((t,e)=>{"object"==typeof exports&&"object"==typeof module?module.exports=t.pdfjsLib=e():"function"==typeof define&&define.amd?define("pdfjs-dist/build/pdf",[],()=>t.pdfjsLib=e()):"object"==typeof exports?exports["pdfjs-dist/build/pdf"]=t.pdfjsLib=e():t["pdfjs-dist/build/pdf"]=t.pdfjsLib=e()})(globalThis,()=>(()=>{var __webpack_modules__=[,(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.VerbosityLevel=e.Util=e.UnknownErrorException=e.UnexpectedResponseException=e.TextRenderingMode=e.RenderingIntentFlag=e.PromiseCapability=e.PermissionFlag=e.PasswordResponses=e.PasswordException=e.PageActionEventType=e.OPS=e.MissingPDFException=e.MAX_IMAGE_SIZE_TO_CACHE=e.LINE_FACTOR=e.LINE_DESCENT_FACTOR=e.InvalidPDFException=e.ImageKind=e.IDENTITY_MATRIX=e.FormatError=e.FeatureTest=e.FONT_IDENTITY_MATRIX=e.DocumentActionEventType=e.CMapCompressionType=e.BaseException=e.BASELINE_FACTOR=e.AnnotationType=e.AnnotationReplyType=e.AnnotationPrefix=e.AnnotationMode=e.AnnotationFlag=e.AnnotationFieldFlag=e.AnnotationEditorType=e.AnnotationEditorPrefix=e.AnnotationEditorParamsType=e.AnnotationBorderStyleType=e.AnnotationActionEventType=e.AbortException=void 0,e.assert=function(t,e){t||a(e)},e.bytesToString=h,e.createValidAbsoluteUrl=function(e){let t=1{switch(t?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return 1;default:return}})(i))return i}catch{}return null},e.getModificationDate=function(){var t=0=i.INFOS&&console.log("Info: "+t)},e.isArrayBuffer=function(t){return"object"==typeof t&&void 0!==t?.byteLength},e.isArrayEqual=function(r,i){if(r.length!==i.length)return!1;for(let t=0,e=r.length;te?e.normalize("NFKC"):g.get(r))},e.objectFromMap=function(t){var e,r,i=Object.create(null);for([e,r]of t)i[e]=r;return i},e.objectSize=function(t){return Object.keys(t).length},e.setVerbosityLevel=function(t){Number.isInteger(t)&&(s=t)},e.shadow=o,e.string32=function(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,255&t)},e.stringToBytes=d,e.stringToPDFString=function(r){if("ï"<=r[0]){let t;if("þ"===r[0]&&"ÿ"===r[1]?t="utf-16be":"ÿ"===r[0]&&"þ"===r[1]?t="utf-16le":"ï"===r[0]&&"»"===r[1]&&"¿"===r[2]&&(t="utf-8"),t)try{var e=new TextDecoder(t,{fatal:!0}),i=d(r);return e.decode(i)}catch(r){n(`stringToPDFString: "${r}".`)}}var s=[];for(let t=0,e=r.length;t=i.WARNINGS&&console.log("Warning: "+t)}function a(t){throw new Error(t)}function o(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!(3{try{return new Function(""),!0}catch{return!1}})())}static get isOffscreenCanvasSupported(){return o(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}static get platform(){return"undefined"==typeof navigator?o(this,"platform",{isWin:!1,isMac:!1}):o(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}static get isCSSRoundSupported(){return o(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}};let c=[...Array(256).keys()].map(t=>t.toString(16).padStart(2,"0")),u=(e.Util=class{static makeHexColor(t,e,r){return"#"+c[t]+c[e]+c[r]}static scaleMinMax(t,e){let r;t[0]?(t[0]<0&&(r=e[0],e[0]=e[1],e[1]=r),e[0]*=t[0],e[1]*=t[0],t[3]<0&&(r=e[2],e[2]=e[3],e[3]=r),e[2]*=t[3],e[3]*=t[3]):(r=e[0],e[0]=e[2],e[2]=r,r=e[1],e[1]=e[3],e[3]=r,t[1]<0&&(r=e[2],e[2]=e[3],e[3]=r),e[2]*=t[1],e[3]*=t[1],t[2]<0&&(r=e[0],e[0]=e[1],e[1]=r),e[0]*=t[2],e[1]*=t[2]),e[0]+=t[4],e[1]+=t[4],e[2]+=t[5],e[3]+=t[5]}static transform(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}static applyTransform(t,e){return[t[0]*e[0]+t[1]*e[2]+e[4],t[0]*e[1]+t[1]*e[3]+e[5]]}static applyInverseTransform(t,e){var r=e[0]*e[3]-e[1]*e[2];return[(t[0]*e[3]-t[1]*e[2]+e[2]*e[5]-e[4]*e[3])/r,(-t[0]*e[1]+t[1]*e[0]+e[4]*e[1]-e[5]*e[0])/r]}static getAxialAlignedBoundingBox(t,e){var r=this.applyTransform(t,e),i=this.applyTransform(t.slice(2,4),e),s=this.applyTransform([t[0],t[3]],e),t=this.applyTransform([t[2],t[1]],e);return[Math.min(r[0],i[0],s[0],t[0]),Math.min(r[1],i[1],s[1],t[1]),Math.max(r[0],i[0],s[0],t[0]),Math.max(r[1],i[1],s[1],t[1])]}static inverseTransform(t){var e=t[0]*t[3]-t[1]*t[2];return[t[3]/e,-t[1]/e,-t[2]/e,t[0]/e,(t[2]*t[5]-t[4]*t[3])/e,(t[4]*t[1]-t[5]*t[0])/e]}static singularValueDecompose2dScale(t){var e=[t[0],t[2],t[1],t[3]],r=t[0]*e[0]+t[1]*e[2],i=t[2]*e[1]+t[3]*e[3],s=(r+i)/2,r=Math.sqrt((r+i)**2-4*(r*i-(t[2]*e[0]+t[3]*e[2])*(t[0]*e[1]+t[1]*e[3])))/2,i=s-r||1;return[Math.sqrt(s+r||1),Math.sqrt(i)]}static normalizeRect(t){var e=t.slice(0);return t[0]>t[2]&&(e[0]=t[2],e[2]=t[0]),t[3]{this.resolve=t=>{this.#t=!0,e(t)},this.reject=t=>{this.#t=!0,r(t)}})}get settled(){return this.#t}};let f=null,g=null;e.AnnotationPrefix="pdfjs_internal_id_"},(t,e,r)=>{function i(t,e){var r={};r[t]=l(t,e,c),a({global:!0,constructor:!0,arity:1,forced:c},r)}function s(t,e){var r;d&&d[t]&&((r={})[t]=l(h+"."+t,e,c),a({target:h,stat:!0,constructor:!0,arity:1,forced:c},r))}var a=r(3),n=r(4),o=r(69),l=r(70),h="WebAssembly",d=n[h],c=7!==Error("e",{cause:7}).cause;i("Error",function(e){return function(t){return o(e,this,arguments)}}),i("EvalError",function(e){return function(t){return o(e,this,arguments)}}),i("RangeError",function(e){return function(t){return o(e,this,arguments)}}),i("ReferenceError",function(e){return function(t){return o(e,this,arguments)}}),i("SyntaxError",function(e){return function(t){return o(e,this,arguments)}}),i("TypeError",function(e){return function(t){return o(e,this,arguments)}}),i("URIError",function(e){return function(t){return o(e,this,arguments)}}),s("CompileError",function(e){return function(t){return o(e,this,arguments)}}),s("LinkError",function(e){return function(t){return o(e,this,arguments)}}),s("RuntimeError",function(e){return function(t){return o(e,this,arguments)}})},(t,e,r)=>{var h=r(4),d=r(5).f,c=r(44),u=r(48),p=r(38),f=r(56),g=r(68);t.exports=function(t,e){var r,i,s,a,n=t.target,o=t.global,l=t.stat;if(r=o?h:l?h[n]||p(n,{}):(h[n]||{}).prototype)for(i in e){if(s=e[i],a=t.dontCallGetSet?(a=d(r,i))&&a.value:r[i],!g(o?i:n+(l?".":"#")+i,t.forced)&&void 0!==a){if(typeof s==typeof a)continue;f(s,a)}(t.sham||a&&a.sham)&&c(s,"sham",!0),u(r,i,s,t)}}},function(t){function e(t){return t&&t.Math===Math&&t}t.exports=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof global&&global)||function(){return this}()||this||Function("return this")()},(t,e,r)=>{var i=r(6),s=r(8),a=r(10),n=r(11),o=r(12),l=r(18),h=r(39),d=r(42),c=Object.getOwnPropertyDescriptor;e.f=i?c:function(t,e){if(t=o(t),e=l(e),d)try{return c(t,e)}catch(t){}if(h(t,e))return n(!s(a.f,t,e),t[e])}},(t,e,r)=>{r=r(7);t.exports=!r(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})},t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},(t,e,r)=>{var r=r(9),i=Function.prototype.call;t.exports=r?i.bind(i):function(){return i.apply(i,arguments)}},(t,e,r)=>{r=r(7);t.exports=!r(function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})},(t,e)=>{var r={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,s=i&&!r.call({1:2},1);e.f=s?function(t){t=i(this,t);return!!t&&t.enumerable}:r},t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},(t,e,r)=>{var i=r(13),s=r(16);t.exports=function(t){return i(s(t))}},(t,e,r)=>{var i=r(14),s=r(7),a=r(15),n=Object,o=i("".split);t.exports=s(function(){return!n("z").propertyIsEnumerable(0)})?function(t){return"String"===a(t)?o(t,""):n(t)}:n},(t,e,r)=>{var r=r(9),i=Function.prototype,s=i.call,i=r&&i.bind.bind(s,s);t.exports=r?i:function(t){return function(){return s.apply(t,arguments)}}},(t,e,r)=>{var r=r(14),i=r({}.toString),s=r("".slice);t.exports=function(t){return s(i(t),8,-1)}},(t,e,r)=>{var i=r(17),s=TypeError;t.exports=function(t){if(i(t))throw s("Can't call method on "+t);return t}},t=>{t.exports=function(t){return null==t}},(t,e,r)=>{var i=r(19),s=r(23);t.exports=function(t){t=i(t,"string");return s(t)?t:t+""}},(t,e,r)=>{var i=r(8),s=r(20),a=r(23),n=r(30),o=r(33),r=r(34),l=TypeError,h=r("toPrimitive");t.exports=function(t,e){if(!s(t)||a(t))return t;var r=n(t,h);if(r){if(r=i(r,t,e=void 0===e?"default":e),!s(r)||a(r))return r;throw l("Can't convert object to primitive value")}return o(t,e=void 0===e?"number":e)}},(t,e,r)=>{var i=r(21),r=r(22),s=r.all;t.exports=r.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:i(t)||t===s}:function(t){return"object"==typeof t?null!==t:i(t)}},(t,e,r)=>{var r=r(22),i=r.all;t.exports=r.IS_HTMLDDA?function(t){return"function"==typeof t||t===i}:function(t){return"function"==typeof t}},t=>{var e="object"==typeof document&&document.all;t.exports={all:e,IS_HTMLDDA:void 0===e&&void 0!==e}},(t,e,r)=>{var i=r(24),s=r(21),a=r(25),r=r(26),n=Object;t.exports=r?function(t){return"symbol"==typeof t}:function(t){var e=i("Symbol");return s(e)&&a(e.prototype,n(t))}},(t,e,r)=>{var i=r(4),s=r(21);t.exports=function(t,e){return arguments.length<2?(r=i[t],s(r)?r:void 0):i[t]&&i[t][e];var r}},(t,e,r)=>{r=r(14);t.exports=r({}.isPrototypeOf)},(t,e,r)=>{r=r(27);t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},(t,e,r)=>{var i=r(28),s=r(7),a=r(4).String;t.exports=!!Object.getOwnPropertySymbols&&!s(function(){var t=Symbol("symbol detection");return!a(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&i&&i<41})},(t,e,r)=>{var i,s,a=r(4),r=r(29),n=a.process,a=a.Deno,n=n&&n.versions||a&&a.version,a=n&&n.v8;!(s=a?0<(i=a.split("."))[0]&&i[0]<4?1:+(i[0]+i[1]):s)&&r&&(!(i=r.match(/Edge\/(\d+)/))||74<=i[1])&&(i=r.match(/Chrome\/(\d+)/))&&(s=+i[1]),t.exports=s},t=>{t.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},(t,e,r)=>{var i=r(31),s=r(17);t.exports=function(t,e){t=t[e];return s(t)?void 0:i(t)}},(t,e,r)=>{var i=r(21),s=r(32),a=TypeError;t.exports=function(t){if(i(t))return t;throw a(s(t)+" is not a function")}},t=>{var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},(t,e,r)=>{var s=r(8),a=r(21),n=r(20),o=TypeError;t.exports=function(t,e){var r,i;if("string"===e&&a(r=t.toString)&&!n(i=s(r,t)))return i;if(a(r=t.valueOf)&&!n(i=s(r,t)))return i;if("string"!==e&&a(r=t.toString)&&!n(i=s(r,t)))return i;throw o("Can't convert object to primitive value")}},(t,e,r)=>{var i=r(4),s=r(35),a=r(39),n=r(41),o=r(27),r=r(26),l=i.Symbol,h=s("wks"),d=r?l.for||l:l&&l.withoutSetter||n;t.exports=function(t){return a(h,t)||(h[t]=o&&a(l,t)?l[t]:d("Symbol."+t)),h[t]}},(t,e,r)=>{var i=r(36),s=r(37);(t.exports=function(t,e){return s[t]||(s[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.32.2",mode:i?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.32.2/LICENSE",source:"https://github.com/zloirock/core-js"})},t=>{t.exports=!1},(t,e,r)=>{var i=r(4),r=r(38),s="__core-js_shared__",i=i[s]||r(s,{});t.exports=i},(t,e,r)=>{var i=r(4),s=Object.defineProperty;t.exports=function(e,r){try{s(i,e,{value:r,configurable:!0,writable:!0})}catch(t){i[e]=r}return r}},(t,e,r)=>{var i=r(14),s=r(40),a=i({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return a(s(t),e)}},(t,e,r)=>{var i=r(16),s=Object;t.exports=function(t){return s(i(t))}},(t,e,r)=>{var r=r(14),i=0,s=Math.random(),a=r(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+a(++i+s,36)}},(t,e,r)=>{var i=r(6),s=r(7),a=r(43);t.exports=!i&&!s(function(){return 7!==Object.defineProperty(a("div"),"a",{get:function(){return 7}}).a})},(t,e,r)=>{var i=r(4),r=r(20),s=i.document,a=r(s)&&r(s.createElement);t.exports=function(t){return a?s.createElement(t):{}}},(t,e,r)=>{var i=r(6),s=r(45),a=r(11);t.exports=i?function(t,e,r){return s.f(t,e,a(1,r))}:function(t,e,r){return t[e]=r,t}},(t,e,r)=>{var i=r(6),s=r(42),a=r(46),n=r(47),o=r(18),l=TypeError,h=Object.defineProperty,d=Object.getOwnPropertyDescriptor,c="enumerable",u="configurable",p="writable";e.f=i?a?function(t,e,r){var i;return n(t),e=o(e),n(r),"function"==typeof t&&"prototype"===e&&"value"in r&&p in r&&!r[p]&&(i=d(t,e))&&i[p]&&(t[e]=r.value,r={configurable:(u in r?r:i)[u],enumerable:(c in r?r:i)[c],writable:!1}),h(t,e,r)}:h:function(t,e,r){if(n(t),e=o(e),n(r),s)try{return h(t,e,r)}catch(t){}if("get"in r||"set"in r)throw l("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},(t,e,r)=>{var i=r(6),r=r(7);t.exports=i&&r(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})},(t,e,r)=>{var i=r(20),s=String,a=TypeError;t.exports=function(t){if(i(t))return t;throw a(s(t)+" is not an object")}},(t,e,r)=>{var n=r(21),o=r(45),l=r(49),h=r(38);t.exports=function(t,e,r,i){var s=(i=i||{}).enumerable,a=void 0!==i.name?i.name:e;if(n(r)&&l(r,a,i),i.global)s?t[e]=r:h(e,r);else{try{i.unsafe?t[e]&&(s=!0):delete t[e]}catch(t){}s?t[e]=r:o.f(t,e,{value:r,enumerable:!1,configurable:!i.nonConfigurable,writable:!i.nonWritable})}return t}},(t,e,r)=>{var i=r(14),s=r(7),a=r(21),n=r(39),o=r(6),l=r(50).CONFIGURABLE,h=r(51),r=r(52),d=r.enforce,c=r.get,u=String,p=Object.defineProperty,f=i("".slice),g=i("".replace),m=i([].join),v=o&&!s(function(){return 8!==p(function(){},"length",{value:8}).length}),_=String(String).split("String"),r=t.exports=function(t,e,r){"Symbol("===f(u(e),0,7)&&(e="["+g(u(e),/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!n(t,"name")||l&&t.name!==e)&&(o?p(t,"name",{value:e,configurable:!0}):t.name=e),v&&r&&n(r,"arity")&&t.length!==r.arity&&p(t,"length",{value:r.arity});try{r&&n(r,"constructor")&&r.constructor?o&&p(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}r=d(t);return n(r,"source")||(r.source=m(_,"string"==typeof e?e:"")),t};Function.prototype.toString=r(function(){return a(this)&&c(this).source||h(this)},"toString")},(t,e,r)=>{var i=r(6),r=r(39),s=Function.prototype,a=i&&Object.getOwnPropertyDescriptor,r=r(s,"name"),n=r&&"something"===function(){}.name,i=r&&(!i||a(s,"name").configurable);t.exports={EXISTS:r,PROPER:n,CONFIGURABLE:i}},(t,e,r)=>{var i=r(14),s=r(21),r=r(37),a=i(Function.toString);s(r.inspectSource)||(r.inspectSource=function(t){return a(t)}),t.exports=r.inspectSource},(t,e,r)=>{var i,s,a,n,o=r(53),l=r(4),h=r(20),d=r(44),c=r(39),u=r(37),p=r(54),r=r(55),f="Object already initialized",g=l.TypeError,l=l.WeakMap,m=o||u.state?((a=u.state||(u.state=new l)).get=a.get,a.has=a.has,a.set=a.set,i=function(t,e){if(a.has(t))throw g(f);return e.facade=t,a.set(t,e),e},s=function(t){return a.get(t)||{}},function(t){return a.has(t)}):(r[n=p("state")]=!0,i=function(t,e){if(c(t,n))throw g(f);return e.facade=t,d(t,n,e),e},s=function(t){return c(t,n)?t[n]:{}},function(t){return c(t,n)});t.exports={set:i,get:s,has:m,enforce:function(t){return m(t)?s(t):i(t,{})},getterFor:function(e){return function(t){if(h(t)&&(t=s(t)).type===e)return t;throw g("Incompatible receiver, "+e+" required")}}}},(t,e,r)=>{var i=r(4),r=r(21),i=i.WeakMap;t.exports=r(i)&&/native code/.test(String(i))},(t,e,r)=>{var i=r(35),s=r(41),a=i("keys");t.exports=function(t){return a[t]||(a[t]=s(t))}},t=>{t.exports={}},(t,e,r)=>{var l=r(39),h=r(57),d=r(5),c=r(45);t.exports=function(t,e,r){for(var i=h(e),s=c.f,a=d.f,n=0;n{var i=r(24),s=r(14),a=r(58),n=r(67),o=r(47),l=s([].concat);t.exports=i("Reflect","ownKeys")||function(t){var e=a.f(o(t)),r=n.f;return r?l(e,r(t)):e}},(t,e,r)=>{var i=r(59),s=r(66).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return i(t,s)}},(t,e,r)=>{var i=r(14),n=r(39),o=r(12),l=r(60).indexOf,h=r(55),d=i([].push);t.exports=function(t,e){var r,i=o(t),s=0,a=[];for(r in i)!n(h,r)&&n(i,r)&&d(a,r);for(;e.length>s;)!n(i,r=e[s++])||~l(a,r)||d(a,r);return a}},(t,e,r)=>{function i(o){return function(t,e,r){var i,s=l(t),a=d(s),n=h(r,a);if(o&&e!=e){for(;n{var i=r(62),s=Math.max,a=Math.min;t.exports=function(t,e){t=i(t);return t<0?s(t+e,0):a(t,e)}},(t,e,r)=>{var i=r(63);t.exports=function(t){t=+t;return t!=t||0==t?0:i(t)}},t=>{var e=Math.ceil,r=Math.floor;t.exports=Math.trunc||function(t){t=+t;return(0{var i=r(65);t.exports=function(t){return i(t.length)}},(t,e,r)=>{var i=r(62),s=Math.min;t.exports=function(t){return 0{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},(t,e)=>{e.f=Object.getOwnPropertySymbols},(t,e,r)=>{function i(t,e){return(t=l[o(t)])===d||t!==h&&(a(e)?s(e):!!e)}var s=r(7),a=r(21),n=/#|\.prototype\./,o=i.normalize=function(t){return String(t).replace(n,".").toLowerCase()},l=i.data={},h=i.NATIVE="N",d=i.POLYFILL="P";t.exports=i},(t,e,r)=>{var r=r(9),i=Function.prototype,s=i.apply,a=i.call;t.exports="object"==typeof Reflect&&Reflect.apply||(r?a.bind(s):function(){return a.apply(s,arguments)})},(t,e,r)=>{var c=r(24),u=r(39),p=r(44),f=r(25),g=r(71),m=r(56),v=r(74),_=r(75),b=r(76),y=r(80),A=r(81),S=r(6),x=r(36);t.exports=function(t,e,r,i){var s="stackTraceLimit",a=i?2:1,n=t.split("."),o=n[n.length-1],l=c.apply(null,n);if(l){var h=l.prototype;if(!x&&u(h,"cause")&&delete h.cause,!r)return l;var n=c("Error"),d=e(function(t,e){e=b(i?e:t,void 0),t=i?new l(t):new l;return void 0!==e&&p(t,"message",e),A(t,d,t.stack,2),this&&f(h,this)&&_(t,this,d),a{var s=r(72),a=r(47),n=r(73);t.exports=Object.setPrototypeOf||("__proto__"in{}?(()=>{var r,i=!1,t={};try{(r=s(Object.prototype,"__proto__","set"))(t,[]),i=t instanceof Array}catch(r){}return function(t,e){return a(t),n(e),i?r(t,e):t.__proto__=e,t}})():void 0)},(t,e,r)=>{var i=r(14),s=r(31);t.exports=function(t,e,r){try{return i(s(Object.getOwnPropertyDescriptor(t,e)[r]))}catch(t){}}},(t,e,r)=>{var i=r(21),s=String,a=TypeError;t.exports=function(t){if("object"==typeof t||i(t))return t;throw a("Can't set "+s(t)+" as a prototype")}},(t,e,r)=>{var i=r(45).f;t.exports=function(t,e,r){r in t||i(t,r,{configurable:!0,get:function(){return e[r]},set:function(t){e[r]=t}})}},(t,e,r)=>{var i=r(21),s=r(20),a=r(71);t.exports=function(t,e,r){return a&&i(e=e.constructor)&&e!==r&&s(e=e.prototype)&&e!==r.prototype&&a(t,e),t}},(t,e,r)=>{var i=r(77);t.exports=function(t,e){return void 0===t?arguments.length<2?"":e:i(t)}},(t,e,r)=>{var i=r(78),s=String;t.exports=function(t){if("Symbol"===i(t))throw TypeError("Cannot convert a Symbol value to a string");return s(t)}},(t,e,r)=>{var i=r(79),s=r(21),a=r(15),n=r(34)("toStringTag"),o=Object,l="Arguments"===a(function(){return arguments}());t.exports=i?a:function(t){var e;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(e=((t,e)=>{try{return t[e]}catch(t){}})(t=o(t),n))?e:l?a(t):"Object"===(e=a(t))&&s(t.callee)?"Arguments":e}},(t,e,r)=>{var i={};i[r(34)("toStringTag")]="z",t.exports="[object z]"===String(i)},(t,e,r)=>{var i=r(20),s=r(44);t.exports=function(t,e){i(e)&&"cause"in e&&s(t,"cause",e.cause)}},(t,e,r)=>{var s=r(44),a=r(82),n=r(83),o=Error.captureStackTrace;t.exports=function(t,e,r,i){n&&(o?o(t,e):s(t,"stack",a(r,i)))}},(t,e,r)=>{var r=r(14),i=Error,s=r("".replace),r=String(i("zxcasd").stack),a=/\n\s*at [^:]*:[^\n]*/,n=a.test(r);t.exports=function(t,e){if(n&&"string"==typeof t&&!i.prepareStackTrace)for(;e--;)t=s(t,a,"");return t}},(t,e,r)=>{var i=r(7),s=r(11);t.exports=!i(function(){var t=Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",s(1,7)),7!==t.stack)})},(t,e,r)=>{var i=r(48),s=r(14),c=r(77),u=r(85),r=URLSearchParams,a=r.prototype,p=s(a.append),f=s(a.delete),g=s(a.forEach),m=s([].push),s=new r("a=1&a=2&b=3");s.delete("a",1),s.delete("b",void 0),s+""!="a=2"&&i(a,"delete",function(t){var e=arguments.length,r=e<2?void 0:arguments[1];if(e&&void 0===r)return f(this,t);var i=[];g(this,function(t,e){m(i,{key:e,value:t})}),u(e,1);for(var s,a=c(t),n=c(r),o=0,l=0,h=!1,d=i.length;o{var r=TypeError;t.exports=function(t,e){if(t{var i=r(48),s=r(14),n=r(77),o=r(85),r=URLSearchParams,a=r.prototype,l=s(a.getAll),h=s(a.has),s=new r("a=1");!s.has("a",2)&&s.has("a",void 0)||i(a,"has",function(t){var e=arguments.length,r=e<2?void 0:arguments[1];if(e&&void 0===r)return h(this,t);var i=l(this,t);o(e,1);for(var s=n(r),a=0;a{var i=r(6),s=r(14),r=r(88),a=URLSearchParams.prototype,n=s(a.forEach);!i||"size"in a||r(a,"size",{get:function(){var t=0;return n(this,function(){t++}),t},configurable:!0,enumerable:!0})},(t,e,r)=>{var i=r(49),s=r(45);t.exports=function(t,e,r){return r.get&&i(r.get,e,{getter:!0}),r.set&&i(r.set,e,{setter:!0}),s.f(t,e,r)}},(t,e,r)=>{var i=r(3),a=r(40),n=r(64),o=r(90),l=r(92);i({target:"Array",proto:!0,arity:1,forced:r(7)(function(){return 4294967297!==[].push.call({length:4294967296},1)})||!(()=>{try{Object.defineProperty([],"length",{writable:!1}).push()}catch(t){return t instanceof TypeError}})()},{push:function(t){var e=a(this),r=n(e),i=arguments.length;l(r+i);for(var s=0;s{var i=r(6),s=r(91),a=TypeError,n=Object.getOwnPropertyDescriptor,r=i&&!function(){if(void 0!==this)return 1;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();t.exports=r?function(t,e){if(s(t)&&!n(t,"length").writable)throw a("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e}},(t,e,r)=>{var i=r(15);t.exports=Array.isArray||function(t){return"Array"===i(t)}},t=>{var e=TypeError;t.exports=function(t){if(9007199254740991{var i=r(94),s=r(98).findLast,a=i.aTypedArray;(0,i.exportTypedArrayMethod)("findLast",function(t){return s(a(this),t,1{function i(t){var e,t=y(t);if(u(t))return(e=E(t))&&p(e,F)?e[F]:i(t)}function s(t){return!!u(t)&&(t=f(t),p(I,t)||p(O,t))}var a,n,o,l=r(95),h=r(6),d=r(4),c=r(21),u=r(20),p=r(39),f=r(78),g=r(32),m=r(44),v=r(48),_=r(88),b=r(25),y=r(96),A=r(71),S=r(34),x=r(41),r=r(52),w=r.enforce,E=r.get,r=d.Int8Array,T=r&&r.prototype,C=d.Uint8ClampedArray,C=C&&C.prototype,P=r&&y(r),k=T&&y(T),r=Object.prototype,M=d.TypeError,S=S("toStringTag"),R=x("TYPED_ARRAY_TAG"),F="TypedArrayConstructor",D=l&&!!A&&"Opera"!==f(d.opera),x=!1,I={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},O={BigInt64Array:8,BigUint64Array:8};for(a in I)(o=(n=d[a])&&n.prototype)?w(o)[F]=n:D=!1;for(a in O)(o=(n=d[a])&&n.prototype)&&(w(o)[F]=n);if((!D||!c(P)||P===Function.prototype)&&(P=function(){throw M("Incorrect invocation")},D))for(a in I)d[a]&&A(d[a],P);if((!D||!k||k===r)&&(k=P.prototype,D))for(a in I)d[a]&&A(d[a].prototype,k);if(D&&y(C)!==k&&A(C,k),h&&!p(k,S))for(a in _(k,S,{configurable:x=!0,get:function(){return u(this)?this[R]:void 0}}),I)d[a]&&m(d[a],R,a);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:D,TYPED_ARRAY_TAG:x&&R,aTypedArray:function(t){if(s(t))return t;throw M("Target is not a typed array")},aTypedArrayConstructor:function(t){if(!c(t)||A&&!b(P,t))throw M(g(t)+" is not a typed array constructor");return t},exportTypedArrayMethod:function(t,e,r,i){if(h){if(r)for(var s in I){s=d[s];if(s&&p(s.prototype,t))try{delete s.prototype[t]}catch(r){try{s.prototype[t]=e}catch(t){}}}k[t]&&!r||v(k,t,!r&&D&&T[t]||e,i)}},exportTypedArrayStaticMethod:function(t,e,r){var i,s;if(h){if(A){if(r)for(i in I)if((s=d[i])&&p(s,t))try{delete s[t]}catch(t){}if(P[t]&&!r)return;try{return v(P,t,!r&&D&&P[t]||e)}catch(t){}}for(i in I)!(s=d[i])||s[t]&&!r||v(s,t,e)}},getTypedArrayConstructor:i,isView:function(t){return!!u(t)&&("DataView"===(t=f(t))||p(I,t)||p(O,t))},isTypedArray:s,TypedArray:P,TypedArrayPrototype:k}},t=>{t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},(t,e,r)=>{var i=r(39),s=r(21),a=r(40),n=r(54),r=r(97),o=n("IE_PROTO"),l=Object,h=l.prototype;t.exports=r?l.getPrototypeOf:function(t){var e,t=a(t);return i(t,o)?t[o]:(e=t.constructor,s(e)&&t instanceof e?e.prototype:t instanceof l?h:null)}},(t,e,r)=>{r=r(7);t.exports=!r(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})},(t,e,r)=>{function i(l){var h=1===l;return function(t,e,r){for(var i,s=u(t),a=c(s),n=d(e,r),o=p(a);0{var i=r(100),s=r(31),a=r(9),n=i(i.bind);t.exports=function(t,e){return s(t),void 0===e?t:a?n(t,e):function(){return t.apply(e,arguments)}}},(t,e,r)=>{var i=r(15),s=r(14);t.exports=function(t){if("Function"===i(t))return s(t)}},(t,e,r)=>{var i=r(94),s=r(98).findLastIndex,a=i.aTypedArray;(0,i.exportTypedArrayMethod)("findLastIndex",function(t){return s(a(this),t,1{var i=r(4),a=r(8),s=r(94),n=r(64),o=r(103),l=r(40),r=r(7),h=i.RangeError,d=i.Int8Array,i=d&&d.prototype,c=i&&i.set,u=s.aTypedArray,i=s.exportTypedArrayMethod,p=!r(function(){var t=new Uint8ClampedArray(2);return a(c,t,{length:1,0:3},1),3!==t[1]}),s=p&&s.NATIVE_ARRAY_BUFFER_VIEWS&&r(function(){var t=new d(2);return t.set(1),t.set("2",1),0!==t[0]||2!==t[1]});i("set",function(t){u(this);var e=o(1{var i=r(104),s=RangeError;t.exports=function(t,e){t=i(t);if(t%e)throw s("Wrong offset");return t}},(t,e,r)=>{var i=r(62),s=RangeError;t.exports=function(t){t=i(t);if(t<0)throw s("The argument can't be less than 0");return t}},(t,e,r)=>{var i=r(106),r=r(94),s=r.aTypedArray,a=r.exportTypedArrayMethod,n=r.getTypedArrayConstructor;a("toReversed",function(){return i(s(this),n(this))})},(t,e,r)=>{var a=r(64);t.exports=function(t,e){for(var r=a(t),i=new e(r),s=0;s{var i=r(94),s=r(14),a=r(31),n=r(108),o=i.aTypedArray,l=i.getTypedArrayConstructor,r=i.exportTypedArrayMethod,h=s(i.TypedArrayPrototype.sort);r("toSorted",function(t){void 0!==t&&a(t);var e=o(this),e=n(l(e),e);return h(e,t)})},(t,e,r)=>{var a=r(64);t.exports=function(t,e){for(var r=0,i=a(e),s=new t(i);r{var i=r(110),s=r(94),a=r(111),n=r(62),o=r(112),l=s.aTypedArray,h=s.getTypedArrayConstructor;(0,s.exportTypedArrayMethod)("with",function(t,e){var r=l(this),t=n(t),e=a(r)?o(e):+e;return i(r,h(r),t,e)},!!!(()=>{try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(t){return 8===t}})())},(t,e,r)=>{var l=r(64),h=r(62),d=RangeError;t.exports=function(t,e,r,i){var s=l(t),r=h(r),a=r<0?s+r:r;if(s<=a||a<0)throw d("Incorrect index");for(var n=new e(s),o=0;o{var i=r(78);t.exports=function(t){t=i(t);return"BigInt64Array"===t||"BigUint64Array"===t}},(t,e,r)=>{var i=r(19),s=TypeError;t.exports=function(t){t=i(t,"number");if("number"==typeof t)throw s("Can't convert number to bigint");return BigInt(t)}},(t,e,r)=>{var i=r(6),s=r(88),a=r(114),r=ArrayBuffer.prototype;!i||"detached"in r||s(r,"detached",{configurable:!0,get:function(){return a(this)}})},(t,e,r)=>{var i=r(14),s=r(115),a=i(ArrayBuffer.prototype.slice);t.exports=function(t){if(0!==s(t))return!1;try{return a(t,0,0),!1}catch(t){return!0}}},(t,e,r)=>{var i=r(72),s=r(15),a=TypeError;t.exports=i(ArrayBuffer.prototype,"byteLength","get")||function(t){if("ArrayBuffer"!==s(t))throw a("ArrayBuffer expected");return t.byteLength}},(t,e,r)=>{var i=r(3),s=r(117);s&&i({target:"ArrayBuffer",proto:!0},{transfer:function(){return s(this,arguments.length?arguments[0]:void 0,!0)}})},(t,e,r)=>{var i=r(4),s=r(14),a=r(72),h=r(118),d=r(114),c=r(115),r=r(119),u=i.TypeError,p=i.structuredClone,f=i.ArrayBuffer,g=i.DataView,m=Math.min,i=f.prototype,n=g.prototype,v=s(i.slice),_=a(i,"resizable","get"),b=a(i,"maxByteLength","get"),y=s(n.getInt8),A=s(n.setInt8);t.exports=r&&function(t,e,r){var i=c(t),e=void 0===e?i:h(e),s=!_||!_(t);if(d(t))throw u("ArrayBuffer is detached");t=p(t,{transfer:[t]});if(i===e&&(r||s))return t;if(e<=i&&(!r||s))return v(t,0,e);for(var r=r&&!s&&b?{maxByteLength:b(t)}:void 0,s=new f(e,r),a=new g(t),n=new g(s),o=m(e,i),l=0;l{var i=r(62),s=r(65),a=RangeError;t.exports=function(t){if(void 0===t)return 0;var t=i(t),e=s(t);if(t!==e)throw a("Wrong length or index");return e}},(t,e,r)=>{var i=r(4),s=r(7),a=r(28),n=r(120),o=r(121),l=r(122),h=i.structuredClone;t.exports=!!h&&!s(function(){var t,e;return!(o&&92{var i=r(121),r=r(122);t.exports=!i&&!r&&"object"==typeof window&&"object"==typeof document},t=>{t.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},(t,e,r)=>{var i=r(4),r=r(15);t.exports="process"===r(i.process)},(t,e,r)=>{var i=r(3),s=r(117);s&&i({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return s(this,arguments.length?arguments[0]:void 0,!1)}})},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{Object.defineProperty(exports,"__esModule",{value:!0}),exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultFilterFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0,Object.defineProperty(exports,"SVGGraphics",{enumerable:!0,get:function(){return _displaySvg.SVGGraphics}}),exports.build=void 0,exports.getDocument=getDocument,exports.version=void 0,__w_pdfjs_require__(84),__w_pdfjs_require__(86),__w_pdfjs_require__(87),__w_pdfjs_require__(2),__w_pdfjs_require__(93),__w_pdfjs_require__(101),__w_pdfjs_require__(102),__w_pdfjs_require__(105),__w_pdfjs_require__(107),__w_pdfjs_require__(109),__w_pdfjs_require__(113),__w_pdfjs_require__(116),__w_pdfjs_require__(123),__w_pdfjs_require__(89),__w_pdfjs_require__(125),__w_pdfjs_require__(136),__w_pdfjs_require__(138),__w_pdfjs_require__(141),__w_pdfjs_require__(143),__w_pdfjs_require__(145),__w_pdfjs_require__(147),__w_pdfjs_require__(149),__w_pdfjs_require__(152);var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(163),_display_utils=__w_pdfjs_require__(168),_font_loader=__w_pdfjs_require__(171),_displayNode_utils=__w_pdfjs_require__(172),_canvas=__w_pdfjs_require__(173),_worker_options=__w_pdfjs_require__(176),_message_handler=__w_pdfjs_require__(177),_metadata=__w_pdfjs_require__(178),_optional_content_config=__w_pdfjs_require__(179),_transport_stream=__w_pdfjs_require__(180),_displayFetch_stream=__w_pdfjs_require__(181),_displayNetwork=__w_pdfjs_require__(184),_displayNode_stream=__w_pdfjs_require__(185),_displaySvg=__w_pdfjs_require__(186),_xfa_text=__w_pdfjs_require__(194);let DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DELAYED_CLEANUP_TIMEOUT=5e3,DefaultCanvasFactory=_util.isNodeJS?_displayNode_utils.NodeCanvasFactory:_display_utils.DOMCanvasFactory,DefaultCMapReaderFactory=(exports.DefaultCanvasFactory=DefaultCanvasFactory,_util.isNodeJS?_displayNode_utils.NodeCMapReaderFactory:_display_utils.DOMCMapReaderFactory),DefaultFilterFactory=(exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory,_util.isNodeJS?_displayNode_utils.NodeFilterFactory:_display_utils.DOMFilterFactory),DefaultStandardFontDataFactory=(exports.DefaultFilterFactory=DefaultFilterFactory,_util.isNodeJS?_displayNode_utils.NodeStandardFontDataFactory:_display_utils.DOMStandardFontDataFactory);function getDocument(t){if("string"==typeof t||t instanceof URL?t={url:t}:(0,_util.isArrayBuffer)(t)&&(t={data:t}),"object"!=typeof t)throw new Error("Invalid parameter in getDocument, need parameter object.");if(!t.url&&!t.data&&!t.range)throw new Error("Invalid parameter object: need either .data, .range or .url");let r=new PDFDocumentLoadingTask,i=r.docId,s=t.url?getUrlProp(t.url):null,a=t.data?getDataProp(t.data):null,n=t.httpHeaders||null,o=!0===t.withCredentials,e=t.password??null,l=t.range instanceof PDFDataRangeTransport?t.range:null,h=Number.isInteger(t.rangeChunkSize)&&0{for(var t of this._progressListeners)t(e,r)})}onDataProgressiveRead(e){this._readyCapability.promise.then(()=>{for(var t of this._progressiveReadListeners)t(e)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(var t of this._progressiveDoneListeners)t()})}transportReady(){this._readyCapability.resolve()}requestDataRange(t,e){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(t,e){this._pdfInfo=t,this._transport=e,Object.defineProperty(this,"getJavaScript",{value:()=>((0,_display_utils.deprecated)("`PDFDocumentProxy.getJavaScript`, please use `PDFDocumentProxy.getJSActions` instead."),this.getJSActions().then(t=>{if(!t)return t;var e,r=[];for(e in t)r.push(...t[e]);return r}))})}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(t){return this._transport.getPage(t)}getPageIndex(t){return this._transport.getPageIndex(t)}getDestinations(){return this._transport.getDestinations()}getDestination(t){return this._transport.getDestination(t)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(){return this._transport.startCleanup(0{c.renderTasks.delete(f),(this._maybeCleanupAfterRender||u)&&(this.#i=!0),this.#s(!u),t?(f.capability.reject(t),this._abortOperatorList({intentState:c,reason:t instanceof Error?t:new Error(t)})):f.capability.resolve(),this._stats?.timeEnd("Rendering"),this._stats?.timeEnd("Overall")}),f=new InternalRenderTask({callback:p,params:{canvasContext:e,viewport:r,transform:a,background:n},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:l,operatorList:c.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!u,pdfBug:this._pdfBug,pageColors:h});(c.renderTasks||=new Set).add(f);t=f.task;return Promise.all([c.displayReadyCapability.promise,o]).then(t=>{var[t,e]=t;this.destroyed?p():(this._stats?.time("Rendering"),f.initializeGraphics({transparency:t,optionalContentConfig:e}),f.operatorListChanged())}).catch(p),t}getOperatorList(){var{intent:t="display",annotationMode:e=_util.AnnotationMode.ENABLE,printAnnotationStorage:r=null}=0t.items.length})}getTextContent(){var t=0_xfa_text.XfaText.textContent(t));let r=this.streamTextContent(t);return new Promise(function(i,t){let e=r.getReader(),s={items:[],styles:Object.create(null)};!function r(){e.read().then(function(t){var{value:t,done:e}=t;e?i(s):(Object.assign(s.styles,t.styles),s.items.push(...t.items),r())},t)}()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;var t,e=[];for(t of this._intentStates.values())if(this._abortOperatorList({intentState:t,reason:new Error("Page was destroyed."),force:!0}),!t.opListReadCapability)for(var r of t.renderTasks)e.push(r.completed),r.cancel();return this.objs.clear(),this.#i=!1,this.#r(),Promise.all(e)}cleanup(){var t=0{this.#n=null,this.#s(!1)},DELAYED_CLEANUP_TIMEOUT),!1;for(let{renderTasks:t,operatorList:e}of this._intentStates.values())if(0{a.read().then(t=>{var{value:t,done:e}=t;e?n.streamReader=null:this._transport.destroyed||(this._renderPageChunk(t,n),o())},t=>{if(n.streamReader=null,!this._transport.destroyed){if(n.operatorList){n.operatorList.lastChunk=!0;for(let t of n.renderTasks)t.operatorListChanged();this.#s(!0)}if(n.displayReadyCapability)n.displayReadyCapability.reject(t);else{if(!n.opListReadCapability)throw t;n.opListReadCapability.reject(t)}}})});o()}_abortOperatorList(t){let{intentState:r,reason:e,force:i=!1}=t;if(r.streamReader){if(r.streamReaderCancelTimeout&&(clearTimeout(r.streamReaderCancelTimeout),r.streamReaderCancelTimeout=null),!i){if(0{r.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:r,reason:e,force:!0})},t))}}if(r.streamReader.cancel(new _util.AbortException(e.message)).catch(()=>{}),r.streamReader=null,!this._transport.destroyed){for(let[t,e]of this._intentStates)if(e===r){this._intentStates.delete(t);break}this.cleanup()}}}get stats(){return this._stats}}exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{#a=new Set;#o=Promise.resolve();postMessage(t,e){let r={data:structuredClone(t,null)};this.#o.then(()=>{for(var t of this.#a)t.call(this,r)})}addEventListener(t,e){this.#a.add(e)}removeEventListener(t,e){this.#a.delete(e)}terminate(){this.#a.clear()}}exports.LoopbackPort=LoopbackPort;let PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};if(exports.PDFWorkerUtil=PDFWorkerUtil,_util.isNodeJS&&"function"==typeof require)PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if("object"==typeof document){let t=document?.currentScript?.src;t&&(PDFWorkerUtil.fallbackWorkerSrc=t.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(t,e){let r;try{if(!(r=new URL(t)).origin||"null"===r.origin)return!1}catch{return!1}t=new URL(e,r);return r.origin===t.origin},PDFWorkerUtil.createCDNWrapper=function(t){return URL.createObjectURL(new Blob([`importScripts("${t}");`]))};class PDFWorker{static#l;constructor(){var{name:t=null,port:e=null,verbosity:r=(0,_util.getVerbosityLevel)()}=0{e.removeEventListener("error",s),r.destroy(),e.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},s=()=>{this._webWorker||i()},a=(e.addEventListener("error",s),r.on("test",t=>{e.removeEventListener("error",s),this.destroyed?i():t?(this._messageHandler=r,this._port=e,this._webWorker=e,this._readyCapability.resolve(),r.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),r.destroy(),e.terminate())}),r.on("ready",t=>{if(e.removeEventListener("error",s),this.destroyed)i();else try{a()}catch{this._setupFakeWorker()}}),()=>{var t=new Uint8Array;r.send("test",t,[t.buffer])});return void a()}catch{(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){PDFWorkerUtil.isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),PDFWorkerUtil.isWorkerDisabled=!0),PDFWorker._setupFakeWorkerGlobal.then(t=>{var e,r,i;this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):(e=new LoopbackPort,this._port=e,r="fake"+PDFWorkerUtil.fakeWorkerId++,i=new _message_handler.MessageHandler(r+"_worker",r,e),t.setup(i,e),t=new _message_handler.MessageHandler(r,r+"_worker",e),this._messageHandler=t,this._readyCapability.resolve(),t.send("configure",{verbosity:this.verbosity}))}).catch(t=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${t.message}".`))})}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),PDFWorker.#l?.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(t){if(!t?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");var e=this.#l?.get(t.port);if(e){if(e._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return e}return new PDFWorker(t)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(null!==PDFWorkerUtil.fallbackWorkerSrc)return _util.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){let loader=async()=>{let mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_util.isNodeJS&&"function"==typeof require){let worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}return await(0,_display_utils.loadScript)(this.workerSrc),window.pdfjsWorker.WorkerMessageHandler};return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}}exports.PDFWorker=PDFWorker;class WorkerTransport{#c=new Map;#h=new Map;#d=new Map;#u=null;constructor(t,e,r,i,s){this.messageHandler=t,this.loadingTask=e,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({ownerDocument:i.ownerDocument,styleElement:i.styleElement}),this._params=i,this.canvasFactory=s.canvasFactory,this.filterFactory=s.filterFactory,this.cMapReaderFactory=s.cMapReaderFactory,this.standardFontDataFactory=s.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=r,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=new _util.PromiseCapability,this.setupMessageHandler()}#p(t){var e=1{this.commonObjs.clear(),this.fontLoader.clear(),this.#c.clear(),this.filterFactory.destroy(),this._networkStream?.cancelAllRequests(new _util.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject)}return this.destroyCapability.promise}setupMessageHandler(){let{messageHandler:a,loadingTask:i}=this;a.on("GetReader",(t,r)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=t=>{this._lastProgress={loaded:t.loaded,total:t.total}},r.onPull=()=>{this._fullReader.read().then(function(t){var{value:t,done:e}=t;e?r.close():((0,_util.assert)(t instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),r.enqueue(new Uint8Array(t),1,[t]))}).catch(t=>{r.error(t)})},r.onCancel=t=>{this._fullReader.cancel(t),r.ready.catch(t=>{if(!this.destroyed)throw t})}}),a.on("ReaderHeadersReady",t=>{let e=new _util.PromiseCapability,r=this._fullReader;return r.headersReady.then(()=>{r.isStreamingSupported&&r.isRangeSupported||(this._lastProgress&&i.onProgress?.(this._lastProgress),r.onProgress=t=>{i.onProgress?.({loaded:t.loaded,total:t.total})}),e.resolve({isStreamingSupported:r.isStreamingSupported,isRangeSupported:r.isRangeSupported,contentLength:r.contentLength})},e.reject),e.promise}),a.on("GetRangeReader",(t,r)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");let e=this._networkStream.getRangeReader(t.begin,t.end);e?(r.onPull=()=>{e.read().then(function(t){var{value:t,done:e}=t;e?r.close():((0,_util.assert)(t instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),r.enqueue(new Uint8Array(t),1,[t]))}).catch(t=>{r.error(t)})},r.onCancel=t=>{e.cancel(t),r.ready.catch(t=>{if(!this.destroyed)throw t})}):r.close()}),a.on("GetDoc",t=>{t=t.pdfInfo;this._numPages=t.numPages,this._htmlForXfa=t.htmlForXfa,delete t.htmlForXfa,i._capability.resolve(new PDFDocumentProxy(t,this))}),a.on("DocException",function(t){let e;switch(t.name){case"PasswordException":e=new _util.PasswordException(t.message,t.code);break;case"InvalidPDFException":e=new _util.InvalidPDFException(t.message);break;case"MissingPDFException":e=new _util.MissingPDFException(t.message);break;case"UnexpectedResponseException":e=new _util.UnexpectedResponseException(t.message,t.status);break;case"UnknownErrorException":e=new _util.UnknownErrorException(t.message,t.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}i._capability.reject(e)}),a.on("PasswordRequest",t=>{if(this.#u=new _util.PromiseCapability,i.onPassword){var e=t=>{t instanceof Error?this.#u.reject(t):this.#u.resolve({password:t})};try{i.onPassword(e,t.code)}catch(t){this.#u.reject(t)}}else this.#u.reject(new _util.PasswordException(t.message,t.code));return this.#u.promise}),a.on("DataLoaded",t=>{i.onProgress?.({loaded:t.length,total:t.length}),this.downloadInfoCapability.resolve(t)}),a.on("StartRenderPage",t=>{this.destroyed||this.#h.get(t.pageIndex)._startRenderPage(t.transparency,t.cacheKey)}),a.on("commonobj",t=>{let[i,e,s]=t;if(!this.destroyed&&!this.commonObjs.has(i))switch(e){case"Font":let r=this._params;if("error"in s){let t=s.error;(0,_util.warn)("Error during font loading: "+t),this.commonObjs.resolve(i,t)}else{let t=r.pdfBug&&globalThis.FontInspector?.enabled?(t,e)=>globalThis.FontInspector.fontAdded(t,e):null,e=new _font_loader.FontFaceObject(s,{isEvalSupported:r.isEvalSupported,disableFontFace:r.disableFontFace,ignoreErrors:r.ignoreErrors,inspectFont:t});this.fontLoader.bind(e).catch(t=>a.sendWithPromise("FontFallback",{id:i})).finally(()=>{!r.fontExtraProperties&&e.data&&(e.data=null),this.commonObjs.resolve(i,e)})}break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(i,s);break;default:throw new Error("Got unknown common object type "+e)}}),a.on("obj",t=>{let[e,r,i,s]=t;if(!this.destroyed){var a=this.#h.get(r);if(!a.objs.has(e))switch(i){case"Image":if(a.objs.resolve(e,s),s){let r;if(s.bitmap){let{width:t,height:e}=s;r=t*e*4}else r=s.data?.length||0;r>_util.MAX_IMAGE_SIZE_TO_CACHE&&(a._maybeCleanupAfterRender=!0)}break;case"Pattern":a.objs.resolve(e,s);break;default:throw new Error("Got unknown object type "+i)}}}),a.on("DocProgress",t=>{this.destroyed||i.onProgress?.({loaded:t.loaded,total:t.total})}),a.on("FetchBuiltInCMap",t=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(t):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),a.on("FetchStandardFontData",t=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(t):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");var{map:t,transfers:e}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:t,filename:this._fullReader?.filename??null},e).finally(()=>{this.annotationStorage.resetModified()})}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));let e=t-1,r=this.#d.get(e);return r||(t=this.messageHandler.sendWithPromise("GetPage",{pageIndex:e}).then(t=>{if(this.destroyed)throw new Error("Transport destroyed");t=new PDFPageProxy(e,t,this,this._params.pdfBug);return this.#h.set(e,t),t}),this.#d.set(e,t),t)}getPageIndex(t){return"object"!=typeof t||null===t||!Number.isInteger(t.num)||t.num<0||!Number.isInteger(t.gen)||t.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen})}getAnnotations(t,e){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:e})}getFieldObjects(){return this.#p("GetFieldObjects")}hasJSActions(){return this.#p("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return"string"!=typeof t?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return this.#p("GetDocJSActions")}getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:t})}getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:t})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then(t=>new _optional_content_config.OptionalContentConfig(t))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){var t="GetMetadata",e=this.#c.get(t);return e||(e=this.messageHandler.sendWithPromise(t,null).then(t=>({info:t[0],metadata:t[1]?new _metadata.Metadata(t[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null})),this.#c.set(t,e),e)}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(){let t=0r(t.data)),null}let t=this.#f[e];if(t?.capability.settled)return t.data;throw new Error(`Requesting object that isn't resolved yet ${e}.`)}has(t){return this.#f[t]?.capability.settled||!1}resolve(t){var e=1{this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk)&&(this.gfx.endDrawing(),InternalRenderTask.#b.delete(this._canvas),this.callback()))}}let version="3.11.174",build=(exports.version=version,"ce8716743");exports.build=build},(t,e,r)=>{var i=r(3),s=r(126);i({target:"Set",proto:!0,real:!0,forced:!r(135)("difference")},{difference:s})},(t,e,r)=>{var s=r(127),i=r(128),a=r(129),n=r(132),o=r(133),l=r(130),h=r(131),d=i.has,c=i.remove;t.exports=function(t){var e=s(this),r=o(t),i=a(e);return n(e)<=r.size?l(e,function(t){r.includes(t)&&c(i,t)}):h(r.getIterator(),function(t){d(e,t)&&c(i,t)}),i}},(t,e,r)=>{var i=r(128).has;t.exports=function(t){return i(t),t}},(t,e,r)=>{var r=r(14),i=Set.prototype;t.exports={Set:Set,add:r(i.add),has:r(i.has),remove:r(i.delete),proto:i}},(t,e,r)=>{var i=r(128),s=r(130),a=i.Set,n=i.add;t.exports=function(t){var e=new a;return s(t,function(t){n(e,t)}),e}},(t,e,r)=>{var i=r(14),s=r(131),r=r(128),a=r.Set,r=r.proto,n=i(r.forEach),o=i(r.keys),l=o(new a).next;t.exports=function(t,e,r){return r?s({iterator:o(t),next:l},e):n(t,e)}},(t,e,r)=>{var n=r(8);t.exports=function(t,e,r){for(var i,s=r?t:t.iterator,a=t.next;!(i=n(a,s)).done;)if(void 0!==(i=e(i.value)))return i}},(t,e,r)=>{var i=r(72),r=r(128);t.exports=i(r.proto,"size","get")||function(t){return t.size}},(t,e,r)=>{function i(t,e,r,i){this.set=t,this.size=e,this.has=r,this.keys=i}var s=r(31),a=r(47),n=r(8),o=r(62),l=r(134),h="Invalid size",d=RangeError,c=TypeError,u=Math.max;i.prototype={getIterator:function(){return l(a(n(this.keys,this.set)))},includes:function(t){return n(this.has,this.set,t)}},t.exports=function(t){a(t);var e=+t.size;if(e!=e)throw c(h);e=o(e);if(e<0)throw d(h);return new i(t,u(e,0),s(t.has),s(t.keys))}},t=>{t.exports=function(t){return{iterator:t,next:t.next,done:!1}}},(t,e,r)=>{function i(t){return{size:t,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}}var s=r(24);t.exports=function(t){var e=s("Set");try{(new e)[t](i(0));try{return(new e)[t](i(-1)),!1}catch(t){return!0}}catch(t){return!1}}},(t,e,r)=>{var i=r(3),s=r(7),a=r(137);i({target:"Set",proto:!0,real:!0,forced:!r(135)("intersection")||s(function(){return"3,2"!==Array.from(new Set([1,2,3]).intersection(new Set([3,2])))})},{intersection:a})},(t,e,r)=>{var s=r(127),i=r(128),a=r(132),n=r(133),o=r(130),l=r(131),h=i.Set,d=i.add,c=i.has;t.exports=function(t){var e=s(this),r=n(t),i=new h;return a(e)>r.size?l(r.getIterator(),function(t){c(e,t)&&d(i,t)}):o(e,function(t){r.includes(t)&&d(i,t)}),i}},(t,e,r)=>{var i=r(3),s=r(139);i({target:"Set",proto:!0,real:!0,forced:!r(135)("isDisjointFrom")},{isDisjointFrom:s})},(t,e,r)=>{var s=r(127),a=r(128).has,n=r(132),o=r(133),l=r(130),h=r(131),d=r(140);t.exports=function(t){var e,r=s(this),i=o(t);return n(r)<=i.size?!1!==l(r,function(t){if(i.includes(t))return!1},!0):(e=i.getIterator(),!1!==h(e,function(t){if(a(r,t))return d(e,"normal",!1)}))}},(t,e,r)=>{var a=r(8),n=r(47),o=r(30);t.exports=function(t,e,r){var i,s;n(t);try{if(!(i=o(t,"return"))){if("throw"===e)throw r;return r}i=a(i,t)}catch(t){s=!0,i=t}if("throw"===e)throw r;if(s)throw i;return n(i),r}},(t,e,r)=>{var i=r(3),s=r(142);i({target:"Set",proto:!0,real:!0,forced:!r(135)("isSubsetOf")},{isSubsetOf:s})},(t,e,r)=>{var i=r(127),s=r(132),a=r(130),n=r(133);t.exports=function(t){var e=i(this),r=n(t);return!(s(e)>r.size)&&!1!==a(e,function(t){if(!r.includes(t))return!1},!0)}},(t,e,r)=>{var i=r(3),s=r(144);i({target:"Set",proto:!0,real:!0,forced:!r(135)("isSupersetOf")},{isSupersetOf:s})},(t,e,r)=>{var i=r(127),s=r(128).has,a=r(132),n=r(133),o=r(131),l=r(140);t.exports=function(t){var e,r=i(this),t=n(t);return!(a(r){var i=r(3),s=r(146);i({target:"Set",proto:!0,real:!0,forced:!r(135)("symmetricDifference")},{symmetricDifference:s})},(t,e,r)=>{var i=r(127),s=r(128),a=r(129),n=r(133),o=r(131),l=s.add,h=s.has,d=s.remove;t.exports=function(t){var e=i(this),t=n(t).getIterator(),r=a(e);return o(t,function(t){(h(e,t)?d:l)(r,t)}),r}},(t,e,r)=>{var i=r(3),s=r(148);i({target:"Set",proto:!0,real:!0,forced:!r(135)("union")},{union:s})},(t,e,r)=>{var i=r(127),s=r(128).add,a=r(129),n=r(133),o=r(131);t.exports=function(t){var e=i(this),t=n(t).getIterator(),r=a(e);return o(t,function(t){s(r,t)}),r}},(t,e,r)=>{function i(){c(this,y);var t=p((e=arguments.length)<1?void 0:arguments[0]),e=p(e<2?void 0:arguments[1],"Error"),e=new b(t,e);return(t=_(t)).name=v,h(e,"stack",l(1,g(t.stack,1))),u(e,this,i),e}var s,a=r(3),n=r(4),o=r(24),l=r(11),h=r(45).f,d=r(39),c=r(150),u=r(75),p=r(76),f=r(151),g=r(82),m=r(6),r=r(36),v="DOMException",_=o("Error"),b=o(v),y=i.prototype=b.prototype,A="stack"in _(v),S="stack"in new b(1,2),m=b&&m&&Object.getOwnPropertyDescriptor(n,v),n=!(!m||m.writable&&m.configurable),m=A&&!n&&!S,x=(a({global:!0,constructor:!0,forced:r||m},{DOMException:m?i:b}),o(v)),A=x.prototype;if(A.constructor!==x)for(var w in r||h(A,"constructor",l(1,x)),f)!d(f,w)||d(x,s=(w=f[w]).s)||h(x,s,l(6,w.c))},(t,e,r)=>{var i=r(25),s=TypeError;t.exports=function(t,e){if(i(e,t))return t;throw s("Incorrect invocation")}},t=>{t.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},(l,h,t)=>{function e(i){return!a(function(){var t=new v.Set([7]),e=i(t),r=i(T(7));return e===t||!e.has(7)||"object"!=typeof r||7!=+r})&&i}function r(r,i){return!a(function(){var t=new i,e=r({a:t,b:t});return!(e&&e.a===e.b&&e.a instanceof i&&e.a.stack===t.stack)})}function u(t){throw new P("Uncloneable type: "+t,D)}function p(t,e){return L||N(e),L(t)}function f(t,e,r,i,s){var a=v[e];return y(a)||N(e),new a(j(t.buffer,s),r,i)}function g(t,e,r){this.object=t,this.type=e,this.metadata=r}function m(t,r,i){if(q(t)&&u("Symbol"),!y(t))return t;if(r){if(M(r,t))return R(r,t)}else r=new k;var e,s,a,n,o,l,h,d,c=S(t);switch(c){case"Array":a=J(w(t));break;case"Object":a={};break;case"Map":a=new k;break;case"Set":a=new ht;break;case"RegExp":a=new RegExp(t.source,K(t));break;case"Error":switch(s=t.name){case"AggregateError":a=_("AggregateError")([]);break;case"EvalError":a=Z();break;case"RangeError":a=tt();break;case"ReferenceError":a=et();break;case"SyntaxError":a=rt();break;case"TypeError":a=it();break;case"URIError":a=st();break;case"CompileError":a=nt();break;case"LinkError":a=ot();break;case"RuntimeError":a=lt();break;default:a=C()}break;case"DOMException":a=new P(t.message,t.name);break;case"ArrayBuffer":case"SharedArrayBuffer":a=i?new g(t,c):j(t,r,c);break;case"DataView":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float16Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":l="DataView"===c?t.byteLength:t.length,a=i?new g(t,c,{offset:t.byteOffset,length:l}):f(t,c,t.byteOffset,l,r);break;case"DOMQuad":try{a=new DOMQuad(m(t.p1,r,i),m(t.p2,r,i),m(t.p3,r,i),m(t.p4,r,i))}catch(r){a=p(t,c)}break;case"File":if(L)try{a=L(t),S(a)!==c&&(a=void 0)}catch(t){}if(!a)try{a=new File([t],t.name,t)}catch(t){}a||N(c);break;case"FileList":if(n=(()=>{var e;try{e=new v.DataTransfer}catch(t){try{e=new v.ClipboardEvent("").clipboardData}catch(e){}}return e&&e.items&&e.files?e:null})()){for(o=0,l=w(t);o{if(!y(t))throw it("Transfer option cannot be converted to a sequence");var r=[];H(t,function(t){ut(r,A(t))});for(var i,s,a,n,o,l=0,h=w(r),d=[];l{function i(){}function s(t){if(!l(t))return!1;try{return p(i,u,t),!0}catch(t){return!1}}function a(t){if(!l(t))return!1;switch(h(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return m||!!g(f,c(t))}catch(t){return!0}}var n=r(14),o=r(7),l=r(21),h=r(78),d=r(24),c=r(51),u=[],p=d("Reflect","construct"),f=/^\s*(?:class|function)\b/,g=n(f.exec),m=!f.exec(i);a.sham=!0,t.exports=!p||o(function(){var t;return s(s.call)||!s(Object)||!s(function(){t=!0})||t})?a:s},(t,e,r)=>{function v(t,e){this.stopped=t,this.result=e}var _=r(99),b=r(8),y=r(47),A=r(32),S=r(155),x=r(64),w=r(25),E=r(157),T=r(158),C=r(140),P=TypeError,k=v.prototype;t.exports=function(t,e,r){function i(t){return a&&C(a,"normal",t),new v(!0,t)}function s(t){return u?(y(t),g?m(t[0],t[1],i):m(t[0],t[1])):g?m(t,i):m(t)}var a,n,o,l,h,d,c=r&&r.that,u=!(!r||!r.AS_ENTRIES),p=!(!r||!r.IS_RECORD),f=!(!r||!r.IS_ITERATOR),g=!(!r||!r.INTERRUPTED),m=_(e,c);if(p)a=t.iterator;else if(f)a=t;else{if(!(r=T(t)))throw P(A(t)+" is not iterable");if(S(r)){for(n=0,o=x(t);n{var i=r(34),s=r(156),a=i("iterator"),n=Array.prototype;t.exports=function(t){return void 0!==t&&(s.Array===t||n[a]===t)}},t=>{t.exports={}},(t,e,r)=>{var i=r(8),s=r(31),a=r(47),n=r(32),o=r(158),l=TypeError;t.exports=function(t,e){e=arguments.length<2?o(t):e;if(s(e))return a(i(e,t));throw l(n(t)+" is not iterable")}},(t,e,r)=>{var i=r(78),s=r(30),a=r(17),n=r(156),o=r(34)("iterator");t.exports=function(t){if(!a(t))return s(t,o)||s(t,"@@iterator")||n[i(t)]}},(t,e,r)=>{var i=r(18),s=r(45),a=r(11);t.exports=function(t,e,r){e=i(e);e in t?s.f(t,e,a(0,r)):t[e]=r}},(t,e,r)=>{var i=r(8),s=r(39),a=r(25),n=r(161),o=RegExp.prototype;t.exports=function(t){var e=t.flags;return void 0!==e||"flags"in o||s(t,"flags")||!a(o,t)?e:i(n,t)}},(t,e,r)=>{var i=r(47);t.exports=function(){var t=i(this),e="";return t.hasIndices&&(e+="d"),t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.unicodeSets&&(e+="v"),t.sticky&&(e+="y"),e}},(t,e,r)=>{var r=r(14),i=Map.prototype;t.exports={Map:Map,set:r(i.set),get:r(i.get),has:r(i.has),remove:r(i.delete),proto:i}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SerializableEmpty=e.PrintAnnotationStorage=e.AnnotationStorage=void 0,r(89),r(149),r(152);var i=r(1),o=r(164),l=r(170);let h=Object.freeze({map:null,hash:"",transfers:void 0});e.SerializableEmpty=h;class s{#v=!1;#y=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,e){t=this.#y.get(t);return void 0===t?e:Object.assign(e,t)}getRawValue(t){return this.#y.get(t)}remove(t){if(this.#y.delete(t),0===this.#y.size&&this.resetModified(),"function"==typeof this.onAnnotationEditor){for(let t of this.#y.values())if(t instanceof o.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(t,r){var i=this.#y.get(t);let s=!1;if(void 0!==i)for(let[t,e]of Object.entries(r))i[t]!==e&&(s=!0,i[t]=e);else s=!0,this.#y.set(t,r);s&&this.#_(),r instanceof o.AnnotationEditor&&"function"==typeof this.onAnnotationEditor&&this.onAnnotationEditor(r.constructor._type)}has(t){return this.#y.has(t)}getAll(){return 0{Object.defineProperty(e,"__esModule",{value:!0}),e.AnnotationEditor=void 0,r(89),r(2);var i=r(165),n=r(1),s=r(168);class C{#S="";#E=!1;#x=null;#w=null;#C=null;#T=!1;#P=null;#k=this.focusin.bind(this);#M=this.focusout.bind(this);#F=!1;#R=!1;#D=!1;_initialOptions=Object.create(null);_uiManager=null;_focusEventsAllowed=!0;_l10nPromise=null;#I=!1;#O=C._zIndex++;static _borderLineWidth=-1;static _colorManager=new i.ColorManager;static _zIndex=1;static SMALL_EDITOR_SIZE=0;constructor(t){this.constructor===C&&(0,n.unreachable)("Cannot initialize AnnotationEditor."),this.parent=t.parent,this.id=t.id,this.width=this.height=null,this.pageIndex=t.parent.pageIndex,this.name=t.name,this.div=null,this._uiManager=t.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=t.isCentered,this._structTreeParentId=null;var{rotation:e,rawDims:{pageWidth:r,pageHeight:i,pageX:s,pageY:a}}=this.parent.viewport,[e,r]=(this.rotation=e,this.pageRotation=(360+e-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[r,i],this.pageTranslation=[s,a],this.parentDimensions);this.x=t.x/e,this.y=t.y/r,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return(0,n.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){var e=new a({id:t.parent.getNextId(),parent:t.parent,uiManager:t._uiManager});e.annotationElementId=t.annotationElementId,e.deleted=!0,e._uiManager.addToAnnotationStorage(e)}static initialize(e){var r=1[t,e.get(t)])),r?.strings)for(let t of r.strings)C._l10nPromise.set(t,e.get(t));if(-1===C._borderLineWidth){let t=getComputedStyle(document.documentElement);C._borderLineWidth=parseFloat(t.getPropertyValue("--outline-width"))||0}}static updateDefaultParams(t,e){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,e){(0,n.unreachable)("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#I}set _isDraggable(t){this.#I=t,this.div?.classList.toggle("draggable",t)}center(){var[t,e]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*e/(2*t),this.y+=this.width*t/(2*e);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*e/(2*t),this.y-=this.width*t/(2*e);break;default:this.x-=this.width/2,this.y-=this.height/2}this.fixAndSetPosition()}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#O}setParent(t){null!==t&&(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions),this.parent=t}focusin(t){this._focusEventsAllowed&&(this.#F?this.#F=!1:this.parent.setSelected(this))}focusout(t){this._focusEventsAllowed&&this.isAttachedToDOM&&!t.relatedTarget?.closest("#"+this.id)&&(t.preventDefault(),!this.parent?.isMultipleSelection)&&this.commitOrRemove()}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(t,e,r,i){var[s,a]=this.parentDimensions;[r,i]=this.screenToPageTranslation(r,i),this.x=(t+r)/s,this.y=(e+i)/a,this.fixAndSetPosition()}#L(t,e,r){var[t,i]=t;[e,r]=this.screenToPageTranslation(e,r),this.x+=e/t,this.y+=r/i,this.fixAndSetPosition()}translate(t,e){this.#L(this.parentDimensions,t,e)}translateInPage(t,e){this.#L(this.pageDimensions,t,e),this.div.scrollIntoView({block:"nearest"})}drag(t,e){var[r,i]=this.parentDimensions;if(this.x+=t/r,this.y+=e/i,this.parent&&(this.x<0||1{this._isDraggable=e,window.removeEventListener("pointerup",p),window.removeEventListener("blur",p),window.removeEventListener("pointermove",t,n),this.parent.div.style.cursor=c,this.div.style.cursor=u;let r=this.x,i=this.y,s=this.width,a=this.height;r===o&&i===l&&s===h&&a===d||this.addCommands({cmd:()=>{this.width=s,this.height=a,this.x=r,this.y=i;var[t,e]=this.parentDimensions;this.setDims(t*s,e*a),this.fixAndSetPosition()},undo:()=>{this.width=h,this.height=d,this.x=o,this.y=l;var[t,e]=this.parentDimensions;this.setDims(t*h,e*d),this.fixAndSetPosition()},mustExec:!0})});window.addEventListener("pointerup",p),window.addEventListener("blur",p)}}#W(t,e){let[r,i]=this.parentDimensions,s=this.x,a=this.y,n=this.width,o=this.height,l=C.MIN_SIZE/r,h=C.MIN_SIZE/i,d=t=>Math.round(1e4*t)/1e4,c=this.#j(this.rotation),u=(t,e)=>[c[0]*t+c[2]*e,c[1]*t+c[3]*e],p=this.#j(360-this.rotation),f,g,m=!1,v=!1;switch(t){case"topLeft":m=!0,f=(t,e)=>[0,0],g=(t,e)=>[t,e];break;case"topMiddle":f=(t,e)=>[t/2,0],g=(t,e)=>[t/2,e];break;case"topRight":m=!0,f=(t,e)=>[t,0],g=(t,e)=>[0,e];break;case"middleRight":v=!0,f=(t,e)=>[t,e/2],g=(t,e)=>[0,e/2];break;case"bottomRight":m=!0,f=(t,e)=>[t,e],g=(t,e)=>[0,0];break;case"bottomMiddle":f=(t,e)=>[t/2,e],g=(t,e)=>[t/2,0];break;case"bottomLeft":m=!0,f=(t,e)=>[0,e],g=(t,e)=>[t,0];break;case"middleLeft":v=!0,f=(t,e)=>[0,e/2],g=(t,e)=>[t,e/2]}var _=f(n,o),b=g(n,o),t=u(...b),y=d(s+t[0]),A=d(a+t[1]);let S=1,x=1,[w,E]=this.screenToPageTranslation(e.movementX,e.movementY);if([w,E]=[p[0]*(e=w/r)+p[2]*(T=E/i),p[1]*e+p[3]*T],m){let t=Math.hypot(n,o);S=x=Math.max(Math.min(Math.hypot(b[0]-_[0]-w,b[1]-_[1]-E)/t,1/n,1/o),l/n,h/o)}else v?S=Math.max(l,Math.min(1,Math.abs(b[0]-_[0]-w)))/n:x=Math.max(h,Math.min(1,Math.abs(b[1]-_[1]-E)))/o;var e=d(n*S),T=d(o*x),b=y-(t=u(...g(e,T)))[0],_=A-t[1];this.width=e,this.height=T,this.x=b,this.y=_,this.setDims(r*e,i*T),this.fixAndSetPosition()}async addAltTextButton(){if(!this.#x){let e=this.#x=document.createElement("button"),t=(e.className="altText",await C._l10nPromise.get("editor_alt_text_button_label"));if(e.textContent=t,e.setAttribute("aria-label",t),e.tabIndex="0",e.addEventListener("contextmenu",s.noContextMenu),e.addEventListener("pointerdown",t=>t.stopPropagation()),e.addEventListener("click",t=>{t.preventDefault(),this._uiManager.editAltText(this)},{capture:!0}),e.addEventListener("keydown",t=>{t.target===e&&"Enter"===t.key&&(t.preventDefault(),this._uiManager.editAltText(this))}),this.#H(),this.div.append(e),!C.SMALL_EDITOR_SIZE)C.SMALL_EDITOR_SIZE=Math.min(128,Math.round(1.4*e.getBoundingClientRect().width))}}async#H(){let e=this.#x;if(e)if(this.#S||this.#E){C._l10nPromise.get("editor_alt_text_edit_button_label").then(t=>{e.setAttribute("aria-label",t)});let t=this.#w;if(!t){this.#w=t=document.createElement("span"),t.className="tooltip",t.setAttribute("role","tooltip");var r=t.id="alt-text-tooltip-"+this.id;e.setAttribute("aria-describedby",r);e.addEventListener("mouseenter",()=>{this.#C=setTimeout(()=>{this.#C=null,this.#w.classList.add("show"),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"alt_text_tooltip"}}})},100)}),e.addEventListener("mouseleave",()=>{clearTimeout(this.#C),this.#C=null,this.#w?.classList.remove("show")})}e.classList.add("done"),t.innerText=this.#E?await C._l10nPromise.get("editor_alt_text_decorative_tooltip"):this.#S,t.parentNode||e.append(t)}else e.classList.remove("done"),this.#w?.remove()}getClientDimensions(){return this.div.getBoundingClientRect()}get altTextData(){return{altText:this.#S,decorative:this.#E}}set altTextData(t){var{altText:t,decorative:e}=t;this.#S===t&&this.#E===e||(this.#S=t,this.#E=e,this.#H())}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.setAttribute("tabIndex",0),this.setInForeground(),this.div.addEventListener("focusin",this.#k),this.div.addEventListener("focusout",this.#M);var[t,e]=this.parentDimensions,[t,e]=(this.parentRotation%180!=0&&(this.div.style.maxWidth=(100*e/t).toFixed(2)+"%",this.div.style.maxHeight=(100*t/e).toFixed(2)+"%"),this.getInitialTranslation());return this.translate(t,e),(0,i.bindEvents)(this,this.div,["pointerdown"]),this.div}pointerdown(t){var e=n.FeatureTest.platform.isMac;0!==t.button||t.ctrlKey&&e?t.preventDefault():(this.#F=!0,this.#q(t))}#q(s){if(this._isDraggable){let t=this._uiManager.isSelected(this);this._uiManager.setUpDragSession();let e,r,i=(t&&(e={passive:!0,capture:!0},r=t=>{var[t,e]=this.screenToPageTranslation(t.movementX,t.movementY);this._uiManager.dragSelectedEditors(t,e)},window.addEventListener("pointermove",r,e)),()=>{if(window.removeEventListener("pointerup",i),window.removeEventListener("blur",i),t&&window.removeEventListener("pointermove",r,e),this.#F=!1,!this._uiManager.endDragSession()){let t=n.FeatureTest.platform.isMac;s.ctrlKey&&!t||s.shiftKey||s.metaKey&&t?this.parent.toggleSelected(this):this.parent.setSelected(this)}});window.addEventListener("pointerup",i),window.addEventListener("blur",i)}}moveInDOM(){this.parent?.moveEditorInDOM(this)}_setParentAndPosition(t,e,r){t.changeParent(this),this.x=e,this.y=r,this.fixAndSetPosition()}getRect(t,e){var r=this.parentScale,[i,s]=this.pageDimensions,[a,n]=this.pageTranslation,o=t/r,l=e/r,h=this.x*i,d=this.y*s,c=this.width*i,u=this.height*s;switch(this.rotation){case 0:return[h+o+a,s-d-l-u+n,h+o+c+a,s-d-l+n];case 90:return[h+l+a,s-d+o+n,h+l+u+a,s-d+o+c+n];case 180:return[h-o-c+a,s-d+l+n,h-o+a,s-d+l+u+n];case 270:return[h-l-u+a,s-d-o-c+n,h-l+a,s-d-o+n];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,e){var[r,i,s,a]=t,n=s-r,o=a-i;switch(this.rotation){case 0:return[r,e-a,n,o];case 90:return[r,e-i,o,n];case 180:return[s,e-i,n,o];case 270:return[s,e-a,o,n];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){this.#D=!0}disableEditMode(){this.#D=!1}isInEditMode(){return this.#D}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){this.div?.addEventListener("focusin",this.#k),this.div?.addEventListener("focusout",this.#M)}serialize(){(0,n.unreachable)("An editor must be serializable")}static deserialize(t,e,r){var e=new this.prototype.constructor({parent:e,id:e.getNextId(),uiManager:r}),[r,i]=(e.rotation=t.rotation,e.pageDimensions),[t,s,a,n]=e.getRectInCurrentCoords(t.rect,i);return e.x=t/r,e.y=s/i,e.width=a/r,e.height=n/i,e}remove(){this.div.removeEventListener("focusin",this.#k),this.div.removeEventListener("focusout",this.#M),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.#x?.remove(),this.#x=null,this.#w=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#U(),this.#P.classList.remove("hidden"))}select(){this.makeResizable(),this.div?.classList.add("selectedEditor")}unselect(){this.#P?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus()}updateParams(t,e){}disableEditing(){this.#x&&(this.#x.hidden=!0)}enableEditing(){this.#x&&(this.#x.hidden=!1)}enterInEditMode(){}get contentDiv(){return this.div}get isEditing(){return this.#R}set isEditing(t){this.#R=t,this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(t,e){this.#T=!0;var r=this.div.style;r.aspectRatio=t/e,r.height="auto"}static get MIN_SIZE(){return 16}}e.AnnotationEditor=C;class a extends C{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.KeyboardManager=e.CommandManager=e.ColorManager=e.AnnotationEditorUIManager=void 0,e.bindEvents=function(t,e,r){for(var i of r)e.addEventListener(i,t[i].bind(t))},e.opacityToHex=function(t){return Math.round(Math.min(255,Math.max(1,255*t))).toString(16).padStart(2,"0")},r(93),r(101),r(102),r(105),r(107),r(109),r(113),r(116),r(123),r(2),r(89),r(125),r(136),r(138),r(141),r(143),r(145),r(147),r(166);var n=r(1),o=r(168);class i{#G=0;getId(){return""+n.AnnotationEditorPrefix+this.#G++}}class l{#V=(0,n.getUuid)();#G=0;#$=null;static get _isSVGFittingCanvas(){let t=new OffscreenCanvas(1,3).getContext("2d"),e=new Image;e.src='data:image/svg+xml;charset=UTF-8,';var r=e.decode().then(()=>(t.drawImage(e,0,0,1,1,0,0,1,3),0===new Uint32Array(t.getImageData(0,0,1,1).data.buffer)[0]));return(0,n.shadow)(this,"_isSVGFittingCanvas",r)}async#X(t,r){this.#$||=new Map;let a=this.#$.get(t);if(null===a)return null;if(a?.bitmap)a.refCounter+=1;else{try{a||={bitmap:null,id:`image_${this.#V}_`+this.#G++,refCounter:0,isSvg:!1};let e;if("string"==typeof r){a.url=r;var i=await fetch(r);if(!i.ok)throw new Error(i.statusText);e=await i.blob()}else e=a.file=r;if("image/svg+xml"===e.type){let r=l._isSVGFittingCanvas,i=new FileReader,s=new Image,t=new Promise((t,e)=>{s.onload=()=>{a.bitmap=s,a.isSvg=!0,t()},i.onload=async()=>{var t=a.svgUrl=i.result;s.src=await r?t+"#svgView(preserveAspectRatio(none))":t},s.onerror=i.onerror=e});i.readAsDataURL(e),await t}else a.bitmap=await createImageBitmap(e);a.refCounter=1}catch(t){console.error(t),a=null}this.#$.set(t,a),a&&this.#$.set(a.id,a)}return a}async getFromFile(t){var{lastModified:e,name:r,size:i,type:s}=t;return this.#X(e+`_${r}_${i}_`+s,t)}async getFromUrl(t){return this.#X(t,t)}async getFromId(t){this.#$||=new Map;t=this.#$.get(t);return t?t.bitmap?(t.refCounter+=1,t):t.file?this.getFromFile(t.file):this.getFromUrl(t.url):null}getSvgUrl(t){t=this.#$.get(t);return t?.isSvg?t.svgUrl:null}deleteId(t){this.#$||=new Map;t=this.#$.get(t);t&&(--t.refCounter,0===t.refCounter)&&(t.bitmap=null)}isValidId(t){return t.startsWith(`image_${this.#V}_`)}}class s{#K=[];#Y=!1;#J;#Q=-1;constructor(){this.#J=0t===r[e]))return h._colorsMapping.get(t);return r}getHexCode(t){var e=this._colors.get(t);return e?n.Util.makeHexColor(...e):t}}e.ColorManager=h;class d{#tt=null;#et=new Map;#nt=new Map;#it=null;#rt=null;#st=new s;#at=0;#ot=new Set;#lt=null;#ct=null;#ht=new Set;#dt=null;#ut=new i;#pt=!1;#ft=!1;#gt=null;#mt=n.AnnotationEditorType.NONE;#bt=new Set;#vt=null;#yt=this.blur.bind(this);#_t=this.focus.bind(this);#At=this.copy.bind(this);#St=this.cut.bind(this);#Et=this.paste.bind(this);#xt=this.keydown.bind(this);#wt=this.onEditingAction.bind(this);#Ct=this.onPageChanging.bind(this);#Tt=this.onScaleChanging.bind(this);#Pt=this.onRotationChanging.bind(this);#kt={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1};#Mt=[0,0];#Ft=null;#Rt=null;#Dt=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){var t=d.prototype,e=t=>{var e=document.activeElement;return e&&t.#Rt.contains(e)&&t.hasSomethingToControl()},r=this.TRANSLATE_SMALL,i=this.TRANSLATE_BIG;return(0,n.shadow)(this,"_keyboardManager",new a([[["ctrl+a","mac+meta+a"],t.selectAll],[["ctrl+z","mac+meta+z"],t.undo],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],t.delete],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-r,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-i,0],checker:e}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[r,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[i,0],checker:e}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-r],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-i],checker:e}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,r],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,i],checker:e}]]))}constructor(t,e,r,i,s,a){this.#Rt=t,this.#Dt=e,this.#it=r,this._eventBus=i,this._eventBus._on("editingaction",this.#wt),this._eventBus._on("pagechanging",this.#Ct),this._eventBus._on("scalechanging",this.#Tt),this._eventBus._on("rotationchanging",this.#Pt),this.#rt=s.annotationStorage,this.#dt=s.filterFactory,this.#vt=a,this.viewParameters={realScale:o.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}destroy(){this.#It(),this.#Ot(),this._eventBus._off("editingaction",this.#wt),this._eventBus._off("pagechanging",this.#Ct),this._eventBus._off("scalechanging",this.#Tt),this._eventBus._off("rotationchanging",this.#Pt);for(var t of this.#nt.values())t.destroy();this.#nt.clear(),this.#et.clear(),this.#ht.clear(),this.#tt=null,this.#bt.clear(),this.#st.destroy(),this.#it.destroy()}get hcmFilter(){return(0,n.shadow)(this,"hcmFilter",this.#vt?this.#dt.addHCMFilter(this.#vt.foreground,this.#vt.background):"none")}get direction(){return(0,n.shadow)(this,"direction",getComputedStyle(this.#Rt).direction)}editAltText(t){this.#it?.editAltText(this,t)}onPageChanging(t){t=t.pageNumber;this.#at=t-1}focusMainContainer(){this.#Rt.focus()}findParent(t,e){for(var r of this.#nt.values()){var{x:i,y:s,width:a,height:n}=r.div.getBoundingClientRect();if(i<=t&&t<=i+a&&s<=e&&e<=s+n)return r}return null}disableUserSelect(){this.#Dt.classList.toggle("noUserSelect",0{t._focusEventsAllowed=!0},{once:!0}),e.focus()}}#Nt(){window.addEventListener("keydown",this.#xt,{capture:!0})}#It(){window.removeEventListener("keydown",this.#xt,{capture:!0})}#Bt(){document.addEventListener("copy",this.#At),document.addEventListener("cut",this.#St),document.addEventListener("paste",this.#Et)}#jt(){document.removeEventListener("copy",this.#At),document.removeEventListener("cut",this.#St),document.removeEventListener("paste",this.#Et)}addEditListeners(){this.#Nt(),this.#Bt()}removeEditListeners(){this.#It(),this.#jt()}copy(t){if(t.preventDefault(),this.#tt?.commitOrRemove(),this.hasSelection){var e=[];for(let t of this.#bt){var r=t.serialize(!0);r&&e.push(r)}0!==e.length&&t.clipboardData.setData("application/pdfjs",JSON.stringify(e))}}cut(t){this.copy(t),this.delete()}paste(t){t.preventDefault();let r=t.clipboardData;for(let e of r.items)for(let t of this.#ct)if(t.isHandlingMimeForPasting(e.type))return void t.paste(e,this.currentLayer);let i=r.getData("application/pdfjs");if(i){try{i=JSON.parse(i)}catch(t){return void(0,n.warn)(`paste: "${t.message}".`)}if(Array.isArray(i)){this.unselectAll();var s=this.currentLayer;try{let r=[];for(let e of i){let t=s.deserialize(e);if(!t)return;r.push(t)}this.addCommands({cmd:()=>{for(var t of r)this.#Ut(t);this.#zt(r)},undo:()=>{for(var t of r)t.remove()},mustExec:!0})}catch(t){(0,n.warn)(`paste: "${t.message}".`)}}}}keydown(t){this.getActive()?.shouldGetKeyboardEvents()||d._keyboardManager.exec(this,t)}onEditingAction(t){["undo","redo","delete","selectAll"].includes(t.name)&&this[t.name]()}#Wt(t){Object.entries(t).some(t=>{var[t,e]=t;return this.#kt[t]!==e})&&this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#kt,t)})}#Ht(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})}setEditingState(t){t?(this.#Lt(),this.#Nt(),this.#Bt(),this.#Wt({isEditing:this.#mt!==n.AnnotationEditorType.NONE,isEmpty:this.#qt(),hasSomethingToUndo:this.#st.hasSomethingToUndo(),hasSomethingToRedo:this.#st.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#Ot(),this.#It(),this.#jt(),this.#Wt({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!this.#ct){this.#ct=t;for(let t of this.#ct)this.#Ht(t.defaultPropertiesToUpdate)}}getId(){return this.#ut.getId()}get currentLayer(){return this.#nt.get(this.#at)}getLayer(t){return this.#nt.get(t)}get currentPageIndex(){return this.#at}addLayer(t){this.#nt.set(t.pageIndex,t),this.#pt?t.enable():t.disable()}removeLayer(t){this.#nt.delete(t.pageIndex)}updateMode(e){let r=1{for(var t of e)t.remove()},undo:()=>{for(var t of e)this.#Ut(t)},mustExec:!0})}}commitOrRemove(){this.#tt?.commitOrRemove()}hasSomethingToControl(){return this.#tt||this.hasSelection}#zt(t){this.#bt.clear();for(var e of t)e.isEmpty()||(this.#bt.add(e),e.select());this.#Wt({hasSelectedEditor:!0})}selectAll(){for(var t of this.#bt)t.commit();this.#zt(this.#et.values())}unselectAll(){if(this.#tt)this.#tt.commitOrRemove();else if(this.hasSelection){for(var t of this.#bt)t.unselect();this.#bt.clear(),this.#Wt({hasSelectedEditor:!1})}}translateSelectedEditors(s,a){if(2{this.#Ft=null,this.#Mt[0]=this.#Mt[1]=0,this.addCommands({cmd:()=>{for(var t of i)this.#et.has(t.id)&&t.translateInPage(e,r)},undo:()=>{for(var t of i)this.#et.has(t.id)&&t.translateInPage(-e,-r)},mustExec:!1})},1e3);for(let t of i)t.translateInPage(s,a)}}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#lt=new Map;for(var t of this.#bt)this.#lt.set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#lt)return!1;this.disableUserSelect(!1);let s=this.#lt,t=(this.#lt=null,!1);for(var[{x:e,y:r,pageIndex:i},a]of s)a.newX=e,a.newY=r,a.newPageIndex=i,t||=e!==a.savedX||r!==a.savedY||i!==a.savedPageIndex;if(!t)return!1;let n=(t,e,r,i)=>{var s;this.#et.has(t.id)&&((s=this.#nt.get(i))?t._setParentAndPosition(s,e,r):(t.pageIndex=i,t.x=e,t.y=r))};return this.addCommands({cmd:()=>{for(var[t,{newX:e,newY:r,newPageIndex:i}]of s)n(t,e,r,i)},undo:()=>{for(var[t,{savedX:e,savedY:r,savedPageIndex:i}]of s)n(t,e,r,i)},mustExec:!0}),!0}dragSelectedEditors(t,e){if(this.#lt)for(var r of this.#lt.keys())r.drag(t,e)}rebuild(t){var e;null===t.parent?(e=this.getLayer(t.pageIndex))?(e.changeParent(t),e.addOrRebuild(t)):(this.addEditor(t),this.addToAnnotationStorage(t),t.rebuild()):t.parent.addOrRebuild(t)}isActive(t){return this.#tt===t}getActive(){return this.#tt}getMode(){return this.#mt}get imageManager(){return(0,n.shadow)(this,"imageManager",new l)}}e.AnnotationEditorUIManager=d},(t,L,e)=>{function f(t,e,r,i){var s,a,n,o,l,h=t[e],d=i&&h===i.value,c=d&&"string"==typeof i.source?{source:i.source}:{};if(v(h)){var u=_(h),p=d?i.nodes:u?[]:{};if(u)for(s=p.length,n=y(h),o=0;o{var i=r(14),n=r(39),o=SyntaxError,l=parseInt,h=String.fromCharCode,d=i("".charAt),c=i("".slice),u=i(/./.exec),p={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":"\n","\\r":"\r","\\t":"\t"},f=/^[\da-f]{4}$/i,g=/^[\u0000-\u001F]$/;t.exports=function(t,e){for(var r=!0,i="";e{Object.defineProperty(e,"__esModule",{value:!0}),e.StatTimer=e.RenderingCancelledException=e.PixelsPerInch=e.PageViewport=e.PDFDateString=e.DOMStandardFontDataFactory=e.DOMSVGFactory=e.DOMFilterFactory=e.DOMCanvasFactory=e.DOMCMapReaderFactory=void 0,e.deprecated=function(t){console.log("Deprecated API usage: "+t)},e.getColorValues=function(t){var e,r=document.createElement("span");r.style.visibility="hidden",document.body.append(r);for(e of t.keys()){r.style.color=e;var i=window.getComputedStyle(r).color;t.set(e,_(i))}r.remove()},e.getCurrentTransform=function(t){var{a:t,b:e,c:r,d:i,e:s,f:a}=t.getTransform();return[t,e,r,i,s,a]},e.getCurrentTransformInverse=function(t){var{a:t,b:e,c:r,d:i,e:s,f:a}=t.getTransform().invertSelf();return[t,e,r,i,s,a]},e.getFilenameFromUrl=function(t){return 1{let r=document.createElement("script");r.src=i,r.onload=function(t){s&&r.remove(),e(t)},r.onerror=function(){t(new Error("Cannot load script at: "+r.src))},(document.head||document.documentElement).append(r)})},e.noContextMenu=function(t){t.preventDefault()},e.setLayerDimensions=function(l,h){let d=2{var r=a[t]/255,i=n[t]/255,s=new Array(e+1);for(let t=0;t<=e;t++)s[t]=r+t/e*(i-r);return s.join(",")});this.#re(r(0,5),r(1,5),r(2,5),e),this.#Qt=`url(#${t})`}}return this.#Qt}addHighlightHCMFilter(r,i,s,a){var n=r+`-${i}-${s}-`+a;if(this.#te!==n&&(this.#te=n,this.#ee="none",this.#Zt?.remove(),r)&&i){var[n,r]=[r,i].map(this.#se.bind(this));let l=Math.round(.2126*n[0]+.7152*n[1]+.0722*n[2]),h=Math.round(.2126*r[0]+.7152*r[1]+.0722*r[2]),[t,e]=[s,a].map(this.#se.bind(this));h{var i=new Array(256),s=(h-l)/r,a=t/255,n=(e-t)/(255*r);let o=0;for(let t=0;t<=r;t++){let e=Math.round(l+t*s),r=a+t*n;for(let t=o;t<=e;t++)i[t]=r;o=e+1}for(let t=o;t<256;t++)i[t]=i[o-1];return i.join(",")},n=`g_${this.#e}_hcm_highlight_filter`,r=this.#Zt=this.#ie(n);this.#ae(r),this.#re(i(t[0],e[0],5),i(t[1],e[1],5),i(t[2],e[2],5),r),this.#ee=`url(#${n})`}return this.#ee}destroy(){0{let r=new XMLHttpRequest;r.open("GET",i,!0),s&&(r.responseType="arraybuffer"),r.onreadystatechange=()=>{if(r.readyState===XMLHttpRequest.DONE){if(200===r.status||0===r.status){let t;if(s&&r.response?t=new Uint8Array(r.response):!s&&r.responseText&&(t=(0,c.stringToBytes)(r.responseText)),t)return void e(t)}t(new Error(r.statusText))}},r.send(null)})}e.DOMCanvasFactory=o;class h extends i.BaseCMapReaderFactory{_fetchData(t,e){return l(t,this.isCompressed).then(t=>({cMapData:t,compressionType:e}))}}e.DOMCMapReaderFactory=h;class d extends i.BaseStandardFontDataFactory{_fetchData(t){return l(t,!0)}}e.DOMStandardFontDataFactory=d;class u extends i.BaseSVGFactory{_createSVG(t){return document.createElementNS(a,t)}}e.DOMSVGFactory=u;class p{constructor(t){let{viewBox:e,scale:r,rotation:i,offsetX:s=0,offsetY:a=0,dontFlip:n=!1}=t;this.viewBox=e,this.scale=r,this.rotation=i,this.offsetX=s,this.offsetY=a;var t=(e[2]+e[0])/2,o=(e[3]+e[1])/2;let l,h,d,c,u,p,f,g;switch((i%=360)<0&&(i+=360),i){case 180:l=-1,h=0,d=0,c=1;break;case 90:l=0,h=1,d=1,c=0;break;case 270:l=0,h=-1,d=-1,c=0;break;case 0:l=1,h=0,d=0,c=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}n&&(d=-d,c=-c),g=0===l?(u=Math.abs(o-e[1])*r+s,p=Math.abs(t-e[0])*r+a,f=(e[3]-e[1])*r,(e[2]-e[0])*r):(u=Math.abs(t-e[0])*r+s,p=Math.abs(o-e[1])*r+a,f=(e[2]-e[0])*r,(e[3]-e[1])*r),this.transform=[l*r,h*r,d*r,c*r,u-l*r*t-d*r*o,p-h*r*t-c*r*o],this.width=f,this.height=g}get rawDims(){var t=this.viewBox;return(0,c.shadow)(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone(){var{scale:t=this.scale,rotation:e=this.rotation,offsetX:r=this.offsetX,offsetY:i=this.offsetY,dontFlip:s=!1}=0>16,(65280&e)>>8,255&e]:t.startsWith("rgb(")?t.slice(4,-1).split(",").map(t=>parseInt(t)):t.startsWith("rgba(")?t.slice(5,-1).split(",").map(t=>parseInt(t)).slice(0,3):((0,c.warn)(`Not a valid color format: "${t}"`),[0,0,0])}e.PDFDateString=class{static toDateObject(t){if(!t||"string"!=typeof t)return null;t=(v||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?")).exec(t);if(!t)return null;var e=parseInt(t[1],10),r=1<=(r=parseInt(t[2],10))&&r<=12?r-1:0,i=1<=(i=parseInt(t[3],10))&&i<=31?i:1;let s=parseInt(t[4],10),a=(s=0<=s&&s<=23?s:0,parseInt(t[5],10));a=0<=a&&a<=59?a:0;var n=0<=(n=parseInt(t[6],10))&&n<=59?n:0,o=t[7]||"Z",l=0<=(l=parseInt(t[8],10))&&l<=23?l:0,t=0<=(t=parseInt(t[9],10)||0)&&t<=59?t:0;return"-"===o?(s+=l,a+=t):"+"===o&&(s-=l,a-=t),new Date(Date.UTC(e,r,i,s,a,n))}}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BaseStandardFontDataFactory=e.BaseSVGFactory=e.BaseFilterFactory=e.BaseCanvasFactory=e.BaseCMapReaderFactory=void 0,r(2);var i=r(1);e.BaseFilterFactory=class s{constructor(){this.constructor===s&&(0,i.unreachable)("Cannot initialize BaseFilterFactory.")}addFilter(t){return"none"}addHCMFilter(t,e){return"none"}addHighlightHCMFilter(t,e,r,i){return"none"}destroy(){}};e.BaseCanvasFactory=class a{constructor(){this.constructor===a&&(0,i.unreachable)("Cannot initialize BaseCanvasFactory.")}create(t,e){if(t<=0||e<=0)throw new Error("Invalid canvas size");return{canvas:t=this._createCanvas(t,e),context:t.getContext("2d")}}reset(t,e,r){if(!t.canvas)throw new Error("Canvas is not specified");if(e<=0||r<=0)throw new Error("Invalid canvas size");t.canvas.width=e,t.canvas.height=r}destroy(t){if(!t.canvas)throw new Error("Canvas is not specified");t.canvas.width=0,t.canvas.height=0,t.canvas=null,t.context=null}_createCanvas(t,e){(0,i.unreachable)("Abstract method `_createCanvas` called.")}};e.BaseCMapReaderFactory=class n{constructor(t){var{baseUrl:t=null,isCompressed:e=!0}=t;this.constructor===n&&(0,i.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=t,this.isCompressed=e}async fetch(t){if(t=t.name,!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!t)throw new Error("CMap name must be specified.");let e=this.baseUrl+t+(this.isCompressed?".bcmap":""),r=this.isCompressed?i.CMapCompressionType.BINARY:i.CMapCompressionType.NONE;return this._fetchData(e,r).catch(t=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: `+e)})}_fetchData(t,e){(0,i.unreachable)("Abstract method `_fetchData` called.")}};e.BaseStandardFontDataFactory=class o{constructor(t){var{baseUrl:t=null}=t;this.constructor===o&&(0,i.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=t}async fetch(t){if(t=t.filename,!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!t)throw new Error("Font filename must be specified.");let e=""+this.baseUrl+t;return this._fetchData(e).catch(t=>{throw new Error("Unable to load font data at: "+e)})}_fetchData(t){(0,i.unreachable)("Abstract method `_fetchData` called.")}};e.BaseSVGFactory=class l{constructor(){this.constructor===l&&(0,i.unreachable)("Cannot initialize BaseSVGFactory.")}create(t,e){var r=2{Object.defineProperty(e,"__esModule",{value:!0}),e.MurmurHash3_64=void 0,r(93),r(101),r(102),r(105),r(107),r(109),r(113),r(116),r(123),r(2);var u=r(1);let i=3285377520,p=4294901760,f=65535;e.MurmurHash3_64=class{constructor(t){this.h1=t?4294967295&t:i,this.h2=t?4294967295&t:i}update(r){let i,s;if("string"==typeof r){i=new Uint8Array(2*r.length);for(let e=s=0,t=r.length;e>>8,i[s++]=255&t)}}else{if(!(0,u.isArrayBuffer)(r))throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");i=r.slice(),s=i.byteLength}let e=s>>2,t=s-4*e,a=new Uint32Array(i.buffer,0,e),n=0,o,l=this.h1,h=this.h2;var d=3432918353,c=461845907;for(let t=0;t>>17)*c&p|13715*n&f,l=5*(l=(l^=n)<<13|l>>>19)+3864292196):(o=(o=(o=(o=a[t])*d&p|11601*o&f)<<15|o>>>17)*c&p|13715*o&f,h=5*(h=(h^=o)<<13|h>>>19)+3864292196);switch(n=0,t){case 3:n^=i[4*e+2]<<16;case 2:n^=i[4*e+1]<<8;case 1:n=(n=(n=(n^=i[4*e])*d&p|11601*n&f)<<15|n>>>17)*c&p|13715*n&f,1&e?l^=n:h^=n}this.h1=l,this.h2=h}hexdigest(){var t=this.h1,e=this.h2,t=3981806797*(t^=e>>>1)&p|36045*t&f;return t=444984403*(t^=(e=4283543511*e&p|(2950163797*(e<<16|t>>>16)&p)>>>16)>>>1)&p|60499*t&f,((t^=(e=3301882366*e&p|(3120437893*(e<<16|t>>>16)&p)>>>16)>>>1)>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FontLoader=e.FontFaceObject=void 0,r(125),r(136),r(138),r(141),r(143),r(145),r(147),r(89),r(149);var p=r(1);e.FontLoader=class{#le=new Set;constructor(t){var{ownerDocument:t=globalThis.document}=t;this._document=t,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(t){this.nativeFontFaces.add(t),this._document.fonts.add(t)}removeNativeFontFace(t){this.nativeFontFaces.delete(t),this._document.fonts.delete(t)}insertRule(t){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));var e=this.styleElement.sheet;e.insertRule(t,e.cssRules.length)}clear(){for(var t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.clear(),this.#le.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont(t){if(t&&!this.#le.has(t.loadedName))if((0,p.assert)(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){var{loadedName:e,src:r,style:i}=t,r=new FontFace(e,r,i);this.addNativeFontFace(r);try{await r.load(),this.#le.add(e)}catch{(0,p.warn)(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(r)}}else(0,p.unreachable)("Not implemented: loadSystemFont without the Font Loading API.")}async bind(r){if(!(r.attached||r.missingFile&&!r.systemFontInfo))if(r.attached=!0,r.systemFontInfo)await this.loadSystemFont(r.systemFontInfo);else if(this.isFontLoadingAPISupported){let e=r.createNativeFontFace();if(e){this.addNativeFontFace(e);try{await e.loaded}catch(t){throw(0,p.warn)(`Failed to load font '${e.family}': '${t}'.`),r.disableFontFace=!0,t}}}else{let t=r.createFontFaceRule();t&&(this.insertRule(t),this.isSyncFontLoadingSupported||await new Promise(t=>{t=this._queueLoadingCallback(t);this._prepareFontLoadEvent(r,t)}))}}get isFontLoadingAPISupported(){var t=!!this._document?.fonts;return(0,p.shadow)(this,"isFontLoadingAPISupported",t)}get isSyncFontLoadingSupported(){let t=!1;return(p.isNodeJS||"undefined"!=typeof navigator&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(t=!0),(0,p.shadow)(this,"isSyncFontLoadingSupported",t)}_queueLoadingCallback(t){let e=this.loadingRequests,r={done:!1,complete:function(){for((0,p.assert)(!r.done,"completeRequest() cannot be called twice."),r.done=!0;0{u.remove(),e.complete()})}},e.FontFaceObject=class{constructor(e,t){var{isEvalSupported:t=!0,disableFontFace:r=!1,ignoreErrors:i=!1,inspectFont:s=null}=t;this.compiledGlyphs=Object.create(null);for(let t in e)this[t]=e[t];this.isEvalSupported=!1!==t,this.disableFontFace=!0===r,this.ignoreErrors=!0===i,this._inspectFont=s}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let t;var e;return t=this.cssFontInfo?(e={weight:this.cssFontInfo.fontWeight},this.cssFontInfo.italicAngle&&(e.style=`oblique ${this.cssFontInfo.italicAngle}deg`),new FontFace(this.cssFontInfo.fontFamily,this.data,e)):new FontFace(this.loadedName,this.data,{}),this._inspectFont?.(this),t}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;var e=(0,p.bytesToString)(this.data),e=`url(data:${this.mimetype};base64,${btoa(e)});`;let r;if(this.cssFontInfo){let t=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(t+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),r=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${t}src:${e}}`}else r=`@font-face {font-family:"${this.loadedName}";src:${e}}`;return this._inspectFont?.(this,e),r}getPathGenerator(t,e){if(void 0!==this.compiledGlyphs[e])return this.compiledGlyphs[e];let i;try{i=t.get(this.loadedName+"_path_"+e)}catch(t){if(this.ignoreErrors)return(0,p.warn)(`getPathGenerator - ignoring character: "${t}".`),this.compiledGlyphs[e]=function(t,e){};throw t}if(this.isEvalSupported&&p.FeatureTest.isEvalSupported){let r=[];for(let e of i){let t=void 0!==e.args?e.args.join(","):"";r.push("c.",e.cmd,"(",t,");\n")}return this.compiledGlyphs[e]=new Function("c","size",r.join(""))}return this.compiledGlyphs[e]=function(t,e){for(var r of i)"scale"===r.cmd&&(r.args=[e,-e]),t[r.cmd].apply(t,r.args)}}}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.NodeStandardFontDataFactory=e.NodeFilterFactory=e.NodeCanvasFactory=e.NodeCMapReaderFactory=void 0,r(2),r(93),r(101),r(102),r(105),r(107),r(109),r(113),r(116),r(123);var i=r(169),r=r(1);if(!globalThis.DOMMatrix&&r.isNodeJS)try{globalThis.DOMMatrix=require("canvas").DOMMatrix}catch(t){(0,r.warn)(`Cannot polyfill \`DOMMatrix\`, rendering may be broken: "${t}".`)}if(!globalThis.Path2D&&r.isNodeJS)try{var s=require("canvas").CanvasRenderingContext2D,a=require("path2d-polyfill").polyfillPath2D;globalThis.CanvasRenderingContext2D=s,a(globalThis)}catch(t){(0,r.warn)(`Cannot polyfill \`Path2D\`, rendering may be broken: "${t}".`)}function n(t){return new Promise((r,i)=>{require("fs").readFile(t,(t,e)=>{!t&&e?r(new Uint8Array(e)):i(new Error(t))})})}class o extends i.BaseFilterFactory{}e.NodeFilterFactory=o;class l extends i.BaseCanvasFactory{_createCanvas(t,e){return require("canvas").createCanvas(t,e)}}e.NodeCanvasFactory=l;class h extends i.BaseCMapReaderFactory{_fetchData(t,e){return n(t).then(t=>({cMapData:t,compressionType:e}))}}e.NodeCMapReaderFactory=h;class d extends i.BaseStandardFontDataFactory{_fetchData(t){return n(t)}}e.NodeStandardFontDataFactory=d},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CanvasGraphics=void 0,r(2),r(93),r(101),r(102),r(105),r(107),r(109),r(113),r(116),r(123),r(89);var A=r(1),w=r(168),S=r(174),c=r(175);let u=4096;class h{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,e,r){let i;return void 0!==this.cache[t]?(i=this.cache[t],this.canvasFactory.reset(i,e,r)):(i=this.canvasFactory.create(e,r),this.cache[t]=i),i}delete(t){delete this.cache[t]}clear(){for(var t in this.cache){var e=this.cache[t];this.canvasFactory.destroy(e),delete this.cache[t]}}}function v(l,h,d,c,u,p,f,g,m,v){var[_,b,y,A,S,x]=(0,w.getCurrentTransform)(l);if(0===b&&0===y){let t=f*_+S,e=Math.round(t),r=g*A+x,i=Math.round(r),s=(f+m)*_+S,a=Math.abs(Math.round(s)-e)||1,n=(g+v)*A+x,o=Math.abs(Math.round(n)-i)||1;l.setTransform(Math.sign(_),0,0,Math.sign(A),e,i),l.drawImage(h,d,c,u,p,0,0,a,o),void l.setTransform(_,b,y,A,S,x)}else if(0===_&&0===A){let t=g*y+S,e=Math.round(t),r=f*b+x,i=Math.round(r),s=(g+v)*y+S,a=Math.abs(Math.round(s)-e)||1,n=(f+m)*b+x,o=Math.abs(Math.round(n)-i)||1;l.setTransform(0,Math.sign(b),Math.sign(y),0,e,i),l.drawImage(h,d,c,u,p,0,0,o,a),void l.setTransform(_,b,y,A,S,x)}else l.drawImage(h,d,c,u,p,f,g,m,v),Math.hypot(_,b),Math.hypot(y,A)}class p{constructor(t,e){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=A.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=A.FONT_IDENTITY_MATRIX,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=A.TextRenderingMode.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,t,e])}clone(){var t=Object.create(this);return t.clipBox=this.clipBox.slice(),t}setCurrentPoint(t,e){this.x=t,this.y=e}updatePathMinMax(t,e,r){[e,r]=A.Util.applyTransform([e,r],t),this.minX=Math.min(this.minX,e),this.minY=Math.min(this.minY,r),this.maxX=Math.max(this.maxX,e),this.maxY=Math.max(this.maxY,r)}updateRectMinMax(t,e){var r=A.Util.applyTransform(e,t),e=A.Util.applyTransform(e.slice(2),t);this.minX=Math.min(this.minX,r[0],e[0]),this.minY=Math.min(this.minY,r[1],e[1]),this.maxX=Math.max(this.maxX,r[0],e[0]),this.maxY=Math.max(this.maxY,r[1],e[1])}updateScalingPathMinMax(t,e){A.Util.scaleMinMax(t,e),this.minX=Math.min(this.minX,e[0]),this.maxX=Math.max(this.maxX,e[1]),this.minY=Math.min(this.minY,e[2]),this.maxY=Math.max(this.maxY,e[3])}updateCurvePathMinMax(t,e,r,i,s,a,n,o,l,h){e=A.Util.bezierBoundingBox(e,r,i,s,a,n,o,l);h?(h[0]=Math.min(h[0],e[0],e[2]),h[1]=Math.max(h[1],e[0],e[2]),h[2]=Math.min(h[2],e[1],e[3]),h[3]=Math.max(h[3],e[1],e[3])):this.updateRectMinMax(t,e)}getPathBoundingBox(){let t=0>2),t=o.length,l=c+7>>3,h=4294967295,d=A.FeatureTest.isLittleEndian?4278190080:255;for(a=0;al?c:8*t-7,i=-8&r,s=0,a=0;for(;e>=1}for(;u=r&&(g=e,n=c*g),u=0,f=n;f--;)_[u++]=v[p++],_[u++]=v[p++],_[u++]=v[p++],_[u++]=255;m.putImageData(s,0,16*a)}}}}function _(l,e){if(e.bitmap)l.drawImage(e.bitmap,0,0);else{let t=e.height,r=e.width,i=t%16,s=(t-i)/16,a=0==i?s:1+s,n=l.createImageData(r,16),o=0;var h=e.data,d=n.data;for(let e=0;e>8]>>8:i[e]*t>>16}}function b(t,e){var t=A.Util.singularValueDecompose2dScale(t),r=(t[0]=Math.fround(t[0]),t[1]=Math.fround(t[1]),Math.fround((globalThis.devicePixelRatio||1)*w.PixelsPerInch.PDF_TO_CSS_UNITS));return void 0!==e?e:t[0]<=r||t[1]<=r}let i=["butt","round","square"],s=["miter","round","bevel"],a={},o={};class l{constructor(t,e,r,i,s,a,n,o){var{optionalContentConfig:a,markedContentStack:l=null}=a;this.ctx=t,this.current=new p(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=e,this.objs=r,this.canvasFactory=i,this.filterFactory=s,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=l||[],this.optionalContentConfig=a,this.cachedCanvases=new h(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=n,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=o,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(t){var e=1h)return r(),n;d=0}}}#ce(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)}endDrawing(){this.#ce(),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(var t of this._cachedBitmapsMap.values()){for(var e of t.values())"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement&&(e.width=e.height=0);t.clear()}this._cachedBitmapsMap.clear(),this.#he()}#he(){var t,e;this.pageColors&&"none"!==(t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background))&&(e=this.ctx.filter,this.ctx.filter=t,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=e)}_scaleImage(r,t){var e=r.width,i=r.height;let s,a,n=Math.max(Math.hypot(t[0],t[1]),1),o=Math.max(Math.hypot(t[2],t[3]),1),l=e,h=i,d="prescale1";for(;2{i.save=i.__originalSave,i.restore=i.__originalRestore,i.rotate=i.__originalRotate,i.scale=i.__originalScale,i.translate=i.__originalTranslate,i.transform=i.__originalTransform,i.setTransform=i.__originalSetTransform,i.resetTransform=i.__originalResetTransform,i.clip=i.__originalClip,i.moveTo=i.__originalMoveTo,i.lineTo=i.__originalLineTo,i.bezierCurveTo=i.__originalBezierCurveTo,i.rect=i.__originalRect,i.closePath=i.__originalClosePath,i.beginPath=i.__originalBeginPath,delete i._removeMirroring},i.save=function(){n.save(),this.__originalSave()},i.restore=function(){n.restore(),this.__originalRestore()},i.translate=function(t,e){n.translate(t,e),this.__originalTranslate(t,e)},i.scale=function(t,e){n.scale(t,e),this.__originalScale(t,e)},i.transform=function(t,e,r,i,s,a){n.transform(t,e,r,i,s,a),this.__originalTransform(t,e,r,i,s,a)},i.setTransform=function(t,e,r,i,s,a){n.setTransform(t,e,r,i,s,a),this.__originalSetTransform(t,e,r,i,s,a)},i.resetTransform=function(){n.resetTransform(),this.__originalResetTransform()},i.rotate=function(t){n.rotate(t),this.__originalRotate(t)},i.clip=function(t){n.clip(t),this.__originalClip(t)},i.moveTo=function(t,e){n.moveTo(t,e),this.__originalMoveTo(t,e)},i.lineTo=function(t,e){n.lineTo(t,e),this.__originalLineTo(t,e)},i.bezierCurveTo=function(t,e,r,i,s,a){n.bezierCurveTo(t,e,r,i,s,a),this.__originalBezierCurveTo(t,e,r,i,s,a)},i.rect=function(t,e,r,i){n.rect(t,e,r,i),this.__originalRect(t,e,r,i)},i.closePath=function(){n.closePath(),this.__originalClosePath()},i.beginPath=function(){n.beginPath(),this.__originalBeginPath()},this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),f(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(t){if(this.current.activeSMask){t?(t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.ceil(t[2]),t[3]=Math.ceil(t[3])):t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];var e=this.current.activeSMask,r=this.suspendedCtx,i=this.ctx,s=(t=t)[0],a=t[1],n=t[2]-s,t=t[3]-a;if(0!=n&&0!=t){var o,l=e.context,h=i,d=n,c=t,n=e.subtype,u=e.backdrop,p=e.transferMap,f=s,g=a,m=e.offsetX,v=e.offsetY,_=!!u,b=_?u[0]:0,y=_?u[1]:0,A=_?u[2]:0,S="Luminosity"===n?k:P,x=Math.min(c,Math.ceil(1048576/d));for(let i=0;i>8,w[e-2]=w[e-2]*t+T*o>>8,w[e-1]=w[e-1]*t+C*o>>8)}}S(e.data,r.data,p),h.putImageData(r,f,i+g)}r.save(),r.globalAlpha=1,r.globalCompositeOperation="source-over",r.setTransform(1,0,0,1,0,0),r.drawImage(i.canvas,0,0),r.restore()}this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}}save(){(this.inSMaskMode?(f(this.ctx,this.suspendedCtx),this.suspendedCtx):this.ctx).save();var t=this.current;this.stateStack.push(t),this.current=t.clone()}restore(){0===this.stateStack.length&&this.inSMaskMode&&this.endSMaskMode(),0!==this.stateStack.length&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),f(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(t,e,r,i,s,a){this.ctx.transform(t,e,r,i,s,a),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(r,a,t){var n=this.ctx,o=this.current;let l,h,d=o.x,c=o.y;var u=(0,w.getCurrentTransform)(n),p=0===u[0]&&0===u[3]||0===u[1]&&0===u[2],f=p?t.slice(0):null;for(let t=0,s=0,e=r.length;tnew l(t,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})},i)):this._getPattern(t[1],t[2])}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(t,e,r){t=A.Util.makeHexColor(t,e,r);this.ctx.strokeStyle=t,this.current.strokeColor=t}setFillRGBColor(t,e,r){t=A.Util.makeHexColor(t,e,r);this.ctx.fillStyle=t,this.current.fillColor=t,this.current.patternFill=!1}_getPattern(t){let e,r=1u&&(r=t/u,t=u),e>u&&(i=e/u,e=u),this.current.startNewPathAndClipBox([0,0,t,e]),"groupAt"+this.groupLevel);a.smask&&(s+="_smask_"+this.smaskCounter++%2);var l=this.cachedCanvases.getCanvas(s,t,e),c=l.context;c.scale(1/r,1/i),c.translate(-h,-d),c.transform(...o),a.smask?this.smaskStack.push({canvas:l.canvas,context:c,offsetX:h,offsetY:d,scaleX:r,scaleY:i,subtype:a.smask.subtype,backdrop:a.smask.backdrop,transferMap:a.smask.transferMap||null,startTransformInverse:null}):(n.setTransform(1,0,0,1,0,0),n.translate(h,d),n.scale(r,i),n.save()),f(n,c),this.ctx=c,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(n),this.groupLevel++}}endGroup(e){if(this.contentVisible){this.groupLevel--;let r=this.ctx,t=this.groupStack.pop();if(this.ctx=t,this.ctx.imageSmoothingEnabled=!1,e.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();let t=(0,w.getCurrentTransform)(this.ctx),e=(this.restore(),this.ctx.save(),this.ctx.setTransform(...t),A.Util.getAxialAlignedBoundingBox([0,0,r.canvas.width,r.canvas.height],t));this.ctx.drawImage(r.canvas,0,0),this.ctx.restore(),this.compose(e)}}}beginAnnotation(o,l,h,t,e){if(this.#ce(),g(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),Array.isArray(l)&&4===l.length){let a=l[2]-l[0],n=l[3]-l[1];if(e&&this.annotationCanvasMap){(h=h.slice())[4]-=l[0],h[5]-=l[1],(l=l.slice())[0]=l[1]=0,l[2]=a,l[3]=n;let[t,e]=A.Util.singularValueDecompose2dScale((0,w.getCurrentTransform)(this.ctx)),r=this.viewportScale,i=Math.ceil(a*this.outputScaleX*r),s=Math.ceil(n*this.outputScaleY*r);this.annotationCanvas=this.canvasFactory.create(i,s);var{canvas:d,context:c}=this.annotationCanvas;this.annotationCanvasMap.set(o,d),this.annotationCanvas.savedCtx=this.ctx,this.ctx=c,this.ctx.save(),this.ctx.setTransform(t,0,0,-e,0,n*e),g(this.ctx)}else g(this.ctx),this.ctx.rect(l[0],l[1],a,n),this.ctx.clip(),this.endPath()}this.current=new p(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...h),this.transform(...t)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),this.#he(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(t){var e,r;this.contentVisible&&(e=t.count,(t=this.getObject(t.data,t)).count=e,e=this.ctx,(r=this.processingType3)&&(void 0===r.compiled&&(r.compiled=(t=>{let{width:e,height:r}=t;if(1e3>=1}let u=0;for((c=0)!==d[c]&&(l[0]=1,++u),n=1;n>2)+(d[c+1]?4:0)+(d[c-h+1]?8:0),i[t]&&(l[o+n]=i[t],++u),c++;if(d[c-h]!==d[c]&&(l[o+n]=d[c]?2:4,++u),1e3>4,l[i]&=r>>2|r<<2),f.lineTo(i%s,i/s|0),l[i]||--u}while(t!==i);--a}}return d=null,l=null,function(t){t.save(),t.scale(1/e,-1/r),t.translate(0,-r),t.fill(f),t.beginPath(),t.restore()}})(t)),r.compiled)?r.compiled(e):(t=(r=this._createMaskCanvas(t)).canvas,e.save(),e.setTransform(1,0,0,1,0,0),e.drawImage(t,r.offsetX,r.offsetY),e.restore(),this.compose()))}paintImageMaskXObjectRepeat(t,s){var a=2t/e)),r.lineDashOffset/=e}r.stroke(),t&&r.restore()}}isContentVisible(){for(let t=this.markedContentStack.length-1;0<=t;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}e.CanvasGraphics=l;for(let t in A.OPS)void 0!==l.prototype[t]&&(l.prototype[A.OPS[t]]=l.prototype[t])},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TilingPattern=e.PathType=void 0,e.getShadingPattern=function(t){switch(t[0]){case"RadialAxial":return new s(t);case"Mesh":return new a(t);case"Dummy":return new n}throw new Error("Unknown IR type: "+t[0])},r(2);var v=r(1),_=r(168);let d={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function c(t,e){var r,i,s;e&&(r=e[2]-e[0],i=e[3]-e[1],(s=new Path2D).rect(e[0],e[1],r,i),t.clip(s))}e.PathType=d;class i{constructor(){this.constructor===i&&(0,v.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,v.unreachable)("Abstract method `getPattern` called.")}}class s extends i{constructor(t){super(),this._type=t[1],this._bbox=t[2],this._colorStops=t[3],this._p0=t[4],this._p1=t[5],this._r0=t[6],this._r1=t[7],this.matrix=null}_createGradient(t){let e;"axial"===this._type?e=t.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(e=t.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(let t of this._colorStops)e.addColorStop(t[0],t[1]);return e}getPattern(a,n,o,l){let h;if(l===d.STROKE||l===d.FILL){let t=n.current.getClippedPathBoundingBox(l,(0,_.getCurrentTransform)(a))||[0,0,0,0],e=Math.ceil(t[2]-t[0])||1,r=Math.ceil(t[3]-t[1])||1,i=n.cachedCanvases.getCanvas("pattern",e,r,!0),s=i.context;s.clearRect(0,0,s.canvas.width,s.canvas.height),s.beginPath(),s.rect(0,0,s.canvas.width,s.canvas.height),s.translate(-t[0],-t[1]),o=v.Util.transform(o,[1,0,0,1,t[0],t[1]]),s.transform(...n.baseTransform),this.matrix&&s.transform(...this.matrix),c(s,this._bbox),s.fillStyle=this._createGradient(s),s.fill(),h=a.createPattern(i.canvas,"no-repeat");l=new DOMMatrix(o);h.setTransform(l)}else c(a,this._bbox),h=this._createGradient(a);return h}}function b(t,e,r,i,s,a,f,g){var n=e.coords,m=e.colors,v=t.data,_=4*t.width;let o;n[r+1]>n[i+1]&&(o=r,r=i,i=o,o=a,a=f,f=o),n[s+1]w?1:S==w?0:(S-a)/(S-w);n=A-(A-x)*O,o=P-(P-R)*O,l=k-(k-F)*O,h=M-(M-D)*O}let e,r=(d=b-(b-x)*(e=aw?1:(y-a)/(y-w)),c=E-(E-R)*e,u=T-(T-F)*e,p=C-(C-D)*e,Math.round(Math.min(n,d))),i=Math.round(Math.max(n,d)),s=_*a+4*r;for(let t=r;t<=i;t++)(e=(n-t)/(n-d))<0?e=0:1=e?i=e:r=i/t,{scale:r,size:i}}clipBbox(t,e,r,i,s){t.ctx.rect(e,r,i-e,s-r),t.current.updateRectMinMax((0,_.getCurrentTransform)(t.ctx),[e,r,i,s]),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,e,r){var i=t.ctx,s=t.current;switch(e){case 1:let t=this.ctx;i.fillStyle=t.fillStyle,i.strokeStyle=t.strokeStyle,s.fillColor=t.fillStyle,s.strokeColor=t.strokeStyle;break;case 2:var a=v.Util.makeHexColor(r[0],r[1],r[2]);i.fillStyle=a,i.strokeStyle=a,s.fillColor=a,s.strokeColor=a;break;default:throw new v.FormatError("Unsupported paint type: "+e)}}getPattern(t,e,r,i){let s=r,a=(i!==d.SHADING&&(s=v.Util.transform(s,e.baseTransform),this.matrix)&&(s=v.Util.transform(s,this.matrix)),r=this.createPatternCanvas(e),new DOMMatrix(s));return a=(a=a.translate(r.offsetX,r.offsetY)).scale(1/r.scaleX,1/r.scaleY),(i=t.createPattern(r.canvas,"repeat")).setTransform(a),i}}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.convertBlackAndWhiteToRGBA=i,e.convertToRGBA=function(e){switch(e.kind){case f.ImageKind.GRAYSCALE_1BPP:return i(e);case f.ImageKind.RGB_24BPP:{var n=e;let{src:r,srcPos:t=0,dest:i,destPos:s=0}=n,a=0;var o=r.length>>2,l=new Uint32Array(r.buffer,t,o);if(f.FeatureTest.isLittleEndian){for(;a>>24|e<<8|4278190080,i[s+2]=e>>>16|r<<16|4278190080,i[s+3]=r>>>8|4278190080}for(let t=4*a,e=r.length;t>>8|255,i[s+2]=e<<16|r>>>16|255,i[s+3]=r<<8|255}for(let t=4*a,e=r.length;t>3,c=7&e,u=r.length;s=new Uint32Array(s.buffer);let p=0;for(let t=0;t{Object.defineProperty(e,"__esModule",{value:!0}),e.GlobalWorkerOptions=void 0;var r=Object.create(null);(e.GlobalWorkerOptions=r).workerPort=null,r.workerSrc=""},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MessageHandler=void 0,r(2);var h=r(1);function d(t){switch(t instanceof Error||"object"==typeof t&&null!==t||(0,h.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new h.AbortException(t.message);case"MissingPDFException":return new h.MissingPDFException(t.message);case"PasswordException":return new h.PasswordException(t.message,t.code);case"UnexpectedResponseException":return new h.UnexpectedResponseException(t.message,t.status);case"UnknownErrorException":return new h.UnknownErrorException(t.message,t.details);default:return new h.UnknownErrorException(t.message,t.toString())}}e.MessageHandler=class{constructor(t,e,a){this.sourceName=t,this.targetName=e,this.comObj=a,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=t=>{let s=t.data;if(s.targetName===this.sourceName)if(s.stream)this.#de(s);else if(s.callback){let t=s.callbackId,e=this.callbackCapabilities[t];if(!e)throw new Error("Cannot resolve callback "+t);if(delete this.callbackCapabilities[t],1===s.callback)e.resolve(s.data);else{if(2!==s.callback)throw new Error("Unexpected callback case");e.reject(d(s.reason))}}else{let i=this.actionHandler[s.action];if(!i)throw new Error("Unknown action from worker: "+s.action);if(s.callbackId){let e=this.sourceName,r=s.sourceName;new Promise(function(t){t(i(s.data))}).then(function(t){a.postMessage({sourceName:e,targetName:r,callback:1,callbackId:s.callbackId,data:t})},function(t){a.postMessage({sourceName:e,targetName:r,callback:2,callbackId:s.callbackId,reason:d(t)})})}else s.streamId?this.#ue(s):i(s.data)}},a.addEventListener("message",this._onComObjOnMessage)}on(t,e){var r=this.actionHandler;if(r[t])throw new Error(`There is already an actionName called "${t}"`);r[t]=e}send(t,e,r){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:e},r)}sendWithPromise(t,e,r){var i=this.callbackId++,s=new h.PromiseCapability;this.callbackCapabilities[i]=s;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:i,data:e},r)}catch(t){s.reject(t)}return s.promise}sendWithStream(r,i,t,s){let a=this.streamId++,n=this.sourceName,o=this.targetName,l=this.comObj;return new ReadableStream({start:t=>{var e=new h.PromiseCapability;return this.streamControllers[a]={controller:t,startCall:e,pullCall:null,cancelCall:null,isClosed:!1},l.postMessage({sourceName:n,targetName:o,action:r,streamId:a,data:i,desiredSize:t.desiredSize},s),e.promise},pull:t=>{var e=new h.PromiseCapability;return this.streamControllers[a].pullCall=e,l.postMessage({sourceName:n,targetName:o,stream:6,streamId:a,desiredSize:t.desiredSize}),e.promise},cancel:t=>{(0,h.assert)(t instanceof Error,"cancel must have a valid reason");var e=new h.PromiseCapability;return this.streamControllers[a].cancelCall=e,this.streamControllers[a].isClosed=!0,l.postMessage({sourceName:n,targetName:o,stream:1,streamId:a,reason:d(t)}),e.promise}},t)}#ue(e){let s=e.streamId,a=this.sourceName,n=e.sourceName,o=this.comObj,t=this,r=this.actionHandler[e.action],i={enqueue(t){var e,r=1{Object.defineProperty(e,"__esModule",{value:!0}),e.Metadata=void 0;var i=r(1);e.Metadata=class{#fe;#ge;constructor(t){var{parsedData:t,rawData:e}=t;this.#fe=t,this.#ge=e}getRaw(){return this.#ge}get(t){return this.#fe.get(t)??null}getAll(){return(0,i.objectFromMap)(this.#fe)}has(t){return this.#fe.has(t)}}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OptionalContentConfig=void 0;var a=r(1),i=r(170);let s=Symbol("INTERNAL");class n{#me=!0;constructor(t,e){this.name=t,this.intent=e}get visible(){return this.#me}_setVisible(t,e){t!==s&&(0,a.unreachable)("Internal method `_setVisible` called."),this.#me=e}}e.OptionalContentConfig=class{#be=null;#ve=new Map;#ye=null;#_e=null;constructor(t){if(this.name=null,(this.creator=null)!==t){this.name=t.name,this.creator=t.creator,this.#_e=t.order;for(var e of t.groups)this.#ve.set(e.id,new n(e.name,e.intent));if("OFF"===t.baseState)for(let t of this.#ve.values())t._setVisible(s,!1);for(var r of t.on)this.#ve.get(r)._setVisible(s,!0);for(var i of t.off)this.#ve.get(i)._setVisible(s,!1);this.#ye=this.getHash()}}#Ae(i){let t=i.length;if(t<2)return!0;var s=i[0];for(let r=1;r{Object.defineProperty(e,"__esModule",{value:!0}),e.PDFDataTransportStream=void 0,r(93),r(101),r(102),r(105),r(107),r(109),r(113),r(116),r(123),r(89);var o=r(1),s=r(168);e.PDFDataTransportStream=class{constructor(t,e){var{length:t,initialData:r,progressiveDone:i=!1,contentDispositionFilename:s=null,disableRange:a=!1,disableStream:n=!1}=t;if((0,o.assert)(e,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=i,this._contentDispositionFilename=s,0{this._onReceiveData({begin:t,chunk:e})}),this._pdfDataRangeTransport.addProgressListener((t,e)=>{this._onProgress({loaded:t,total:e})}),this._pdfDataRangeTransport.addProgressiveReadListener(t=>{this._onReceiveData({chunk:t})}),this._pdfDataRangeTransport.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),this._pdfDataRangeTransport.transportReady()}_onReceiveData(t){let{begin:e,chunk:r}=t,i=(r instanceof Uint8Array&&r.byteLength===r.buffer.byteLength?r:new Uint8Array(r)).buffer;if(void 0===e)this._fullRequestReader?this._fullRequestReader._enqueue(i):this._queuedChunks.push(i);else{let t=this._rangeReaders.some(function(t){return t._begin===e&&(t._enqueue(i),!0)});(0,o.assert)(t,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(t){void 0===t.total?this._rangeReaders[0]?.onProgress?.({loaded:t.loaded}):this._fullRequestReader?.onProgress?.({loaded:t.loaded,total:t.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){t=this._rangeReaders.indexOf(t);0<=t&&this._rangeReaders.splice(t,1)}getFullReader(){(0,o.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");var t=this._queuedChunks;return this._queuedChunks=null,new i(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,e){var r;return e<=this._progressiveDataLength?null:(r=new a(this,t,e),this._pdfDataRangeTransport.requestDataRange(t,e),this._rangeReaders.push(r),r)}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(var e of this._rangeReaders.slice(0))e.cancel(t);this._pdfDataRangeTransport.abort()}};class i{constructor(t,e){var r=2{Object.defineProperty(e,"__esModule",{value:!0}),e.PDFFetchStream=void 0,r(93),r(101),r(102),r(105),r(107),r(109),r(113),r(116),r(123),r(89);var a=r(1),n=r(182);function o(t,e,r){return{method:"GET",headers:t,signal:r.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function l(t){var e,r=new Headers;for(e in t){var i=t[e];void 0!==i&&r.append(e,i)}return r}function i(t){return t instanceof Uint8Array?t.buffer:t instanceof ArrayBuffer?t:((0,a.warn)("getArrayBuffer - unexpected data format: "+t),new Uint8Array(t).buffer)}e.PDFFetchStream=class{constructor(t){this.source=t,this.isHttp=/^https?:/i.test(t.url),this.httpHeaders=this.isHttp&&t.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return(0,a.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new s(this),this._fullRequestReader}getRangeReader(t,e){return e<=this._progressiveDataLength?null:(t=new h(this,t,e),this._rangeRequestReaders.push(t),t)}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(var e of this._rangeRequestReaders.slice(0))e.cancel(t)}};class s{constructor(t){this._stream=t,this._reader=null,this._loaded=0,this._filename=null;t=t.source;this._withCredentials=t.withCredentials||!1,this._contentLength=t.length,this._headersCapability=new a.PromiseCapability,this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._headers=l(this._stream.httpHeaders);let s=t.url;fetch(s,o(this._headers,this._withCredentials,this._abortController)).then(e=>{if(!(0,n.validateResponseStatus)(e.status))throw(0,n.createResponseStatusError)(e.status,s);this._reader=e.body.getReader(),this._headersCapability.resolve();var t=t=>e.headers.get(t),{allowRangeRequests:r,suggestedLength:i}=(0,n.validateRangeRequestCapabilities)({getResponseHeader:t,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=r,this._contentLength=i||this._contentLength,this._filename=(0,n.extractFilenameFromHeader)(t),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new a.AbortException("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._headersCapability.promise;var{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:i(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}class h{constructor(t,e,r){this._stream=t,this._reader=null,this._loaded=0;t=t.source;this._withCredentials=t.withCredentials||!1,this._readCapability=new a.PromiseCapability,this._isStreamingSupported=!t.disableStream,this._abortController=new AbortController,this._headers=l(this._stream.httpHeaders),this._headers.append("Range",`bytes=${e}-`+(r-1));let i=t.url;fetch(i,o(this._headers,this._withCredentials,this._abortController)).then(t=>{if(!(0,n.validateResponseStatus)(t.status))throw(0,n.createResponseStatusError)(t.status,i);this._readCapability.resolve(),this._reader=t.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;var{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded}),{value:i(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createResponseStatusError=function(t,e){return 404===t||0===t&&e.startsWith("file:")?new i.MissingPDFException('Missing PDF "'+e+'".'):new i.UnexpectedResponseException(`Unexpected server response (${t}) while retrieving PDF "${e}".`,t)},e.extractFilenameFromHeader=function(e){e=e("Content-Disposition");if(e){let t=(0,s.getFilenameFromContentDispositionHeader)(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch{}if((0,a.isPdfFile)(t))return t}return null},e.validateRangeRequestCapabilities=function(t){var{getResponseHeader:t,isHttp:e,rangeChunkSize:r,disableRange:i}=t,s={allowRangeRequests:!1,suggestedLength:void 0},a=parseInt(t("Content-Length"),10);return!Number.isInteger(a)||(s.suggestedLength=a)<=2*r||!i&&e&&"bytes"===t("Accept-Ranges")&&"identity"===(t("Content-Encoding")||"identity")&&(s.allowRangeRequests=!0),s},e.validateResponseStatus=function(t){return 200===t||206===t};var i=r(1),s=r(183),a=r(168)},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getFilenameFromContentDispositionHeader=function(t){let s=!0,e=o("filename\\*","i").exec(t);var r;return e?(r=l(e=e[1]),i(r=n(r=h(r=unescape(r))))):(e=(t=>{for(var i=[],e=o("filename\\*((?!0\\d)\\d+)(\\*?)","ig");null!==(r=e.exec(t));){var[,r,s,a]=r;if((r=parseInt(r,10))in i){if(0===r)break}else i[r]=[s,a]}var n=[];for(let r=0;r{Object.defineProperty(e,"__esModule",{value:!0}),e.PDFNetworkStream=void 0,r(89);var a=r(1),n=r(182);class i{constructor(t){var e=1"string"!=typeof(t=t.response)?t:(0,a.stringToBytes)(t).buffer)(i);if(206===t){let t=i.getResponseHeader("Content-Range"),e=/bytes (\d+)-(\d+)\/(\d+)/.exec(t);r.onDone({begin:parseInt(e[1],10),chunk:s})}else s?r.onDone({begin:0,chunk:s}):r.onError?.(i.status)}else r.onError?.(i.status)}}}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){var e=this.pendingRequests[t].xhr;delete this.pendingRequests[t],e.abort()}}e.PDFNetworkStream=class{constructor(t){this._source=t,this._manager=new i(t.url,{httpHeaders:t.httpHeaders,withCredentials:t.withCredentials}),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){t=this._rangeRequestReaders.indexOf(t);0<=t&&this._rangeRequestReaders.splice(t,1)}getFullReader(){return(0,a.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new s(this._manager,this._source),this._fullRequestReader}getRangeReader(t,e){t=new o(this._manager,t,e);return t.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(t),t}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(var e of this._rangeRequestReaders.slice(0))e.cancel(t)}};class s{constructor(t,e){this._manager=t;var r={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=e.url,this._fullRequestId=t.requestFull(r),this._headersReceivedCapability=new a.PromiseCapability,this._disableRange=e.disableRange||!1,this._contentLength=e.length,this._rangeChunkSize=e.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){let t=this._fullRequestId,e=this._manager.getRequestXhr(t),r=t=>e.getResponseHeader(t),{allowRangeRequests:i,suggestedLength:s}=(0,n.validateRangeRequestCapabilities)({getResponseHeader:r,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});i&&(this._isRangeSupported=!0),this._contentLength=s||this._contentLength,this._filename=(0,n.extractFilenameFromHeader)(r),this._isRangeSupported&&this._manager.abortRequest(t),this._headersReceivedCapability.resolve()}_onDone(t){if(t&&(0{Object.defineProperty(e,"__esModule",{value:!0}),e.PDFNodeStream=void 0,r(89),r(93),r(101),r(102),r(105),r(107),r(109),r(113),r(116),r(123);var s=r(1),a=r(182);let n=/^file:\/\/\/[a-zA-Z]:\//;e.PDFNodeStream=class{constructor(t){this.source=t,this.url=(t=>{var e=require("url"),r=e.parse(t);if("file:"!==r.protocol&&!r.host){if(/^[a-z]:[/\\]/i.test(t))return e.parse("file:///"+t);r.host||(r.protocol="file:")}return r})(t.url),this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol,this.isFsUrl="file:"===this.url.protocol,this.httpHeaders=this.isHttp&&t.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return(0,s.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=new(this.isFsUrl?c:h)(this),this._fullRequestReader}getRangeReader(t,e){return e<=this._progressiveDataLength?null:(t=new(this.isFsUrl?u:d)(this,t,e),this._rangeRequestReaders.push(t),t)}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(var e of this._rangeRequestReaders.slice(0))e.cancel(t)}};class i{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null;t=t.source;this._contentLength=t.length,this._loaded=0,this._filename=null,this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._readableStream=null,this._readCapability=new s.PromiseCapability,this._headersCapability=new s.PromiseCapability}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;var t=this._readableStream.read();return null===t?(this._readCapability=new s.PromiseCapability,this.read()):(this._loaded+=t.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){(this._readableStream=t).on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",t=>{this._error(t)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new s.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class o{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=new s.PromiseCapability;t=t.source;this._isStreamingSupported=!t.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;var t=this._readableStream.read();return null===t?(this._readCapability=new s.PromiseCapability,this.read()):(this._loaded+=t.length,this.onProgress?.({loaded:this._loaded}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){(this._readableStream=t).on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",t=>{this._error(t)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function l(t,e){return{protocol:t.protocol,auth:t.auth,host:t.hostname,port:t.port,path:t.path,method:"GET",headers:e}}class h extends i{constructor(i){super(i);var t,e=t=>{if(404===t.statusCode){let t=new s.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=t,void this._headersCapability.reject(t)}else{this._headersCapability.resolve(),this._setReadableStream(t);var t=t=>this._readableStream.headers[t.toLowerCase()],{allowRangeRequests:e,suggestedLength:r}=(0,a.validateRangeRequestCapabilities)({getResponseHeader:t,isHttp:i.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=e,this._contentLength=r||this._contentLength,this._filename=(0,a.extractFilenameFromHeader)(t)}};this._request=null,"http:"===this._url.protocol?(t=require("http"),this._request=t.request(l(this._url,i.httpHeaders),e)):(t=require("https"),this._request=t.request(l(this._url,i.httpHeaders),e)),this._request.on("error",t=>{this._storedError=t,this._headersCapability.reject(t)}),this._request.end()}}class d extends o{constructor(r,e,t){super(r),this._httpHeaders={};for(let e in r.httpHeaders){let t=r.httpHeaders[e];void 0!==t&&(this._httpHeaders[e]=t)}this._httpHeaders.Range=`bytes=${e}-`+(t-1);e=t=>{if(404!==t.statusCode)this._setReadableStream(t);else{let t=new s.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=t}};if(this._request=null,"http:"===this._url.protocol){let t=require("http");this._request=t.request(l(this._url,this._httpHeaders),e)}else{let t=require("https");this._request=t.request(l(this._url,this._httpHeaders),e)}this._request.on("error",t=>{this._storedError=t}),this._request.end()}}class c extends i{constructor(t){super(t);let r=decodeURIComponent(this._url.path),i=(n.test(this._url.href)&&(r=r.replace(/^\//,"")),require("fs"));i.lstat(r,(t,e)=>{t?("ENOENT"===t.code&&(t=new s.MissingPDFException(`Missing PDF "${r}".`)),this._storedError=t,this._headersCapability.reject(t)):(this._contentLength=e.size,this._setReadableStream(i.createReadStream(r)),this._headersCapability.resolve())})}}class u extends o{constructor(t,e,r){super(t);let i=decodeURIComponent(this._url.path);n.test(this._url.href)&&(i=i.replace(/^\//,""));t=require("fs");this._setReadableStream(t.createReadStream(i,{start:e,end:r-1}))}}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SVGGraphics=void 0,r(84),r(86),r(87),r(93),r(101),r(102),r(105),r(107),r(109),r(113),r(116),r(123),r(2),r(89),r(187);var i=r(168),v=r(1);function _(r){var t=1>2]+i[(3&a)<<4|n>>4]+i[t+1>6:64]+i[t+2{let f=new Uint8Array([137,80,78,71,13,10,26,10]),n=new Int32Array(256);for(let t=0;t<256;t++){let e=t;for(let t=0;t<8;t++)e=1&e?3988292384^e>>1&2147483647:e>>1&2147483647;n[t]=e}function g(t,e,r,i){var s=i,a=e.length,a=(r[s]=a>>24&255,r[s+1]=a>>16&255,r[s+2]=a>>8&255,r[s+3]=255&a,r[s+=4]=255&t.charCodeAt(0),r[s+1]=255&t.charCodeAt(1),r[s+2]=255&t.charCodeAt(2),r[s+3]=255&t.charCodeAt(3),r.set(e,s+=4),((r,t,i)=>{let s=-1;for(let e=t;e>>8^n[t]}return-1^s})(r,i+4,s+=e.length));r[s]=a>>24&255,r[s+1]=a>>16&255,r[s+2]=a>>8&255,r[s+3]=255&a}function m(t){let e=t.length;var r=65535,i=Math.ceil(e/r),s=new Uint8Array(2+e+5*i+4);let a=0,n=(s[a++]=120,s[a++]=156,0);for(;e>r;)s[a++]=0,s[a++]=255,s[a++]=255,s[a++]=0,s[a++]=0,s.set(t.subarray(n,n+r),a),a+=r,n+=r,e-=r;s[a++]=1,s[a++]=255&e,s[a++]=e>>8&255,s[a++]=255&~e,s[a++]=(65535&~e)>>8&255,s.set(t.subarray(n),a),a+=t.length-n;i=((e,r,i)=>{let s=1,a=0;for(let t=r;t>24&255,s[a++]=i>>16&255,s[a++]=i>>8&255,s[a++]=255&i,s}function i(t,e,r,i){var s=t.width,a=t.height;let n,o,l;var h=t.data;switch(e){case v.ImageKind.GRAYSCALE_1BPP:o=0,n=1,l=s+7>>3;break;case v.ImageKind.RGB_24BPP:o=2,n=8,l=3*s;break;case v.ImageKind.RGBA_32BPP:o=6,n=8,l=4*s;break;default:throw new Error("invalid format")}var d=new Uint8Array((1+l)*a);let c=0,u=0;for(let t=0;t>24&255,s>>16&255,s>>8&255,255&s,a>>24&255,a>>16&255,a>>8&255,255&a,n,o,0,0,0]),e=(t=>{if(v.isNodeJS)try{var e=8<=parseInt(process.versions.node)?t:Buffer.from(t),r=require("zlib").deflateSync(e,{level:9});return r instanceof Uint8Array?r:new Uint8Array(r)}catch(t){(0,v.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+t)}return m(t)})(d),i=f.length+36+t.length+e.length,i=new Uint8Array(i),p=0;return i.set(f,0),g("IHDR",t,i,p+=f.length),g("IDATA",e,i,p+=12+t.length),p+=12+e.length,g("IEND",new Uint8Array(0),i,p),_(i,"image/png",r)}return function(t,e,r){return i(t,void 0===t.kind?v.ImageKind.GRAYSCALE_1BPP:t.kind,e,r)}})();class o{constructor(){this.fontSizeScale=1,this.fontWeight="normal",this.fontSize=0,this.textMatrix=v.IDENTITY_MATRIX,this.fontMatrix=v.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=v.TextRenderingMode.FILL,this.textMatrixScale=1,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.lineJoin="",this.lineCap="",this.miterLimit=0,this.dashArray=[],this.dashPhase=0,this.dependencies=[],this.activeClipUrl=null,this.clipGroup=null,this.maskId=""}clone(){return Object.create(this)}setCurrentPoint(t,e){this.x=t,this.y=e}}function b(t){if(Number.isInteger(t))return t.toString();var e=t.toFixed(10);let r=e.length-1;if("0"!==e[r])return e;for(;"0"===e[--r];);return e.substring(0,"."===e[r]?r:r+1)}function y(t){if(0===t[4]&&0===t[5]){if(0===t[1]&&0===t[2])return 1===t[0]&&1===t[3]?"":`scale(${b(t[0])} ${b(t[3])})`;if(t[0]===t[3]&&t[1]===-t[2])return`rotate(${b(180*Math.acos(t[0])/Math.PI)})`}else if(1===t[0]&&0===t[1]&&0===t[2]&&1===t[3])return`translate(${b(t[4])} ${b(t[5])})`;return`matrix(${b(t[0])} ${b(t[1])} ${b(t[2])} ${b(t[3])} ${b(t[4])} ${b(t[5])})`}let l=0,h=0,f=0;e.SVGGraphics=class{constructor(t,e){var r=2{e.get(r,t)});this.current.dependencies.push(t)}return Promise.all(this.current.dependencies)}transform(t,e,r,i,s,a){this.transformMatrix=v.Util.transform(this.transformMatrix,[t,e,r,i,s,a]),this.tgrp=null}getSVG(t,e){this.viewport=e;let r=this._initialize(e);return this.loadDependencies(t).then(()=>(this.transformMatrix=v.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(t)),r))}convertOpList(e){var r=this._operatorIdMapping,i=e.argsArray,s=e.fnArray,a=[];for(let t=0,e=s.length;t{var i=r(3),s=r(188),r=r(193);i({target:"Array",proto:!0},{group:function(t){return s(this,t,1{var p=r(99),i=r(14),f=r(13),g=r(40),m=r(18),v=r(64),_=r(189),b=r(108),y=Array,A=i([].push);t.exports=function(t,e,r,i){for(var s,a,n,o=g(t),l=f(o),h=p(e,r),d=_(null),c=v(l),u=0;u{function i(){}function s(t){t.write(g("")),t.close();var e=t.parentWindow.Object;return t=null,e}var a,n=r(47),o=r(190),l=r(66),h=r(55),d=r(192),c=r(43),r=r(54),u="prototype",p="script",f=r("IE_PROTO"),g=function(t){return"<"+p+">"+t+""},m=function(){try{a=new ActiveXObject("htmlfile")}catch(r){}var t,e;m="undefined"==typeof document||document.domain&&a?s(a):(t=c("iframe"),e="java"+p+":",t.style.display="none",d.appendChild(t),t.src=String(e),(e=t.contentWindow.document).open(),e.write(g("document.F=Object")),e.close(),e.F);for(var r=l.length;r--;)delete m[u][l[r]];return m()};h[f]=!0,t.exports=Object.create||function(t,e){var r;return null!==t?(i[u]=n(t),r=new i,i[u]=null,r[f]=t):r=m(),void 0===e?r:o.f(r,e)}},(t,e,r)=>{var i=r(6),s=r(46),o=r(45),l=r(47),h=r(12),d=r(191);e.f=i&&!s?Object.defineProperties:function(t,e){l(t);for(var r,i=h(e),s=d(e),a=s.length,n=0;n{var i=r(59),s=r(66);t.exports=Object.keys||function(t){return i(t,s)}},(t,e,r)=>{r=r(24);t.exports=r("document","documentElement")},(t,e,r)=>{var i=r(34),s=r(189),r=r(45).f,a=i("unscopables"),n=Array.prototype;void 0===n[a]&&r(n,a,{configurable:!0,value:s(null)}),t.exports=function(t){n[a][t]=!0}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.XfaText=void 0,r(89);class a{static textContent(t){let s=[],e={items:s,styles:Object.create(null)};return function e(r){if(r){let t=null;var i=r.name;if("#text"===i)t=r.value;else{if(!a.shouldBuildText(i))return;r?.attributes?.textContent?t=r.attributes.textContent:r.value&&(t=r.value)}if(null!==t&&s.push({str:t}),r.children)for(let t of r.children)e(t)}}(t),e}static shouldBuildText(t){return!("textarea"===t||"input"===t||"option"===t||"select"===t)}}e.XfaText=a},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TextLayerRenderTask=void 0,e.renderTextLayer=function(t){t.textContentSource||!t.textContent&&!t.textContentStream||((0,l.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters will be removed in the future, please use `textContentSource` instead."),t.textContentSource=t.textContent||t.textContentStream);var{container:e,viewport:r}=t,e=getComputedStyle(e),i=e.getPropertyValue("visibility"),e=parseFloat(e.getPropertyValue("--scale-factor")),i=("visible"===i&&(!e||1e-5{var r=p.get(e);if(r)return r;(r=f(30,t)).font="30px "+e;let i=(t=r.measureText("")).fontBoundingBoxAscent,s=Math.abs(t.fontBoundingBoxDescent);if(i){let t=i/(i+s);return p.set(e,t),r.canvas.width=r.canvas.height=0,t}r.strokeStyle="red",r.clearRect(0,0,30,30),r.strokeText("g",0,0);let a=r.getImageData(0,0,30,30).data;s=0;for(let t=a.length-1-3;0<=t;t-=4)if(0{this._layoutTextParams=null}).catch(()=>{})}get promise(){return this._capability.promise}cancel(){this._canceled=!0,this._reader&&(this._reader.cancel(new u.AbortException("TextLayer task cancelled.")).catch(()=>{}),this._reader=null),this._capability.reject(new u.AbortException("TextLayer task cancelled."))}_processItems(t,e){for(var r of t)if(void 0!==r.str)this._textContentItemsStr.push(r.str),i(this,r,e);else if("beginMarkedContentProps"===r.type||"beginMarkedContent"===r.type){let t=this._container;this._container=document.createElement("span"),this._container.classList.add("markedContent"),null!==r.id&&this._container.setAttribute("id",""+r.id),t.append(this._container)}else"endMarkedContent"===r.type&&(this._container=this._container.parentNode)}_layoutText(t){var e=this._layoutTextParams.properties=this._textDivProperties.get(t);if(this._layoutTextParams.div=t,h(this._layoutTextParams),e.hasText&&this._container.append(t),e.hasEOL){let t=document.createElement("br");t.setAttribute("role","presentation"),this._container.append(t)}}_render(){let i=new u.PromiseCapability,s=Object.create(null);if(this._isReadableStream){let r=()=>{this._reader.read().then(t=>{var{value:t,done:e}=t;e?i.resolve():(Object.assign(s,t.styles),this._processItems(t.items,s),r())},i.reject)};this._reader=this._textContentSource.getReader(),r()}else{if(!this._textContentSource)throw new Error('No "textContentSource" parameter specified.');{let{items:t,styles:e}=this._textContentSource;this._processItems(t,e),i.resolve()}}i.promise.then(()=>{s=null;var r=this;if(!r._canceled){let e=r._textDivs,t=r._capability;if(!(1e5{Object.defineProperty(e,"__esModule",{value:!0}),e.AnnotationEditorLayer=void 0,r(125),r(136),r(138),r(141),r(143),r(145),r(147);var i=r(1),s=r(164),l=r(197),h=r(202),a=r(168),d=r(203);class c{#Se;#Ee=!1;#xe=null;#we=this.pointerup.bind(this);#Ce=this.pointerdown.bind(this);#Te=new Map;#Pe=!1;#ke=!1;#Me=!1;#Fe;static _initialized=!1;constructor(t){var{uiManager:t,pageIndex:e,div:r,accessibilityManager:i,annotationLayer:s,viewport:a,l10n:n}=t,o=[l.FreeTextEditor,h.InkEditor,d.StampEditor];if(!c._initialized){c._initialized=!0;for(let t of o)t.initialize(n)}t.registerEditorTypes(o),this.#Fe=t,this.pageIndex=e,this.div=r,this.#Se=i,this.#xe=s,this.viewport=a,this.#Fe.addLayer(this)}get isEmpty(){return 0===this.#Te.size}updateToolbar(t){this.#Fe.updateToolbar(t)}updateMode(){var t=0{this.#Fe.focusMainContainer()},0),t.div.remove(),t.isAttachedToDOM=!1,this.#ke||this.addInkEditorIfNeeded(!1)}changeParent(t){t.parent!==this&&(t.annotationElementId&&(this.#Fe.addDeletedAnnotationElement(t.annotationElementId),s.AnnotationEditor.deleteAnnotationElement(t),t.annotationElementId=null),this.attach(t),t.parent?.detach(t),t.setParent(this),t.div)&&t.isAttachedToDOM&&(t.div.remove(),this.div.append(t.div))}add(t){var e;this.changeParent(t),this.#Fe.addEditor(t),this.attach(t),t.isAttachedToDOM||(e=t.render(),this.div.append(e),t.isAttachedToDOM=!0),t.fixAndSetPosition(),t.onceAdded(),this.#Fe.addToAnnotationStorage(t)}moveEditorInDOM(e){if(e.isAttachedToDOM){let t=document.activeElement;e.div.contains(t)&&(e._focusEventsAllowed=!1,setTimeout(()=>{e.div.contains(document.activeElement)?e._focusEventsAllowed=!0:(e.div.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0}),t.focus())},0)),e._structTreeParentId=this.#Se?.moveElementInDOM(this.div,e.div,e.contentDiv,!0)}}addOrRebuild(t){t.needsToBeRebuilt()?t.rebuild():this.add(t)}addUndoableEditor(t){this.addCommands({cmd:()=>t._uiManager.rebuild(t),undo:()=>{t.remove()},mustExec:!1})}getNextId(){return this.#Fe.getId()}#Ie(t){switch(this.#Fe.getMode()){case i.AnnotationEditorType.FREETEXT:return new l.FreeTextEditor(t);case i.AnnotationEditorType.INK:return new h.InkEditor(t);case i.AnnotationEditorType.STAMP:return new d.StampEditor(t)}return null}pasteEditor(t,e){this.#Fe.updateToolbar(t),this.#Fe.updateMode(t);var{offsetX:t,offsetY:r}=this.#Oe(),i=this.getNextId(),i=this.#Ie({parent:this,id:i,x:t,y:r,uiManager:this.#Fe,isCentered:!0,...e});i&&this.add(i)}deserialize(t){switch(t.annotationType??t.annotationEditorType){case i.AnnotationEditorType.FREETEXT:return l.FreeTextEditor.deserialize(t,this,this.#Fe);case i.AnnotationEditorType.INK:return h.InkEditor.deserialize(t,this,this.#Fe);case i.AnnotationEditorType.STAMP:return d.StampEditor.deserialize(t,this,this.#Fe)}return null}#De(t,e){var r=this.getNextId(),r=this.#Ie({parent:this,id:r,x:t.offsetX,y:t.offsetY,uiManager:this.#Fe,isCentered:e});return r&&this.add(r),r}#Oe(){var{x:t,y:e,width:r,height:i}=this.div.getBoundingClientRect(),s=Math.max(0,t),a=Math.max(0,e),s=(s+Math.min(window.innerWidth,t+r))/2-t,r=(a+Math.min(window.innerHeight,e+i))/2-e,[t,a]=this.viewport.rotation%180==0?[s,r]:[r,s];return{offsetX:t,offsetY:a}}addNewEditor(){this.#De(this.#Oe(),!0)}setSelected(t){this.#Fe.setSelected(t)}toggleSelected(t){this.#Fe.toggleSelected(t)}isSelected(t){return this.#Fe.isSelected(t)}unselect(t){this.#Fe.unselect(t)}pointerup(t){var e=i.FeatureTest.platform.isMac;0!==t.button||t.ctrlKey&&e||t.target!==this.div||!this.#Pe||(this.#Pe=!1,this.#Ee?this.#Fe.getMode()!==i.AnnotationEditorType.STAMP?this.#De(t,!1):this.#Fe.unselectAll():this.#Ee=!0)}pointerdown(t){var e;this.#Pe?this.#Pe=!1:(e=i.FeatureTest.platform.isMac,0!==t.button||t.ctrlKey&&e||t.target===this.div&&(this.#Pe=!0,e=this.#Fe.getActive(),this.#Ee=!e||e.isEmpty()))}findNewParent(t,e,r){e=this.#Fe.findParent(e,r);return null!==e&&e!==this&&(e.changeParent(t),!0)}destroy(){this.#Fe.getActive()?.parent===this&&(this.#Fe.commitOrRemove(),this.#Fe.setActiveEditor(null));for(var t of this.#Te.values())this.#Se?.removePointerInTextLayer(t.contentDiv),t.setParent(null),t.isAttachedToDOM=!1,t.div.remove();this.div=null,this.#Te.clear(),this.#Fe.removeLayer(this)}#Re(){this.#ke=!0;for(var t of this.#Te.values())t.isEmpty()&&t.remove();this.#ke=!1}render(t){t=t.viewport;this.viewport=t,(0,a.setLayerDimensions)(this.div,t);for(let t of this.#Fe.getEditors(this.pageIndex))this.add(t);this.updateMode()}update(t){t=t.viewport;this.#Fe.commitOrRemove(),this.viewport=t,(0,a.setLayerDimensions)(this.div,{rotation:t.rotation}),this.updateMode()}get pageDimensions(){var{pageWidth:t,pageHeight:e}=this.viewport.rawDims;return[t,e]}}e.AnnotationEditorLayer=c},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FreeTextEditor=void 0,r(89);var d=r(1),s=r(165),i=r(164),a=r(198);class n extends i.AnnotationEditor{#Le=this.editorDivBlur.bind(this);#Ne=this.editorDivFocus.bind(this);#Be=this.editorDivInput.bind(this);#je=this.editorDivKeydown.bind(this);#Ue;#ze="";#We=this.id+"-editor";#He;#qe=null;static _freeTextDefaultContent="";static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){var t=n.prototype,e=t=>t.isEmpty(),r=s.AnnotationEditorUIManager.TRANSLATE_SMALL,i=s.AnnotationEditorUIManager.TRANSLATE_BIG;return(0,d.shadow)(this,"_keyboardManager",new s.KeyboardManager([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],t.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],t.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],t._translateEmpty,{args:[-r,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t._translateEmpty,{args:[-i,0],checker:e}],[["ArrowRight","mac+ArrowRight"],t._translateEmpty,{args:[r,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t._translateEmpty,{args:[i,0],checker:e}],[["ArrowUp","mac+ArrowUp"],t._translateEmpty,{args:[0,-r],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t._translateEmpty,{args:[0,-i],checker:e}],[["ArrowDown","mac+ArrowDown"],t._translateEmpty,{args:[0,r],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t._translateEmpty,{args:[0,i],checker:e}]]))}static _type="freetext";constructor(t){super({...t,name:"freeTextEditor"}),this.#Ue=t.color||n._defaultColor||i.AnnotationEditor._defaultLineColor,this.#He=t.fontSize||n._defaultFontSize}static initialize(t){i.AnnotationEditor.initialize(t,{strings:["free_text2_default_content","editor_free_text2_aria_label"]});t=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(t.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,e){switch(t){case d.AnnotationEditorParamsType.FREETEXT_SIZE:n._defaultFontSize=e;break;case d.AnnotationEditorParamsType.FREETEXT_COLOR:n._defaultColor=e}}updateParams(t,e){switch(t){case d.AnnotationEditorParamsType.FREETEXT_SIZE:this.#Ge(e);break;case d.AnnotationEditorParamsType.FREETEXT_COLOR:this.#Ve(e)}}static get defaultPropertiesToUpdate(){return[[d.AnnotationEditorParamsType.FREETEXT_SIZE,n._defaultFontSize],[d.AnnotationEditorParamsType.FREETEXT_COLOR,n._defaultColor||i.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[d.AnnotationEditorParamsType.FREETEXT_SIZE,this.#He],[d.AnnotationEditorParamsType.FREETEXT_COLOR,this.#Ue]]}#Ge(t){let e=t=>{this.editorDiv.style.fontSize=`calc(${t}px * var(--scale-factor))`,this.translate(0,-(t-this.#He)*this.parentScale),this.#He=t,this.#$e()},r=this.#He;this.addCommands({cmd:()=>{e(t)},undo:()=>{e(r)},mustExec:!0,type:d.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}#Ve(t){let e=this.#Ue;this.addCommands({cmd:()=>{this.#Ue=this.editorDiv.style.color=t},undo:()=>{this.#Ue=this.editorDiv.style.color=e},mustExec:!0,type:d.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(t,e){this._uiManager.translateSelectedEditors(t,e,!0)}getInitialTranslation(){var t=this.parentScale;return[-n._internalPadding*t,-(n._internalPadding+this.#He)*t]}rebuild(){this.parent&&(super.rebuild(),null===this.div||this.isAttachedToDOM||this.parent.add(this))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(d.AnnotationEditorType.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),this.editorDiv.addEventListener("keydown",this.#je),this.editorDiv.addEventListener("focus",this.#Ne),this.editorDiv.addEventListener("blur",this.#Le),this.editorDiv.addEventListener("input",this.#Be))}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",this.#We),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",this.#je),this.editorDiv.removeEventListener("focus",this.#Ne),this.editorDiv.removeEventListener("blur",this.#Le),this.editorDiv.removeEventListener("input",this.#Be),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freeTextEditing"))}focusin(t){this._focusEventsAllowed&&(super.focusin(t),t.target!==this.editorDiv)&&this.editorDiv.focus()}onceAdded(){this.width?this.#Xe():(this.enableEditMode(),this.editorDiv.focus(),this._initialOptions?.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freeTextEditing")),super.remove()}#Ke(){var t=this.editorDiv.getElementsByTagName("div");if(0===t.length)return this.editorDiv.innerText;var e,r=[];for(e of t)r.push(e.innerText.replace(/\r\n?|\n/,""));return r.join("\n")}#$e(){let[t,e]=this.parentDimensions,i;if(this.isAttachedToDOM)i=this.div.getBoundingClientRect();else{let{currentLayer:t,div:e}=this,r=e.style.display;e.style.display="hidden",t.div.append(this.div),i=e.getBoundingClientRect(),e.remove(),e.style.display=r}this.rotation%180==this.parentRotation%180?(this.width=i.width/t,this.height=i.height/e):(this.width=i.height/t,this.height=i.width/e),this.fixAndSetPosition()}commit(){if(this.isInEditMode()){super.commit(),this.disableEditMode();let e=this.#ze,r=this.#ze=this.#Ke().trimEnd();if(e!==r){let t=t=>{(this.#ze=t)?(this.#Ye(),this._uiManager.rebuild(this),this.#$e()):this.remove()};this.addCommands({cmd:()=>{t(r)},undo:()=>{t(e)},mustExec:!1}),this.#$e()}}}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(t){this.enterInEditMode()}keydown(t){t.target===this.div&&"Enter"===t.key&&(this.enterInEditMode(),t.preventDefault())}editorDivKeydown(t){n._keyboardManager.exec(this,t)}editorDivFocus(t){this.isEditing=!0}editorDivBlur(t){this.isEditing=!1}editorDivInput(t){this.parent.div.classList.toggle("freeTextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(!this.div){let o,l,t=(this.width&&(o=this.x,l=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",this.#We),this.enableEditing(),i.AnnotationEditor._l10nPromise.get("editor_free_text2_aria_label").then(t=>this.editorDiv?.setAttribute("aria-label",t)),i.AnnotationEditor._l10nPromise.get("free_text2_default_content").then(t=>this.editorDiv?.setAttribute("default-content",t)),this.editorDiv.contentEditable=!0,this.editorDiv).style;if(t.fontSize=`calc(${this.#He}px * var(--scale-factor))`,t.color=this.#Ue,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),(0,s.bindEvents)(this,this.div,["dblclick","keydown"]),this.width){let[a,n]=this.parentDimensions;if(this.annotationElementId){let t=this.#qe.position,[e,r]=this.getInitialTranslation();[e,r]=this.pageTranslationToScreen(e,r);var[h,d]=this.pageDimensions,[c,u]=this.pageTranslation;let i,s;switch(this.rotation){case 0:i=o+(t[0]-c)/h,s=l+this.height-(t[1]-u)/d;break;case 90:i=o+(t[0]-c)/h,s=l-(t[1]-u)/d,[e,r]=[r,-e];break;case 180:i=o-this.width+(t[0]-c)/h,s=l-(t[1]-u)/d,[e,r]=[-e,-r];break;case 270:i=o+(t[0]-c-this.height*d)/h,s=l+(t[1]-u-this.width*h)/d,[e,r]=[-r,e]}this.setAt(i*a,s*n,e,r)}else this.setAt(o*a,l*n,this.width*a,this.height*n);this.#Ye(),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0}return this.div}#Ye(){if(this.editorDiv.replaceChildren(),this.#ze)for(var t of this.#ze.split("\n")){var e=document.createElement("div");e.append(t?document.createTextNode(t):document.createElement("br")),this.editorDiv.append(e)}}get contentDiv(){return this.editorDiv}static deserialize(l,t,e){let h=null;if(l instanceof a.FreeTextAnnotationElement){let{data:{defaultAppearanceData:{fontSize:t,fontColor:e},rect:r,rotation:i,id:s},textContent:a,textPosition:n,parent:{page:{pageNumber:o}}}=l;if(!a||0===a.length)return null;h=l={annotationType:d.AnnotationEditorType.FREETEXT,color:Array.from(e),fontSize:t,value:a.join("\n"),position:n,pageIndex:o-1,rect:r,rotation:i,id:s,deleted:!1}}let r=super.deserialize(l,t,e);return r.#He=l.fontSize,r.#Ue=d.Util.makeHexColor(...l.color),r.#ze=l.value,r.annotationElementId=l.id||null,r.#qe=h,r}serialize(){var t=01<=Math.abs(t-s[e]))||t.color.some((t,e)=>t!==i[e])||t.pageIndex!==a}#Xe(){var t=0this.#Xe(!0),0))}}e.FreeTextEditor=n},(L,t,e)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StampAnnotationElement=t.InkAnnotationElement=t.FreeTextAnnotationElement=t.AnnotationLayer=void 0,e(89),e(125),e(136),e(138),e(141),e(143),e(145),e(147);var u=e(1),c=e(168),i=e(163),s=e(199),n=e(200),p=e(201);let f=new WeakSet;function g(t){return{width:t[2]-t[0],height:t[3]-t[1]}}class o{static create(t){switch(t.data.annotationType){case u.AnnotationType.LINK:return new r(t);case u.AnnotationType.TEXT:return new l(t);case u.AnnotationType.WIDGET:switch(t.data.fieldType){case"Tx":return new h(t);case"Btn":return new(t.data.radioButton?_:t.data.checkBox?v:b)(t);case"Ch":return new y(t);case"Sig":return new d(t)}return new m(t);case u.AnnotationType.POPUP:return new A(t);case u.AnnotationType.FREETEXT:return new x(t);case u.AnnotationType.LINE:return new w(t);case u.AnnotationType.SQUARE:return new E(t);case u.AnnotationType.CIRCLE:return new T(t);case u.AnnotationType.POLYLINE:return new C(t);case u.AnnotationType.CARET:return new k(t);case u.AnnotationType.INK:return new M(t);case u.AnnotationType.POLYGON:return new P(t);case u.AnnotationType.HIGHLIGHT:return new R(t);case u.AnnotationType.UNDERLINE:return new F(t);case u.AnnotationType.SQUIGGLY:return new D(t);case u.AnnotationType.STRIKEOUT:return new I(t);case u.AnnotationType.STAMP:return new O(t);case u.AnnotationType.FILEATTACHMENT:return new N(t);default:return new a(t)}}}class a{#Qe=!1;constructor(t){var{isRenderable:e=!1,ignoreBorder:r=!1,createQuadrilaterals:i=!1}=1{var t=r.detail[t],i=t[0],t=t.slice(1);r.target.style[e]=s.ColorConverters[i+"_HTML"](t),this.annotationStorage.setValue(this.data.id,{[e]:s.ColorConverters[i+"_rgb"](t)})};return(0,u.shadow)(this,"_commonActions",{display:t=>{var t=t.detail.display,e=t%2==1;this.container.style.visibility=e?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:e,noPrint:1===t||2===t})},print:t=>{this.annotationStorage.setValue(this.data.id,{noPrint:!t.detail.print})},hidden:t=>{t=t.detail.hidden;this.container.style.visibility=t?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:t,noView:t})},focus:t=>{setTimeout(()=>t.target.focus({preventScroll:!1}),0)},userName:t=>{t.target.title=t.detail.userName},readonly:t=>{t.target.disabled=t.detail.readonly},required:t=>{this._setRequired(t.target,t.detail.required)},bgColor:t=>{e("bgColor","backgroundColor",t)},fillColor:t=>{e("fillColor","backgroundColor",t)},fgColor:t=>{e("fgColor","color",t)},textColor:t=>{e("textColor","color",t)},borderColor:t=>{e("borderColor","borderColor",t)},strokeColor:t=>{e("strokeColor","borderColor",t)},rotation:t=>{t=t.detail.rotation;this.setRotation(t),this.annotationStorage.setValue(this.data.id,{rotation:t})}})}_dispatchEventFromSandbox(t,e){var r,i=this._commonActions;for(r of Object.keys(e.detail))(t[r]||i[r])?.(e)}_setDefaultPropertiesFromJS(t){if(this.enableScripting){var e=this.annotationStorage.getRawValue(this.data.id);if(e){var r,i,s=this._commonActions;for([r,i]of Object.entries(e)){var a=s[r];a&&(a({detail:{[r]:i},target:t}),delete e[r])}}}}_createQuadrilaterals(){if(this.container){let m=this.data.quadPoints;if(m){let[h,s,a,d]=this.data.rect;if(1===m.length){let[,{x:t,y:e},{x:r,y:i}]=m[0];if(a===t&&d===e&&h===r&&s===i)return}let r=this.container.style,c;if(this.#Qe){let{borderColor:t,borderWidth:e}=r;r.borderWidth=0,c=["url('data:image/svg+xml;utf8,",'',``],this.container.classList.add("hasBorder")}let u=a-h,p=d-s,f=this.svgFactory,t=f.createElement("svg"),e=(t.classList.add("quadrilateralsContainer"),t.setAttribute("width",0),t.setAttribute("height",0),f.createElement("defs")),g=(t.append(e),f.createElement("clipPath")),i="clippath_"+this.data.id;g.setAttribute("id",i),g.setAttribute("clipPathUnits","objectBoundingBox"),e.append(g);for(let[,{x:a,y:n},{x:o,y:l}]of m){let t=f.createElement("rect"),e=(o-h)/u,r=(d-n)/p,i=(a-o)/u,s=(n-l)/p;t.setAttribute("x",e),t.setAttribute("y",r),t.setAttribute("width",i),t.setAttribute("height",s),g.append(t),c?.push(``)}this.#Qe&&(c.push("')"),r.backgroundImage=c.join("")),this.container.append(t),this.container.style.clipPath=`url(#${i})`}}}_createPopup(){var{container:t,data:e}=this,t=(t.setAttribute("aria-haspopup","dialog"),new A({data:{color:e.color,titleObj:e.titleObj,modificationDate:e.modificationDate,contentsObj:e.contentsObj,richText:e.richText,parentRect:e.rect,borderStyle:0,id:"popup_"+e.id,rotation:e.rotation},parent:this.parent,elements:[this]}));this.parent.div.append(t.render())}render(){(0,u.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(t){var i=1{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:t,editId:e})})}}class r extends a{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!!(1(e&&this.linkService.goToDestination(e),!1),!e&&""!==e||this.#tn()}_bindNamedAction(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(e),!1),this.#tn()}_bindAttachment(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.downloadManager?.openOrDownloadData(this.container,e.content,e.filename),!1),this.#tn()}#Ze(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(e),!1),this.#tn()}_bindJSAction(e,r){e.href=this.linkService.getAnchorUrl("");var i=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(let t of Object.keys(r.actions)){var s=i.get(t);s&&(e[s]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:r.id,name:t}}),!1))}e.onclick||(e.onclick=()=>!1),this.#tn()}_bindResetFormAction(t,r){let o=t.onclick;o||(t.href=this.linkService.getAnchorUrl("")),this.#tn(),this._fieldObjects?t.onclick=()=>{o?.();let{fields:e,refs:t,include:i}=r,s=[];if(0!==e.length||0!==t.length){let r=new Set(t);for(let t of e){let e=this._fieldObjects[t]||[];for(let{id:t}of e)r.add(t)}for(let e of Object.values(this._fieldObjects))for(let t of e)r.has(t.id)===i&&s.push(t)}else for(let t of Object.values(this._fieldObjects))s.push(...t);var a=this.annotationStorage,n=[];for(let r of s){let e=r.id;switch(n.push(e),r.type){case"text":{let t=r.defaultValue||"";a.setValue(e,{value:t});break}case"checkbox":case"radiobutton":{let t=r.defaultValue===r.exportValues;a.setValue(e,{value:t});break}case"combobox":case"listbox":{let t=r.defaultValue||"";a.setValue(e,{value:t});break}default:continue}let t=document.querySelector(`[data-element-id="${e}"]`);t&&(f.has(t)?t.dispatchEvent(new Event("resetform")):(0,u.warn)("_bindResetFormAction - element not allowed: "+e))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:n,name:"ResetForm"}}),!1}:((0,u.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),o||(t.onclick=()=>!1))}}class l extends a{constructor(t){super(t,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");var t=document.createElement("img");return t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",t.alt="[{{type}} Annotation]",t.dataset.l10nId="text_annotation_type",t.dataset.l10nArgs=JSON.stringify({type:this.data.name}),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(t),this.container}}class m extends a{render(){return this.data.alternativeText&&(this.container.title=this.data.alternativeText),this.container}showElementAndHideCanvas(t){this.data.hasOwnCanvas&&("CANVAS"===t.previousSibling?.nodeName&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){var{isWin:e,isMac:r}=u.FeatureTest.platform;return e&&t.ctrlKey||r&&t.metaKey}_setEventListener(t,e,r,i,s){r.includes("mouse")?t.addEventListener(r,t=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:s(t),shift:t.shiftKey,modifier:this._getKeyModifier(t)}})}):t.addEventListener(r,t=>{if("blur"===r){if(!e.focused||!t.relatedTarget)return;e.focused=!1}else if("focus"===r){if(e.focused)return;e.focused=!0}s&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:s(t)}})})}_setEventListeners(t,e,r,i){for(var[s,a]of r)"Action"!==a&&!this.data.actions?.[a]||("Focus"!==a&&"Blur"!==a||(e||={focused:!1}),this._setEventListener(t,e,s,a,i),"Focus"!==a||this.data.actions?.Blur?"Blur"!==a||this.data.actions?.Focus||this._setEventListener(t,e,"focus","Focus",null):this._setEventListener(t,e,"blur","Blur",null))}_setBackgroundColor(t){var e=this.data.backgroundColor||null;t.style.backgroundColor=null===e?"transparent":u.Util.makeHexColor(e[0],e[1],e[2])}_setTextStyle(t){let e=["left","center","right"],r=this.data.defaultAppearanceData.fontColor,i=this.data.defaultAppearanceData.fontSize||9,s=t.style,a;var n=t=>Math.round(10*t)/10;if(this.data.multiLine){let t=Math.abs(this.data.rect[3]-this.data.rect[1]-2),e=t/(Math.round(t/(u.LINE_FACTOR*i))||1);a=Math.min(i,n(e/u.LINE_FACTOR))}else{let t=Math.abs(this.data.rect[3]-this.data.rect[1]-2);a=Math.min(i,n(t/u.LINE_FACTOR))}s.fontSize=`calc(${a}px * var(--scale-factor))`,s.color=u.Util.makeHexColor(r[0],r[1],r[2]),null!==this.data.textAlignment&&(s.textAlign=e[this.data.textAlignment])}_setRequired(t,e){e?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",e)}}class h extends m{constructor(t){super(t,{isRenderable:t.renderForms||!t.data.hasAppearance&&!!t.data.fieldValue})}setPropertyOnSiblings(t,e,r,i){var s,a=this.annotationStorage;for(s of this._getElementsByName(t.name,t.id))s.domElement&&(s.domElement[e]=r),a.setValue(s.id,{[i]:r})}render(){let s=this.annotationStorage,h=this.data.id,a=(this.container.classList.add("textWidgetAnnotation"),null);if(this.renderForms){var r=s.getValue(h,{value:this.data.fieldValue});let t=r.value||"";var n=s.getValue(h,{charLimit:this.data.maxLen}).charLimit;n&&t.length>n&&(t=t.slice(0,n));let e=r.formattedValue||this.data.textContent?.join("\n")||null,l=(e&&this.data.comb&&(e=e.replaceAll(/\s+/g,"")),{userValue:t,formattedValue:e,lastCommittedValue:null,commitKey:1,focused:!1}),i=(this.data.multiLine?((a=document.createElement("textarea")).textContent=e??t,this.data.doNotScroll&&(a.style.overflowY="hidden")):((a=document.createElement("input")).type="text",a.setAttribute("value",e??t),this.data.doNotScroll&&(a.style.overflowX="hidden")),this.data.hasOwnCanvas&&(a.hidden=!0),f.add(a),a.setAttribute("data-element-id",h),a.disabled=this.data.readOnly,a.name=this.data.fieldName,a.tabIndex=1e3,this._setRequired(a,this.data.required),n&&(a.maxLength=n),a.addEventListener("input",t=>{s.setValue(h,{value:t.target.value}),this.setPropertyOnSiblings(a,"value",t.target.value,"value"),l.formattedValue=null}),a.addEventListener("resetform",t=>{var e=this.data.defaultFieldValue??"";a.value=l.userValue=e,l.formattedValue=null}),t=>{var e=l.formattedValue;null!=e&&(t.target.value=e),t.target.scrollLeft=0});if(this.enableScripting&&this.hasJSActions){a.addEventListener("focus",t=>{l.focused||(t=t.target,l.userValue&&(t.value=l.userValue),l.lastCommittedValue=t.value,l.commitKey=1,l.focused=!0)}),a.addEventListener("updatefromsandbox",t=>{this.showElementAndHideCanvas(t.target),this._dispatchEventFromSandbox({value(t){l.userValue=t.detail.value??"",s.setValue(h,{value:l.userValue.toString()}),t.target.value=l.userValue},formattedValue(t){var e=t.detail.formattedValue;null!=(l.formattedValue=e)&&t.target!==document.activeElement&&(t.target.value=e),s.setValue(h,{formattedValue:e})},selRange(t){t.target.setSelectionRange(...t.detail.selRange)},charLimit:e=>{var r=e.detail.charLimit,e=e.target;if(0===r)e.removeAttribute("maxLength");else{e.setAttribute("maxLength",r);let t=l.userValue;!t||t.length<=r||(t=t.slice(0,r),e.value=l.userValue=t,s.setValue(h,{value:t}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:h,name:"Keystroke",value:t,willCommit:!0,commitKey:1,selStart:e.selectionStart,selEnd:e.selectionEnd}}))}}},t)}),a.addEventListener("keydown",t=>{let e=-(l.commitKey=1);var r;"Escape"===t.key?e=0:"Enter"!==t.key||this.data.multiLine?"Tab"===t.key&&(l.commitKey=3):e=2,-1!==e&&(r=t.target.value,l.lastCommittedValue!==r)&&(l.lastCommittedValue=r,l.userValue=r,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:h,name:"Keystroke",value:r,willCommit:!0,commitKey:e,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}))});let r=i;i=null,a.addEventListener("blur",t=>{var e;l.focused&&t.relatedTarget&&(l.focused=!1,e=t.target.value,l.userValue=e,l.lastCommittedValue!==e&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:h,name:"Keystroke",value:e,willCommit:!0,commitKey:l.commitKey,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}),r(t))}),this.data.actions?.Keystroke&&a.addEventListener("beforeinput",t=>{l.lastCommittedValue=null;var{data:e,target:r}=t,{value:i,selectionStart:s,selectionEnd:a}=r;let n=s,o=a;switch(t.inputType){case"deleteWordBackward":{let t=i.substring(0,s).match(/\w*[^\w]*$/);t&&(n-=t[0].length);break}case"deleteWordForward":{let t=i.substring(s).match(/^[^\w]*\w*/);t&&(o+=t[0].length);break}case"deleteContentBackward":s===a&&--n;break;case"deleteContentForward":s===a&&(o+=1)}t.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:h,name:"Keystroke",value:i,change:e||"",willCommit:!1,selStart:n,selEnd:o}})}),this._setEventListeners(a,l,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],t=>t.target.value)}if(i&&a.addEventListener("blur",i),this.data.comb){let t=(this.data.rect[2]-this.data.rect[0])/n;a.classList.add("comb"),a.style.letterSpacing=`calc(${t}px * var(--scale-factor) - 1ch)`}}else(a=document.createElement("div")).textContent=this.data.fieldValue,a.style.verticalAlign="middle",a.style.display="table-cell";return this._setTextStyle(a),this._setBackgroundColor(a),this._setDefaultPropertiesFromJS(a),this.container.append(a),this.container}}class d extends m{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class v extends m{constructor(t){super(t,{isRenderable:t.renderForms})}render(){let s=this.annotationStorage,a=this.data,n=a.id,t=s.getValue(n,{value:a.exportValue===a.fieldValue}).value;"string"==typeof t&&(t="Off"!==t,s.setValue(n,{value:t})),this.container.classList.add("buttonWidgetAnnotation","checkBox");var e=document.createElement("input");return f.add(e),e.setAttribute("data-element-id",n),e.disabled=a.readOnly,this._setRequired(e,this.data.required),e.type="checkbox",e.name=a.fieldName,t&&e.setAttribute("checked",!0),e.setAttribute("exportValue",a.exportValue),e.tabIndex=1e3,e.addEventListener("change",t=>{var{name:r,checked:i}=t.target;for(let e of this._getElementsByName(r,n)){let t=i&&e.exportValue===a.exportValue;e.domElement&&(e.domElement.checked=t),s.setValue(e.id,{value:t})}s.setValue(n,{value:i})}),e.addEventListener("resetform",t=>{var e=a.defaultFieldValue||"Off";t.target.checked=e===a.exportValue}),this.enableScripting&&this.hasJSActions&&(e.addEventListener("updatefromsandbox",t=>{this._dispatchEventFromSandbox({value(t){t.target.checked="Off"!==t.detail.value,s.setValue(n,{value:t.target.checked})}},t)}),this._setEventListeners(e,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],t=>t.target.checked)),this._setBackgroundColor(e),this._setDefaultPropertiesFromJS(e),this.container.append(e),this.container}}class _ extends m{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");let i=this.annotationStorage,r=this.data,s=r.id,t=i.getValue(s,{value:r.fieldValue===r.buttonValue}).value;"string"==typeof t&&(t=t!==r.buttonValue,i.setValue(s,{value:t}));var a=document.createElement("input");if(f.add(a),a.setAttribute("data-element-id",s),a.disabled=r.readOnly,this._setRequired(a,this.data.required),a.type="radio",a.name=r.fieldName,t&&a.setAttribute("checked",!0),a.tabIndex=1e3,a.addEventListener("change",t=>{var{name:e,checked:t}=t.target;for(let t of this._getElementsByName(e,s))i.setValue(t.id,{value:!1});i.setValue(s,{value:t})}),a.addEventListener("resetform",t=>{var e=r.defaultFieldValue;t.target.checked=null!=e&&e===r.buttonValue}),this.enableScripting&&this.hasJSActions){let e=r.buttonValue;a.addEventListener("updatefromsandbox",t=>{this._dispatchEventFromSandbox({value:t=>{var r=e===t.detail.value;for(let e of this._getElementsByName(t.target.name)){let t=r&&e.id===s;e.domElement&&(e.domElement.checked=t),i.setValue(e.id,{value:t})}}},t)}),this._setEventListeners(a,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],t=>t.target.checked)}return this._setBackgroundColor(a),this._setDefaultPropertiesFromJS(a),this.container.append(a),this.container}}class b extends r{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){var t=super.render(),e=(t.classList.add("buttonWidgetAnnotation","pushButton"),this.data.alternativeText&&(t.title=this.data.alternativeText),t.lastChild);return this.enableScripting&&this.hasJSActions&&e&&(this._setDefaultPropertiesFromJS(e),e.addEventListener("updatefromsandbox",t=>{this._dispatchEventFromSandbox({},t)})),t}}class y extends m{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");let a=this.annotationStorage,n=this.data.id,r=a.getValue(n,{value:this.data.fieldValue}),o=document.createElement("select"),i=(f.add(o),o.setAttribute("data-element-id",n),o.disabled=this.data.readOnly,this._setRequired(o,this.data.required),o.name=this.data.fieldName,o.tabIndex=1e3,this.data.combo&&0{var e=this.data.defaultFieldValue;for(let t of o.options)t.selected=t.value===e});for(let e of this.data.options){let t=document.createElement("option");t.textContent=e.displayValue,t.value=e.exportValue,r.value.includes(e.exportValue)&&(t.setAttribute("selected",!0),i=!1),o.append(t)}let s=null;if(i){let t=document.createElement("option");t.value=" ",t.setAttribute("hidden",!0),t.setAttribute("selected",!0),o.prepend(t),s=()=>{t.remove(),o.removeEventListener("input",s),s=null},o.addEventListener("input",s)}let l=t=>{let e=t?"value":"textContent",{options:r,multiple:i}=o;return i?Array.prototype.filter.call(r,t=>t.selected).map(t=>t[e]):-1===r.selectedIndex?null:r[r.selectedIndex][e]},h=l(!1),d=t=>{t=t.target.options;return Array.prototype.map.call(t,t=>({displayValue:t.textContent,exportValue:t.value}))};return this.enableScripting&&this.hasJSActions?(o.addEventListener("updatefromsandbox",t=>{this._dispatchEventFromSandbox({value(t){s?.();var t=t.detail.value,e=new Set(Array.isArray(t)?t:[t]);for(let t of o.options)t.selected=e.has(t.value);a.setValue(n,{value:l(!0)}),h=l(!1)},multipleSelection(t){o.multiple=!0},remove(t){var e=o.options,r=t.detail.remove;e[r].selected=!1,o.remove(r),0t.selected)&&(e[0].selected=!0),a.setValue(n,{value:l(!0),items:d(t)}),h=l(!1)},clear(t){for(;0!==o.length;)o.remove(0);a.setValue(n,{value:null,items:[]}),h=l(!1)},insert(t){var{index:e,displayValue:r,exportValue:i}=t.detail.insert,e=o.children[e],s=document.createElement("option");s.textContent=r,s.value=i,e?e.before(s):o.append(s),a.setValue(n,{value:l(!0),items:d(t)}),h=l(!1)},items(t){let e=t.detail.items;for(;0!==o.length;)o.remove(0);for(let i of e){let{displayValue:t,exportValue:e}=i,r=document.createElement("option");r.textContent=t,r.value=e,o.append(r)}0{var e=l(!0);a.setValue(n,{value:e}),t.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n,name:"Keystroke",value:h,changeEx:e,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(o,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],t=>t.target.value)):o.addEventListener("input",function(t){a.setValue(n,{value:l(!0)})}),this.data.combo&&this._setTextStyle(o),this._setBackgroundColor(o),this._setDefaultPropertiesFromJS(o),this.container.append(o),this.container}}class A extends a{constructor(t){var{data:e,elements:r}=t;super(t,{isRenderable:a._hasPopupData(e)}),this.elements=r}render(){this.container.classList.add("popupAnnotation");var t,e=new S({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open}),r=[];for(t of this.elements)t.popup=e,r.push(t.data.id),t.addHighlightArea();return this.container.setAttribute("aria-controls",r.map(t=>""+u.AnnotationPrefix+t).join(",")),this.container}}class S{#en=null;#nn=this.#in.bind(this);#rn=this.#sn.bind(this);#an=this.#on.bind(this);#ln=this.#cn.bind(this);#Ue=null;#Rt=null;#hn=null;#dn=null;#un=null;#pn=null;#fn=!1;#gn=null;#mn=null;#bn=null;#vn=null;#yn=!1;constructor(t){var{container:t,color:e,elements:r,titleObj:i,modificationDate:s,contentsObj:a,richText:n,parent:o,rect:l,parentRect:h,open:d}=t,t=(this.#Rt=t,this.#vn=i,this.#hn=a,this.#bn=n,this.#un=o,this.#Ue=e,this.#mn=l,this.#pn=h,this.#dn=r,c.PDFDateString.toDateObject(s));t&&(this.#en=o.l10n.get("annotation_date_string",{date:t.toLocaleDateString(),time:t.toLocaleTimeString()})),this.trigger=r.flatMap(t=>t.getElementsToTriggerPopup());for(let t of this.trigger)t.addEventListener("click",this.#ln),t.addEventListener("mouseenter",this.#an),t.addEventListener("mouseleave",this.#rn),t.classList.add("popupTriggerArea");for(let t of r)t.container?.addEventListener("keydown",this.#nn);this.#Rt.hidden=!0,d&&this.#cn()}render(){if(!this.#gn){let{page:{view:t},viewport:{rawDims:{pageWidth:e,pageHeight:r,pageX:i,pageY:s}}}=this.#un,a=this.#gn=document.createElement("div");if(a.className="popup",this.#Ue){let t=a.style.outlineColor=u.Util.makeHexColor(...this.#Ue);if(CSS.supports("background-color","color-mix(in srgb, red 30%, white)"))a.style.backgroundColor=`color-mix(in srgb, ${t} 30%, white)`;else a.style.backgroundColor=u.Util.makeHexColor(...this.#Ue.map(t=>Math.floor(.7*(255-t)+t)))}var l=document.createElement("span"),h=(l.className="header",document.createElement("h1"));if(l.append(h),{dir:h.dir,str:h.textContent}=this.#vn,a.append(l),this.#en){let e=document.createElement("span");e.classList.add("popupDate"),this.#en.then(t=>{e.textContent=t}),l.append(e)}h=this.#hn,l=this.#bn;if(!l?.str||h?.str&&h.str!==l.str){let t=this._formatContents(h);a.append(t)}else p.XfaLayer.render({xfaHtml:l.html,intent:"richText",div:a}),a.lastChild.classList.add("richText","popupContent");let n=!!this.#pn,o=n?this.#pn:this.#mn;for(let t of this.#dn)if(!o||null!==u.Util.intersect(t.data.rect,o)){o=t.data.rect,n=!0;break}var h=u.Util.normalizeRect([o[0],t[3]-o[1]+t[1],o[2],t[3]-o[3]+t[1]]),l=n?o[2]-o[0]+5:0,l=h[0]+l,h=h[1],d=this.#Rt.style;d.left=100*(l-i)/e+"%",d.top=100*(h-s)/r+"%",this.#Rt.append(a)}}_formatContents(t){let{str:e,dir:r}=t;var i=document.createElement("p"),s=(i.classList.add("popupContent"),i.dir=r,e.split(/(?:\r\n?|\n)/));for(let e=0,r=s.length;e{"Enter"===t.key&&(i?t.metaKey:t.ctrlKey)&&this.#Cn()}),!e.popupRef&&this.hasPopupData?this._createPopup():r.classList.add("popupTriggerArea"),t.append(r),t}getElementsToTriggerPopup(){return this.#wn}addHighlightArea(){this.container.classList.add("highlightArea")}#Cn(){this.downloadManager?.openOrDownloadData(this.container,this.content,this.filename)}}t.AnnotationLayer=class{#Se=null;#Tn=null;#Pn=new Map;constructor(t){var{div:t,accessibilityManager:e,annotationCanvasMap:r,l10n:i,page:s,viewport:a}=t;this.div=t,this.#Se=e,this.#Tn=r,this.l10n=i,this.page=s,this.viewport=a,this.zIndex=0,this.l10n||=n.NullL10n}#kn(t,e){var r=t.firstChild||t;r.id=""+u.AnnotationPrefix+e,this.div.append(t),this.#Se?.moveElementInDOM(this.div,t,r,!1)}async render(t){let e=t.annotations,r=this.div;(0,c.setLayerDimensions)(r,this.viewport);var s=new Map,a={data:null,layer:r,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:!1!==t.renderForms,svgFactory:new c.DOMSVGFactory,annotationStorage:t.annotationStorage||new i.AnnotationStorage,enableScripting:!0===t.enableScripting,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(let i of e)if(!i.noHTML){let e=i.annotationType===u.AnnotationType.POPUP;if(e){let t=s.get(i.id);if(!t)continue;a.elements=t}else{let{width:t,height:e}=g(i.rect);if(t<=0||e<=0)continue}a.data=i;let r=o.create(a);if(r.isRenderable){if(!e&&i.popupRef){let t=s.get(i.popupRef);t?t.push(r):s.set(i.popupRef,[r])}0{function r(t){return Math.floor(255*Math.max(0,Math.min(1,t))).toString(16).padStart(2,"0")}function s(t){return Math.max(0,Math.min(255,255*t))}Object.defineProperty(e,"__esModule",{value:!0}),e.ColorConverters=void 0,e.ColorConverters=class{static CMYK_G(t){var[t,e,r,i]=t;return["G",1-Math.min(1,.3*t+.59*r+.11*e+i)]}static G_CMYK(t){var[t]=t;return["CMYK",0,0,0,1-t]}static G_RGB(t){var[t]=t;return["RGB",t,t,t]}static G_rgb(t){var[t]=t;return[t=s(t),t,t]}static G_HTML(t){var[t]=t,t=r(t);return"#"+t+t+t}static RGB_G(t){var[t,e,r]=t;return["G",.3*t+.59*e+.11*r]}static RGB_rgb(t){return t.map(s)}static RGB_HTML(t){return"#"+t.map(r).join("")}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB(t){var[t,e,r,i]=t;return["RGB",1-Math.min(1,t+i),1-Math.min(1,r+i),1-Math.min(1,e+i)]}static CMYK_rgb(t){var[t,e,r,i]=t;return[s(1-Math.min(1,t+i)),s(1-Math.min(1,r+i)),s(1-Math.min(1,e+i))]}static CMYK_HTML(t){t=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(t)}static RGB_CMYK(t){var[t,e,r]=t,t=1-t,e=1-e,r=1-r;return["CMYK",t,e,r,Math.min(t,e,r)]}}},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.NullL10n=void 0,e.getL10nFallback=i;let r={of_pages:"of {{pagesCount}}",page_of_pages:"({{pageNumber}} of {{pagesCount}})",document_properties_kb:"{{size_kb}} KB ({{size_b}} bytes)",document_properties_mb:"{{size_mb}} MB ({{size_b}} bytes)",document_properties_date_string:"{{date}}, {{time}}",document_properties_page_size_unit_inches:"in",document_properties_page_size_unit_millimeters:"mm",document_properties_page_size_orientation_portrait:"portrait",document_properties_page_size_orientation_landscape:"landscape",document_properties_page_size_name_a3:"A3",document_properties_page_size_name_a4:"A4",document_properties_page_size_name_letter:"Letter",document_properties_page_size_name_legal:"Legal",document_properties_page_size_dimension_string:"{{width}} × {{height}} {{unit}} ({{orientation}})",document_properties_page_size_dimension_name_string:"{{width}} × {{height}} {{unit}} ({{name}}, {{orientation}})",document_properties_linearized_yes:"Yes",document_properties_linearized_no:"No",additional_layers:"Additional Layers",page_landmark:"Page {{page}}",thumb_page_title:"Page {{page}}",thumb_page_canvas:"Thumbnail of Page {{page}}",find_reached_top:"Reached top of document, continued from bottom",find_reached_bottom:"Reached end of document, continued from top","find_match_count[one]":"{{current}} of {{total}} match","find_match_count[other]":"{{current}} of {{total}} matches","find_match_count_limit[one]":"More than {{limit}} match","find_match_count_limit[other]":"More than {{limit}} matches",find_not_found:"Phrase not found",page_scale_width:"Page Width",page_scale_fit:"Page Fit",page_scale_auto:"Automatic Zoom",page_scale_actual:"Actual Size",page_scale_percent:"{{scale}}%",loading_error:"An error occurred while loading the PDF.",invalid_file_error:"Invalid or corrupted PDF file.",missing_file_error:"Missing PDF file.",unexpected_response_error:"Unexpected server response.",rendering_error:"An error occurred while rendering the page.",annotation_date_string:"{{date}}, {{time}}",printing_not_supported:"Warning: Printing is not fully supported by this browser.",printing_not_ready:"Warning: The PDF is not fully loaded for printing.",web_fonts_disabled:"Web fonts are disabled: unable to use embedded PDF fonts.",free_text2_default_content:"Start typing…",editor_free_text2_aria_label:"Text Editor",editor_ink2_aria_label:"Draw Editor",editor_ink_canvas_aria_label:"User-created image",editor_alt_text_button_label:"Alt text",editor_alt_text_edit_button_label:"Edit alt text",editor_alt_text_decorative_tooltip:"Marked as decorative",print_progress_percent:"{{progress}}%"};function i(t,e){switch(t){case"find_match_count":t=`find_match_count[${1===e.total?"one":"other"}]`;break;case"find_match_count_limit":t=`find_match_count_limit[${1===e.limit?"one":"other"}]`}return r[t]||""}e.NullL10n={getLanguage:async()=>"en-us",getDirection:async()=>"ltr",async get(t){var r,e=1e in r?r[e]:"{{"+e+"}}"):t},async translate(t){}}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.XfaLayer=void 0,r(89);var c=r(194);e.XfaLayer=class{static setupStorage(t,e,r,i,s){var a=i.getValue(e,{value:null});switch(r.name){case"textarea":null!==a.value&&(t.textContent=a.value),"print"!==s&&t.addEventListener("input",t=>{i.setValue(e,{value:t.target.value})});break;case"input":if("radio"===r.attributes.type||"checkbox"===r.attributes.type){if(a.value===r.attributes.xfaOn?t.setAttribute("checked",!0):a.value===r.attributes.xfaOff&&t.removeAttribute("checked"),"print"===s)break;t.addEventListener("change",t=>{i.setValue(e,{value:t.target.checked?t.target.getAttribute("xfaOn"):t.target.getAttribute("xfaOff")})})}else{if(null!==a.value&&t.setAttribute("value",a.value),"print"===s)break;t.addEventListener("input",t=>{i.setValue(e,{value:t.target.value})})}break;case"select":if(null!==a.value){t.setAttribute("value",a.value);for(let t of r.children)t.attributes.value===a.value?t.attributes.selected=!0:t.attributes.hasOwnProperty("selected")&&delete t.attributes.selected}t.addEventListener("input",t=>{t=t.target.options,t=-1===t.selectedIndex?"":t[t.selectedIndex].value;i.setValue(e,{value:t})})}}static setAttributes(t){let{html:r,element:e,storage:i=null,intent:s,linkService:a}=t;var n=e.attributes,o=r instanceof HTMLAnchorElement;"radio"===n.type&&(n.name=n.name+"-"+s);for(let[t,e]of Object.entries(n))if(null!=e)switch(t){case"class":e.length&&r.setAttribute(t,e.join(" "));break;case"dataId":break;case"id":r.setAttribute("data-element-id",e);break;case"style":Object.assign(r.style,e);break;case"textContent":r.textContent=e;break;default:o&&("href"===t||"newWindow"===t)||r.setAttribute(t,e)}o&&a.addLinkAttributes(r,n.href,n.newWindow),i&&n.dataId&&this.setupStorage(r,n.dataId,e,i)}static render(e){let i=e.annotationStorage,s=e.linkService,t=e.xfaHtml,a=e.intent||"display",r=document.createElement(t.name),n=(t.attributes&&this.setAttributes({html:r,element:t,intent:a,linkService:s}),[[t,-1,r]]),o=e.div;if(o.append(r),e.viewport){let t=`matrix(${e.viewport.transform.join(",")})`;o.style.transform=t}"richText"!==a&&o.setAttribute("class","xfaLayer xfaFont");for(var l=[];0{Object.defineProperty(e,"__esModule",{value:!0}),e.InkEditor=void 0,r(89),r(2);var h=r(1),l=r(164),g=r(198),i=r(168),n=r(165);class _ extends l.AnnotationEditor{#Fn=0;#Rn=0;#Dn=this.canvasPointermove.bind(this);#In=this.canvasPointerleave.bind(this);#On=this.canvasPointerup.bind(this);#Ln=this.canvasPointerdown.bind(this);#Nn=new Path2D;#Bn=!1;#jn=!1;#Un=!1;#zn=null;#Wn=0;#Hn=0;#qn=null;static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=1;static _type="ink";constructor(t){super({...t,name:"inkEditor"}),this.color=t.color||null,this.thickness=t.thickness||null,this.opacity=t.opacity||null,this.paths=[],this.bezierPath2D=[],this.allRawPaths=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0,this._willKeepAspectRatio=!0}static initialize(t){l.AnnotationEditor.initialize(t,{strings:["editor_ink_canvas_aria_label","editor_ink2_aria_label"]})}static updateDefaultParams(t,e){switch(t){case h.AnnotationEditorParamsType.INK_THICKNESS:_._defaultThickness=e;break;case h.AnnotationEditorParamsType.INK_COLOR:_._defaultColor=e;break;case h.AnnotationEditorParamsType.INK_OPACITY:_._defaultOpacity=e/100}}updateParams(t,e){switch(t){case h.AnnotationEditorParamsType.INK_THICKNESS:this.#Gn(e);break;case h.AnnotationEditorParamsType.INK_COLOR:this.#Ve(e);break;case h.AnnotationEditorParamsType.INK_OPACITY:this.#Vn(e)}}static get defaultPropertiesToUpdate(){return[[h.AnnotationEditorParamsType.INK_THICKNESS,_._defaultThickness],[h.AnnotationEditorParamsType.INK_COLOR,_._defaultColor||l.AnnotationEditor._defaultLineColor],[h.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*_._defaultOpacity)]]}get propertiesToUpdate(){return[[h.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||_._defaultThickness],[h.AnnotationEditorParamsType.INK_COLOR,this.color||_._defaultColor||l.AnnotationEditor._defaultLineColor],[h.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(this.opacity??_._defaultOpacity))]]}#Gn(t){let e=this.thickness;this.addCommands({cmd:()=>{this.thickness=t,this.#$n()},undo:()=>{this.thickness=e,this.#$n()},mustExec:!0,type:h.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}#Ve(t){let e=this.color;this.addCommands({cmd:()=>{this.color=t,this.#Xn()},undo:()=>{this.color=e,this.#Xn()},mustExec:!0,type:h.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}#Vn(t){t/=100;let e=this.opacity;this.addCommands({cmd:()=>{this.opacity=t,this.#Xn()},undo:()=>{this.opacity=e,this.#Xn()},mustExec:!0,type:h.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}rebuild(){this.parent&&(super.rebuild(),null!==this.div)&&(this.canvas||(this.#Kn(),this.#Yn()),this.isAttachedToDOM||(this.parent.add(this),this.#Jn()),this.#$n())}remove(){null!==this.canvas&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,this.#zn.disconnect(),this.#zn=null,super.remove())}setParent(t){!this.parent&&t?this._uiManager.removeShouldRescale(this):this.parent&&null===t&&this._uiManager.addShouldRescale(this),super.setParent(t)}onScaleChanging(){var[t,e]=this.parentDimensions,t=this.width*t,e=this.height*e;this.setDimensions(t,e)}enableEditMode(){this.#Bn||null===this.canvas||(super.enableEditMode(),this._isDraggable=!1,this.canvas.addEventListener("pointerdown",this.#Ln))}disableEditMode(){this.isInEditMode()&&null!==this.canvas&&(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",this.#Ln))}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}#Qn(){var{parentRotation:t,parentDimensions:[e,r]}=this;switch(t){case 90:return[0,r,r,e];case 180:return[e,r,e,r];case 270:return[e,0,r,e];default:return[0,0,e,r]}}#Zn(){var{ctx:t,color:e,opacity:r,thickness:i,parentScale:s,scaleFactor:a}=this;t.lineWidth=i*s/a,t.lineCap="round",t.lineJoin="round",t.miterLimit=10,t.strokeStyle=""+e+(0,n.opacityToHex)(r)}#ti(t,e){this.canvas.addEventListener("contextmenu",i.noContextMenu),this.canvas.addEventListener("pointerleave",this.#In),this.canvas.addEventListener("pointermove",this.#Dn),this.canvas.addEventListener("pointerup",this.#On),this.canvas.removeEventListener("pointerdown",this.#Ln),this.isEditing=!0,this.#Un||(this.#Un=!0,this.#Jn(),this.thickness||=_._defaultThickness,this.color||=_._defaultColor||l.AnnotationEditor._defaultLineColor,this.opacity??=_._defaultOpacity),this.currentPath.push([t,e]),this.#jn=!1,this.#Zn(),this.#qn=()=>{this.#ei(),this.#qn&&window.requestAnimationFrame(this.#qn)},window.requestAnimationFrame(this.#qn)}#ni(e,r){var[i,t]=this.currentPath.at(-1);if(!(1{this.allRawPaths.push(s),this.paths.push(i),this.bezierPath2D.push(t),this.rebuild()},undo:()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),0===this.paths.length?this.remove():(this.canvas||(this.#Kn(),this.#Yn()),this.#$n())},mustExec:!0})}#ei(){if(this.#jn){this.#jn=!1;let t=Math.ceil(this.thickness*this.parentScale),e=this.currentPath.slice(-3),r=e.map(t=>t[0]),i=e.map(t=>t[1]),s=(Math.min(...r),Math.max(...r),Math.min(...i),Math.max(...i),this).ctx;s.save(),s.clearRect(0,0,this.canvas.width,this.canvas.height);for(let t of this.bezierPath2D)s.stroke(t);s.stroke(this.#Nn),s.restore()}}#ii(t,e,r,i,s,a,n){e=(e+i)/2,r=(r+s)/2,a=(i+a)/2,n=(s+n)/2;t.bezierCurveTo(e+2*(i-e)/3,r+2*(s-r)/3,a+2*(i-a)/3,n+2*(s-n)/3,a,n)}#ai(){var l=this.currentPath;if(l.length<=2)return[[l[0],l[0],l.at(-1),l.at(-1)]];var h=[];let d,[c,u]=l[0];for(d=1;d{this.canvas.removeEventListener("contextmenu",i.noContextMenu)},10),this.#si(t.offsetX,t.offsetY),this.addToAnnotationStorage(),this.setInBackground()}#Kn(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",l.AnnotationEditor._l10nPromise.get("editor_ink_canvas_aria_label").then(t=>this.canvas?.setAttribute("aria-label",t)),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")}#Yn(){this.#zn=new ResizeObserver(t=>{t=t[0].contentRect;t.width&&t.height&&this.setDimensions(t.width,t.height)}),this.#zn.observe(this.div)}get isResizable(){return!this.isEmpty()&&this.#Bn}render(){if(!this.div){let r,i,[t,e,s,a]=(this.width&&(r=this.x,i=this.y),super.render(),l.AnnotationEditor._l10nPromise.get("editor_ink2_aria_label").then(t=>this.div?.setAttribute("aria-label",t)),this.#Qn());if(this.setAt(t,e,0,0),this.setDims(s,a),this.#Kn(),this.width){let[t,e]=this.parentDimensions;this.setAspectRatio(this.width*t,this.height*e),this.setAt(r*t,i*e,this.width*t,this.height*e),this.#Un=!0,this.#Jn(),this.setDims(this.width*t,this.height*e),this.#Xn(),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();this.#Yn()}return this.div}#Jn(){var t,e;this.#Un&&([t,e]=this.parentDimensions,this.canvas.width=Math.ceil(this.width*t),this.canvas.height=Math.ceil(this.height*e),this.#oi())}setDimensions(t,e){var r=Math.round(t),i=Math.round(e);this.#Wn===r&&this.#Hn===i||(this.#Wn=r,this.#Hn=i,this.canvas.style.visibility="hidden",[r,i]=this.parentDimensions,this.width=t/r,this.height=e/i,this.fixAndSetPosition(),this.#Bn&&this.#ci(t,e),this.#Jn(),this.#Xn(),this.canvas.style.visibility="visible",this.fixDims())}#ci(t,e){var r=this.#hi(),t=(t-r)/this.#Rn,e=(e-r)/this.#Fn;this.scaleFactor=Math.min(t,e)}#oi(){var t=this.#hi()/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+t,this.translationY*this.scaleFactor+t)}static#di(r){var i=new Path2D;for(let t=0,e=r.length;t{Object.defineProperty(e,"__esModule",{value:!0}),e.StampEditor=void 0,r(149),r(152);var a=r(1),i=r(164),n=r(168),o=r(198);class s extends i.AnnotationEditor{#mi=null;#bi=null;#vi=null;#yi=null;#_i=null;#Ai=null;#zn=null;#Si=null;#Ei=!1;#xi=!1;static _type="stamp";constructor(t){super({...t,name:"stampEditor"}),this.#yi=t.bitmapUrl,this.#_i=t.bitmapFile}static initialize(t){i.AnnotationEditor.initialize(t)}static get supportedTypes(){return(0,a.shadow)(this,"supportedTypes",["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"].map(t=>"image/"+t))}static get supportedTypesStr(){return(0,a.shadow)(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(t){return this.supportedTypes.includes(t)}static paste(t,e){e.pasteEditor(a.AnnotationEditorType.STAMP,{bitmapFile:t.getAsFile()})}#wi(t){var e=1this.#wi(t,!0)).finally(()=>this.#Ci());else if(this.#yi){let t=this.#yi;this.#yi=null,this._uiManager.enableWaiting(!0),void(this.#vi=this._uiManager.imageManager.getFromUrl(t).then(t=>this.#wi(t)).finally(()=>this.#Ci()))}else if(this.#_i){let t=this.#_i;this.#_i=null,this._uiManager.enableWaiting(!0),void(this.#vi=this._uiManager.imageManager.getFromFile(t).then(t=>this.#wi(t)).finally(()=>this.#Ci()))}else{let e=document.createElement("input");e.type="file",e.accept=s.supportedTypesStr,this.#vi=new Promise(t=>{e.addEventListener("change",async()=>{if(e.files&&0!==e.files.length){this._uiManager.enableWaiting(!0);let t=await this._uiManager.imageManager.getFromFile(e.files[0]);this.#wi(t)}else this.remove();t()}),e.addEventListener("cancel",()=>{this.remove(),t()})}).finally(()=>this.#Ci()),e.click()}}remove(){this.#bi&&(this.#mi=null,this._uiManager.imageManager.deleteId(this.#bi),this.#Ai?.remove(),this.#Ai=null,this.#zn?.disconnect(),this.#zn=null),super.remove()}rebuild(){this.parent?(super.rebuild(),null!==this.div&&(this.#bi&&this.#Ti(),this.isAttachedToDOM||this.parent.add(this))):this.#bi&&this.#Ti()}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(this.#vi||this.#mi||this.#yi||this.#_i)}get isResizable(){return!0}render(){if(!this.div){let t,e;var r,i;this.width&&(t=this.x,e=this.y),super.render(),this.div.hidden=!0,this.#mi?this.#Kn():this.#Ti(),this.width&&([r,i]=this.parentDimensions,this.setAt(t*r,e*i,this.width*r,this.height*i))}return this.div}#Kn(){let t=this.div,{width:e,height:r}=this.#mi;var[i,s]=this.pageDimensions;if(this.width)e=this.width*i,r=this.height*s;else if(e>.75*i||r>.75*s){let t=Math.min(.75*i/e,.75*s/r);e*=t,r*=t}var[a,n]=this.parentDimensions,a=(this.setDims(e*a/i,r*n/s),this._uiManager.enableWaiting(!1),this.#Ai=document.createElement("canvas"));t.append(a),t.hidden=!1,this.#Pi(e,r),this.#Yn(),this.#xi||(this.parent.addUndoableEditor(this),this.#xi=!0),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"inserted_image"}}}),this.addAltTextButton()}#ki(t,e){var[r,i]=this.parentDimensions;this.width=t/r,this.height=e/i,this.setDims(t,e),this._initialOptions?.isCentered?this.center():this.fixAndSetPosition(),(this._initialOptions=null)!==this.#Si&&clearTimeout(this.#Si),this.#Si=setTimeout(()=>{this.#Si=null,this.#Pi(t,e)},200)}#Mi(r,i){let{width:t,height:e}=this.#mi,s=t,a=e,n=this.#mi;for(;s>2*r||a>2*i;){let t=s,e=a;s>2*r&&(s=16384<=s?Math.floor(s/2)-1:Math.ceil(s/2)),a>2*i&&(a=16384<=a?Math.floor(a/2)-1:Math.ceil(a/2));var o=new OffscreenCanvas(s,a);o.getContext("2d").drawImage(n,0,0,t,e,0,0,s,a),n=o.transferToImageBitmap()}return n}#Pi(t,e){t=Math.ceil(t),e=Math.ceil(e);var r,i=this.#Ai;!i||i.width===t&&i.height===e||(i.width=t,i.height=e,r=this.#Ei?this.#mi:this.#Mi(t,e),(i=i.getContext("2d")).filter=this._uiManager.hcmFilter,i.drawImage(r,0,0,r.width,r.height,0,0,t,e))}#Fi(t){if(t){if(this.#Ei){let t=this._uiManager.imageManager.getSvgUrl(this.#bi);if(t)return t}let t=document.createElement("canvas");return{width:t.width,height:t.height}=this.#mi,t.getContext("2d").drawImage(this.#mi,0,0),t.toDataURL()}if(this.#Ei){let[t,e]=this.pageDimensions,r=Math.round(this.width*t*n.PixelsPerInch.PDF_TO_CSS_UNITS),i=Math.round(this.height*e*n.PixelsPerInch.PDF_TO_CSS_UNITS),s=new OffscreenCanvas(r,i);return s.getContext("2d").drawImage(this.#mi,0,0,this.#mi.width,this.#mi.height,0,0,r,i),s.transferToImageBitmap()}return structuredClone(this.#mi)}#Yn(){this.#zn=new ResizeObserver(t=>{t=t[0].contentRect;t.width&&t.height&&this.#ki(t.width,t.height)}),this.#zn.observe(this.div)}static deserialize(t,e,r){var i,s,a,n;return t instanceof o.StampAnnotationElement?null:(e=super.deserialize(t,e,r),{rect:t,bitmapUrl:i,bitmapId:n,isSvg:s,accessibilityData:a}=t,[r,n]=(n&&r.imageManager.isValidId(n)?e.#bi=n:e.#yi=i,e.#Ei=s,e.pageDimensions),e.width=(t[2]-t[0])/r,e.height=(t[3]-t[1])/n,a&&(e.altTextData=a),e)}serialize(){let t=0t.area&&(t.area=i,t.serialized.bitmap.close(),t.serialized.bitmap=this.#Fi(!1))}}else e.stamps.set(this.#bi,{area:i,serialized:r}),r.bitmap=this.#Fi(!1)}}return r}}e.StampEditor=s}],__webpack_module_cache__={};function __w_pdfjs_require__(t){var e=__webpack_module_cache__[t];return void 0!==e||(e=__webpack_module_cache__[t]={exports:{}},__webpack_modules__[t].call(e.exports,e,e.exports,__w_pdfjs_require__)),e.exports}var __webpack_exports__={};return(()=>{var t=__webpack_exports__,e=(Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"AbortException",{enumerable:!0,get:function(){return e.AbortException}}),Object.defineProperty(t,"AnnotationEditorLayer",{enumerable:!0,get:function(){return a.AnnotationEditorLayer}}),Object.defineProperty(t,"AnnotationEditorParamsType",{enumerable:!0,get:function(){return e.AnnotationEditorParamsType}}),Object.defineProperty(t,"AnnotationEditorType",{enumerable:!0,get:function(){return e.AnnotationEditorType}}),Object.defineProperty(t,"AnnotationEditorUIManager",{enumerable:!0,get:function(){return n.AnnotationEditorUIManager}}),Object.defineProperty(t,"AnnotationLayer",{enumerable:!0,get:function(){return o.AnnotationLayer}}),Object.defineProperty(t,"AnnotationMode",{enumerable:!0,get:function(){return e.AnnotationMode}}),Object.defineProperty(t,"CMapCompressionType",{enumerable:!0,get:function(){return e.CMapCompressionType}}),Object.defineProperty(t,"DOMSVGFactory",{enumerable:!0,get:function(){return i.DOMSVGFactory}}),Object.defineProperty(t,"FeatureTest",{enumerable:!0,get:function(){return e.FeatureTest}}),Object.defineProperty(t,"GlobalWorkerOptions",{enumerable:!0,get:function(){return l.GlobalWorkerOptions}}),Object.defineProperty(t,"ImageKind",{enumerable:!0,get:function(){return e.ImageKind}}),Object.defineProperty(t,"InvalidPDFException",{enumerable:!0,get:function(){return e.InvalidPDFException}}),Object.defineProperty(t,"MissingPDFException",{enumerable:!0,get:function(){return e.MissingPDFException}}),Object.defineProperty(t,"OPS",{enumerable:!0,get:function(){return e.OPS}}),Object.defineProperty(t,"PDFDataRangeTransport",{enumerable:!0,get:function(){return r.PDFDataRangeTransport}}),Object.defineProperty(t,"PDFDateString",{enumerable:!0,get:function(){return i.PDFDateString}}),Object.defineProperty(t,"PDFWorker",{enumerable:!0,get:function(){return r.PDFWorker}}),Object.defineProperty(t,"PasswordResponses",{enumerable:!0,get:function(){return e.PasswordResponses}}),Object.defineProperty(t,"PermissionFlag",{enumerable:!0,get:function(){return e.PermissionFlag}}),Object.defineProperty(t,"PixelsPerInch",{enumerable:!0,get:function(){return i.PixelsPerInch}}),Object.defineProperty(t,"PromiseCapability",{enumerable:!0,get:function(){return e.PromiseCapability}}),Object.defineProperty(t,"RenderingCancelledException",{enumerable:!0,get:function(){return i.RenderingCancelledException}}),Object.defineProperty(t,"SVGGraphics",{enumerable:!0,get:function(){return r.SVGGraphics}}),Object.defineProperty(t,"UnexpectedResponseException",{enumerable:!0,get:function(){return e.UnexpectedResponseException}}),Object.defineProperty(t,"Util",{enumerable:!0,get:function(){return e.Util}}),Object.defineProperty(t,"VerbosityLevel",{enumerable:!0,get:function(){return e.VerbosityLevel}}),Object.defineProperty(t,"XfaLayer",{enumerable:!0,get:function(){return h.XfaLayer}}),Object.defineProperty(t,"build",{enumerable:!0,get:function(){return r.build}}),Object.defineProperty(t,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return e.createValidAbsoluteUrl}}),Object.defineProperty(t,"getDocument",{enumerable:!0,get:function(){return r.getDocument}}),Object.defineProperty(t,"getFilenameFromUrl",{enumerable:!0,get:function(){return i.getFilenameFromUrl}}),Object.defineProperty(t,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return i.getPdfFilenameFromUrl}}),Object.defineProperty(t,"getXfaPageViewport",{enumerable:!0,get:function(){return i.getXfaPageViewport}}),Object.defineProperty(t,"isDataScheme",{enumerable:!0,get:function(){return i.isDataScheme}}),Object.defineProperty(t,"isPdfFile",{enumerable:!0,get:function(){return i.isPdfFile}}),Object.defineProperty(t,"loadScript",{enumerable:!0,get:function(){return i.loadScript}}),Object.defineProperty(t,"noContextMenu",{enumerable:!0,get:function(){return i.noContextMenu}}),Object.defineProperty(t,"normalizeUnicode",{enumerable:!0,get:function(){return e.normalizeUnicode}}),Object.defineProperty(t,"renderTextLayer",{enumerable:!0,get:function(){return s.renderTextLayer}}),Object.defineProperty(t,"setLayerDimensions",{enumerable:!0,get:function(){return i.setLayerDimensions}}),Object.defineProperty(t,"shadow",{enumerable:!0,get:function(){return e.shadow}}),Object.defineProperty(t,"updateTextLayer",{enumerable:!0,get:function(){return s.updateTextLayer}}),Object.defineProperty(t,"version",{enumerable:!0,get:function(){return r.version}}),__w_pdfjs_require__(1)),r=__w_pdfjs_require__(124),i=__w_pdfjs_require__(168),s=__w_pdfjs_require__(195),a=__w_pdfjs_require__(196),n=__w_pdfjs_require__(165),o=__w_pdfjs_require__(198),l=__w_pdfjs_require__(176),h=__w_pdfjs_require__(201)})(),__webpack_exports__})());