diff --git a/gulpfile.js b/gulpfile.js index 63a6e01..22ed1c3 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -67,7 +67,10 @@ function buildCoreJs(cb) { async function buildVendorJs() { const lazyAssets = {}; await Promise.all(Object.entries(lazyGroups).map(async ([name, files]) => { - await promisify(pipeline)(orderedSrc(files), concat(`${name}.min.js`), uglify(), dest("public/script")); + // PDF.js is already minified upstream. Re-minifying it breaks rendering + // for documents such as #857, even though page.render() resolves. + const transforms = name === "pdf" ? [] : [uglify()]; + await promisify(pipeline)(orderedSrc(files), concat(`${name}.min.js`), ...transforms, dest("public/script")); lazyAssets[name] = `/script/${name}.${hashFile(`public/script/${name}.min.js`)}.min.js`; })); const app = await esbuild.build({ diff --git a/public/asset-manifest.json b/public/asset-manifest.json index aa52a20..d039bc0 100644 --- a/public/asset-manifest.json +++ b/public/asset-manifest.json @@ -1,10 +1,10 @@ { "core.min.js": "core.3b07189932.min.js", - "vendor.min.js": "vendor.bc790a8831.min.js", + "vendor.min.js": "vendor.ee88004107.min.js", "mermaid.min.js": "mermaid.f848a72d16.min.js", "all.min.css": "all.5fbafcda4e.min.css", "markdown.min.js": "markdown.44f2e93820.min.js", - "pdf.min.js": "pdf.0175d53d2f.min.js", + "pdf.min.js": "pdf.4d9cc6ff49.min.js", "notebook.min.js": "notebook.c3144c18ae.min.js", "org.min.js": "org.f61f262915.min.js", "editor.min.js": "editor.4f142d3adc.min.js" diff --git a/public/script/pdf.min.js b/public/script/pdf.min.js index ab5b14a..1e2923b 100644 --- a/public/script/pdf.min.js +++ b/public/script/pdf.min.js @@ -1,2 +1,22 @@ -((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__})()); \ No newline at end of file +/** + * @licstart The following is the entire license notice for the + * JavaScript code in this page + * + * Copyright 2023 Mozilla Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @licend The above is the entire license notice for the + * JavaScript code in this page + */ +!function webpackUniversalModuleDefinition(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,(()=>(()=>{"use strict";var __webpack_modules__=[,(t,e,n)=>{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 assert(t,e){t||unreachable(e)};e.bytesToString=bytesToString;e.createValidAbsoluteUrl=function createValidAbsoluteUrl(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return null;try{if(n&&"string"==typeof t){if(n.addDefaultProtocol&&t.startsWith("www.")){const e=t.match(/\./g);e?.length>=2&&(t=`http://${t}`)}if(n.tryConvertEncoding)try{t=stringToUTF8String(t)}catch{}}const i=e?new URL(t,e):new URL(t);if(function _isValidProtocol(t){switch(t?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(i))return i}catch{}return null};e.getModificationDate=function getModificationDate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date;return[t.getUTCFullYear().toString(),(t.getUTCMonth()+1).toString().padStart(2,"0"),t.getUTCDate().toString().padStart(2,"0"),t.getUTCHours().toString().padStart(2,"0"),t.getUTCMinutes().toString().padStart(2,"0"),t.getUTCSeconds().toString().padStart(2,"0")].join("")};e.getUuid=function getUuid(){if("undefined"!=typeof crypto&&"function"==typeof crypto?.randomUUID)return crypto.randomUUID();const t=new Uint8Array(32);if("undefined"!=typeof crypto&&"function"==typeof crypto?.getRandomValues)crypto.getRandomValues(t);else for(let e=0;e<32;e++)t[e]=Math.floor(255*Math.random());return bytesToString(t)};e.getVerbosityLevel=function getVerbosityLevel(){return s};e.info=function info(t){s>=r.INFOS&&console.log(`Info: ${t}`)};e.isArrayBuffer=function isArrayBuffer(t){return"object"==typeof t&&void 0!==t?.byteLength};e.isArrayEqual=function isArrayEqual(t,e){if(t.length!==e.length)return!1;for(let n=0,i=t.length;ne?e.normalize("NFKC"):h.get(n)))};e.objectFromMap=function objectFromMap(t){const e=Object.create(null);for(const[n,i]of t)e[n]=i;return e};e.objectSize=function objectSize(t){return Object.keys(t).length};e.setVerbosityLevel=function setVerbosityLevel(t){Number.isInteger(t)&&(s=t)};e.shadow=shadow;e.string32=function string32(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,255&t)};e.stringToBytes=stringToBytes;e.stringToPDFString=function stringToPDFString(t){if(t[0]>="ï"){let e;"þ"===t[0]&&"ÿ"===t[1]?e="utf-16be":"ÿ"===t[0]&&"þ"===t[1]?e="utf-16le":"ï"===t[0]&&"»"===t[1]&&"¿"===t[2]&&(e="utf-8");if(e)try{const n=new TextDecoder(e,{fatal:!0}),i=stringToBytes(t);return n.decode(i)}catch(t){warn(`stringToPDFString: "${t}".`)}}const e=[];for(let n=0,i=t.length;n=r.WARNINGS&&console.log(`Warning: ${t}`)}function unreachable(t){throw new Error(t)}function shadow(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];Object.defineProperty(t,e,{value:n,enumerable:!i,configurable:!0,writable:!1});return n}const a=function BaseExceptionClosure(){function BaseException(t,e){this.constructor===BaseException&&unreachable("Cannot initialize BaseException.");this.message=t;this.name=e}BaseException.prototype=new Error;BaseException.constructor=BaseException;return BaseException}();e.BaseException=a;e.PasswordException=class PasswordException extends a{constructor(t,e){super(t,"PasswordException");this.code=e}};e.UnknownErrorException=class UnknownErrorException extends a{constructor(t,e){super(t,"UnknownErrorException");this.details=e}};e.InvalidPDFException=class InvalidPDFException extends a{constructor(t){super(t,"InvalidPDFException")}};e.MissingPDFException=class MissingPDFException extends a{constructor(t){super(t,"MissingPDFException")}};e.UnexpectedResponseException=class UnexpectedResponseException extends a{constructor(t,e){super(t,"UnexpectedResponseException");this.status=e}};e.FormatError=class FormatError extends a{constructor(t){super(t,"FormatError")}};e.AbortException=class AbortException extends a{constructor(t){super(t,"AbortException")}};function bytesToString(t){"object"==typeof t&&void 0!==t?.length||unreachable("Invalid argument for bytesToString");const e=t.length,n=8192;if(et.toString(16).padStart(2,"0")));e.Util=class Util{static makeHexColor(t,e,n){return`#${o[t]}${o[e]}${o[n]}`}static scaleMinMax(t,e){let n;if(t[0]){if(t[0]<0){n=e[0];e[0]=e[1];e[1]=n}e[0]*=t[0];e[1]*=t[0];if(t[3]<0){n=e[2];e[2]=e[3];e[3]=n}e[2]*=t[3];e[3]*=t[3]}else{n=e[0];e[0]=e[2];e[2]=n;n=e[1];e[1]=e[3];e[3]=n;if(t[1]<0){n=e[2];e[2]=e[3];e[3]=n}e[2]*=t[1];e[3]*=t[1];if(t[2]<0){n=e[0];e[0]=e[1];e[1]=n}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){const n=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])/n,(-t[0]*e[1]+t[1]*e[0]+e[4]*e[1]-e[5]*e[0])/n]}static getAxialAlignedBoundingBox(t,e){const n=this.applyTransform(t,e),i=this.applyTransform(t.slice(2,4),e),r=this.applyTransform([t[0],t[3]],e),s=this.applyTransform([t[2],t[1]],e);return[Math.min(n[0],i[0],r[0],s[0]),Math.min(n[1],i[1],r[1],s[1]),Math.max(n[0],i[0],r[0],s[0]),Math.max(n[1],i[1],r[1],s[1])]}static inverseTransform(t){const 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){const e=[t[0],t[2],t[1],t[3]],n=t[0]*e[0]+t[1]*e[2],i=t[0]*e[1]+t[1]*e[3],r=t[2]*e[0]+t[3]*e[2],s=t[2]*e[1]+t[3]*e[3],a=(n+s)/2,o=Math.sqrt((n+s)**2-4*(n*s-r*i))/2,l=a+o||1,c=a-o||1;return[Math.sqrt(l),Math.sqrt(c)]}static normalizeRect(t){const e=t.slice(0);if(t[0]>t[2]){e[0]=t[2];e[2]=t[0]}if(t[1]>t[3]){e[1]=t[3];e[3]=t[1]}return e}static intersect(t,e){const n=Math.max(Math.min(t[0],t[2]),Math.min(e[0],e[2])),i=Math.min(Math.max(t[0],t[2]),Math.max(e[0],e[2]));if(n>i)return null;const r=Math.max(Math.min(t[1],t[3]),Math.min(e[1],e[3])),s=Math.min(Math.max(t[1],t[3]),Math.max(e[1],e[3]));return r>s?null:[n,r,i,s]}static bezierBoundingBox(t,e,n,i,r,s,a,o){const l=[],c=[[],[]];let h,d,u,p,f,g,m,b;for(let c=0;c<2;++c){if(0===c){d=6*t-12*n+6*r;h=-3*t+9*n-9*r+3*a;u=3*n-3*t}else{d=6*e-12*i+6*s;h=-3*e+9*i-9*s+3*o;u=3*i-3*e}if(Math.abs(h)<1e-12){if(Math.abs(d)<1e-12)continue;p=-u/d;0{this.resolve=e=>{this.#t=!0;t(e)};this.reject=t=>{this.#t=!0;e(t)}}))}get settled(){return this.#t}};let c=null,h=null;e.AnnotationPrefix="pdfjs_internal_id_"},(t,e,n)=>{var i=n(3),r=n(4),s=n(69),a=n(70),o="WebAssembly",l=r[o],c=7!==Error("e",{cause:7}).cause,exportGlobalErrorCauseWrapper=function(t,e){var n={};n[t]=a(t,e,c);i({global:!0,constructor:!0,arity:1,forced:c},n)},exportWebAssemblyErrorCauseWrapper=function(t,e){if(l&&l[t]){var n={};n[t]=a(o+"."+t,e,c);i({target:o,stat:!0,constructor:!0,arity:1,forced:c},n)}};exportGlobalErrorCauseWrapper("Error",(function(t){return function Error(e){return s(t,this,arguments)}}));exportGlobalErrorCauseWrapper("EvalError",(function(t){return function EvalError(e){return s(t,this,arguments)}}));exportGlobalErrorCauseWrapper("RangeError",(function(t){return function RangeError(e){return s(t,this,arguments)}}));exportGlobalErrorCauseWrapper("ReferenceError",(function(t){return function ReferenceError(e){return s(t,this,arguments)}}));exportGlobalErrorCauseWrapper("SyntaxError",(function(t){return function SyntaxError(e){return s(t,this,arguments)}}));exportGlobalErrorCauseWrapper("TypeError",(function(t){return function TypeError(e){return s(t,this,arguments)}}));exportGlobalErrorCauseWrapper("URIError",(function(t){return function URIError(e){return s(t,this,arguments)}}));exportWebAssemblyErrorCauseWrapper("CompileError",(function(t){return function CompileError(e){return s(t,this,arguments)}}));exportWebAssemblyErrorCauseWrapper("LinkError",(function(t){return function LinkError(e){return s(t,this,arguments)}}));exportWebAssemblyErrorCauseWrapper("RuntimeError",(function(t){return function RuntimeError(e){return s(t,this,arguments)}}))},(t,e,n)=>{var i=n(4),r=n(5).f,s=n(44),a=n(48),o=n(38),l=n(56),c=n(68);t.exports=function(t,e){var n,h,d,u,p,f=t.target,g=t.global,m=t.stat;if(n=g?i:m?i[f]||o(f,{}):(i[f]||{}).prototype)for(h in e){u=e[h];d=t.dontCallGetSet?(p=r(n,h))&&p.value:n[h];if(!c(g?h:f+(m?".":"#")+h,t.forced)&&void 0!==d){if(typeof u==typeof d)continue;l(u,d)}(t.sham||d&&d.sham)&&s(u,"sham",!0);a(n,h,u,t)}}},function(t){var check=function(t){return t&&t.Math===Math&&t};t.exports=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof global&&global)||function(){return this}()||this||Function("return this")()},(t,e,n)=>{var i=n(6),r=n(8),s=n(10),a=n(11),o=n(12),l=n(18),c=n(39),h=n(42),d=Object.getOwnPropertyDescriptor;e.f=i?d:function getOwnPropertyDescriptor(t,e){t=o(t);e=l(e);if(h)try{return d(t,e)}catch(t){}if(c(t,e))return a(!r(s.f,t,e),t[e])}},(t,e,n)=>{var i=n(7);t.exports=!i((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,n)=>{var i=n(9),r=Function.prototype.call;t.exports=i?r.bind(r):function(){return r.apply(r,arguments)}},(t,e,n)=>{var i=n(7);t.exports=!i((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},(t,e)=>{var n={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,r=i&&!n.call({1:2},1);e.f=r?function propertyIsEnumerable(t){var e=i(this,t);return!!e&&e.enumerable}:n},t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},(t,e,n)=>{var i=n(13),r=n(16);t.exports=function(t){return i(r(t))}},(t,e,n)=>{var i=n(14),r=n(7),s=n(15),a=Object,o=i("".split);t.exports=r((function(){return!a("z").propertyIsEnumerable(0)}))?function(t){return"String"===s(t)?o(t,""):a(t)}:a},(t,e,n)=>{var i=n(9),r=Function.prototype,s=r.call,a=i&&r.bind.bind(s,s);t.exports=i?a:function(t){return function(){return s.apply(t,arguments)}}},(t,e,n)=>{var i=n(14),r=i({}.toString),s=i("".slice);t.exports=function(t){return s(r(t),8,-1)}},(t,e,n)=>{var i=n(17),r=TypeError;t.exports=function(t){if(i(t))throw r("Can't call method on "+t);return t}},t=>{t.exports=function(t){return null==t}},(t,e,n)=>{var i=n(19),r=n(23);t.exports=function(t){var e=i(t,"string");return r(e)?e:e+""}},(t,e,n)=>{var i=n(8),r=n(20),s=n(23),a=n(30),o=n(33),l=n(34),c=TypeError,h=l("toPrimitive");t.exports=function(t,e){if(!r(t)||s(t))return t;var n,l=a(t,h);if(l){void 0===e&&(e="default");n=i(l,t,e);if(!r(n)||s(n))return n;throw c("Can't convert object to primitive value")}void 0===e&&(e="number");return o(t,e)}},(t,e,n)=>{var i=n(21),r=n(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,n)=>{var i=n(22),r=i.all;t.exports=i.IS_HTMLDDA?function(t){return"function"==typeof t||t===r}:function(t){return"function"==typeof t}},t=>{var e="object"==typeof document&&document.all,n=void 0===e&&void 0!==e;t.exports={all:e,IS_HTMLDDA:n}},(t,e,n)=>{var i=n(24),r=n(21),s=n(25),a=n(26),o=Object;t.exports=a?function(t){return"symbol"==typeof t}:function(t){var e=i("Symbol");return r(e)&&s(e.prototype,o(t))}},(t,e,n)=>{var i=n(4),r=n(21);t.exports=function(t,e){return arguments.length<2?(n=i[t],r(n)?n:void 0):i[t]&&i[t][e];var n}},(t,e,n)=>{var i=n(14);t.exports=i({}.isPrototypeOf)},(t,e,n)=>{var i=n(27);t.exports=i&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},(t,e,n)=>{var i=n(28),r=n(7),s=n(4).String;t.exports=!!Object.getOwnPropertySymbols&&!r((function(){var t=Symbol("symbol detection");return!s(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&i&&i<41}))},(t,e,n)=>{var i,r,s=n(4),a=n(29),o=s.process,l=s.Deno,c=o&&o.versions||l&&l.version,h=c&&c.v8;h&&(r=(i=h.split("."))[0]>0&&i[0]<4?1:+(i[0]+i[1]));!r&&a&&(!(i=a.match(/Edge\/(\d+)/))||i[1]>=74)&&(i=a.match(/Chrome\/(\d+)/))&&(r=+i[1]);t.exports=r},t=>{t.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},(t,e,n)=>{var i=n(31),r=n(17);t.exports=function(t,e){var n=t[e];return r(n)?void 0:i(n)}},(t,e,n)=>{var i=n(21),r=n(32),s=TypeError;t.exports=function(t){if(i(t))return t;throw s(r(t)+" is not a function")}},t=>{var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},(t,e,n)=>{var i=n(8),r=n(21),s=n(20),a=TypeError;t.exports=function(t,e){var n,o;if("string"===e&&r(n=t.toString)&&!s(o=i(n,t)))return o;if(r(n=t.valueOf)&&!s(o=i(n,t)))return o;if("string"!==e&&r(n=t.toString)&&!s(o=i(n,t)))return o;throw a("Can't convert object to primitive value")}},(t,e,n)=>{var i=n(4),r=n(35),s=n(39),a=n(41),o=n(27),l=n(26),c=i.Symbol,h=r("wks"),d=l?c.for||c:c&&c.withoutSetter||a;t.exports=function(t){s(h,t)||(h[t]=o&&s(c,t)?c[t]:d("Symbol."+t));return h[t]}},(t,e,n)=>{var i=n(36),r=n(37);(t.exports=function(t,e){return r[t]||(r[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,n)=>{var i=n(4),r=n(38),s="__core-js_shared__",a=i[s]||r(s,{});t.exports=a},(t,e,n)=>{var i=n(4),r=Object.defineProperty;t.exports=function(t,e){try{r(i,t,{value:e,configurable:!0,writable:!0})}catch(n){i[t]=e}return e}},(t,e,n)=>{var i=n(14),r=n(40),s=i({}.hasOwnProperty);t.exports=Object.hasOwn||function hasOwn(t,e){return s(r(t),e)}},(t,e,n)=>{var i=n(16),r=Object;t.exports=function(t){return r(i(t))}},(t,e,n)=>{var i=n(14),r=0,s=Math.random(),a=i(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+a(++r+s,36)}},(t,e,n)=>{var i=n(6),r=n(7),s=n(43);t.exports=!i&&!r((function(){return 7!==Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a}))},(t,e,n)=>{var i=n(4),r=n(20),s=i.document,a=r(s)&&r(s.createElement);t.exports=function(t){return a?s.createElement(t):{}}},(t,e,n)=>{var i=n(6),r=n(45),s=n(11);t.exports=i?function(t,e,n){return r.f(t,e,s(1,n))}:function(t,e,n){t[e]=n;return t}},(t,e,n)=>{var i=n(6),r=n(42),s=n(46),a=n(47),o=n(18),l=TypeError,c=Object.defineProperty,h=Object.getOwnPropertyDescriptor,d="enumerable",u="configurable",p="writable";e.f=i?s?function defineProperty(t,e,n){a(t);e=o(e);a(n);if("function"==typeof t&&"prototype"===e&&"value"in n&&p in n&&!n[p]){var i=h(t,e);if(i&&i[p]){t[e]=n.value;n={configurable:u in n?n[u]:i[u],enumerable:d in n?n[d]:i[d],writable:!1}}}return c(t,e,n)}:c:function defineProperty(t,e,n){a(t);e=o(e);a(n);if(r)try{return c(t,e,n)}catch(t){}if("get"in n||"set"in n)throw l("Accessors not supported");"value"in n&&(t[e]=n.value);return t}},(t,e,n)=>{var i=n(6),r=n(7);t.exports=i&&r((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},(t,e,n)=>{var i=n(20),r=String,s=TypeError;t.exports=function(t){if(i(t))return t;throw s(r(t)+" is not an object")}},(t,e,n)=>{var i=n(21),r=n(45),s=n(49),a=n(38);t.exports=function(t,e,n,o){o||(o={});var l=o.enumerable,c=void 0!==o.name?o.name:e;i(n)&&s(n,c,o);if(o.global)l?t[e]=n:a(e,n);else{try{o.unsafe?t[e]&&(l=!0):delete t[e]}catch(t){}l?t[e]=n:r.f(t,e,{value:n,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return t}},(t,e,n)=>{var i=n(14),r=n(7),s=n(21),a=n(39),o=n(6),l=n(50).CONFIGURABLE,c=n(51),h=n(52),d=h.enforce,u=h.get,p=String,f=Object.defineProperty,g=i("".slice),m=i("".replace),b=i([].join),v=o&&!r((function(){return 8!==f((function(){}),"length",{value:8}).length})),y=String(String).split("String"),_=t.exports=function(t,e,n){"Symbol("===g(p(e),0,7)&&(e="["+m(p(e),/^Symbol\(([^)]*)\)/,"$1")+"]");n&&n.getter&&(e="get "+e);n&&n.setter&&(e="set "+e);(!a(t,"name")||l&&t.name!==e)&&(o?f(t,"name",{value:e,configurable:!0}):t.name=e);v&&n&&a(n,"arity")&&t.length!==n.arity&&f(t,"length",{value:n.arity});try{n&&a(n,"constructor")&&n.constructor?o&&f(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var i=d(t);a(i,"source")||(i.source=b(y,"string"==typeof e?e:""));return t};Function.prototype.toString=_((function toString(){return s(this)&&u(this).source||c(this)}),"toString")},(t,e,n)=>{var i=n(6),r=n(39),s=Function.prototype,a=i&&Object.getOwnPropertyDescriptor,o=r(s,"name"),l=o&&"something"===function something(){}.name,c=o&&(!i||i&&a(s,"name").configurable);t.exports={EXISTS:o,PROPER:l,CONFIGURABLE:c}},(t,e,n)=>{var i=n(14),r=n(21),s=n(37),a=i(Function.toString);r(s.inspectSource)||(s.inspectSource=function(t){return a(t)});t.exports=s.inspectSource},(t,e,n)=>{var i,r,s,a=n(53),o=n(4),l=n(20),c=n(44),h=n(39),d=n(37),u=n(54),p=n(55),f="Object already initialized",g=o.TypeError,m=o.WeakMap;if(a||d.state){var b=d.state||(d.state=new m);b.get=b.get;b.has=b.has;b.set=b.set;i=function(t,e){if(b.has(t))throw g(f);e.facade=t;b.set(t,e);return e};r=function(t){return b.get(t)||{}};s=function(t){return b.has(t)}}else{var v=u("state");p[v]=!0;i=function(t,e){if(h(t,v))throw g(f);e.facade=t;c(t,v,e);return e};r=function(t){return h(t,v)?t[v]:{}};s=function(t){return h(t,v)}}t.exports={set:i,get:r,has:s,enforce:function(t){return s(t)?r(t):i(t,{})},getterFor:function(t){return function(e){var n;if(!l(e)||(n=r(e)).type!==t)throw g("Incompatible receiver, "+t+" required");return n}}}},(t,e,n)=>{var i=n(4),r=n(21),s=i.WeakMap;t.exports=r(s)&&/native code/.test(String(s))},(t,e,n)=>{var i=n(35),r=n(41),s=i("keys");t.exports=function(t){return s[t]||(s[t]=r(t))}},t=>{t.exports={}},(t,e,n)=>{var i=n(39),r=n(57),s=n(5),a=n(45);t.exports=function(t,e,n){for(var o=r(e),l=a.f,c=s.f,h=0;h{var i=n(24),r=n(14),s=n(58),a=n(67),o=n(47),l=r([].concat);t.exports=i("Reflect","ownKeys")||function ownKeys(t){var e=s.f(o(t)),n=a.f;return n?l(e,n(t)):e}},(t,e,n)=>{var i=n(59),r=n(66).concat("length","prototype");e.f=Object.getOwnPropertyNames||function getOwnPropertyNames(t){return i(t,r)}},(t,e,n)=>{var i=n(14),r=n(39),s=n(12),a=n(60).indexOf,o=n(55),l=i([].push);t.exports=function(t,e){var n,i=s(t),c=0,h=[];for(n in i)!r(o,n)&&r(i,n)&&l(h,n);for(;e.length>c;)r(i,n=e[c++])&&(~a(h,n)||l(h,n));return h}},(t,e,n)=>{var i=n(12),r=n(61),s=n(64),createMethod=function(t){return function(e,n,a){var o,l=i(e),c=s(l),h=r(a,c);if(t&&n!=n){for(;c>h;)if((o=l[h++])!=o)return!0}else for(;c>h;h++)if((t||h in l)&&l[h]===n)return t||h||0;return!t&&-1}};t.exports={includes:createMethod(!0),indexOf:createMethod(!1)}},(t,e,n)=>{var i=n(62),r=Math.max,s=Math.min;t.exports=function(t,e){var n=i(t);return n<0?r(n+e,0):s(n,e)}},(t,e,n)=>{var i=n(63);t.exports=function(t){var e=+t;return e!=e||0===e?0:i(e)}},t=>{var e=Math.ceil,n=Math.floor;t.exports=Math.trunc||function trunc(t){var i=+t;return(i>0?n:e)(i)}},(t,e,n)=>{var i=n(65);t.exports=function(t){return i(t.length)}},(t,e,n)=>{var i=n(62),r=Math.min;t.exports=function(t){return t>0?r(i(t),9007199254740991):0}},t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},(t,e)=>{e.f=Object.getOwnPropertySymbols},(t,e,n)=>{var i=n(7),r=n(21),s=/#|\.prototype\./,isForced=function(t,e){var n=o[a(t)];return n===c||n!==l&&(r(e)?i(e):!!e)},a=isForced.normalize=function(t){return String(t).replace(s,".").toLowerCase()},o=isForced.data={},l=isForced.NATIVE="N",c=isForced.POLYFILL="P";t.exports=isForced},(t,e,n)=>{var i=n(9),r=Function.prototype,s=r.apply,a=r.call;t.exports="object"==typeof Reflect&&Reflect.apply||(i?a.bind(s):function(){return a.apply(s,arguments)})},(t,e,n)=>{var i=n(24),r=n(39),s=n(44),a=n(25),o=n(71),l=n(56),c=n(74),h=n(75),d=n(76),u=n(80),p=n(81),f=n(6),g=n(36);t.exports=function(t,e,n,m){var b="stackTraceLimit",v=m?2:1,y=t.split("."),_=y[y.length-1],A=i.apply(null,y);if(A){var S=A.prototype;!g&&r(S,"cause")&&delete S.cause;if(!n)return A;var E=i("Error"),x=e((function(t,e){var n=d(m?e:t,void 0),i=m?new A(t):new A;void 0!==n&&s(i,"message",n);p(i,x,i.stack,2);this&&a(S,this)&&h(i,this,x);arguments.length>v&&u(i,arguments[v]);return i}));x.prototype=S;if("Error"!==_)o?o(x,E):l(x,E,{name:!0});else if(f&&b in A){c(x,A,b);c(x,A,"prepareStackTrace")}l(x,A);if(!g)try{S.name!==_&&s(S,"name",_);S.constructor=x}catch(t){}return x}}},(t,e,n)=>{var i=n(72),r=n(47),s=n(73);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=i(Object.prototype,"__proto__","set"))(n,[]);e=n instanceof Array}catch(t){}return function setPrototypeOf(n,i){r(n);s(i);e?t(n,i):n.__proto__=i;return n}}():void 0)},(t,e,n)=>{var i=n(14),r=n(31);t.exports=function(t,e,n){try{return i(r(Object.getOwnPropertyDescriptor(t,e)[n]))}catch(t){}}},(t,e,n)=>{var i=n(21),r=String,s=TypeError;t.exports=function(t){if("object"==typeof t||i(t))return t;throw s("Can't set "+r(t)+" as a prototype")}},(t,e,n)=>{var i=n(45).f;t.exports=function(t,e,n){n in t||i(t,n,{configurable:!0,get:function(){return e[n]},set:function(t){e[n]=t}})}},(t,e,n)=>{var i=n(21),r=n(20),s=n(71);t.exports=function(t,e,n){var a,o;s&&i(a=e.constructor)&&a!==n&&r(o=a.prototype)&&o!==n.prototype&&s(t,o);return t}},(t,e,n)=>{var i=n(77);t.exports=function(t,e){return void 0===t?arguments.length<2?"":e:i(t)}},(t,e,n)=>{var i=n(78),r=String;t.exports=function(t){if("Symbol"===i(t))throw TypeError("Cannot convert a Symbol value to a string");return r(t)}},(t,e,n)=>{var i=n(79),r=n(21),s=n(15),a=n(34)("toStringTag"),o=Object,l="Arguments"===s(function(){return arguments}());t.exports=i?s:function(t){var e,n,i;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=o(t),a))?n:l?s(e):"Object"===(i=s(e))&&r(e.callee)?"Arguments":i}},(t,e,n)=>{var i={};i[n(34)("toStringTag")]="z";t.exports="[object z]"===String(i)},(t,e,n)=>{var i=n(20),r=n(44);t.exports=function(t,e){i(e)&&"cause"in e&&r(t,"cause",e.cause)}},(t,e,n)=>{var i=n(44),r=n(82),s=n(83),a=Error.captureStackTrace;t.exports=function(t,e,n,o){s&&(a?a(t,e):i(t,"stack",r(n,o)))}},(t,e,n)=>{var i=n(14),r=Error,s=i("".replace),a=String(r("zxcasd").stack),o=/\n\s*at [^:]*:[^\n]*/,l=o.test(a);t.exports=function(t,e){if(l&&"string"==typeof t&&!r.prepareStackTrace)for(;e--;)t=s(t,o,"");return t}},(t,e,n)=>{var i=n(7),r=n(11);t.exports=!i((function(){var t=Error("a");if(!("stack"in t))return!0;Object.defineProperty(t,"stack",r(1,7));return 7!==t.stack}))},(t,e,n)=>{var i=n(48),r=n(14),s=n(77),a=n(85),o=URLSearchParams,l=o.prototype,c=r(l.append),h=r(l.delete),d=r(l.forEach),u=r([].push),p=new o("a=1&a=2&b=3");p.delete("a",1);p.delete("b",void 0);p+""!="a=2"&&i(l,"delete",(function(t){var e=arguments.length,n=e<2?void 0:arguments[1];if(e&&void 0===n)return h(this,t);var i=[];d(this,(function(t,e){u(i,{key:e,value:t})}));a(e,1);for(var r,o=s(t),l=s(n),p=0,f=0,g=!1,m=i.length;p{var e=TypeError;t.exports=function(t,n){if(t{var i=n(48),r=n(14),s=n(77),a=n(85),o=URLSearchParams,l=o.prototype,c=r(l.getAll),h=r(l.has),d=new o("a=1");!d.has("a",2)&&d.has("a",void 0)||i(l,"has",(function has(t){var e=arguments.length,n=e<2?void 0:arguments[1];if(e&&void 0===n)return h(this,t);var i=c(this,t);a(e,1);for(var r=s(n),o=0;o{var i=n(6),r=n(14),s=n(88),a=URLSearchParams.prototype,o=r(a.forEach);i&&!("size"in a)&&s(a,"size",{get:function size(){var t=0;o(this,(function(){t++}));return t},configurable:!0,enumerable:!0})},(t,e,n)=>{var i=n(49),r=n(45);t.exports=function(t,e,n){n.get&&i(n.get,e,{getter:!0});n.set&&i(n.set,e,{setter:!0});return r.f(t,e,n)}},(t,e,n)=>{var i=n(3),r=n(40),s=n(64),a=n(90),o=n(92);i({target:"Array",proto:!0,arity:1,forced:n(7)((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(t){return t instanceof TypeError}}()},{push:function push(t){var e=r(this),n=s(e),i=arguments.length;o(n+i);for(var l=0;l{var i=n(6),r=n(91),s=TypeError,a=Object.getOwnPropertyDescriptor,o=i&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();t.exports=o?function(t,e){if(r(t)&&!a(t,"length").writable)throw s("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e}},(t,e,n)=>{var i=n(15);t.exports=Array.isArray||function isArray(t){return"Array"===i(t)}},t=>{var e=TypeError;t.exports=function(t){if(t>9007199254740991)throw e("Maximum allowed index exceeded");return t}},(t,e,n)=>{var i=n(94),r=n(98).findLast,s=i.aTypedArray;(0,i.exportTypedArrayMethod)("findLast",(function findLast(t){return r(s(this),t,arguments.length>1?arguments[1]:void 0)}))},(t,e,n)=>{var i,r,s,a=n(95),o=n(6),l=n(4),c=n(21),h=n(20),d=n(39),u=n(78),p=n(32),f=n(44),g=n(48),m=n(88),b=n(25),v=n(96),y=n(71),_=n(34),A=n(41),S=n(52),E=S.enforce,x=S.get,w=l.Int8Array,C=w&&w.prototype,T=l.Uint8ClampedArray,P=T&&T.prototype,k=w&&v(w),M=C&&v(C),R=Object.prototype,D=l.TypeError,I=_("toStringTag"),O=A("TYPED_ARRAY_TAG"),L="TypedArrayConstructor",N=a&&!!y&&"Opera"!==u(l.opera),B=!1,j={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},U={BigInt64Array:8,BigUint64Array:8},getTypedArrayConstructor=function(t){var e=v(t);if(h(e)){var n=x(e);return n&&d(n,L)?n[L]:getTypedArrayConstructor(e)}},isTypedArray=function(t){if(!h(t))return!1;var e=u(t);return d(j,e)||d(U,e)};for(i in j)(s=(r=l[i])&&r.prototype)?E(s)[L]=r:N=!1;for(i in U)(s=(r=l[i])&&r.prototype)&&(E(s)[L]=r);if(!N||!c(k)||k===Function.prototype){k=function TypedArray(){throw D("Incorrect invocation")};if(N)for(i in j)l[i]&&y(l[i],k)}if(!N||!M||M===R){M=k.prototype;if(N)for(i in j)l[i]&&y(l[i].prototype,M)}N&&v(P)!==M&&y(P,M);if(o&&!d(M,I)){B=!0;m(M,I,{configurable:!0,get:function(){return h(this)?this[O]:void 0}});for(i in j)l[i]&&f(l[i],O,i)}t.exports={NATIVE_ARRAY_BUFFER_VIEWS:N,TYPED_ARRAY_TAG:B&&O,aTypedArray:function(t){if(isTypedArray(t))return t;throw D("Target is not a typed array")},aTypedArrayConstructor:function(t){if(c(t)&&(!y||b(k,t)))return t;throw D(p(t)+" is not a typed array constructor")},exportTypedArrayMethod:function(t,e,n,i){if(o){if(n)for(var r in j){var s=l[r];if(s&&d(s.prototype,t))try{delete s.prototype[t]}catch(n){try{s.prototype[t]=e}catch(t){}}}M[t]&&!n||g(M,t,n?e:N&&C[t]||e,i)}},exportTypedArrayStaticMethod:function(t,e,n){var i,r;if(o){if(y){if(n)for(i in j)if((r=l[i])&&d(r,t))try{delete r[t]}catch(t){}if(k[t]&&!n)return;try{return g(k,t,n?e:N&&k[t]||e)}catch(t){}}for(i in j)!(r=l[i])||r[t]&&!n||g(r,t,e)}},getTypedArrayConstructor:getTypedArrayConstructor,isView:function isView(t){if(!h(t))return!1;var e=u(t);return"DataView"===e||d(j,e)||d(U,e)},isTypedArray:isTypedArray,TypedArray:k,TypedArrayPrototype:M}},t=>{t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},(t,e,n)=>{var i=n(39),r=n(21),s=n(40),a=n(54),o=n(97),l=a("IE_PROTO"),c=Object,h=c.prototype;t.exports=o?c.getPrototypeOf:function(t){var e=s(t);if(i(e,l))return e[l];var n=e.constructor;return r(n)&&e instanceof n?n.prototype:e instanceof c?h:null}},(t,e,n)=>{var i=n(7);t.exports=!i((function(){function F(){}F.prototype.constructor=null;return Object.getPrototypeOf(new F)!==F.prototype}))},(t,e,n)=>{var i=n(99),r=n(13),s=n(40),a=n(64),createMethod=function(t){var e=1===t;return function(n,o,l){for(var c,h=s(n),d=r(h),u=i(o,l),p=a(d);p-- >0;)if(u(c=d[p],p,h))switch(t){case 0:return c;case 1:return p}return e?-1:void 0}};t.exports={findLast:createMethod(0),findLastIndex:createMethod(1)}},(t,e,n)=>{var i=n(100),r=n(31),s=n(9),a=i(i.bind);t.exports=function(t,e){r(t);return void 0===e?t:s?a(t,e):function(){return t.apply(e,arguments)}}},(t,e,n)=>{var i=n(15),r=n(14);t.exports=function(t){if("Function"===i(t))return r(t)}},(t,e,n)=>{var i=n(94),r=n(98).findLastIndex,s=i.aTypedArray;(0,i.exportTypedArrayMethod)("findLastIndex",(function findLastIndex(t){return r(s(this),t,arguments.length>1?arguments[1]:void 0)}))},(t,e,n)=>{var i=n(4),r=n(8),s=n(94),a=n(64),o=n(103),l=n(40),c=n(7),h=i.RangeError,d=i.Int8Array,u=d&&d.prototype,p=u&&u.set,f=s.aTypedArray,g=s.exportTypedArrayMethod,m=!c((function(){var t=new Uint8ClampedArray(2);r(p,t,{length:1,0:3},1);return 3!==t[1]})),b=m&&s.NATIVE_ARRAY_BUFFER_VIEWS&&c((function(){var t=new d(2);t.set(1);t.set("2",1);return 0!==t[0]||2!==t[1]}));g("set",(function set(t){f(this);var e=o(arguments.length>1?arguments[1]:void 0,1),n=l(t);if(m)return r(p,this,n,e);var i=this.length,s=a(n),c=0;if(s+e>i)throw h("Wrong length");for(;c{var i=n(104),r=RangeError;t.exports=function(t,e){var n=i(t);if(n%e)throw r("Wrong offset");return n}},(t,e,n)=>{var i=n(62),r=RangeError;t.exports=function(t){var e=i(t);if(e<0)throw r("The argument can't be less than 0");return e}},(t,e,n)=>{var i=n(106),r=n(94),s=r.aTypedArray,a=r.exportTypedArrayMethod,o=r.getTypedArrayConstructor;a("toReversed",(function toReversed(){return i(s(this),o(this))}))},(t,e,n)=>{var i=n(64);t.exports=function(t,e){for(var n=i(t),r=new e(n),s=0;s{var i=n(94),r=n(14),s=n(31),a=n(108),o=i.aTypedArray,l=i.getTypedArrayConstructor,c=i.exportTypedArrayMethod,h=r(i.TypedArrayPrototype.sort);c("toSorted",(function toSorted(t){void 0!==t&&s(t);var e=o(this),n=a(l(e),e);return h(n,t)}))},(t,e,n)=>{var i=n(64);t.exports=function(t,e){for(var n=0,r=i(e),s=new t(r);r>n;)s[n]=e[n++];return s}},(t,e,n)=>{var i=n(110),r=n(94),s=n(111),a=n(62),o=n(112),l=r.aTypedArray,c=r.getTypedArrayConstructor,h=r.exportTypedArrayMethod,d=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(t){return 8===t}}();h("with",{with:function(t,e){var n=l(this),r=a(t),h=s(n)?o(e):+e;return i(n,c(n),r,h)}}.with,!d)},(t,e,n)=>{var i=n(64),r=n(62),s=RangeError;t.exports=function(t,e,n,a){var o=i(t),l=r(n),c=l<0?o+l:l;if(c>=o||c<0)throw s("Incorrect index");for(var h=new e(o),d=0;d{var i=n(78);t.exports=function(t){var e=i(t);return"BigInt64Array"===e||"BigUint64Array"===e}},(t,e,n)=>{var i=n(19),r=TypeError;t.exports=function(t){var e=i(t,"number");if("number"==typeof e)throw r("Can't convert number to bigint");return BigInt(e)}},(t,e,n)=>{var i=n(6),r=n(88),s=n(114),a=ArrayBuffer.prototype;i&&!("detached"in a)&&r(a,"detached",{configurable:!0,get:function detached(){return s(this)}})},(t,e,n)=>{var i=n(14),r=n(115),s=i(ArrayBuffer.prototype.slice);t.exports=function(t){if(0!==r(t))return!1;try{s(t,0,0);return!1}catch(t){return!0}}},(t,e,n)=>{var i=n(72),r=n(15),s=TypeError;t.exports=i(ArrayBuffer.prototype,"byteLength","get")||function(t){if("ArrayBuffer"!==r(t))throw s("ArrayBuffer expected");return t.byteLength}},(t,e,n)=>{var i=n(3),r=n(117);r&&i({target:"ArrayBuffer",proto:!0},{transfer:function transfer(){return r(this,arguments.length?arguments[0]:void 0,!0)}})},(t,e,n)=>{var i=n(4),r=n(14),s=n(72),a=n(118),o=n(114),l=n(115),c=n(119),h=i.TypeError,d=i.structuredClone,u=i.ArrayBuffer,p=i.DataView,f=Math.min,g=u.prototype,m=p.prototype,b=r(g.slice),v=s(g,"resizable","get"),y=s(g,"maxByteLength","get"),_=r(m.getInt8),A=r(m.setInt8);t.exports=c&&function(t,e,n){var i=l(t),r=void 0===e?i:a(e),s=!v||!v(t);if(o(t))throw h("ArrayBuffer is detached");var c=d(t,{transfer:[t]});if(i===r&&(n||s))return c;if(i>=r&&(!n||s))return b(c,0,r);for(var g=n&&!s&&y?{maxByteLength:y(c)}:void 0,m=new u(r,g),S=new p(c),E=new p(m),x=f(r,i),w=0;w{var i=n(62),r=n(65),s=RangeError;t.exports=function(t){if(void 0===t)return 0;var e=i(t),n=r(e);if(e!==n)throw s("Wrong length or index");return n}},(t,e,n)=>{var i=n(4),r=n(7),s=n(28),a=n(120),o=n(121),l=n(122),c=i.structuredClone;t.exports=!!c&&!r((function(){if(o&&s>92||l&&s>94||a&&s>97)return!1;var t=new ArrayBuffer(8),e=c(t,{transfer:[t]});return 0!==t.byteLength||8!==e.byteLength}))},(t,e,n)=>{var i=n(121),r=n(122);t.exports=!i&&!r&&"object"==typeof window&&"object"==typeof document},t=>{t.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},(t,e,n)=>{var i=n(4),r=n(15);t.exports="process"===r(i.process)},(t,e,n)=>{var i=n(3),r=n(117);r&&i({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function transferToFixedLength(){return r(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);const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DELAYED_CLEANUP_TIMEOUT=5e3,DefaultCanvasFactory=_util.isNodeJS?_displayNode_utils.NodeCanvasFactory:_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;const DefaultCMapReaderFactory=_util.isNodeJS?_displayNode_utils.NodeCMapReaderFactory:_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;const DefaultFilterFactory=_util.isNodeJS?_displayNode_utils.NodeFilterFactory:_display_utils.DOMFilterFactory;exports.DefaultFilterFactory=DefaultFilterFactory;const DefaultStandardFontDataFactory=_util.isNodeJS?_displayNode_utils.NodeStandardFontDataFactory:_display_utils.DOMStandardFontDataFactory;exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory;function getDocument(t){"string"==typeof t||t instanceof URL?t={url:t}:(0,_util.isArrayBuffer)(t)&&(t={data:t});if("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");const e=new PDFDocumentLoadingTask,{docId:n}=e,i=t.url?getUrlProp(t.url):null,r=t.data?getDataProp(t.data):null,s=t.httpHeaders||null,a=!0===t.withCredentials,o=t.password??null,l=t.range instanceof PDFDataRangeTransport?t.range:null,c=Number.isInteger(t.rangeChunkSize)&&t.rangeChunkSize>0?t.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE;let h=t.worker instanceof PDFWorker?t.worker:null;const d=t.verbosity,u="string"!=typeof t.docBaseUrl||(0,_display_utils.isDataScheme)(t.docBaseUrl)?null:t.docBaseUrl,p="string"==typeof t.cMapUrl?t.cMapUrl:null,f=!1!==t.cMapPacked,g=t.CMapReaderFactory||DefaultCMapReaderFactory,m="string"==typeof t.standardFontDataUrl?t.standardFontDataUrl:null,b=t.StandardFontDataFactory||DefaultStandardFontDataFactory,v=!0!==t.stopAtErrors,y=Number.isInteger(t.maxImageSize)&&t.maxImageSize>-1?t.maxImageSize:-1,_=!1!==t.isEvalSupported,A="boolean"==typeof t.isOffscreenCanvasSupported?t.isOffscreenCanvasSupported:!_util.isNodeJS,S=Number.isInteger(t.canvasMaxAreaInBytes)?t.canvasMaxAreaInBytes:-1,E="boolean"==typeof t.disableFontFace?t.disableFontFace:_util.isNodeJS,x=!0===t.fontExtraProperties,w=!0===t.enableXfa,C=t.ownerDocument||globalThis.document,T=!0===t.disableRange,P=!0===t.disableStream,k=!0===t.disableAutoFetch,M=!0===t.pdfBug,R=l?l.length:t.length??NaN,D="boolean"==typeof t.useSystemFonts?t.useSystemFonts:!_util.isNodeJS&&!E,I="boolean"==typeof t.useWorkerFetch?t.useWorkerFetch:g===_display_utils.DOMCMapReaderFactory&&b===_display_utils.DOMStandardFontDataFactory&&p&&m&&(0,_display_utils.isValidFetchUrl)(p,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(m,document.baseURI),O=t.canvasFactory||new DefaultCanvasFactory({ownerDocument:C}),L=t.filterFactory||new DefaultFilterFactory({docId:n,ownerDocument:C});(0,_util.setVerbosityLevel)(d);const N={canvasFactory:O,filterFactory:L};if(!I){N.cMapReaderFactory=new g({baseUrl:p,isCompressed:f});N.standardFontDataFactory=new b({baseUrl:m})}if(!h){const t={verbosity:d,port:_worker_options.GlobalWorkerOptions.workerPort};h=t.port?PDFWorker.fromPort(t):new PDFWorker(t);e._worker=h}const B={docId:n,apiVersion:"3.11.174",data:r,password:o,disableAutoFetch:k,rangeChunkSize:c,length:R,docBaseUrl:u,enableXfa:w,evaluatorOptions:{maxImageSize:y,disableFontFace:E,ignoreErrors:v,isEvalSupported:_,isOffscreenCanvasSupported:A,canvasMaxAreaInBytes:S,fontExtraProperties:x,useSystemFonts:D,cMapUrl:I?p:null,standardFontDataUrl:I?m:null}},j={ignoreErrors:v,isEvalSupported:_,disableFontFace:E,fontExtraProperties:x,enableXfa:w,ownerDocument:C,disableAutoFetch:k,pdfBug:M,styleElement:null};h.promise.then((function(){if(e.destroyed)throw new Error("Loading aborted");const t=_fetchDocument(h,B),o=new Promise((function(t){let e;if(l)e=new _transport_stream.PDFDataTransportStream({length:R,initialData:l.initialData,progressiveDone:l.progressiveDone,contentDispositionFilename:l.contentDispositionFilename,disableRange:T,disableStream:P},l);else if(!r){e=(t=>_util.isNodeJS?new _displayNode_stream.PDFNodeStream(t):(0,_display_utils.isValidFetchUrl)(t.url)?new _displayFetch_stream.PDFFetchStream(t):new _displayNetwork.PDFNetworkStream(t))({url:i,length:R,httpHeaders:s,withCredentials:a,rangeChunkSize:c,disableRange:T,disableStream:P})}t(e)}));return Promise.all([t,o]).then((function(t){let[i,r]=t;if(e.destroyed)throw new Error("Loading aborted");const s=new _message_handler.MessageHandler(n,i,h.port),a=new WorkerTransport(s,e,r,j,N);e._transport=a;s.send("Ready",null)}))})).catch(e._capability.reject);return e}async function _fetchDocument(t,e){if(t.destroyed)throw new Error("Worker was destroyed");const n=await t.messageHandler.sendWithPromise("GetDocRequest",e,e.data?[e.data.buffer]:null);if(t.destroyed)throw new Error("Worker was destroyed");return n}function getUrlProp(t){if(t instanceof URL)return t.href;try{return new URL(t,window.location).href}catch{if(_util.isNodeJS&&"string"==typeof t)return t}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp(t){if(_util.isNodeJS&&"undefined"!=typeof Buffer&&t instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength)return t;if("string"==typeof t)return(0,_util.stringToBytes)(t);if("object"==typeof t&&!isNaN(t?.length)||(0,_util.isArrayBuffer)(t))return new Uint8Array(t);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}class PDFDocumentLoadingTask{static#e=0;constructor(){this._capability=new _util.PromiseCapability;this._transport=null;this._worker=null;this.docId="d"+PDFDocumentLoadingTask.#e++;this.destroyed=!1;this.onPassword=null;this.onProgress=null}get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{this._worker?.port&&(this._worker._pendingDestroy=!0);await(this._transport?.destroy())}catch(t){this._worker?.port&&delete this._worker._pendingDestroy;throw t}this._transport=null;if(this._worker){this._worker.destroy();this._worker=null}}}exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this.length=t;this.initialData=e;this.progressiveDone=n;this.contentDispositionFilename=i;this._rangeListeners=[];this._progressListeners=[];this._progressiveReadListeners=[];this._progressiveDoneListeners=[];this._readyCapability=new _util.PromiseCapability}addRangeListener(t){this._rangeListeners.push(t)}addProgressListener(t){this._progressListeners.push(t)}addProgressiveReadListener(t){this._progressiveReadListeners.push(t)}addProgressiveDoneListener(t){this._progressiveDoneListeners.push(t)}onDataRange(t,e){for(const n of this._rangeListeners)n(t,e)}onDataProgress(t,e){this._readyCapability.promise.then((()=>{for(const n of this._progressListeners)n(t,e)}))}onDataProgressiveRead(t){this._readyCapability.promise.then((()=>{for(const e of this._progressiveReadListeners)e(t)}))}onDataProgressiveDone(){this._readyCapability.promise.then((()=>{for(const 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.");return this.getJSActions().then((t=>{if(!t)return t;const e=[];for(const n in t)e.push(...t[n]);return e}))}})}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(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._transport.startCleanup(t||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{#n=null;#i=!1;constructor(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this._pageIndex=t;this._pageInfo=e;this._transport=n;this._stats=i?new _display_utils.StatTimer:null;this._pdfBug=i;this.commonObjs=n.commonObjs;this.objs=new PDFObjects;this._maybeCleanupAfterRender=!1;this._intentStates=new Map;this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport(){let{scale:t,rotation:e=this.rotate,offsetX:n=0,offsetY:i=0,dontFlip:r=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new _display_utils.PageViewport({viewBox:this.view,scale:t,rotation:e,offsetX:n,offsetY:i,dontFlip:r})}getAnnotations(){let{intent:t="display"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,e.renderingIntent)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render(t){let{canvasContext:e,viewport:n,intent:i="display",annotationMode:r=_util.AnnotationMode.ENABLE,transform:s=null,background:a=null,optionalContentConfigPromise:o=null,annotationCanvasMap:l=null,pageColors:c=null,printAnnotationStorage:h=null}=t;this._stats?.time("Overall");const d=this._transport.getRenderingIntent(i,r,h);this.#i=!1;this.#r();o||(o=this._transport.getOptionalContentConfig());let u=this._intentStates.get(d.cacheKey);if(!u){u=Object.create(null);this._intentStates.set(d.cacheKey,u)}if(u.streamReaderCancelTimeout){clearTimeout(u.streamReaderCancelTimeout);u.streamReaderCancelTimeout=null}const p=!!(d.renderingIntent&_util.RenderingIntentFlag.PRINT);if(!u.displayReadyCapability){u.displayReadyCapability=new _util.PromiseCapability;u.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null};this._stats?.time("Page Request");this._pumpOperatorList(d)}const complete=t=>{u.renderTasks.delete(f);(this._maybeCleanupAfterRender||p)&&(this.#i=!0);this.#s(!p);if(t){f.capability.reject(t);this._abortOperatorList({intentState:u,reason:t instanceof Error?t:new Error(t)})}else f.capability.resolve();this._stats?.timeEnd("Rendering");this._stats?.timeEnd("Overall")},f=new InternalRenderTask({callback:complete,params:{canvasContext:e,viewport:n,transform:s,background:a},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:l,operatorList:u.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!p,pdfBug:this._pdfBug,pageColors:c});(u.renderTasks||=new Set).add(f);const g=f.task;Promise.all([u.displayReadyCapability.promise,o]).then((t=>{let[e,n]=t;if(this.destroyed)complete();else{this._stats?.time("Rendering");f.initializeGraphics({transparency:e,optionalContentConfig:n});f.operatorListChanged()}})).catch(complete);return g}getOperatorList(){let{intent:t="display",annotationMode:e=_util.AnnotationMode.ENABLE,printAnnotationStorage:n=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i=this._transport.getRenderingIntent(t,e,n,!0);let r,s=this._intentStates.get(i.cacheKey);if(!s){s=Object.create(null);this._intentStates.set(i.cacheKey,s)}if(!s.opListReadCapability){r=Object.create(null);r.operatorListChanged=function operatorListChanged(){if(s.operatorList.lastChunk){s.opListReadCapability.resolve(s.operatorList);s.renderTasks.delete(r)}};s.opListReadCapability=new _util.PromiseCapability;(s.renderTasks||=new Set).add(r);s.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null};this._stats?.time("Page Request");this._pumpOperatorList(i)}return s.opListReadCapability.promise}streamTextContent(){let{includeMarkedContent:t=!1,disableNormalization:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:!0===t,disableNormalization:!0===e},{highWaterMark:100,size:t=>t.items.length})}getTextContent(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._transport._htmlForXfa)return this.getXfa().then((t=>_xfa_text.XfaText.textContent(t)));const e=this.streamTextContent(t);return new Promise((function(t,n){const i=e.getReader(),r={items:[],styles:Object.create(null)};!function pump(){i.read().then((function(e){let{value:n,done:i}=e;if(i)t(r);else{Object.assign(r.styles,n.styles);r.items.push(...n.items);pump()}}),n)}()}))}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const t=[];for(const e of this._intentStates.values()){this._abortOperatorList({intentState:e,reason:new Error("Page was destroyed."),force:!0});if(!e.opListReadCapability)for(const n of e.renderTasks){t.push(n.completed);n.cancel()}}this.objs.clear();this.#i=!1;this.#r();return Promise.all(t)}cleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.#i=!0;const e=this.#s(!1);t&&e&&(this._stats&&=new _display_utils.StatTimer);return e}#s(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.#r();if(!this.#i||this.destroyed)return!1;if(t){this.#n=setTimeout((()=>{this.#n=null;this.#s(!1)}),DELAYED_CLEANUP_TIMEOUT);return!1}for(const{renderTasks:t,operatorList:e}of this._intentStates.values())if(t.size>0||!e.lastChunk)return!1;this._intentStates.clear();this.objs.clear();this.#i=!1;return!0}#r(){if(this.#n){clearTimeout(this.#n);this.#n=null}}_startRenderPage(t,e){const n=this._intentStates.get(e);if(n){this._stats?.timeEnd("Page Request");n.displayReadyCapability?.resolve(t)}}_renderPageChunk(t,e){for(let n=0,i=t.length;n{a.read().then((t=>{let{value:e,done:n}=t;if(n)o.streamReader=null;else if(!this._transport.destroyed){this._renderPageChunk(e,o);pump()}}),(t=>{o.streamReader=null;if(!this._transport.destroyed){if(o.operatorList){o.operatorList.lastChunk=!0;for(const t of o.renderTasks)t.operatorListChanged();this.#s(!0)}if(o.displayReadyCapability)o.displayReadyCapability.reject(t);else{if(!o.opListReadCapability)throw t;o.opListReadCapability.reject(t)}}}))};pump()}_abortOperatorList(t){let{intentState:e,reason:n,force:i=!1}=t;if(e.streamReader){if(e.streamReaderCancelTimeout){clearTimeout(e.streamReaderCancelTimeout);e.streamReaderCancelTimeout=null}if(!i){if(e.renderTasks.size>0)return;if(n instanceof _display_utils.RenderingCancelledException){let t=RENDERING_CANCELLED_TIMEOUT;n.extraDelay>0&&n.extraDelay<1e3&&(t+=n.extraDelay);e.streamReaderCancelTimeout=setTimeout((()=>{e.streamReaderCancelTimeout=null;this._abortOperatorList({intentState:e,reason:n,force:!0})}),t);return}}e.streamReader.cancel(new _util.AbortException(n.message)).catch((()=>{}));e.streamReader=null;if(!this._transport.destroyed){for(const[t,n]of this._intentStates)if(n===e){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){const n={data:structuredClone(t,null)};this.#o.then((()=>{for(const t of this.#a)t.call(this,n)}))}addEventListener(t,e){this.#a.add(e)}removeEventListener(t,e){this.#a.delete(e)}terminate(){this.#a.clear()}}exports.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};exports.PDFWorkerUtil=PDFWorkerUtil;if(_util.isNodeJS&&"function"==typeof require){PDFWorkerUtil.isWorkerDisabled=!0;PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js"}else if("object"==typeof document){const t=document?.currentScript?.src;t&&(PDFWorkerUtil.fallbackWorkerSrc=t.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(t,e){let n;try{n=new URL(t);if(!n.origin||"null"===n.origin)return!1}catch{return!1}const i=new URL(e,n);return n.origin===i.origin};PDFWorkerUtil.createCDNWrapper=function(t){const e=`importScripts("${t}");`;return URL.createObjectURL(new Blob([e]))};class PDFWorker{static#l;constructor(){let{name:t=null,port:e=null,verbosity:n=(0,_util.getVerbosityLevel)()}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.name=t;this.destroyed=!1;this.verbosity=n;this._readyCapability=new _util.PromiseCapability;this._port=null;this._webWorker=null;this._messageHandler=null;if(e){if(PDFWorker.#l?.has(e))throw new Error("Cannot use more than one PDFWorker per port.");(PDFWorker.#l||=new WeakMap).set(e,this);this._initializeFromPort(e)}else this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(t){this._port=t;this._messageHandler=new _message_handler.MessageHandler("main","worker",t);this._messageHandler.on("ready",(function(){}));this._readyCapability.resolve();this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:t}=PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,t)||(t=PDFWorkerUtil.createCDNWrapper(new URL(t,window.location).href));const e=new Worker(t),n=new _message_handler.MessageHandler("main","worker",e),terminateEarly=()=>{e.removeEventListener("error",onWorkerError);n.destroy();e.terminate();this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},onWorkerError=()=>{this._webWorker||terminateEarly()};e.addEventListener("error",onWorkerError);n.on("test",(t=>{e.removeEventListener("error",onWorkerError);if(this.destroyed)terminateEarly();else if(t){this._messageHandler=n;this._port=e;this._webWorker=e;this._readyCapability.resolve();n.send("configure",{verbosity:this.verbosity})}else{this._setupFakeWorker();n.destroy();e.terminate()}}));n.on("ready",(t=>{e.removeEventListener("error",onWorkerError);if(this.destroyed)terminateEarly();else try{sendTest()}catch{this._setupFakeWorker()}}));const sendTest=()=>{const t=new Uint8Array;n.send("test",t,[t.buffer])};sendTest();return}catch{(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){if(!PDFWorkerUtil.isWorkerDisabled){(0,_util.warn)("Setting up fake worker.");PDFWorkerUtil.isWorkerDisabled=!0}PDFWorker._setupFakeWorkerGlobal.then((t=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const e=new LoopbackPort;this._port=e;const n="fake"+PDFWorkerUtil.fakeWorkerId++,i=new _message_handler.MessageHandler(n+"_worker",n,e);t.setup(i,e);const r=new _message_handler.MessageHandler(n,n+"_worker",e);this._messageHandler=r;this._readyCapability.resolve();r.send("configure",{verbosity:this.verbosity})})).catch((t=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${t.message}".`))}))}destroy(){this.destroyed=!0;if(this._webWorker){this._webWorker.terminate();this._webWorker=null}PDFWorker.#l?.delete(this._port);this._port=null;if(this._messageHandler){this._messageHandler.destroy();this._messageHandler=null}}static fromPort(t){if(!t?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");const 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){_util.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.');return PDFWorkerUtil.fallbackWorkerSrc}throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_util.isNodeJS&&"function"==typeof require){const worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}await(0,_display_utils.loadScript)(this.workerSrc);return 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,n,i,r){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=r.canvasFactory;this.filterFactory=r.filterFactory;this.cMapReaderFactory=r.cMapReaderFactory;this.standardFontDataFactory=r.standardFontDataFactory;this.destroyed=!1;this.destroyCapability=null;this._networkStream=n;this._fullReader=null;this._lastProgress=null;this.downloadInfoCapability=new _util.PromiseCapability;this.setupMessageHandler()}#p(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=this.#c.get(t);if(n)return n;const i=this.messageHandler.sendWithPromise(t,e);this.#c.set(t,i);return i}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}getRenderingIntent(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_util.AnnotationMode.ENABLE,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=_util.RenderingIntentFlag.DISPLAY,s=_annotation_storage.SerializableEmpty;switch(t){case"any":r=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":r=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)(`getRenderingIntent - invalid intent: ${t}`)}switch(e){case _util.AnnotationMode.DISABLE:r+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:r+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:r+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE;s=(r&_util.RenderingIntentFlag.PRINT&&n instanceof _annotation_storage.PrintAnnotationStorage?n:this.annotationStorage).serializable;break;default:(0,_util.warn)(`getRenderingIntent - invalid annotationMode: ${e}`)}i&&(r+=_util.RenderingIntentFlag.OPLIST);return{renderingIntent:r,cacheKey:`${r}_${s.hash}`,annotationStorageSerializable:s}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0;this.destroyCapability=new _util.PromiseCapability;this.#u?.reject(new Error("Worker was destroyed during onPassword callback"));const t=[];for(const e of this.#h.values())t.push(e._destroy());this.#h.clear();this.#d.clear();this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const e=this.messageHandler.sendWithPromise("Terminate",null);t.push(e);Promise.all(t).then((()=>{this.commonObjs.clear();this.fontLoader.clear();this.#c.clear();this.filterFactory.destroy();this._networkStream?.cancelAllRequests(new _util.AbortException("Worker was terminated."));if(this.messageHandler){this.messageHandler.destroy();this.messageHandler=null}this.destroyCapability.resolve()}),this.destroyCapability.reject);return this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:t,loadingTask:e}=this;t.on("GetReader",((t,e)=>{(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}};e.onPull=()=>{this._fullReader.read().then((function(t){let{value:n,done:i}=t;if(i)e.close();else{(0,_util.assert)(n instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer.");e.enqueue(new Uint8Array(n),1,[n])}})).catch((t=>{e.error(t)}))};e.onCancel=t=>{this._fullReader.cancel(t);e.ready.catch((t=>{if(!this.destroyed)throw t}))}}));t.on("ReaderHeadersReady",(t=>{const n=new _util.PromiseCapability,i=this._fullReader;i.headersReady.then((()=>{if(!i.isStreamingSupported||!i.isRangeSupported){this._lastProgress&&e.onProgress?.(this._lastProgress);i.onProgress=t=>{e.onProgress?.({loaded:t.loaded,total:t.total})}}n.resolve({isStreamingSupported:i.isStreamingSupported,isRangeSupported:i.isRangeSupported,contentLength:i.contentLength})}),n.reject);return n.promise}));t.on("GetRangeReader",((t,e)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const n=this._networkStream.getRangeReader(t.begin,t.end);if(n){e.onPull=()=>{n.read().then((function(t){let{value:n,done:i}=t;if(i)e.close();else{(0,_util.assert)(n instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer.");e.enqueue(new Uint8Array(n),1,[n])}})).catch((t=>{e.error(t)}))};e.onCancel=t=>{n.cancel(t);e.ready.catch((t=>{if(!this.destroyed)throw t}))}}else e.close()}));t.on("GetDoc",(t=>{let{pdfInfo:n}=t;this._numPages=n.numPages;this._htmlForXfa=n.htmlForXfa;delete n.htmlForXfa;e._capability.resolve(new PDFDocumentProxy(n,this))}));t.on("DocException",(function(t){let n;switch(t.name){case"PasswordException":n=new _util.PasswordException(t.message,t.code);break;case"InvalidPDFException":n=new _util.InvalidPDFException(t.message);break;case"MissingPDFException":n=new _util.MissingPDFException(t.message);break;case"UnexpectedResponseException":n=new _util.UnexpectedResponseException(t.message,t.status);break;case"UnknownErrorException":n=new _util.UnknownErrorException(t.message,t.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}e._capability.reject(n)}));t.on("PasswordRequest",(t=>{this.#u=new _util.PromiseCapability;if(e.onPassword){const updatePassword=t=>{t instanceof Error?this.#u.reject(t):this.#u.resolve({password:t})};try{e.onPassword(updatePassword,t.code)}catch(t){this.#u.reject(t)}}else this.#u.reject(new _util.PasswordException(t.message,t.code));return this.#u.promise}));t.on("DataLoaded",(t=>{e.onProgress?.({loaded:t.length,total:t.length});this.downloadInfoCapability.resolve(t)}));t.on("StartRenderPage",(t=>{if(this.destroyed)return;this.#h.get(t.pageIndex)._startRenderPage(t.transparency,t.cacheKey)}));t.on("commonobj",(e=>{let[n,i,r]=e;if(!this.destroyed&&!this.commonObjs.has(n))switch(i){case"Font":const e=this._params;if("error"in r){const t=r.error;(0,_util.warn)(`Error during font loading: ${t}`);this.commonObjs.resolve(n,t);break}const s=e.pdfBug&&globalThis.FontInspector?.enabled?(t,e)=>globalThis.FontInspector.fontAdded(t,e):null,a=new _font_loader.FontFaceObject(r,{isEvalSupported:e.isEvalSupported,disableFontFace:e.disableFontFace,ignoreErrors:e.ignoreErrors,inspectFont:s});this.fontLoader.bind(a).catch((e=>t.sendWithPromise("FontFallback",{id:n}))).finally((()=>{!e.fontExtraProperties&&a.data&&(a.data=null);this.commonObjs.resolve(n,a)}));break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(n,r);break;default:throw new Error(`Got unknown common object type ${i}`)}}));t.on("obj",(t=>{let[e,n,i,r]=t;if(this.destroyed)return;const s=this.#h.get(n);if(!s.objs.has(e))switch(i){case"Image":s.objs.resolve(e,r);if(r){let t;if(r.bitmap){const{width:e,height:n}=r;t=e*n*4}else t=r.data?.length||0;t>_util.MAX_IMAGE_SIZE_TO_CACHE&&(s._maybeCleanupAfterRender=!0)}break;case"Pattern":s.objs.resolve(e,r);break;default:throw new Error(`Got unknown object type ${i}`)}}));t.on("DocProgress",(t=>{this.destroyed||e.onProgress?.({loaded:t.loaded,total:t.total})}));t.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."))));t.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.");const{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."));const e=t-1,n=this.#d.get(e);if(n)return n;const i=this.messageHandler.sendWithPromise("GetPage",{pageIndex:e}).then((t=>{if(this.destroyed)throw new Error("Transport destroyed");const n=new PDFPageProxy(e,t,this,this._params.pdfBug);this.#h.set(e,n);return n}));this.#d.set(e,i);return i}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(){const t="GetMetadata",e=this.#c.get(t);if(e)return e;const n=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,n);return n}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const t of this.#h.values()){if(!t.cleanup())throw new Error(`startCleanup: Page ${t.pageNumber} is currently rendering.`)}this.commonObjs.clear();t||this.fontLoader.clear();this.#c.clear();this.filterFactory.destroy(!0)}}get loadingParams(){const{disableAutoFetch:t,enableXfa:e}=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:t,enableXfa:e})}}class PDFObjects{#f=Object.create(null);#g(t){return this.#f[t]||={capability:new _util.PromiseCapability,data:null}}get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e){const n=this.#g(t);n.capability.promise.then((()=>e(n.data)));return null}const n=this.#f[t];if(!n?.capability.settled)throw new Error(`Requesting object that isn't resolved yet ${t}.`);return n.data}has(t){const e=this.#f[t];return e?.capability.settled||!1}resolve(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=this.#g(t);n.data=e;n.capability.resolve()}clear(){for(const t in this.#f){const{data:e}=this.#f[t];e?.bitmap?.close()}this.#f=Object.create(null)}}class RenderTask{#m=null;constructor(t){this.#m=t;this.onContinue=null}get promise(){return this.#m.capability.promise}cancel(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.#m.cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=this.#m.operatorList;if(!t)return!1;const{annotationCanvasMap:e}=this.#m;return t.form||t.canvas&&e?.size>0}}exports.RenderTask=RenderTask;class InternalRenderTask{static#b=new WeakSet;constructor(t){let{callback:e,params:n,objs:i,commonObjs:r,annotationCanvasMap:s,operatorList:a,pageIndex:o,canvasFactory:l,filterFactory:c,useRequestAnimationFrame:h=!1,pdfBug:d=!1,pageColors:u=null}=t;this.callback=e;this.params=n;this.objs=i;this.commonObjs=r;this.annotationCanvasMap=s;this.operatorListIdx=null;this.operatorList=a;this._pageIndex=o;this.canvasFactory=l;this.filterFactory=c;this._pdfBug=d;this.pageColors=u;this.running=!1;this.graphicsReadyCallback=null;this.graphicsReady=!1;this._useRequestAnimationFrame=!0===h&&"undefined"!=typeof window;this.cancelled=!1;this.capability=new _util.PromiseCapability;this.task=new RenderTask(this);this._cancelBound=this.cancel.bind(this);this._continueBound=this._continue.bind(this);this._scheduleNextBound=this._scheduleNext.bind(this);this._nextBound=this._next.bind(this);this._canvas=n.canvasContext.canvas}get completed(){return this.capability.promise.catch((function(){}))}initializeGraphics(t){let{transparency:e=!1,optionalContentConfig:n}=t;if(this.cancelled)return;if(this._canvas){if(InternalRenderTask.#b.has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");InternalRenderTask.#b.add(this._canvas)}if(this._pdfBug&&globalThis.StepperManager?.enabled){this.stepper=globalThis.StepperManager.create(this._pageIndex);this.stepper.init(this.operatorList);this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint()}const{canvasContext:i,viewport:r,transform:s,background:a}=this.params;this.gfx=new _canvas.CanvasGraphics(i,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:n},this.annotationCanvasMap,this.pageColors);this.gfx.beginDrawing({transform:s,viewport:r,transparency:e,background:a});this.operatorListIdx=0;this.graphicsReady=!0;this.graphicsReadyCallback?.()}cancel(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.running=!1;this.cancelled=!0;this.gfx?.endDrawing();InternalRenderTask.#b.delete(this._canvas);this.callback(t||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,e))}operatorListChanged(){if(this.graphicsReady){this.stepper?.updateOperatorList(this.operatorList);this.running||this._continue()}else this.graphicsReadyCallback||=this._continueBound}_continue(){this.running=!0;this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame((()=>{this._nextBound().catch(this._cancelBound)})):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){if(!this.cancelled){this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper);if(this.operatorListIdx===this.operatorList.argsArray.length){this.running=!1;if(this.operatorList.lastChunk){this.gfx.endDrawing();InternalRenderTask.#b.delete(this._canvas);this.callback()}}}}}const version="3.11.174";exports.version=version;const build="ce8716743";exports.build=build},(t,e,n)=>{var i=n(3),r=n(126);i({target:"Set",proto:!0,real:!0,forced:!n(135)("difference")},{difference:r})},(t,e,n)=>{var i=n(127),r=n(128),s=n(129),a=n(132),o=n(133),l=n(130),c=n(131),h=r.has,d=r.remove;t.exports=function difference(t){var e=i(this),n=o(t),r=s(e);a(e)<=n.size?l(e,(function(t){n.includes(t)&&d(r,t)})):c(n.getIterator(),(function(t){h(e,t)&&d(r,t)}));return r}},(t,e,n)=>{var i=n(128).has;t.exports=function(t){i(t);return t}},(t,e,n)=>{var i=n(14),r=Set.prototype;t.exports={Set:Set,add:i(r.add),has:i(r.has),remove:i(r.delete),proto:r}},(t,e,n)=>{var i=n(128),r=n(130),s=i.Set,a=i.add;t.exports=function(t){var e=new s;r(t,(function(t){a(e,t)}));return e}},(t,e,n)=>{var i=n(14),r=n(131),s=n(128),a=s.Set,o=s.proto,l=i(o.forEach),c=i(o.keys),h=c(new a).next;t.exports=function(t,e,n){return n?r({iterator:c(t),next:h},e):l(t,e)}},(t,e,n)=>{var i=n(8);t.exports=function(t,e,n){for(var r,s,a=n?t:t.iterator,o=t.next;!(r=i(o,a)).done;)if(void 0!==(s=e(r.value)))return s}},(t,e,n)=>{var i=n(72),r=n(128);t.exports=i(r.proto,"size","get")||function(t){return t.size}},(t,e,n)=>{var i=n(31),r=n(47),s=n(8),a=n(62),o=n(134),l="Invalid size",c=RangeError,h=TypeError,d=Math.max,SetRecord=function(t,e,n,i){this.set=t;this.size=e;this.has=n;this.keys=i};SetRecord.prototype={getIterator:function(){return o(r(s(this.keys,this.set)))},includes:function(t){return s(this.has,this.set,t)}};t.exports=function(t){r(t);var e=+t.size;if(e!=e)throw h(l);var n=a(e);if(n<0)throw c(l);return new SetRecord(t,d(n,0),i(t.has),i(t.keys))}},t=>{t.exports=function(t){return{iterator:t,next:t.next,done:!1}}},(t,e,n)=>{var i=n(24),createSetLike=function(t){return{size:t,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}};t.exports=function(t){var e=i("Set");try{(new e)[t](createSetLike(0));try{(new e)[t](createSetLike(-1));return!1}catch(t){return!0}}catch(t){return!1}}},(t,e,n)=>{var i=n(3),r=n(7),s=n(137);i({target:"Set",proto:!0,real:!0,forced:!n(135)("intersection")||r((function(){return"3,2"!==Array.from(new Set([1,2,3]).intersection(new Set([3,2])))}))},{intersection:s})},(t,e,n)=>{var i=n(127),r=n(128),s=n(132),a=n(133),o=n(130),l=n(131),c=r.Set,h=r.add,d=r.has;t.exports=function intersection(t){var e=i(this),n=a(t),r=new c;s(e)>n.size?l(n.getIterator(),(function(t){d(e,t)&&h(r,t)})):o(e,(function(t){n.includes(t)&&h(r,t)}));return r}},(t,e,n)=>{var i=n(3),r=n(139);i({target:"Set",proto:!0,real:!0,forced:!n(135)("isDisjointFrom")},{isDisjointFrom:r})},(t,e,n)=>{var i=n(127),r=n(128).has,s=n(132),a=n(133),o=n(130),l=n(131),c=n(140);t.exports=function isDisjointFrom(t){var e=i(this),n=a(t);if(s(e)<=n.size)return!1!==o(e,(function(t){if(n.includes(t))return!1}),!0);var h=n.getIterator();return!1!==l(h,(function(t){if(r(e,t))return c(h,"normal",!1)}))}},(t,e,n)=>{var i=n(8),r=n(47),s=n(30);t.exports=function(t,e,n){var a,o;r(t);try{if(!(a=s(t,"return"))){if("throw"===e)throw n;return n}a=i(a,t)}catch(t){o=!0;a=t}if("throw"===e)throw n;if(o)throw a;r(a);return n}},(t,e,n)=>{var i=n(3),r=n(142);i({target:"Set",proto:!0,real:!0,forced:!n(135)("isSubsetOf")},{isSubsetOf:r})},(t,e,n)=>{var i=n(127),r=n(132),s=n(130),a=n(133);t.exports=function isSubsetOf(t){var e=i(this),n=a(t);return!(r(e)>n.size)&&!1!==s(e,(function(t){if(!n.includes(t))return!1}),!0)}},(t,e,n)=>{var i=n(3),r=n(144);i({target:"Set",proto:!0,real:!0,forced:!n(135)("isSupersetOf")},{isSupersetOf:r})},(t,e,n)=>{var i=n(127),r=n(128).has,s=n(132),a=n(133),o=n(131),l=n(140);t.exports=function isSupersetOf(t){var e=i(this),n=a(t);if(s(e){var i=n(3),r=n(146);i({target:"Set",proto:!0,real:!0,forced:!n(135)("symmetricDifference")},{symmetricDifference:r})},(t,e,n)=>{var i=n(127),r=n(128),s=n(129),a=n(133),o=n(131),l=r.add,c=r.has,h=r.remove;t.exports=function symmetricDifference(t){var e=i(this),n=a(t).getIterator(),r=s(e);o(n,(function(t){c(e,t)?h(r,t):l(r,t)}));return r}},(t,e,n)=>{var i=n(3),r=n(148);i({target:"Set",proto:!0,real:!0,forced:!n(135)("union")},{union:r})},(t,e,n)=>{var i=n(127),r=n(128).add,s=n(129),a=n(133),o=n(131);t.exports=function union(t){var e=i(this),n=a(t).getIterator(),l=s(e);o(n,(function(t){r(l,t)}));return l}},(t,e,n)=>{var i=n(3),r=n(4),s=n(24),a=n(11),o=n(45).f,l=n(39),c=n(150),h=n(75),d=n(76),u=n(151),p=n(82),f=n(6),g=n(36),m="DOMException",b=s("Error"),v=s(m),y=function DOMException(){c(this,_);var t=arguments.length,e=d(t<1?void 0:arguments[0]),n=d(t<2?void 0:arguments[1],"Error"),i=new v(e,n),r=b(e);r.name=m;o(i,"stack",a(1,p(r.stack,1)));h(i,this,y);return i},_=y.prototype=v.prototype,A="stack"in b(m),S="stack"in new v(1,2),E=v&&f&&Object.getOwnPropertyDescriptor(r,m),x=!(!E||E.writable&&E.configurable),w=A&&!x&&!S;i({global:!0,constructor:!0,forced:g||w},{DOMException:w?y:v});var C=s(m),T=C.prototype;if(T.constructor!==C){g||o(T,"constructor",a(1,C));for(var P in u)if(l(u,P)){var k=u[P],M=k.s;l(C,M)||o(C,M,a(6,k.c))}}},(t,e,n)=>{var i=n(25),r=TypeError;t.exports=function(t,e){if(i(e,t))return t;throw r("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}}},(t,e,n)=>{var i,r=n(36),s=n(3),a=n(4),o=n(24),l=n(14),c=n(7),h=n(41),d=n(21),u=n(153),p=n(17),f=n(20),g=n(23),m=n(154),b=n(47),v=n(78),y=n(39),_=n(159),A=n(44),S=n(64),E=n(85),x=n(160),w=n(162),C=n(128),T=n(83),P=n(119),k=a.Object,M=a.Array,R=a.Date,D=a.Error,I=a.EvalError,O=a.RangeError,L=a.ReferenceError,N=a.SyntaxError,B=a.TypeError,j=a.URIError,U=a.PerformanceMark,z=a.WebAssembly,W=z&&z.CompileError||D,H=z&&z.LinkError||D,q=z&&z.RuntimeError||D,G=o("DOMException"),V=w.Map,$=w.has,X=w.get,K=w.set,Y=C.Set,J=C.add,Q=o("Object","keys"),Z=l([].push),tt=l((!0).valueOf),et=l(1..valueOf),nt=l("".valueOf),it=l(R.prototype.getTime),rt=h("structuredClone"),st="DataCloneError",at="Transferring",checkBasicSemantic=function(t){return!c((function(){var e=new a.Set([7]),n=t(e),i=t(k(7));return n===e||!n.has(7)||"object"!=typeof i||7!=+i}))&&t},checkErrorsCloning=function(t,e){return!c((function(){var n=new e,i=t({a:n,b:n});return!(i&&i.a===i.b&&i.a instanceof e&&i.a.stack===n.stack)}))},ot=a.structuredClone,lt=r||!checkErrorsCloning(ot,D)||!checkErrorsCloning(ot,G)||!(i=ot,!c((function(){var t=i(new a.AggregateError([1],rt,{cause:3}));return"AggregateError"!==t.name||1!==t.errors[0]||t.message!==rt||3!==t.cause}))),ct=!ot&&checkBasicSemantic((function(t){return new U(rt,{detail:t}).detail})),ht=checkBasicSemantic(ot)||ct,throwUncloneable=function(t){throw new G("Uncloneable type: "+t,st)},throwUnpolyfillable=function(t,e){throw new G((e||"Cloning")+" of "+t+" cannot be properly polyfilled in this engine",st)},tryNativeRestrictedStructuredClone=function(t,e){ht||throwUnpolyfillable(e);return ht(t)},cloneBuffer=function(t,e,n){if($(e,t))return X(e,t);var i,r,s,o,l,c;if("SharedArrayBuffer"===(n||v(t)))i=ht?ht(t):t;else{var h=a.DataView;h||"function"==typeof t.slice||throwUnpolyfillable("ArrayBuffer");try{if("function"!=typeof t.slice||t.resizable){r=t.byteLength;s="maxByteLength"in t?{maxByteLength:t.maxByteLength}:void 0;i=new ArrayBuffer(r,s);o=new h(t);l=new h(i);for(c=0;c1&&!p(arguments[1])?b(arguments[1]):void 0,r=i?i.transfer:void 0,s=!1;if(void 0!==r){n=function(t,e){if(!f(t))throw B("Transfer option cannot be converted to a sequence");var n=[];m(t,(function(t){Z(n,b(t))}));for(var i,r,s,o,l,c=0,h=S(n),p=[];c{var i=n(14),r=n(7),s=n(21),a=n(78),o=n(24),l=n(51),noop=function(){},c=[],h=o("Reflect","construct"),d=/^\s*(?:class|function)\b/,u=i(d.exec),p=!d.exec(noop),f=function isConstructor(t){if(!s(t))return!1;try{h(noop,c,t);return!0}catch(t){return!1}},g=function isConstructor(t){if(!s(t))return!1;switch(a(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return p||!!u(d,l(t))}catch(t){return!0}};g.sham=!0;t.exports=!h||r((function(){var t;return f(f.call)||!f(Object)||!f((function(){t=!0}))||t}))?g:f},(t,e,n)=>{var i=n(99),r=n(8),s=n(47),a=n(32),o=n(155),l=n(64),c=n(25),h=n(157),d=n(158),u=n(140),p=TypeError,Result=function(t,e){this.stopped=t;this.result=e},f=Result.prototype;t.exports=function(t,e,n){var g,m,b,v,y,_,A,S=n&&n.that,E=!(!n||!n.AS_ENTRIES),x=!(!n||!n.IS_RECORD),w=!(!n||!n.IS_ITERATOR),C=!(!n||!n.INTERRUPTED),T=i(e,S),stop=function(t){g&&u(g,"normal",t);return new Result(!0,t)},callFn=function(t){if(E){s(t);return C?T(t[0],t[1],stop):T(t[0],t[1])}return C?T(t,stop):T(t)};if(x)g=t.iterator;else if(w)g=t;else{if(!(m=d(t)))throw p(a(t)+" is not iterable");if(o(m)){for(b=0,v=l(t);v>b;b++)if((y=callFn(t[b]))&&c(f,y))return y;return new Result(!1)}g=h(t,m)}_=x?t.next:g.next;for(;!(A=r(_,g)).done;){try{y=callFn(A.value)}catch(t){u(g,"throw",t)}if("object"==typeof y&&y&&c(f,y))return y}return new Result(!1)}},(t,e,n)=>{var i=n(34),r=n(156),s=i("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||a[s]===t)}},t=>{t.exports={}},(t,e,n)=>{var i=n(8),r=n(31),s=n(47),a=n(32),o=n(158),l=TypeError;t.exports=function(t,e){var n=arguments.length<2?o(t):e;if(r(n))return s(i(n,t));throw l(a(t)+" is not iterable")}},(t,e,n)=>{var i=n(78),r=n(30),s=n(17),a=n(156),o=n(34)("iterator");t.exports=function(t){if(!s(t))return r(t,o)||r(t,"@@iterator")||a[i(t)]}},(t,e,n)=>{var i=n(18),r=n(45),s=n(11);t.exports=function(t,e,n){var a=i(e);a in t?r.f(t,a,s(0,n)):t[a]=n}},(t,e,n)=>{var i=n(8),r=n(39),s=n(25),a=n(161),o=RegExp.prototype;t.exports=function(t){var e=t.flags;return void 0!==e||"flags"in o||r(t,"flags")||!s(o,t)?e:i(a,t)}},(t,e,n)=>{var i=n(47);t.exports=function(){var t=i(this),e="";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");return e}},(t,e,n)=>{var i=n(14),r=Map.prototype;t.exports={Map:Map,set:i(r.set),get:i(r.get),has:i(r.has),remove:i(r.delete),proto:r}},(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0});e.SerializableEmpty=e.PrintAnnotationStorage=e.AnnotationStorage=void 0;n(89);n(149);n(152);var i=n(1),r=n(164),s=n(170);const a=Object.freeze({map:null,hash:"",transfers:void 0});e.SerializableEmpty=a;class AnnotationStorage{#v=!1;#y=new Map;constructor(){this.onSetModified=null;this.onResetModified=null;this.onAnnotationEditor=null}getValue(t,e){const n=this.#y.get(t);return void 0===n?e:Object.assign(e,n)}getRawValue(t){return this.#y.get(t)}remove(t){this.#y.delete(t);0===this.#y.size&&this.resetModified();if("function"==typeof this.onAnnotationEditor){for(const t of this.#y.values())if(t instanceof r.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(t,e){const n=this.#y.get(t);let i=!1;if(void 0!==n){for(const[t,r]of Object.entries(e))if(n[t]!==r){i=!0;n[t]=r}}else{i=!0;this.#y.set(t,e)}i&&this.#_();e instanceof r.AnnotationEditor&&"function"==typeof this.onAnnotationEditor&&this.onAnnotationEditor(e.constructor._type)}has(t){return this.#y.has(t)}getAll(){return this.#y.size>0?(0,i.objectFromMap)(this.#y):null}setAll(t){for(const[e,n]of Object.entries(t))this.setValue(e,n)}get size(){return this.#y.size}#_(){if(!this.#v){this.#v=!0;"function"==typeof this.onSetModified&&this.onSetModified()}}resetModified(){if(this.#v){this.#v=!1;"function"==typeof this.onResetModified&&this.onResetModified()}}get print(){return new PrintAnnotationStorage(this)}get serializable(){if(0===this.#y.size)return a;const t=new Map,e=new s.MurmurHash3_64,n=[],i=Object.create(null);let o=!1;for(const[n,s]of this.#y){const a=s instanceof r.AnnotationEditor?s.serialize(!1,i):s;if(a){t.set(n,a);e.update(`${n}:${JSON.stringify(a)}`);o||=!!a.bitmap}}if(o)for(const e of t.values())e.bitmap&&n.push(e.bitmap);return t.size>0?{map:t,hash:e.hexdigest(),transfers:n}:a}}e.AnnotationStorage=AnnotationStorage;class PrintAnnotationStorage extends AnnotationStorage{#A;constructor(t){super();const{map:e,hash:n,transfers:i}=t.serializable,r=structuredClone(e,null);this.#A={map:r,hash:n,transfers:i}}get print(){(0,i.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#A}}e.PrintAnnotationStorage=PrintAnnotationStorage},(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0});e.AnnotationEditor=void 0;n(89);n(2);var i=n(165),r=n(1),s=n(168);class AnnotationEditor{#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=AnnotationEditor._zIndex++;static _borderLineWidth=-1;static _colorManager=new i.ColorManager;static _zIndex=1;static SMALL_EDITOR_SIZE=0;constructor(t){this.constructor===AnnotationEditor&&(0,r.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;const{rotation:e,rawDims:{pageWidth:n,pageHeight:i,pageX:s,pageY:a}}=this.parent.viewport;this.rotation=e;this.pageRotation=(360+e-this._uiManager.viewParameters.rotation)%360;this.pageDimensions=[n,i];this.pageTranslation=[s,a];const[o,l]=this.parentDimensions;this.x=t.x/o;this.y=t.y/l;this.isAttachedToDOM=!1;this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return(0,r.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const e=new FakeEditor({id:t.parent.getNextId(),parent:t.parent,uiManager:t._uiManager});e.annotationElementId=t.annotationElementId;e.deleted=!0;e._uiManager.addToAnnotationStorage(e)}static initialize(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;AnnotationEditor._l10nPromise||=new Map(["editor_alt_text_button_label","editor_alt_text_edit_button_label","editor_alt_text_decorative_tooltip"].map((e=>[e,t.get(e)])));if(e?.strings)for(const n of e.strings)AnnotationEditor._l10nPromise.set(n,t.get(n));if(-1!==AnnotationEditor._borderLineWidth)return;const n=getComputedStyle(document.documentElement);AnnotationEditor._borderLineWidth=parseFloat(n.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,e){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,e){(0,r.unreachable)("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#I}set _isDraggable(t){this.#I=t;this.div?.classList.toggle("draggable",t)}center(){const[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){if(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){if(!this._focusEventsAllowed)return;if(!this.isAttachedToDOM)return;const e=t.relatedTarget;if(!e?.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,n,i){const[r,s]=this.parentDimensions;[n,i]=this.screenToPageTranslation(n,i);this.x=(t+n)/r;this.y=(e+i)/s;this.fixAndSetPosition()}#L(t,e,n){let[i,r]=t;[e,n]=this.screenToPageTranslation(e,n);this.x+=e/i;this.y+=n/r;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){const[n,i]=this.parentDimensions;this.x+=t/n;this.y+=e/i;if(this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:t,y:e}=this.div.getBoundingClientRect();if(this.parent.findNewParent(this,t,e)){this.x-=Math.floor(this.x);this.y-=Math.floor(this.y)}}let{x:r,y:s}=this;const[a,o]=this.#N();r+=a;s+=o;this.div.style.left=`${(100*r).toFixed(2)}%`;this.div.style.top=`${(100*s).toFixed(2)}%`;this.div.scrollIntoView({block:"nearest"})}#N(){const[t,e]=this.parentDimensions,{_borderLineWidth:n}=AnnotationEditor,i=n/t,r=n/e;switch(this.rotation){case 90:return[-i,r];case 180:return[i,r];case 270:return[i,-r];default:return[-i,-r]}}fixAndSetPosition(){const[t,e]=this.pageDimensions;let{x:n,y:i,width:r,height:s}=this;r*=t;s*=e;n*=t;i*=e;switch(this.rotation){case 0:n=Math.max(0,Math.min(t-r,n));i=Math.max(0,Math.min(e-s,i));break;case 90:n=Math.max(0,Math.min(t-s,n));i=Math.min(e,Math.max(r,i));break;case 180:n=Math.min(t,Math.max(r,n));i=Math.min(e,Math.max(s,i));break;case 270:n=Math.min(t,Math.max(s,n));i=Math.max(0,Math.min(e-r,i))}this.x=n/=t;this.y=i/=e;const[a,o]=this.#N();n+=a;i+=o;const{style:l}=this.div;l.left=`${(100*n).toFixed(2)}%`;l.top=`${(100*i).toFixed(2)}%`;this.moveInDOM()}static#B(t,e,n){switch(n){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}}screenToPageTranslation(t,e){return AnnotationEditor.#B(t,e,this.parentRotation)}pageTranslationToScreen(t,e){return AnnotationEditor.#B(t,e,360-this.parentRotation)}#j(t){switch(t){case 90:{const[t,e]=this.pageDimensions;return[0,-t/e,e/t,0]}case 180:return[-1,0,0,-1];case 270:{const[t,e]=this.pageDimensions;return[0,t/e,-e/t,0]}default:return[1,0,0,1]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:t,pageDimensions:[e,n]}=this,i=e*t,s=n*t;return r.FeatureTest.isCSSRoundSupported?[Math.round(i),Math.round(s)]:[i,s]}setDims(t,e){const[n,i]=this.parentDimensions;this.div.style.width=`${(100*t/n).toFixed(2)}%`;this.#T||(this.div.style.height=`${(100*e/i).toFixed(2)}%`);this.#x?.classList.toggle("small",t{this._isDraggable=s;window.removeEventListener("pointerup",pointerUpCallback);window.removeEventListener("blur",pointerUpCallback);window.removeEventListener("pointermove",i,a);this.parent.div.style.cursor=d;this.div.style.cursor=u;const t=this.x,e=this.y,n=this.width,r=this.height;t===o&&e===l&&n===c&&r===h||this.addCommands({cmd:()=>{this.width=n;this.height=r;this.x=t;this.y=e;const[i,s]=this.parentDimensions;this.setDims(i*n,s*r);this.fixAndSetPosition()},undo:()=>{this.width=c;this.height=h;this.x=o;this.y=l;const[t,e]=this.parentDimensions;this.setDims(t*c,e*h);this.fixAndSetPosition()},mustExec:!0})};window.addEventListener("pointerup",pointerUpCallback);window.addEventListener("blur",pointerUpCallback)}#W(t,e){const[n,i]=this.parentDimensions,r=this.x,s=this.y,a=this.width,o=this.height,l=AnnotationEditor.MIN_SIZE/n,c=AnnotationEditor.MIN_SIZE/i,round=t=>Math.round(1e4*t)/1e4,h=this.#j(this.rotation),transf=(t,e)=>[h[0]*t+h[2]*e,h[1]*t+h[3]*e],d=this.#j(360-this.rotation);let u,p,f=!1,g=!1;switch(t){case"topLeft":f=!0;u=(t,e)=>[0,0];p=(t,e)=>[t,e];break;case"topMiddle":u=(t,e)=>[t/2,0];p=(t,e)=>[t/2,e];break;case"topRight":f=!0;u=(t,e)=>[t,0];p=(t,e)=>[0,e];break;case"middleRight":g=!0;u=(t,e)=>[t,e/2];p=(t,e)=>[0,e/2];break;case"bottomRight":f=!0;u=(t,e)=>[t,e];p=(t,e)=>[0,0];break;case"bottomMiddle":u=(t,e)=>[t/2,e];p=(t,e)=>[t/2,0];break;case"bottomLeft":f=!0;u=(t,e)=>[0,e];p=(t,e)=>[t,0];break;case"middleLeft":g=!0;u=(t,e)=>[0,e/2];p=(t,e)=>[t,e/2]}const m=u(a,o),b=p(a,o);let v=transf(...b);const y=round(r+v[0]),_=round(s+v[1]);let A=1,S=1,[E,x]=this.screenToPageTranslation(e.movementX,e.movementY);[E,x]=(w=E/n,C=x/i,[d[0]*w+d[2]*C,d[1]*w+d[3]*C]);var w,C;if(f){const t=Math.hypot(a,o);A=S=Math.max(Math.min(Math.hypot(b[0]-m[0]-E,b[1]-m[1]-x)/t,1/a,1/o),l/a,c/o)}else g?A=Math.max(l,Math.min(1,Math.abs(b[0]-m[0]-E)))/a:S=Math.max(c,Math.min(1,Math.abs(b[1]-m[1]-x)))/o;const T=round(a*A),P=round(o*S);v=transf(...p(T,P));const k=y-v[0],M=_-v[1];this.width=T;this.height=P;this.x=k;this.y=M;this.setDims(n*T,i*P);this.fixAndSetPosition()}async addAltTextButton(){if(this.#x)return;const t=this.#x=document.createElement("button");t.className="altText";const e=await AnnotationEditor._l10nPromise.get("editor_alt_text_button_label");t.textContent=e;t.setAttribute("aria-label",e);t.tabIndex="0";t.addEventListener("contextmenu",s.noContextMenu);t.addEventListener("pointerdown",(t=>t.stopPropagation()));t.addEventListener("click",(t=>{t.preventDefault();this._uiManager.editAltText(this)}),{capture:!0});t.addEventListener("keydown",(e=>{if(e.target===t&&"Enter"===e.key){e.preventDefault();this._uiManager.editAltText(this)}}));this.#H();this.div.append(t);if(!AnnotationEditor.SMALL_EDITOR_SIZE){const e=40;AnnotationEditor.SMALL_EDITOR_SIZE=Math.min(128,Math.round(t.getBoundingClientRect().width*(1+e/100)))}}async#H(){const t=this.#x;if(!t)return;if(!this.#S&&!this.#E){t.classList.remove("done");this.#w?.remove();return}AnnotationEditor._l10nPromise.get("editor_alt_text_edit_button_label").then((e=>{t.setAttribute("aria-label",e)}));let e=this.#w;if(!e){this.#w=e=document.createElement("span");e.className="tooltip";e.setAttribute("role","tooltip");const n=e.id=`alt-text-tooltip-${this.id}`;t.setAttribute("aria-describedby",n);const i=100;t.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"}}})}),i)}));t.addEventListener("mouseleave",(()=>{clearTimeout(this.#C);this.#C=null;this.#w?.classList.remove("show")}))}t.classList.add("done");e.innerText=this.#E?await AnnotationEditor._l10nPromise.get("editor_alt_text_decorative_tooltip"):this.#S;e.parentNode||t.append(e)}getClientDimensions(){return this.div.getBoundingClientRect()}get altTextData(){return{altText:this.#S,decorative:this.#E}}set altTextData(t){let{altText:e,decorative:n}=t;if(this.#S!==e||this.#E!==n){this.#S=e;this.#E=n;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);const[t,e]=this.parentDimensions;if(this.parentRotation%180!=0){this.div.style.maxWidth=`${(100*e/t).toFixed(2)}%`;this.div.style.maxHeight=`${(100*t/e).toFixed(2)}%`}const[n,r]=this.getInitialTranslation();this.translate(n,r);(0,i.bindEvents)(this,this.div,["pointerdown"]);return this.div}pointerdown(t){const{isMac:e}=r.FeatureTest.platform;if(0!==t.button||t.ctrlKey&&e)t.preventDefault();else{this.#F=!0;this.#q(t)}}#q(t){if(!this._isDraggable)return;const e=this._uiManager.isSelected(this);this._uiManager.setUpDragSession();let n,i;if(e){n={passive:!0,capture:!0};i=t=>{const[e,n]=this.screenToPageTranslation(t.movementX,t.movementY);this._uiManager.dragSelectedEditors(e,n)};window.addEventListener("pointermove",i,n)}const pointerUpCallback=()=>{window.removeEventListener("pointerup",pointerUpCallback);window.removeEventListener("blur",pointerUpCallback);e&&window.removeEventListener("pointermove",i,n);this.#F=!1;if(!this._uiManager.endDragSession()){const{isMac:e}=r.FeatureTest.platform;t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this)}};window.addEventListener("pointerup",pointerUpCallback);window.addEventListener("blur",pointerUpCallback)}moveInDOM(){this.parent?.moveEditorInDOM(this)}_setParentAndPosition(t,e,n){t.changeParent(this);this.x=e;this.y=n;this.fixAndSetPosition()}getRect(t,e){const n=this.parentScale,[i,r]=this.pageDimensions,[s,a]=this.pageTranslation,o=t/n,l=e/n,c=this.x*i,h=this.y*r,d=this.width*i,u=this.height*r;switch(this.rotation){case 0:return[c+o+s,r-h-l-u+a,c+o+d+s,r-h-l+a];case 90:return[c+l+s,r-h+o+a,c+l+u+s,r-h+o+d+a];case 180:return[c-o-d+s,r-h+l+a,c-o+s,r-h+l+u+a];case 270:return[c-l-u+s,r-h-o-d+a,c-l+s,r-h-o+a];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,e){const[n,i,r,s]=t,a=r-n,o=s-i;switch(this.rotation){case 0:return[n,e-s,a,o];case 90:return[n,e-i,o,a];case 180:return[r,e-i,a,o];case 270:return[r,e-s,o,a];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,r.unreachable)("An editor must be serializable")}static deserialize(t,e,n){const i=new this.prototype.constructor({parent:e,id:e.getNextId(),uiManager:n});i.rotation=t.rotation;const[r,s]=i.pageDimensions,[a,o,l,c]=i.getRectInCurrentCoords(t.rect,s);i.x=a/r;i.y=o/s;i.width=l/r;i.height=c/s;return i}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(){if(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;if(this.parent)if(t){this.parent.setSelected(this);this.parent.setActiveEditor(this)}else this.parent.setActiveEditor(null)}setAspectRatio(t,e){this.#T=!0;const n=t/e,{style:i}=this.div;i.aspectRatio=n;i.height="auto"}static get MIN_SIZE(){return 16}}e.AnnotationEditor=AnnotationEditor;class FakeEditor extends AnnotationEditor{constructor(t){super(t);this.annotationElementId=t.annotationElementId;this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}},(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0});e.KeyboardManager=e.CommandManager=e.ColorManager=e.AnnotationEditorUIManager=void 0;e.bindEvents=function bindEvents(t,e,n){for(const i of n)e.addEventListener(i,t[i].bind(t))};e.opacityToHex=function opacityToHex(t){return Math.round(Math.min(255,Math.max(1,255*t))).toString(16).padStart(2,"0")};n(93);n(101);n(102);n(105);n(107);n(109);n(113);n(116);n(123);n(2);n(89);n(125);n(136);n(138);n(141);n(143);n(145);n(147);n(166);var i=n(1),r=n(168);class IdManager{#G=0;getId(){return`${i.AnnotationEditorPrefix}${this.#G++}`}}class ImageManager{#V=(0,i.getUuid)();#G=0;#$=null;static get _isSVGFittingCanvas(){const t=new OffscreenCanvas(1,3).getContext("2d"),e=new Image;e.src='data:image/svg+xml;charset=UTF-8,';const n=e.decode().then((()=>{t.drawImage(e,0,0,1,1,0,0,1,3);return 0===new Uint32Array(t.getImageData(0,0,1,1).data.buffer)[0]}));return(0,i.shadow)(this,"_isSVGFittingCanvas",n)}async#X(t,e){this.#$||=new Map;let n=this.#$.get(t);if(null===n)return null;if(n?.bitmap){n.refCounter+=1;return n}try{n||={bitmap:null,id:`image_${this.#V}_${this.#G++}`,refCounter:0,isSvg:!1};let t;if("string"==typeof e){n.url=e;const i=await fetch(e);if(!i.ok)throw new Error(i.statusText);t=await i.blob()}else t=n.file=e;if("image/svg+xml"===t.type){const e=ImageManager._isSVGFittingCanvas,i=new FileReader,r=new Image,s=new Promise(((t,s)=>{r.onload=()=>{n.bitmap=r;n.isSvg=!0;t()};i.onload=async()=>{const t=n.svgUrl=i.result;r.src=await e?`${t}#svgView(preserveAspectRatio(none))`:t};r.onerror=i.onerror=s}));i.readAsDataURL(t);await s}else n.bitmap=await createImageBitmap(t);n.refCounter=1}catch(t){console.error(t);n=null}this.#$.set(t,n);n&&this.#$.set(n.id,n);return n}async getFromFile(t){const{lastModified:e,name:n,size:i,type:r}=t;return this.#X(`${e}_${n}_${i}_${r}`,t)}async getFromUrl(t){return this.#X(t,t)}async getFromId(t){this.#$||=new Map;const e=this.#$.get(t);if(!e)return null;if(e.bitmap){e.refCounter+=1;return e}return e.file?this.getFromFile(e.file):this.getFromUrl(e.url)}getSvgUrl(t){const e=this.#$.get(t);return e?.isSvg?e.svgUrl:null}deleteId(t){this.#$||=new Map;const e=this.#$.get(t);if(e){e.refCounter-=1;0===e.refCounter&&(e.bitmap=null)}}isValidId(t){return t.startsWith(`image_${this.#V}_`)}}class CommandManager{#K=[];#Y=!1;#J;#Q=-1;constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:128;this.#J=t}add(t){let{cmd:e,undo:n,mustExec:i,type:r=NaN,overwriteIfSameType:s=!1,keepUndo:a=!1}=t;i&&e();if(this.#Y)return;const o={cmd:e,undo:n,type:r};if(-1===this.#Q){this.#K.length>0&&(this.#K.length=0);this.#Q=0;this.#K.push(o);return}if(s&&this.#K[this.#Q].type===r){a&&(o.undo=this.#K[this.#Q].undo);this.#K[this.#Q]=o;return}const l=this.#Q+1;if(l===this.#J)this.#K.splice(0,1);else{this.#Q=l;lt===e[n])))return ColorManager._colorsMapping.get(t);return e}getHexCode(t){const e=this._colors.get(t);return e?i.Util.makeHexColor(...e):t}}e.ColorManager=ColorManager;class AnnotationEditorUIManager{#tt=null;#et=new Map;#nt=new Map;#it=null;#rt=null;#st=new CommandManager;#at=0;#ot=new Set;#lt=null;#ct=null;#ht=new Set;#dt=null;#ut=new IdManager;#pt=!1;#ft=!1;#gt=null;#mt=i.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(){const t=AnnotationEditorUIManager.prototype,arrowChecker=t=>{const{activeElement:e}=document;return e&&t.#Rt.contains(e)&&t.hasSomethingToControl()},e=this.TRANSLATE_SMALL,n=this.TRANSLATE_BIG;return(0,i.shadow)(this,"_keyboardManager",new KeyboardManager([[["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:[-e,0],checker:arrowChecker}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-n,0],checker:arrowChecker}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[e,0],checker:arrowChecker}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[n,0],checker:arrowChecker}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-e],checker:arrowChecker}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-n],checker:arrowChecker}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,e],checker:arrowChecker}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,n],checker:arrowChecker}]]))}constructor(t,e,n,i,s,a){this.#Rt=t;this.#Dt=e;this.#it=n;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:r.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(const 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,i.shadow)(this,"hcmFilter",this.#vt?this.#dt.addHCMFilter(this.#vt.foreground,this.#vt.background):"none")}get direction(){return(0,i.shadow)(this,"direction",getComputedStyle(this.#Rt).direction)}editAltText(t){this.#it?.editAltText(this,t)}onPageChanging(t){let{pageNumber:e}=t;this.#at=e-1}focusMainContainer(){this.#Rt.focus()}findParent(t,e){for(const n of this.#nt.values()){const{x:i,y:r,width:s,height:a}=n.div.getBoundingClientRect();if(t>=i&&t<=i+s&&e>=r&&e<=r+a)return n}return null}disableUserSelect(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.#Dt.classList.toggle("noUserSelect",t)}addShouldRescale(t){this.#ht.add(t)}removeShouldRescale(t){this.#ht.delete(t)}onScaleChanging(t){let{scale:e}=t;this.commitOrRemove();this.viewParameters.realScale=e*r.PixelsPerInch.PDF_TO_CSS_UNITS;for(const t of this.#ht)t.onScaleChanging()}onRotationChanging(t){let{pagesRotation:e}=t;this.commitOrRemove();this.viewParameters.rotation=e}addToAnnotationStorage(t){t.isEmpty()||!this.#rt||this.#rt.has(t.id)||this.#rt.setValue(t.id,t)}#Lt(){window.addEventListener("focus",this.#_t);window.addEventListener("blur",this.#yt)}#Ot(){window.removeEventListener("focus",this.#_t);window.removeEventListener("blur",this.#yt)}blur(){if(!this.hasSelection)return;const{activeElement:t}=document;for(const e of this.#bt)if(e.div.contains(t)){this.#gt=[e,t];e._focusEventsAllowed=!1;break}}focus(){if(!this.#gt)return;const[t,e]=this.#gt;this.#gt=null;e.addEventListener("focusin",(()=>{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){t.preventDefault();this.#tt?.commitOrRemove();if(!this.hasSelection)return;const e=[];for(const t of this.#bt){const n=t.serialize(!0);n&&e.push(n)}0!==e.length&&t.clipboardData.setData("application/pdfjs",JSON.stringify(e))}cut(t){this.copy(t);this.delete()}paste(t){t.preventDefault();const{clipboardData:e}=t;for(const t of e.items)for(const e of this.#ct)if(e.isHandlingMimeForPasting(t.type)){e.paste(t,this.currentLayer);return}let n=e.getData("application/pdfjs");if(!n)return;try{n=JSON.parse(n)}catch(t){(0,i.warn)(`paste: "${t.message}".`);return}if(!Array.isArray(n))return;this.unselectAll();const r=this.currentLayer;try{const t=[];for(const e of n){const n=r.deserialize(e);if(!n)return;t.push(n)}const cmd=()=>{for(const e of t)this.#Ut(e);this.#zt(t)},undo=()=>{for(const e of t)e.remove()};this.addCommands({cmd:cmd,undo:undo,mustExec:!0})}catch(t){(0,i.warn)(`paste: "${t.message}".`)}}keydown(t){this.getActive()?.shouldGetKeyboardEvents()||AnnotationEditorUIManager._keyboardManager.exec(this,t)}onEditingAction(t){["undo","redo","delete","selectAll"].includes(t.name)&&this[t.name]()}#Wt(t){Object.entries(t).some((t=>{let[e,n]=t;return this.#kt[e]!==n}))&&this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#kt,t)})}#Ht(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})}setEditingState(t){if(t){this.#Lt();this.#Nt();this.#Bt();this.#Wt({isEditing:this.#mt!==i.AnnotationEditorType.NONE,isEmpty:this.#qt(),hasSomethingToUndo:this.#st.hasSomethingToUndo(),hasSomethingToRedo:this.#st.hasSomethingToRedo(),hasSelectedEditor:!1})}else{this.#Ot();this.#It();this.#jt();this.#Wt({isEditing:!1});this.disableUserSelect(!1)}}registerEditorTypes(t){if(!this.#ct){this.#ct=t;for(const 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(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.#mt!==t){this.#mt=t;if(t!==i.AnnotationEditorType.NONE){this.setEditingState(!0);this.#Gt();this.unselectAll();for(const e of this.#nt.values())e.updateMode(t);if(e)for(const t of this.#et.values())if(t.annotationElementId===e){this.setSelected(t);t.enterInEditMode();break}}else{this.setEditingState(!1);this.#Vt()}}}updateToolbar(t){t!==this.#mt&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:t})}updateParams(t,e){if(this.#ct)if(t!==i.AnnotationEditorParamsType.CREATE){for(const n of this.#bt)n.updateParams(t,e);for(const n of this.#ct)n.updateDefaultParams(t,e)}else this.currentLayer.addNewEditor(t)}enableWaiting(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.#ft!==t){this.#ft=t;for(const e of this.#nt.values()){t?e.disableClick():e.enableClick();e.div.classList.toggle("waiting",t)}}}#Gt(){if(!this.#pt){this.#pt=!0;for(const t of this.#nt.values())t.enable()}}#Vt(){this.unselectAll();if(this.#pt){this.#pt=!1;for(const t of this.#nt.values())t.disable()}}getEditors(t){const e=[];for(const n of this.#et.values())n.pageIndex===t&&e.push(n);return e}getEditor(t){return this.#et.get(t)}addEditor(t){this.#et.set(t.id,t)}removeEditor(t){this.#et.delete(t.id);this.unselect(t);t.annotationElementId&&this.#ot.has(t.annotationElementId)||this.#rt?.remove(t.id)}addDeletedAnnotationElement(t){this.#ot.add(t.annotationElementId);t.deleted=!0}isDeletedAnnotationElement(t){return this.#ot.has(t)}removeDeletedAnnotationElement(t){this.#ot.delete(t.annotationElementId);t.deleted=!1}#Ut(t){const e=this.#nt.get(t.pageIndex);e?e.addOrRebuild(t):this.addEditor(t)}setActiveEditor(t){if(this.#tt!==t){this.#tt=t;t&&this.#Ht(t.propertiesToUpdate)}}toggleSelected(t){if(this.#bt.has(t)){this.#bt.delete(t);t.unselect();this.#Wt({hasSelectedEditor:this.hasSelection})}else{this.#bt.add(t);t.select();this.#Ht(t.propertiesToUpdate);this.#Wt({hasSelectedEditor:!0})}}setSelected(t){for(const e of this.#bt)e!==t&&e.unselect();this.#bt.clear();this.#bt.add(t);t.select();this.#Ht(t.propertiesToUpdate);this.#Wt({hasSelectedEditor:!0})}isSelected(t){return this.#bt.has(t)}unselect(t){t.unselect();this.#bt.delete(t);this.#Wt({hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==this.#bt.size}undo(){this.#st.undo();this.#Wt({hasSomethingToUndo:this.#st.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#qt()})}redo(){this.#st.redo();this.#Wt({hasSomethingToUndo:!0,hasSomethingToRedo:this.#st.hasSomethingToRedo(),isEmpty:this.#qt()})}addCommands(t){this.#st.add(t);this.#Wt({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#qt()})}#qt(){if(0===this.#et.size)return!0;if(1===this.#et.size)for(const t of this.#et.values())return t.isEmpty();return!1}delete(){this.commitOrRemove();if(!this.hasSelection)return;const t=[...this.#bt];this.addCommands({cmd:()=>{for(const e of t)e.remove()},undo:()=>{for(const e of t)this.#Ut(e)},mustExec:!0})}commitOrRemove(){this.#tt?.commitOrRemove()}hasSomethingToControl(){return this.#tt||this.hasSelection}#zt(t){this.#bt.clear();for(const e of t)if(!e.isEmpty()){this.#bt.add(e);e.select()}this.#Wt({hasSelectedEditor:!0})}selectAll(){for(const t of this.#bt)t.commit();this.#zt(this.#et.values())}unselectAll(){if(this.#tt)this.#tt.commitOrRemove();else if(this.hasSelection){for(const t of this.#bt)t.unselect();this.#bt.clear();this.#Wt({hasSelectedEditor:!1})}}translateSelectedEditors(t,e){arguments.length>2&&void 0!==arguments[2]&&arguments[2]||this.commitOrRemove();if(!this.hasSelection)return;this.#Mt[0]+=t;this.#Mt[1]+=e;const[n,i]=this.#Mt,r=[...this.#bt];this.#Ft&&clearTimeout(this.#Ft);this.#Ft=setTimeout((()=>{this.#Ft=null;this.#Mt[0]=this.#Mt[1]=0;this.addCommands({cmd:()=>{for(const t of r)this.#et.has(t.id)&&t.translateInPage(n,i)},undo:()=>{for(const t of r)this.#et.has(t.id)&&t.translateInPage(-n,-i)},mustExec:!1})}),1e3);for(const n of r)n.translateInPage(t,e)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0);this.#lt=new Map;for(const 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);const t=this.#lt;this.#lt=null;let e=!1;for(const[{x:n,y:i,pageIndex:r},s]of t){s.newX=n;s.newY=i;s.newPageIndex=r;e||=n!==s.savedX||i!==s.savedY||r!==s.savedPageIndex}if(!e)return!1;const move=(t,e,n,i)=>{if(this.#et.has(t.id)){const r=this.#nt.get(i);if(r)t._setParentAndPosition(r,e,n);else{t.pageIndex=i;t.x=e;t.y=n}}};this.addCommands({cmd:()=>{for(const[e,{newX:n,newY:i,newPageIndex:r}]of t)move(e,n,i,r)},undo:()=>{for(const[e,{savedX:n,savedY:i,savedPageIndex:r}]of t)move(e,n,i,r)},mustExec:!0});return!0}dragSelectedEditors(t,e){if(this.#lt)for(const n of this.#lt.keys())n.drag(t,e)}rebuild(t){if(null===t.parent){const e=this.getLayer(t.pageIndex);if(e){e.changeParent(t);e.addOrRebuild(t)}else{this.addEditor(t);this.addToAnnotationStorage(t);t.rebuild()}}else t.parent.addOrRebuild(t)}isActive(t){return this.#tt===t}getActive(){return this.#tt}getMode(){return this.#mt}get imageManager(){return(0,i.shadow)(this,"imageManager",new ImageManager)}}e.AnnotationEditorUIManager=AnnotationEditorUIManager},(t,e,n)=>{var i=n(3),r=n(6),s=n(4),a=n(24),o=n(14),l=n(8),c=n(21),h=n(20),d=n(91),u=n(39),p=n(77),f=n(64),g=n(159),m=n(7),b=n(167),v=n(27),y=s.JSON,_=s.Number,A=s.SyntaxError,S=y&&y.parse,E=a("Object","keys"),x=Object.getOwnPropertyDescriptor,w=o("".charAt),C=o("".slice),T=o(/./.exec),P=o([].push),k=/^\d$/,M=/^[1-9]$/,R=/^(?:-|\d)$/,D=/^[\t\n\r ]$/,internalize=function(t,e,n,i){var r,s,a,o,c,p=t[e],g=i&&p===i.value,m=g&&"string"==typeof i.source?{source:i.source}:{};if(h(p)){var b=d(p),v=g?i.nodes:b?[]:{};if(b){r=v.length;a=f(p);for(o=0;o{var i=n(14),r=n(39),s=SyntaxError,a=parseInt,o=String.fromCharCode,l=i("".charAt),c=i("".slice),h=i(/./.exec),d={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":"\n","\\r":"\r","\\t":"\t"},u=/^[\da-f]{4}$/i,p=/^[\u0000-\u001F]$/;t.exports=function(t,e){for(var n=!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 deprecated(t){console.log("Deprecated API usage: "+t)};e.getColorValues=function getColorValues(t){const e=document.createElement("span");e.style.visibility="hidden";document.body.append(e);for(const n of t.keys()){e.style.color=n;const i=window.getComputedStyle(e).color;t.set(n,getRGB(i))}e.remove()};e.getCurrentTransform=function getCurrentTransform(t){const{a:e,b:n,c:i,d:r,e:s,f:a}=t.getTransform();return[e,n,i,r,s,a]};e.getCurrentTransformInverse=function getCurrentTransformInverse(t){const{a:e,b:n,c:i,d:r,e:s,f:a}=t.getTransform().invertSelf();return[e,n,i,r,s,a]};e.getFilenameFromUrl=function getFilenameFromUrl(t){arguments.length>1&&void 0!==arguments[1]&&arguments[1]||([t]=t.split(/[#?]/,1));return t.substring(t.lastIndexOf("/")+1)};e.getPdfFilenameFromUrl=function getPdfFilenameFromUrl(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"document.pdf";if("string"!=typeof t)return e;if(isDataScheme(t)){(0,r.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.');return e}const n=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,i=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(t);let s=n.exec(i[1])||n.exec(i[2])||n.exec(i[3]);if(s){s=s[0];if(s.includes("%"))try{s=n.exec(decodeURIComponent(s))[0]}catch{}}return s||e};e.getRGB=getRGB;e.getXfaPageViewport=function getXfaPageViewport(t,e){let{scale:n=1,rotation:i=0}=e;const{width:r,height:s}=t.attributes.style,a=[0,0,parseInt(r),parseInt(s)];return new PageViewport({viewBox:a,scale:n,rotation:i})};e.isDataScheme=isDataScheme;e.isPdfFile=function isPdfFile(t){return"string"==typeof t&&/\.pdf$/i.test(t)};e.isValidFetchUrl=isValidFetchUrl;e.loadScript=function loadScript(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return new Promise(((n,i)=>{const r=document.createElement("script");r.src=t;r.onload=function(t){e&&r.remove();n(t)};r.onerror=function(){i(new Error(`Cannot load script at: ${r.src}`))};(document.head||document.documentElement).append(r)}))};e.noContextMenu=function noContextMenu(t){t.preventDefault()};e.setLayerDimensions=function setLayerDimensions(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(e instanceof PageViewport){const{pageWidth:i,pageHeight:s}=e.rawDims,{style:a}=t,o=r.FeatureTest.isCSSRoundSupported,l=`var(--scale-factor) * ${i}px`,c=`var(--scale-factor) * ${s}px`,h=o?`round(${l}, 1px)`:`calc(${l})`,d=o?`round(${c}, 1px)`:`calc(${c})`;if(n&&e.rotation%180!=0){a.width=d;a.height=h}else{a.width=h;a.height=d}}i&&t.setAttribute("data-main-rotation",e.rotation)};n(2);n(93);n(101);n(102);n(105);n(107);n(109);n(113);n(116);n(123);n(89);n(84);n(86);n(87);var i=n(169),r=n(1);const s="http://www.w3.org/2000/svg";class PixelsPerInch{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}e.PixelsPerInch=PixelsPerInch;class DOMFilterFactory extends i.BaseFilterFactory{#$t;#Xt;#e;#Kt;#Yt;#Jt;#Qt;#Zt;#te;#ee;#G=0;constructor(){let{docId:t,ownerDocument:e=globalThis.document}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super();this.#e=t;this.#Kt=e}get#$(){return this.#$t||=new Map}get#ne(){if(!this.#Xt){const t=this.#Kt.createElement("div"),{style:e}=t;e.visibility="hidden";e.contain="strict";e.width=e.height=0;e.position="absolute";e.top=e.left=0;e.zIndex=-1;const n=this.#Kt.createElementNS(s,"svg");n.setAttribute("width",0);n.setAttribute("height",0);this.#Xt=this.#Kt.createElementNS(s,"defs");t.append(n);n.append(this.#Xt);this.#Kt.body.append(t)}return this.#Xt}addFilter(t){if(!t)return"none";let e,n,i,r,s=this.#$.get(t);if(s)return s;if(1===t.length){const s=t[0],a=new Array(256);for(let t=0;t<256;t++)a[t]=s[t]/255;r=e=n=i=a.join(",")}else{const[s,a,o]=t,l=new Array(256),c=new Array(256),h=new Array(256);for(let t=0;t<256;t++){l[t]=s[t]/255;c[t]=a[t]/255;h[t]=o[t]/255}e=l.join(",");n=c.join(",");i=h.join(",");r=`${e}${n}${i}`}s=this.#$.get(r);if(s){this.#$.set(t,s);return s}const a=`g_${this.#e}_transfer_map_${this.#G++}`,o=`url(#${a})`;this.#$.set(t,o);this.#$.set(r,o);const l=this.#ie(a);this.#re(e,n,i,l);return o}addHCMFilter(t,e){const n=`${t}-${e}`;if(this.#Jt===n)return this.#Qt;this.#Jt=n;this.#Qt="none";this.#Yt?.remove();if(!t||!e)return this.#Qt;const i=this.#se(t);t=r.Util.makeHexColor(...i);const s=this.#se(e);e=r.Util.makeHexColor(...s);this.#ne.style.color="";if("#000000"===t&&"#ffffff"===e||t===e)return this.#Qt;const a=new Array(256);for(let t=0;t<=255;t++){const e=t/255;a[t]=e<=.03928?e/12.92:((e+.055)/1.055)**2.4}const o=a.join(","),l=`g_${this.#e}_hcm_filter`,c=this.#Zt=this.#ie(l);this.#re(o,o,o,c);this.#ae(c);const getSteps=(t,e)=>{const n=i[t]/255,r=s[t]/255,a=new Array(e+1);for(let t=0;t<=e;t++)a[t]=n+t/e*(r-n);return a.join(",")};this.#re(getSteps(0,5),getSteps(1,5),getSteps(2,5),c);this.#Qt=`url(#${l})`;return this.#Qt}addHighlightHCMFilter(t,e,n,i){const r=`${t}-${e}-${n}-${i}`;if(this.#te===r)return this.#ee;this.#te=r;this.#ee="none";this.#Zt?.remove();if(!t||!e)return this.#ee;const[s,a]=[t,e].map(this.#se.bind(this));let o=Math.round(.2126*s[0]+.7152*s[1]+.0722*s[2]),l=Math.round(.2126*a[0]+.7152*a[1]+.0722*a[2]),[c,h]=[n,i].map(this.#se.bind(this));l{const i=new Array(256),r=(l-o)/n,s=t/255,a=(e-t)/(255*n);let c=0;for(let t=0;t<=n;t++){const e=Math.round(o+t*r),n=s+t*a;for(let t=c;t<=e;t++)i[t]=n;c=e+1}for(let t=c;t<256;t++)i[t]=i[c-1];return i.join(",")},d=`g_${this.#e}_hcm_highlight_filter`,u=this.#Zt=this.#ie(d);this.#ae(u);this.#re(getSteps(c[0],h[0],5),getSteps(c[1],h[1],5),getSteps(c[2],h[2],5),u);this.#ee=`url(#${d})`;return this.#ee}destroy(){if(!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])||!this.#Qt&&!this.#ee){if(this.#Xt){this.#Xt.parentNode.parentNode.remove();this.#Xt=null}if(this.#$t){this.#$t.clear();this.#$t=null}this.#G=0}}#ae(t){const e=this.#Kt.createElementNS(s,"feColorMatrix");e.setAttribute("type","matrix");e.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0");t.append(e)}#ie(t){const e=this.#Kt.createElementNS(s,"filter");e.setAttribute("color-interpolation-filters","sRGB");e.setAttribute("id",t);this.#ne.append(e);return e}#oe(t,e,n){const i=this.#Kt.createElementNS(s,e);i.setAttribute("type","discrete");i.setAttribute("tableValues",n);t.append(i)}#re(t,e,n,i){const r=this.#Kt.createElementNS(s,"feComponentTransfer");i.append(r);this.#oe(r,"feFuncR",t);this.#oe(r,"feFuncG",e);this.#oe(r,"feFuncB",n)}#se(t){this.#ne.style.color=t;return getRGB(getComputedStyle(this.#ne).getPropertyValue("color"))}}e.DOMFilterFactory=DOMFilterFactory;class DOMCanvasFactory extends i.BaseCanvasFactory{constructor(){let{ownerDocument:t=globalThis.document}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super();this._document=t}_createCanvas(t,e){const n=this._document.createElement("canvas");n.width=t;n.height=e;return n}}e.DOMCanvasFactory=DOMCanvasFactory;async function fetchData(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(isValidFetchUrl(t,document.baseURI)){const n=await fetch(t);if(!n.ok)throw new Error(n.statusText);return e?new Uint8Array(await n.arrayBuffer()):(0,r.stringToBytes)(await n.text())}return new Promise(((n,i)=>{const s=new XMLHttpRequest;s.open("GET",t,!0);e&&(s.responseType="arraybuffer");s.onreadystatechange=()=>{if(s.readyState===XMLHttpRequest.DONE){if(200===s.status||0===s.status){let t;e&&s.response?t=new Uint8Array(s.response):!e&&s.responseText&&(t=(0,r.stringToBytes)(s.responseText));if(t){n(t);return}}i(new Error(s.statusText))}};s.send(null)}))}class DOMCMapReaderFactory extends i.BaseCMapReaderFactory{_fetchData(t,e){return fetchData(t,this.isCompressed).then((t=>({cMapData:t,compressionType:e})))}}e.DOMCMapReaderFactory=DOMCMapReaderFactory;class DOMStandardFontDataFactory extends i.BaseStandardFontDataFactory{_fetchData(t){return fetchData(t,!0)}}e.DOMStandardFontDataFactory=DOMStandardFontDataFactory;class DOMSVGFactory extends i.BaseSVGFactory{_createSVG(t){return document.createElementNS(s,t)}}e.DOMSVGFactory=DOMSVGFactory;class PageViewport{constructor(t){let{viewBox:e,scale:n,rotation:i,offsetX:r=0,offsetY:s=0,dontFlip:a=!1}=t;this.viewBox=e;this.scale=n;this.rotation=i;this.offsetX=r;this.offsetY=s;const o=(e[2]+e[0])/2,l=(e[3]+e[1])/2;let c,h,d,u,p,f,g,m;i%=360;i<0&&(i+=360);switch(i){case 180:c=-1;h=0;d=0;u=1;break;case 90:c=0;h=1;d=1;u=0;break;case 270:c=0;h=-1;d=-1;u=0;break;case 0:c=1;h=0;d=0;u=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}if(a){d=-d;u=-u}if(0===c){p=Math.abs(l-e[1])*n+r;f=Math.abs(o-e[0])*n+s;g=(e[3]-e[1])*n;m=(e[2]-e[0])*n}else{p=Math.abs(o-e[0])*n+r;f=Math.abs(l-e[1])*n+s;g=(e[2]-e[0])*n;m=(e[3]-e[1])*n}this.transform=[c*n,h*n,d*n,u*n,p-c*n*o-d*n*l,f-h*n*o-u*n*l];this.width=g;this.height=m}get rawDims(){const{viewBox:t}=this;return(0,r.shadow)(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone(){let{scale:t=this.scale,rotation:e=this.rotation,offsetX:n=this.offsetX,offsetY:i=this.offsetY,dontFlip:r=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new PageViewport({viewBox:this.viewBox.slice(),scale:t,rotation:e,offsetX:n,offsetY:i,dontFlip:r})}convertToViewportPoint(t,e){return r.Util.applyTransform([t,e],this.transform)}convertToViewportRectangle(t){const e=r.Util.applyTransform([t[0],t[1]],this.transform),n=r.Util.applyTransform([t[2],t[3]],this.transform);return[e[0],e[1],n[0],n[1]]}convertToPdfPoint(t,e){return r.Util.applyInverseTransform([t,e],this.transform)}}e.PageViewport=PageViewport;class RenderingCancelledException extends r.BaseException{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;super(t,"RenderingCancelledException");this.extraDelay=e}}e.RenderingCancelledException=RenderingCancelledException;function isDataScheme(t){const e=t.length;let n=0;for(;n=1&&i<=12?i-1:0;let r=parseInt(e[3],10);r=r>=1&&r<=31?r:1;let s=parseInt(e[4],10);s=s>=0&&s<=23?s:0;let o=parseInt(e[5],10);o=o>=0&&o<=59?o:0;let l=parseInt(e[6],10);l=l>=0&&l<=59?l:0;const c=e[7]||"Z";let h=parseInt(e[8],10);h=h>=0&&h<=23?h:0;let d=parseInt(e[9],10)||0;d=d>=0&&d<=59?d:0;if("-"===c){s+=h;o+=d}else if("+"===c){s-=h;o-=d}return new Date(Date.UTC(n,i,r,s,o,l))}};function getRGB(t){if(t.startsWith("#")){const e=parseInt(t.slice(1),16);return[(16711680&e)>>16,(65280&e)>>8,255&e]}if(t.startsWith("rgb("))return t.slice(4,-1).split(",").map((t=>parseInt(t)));if(t.startsWith("rgba("))return t.slice(5,-1).split(",").map((t=>parseInt(t))).slice(0,3);(0,r.warn)(`Not a valid color format: "${t}"`);return[0,0,0]}},(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0});e.BaseStandardFontDataFactory=e.BaseSVGFactory=e.BaseFilterFactory=e.BaseCanvasFactory=e.BaseCMapReaderFactory=void 0;n(2);var i=n(1);class BaseFilterFactory{constructor(){this.constructor===BaseFilterFactory&&(0,i.unreachable)("Cannot initialize BaseFilterFactory.")}addFilter(t){return"none"}addHCMFilter(t,e){return"none"}addHighlightHCMFilter(t,e,n,i){return"none"}destroy(){}}e.BaseFilterFactory=BaseFilterFactory;class BaseCanvasFactory{constructor(){this.constructor===BaseCanvasFactory&&(0,i.unreachable)("Cannot initialize BaseCanvasFactory.")}create(t,e){if(t<=0||e<=0)throw new Error("Invalid canvas size");const n=this._createCanvas(t,e);return{canvas:n,context:n.getContext("2d")}}reset(t,e,n){if(!t.canvas)throw new Error("Canvas is not specified");if(e<=0||n<=0)throw new Error("Invalid canvas size");t.canvas.width=e;t.canvas.height=n}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.BaseCanvasFactory=BaseCanvasFactory;class BaseCMapReaderFactory{constructor(t){let{baseUrl:e=null,isCompressed:n=!0}=t;this.constructor===BaseCMapReaderFactory&&(0,i.unreachable)("Cannot initialize BaseCMapReaderFactory.");this.baseUrl=e;this.isCompressed=n}async fetch(t){let{name:e}=t;if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!e)throw new Error("CMap name must be specified.");const n=this.baseUrl+e+(this.isCompressed?".bcmap":""),r=this.isCompressed?i.CMapCompressionType.BINARY:i.CMapCompressionType.NONE;return this._fetchData(n,r).catch((t=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${n}`)}))}_fetchData(t,e){(0,i.unreachable)("Abstract method `_fetchData` called.")}}e.BaseCMapReaderFactory=BaseCMapReaderFactory;class BaseStandardFontDataFactory{constructor(t){let{baseUrl:e=null}=t;this.constructor===BaseStandardFontDataFactory&&(0,i.unreachable)("Cannot initialize BaseStandardFontDataFactory.");this.baseUrl=e}async fetch(t){let{filename:e}=t;if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!e)throw new Error("Font filename must be specified.");const n=`${this.baseUrl}${e}`;return this._fetchData(n).catch((t=>{throw new Error(`Unable to load font data at: ${n}`)}))}_fetchData(t){(0,i.unreachable)("Abstract method `_fetchData` called.")}}e.BaseStandardFontDataFactory=BaseStandardFontDataFactory;class BaseSVGFactory{constructor(){this.constructor===BaseSVGFactory&&(0,i.unreachable)("Cannot initialize BaseSVGFactory.")}create(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t<=0||e<=0)throw new Error("Invalid SVG dimensions");const i=this._createSVG("svg:svg");i.setAttribute("version","1.1");if(!n){i.setAttribute("width",`${t}px`);i.setAttribute("height",`${e}px`)}i.setAttribute("preserveAspectRatio","none");i.setAttribute("viewBox",`0 0 ${t} ${e}`);return i}createElement(t){if("string"!=typeof t)throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){(0,i.unreachable)("Abstract method `_createSVG` called.")}}e.BaseSVGFactory=BaseSVGFactory},(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0});e.MurmurHash3_64=void 0;n(93);n(101);n(102);n(105);n(107);n(109);n(113);n(116);n(123);n(2);var i=n(1);const r=3285377520,s=4294901760,a=65535;e.MurmurHash3_64=class MurmurHash3_64{constructor(t){this.h1=t?4294967295&t:r;this.h2=t?4294967295&t:r}update(t){let e,n;if("string"==typeof t){e=new Uint8Array(2*t.length);n=0;for(let i=0,r=t.length;i>>8;e[n++]=255&r}}}else{if(!(0,i.isArrayBuffer)(t))throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");e=t.slice();n=e.byteLength}const r=n>>2,o=n-4*r,l=new Uint32Array(e.buffer,0,r);let c=0,h=0,d=this.h1,u=this.h2;const p=3432918353,f=461845907,g=11601,m=13715;for(let t=0;t>>17;c=c*f&s|c*m&a;d^=c;d=d<<13|d>>>19;d=5*d+3864292196}else{h=l[t];h=h*p&s|h*g&a;h=h<<15|h>>>17;h=h*f&s|h*m&a;u^=h;u=u<<13|u>>>19;u=5*u+3864292196}c=0;switch(o){case 3:c^=e[4*r+2]<<16;case 2:c^=e[4*r+1]<<8;case 1:c^=e[4*r];c=c*p&s|c*g&a;c=c<<15|c>>>17;c=c*f&s|c*m&a;1&r?d^=c:u^=c}this.h1=d;this.h2=u}hexdigest(){let t=this.h1,e=this.h2;t^=e>>>1;t=3981806797*t&s|36045*t&a;e=4283543511*e&s|(2950163797*(e<<16|t>>>16)&s)>>>16;t^=e>>>1;t=444984403*t&s|60499*t&a;e=3301882366*e&s|(3120437893*(e<<16|t>>>16)&s)>>>16;t^=e>>>1;return(t>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}}},(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0});e.FontLoader=e.FontFaceObject=void 0;n(125);n(136);n(138);n(141);n(143);n(145);n(147);n(89);n(149);var i=n(1);e.FontLoader=class FontLoader{#le=new Set;constructor(t){let{ownerDocument:e=globalThis.document,styleElement:n=null}=t;this._document=e;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){if(!this.styleElement){this.styleElement=this._document.createElement("style");this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement)}const e=this.styleElement.sheet;e.insertRule(t,e.cssRules.length)}clear(){for(const t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.clear();this.#le.clear();if(this.styleElement){this.styleElement.remove();this.styleElement=null}}async loadSystemFont(t){if(t&&!this.#le.has(t.loadedName)){(0,i.assert)(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set.");if(this.isFontLoadingAPISupported){const{loadedName:e,src:n,style:r}=t,s=new FontFace(e,n,r);this.addNativeFontFace(s);try{await s.load();this.#le.add(e)}catch{(0,i.warn)(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`);this.removeNativeFontFace(s)}}else(0,i.unreachable)("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(t){if(t.attached||t.missingFile&&!t.systemFontInfo)return;t.attached=!0;if(t.systemFontInfo){await this.loadSystemFont(t.systemFontInfo);return}if(this.isFontLoadingAPISupported){const e=t.createNativeFontFace();if(e){this.addNativeFontFace(e);try{await e.loaded}catch(n){(0,i.warn)(`Failed to load font '${e.family}': '${n}'.`);t.disableFontFace=!0;throw n}}return}const e=t.createFontFaceRule();if(e){this.insertRule(e);if(this.isSyncFontLoadingSupported)return;await new Promise((e=>{const n=this._queueLoadingCallback(e);this._prepareFontLoadEvent(t,n)}))}}get isFontLoadingAPISupported(){const t=!!this._document?.fonts;return(0,i.shadow)(this,"isFontLoadingAPISupported",t)}get isSyncFontLoadingSupported(){let t=!1;(i.isNodeJS||"undefined"!=typeof navigator&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(t=!0);return(0,i.shadow)(this,"isSyncFontLoadingSupported",t)}_queueLoadingCallback(t){const{loadingRequests:e}=this,n={done:!1,complete:function completeRequest(){(0,i.assert)(!n.done,"completeRequest() cannot be called twice.");n.done=!0;for(;e.length>0&&e[0].done;){const t=e.shift();setTimeout(t.callback,0)}},callback:t};e.push(n);return n}get _loadTestFont(){const t=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,i.shadow)(this,"_loadTestFont",t)}_prepareFontLoadEvent(t,e){function int32(t,e){return t.charCodeAt(e)<<24|t.charCodeAt(e+1)<<16|t.charCodeAt(e+2)<<8|255&t.charCodeAt(e+3)}function spliceString(t,e,n,i){return t.substring(0,e)+i+t.substring(e+n)}let n,r;const s=this._document.createElement("canvas");s.width=1;s.height=1;const a=s.getContext("2d");let o=0;const l=`lt${Date.now()}${this.loadTestFontId++}`;let c=this._loadTestFont;c=spliceString(c,976,l.length,l);const h=1482184792;let d=int32(c,16);for(n=0,r=l.length-3;n30){(0,i.warn)("Load test font never loaded.");e();return}a.font="30px "+t;a.fillText(".",0,20);a.getImageData(0,0,1,1).data[3]>0?e():setTimeout(isFontReady.bind(null,t,e))}(l,(()=>{p.remove();e.complete()}))}};e.FontFaceObject=class FontFaceObject{constructor(t,e){let{isEvalSupported:n=!0,disableFontFace:i=!1,ignoreErrors:r=!1,inspectFont:s=null}=e;this.compiledGlyphs=Object.create(null);for(const e in t)this[e]=t[e];this.isEvalSupported=!1!==n;this.disableFontFace=!0===i;this.ignoreErrors=!0===r;this._inspectFont=s}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let t;if(this.cssFontInfo){const e={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(e.style=`oblique ${this.cssFontInfo.italicAngle}deg`);t=new FontFace(this.cssFontInfo.fontFamily,this.data,e)}else t=new FontFace(this.loadedName,this.data,{});this._inspectFont?.(this);return t}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const t=(0,i.bytesToString)(this.data),e=`url(data:${this.mimetype};base64,${btoa(t)});`;let n;if(this.cssFontInfo){let t=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(t+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`);n=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${t}src:${e}}`}else n=`@font-face {font-family:"${this.loadedName}";src:${e}}`;this._inspectFont?.(this,e);return n}getPathGenerator(t,e){if(void 0!==this.compiledGlyphs[e])return this.compiledGlyphs[e];let n;try{n=t.get(this.loadedName+"_path_"+e)}catch(t){if(!this.ignoreErrors)throw t;(0,i.warn)(`getPathGenerator - ignoring character: "${t}".`);return this.compiledGlyphs[e]=function(t,e){}}if(this.isEvalSupported&&i.FeatureTest.isEvalSupported){const t=[];for(const e of n){const n=void 0!==e.args?e.args.join(","):"";t.push("c.",e.cmd,"(",n,");\n")}return this.compiledGlyphs[e]=new Function("c","size",t.join(""))}return this.compiledGlyphs[e]=function(t,e){for(const i of n){"scale"===i.cmd&&(i.args=[e,-e]);t[i.cmd].apply(t,i.args)}}}}},(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0});e.NodeStandardFontDataFactory=e.NodeFilterFactory=e.NodeCanvasFactory=e.NodeCMapReaderFactory=void 0;n(2);n(93);n(101);n(102);n(105);n(107);n(109);n(113);n(116);n(123);var i=n(169),r=n(1);!function checkDOMMatrix(){if(!globalThis.DOMMatrix&&r.isNodeJS)try{globalThis.DOMMatrix=require("canvas").DOMMatrix}catch(t){(0,r.warn)(`Cannot polyfill \`DOMMatrix\`, rendering may be broken: "${t}".`)}}();!function checkPath2D(){if(!globalThis.Path2D&&r.isNodeJS)try{const{CanvasRenderingContext2D:t}=require("canvas"),{polyfillPath2D:e}=require("path2d-polyfill");globalThis.CanvasRenderingContext2D=t;e(globalThis)}catch(t){(0,r.warn)(`Cannot polyfill \`Path2D\`, rendering may be broken: "${t}".`)}}();const fetchData=function(t){return new Promise(((e,n)=>{require("fs").readFile(t,((t,i)=>{!t&&i?e(new Uint8Array(i)):n(new Error(t))}))}))};class NodeFilterFactory extends i.BaseFilterFactory{}e.NodeFilterFactory=NodeFilterFactory;class NodeCanvasFactory extends i.BaseCanvasFactory{_createCanvas(t,e){return require("canvas").createCanvas(t,e)}}e.NodeCanvasFactory=NodeCanvasFactory;class NodeCMapReaderFactory extends i.BaseCMapReaderFactory{_fetchData(t,e){return fetchData(t).then((t=>({cMapData:t,compressionType:e})))}}e.NodeCMapReaderFactory=NodeCMapReaderFactory;class NodeStandardFontDataFactory extends i.BaseStandardFontDataFactory{_fetchData(t){return fetchData(t)}}e.NodeStandardFontDataFactory=NodeStandardFontDataFactory},(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0});e.CanvasGraphics=void 0;n(2);n(93);n(101);n(102);n(105);n(107);n(109);n(113);n(116);n(123);n(89);var i=n(1),r=n(168),s=n(174),a=n(175);const o=4096,l=16;class CachedCanvases{constructor(t){this.canvasFactory=t;this.cache=Object.create(null)}getCanvas(t,e,n){let i;if(void 0!==this.cache[t]){i=this.cache[t];this.canvasFactory.reset(i,e,n)}else{i=this.canvasFactory.create(e,n);this.cache[t]=i}return i}delete(t){delete this.cache[t]}clear(){for(const t in this.cache){const e=this.cache[t];this.canvasFactory.destroy(e);delete this.cache[t]}}}function drawImageAtIntegerCoords(t,e,n,i,s,a,o,l,c,h){const[d,u,p,f,g,m]=(0,r.getCurrentTransform)(t);if(0===u&&0===p){const r=o*d+g,b=Math.round(r),v=l*f+m,y=Math.round(v),_=(o+c)*d+g,A=Math.abs(Math.round(_)-b)||1,S=(l+h)*f+m,E=Math.abs(Math.round(S)-y)||1;t.setTransform(Math.sign(d),0,0,Math.sign(f),b,y);t.drawImage(e,n,i,s,a,0,0,A,E);t.setTransform(d,u,p,f,g,m);return[A,E]}if(0===d&&0===f){const r=l*p+g,b=Math.round(r),v=o*u+m,y=Math.round(v),_=(l+h)*p+g,A=Math.abs(Math.round(_)-b)||1,S=(o+c)*u+m,E=Math.abs(Math.round(S)-y)||1;t.setTransform(0,Math.sign(u),Math.sign(p),0,b,y);t.drawImage(e,n,i,s,a,0,0,E,A);t.setTransform(d,u,p,f,g,m);return[E,A]}t.drawImage(e,n,i,s,a,o,l,c,h);return[Math.hypot(d,u)*c,Math.hypot(p,f)*h]}class CanvasExtraState{constructor(t,e){this.alphaIsShape=!1;this.fontSize=0;this.fontSizeScale=1;this.textMatrix=i.IDENTITY_MATRIX;this.textMatrixScale=1;this.fontMatrix=i.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=i.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(){const t=Object.create(this);t.clipBox=this.clipBox.slice();return t}setCurrentPoint(t,e){this.x=t;this.y=e}updatePathMinMax(t,e,n){[e,n]=i.Util.applyTransform([e,n],t);this.minX=Math.min(this.minX,e);this.minY=Math.min(this.minY,n);this.maxX=Math.max(this.maxX,e);this.maxY=Math.max(this.maxY,n)}updateRectMinMax(t,e){const n=i.Util.applyTransform(e,t),r=i.Util.applyTransform(e.slice(2),t);this.minX=Math.min(this.minX,n[0],r[0]);this.minY=Math.min(this.minY,n[1],r[1]);this.maxX=Math.max(this.maxX,n[0],r[0]);this.maxY=Math.max(this.maxY,n[1],r[1])}updateScalingPathMinMax(t,e){i.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,n,r,s,a,o,l,c,h){const d=i.Util.bezierBoundingBox(e,n,r,s,a,o,l,c);if(h){h[0]=Math.min(h[0],d[0],d[2]);h[1]=Math.max(h[1],d[0],d[2]);h[2]=Math.min(h[2],d[1],d[3]);h[3]=Math.max(h[3],d[1],d[3])}else this.updateRectMinMax(t,d)}getPathBoundingBox(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s.PathType.FILL,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=[this.minX,this.minY,this.maxX,this.maxY];if(t===s.PathType.STROKE){e||(0,i.unreachable)("Stroke bounding box must include transform.");const t=i.Util.singularValueDecompose2dScale(e),r=t[0]*this.lineWidth/2,s=t[1]*this.lineWidth/2;n[0]-=r;n[1]-=s;n[2]+=r;n[3]+=s}return n}updateClipFromPath(){const t=i.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(t){this.clipBox=t;this.minX=1/0;this.minY=1/0;this.maxX=0;this.maxY=0}getClippedPathBoundingBox(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s.PathType.FILL,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return i.Util.intersect(this.clipBox,this.getPathBoundingBox(t,e))}}function putBinaryImageData(t,e){if("undefined"!=typeof ImageData&&e instanceof ImageData){t.putImageData(e,0,0);return}const n=e.height,r=e.width,s=n%l,a=(n-s)/l,o=0===s?a:a+1,c=t.createImageData(r,l);let h,d=0;const u=e.data,p=c.data;let f,g,m,b;if(e.kind===i.ImageKind.GRAYSCALE_1BPP){const e=u.byteLength,n=new Uint32Array(p.buffer,0,p.byteLength>>2),b=n.length,v=r+7>>3,y=4294967295,_=i.FeatureTest.isLittleEndian?4278190080:255;for(f=0;fv?r:8*t-7,a=-8&s;let o=0,l=0;for(;i>=1}}for(;h=a){m=s;b=r*m}h=0;for(g=b;g--;){p[h++]=u[d++];p[h++]=u[d++];p[h++]=u[d++];p[h++]=255}t.putImageData(c,0,f*l)}}}function putBinaryImageMask(t,e){if(e.bitmap){t.drawImage(e.bitmap,0,0);return}const n=e.height,i=e.width,r=n%l,s=(n-r)/l,o=0===r?s:s+1,c=t.createImageData(i,l);let h=0;const d=e.data,u=c.data;for(let e=0;e>8;t[s-2]=t[s-2]*r+n*a>>8;t[s-1]=t[s-1]*r+i*a>>8}}}function composeSMaskAlpha(t,e,n){const i=t.length;for(let r=3;r>8]>>8:e[r]*i>>16}}function composeSMask(t,e,n,i){const r=i[0],s=i[1],a=i[2]-r,o=i[3]-s;if(0!==a&&0!==o){!function genericComposeSMask(t,e,n,i,r,s,a,o,l,c,h){const d=!!s,u=d?s[0]:0,p=d?s[1]:0,f=d?s[2]:0,g="Luminosity"===r?composeSMaskLuminosity:composeSMaskAlpha,m=Math.min(i,Math.ceil(1048576/n));for(let r=0;r1&&void 0!==arguments[1]?arguments[1]:null;return"string"==typeof t?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):e}beginDrawing(t){let{transform:e,viewport:n,transparency:i=!1,background:s=null}=t;const a=this.ctx.canvas.width,o=this.ctx.canvas.height,l=this.ctx.fillStyle;this.ctx.fillStyle=s||"#ffffff";this.ctx.fillRect(0,0,a,o);this.ctx.fillStyle=l;if(i){const t=this.cachedCanvases.getCanvas("transparent",a,o);this.compositeCtx=this.ctx;this.transparentCanvas=t.canvas;this.ctx=t.context;this.ctx.save();this.ctx.transform(...(0,r.getCurrentTransform)(this.compositeCtx))}this.ctx.save();resetCtxToDefault(this.ctx);if(e){this.ctx.transform(...e);this.outputScaleX=e[0];this.outputScaleY=e[0]}this.ctx.transform(...n.transform);this.viewportScale=n.scale;this.baseTransform=(0,r.getCurrentTransform)(this.ctx)}executeOperatorList(t,e,n,r){const s=t.argsArray,a=t.fnArray;let o=e||0;const l=s.length;if(l===o)return o;const c=l-o>10&&"function"==typeof n,h=c?Date.now()+15:0;let d=0;const u=this.commonObjs,p=this.objs;let f;for(;;){if(void 0!==r&&o===r.nextBreakPoint){r.breakIt(o,n);return o}f=a[o];if(f!==i.OPS.dependency)this[f].apply(this,s[o]);else for(const t of s[o]){const e=t.startsWith("g_")?u:p;if(!e.has(t)){e.get(t,n);return o}}o++;if(o===l)return o;if(c&&++d>10){if(Date.now()>h){n();return o}d=0}}}#ce(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore();if(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(const t of this._cachedBitmapsMap.values()){for(const e of t.values())"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement&&(e.width=e.height=0);t.clear()}this._cachedBitmapsMap.clear();this.#he()}#he(){if(this.pageColors){const t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if("none"!==t){const e=this.ctx.filter;this.ctx.filter=t;this.ctx.drawImage(this.ctx.canvas,0,0);this.ctx.filter=e}}}_scaleImage(t,e){const n=t.width,i=t.height;let r,s,a=Math.max(Math.hypot(e[0],e[1]),1),o=Math.max(Math.hypot(e[2],e[3]),1),l=n,c=i,h="prescale1";for(;a>2&&l>1||o>2&&c>1;){let e=l,n=c;if(a>2&&l>1){e=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l/2);a/=l/e}if(o>2&&c>1){n=c>=16384?Math.floor(c/2)-1||1:Math.ceil(c)/2;o/=c/n}r=this.cachedCanvases.getCanvas(h,e,n);s=r.context;s.clearRect(0,0,e,n);s.drawImage(t,0,0,l,c,0,0,e,n);t=r.canvas;l=e;c=n;h="prescale1"===h?"prescale2":"prescale1"}return{img:t,paintWidth:l,paintHeight:c}}_createMaskCanvas(t){const e=this.ctx,{width:n,height:a}=t,o=this.current.fillColor,l=this.current.patternFill,c=(0,r.getCurrentTransform)(e);let h,d,u,p;if((t.bitmap||t.data)&&t.count>1){const e=t.bitmap||t.data.buffer;d=JSON.stringify(l?c:[c.slice(0,4),o]);h=this._cachedBitmapsMap.get(e);if(!h){h=new Map;this._cachedBitmapsMap.set(e,h)}const n=h.get(d);if(n&&!l){return{canvas:n,offsetX:Math.round(Math.min(c[0],c[2])+c[4]),offsetY:Math.round(Math.min(c[1],c[3])+c[5])}}u=n}if(!u){p=this.cachedCanvases.getCanvas("maskCanvas",n,a);putBinaryImageMask(p.context,t)}let f=i.Util.transform(c,[1/n,0,0,-1/a,0,0]);f=i.Util.transform(f,[1,0,0,1,0,-a]);const g=i.Util.applyTransform([0,0],f),m=i.Util.applyTransform([n,a],f),b=i.Util.normalizeRect([g[0],g[1],m[0],m[1]]),v=Math.round(b[2]-b[0])||1,y=Math.round(b[3]-b[1])||1,_=this.cachedCanvases.getCanvas("fillCanvas",v,y),A=_.context,S=Math.min(g[0],m[0]),E=Math.min(g[1],m[1]);A.translate(-S,-E);A.transform(...f);if(!u){u=this._scaleImage(p.canvas,(0,r.getCurrentTransformInverse)(A));u=u.img;h&&l&&h.set(d,u)}A.imageSmoothingEnabled=getImageSmoothingEnabled((0,r.getCurrentTransform)(A),t.interpolate);drawImageAtIntegerCoords(A,u,0,0,u.width,u.height,0,0,n,a);A.globalCompositeOperation="source-in";const x=i.Util.transform((0,r.getCurrentTransformInverse)(A),[1,0,0,1,-S,-E]);A.fillStyle=l?o.getPattern(e,this,x,s.PathType.FILL):o;A.fillRect(0,0,n,a);if(h&&!l){this.cachedCanvases.delete("fillCanvas");h.set(d,_.canvas)}return{canvas:_.canvas,offsetX:Math.round(S),offsetY:Math.round(E)}}setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1);this.current.lineWidth=t;this.ctx.lineWidth=t}setLineCap(t){this.ctx.lineCap=c[t]}setLineJoin(t){this.ctx.lineJoin=h[t]}setMiterLimit(t){this.ctx.miterLimit=t}setDash(t,e){const n=this.ctx;if(void 0!==n.setLineDash){n.setLineDash(t);n.lineDashOffset=e}}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(const[e,n]of t)switch(e){case"LW":this.setLineWidth(n);break;case"LC":this.setLineCap(n);break;case"LJ":this.setLineJoin(n);break;case"ML":this.setMiterLimit(n);break;case"D":this.setDash(n[0],n[1]);break;case"RI":this.setRenderingIntent(n);break;case"FL":this.setFlatness(n);break;case"Font":this.setFont(n[0],n[1]);break;case"CA":this.current.strokeAlpha=n;break;case"ca":this.current.fillAlpha=n;this.ctx.globalAlpha=n;break;case"BM":this.ctx.globalCompositeOperation=n;break;case"SMask":this.current.activeSMask=n?this.tempSMask:null;this.tempSMask=null;this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(n)}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const t=this.ctx.canvas.width,e=this.ctx.canvas.height,n="smaskGroupAt"+this.groupLevel,i=this.cachedCanvases.getCanvas(n,t,e);this.suspendedCtx=this.ctx;this.ctx=i.context;const s=this.ctx;s.setTransform(...(0,r.getCurrentTransform)(this.suspendedCtx));copyCtxState(this.suspendedCtx,s);!function mirrorContextOperations(t,e){if(t._removeMirroring)throw new Error("Context is already forwarding operations.");t.__originalSave=t.save;t.__originalRestore=t.restore;t.__originalRotate=t.rotate;t.__originalScale=t.scale;t.__originalTranslate=t.translate;t.__originalTransform=t.transform;t.__originalSetTransform=t.setTransform;t.__originalResetTransform=t.resetTransform;t.__originalClip=t.clip;t.__originalMoveTo=t.moveTo;t.__originalLineTo=t.lineTo;t.__originalBezierCurveTo=t.bezierCurveTo;t.__originalRect=t.rect;t.__originalClosePath=t.closePath;t.__originalBeginPath=t.beginPath;t._removeMirroring=()=>{t.save=t.__originalSave;t.restore=t.__originalRestore;t.rotate=t.__originalRotate;t.scale=t.__originalScale;t.translate=t.__originalTranslate;t.transform=t.__originalTransform;t.setTransform=t.__originalSetTransform;t.resetTransform=t.__originalResetTransform;t.clip=t.__originalClip;t.moveTo=t.__originalMoveTo;t.lineTo=t.__originalLineTo;t.bezierCurveTo=t.__originalBezierCurveTo;t.rect=t.__originalRect;t.closePath=t.__originalClosePath;t.beginPath=t.__originalBeginPath;delete t._removeMirroring};t.save=function ctxSave(){e.save();this.__originalSave()};t.restore=function ctxRestore(){e.restore();this.__originalRestore()};t.translate=function ctxTranslate(t,n){e.translate(t,n);this.__originalTranslate(t,n)};t.scale=function ctxScale(t,n){e.scale(t,n);this.__originalScale(t,n)};t.transform=function ctxTransform(t,n,i,r,s,a){e.transform(t,n,i,r,s,a);this.__originalTransform(t,n,i,r,s,a)};t.setTransform=function ctxSetTransform(t,n,i,r,s,a){e.setTransform(t,n,i,r,s,a);this.__originalSetTransform(t,n,i,r,s,a)};t.resetTransform=function ctxResetTransform(){e.resetTransform();this.__originalResetTransform()};t.rotate=function ctxRotate(t){e.rotate(t);this.__originalRotate(t)};t.clip=function ctxRotate(t){e.clip(t);this.__originalClip(t)};t.moveTo=function(t,n){e.moveTo(t,n);this.__originalMoveTo(t,n)};t.lineTo=function(t,n){e.lineTo(t,n);this.__originalLineTo(t,n)};t.bezierCurveTo=function(t,n,i,r,s,a){e.bezierCurveTo(t,n,i,r,s,a);this.__originalBezierCurveTo(t,n,i,r,s,a)};t.rect=function(t,n,i,r){e.rect(t,n,i,r);this.__originalRect(t,n,i,r)};t.closePath=function(){e.closePath();this.__originalClosePath()};t.beginPath=function(){e.beginPath();this.__originalBeginPath()}}(s,this.suspendedCtx);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();copyCtxState(this.ctx,this.suspendedCtx);this.ctx=this.suspendedCtx;this.suspendedCtx=null}compose(t){if(!this.current.activeSMask)return;if(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])}else t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const e=this.current.activeSMask;composeSMask(this.suspendedCtx,e,this.ctx,t);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(){if(this.inSMaskMode){copyCtxState(this.ctx,this.suspendedCtx);this.suspendedCtx.save()}else this.ctx.save();const t=this.current;this.stateStack.push(t);this.current=t.clone()}restore(){0===this.stateStack.length&&this.inSMaskMode&&this.endSMaskMode();if(0!==this.stateStack.length){this.current=this.stateStack.pop();if(this.inSMaskMode){this.suspendedCtx.restore();copyCtxState(this.suspendedCtx,this.ctx)}else this.ctx.restore();this.checkSMaskState();this.pendingClip=null;this._cachedScaleForStroking[0]=-1;this._cachedGetSinglePixelWidth=null}}transform(t,e,n,i,r,s){this.ctx.transform(t,e,n,i,r,s);this._cachedScaleForStroking[0]=-1;this._cachedGetSinglePixelWidth=null}constructPath(t,e,n){const s=this.ctx,a=this.current;let o,l,c=a.x,h=a.y;const d=(0,r.getCurrentTransform)(s),u=0===d[0]&&0===d[3]||0===d[1]&&0===d[2],p=u?n.slice(0):null;for(let n=0,r=0,f=t.length;n0&&void 0!==arguments[0])||arguments[0];const e=this.ctx,n=this.current.strokeColor;e.globalAlpha=this.current.strokeAlpha;if(this.contentVisible)if("object"==typeof n&&n?.getPattern){e.save();e.strokeStyle=n.getPattern(e,this,(0,r.getCurrentTransformInverse)(e),s.PathType.STROKE);this.rescaleAndStroke(!1);e.restore()}else this.rescaleAndStroke(!0);t&&this.consumePath(this.current.getClippedPathBoundingBox());e.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath();this.stroke()}fill(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const e=this.ctx,n=this.current.fillColor;let i=!1;if(this.current.patternFill){e.save();e.fillStyle=n.getPattern(e,this,(0,r.getCurrentTransformInverse)(e),s.PathType.FILL);i=!0}const a=this.current.getClippedPathBoundingBox();if(this.contentVisible&&null!==a)if(this.pendingEOFill){e.fill("evenodd");this.pendingEOFill=!1}else e.fill();i&&e.restore();t&&this.consumePath(a)}eoFill(){this.pendingEOFill=!0;this.fill()}fillStroke(){this.fill(!1);this.stroke(!1);this.consumePath()}eoFillStroke(){this.pendingEOFill=!0;this.fillStroke()}closeFillStroke(){this.closePath();this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0;this.closePath();this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=d}eoClip(){this.pendingClip=u}beginText(){this.current.textMatrix=i.IDENTITY_MATRIX;this.current.textMatrixScale=1;this.current.x=this.current.lineX=0;this.current.y=this.current.lineY=0}endText(){const t=this.pendingTextPaths,e=this.ctx;if(void 0!==t){e.save();e.beginPath();for(const n of t){e.setTransform(...n.transform);e.translate(n.x,n.y);n.addToPath(e,n.fontSize)}e.restore();e.clip();e.beginPath();delete this.pendingTextPaths}else e.beginPath()}setCharSpacing(t){this.current.charSpacing=t}setWordSpacing(t){this.current.wordSpacing=t}setHScale(t){this.current.textHScale=t/100}setLeading(t){this.current.leading=-t}setFont(t,e){const n=this.commonObjs.get(t),r=this.current;if(!n)throw new Error(`Can't find font for ${t}`);r.fontMatrix=n.fontMatrix||i.FONT_IDENTITY_MATRIX;0!==r.fontMatrix[0]&&0!==r.fontMatrix[3]||(0,i.warn)("Invalid font matrix for font "+t);if(e<0){e=-e;r.fontDirection=-1}else r.fontDirection=1;this.current.font=n;this.current.fontSize=e;if(n.isType3Font)return;const s=n.loadedName||"sans-serif",a=n.systemFontInfo?.css||`"${s}", ${n.fallbackName}`;let o="normal";n.black?o="900":n.bold&&(o="bold");const l=n.italic?"italic":"normal";let c=e;e<16?c=16:e>100&&(c=100);this.current.fontSizeScale=e/c;this.ctx.font=`${l} ${o} ${c}px ${a}`}setTextRenderingMode(t){this.current.textRenderingMode=t}setTextRise(t){this.current.textRise=t}moveText(t,e){this.current.x=this.current.lineX+=t;this.current.y=this.current.lineY+=e}setLeadingMoveText(t,e){this.setLeading(-e);this.moveText(t,e)}setTextMatrix(t,e,n,i,r,s){this.current.textMatrix=[t,e,n,i,r,s];this.current.textMatrixScale=Math.hypot(t,e);this.current.x=this.current.lineX=0;this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(t,e,n,s){const a=this.ctx,o=this.current,l=o.font,c=o.textRenderingMode,h=o.fontSize/o.fontSizeScale,d=c&i.TextRenderingMode.FILL_STROKE_MASK,u=!!(c&i.TextRenderingMode.ADD_TO_PATH_FLAG),p=o.patternFill&&!l.missingFile;let f;(l.disableFontFace||u||p)&&(f=l.getPathGenerator(this.commonObjs,t));if(l.disableFontFace||p){a.save();a.translate(e,n);a.beginPath();f(a,h);s&&a.setTransform(...s);d!==i.TextRenderingMode.FILL&&d!==i.TextRenderingMode.FILL_STROKE||a.fill();d!==i.TextRenderingMode.STROKE&&d!==i.TextRenderingMode.FILL_STROKE||a.stroke();a.restore()}else{d!==i.TextRenderingMode.FILL&&d!==i.TextRenderingMode.FILL_STROKE||a.fillText(t,e,n);d!==i.TextRenderingMode.STROKE&&d!==i.TextRenderingMode.FILL_STROKE||a.strokeText(t,e,n)}if(u){(this.pendingTextPaths||=[]).push({transform:(0,r.getCurrentTransform)(a),x:e,y:n,fontSize:h,addToPath:f})}}get isFontSubpixelAAEnabled(){const{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);t.scale(1.5,1);t.fillText("I",0,10);const e=t.getImageData(0,0,10,10).data;let n=!1;for(let t=3;t0&&e[t]<255){n=!0;break}return(0,i.shadow)(this,"isFontSubpixelAAEnabled",n)}showText(t){const e=this.current,n=e.font;if(n.isType3Font)return this.showType3Text(t);const a=e.fontSize;if(0===a)return;const o=this.ctx,l=e.fontSizeScale,c=e.charSpacing,h=e.wordSpacing,d=e.fontDirection,u=e.textHScale*d,p=t.length,f=n.vertical,g=f?1:-1,m=n.defaultVMetrics,b=a*e.fontMatrix[0],v=e.textRenderingMode===i.TextRenderingMode.FILL&&!n.disableFontFace&&!e.patternFill;o.save();o.transform(...e.textMatrix);o.translate(e.x,e.y+e.textRise);d>0?o.scale(u,-1):o.scale(u,1);let y;if(e.patternFill){o.save();const t=e.fillColor.getPattern(o,this,(0,r.getCurrentTransformInverse)(o),s.PathType.FILL);y=(0,r.getCurrentTransform)(o);o.restore();o.fillStyle=t}let _=e.lineWidth;const A=e.textMatrixScale;if(0===A||0===_){const t=e.textRenderingMode&i.TextRenderingMode.FILL_STROKE_MASK;t!==i.TextRenderingMode.STROKE&&t!==i.TextRenderingMode.FILL_STROKE||(_=this.getSinglePixelWidth())}else _/=A;if(1!==l){o.scale(l,l);_/=l}o.lineWidth=_;if(n.isInvalidPDFjsFont){const n=[];let i=0;for(const e of t){n.push(e.unicode);i+=e.width}o.fillText(n.join(""),0,0);e.x+=i*b*u;o.restore();this.compose();return}let S,E=0;for(S=0;S0){const t=1e3*o.measureText(s).width/a*l;if(Anew CanvasGraphics(t,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};e=new s.TilingPattern(t,n,this.ctx,a,i)}else e=this._getPattern(t[1],t[2]);return e}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments);this.current.patternFill=!0}setStrokeRGBColor(t,e,n){const r=i.Util.makeHexColor(t,e,n);this.ctx.strokeStyle=r;this.current.strokeColor=r}setFillRGBColor(t,e,n){const r=i.Util.makeHexColor(t,e,n);this.ctx.fillStyle=r;this.current.fillColor=r;this.current.patternFill=!1}_getPattern(t){let e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.cachedPatterns.has(t))e=this.cachedPatterns.get(t);else{e=(0,s.getShadingPattern)(this.getObject(t));this.cachedPatterns.set(t,e)}n&&(e.matrix=n);return e}shadingFill(t){if(!this.contentVisible)return;const e=this.ctx;this.save();const n=this._getPattern(t);e.fillStyle=n.getPattern(e,this,(0,r.getCurrentTransformInverse)(e),s.PathType.SHADING);const a=(0,r.getCurrentTransformInverse)(e);if(a){const{width:t,height:n}=e.canvas,[r,s,o,l]=i.Util.getAxialAlignedBoundingBox([0,0,t,n],a);this.ctx.fillRect(r,s,o-r,l-s)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox());this.restore()}beginInlineImage(){(0,i.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,i.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(t,e){if(this.contentVisible){this.save();this.baseTransformStack.push(this.baseTransform);Array.isArray(t)&&6===t.length&&this.transform(...t);this.baseTransform=(0,r.getCurrentTransform)(this.ctx);if(e){const t=e[2]-e[0],n=e[3]-e[1];this.ctx.rect(e[0],e[1],t,n);this.current.updateRectMinMax((0,r.getCurrentTransform)(this.ctx),e);this.clip();this.endPath()}}}paintFormXObjectEnd(){if(this.contentVisible){this.restore();this.baseTransform=this.baseTransformStack.pop()}}beginGroup(t){if(!this.contentVisible)return;this.save();if(this.inSMaskMode){this.endSMaskMode();this.current.activeSMask=null}const e=this.ctx;t.isolated||(0,i.info)("TODO: Support non-isolated groups.");t.knockout&&(0,i.warn)("Knockout groups not supported.");const n=(0,r.getCurrentTransform)(e);t.matrix&&e.transform(...t.matrix);if(!t.bbox)throw new Error("Bounding box is required.");let s=i.Util.getAxialAlignedBoundingBox(t.bbox,(0,r.getCurrentTransform)(e));const a=[0,0,e.canvas.width,e.canvas.height];s=i.Util.intersect(s,a)||[0,0,0,0];const l=Math.floor(s[0]),c=Math.floor(s[1]);let h=Math.max(Math.ceil(s[2])-l,1),d=Math.max(Math.ceil(s[3])-c,1),u=1,p=1;if(h>o){u=h/o;h=o}if(d>o){p=d/o;d=o}this.current.startNewPathAndClipBox([0,0,h,d]);let f="groupAt"+this.groupLevel;t.smask&&(f+="_smask_"+this.smaskCounter++%2);const g=this.cachedCanvases.getCanvas(f,h,d),m=g.context;m.scale(1/u,1/p);m.translate(-l,-c);m.transform(...n);if(t.smask)this.smaskStack.push({canvas:g.canvas,context:m,offsetX:l,offsetY:c,scaleX:u,scaleY:p,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null});else{e.setTransform(1,0,0,1,0,0);e.translate(l,c);e.scale(u,p);e.save()}copyCtxState(e,m);this.ctx=m;this.setGState([["BM","source-over"],["ca",1],["CA",1]]);this.groupStack.push(e);this.groupLevel++}endGroup(t){if(!this.contentVisible)return;this.groupLevel--;const e=this.ctx,n=this.groupStack.pop();this.ctx=n;this.ctx.imageSmoothingEnabled=!1;if(t.smask){this.tempSMask=this.smaskStack.pop();this.restore()}else{this.ctx.restore();const t=(0,r.getCurrentTransform)(this.ctx);this.restore();this.ctx.save();this.ctx.setTransform(...t);const n=i.Util.getAxialAlignedBoundingBox([0,0,e.canvas.width,e.canvas.height],t);this.ctx.drawImage(e.canvas,0,0);this.ctx.restore();this.compose(n)}}beginAnnotation(t,e,n,s,a){this.#ce();resetCtxToDefault(this.ctx);this.ctx.save();this.save();this.baseTransform&&this.ctx.setTransform(...this.baseTransform);if(Array.isArray(e)&&4===e.length){const s=e[2]-e[0],o=e[3]-e[1];if(a&&this.annotationCanvasMap){(n=n.slice())[4]-=e[0];n[5]-=e[1];(e=e.slice())[0]=e[1]=0;e[2]=s;e[3]=o;const[a,l]=i.Util.singularValueDecompose2dScale((0,r.getCurrentTransform)(this.ctx)),{viewportScale:c}=this,h=Math.ceil(s*this.outputScaleX*c),d=Math.ceil(o*this.outputScaleY*c);this.annotationCanvas=this.canvasFactory.create(h,d);const{canvas:u,context:p}=this.annotationCanvas;this.annotationCanvasMap.set(t,u);this.annotationCanvas.savedCtx=this.ctx;this.ctx=p;this.ctx.save();this.ctx.setTransform(a,0,0,-l,0,o*l);resetCtxToDefault(this.ctx)}else{resetCtxToDefault(this.ctx);this.ctx.rect(e[0],e[1],s,o);this.ctx.clip();this.endPath()}}this.current=new CanvasExtraState(this.ctx.canvas.width,this.ctx.canvas.height);this.transform(...n);this.transform(...s)}endAnnotation(){if(this.annotationCanvas){this.ctx.restore();this.#he();this.ctx=this.annotationCanvas.savedCtx;delete this.annotationCanvas.savedCtx;delete this.annotationCanvas}}paintImageMaskXObject(t){if(!this.contentVisible)return;const e=t.count;(t=this.getObject(t.data,t)).count=e;const n=this.ctx,i=this.processingType3;if(i){void 0===i.compiled&&(i.compiled=function compileType3Glyph(t){const{width:e,height:n}=t;if(e>1e3||n>1e3)return null;const i=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),r=e+1;let s,a,o,l=new Uint8Array(r*(n+1));const c=e+7&-8;let h=new Uint8Array(c*n),d=0;for(const e of t.data){let t=128;for(;t>0;){h[d++]=e&t?0:255;t>>=1}}let u=0;d=0;if(0!==h[d]){l[0]=1;++u}for(a=1;a>2)+(h[d+1]?4:0)+(h[d-c+1]?8:0);if(i[t]){l[o+a]=i[t];++u}d++}if(h[d-c]!==h[d]){l[o+a]=h[d]?2:4;++u}if(u>1e3)return null}d=c*(n-1);o=s*r;if(0!==h[d]){l[o]=8;++u}for(a=1;a1e3)return null;const p=new Int32Array([0,r,-1,0,-r,0,0,0,1]),f=new Path2D;for(s=0;u&&s<=n;s++){let t=s*r;const n=t+e;for(;t>4;l[t]&=a>>2|a<<2}f.lineTo(t%r,t/r|0);l[t]||--u}while(i!==t);--s}h=null;l=null;return function(t){t.save();t.scale(1/e,-1/n);t.translate(0,-n);t.fill(f);t.beginPath();t.restore()}}(t));if(i.compiled){i.compiled(n);return}}const r=this._createMaskCanvas(t),s=r.canvas;n.save();n.setTransform(1,0,0,1,0,0);n.drawImage(s,r.offsetX,r.offsetY);n.restore();this.compose()}paintImageMaskXObjectRepeat(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0;if(!this.contentVisible)return;t=this.getObject(t.data,t);const l=this.ctx;l.save();const c=(0,r.getCurrentTransform)(l);l.transform(e,n,s,a,0,0);const h=this._createMaskCanvas(t);l.setTransform(1,0,0,1,h.offsetX-c[4],h.offsetY-c[5]);for(let t=0,r=o.length;te?c/e:1;a=l>e?l/e:1}}this._cachedScaleForStroking[0]=s;this._cachedScaleForStroking[1]=a}return this._cachedScaleForStroking}rescaleAndStroke(t){const{ctx:e}=this,{lineWidth:n}=this.current,[i,r]=this.getScaleForStroking();e.lineWidth=n||1;if(1===i&&1===r){e.stroke();return}const s=e.getLineDash();t&&e.save();e.scale(i,r);if(s.length>0){const t=Math.max(i,r);e.setLineDash(s.map((e=>e/t)));e.lineDashOffset/=t}e.stroke();t&&e.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}e.CanvasGraphics=CanvasGraphics;for(const t in i.OPS)void 0!==CanvasGraphics.prototype[t]&&(CanvasGraphics.prototype[i.OPS[t]]=CanvasGraphics.prototype[t])},(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0});e.TilingPattern=e.PathType=void 0;e.getShadingPattern=function getShadingPattern(t){switch(t[0]){case"RadialAxial":return new RadialAxialShadingPattern(t);case"Mesh":return new MeshShadingPattern(t);case"Dummy":return new DummyShadingPattern}throw new Error(`Unknown IR type: ${t[0]}`)};n(2);var i=n(1),r=n(168);const s={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};e.PathType=s;function applyBoundingBox(t,e){if(!e)return;const n=e[2]-e[0],i=e[3]-e[1],r=new Path2D;r.rect(e[0],e[1],n,i);t.clip(r)}class BaseShadingPattern{constructor(){this.constructor===BaseShadingPattern&&(0,i.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,i.unreachable)("Abstract method `getPattern` called.")}}class RadialAxialShadingPattern extends BaseShadingPattern{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(const t of this._colorStops)e.addColorStop(t[0],t[1]);return e}getPattern(t,e,n,a){let o;if(a===s.STROKE||a===s.FILL){const s=e.current.getClippedPathBoundingBox(a,(0,r.getCurrentTransform)(t))||[0,0,0,0],l=Math.ceil(s[2]-s[0])||1,c=Math.ceil(s[3]-s[1])||1,h=e.cachedCanvases.getCanvas("pattern",l,c,!0),d=h.context;d.clearRect(0,0,d.canvas.width,d.canvas.height);d.beginPath();d.rect(0,0,d.canvas.width,d.canvas.height);d.translate(-s[0],-s[1]);n=i.Util.transform(n,[1,0,0,1,s[0],s[1]]);d.transform(...e.baseTransform);this.matrix&&d.transform(...this.matrix);applyBoundingBox(d,this._bbox);d.fillStyle=this._createGradient(d);d.fill();o=t.createPattern(h.canvas,"no-repeat");const u=new DOMMatrix(n);o.setTransform(u)}else{applyBoundingBox(t,this._bbox);o=this._createGradient(t)}return o}}function drawTriangle(t,e,n,i,r,s,a,o){const l=e.coords,c=e.colors,h=t.data,d=4*t.width;let u;if(l[n+1]>l[i+1]){u=n;n=i;i=u;u=s;s=a;a=u}if(l[i+1]>l[r+1]){u=i;i=r;r=u;u=a;a=o;o=u}if(l[n+1]>l[i+1]){u=n;n=i;i=u;u=s;s=a;a=u}const p=(l[n]+e.offsetX)*e.scaleX,f=(l[n+1]+e.offsetY)*e.scaleY,g=(l[i]+e.offsetX)*e.scaleX,m=(l[i+1]+e.offsetY)*e.scaleY,b=(l[r]+e.offsetX)*e.scaleX,v=(l[r+1]+e.offsetY)*e.scaleY;if(f>=v)return;const y=c[s],_=c[s+1],A=c[s+2],S=c[a],E=c[a+1],x=c[a+2],w=c[o],C=c[o+1],T=c[o+2],P=Math.round(f),k=Math.round(v);let M,R,D,I,O,L,N,B;for(let t=P;t<=k;t++){if(tv?1:m===v?0:(m-t)/(m-v);M=g-(g-b)*e;R=S-(S-w)*e;D=E-(E-C)*e;I=x-(x-T)*e}let e;e=tv?1:(f-t)/(f-v);O=p-(p-b)*e;L=y-(y-w)*e;N=_-(_-C)*e;B=A-(A-T)*e;const n=Math.round(Math.min(M,O)),i=Math.round(Math.max(M,O));let r=d*t+4*n;for(let t=n;t<=i;t++){e=(M-t)/(M-O);e<0?e=0:e>1&&(e=1);h[r++]=R-(R-L)*e|0;h[r++]=D-(D-N)*e|0;h[r++]=I-(I-B)*e|0;h[r++]=255}}}function drawFigure(t,e,n){const i=e.coords,r=e.colors;let s,a;switch(e.type){case"lattice":const o=e.verticesPerRow,l=Math.floor(i.length/o)-1,c=o-1;for(s=0;s=i?r=i:n=r/t;return{scale:n,size:r}}clipBbox(t,e,n,i,s){const a=i-e,o=s-n;t.ctx.rect(e,n,a,o);t.current.updateRectMinMax((0,r.getCurrentTransform)(t.ctx),[e,n,i,s]);t.clip();t.endPath()}setFillAndStrokeStyleToContext(t,e,n){const r=t.ctx,s=t.current;switch(e){case a:const t=this.ctx;r.fillStyle=t.fillStyle;r.strokeStyle=t.strokeStyle;s.fillColor=t.fillStyle;s.strokeColor=t.strokeStyle;break;case o:const l=i.Util.makeHexColor(n[0],n[1],n[2]);r.fillStyle=l;r.strokeStyle=l;s.fillColor=l;s.strokeColor=l;break;default:throw new i.FormatError(`Unsupported paint type: ${e}`)}}getPattern(t,e,n,r){let a=n;if(r!==s.SHADING){a=i.Util.transform(a,e.baseTransform);this.matrix&&(a=i.Util.transform(a,this.matrix))}const o=this.createPatternCanvas(e);let l=new DOMMatrix(a);l=l.translate(o.offsetX,o.offsetY);l=l.scale(1/o.scaleX,1/o.scaleY);const c=t.createPattern(o.canvas,"repeat");c.setTransform(l);return c}}e.TilingPattern=TilingPattern},(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0});e.convertBlackAndWhiteToRGBA=convertBlackAndWhiteToRGBA;e.convertToRGBA=function convertToRGBA(t){switch(t.kind){case i.ImageKind.GRAYSCALE_1BPP:return convertBlackAndWhiteToRGBA(t);case i.ImageKind.RGB_24BPP:return function convertRGBToRGBA(t){let{src:e,srcPos:n=0,dest:r,destPos:s=0,width:a,height:o}=t,l=0;const c=e.length>>2,h=new Uint32Array(e.buffer,n,c);if(i.FeatureTest.isLittleEndian){for(;l>>24|e<<8|4278190080;r[s+2]=e>>>16|n<<16|4278190080;r[s+3]=n>>>8|4278190080}for(let t=4*l,n=e.length;t>>8|255;r[s+2]=e<<16|n>>>16|255;r[s+3]=n<<8|255}for(let t=4*l,n=e.length;t>3,p=7&s,f=e.length;r=new Uint32Array(r.buffer);let g=0;for(let t=0;t{Object.defineProperty(e,"__esModule",{value:!0});e.GlobalWorkerOptions=void 0;const n=Object.create(null);e.GlobalWorkerOptions=n;n.workerPort=null;n.workerSrc=""},(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0});e.MessageHandler=void 0;n(2);var i=n(1);const r=1,s=2,a=1,o=2,l=3,c=4,h=5,d=6,u=7,p=8;function wrapReason(t){t instanceof Error||"object"==typeof t&&null!==t||(0,i.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.');switch(t.name){case"AbortException":return new i.AbortException(t.message);case"MissingPDFException":return new i.MissingPDFException(t.message);case"PasswordException":return new i.PasswordException(t.message,t.code);case"UnexpectedResponseException":return new i.UnexpectedResponseException(t.message,t.status);case"UnknownErrorException":return new i.UnknownErrorException(t.message,t.details);default:return new i.UnknownErrorException(t.message,t.toString())}}e.MessageHandler=class MessageHandler{constructor(t,e,n){this.sourceName=t;this.targetName=e;this.comObj=n;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=>{const e=t.data;if(e.targetName!==this.sourceName)return;if(e.stream){this.#de(e);return}if(e.callback){const t=e.callbackId,n=this.callbackCapabilities[t];if(!n)throw new Error(`Cannot resolve callback ${t}`);delete this.callbackCapabilities[t];if(e.callback===r)n.resolve(e.data);else{if(e.callback!==s)throw new Error("Unexpected callback case");n.reject(wrapReason(e.reason))}return}const i=this.actionHandler[e.action];if(!i)throw new Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){const t=this.sourceName,a=e.sourceName;new Promise((function(t){t(i(e.data))})).then((function(i){n.postMessage({sourceName:t,targetName:a,callback:r,callbackId:e.callbackId,data:i})}),(function(i){n.postMessage({sourceName:t,targetName:a,callback:s,callbackId:e.callbackId,reason:wrapReason(i)})}))}else e.streamId?this.#ue(e):i(e.data)};n.addEventListener("message",this._onComObjOnMessage)}on(t,e){const n=this.actionHandler;if(n[t])throw new Error(`There is already an actionName called "${t}"`);n[t]=e}send(t,e,n){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:e},n)}sendWithPromise(t,e,n){const r=this.callbackId++,s=new i.PromiseCapability;this.callbackCapabilities[r]=s;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:r,data:e},n)}catch(t){s.reject(t)}return s.promise}sendWithStream(t,e,n,r){const s=this.streamId++,o=this.sourceName,l=this.targetName,c=this.comObj;return new ReadableStream({start:n=>{const a=new i.PromiseCapability;this.streamControllers[s]={controller:n,startCall:a,pullCall:null,cancelCall:null,isClosed:!1};c.postMessage({sourceName:o,targetName:l,action:t,streamId:s,data:e,desiredSize:n.desiredSize},r);return a.promise},pull:t=>{const e=new i.PromiseCapability;this.streamControllers[s].pullCall=e;c.postMessage({sourceName:o,targetName:l,stream:d,streamId:s,desiredSize:t.desiredSize});return e.promise},cancel:t=>{(0,i.assert)(t instanceof Error,"cancel must have a valid reason");const e=new i.PromiseCapability;this.streamControllers[s].cancelCall=e;this.streamControllers[s].isClosed=!0;c.postMessage({sourceName:o,targetName:l,stream:a,streamId:s,reason:wrapReason(t)});return e.promise}},n)}#ue(t){const e=t.streamId,n=this.sourceName,r=t.sourceName,s=this.comObj,a=this,o=this.actionHandler[t.action],d={enqueue(t){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2?arguments[2]:void 0;if(this.isCancelled)return;const l=this.desiredSize;this.desiredSize-=a;if(l>0&&this.desiredSize<=0){this.sinkCapability=new i.PromiseCapability;this.ready=this.sinkCapability.promise}s.postMessage({sourceName:n,targetName:r,stream:c,streamId:e,chunk:t},o)},close(){if(!this.isCancelled){this.isCancelled=!0;s.postMessage({sourceName:n,targetName:r,stream:l,streamId:e});delete a.streamSinks[e]}},error(t){(0,i.assert)(t instanceof Error,"error must have a valid reason");if(!this.isCancelled){this.isCancelled=!0;s.postMessage({sourceName:n,targetName:r,stream:h,streamId:e,reason:wrapReason(t)})}},sinkCapability:new i.PromiseCapability,onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};d.sinkCapability.resolve();d.ready=d.sinkCapability.promise;this.streamSinks[e]=d;new Promise((function(e){e(o(t.data,d))})).then((function(){s.postMessage({sourceName:n,targetName:r,stream:p,streamId:e,success:!0})}),(function(t){s.postMessage({sourceName:n,targetName:r,stream:p,streamId:e,reason:wrapReason(t)})}))}#de(t){const e=t.streamId,n=this.sourceName,r=t.sourceName,s=this.comObj,f=this.streamControllers[e],g=this.streamSinks[e];switch(t.stream){case p:t.success?f.startCall.resolve():f.startCall.reject(wrapReason(t.reason));break;case u:t.success?f.pullCall.resolve():f.pullCall.reject(wrapReason(t.reason));break;case d:if(!g){s.postMessage({sourceName:n,targetName:r,stream:u,streamId:e,success:!0});break}g.desiredSize<=0&&t.desiredSize>0&&g.sinkCapability.resolve();g.desiredSize=t.desiredSize;new Promise((function(t){t(g.onPull?.())})).then((function(){s.postMessage({sourceName:n,targetName:r,stream:u,streamId:e,success:!0})}),(function(t){s.postMessage({sourceName:n,targetName:r,stream:u,streamId:e,reason:wrapReason(t)})}));break;case c:(0,i.assert)(f,"enqueue should have stream controller");if(f.isClosed)break;f.controller.enqueue(t.chunk);break;case l:(0,i.assert)(f,"close should have stream controller");if(f.isClosed)break;f.isClosed=!0;f.controller.close();this.#pe(f,e);break;case h:(0,i.assert)(f,"error should have stream controller");f.controller.error(wrapReason(t.reason));this.#pe(f,e);break;case o:t.success?f.cancelCall.resolve():f.cancelCall.reject(wrapReason(t.reason));this.#pe(f,e);break;case a:if(!g)break;new Promise((function(e){e(g.onCancel?.(wrapReason(t.reason)))})).then((function(){s.postMessage({sourceName:n,targetName:r,stream:o,streamId:e,success:!0})}),(function(t){s.postMessage({sourceName:n,targetName:r,stream:o,streamId:e,reason:wrapReason(t)})}));g.sinkCapability.reject(wrapReason(t.reason));g.isCancelled=!0;delete this.streamSinks[e];break;default:throw new Error("Unexpected stream case")}}async#pe(t,e){await Promise.allSettled([t.startCall?.promise,t.pullCall?.promise,t.cancelCall?.promise]);delete this.streamControllers[e]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}},(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0});e.Metadata=void 0;var i=n(1);e.Metadata=class Metadata{#fe;#ge;constructor(t){let{parsedData:e,rawData:n}=t;this.#fe=e;this.#ge=n}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,n)=>{Object.defineProperty(e,"__esModule",{value:!0});e.OptionalContentConfig=void 0;var i=n(1),r=n(170);const s=Symbol("INTERNAL");class OptionalContentGroup{#me=!0;constructor(t,e){this.name=t;this.intent=e}get visible(){return this.#me}_setVisible(t,e){t!==s&&(0,i.unreachable)("Internal method `_setVisible` called.");this.#me=e}}e.OptionalContentConfig=class OptionalContentConfig{#be=null;#ve=new Map;#ye=null;#_e=null;constructor(t){this.name=null;this.creator=null;if(null!==t){this.name=t.name;this.creator=t.creator;this.#_e=t.order;for(const e of t.groups)this.#ve.set(e.id,new OptionalContentGroup(e.name,e.intent));if("OFF"===t.baseState)for(const t of this.#ve.values())t._setVisible(s,!1);for(const e of t.on)this.#ve.get(e)._setVisible(s,!0);for(const e of t.off)this.#ve.get(e)._setVisible(s,!1);this.#ye=this.getHash()}}#Ae(t){const e=t.length;if(e<2)return!0;const n=t[0];for(let r=1;r1&&void 0!==arguments[1])||arguments[1];if(this.#ve.has(t)){this.#ve.get(t)._setVisible(s,!!e);this.#be=null}else(0,i.warn)(`Optional content group not found: ${t}`)}get hasInitialVisibility(){return null===this.#ye||this.getHash()===this.#ye}getOrder(){return this.#ve.size?this.#_e?this.#_e.slice():[...this.#ve.keys()]:null}getGroups(){return this.#ve.size>0?(0,i.objectFromMap)(this.#ve):null}getGroup(t){return this.#ve.get(t)||null}getHash(){if(null!==this.#be)return this.#be;const t=new r.MurmurHash3_64;for(const[e,n]of this.#ve)t.update(`${e}:${n.visible}`);return this.#be=t.hexdigest()}}},(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0});e.PDFDataTransportStream=void 0;n(93);n(101);n(102);n(105);n(107);n(109);n(113);n(116);n(123);n(89);var i=n(1),r=n(168);e.PDFDataTransportStream=class PDFDataTransportStream{constructor(t,e){let{length:n,initialData:r,progressiveDone:s=!1,contentDispositionFilename:a=null,disableRange:o=!1,disableStream:l=!1}=t;(0,i.assert)(e,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');this._queuedChunks=[];this._progressiveDone=s;this._contentDispositionFilename=a;if(r?.length>0){const t=r instanceof Uint8Array&&r.byteLength===r.buffer.byteLength?r.buffer:new Uint8Array(r).buffer;this._queuedChunks.push(t)}this._pdfDataRangeTransport=e;this._isStreamingSupported=!l;this._isRangeSupported=!o;this._contentLength=n;this._fullRequestReader=null;this._rangeReaders=[];this._pdfDataRangeTransport.addRangeListener(((t,e)=>{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:n}=t;const r=n instanceof Uint8Array&&n.byteLength===n.buffer.byteLength?n.buffer:new Uint8Array(n).buffer;if(void 0===e)this._fullRequestReader?this._fullRequestReader._enqueue(r):this._queuedChunks.push(r);else{const t=this._rangeReaders.some((function(t){if(t._begin!==e)return!1;t._enqueue(r);return!0}));(0,i.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){const e=this._rangeReaders.indexOf(t);e>=0&&this._rangeReaders.splice(e,1)}getFullReader(){(0,i.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;this._queuedChunks=null;return new PDFDataTransportStreamReader(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const n=new PDFDataTransportStreamRangeReader(this,t,e);this._pdfDataRangeTransport.requestDataRange(t,e);this._rangeReaders.push(n);return n}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeReaders.slice(0))e.cancel(t);this._pdfDataRangeTransport.abort()}};class PDFDataTransportStreamReader{constructor(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this._stream=t;this._done=n||!1;this._filename=(0,r.isPdfFile)(i)?i:null;this._queuedChunks=e||[];this._loaded=0;for(const t of this._queuedChunks)this._loaded+=t.byteLength;this._requests=[];this._headersReady=Promise.resolve();t._fullRequestReader=this;this.onProgress=null}_enqueue(t){if(!this._done){if(this._requests.length>0){this._requests.shift().resolve({value:t,done:!1})}else this._queuedChunks.push(t);this._loaded+=t.byteLength}}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0){return{value:this._queuedChunks.shift(),done:!1}}if(this._done)return{value:void 0,done:!0};const t=new i.PromiseCapability;this._requests.push(t);return t.promise}cancel(t){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class PDFDataTransportStreamRangeReader{constructor(t,e,n){this._stream=t;this._begin=e;this._end=n;this._queuedChunk=null;this._requests=[];this._done=!1;this.onProgress=null}_enqueue(t){if(!this._done){if(0===this._requests.length)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,done:!1});for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0;this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const t=this._queuedChunk;this._queuedChunk=null;return{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=new i.PromiseCapability;this._requests.push(t);return t.promise}cancel(t){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0;this._stream._removeRangeReader(this)}}},(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0});e.PDFFetchStream=void 0;n(93);n(101);n(102);n(105);n(107);n(109);n(113);n(116);n(123);n(89);var i=n(1),r=n(182);function createFetchOptions(t,e,n){return{method:"GET",headers:t,signal:n.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function createHeaders(t){const e=new Headers;for(const n in t){const i=t[n];void 0!==i&&e.append(n,i)}return e}function getArrayBuffer(t){if(t instanceof Uint8Array)return t.buffer;if(t instanceof ArrayBuffer)return t;(0,i.warn)(`getArrayBuffer - unexpected data format: ${t}`);return new Uint8Array(t).buffer}e.PDFFetchStream=class PDFFetchStream{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(){(0,i.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once.");this._fullRequestReader=new PDFFetchStreamReader(this);return this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const n=new PDFFetchStreamRangeReader(this,t,e);this._rangeRequestReaders.push(n);return n}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}};class PDFFetchStreamReader{constructor(t){this._stream=t;this._reader=null;this._loaded=0;this._filename=null;const e=t.source;this._withCredentials=e.withCredentials||!1;this._contentLength=e.length;this._headersCapability=new i.PromiseCapability;this._disableRange=e.disableRange||!1;this._rangeChunkSize=e.rangeChunkSize;this._rangeChunkSize||this._disableRange||(this._disableRange=!0);this._abortController=new AbortController;this._isStreamingSupported=!e.disableStream;this._isRangeSupported=!e.disableRange;this._headers=createHeaders(this._stream.httpHeaders);const n=e.url;fetch(n,createFetchOptions(this._headers,this._withCredentials,this._abortController)).then((t=>{if(!(0,r.validateResponseStatus)(t.status))throw(0,r.createResponseStatusError)(t.status,n);this._reader=t.body.getReader();this._headersCapability.resolve();const getResponseHeader=e=>t.headers.get(e),{allowRangeRequests:e,suggestedLength:s}=(0,r.validateRangeRequestCapabilities)({getResponseHeader:getResponseHeader,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=e;this._contentLength=s||this._contentLength;this._filename=(0,r.extractFilenameFromHeader)(getResponseHeader);!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new i.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;const{value:t,done:e}=await this._reader.read();if(e)return{value:t,done:e};this._loaded+=t.byteLength;this.onProgress?.({loaded:this._loaded,total:this._contentLength});return{value:getArrayBuffer(t),done:!1}}cancel(t){this._reader?.cancel(t);this._abortController.abort()}}class PDFFetchStreamRangeReader{constructor(t,e,n){this._stream=t;this._reader=null;this._loaded=0;const s=t.source;this._withCredentials=s.withCredentials||!1;this._readCapability=new i.PromiseCapability;this._isStreamingSupported=!s.disableStream;this._abortController=new AbortController;this._headers=createHeaders(this._stream.httpHeaders);this._headers.append("Range",`bytes=${e}-${n-1}`);const a=s.url;fetch(a,createFetchOptions(this._headers,this._withCredentials,this._abortController)).then((t=>{if(!(0,r.validateResponseStatus)(t.status))throw(0,r.createResponseStatusError)(t.status,a);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;const{value:t,done:e}=await this._reader.read();if(e)return{value:t,done:e};this._loaded+=t.byteLength;this.onProgress?.({loaded:this._loaded});return{value:getArrayBuffer(t),done:!1}}cancel(t){this._reader?.cancel(t);this._abortController.abort()}}},(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0});e.createResponseStatusError=function createResponseStatusError(t,e){if(404===t||0===t&&e.startsWith("file:"))return new i.MissingPDFException('Missing PDF "'+e+'".');return new i.UnexpectedResponseException(`Unexpected server response (${t}) while retrieving PDF "${e}".`,t)};e.extractFilenameFromHeader=function extractFilenameFromHeader(t){const e=t("Content-Disposition");if(e){let t=(0,r.getFilenameFromContentDispositionHeader)(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch{}if((0,s.isPdfFile)(t))return t}return null};e.validateRangeRequestCapabilities=function validateRangeRequestCapabilities(t){let{getResponseHeader:e,isHttp:n,rangeChunkSize:i,disableRange:r}=t;const s={allowRangeRequests:!1,suggestedLength:void 0},a=parseInt(e("Content-Length"),10);if(!Number.isInteger(a))return s;s.suggestedLength=a;if(a<=2*i)return s;if(r||!n)return s;if("bytes"!==e("Accept-Ranges"))return s;if("identity"!==(e("Content-Encoding")||"identity"))return s;s.allowRangeRequests=!0;return s};e.validateResponseStatus=function validateResponseStatus(t){return 200===t||206===t};var i=n(1),r=n(183),s=n(168)},(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0});e.getFilenameFromContentDispositionHeader=function getFilenameFromContentDispositionHeader(t){let e=!0,n=toParamRegExp("filename\\*","i").exec(t);if(n){n=n[1];let t=rfc2616unquote(n);t=unescape(t);t=rfc5987decode(t);t=rfc2047decode(t);return fixupEncoding(t)}n=function rfc2231getparam(t){const e=[];let n;const i=toParamRegExp("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(n=i.exec(t));){let[,t,i,r]=n;t=parseInt(t,10);if(t in e){if(0===t)break}else e[t]=[i,r]}const r=[];for(let t=0;t{Object.defineProperty(e,"__esModule",{value:!0});e.PDFNetworkStream=void 0;n(89);var i=n(1),r=n(182);class NetworkManager{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.url=t;this.isHttp=/^https?:/i.test(t);this.httpHeaders=this.isHttp&&e.httpHeaders||Object.create(null);this.withCredentials=e.withCredentials||!1;this.currXhrId=0;this.pendingRequests=Object.create(null)}requestRange(t,e,n){const i={begin:t,end:e};for(const t in n)i[t]=n[t];return this.request(i)}requestFull(t){return this.request(t)}request(t){const e=new XMLHttpRequest,n=this.currXhrId++,i=this.pendingRequests[n]={xhr:e};e.open("GET",this.url);e.withCredentials=this.withCredentials;for(const t in this.httpHeaders){const n=this.httpHeaders[t];void 0!==n&&e.setRequestHeader(t,n)}if(this.isHttp&&"begin"in t&&"end"in t){e.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`);i.expectedStatus=206}else i.expectedStatus=200;e.responseType="arraybuffer";t.onError&&(e.onerror=function(n){t.onError(e.status)});e.onreadystatechange=this.onStateChange.bind(this,n);e.onprogress=this.onProgress.bind(this,n);i.onHeadersReceived=t.onHeadersReceived;i.onDone=t.onDone;i.onError=t.onError;i.onProgress=t.onProgress;e.send(null);return n}onProgress(t,e){const n=this.pendingRequests[t];n&&n.onProgress?.(e)}onStateChange(t,e){const n=this.pendingRequests[t];if(!n)return;const r=n.xhr;if(r.readyState>=2&&n.onHeadersReceived){n.onHeadersReceived();delete n.onHeadersReceived}if(4!==r.readyState)return;if(!(t in this.pendingRequests))return;delete this.pendingRequests[t];if(0===r.status&&this.isHttp){n.onError?.(r.status);return}const s=r.status||200;if(!(200===s&&206===n.expectedStatus)&&s!==n.expectedStatus){n.onError?.(r.status);return}const a=function getArrayBuffer(t){const e=t.response;return"string"!=typeof e?e:(0,i.stringToBytes)(e).buffer}(r);if(206===s){const t=r.getResponseHeader("Content-Range"),e=/bytes (\d+)-(\d+)\/(\d+)/.exec(t);n.onDone({begin:parseInt(e[1],10),chunk:a})}else a?n.onDone({begin:0,chunk:a}):n.onError?.(r.status)}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){const e=this.pendingRequests[t].xhr;delete this.pendingRequests[t];e.abort()}}e.PDFNetworkStream=class PDFNetworkStream{constructor(t){this._source=t;this._manager=new NetworkManager(t.url,{httpHeaders:t.httpHeaders,withCredentials:t.withCredentials});this._rangeChunkSize=t.rangeChunkSize;this._fullRequestReader=null;this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){const e=this._rangeRequestReaders.indexOf(t);e>=0&&this._rangeRequestReaders.splice(e,1)}getFullReader(){(0,i.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once.");this._fullRequestReader=new PDFNetworkStreamFullRequestReader(this._manager,this._source);return this._fullRequestReader}getRangeReader(t,e){const n=new PDFNetworkStreamRangeRequestReader(this._manager,t,e);n.onClosed=this._onRangeRequestReaderClosed.bind(this);this._rangeRequestReaders.push(n);return n}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}};class PDFNetworkStreamFullRequestReader{constructor(t,e){this._manager=t;const n={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(n);this._headersReceivedCapability=new i.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(){const t=this._fullRequestId,e=this._manager.getRequestXhr(t),getResponseHeader=t=>e.getResponseHeader(t),{allowRangeRequests:n,suggestedLength:i}=(0,r.validateRangeRequestCapabilities)({getResponseHeader:getResponseHeader,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});n&&(this._isRangeSupported=!0);this._contentLength=i||this._contentLength;this._filename=(0,r.extractFilenameFromHeader)(getResponseHeader);this._isRangeSupported&&this._manager.abortRequest(t);this._headersReceivedCapability.resolve()}_onDone(t){if(t)if(this._requests.length>0){this._requests.shift().resolve({value:t.chunk,done:!1})}else this._cachedChunks.push(t.chunk);this._done=!0;if(!(this._cachedChunks.length>0)){for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(t){this._storedError=(0,r.createResponseStatusError)(t,this._url);this._headersReceivedCapability.reject(this._storedError);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0;this._cachedChunks.length=0}_onProgress(t){this.onProgress?.({loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0){return{value:this._cachedChunks.shift(),done:!1}}if(this._done)return{value:void 0,done:!0};const t=new i.PromiseCapability;this._requests.push(t);return t.promise}cancel(t){this._done=!0;this._headersReceivedCapability.reject(t);for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0;this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId);this._fullRequestReader=null}}class PDFNetworkStreamRangeRequestReader{constructor(t,e,n){this._manager=t;const i={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url;this._requestId=t.requestRange(e,n,i);this._requests=[];this._queuedChunk=null;this._done=!1;this._storedError=void 0;this.onProgress=null;this.onClosed=null}_close(){this.onClosed?.(this)}_onDone(t){const e=t.chunk;if(this._requests.length>0){this._requests.shift().resolve({value:e,done:!1})}else this._queuedChunk=e;this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0;this._close()}_onError(t){this._storedError=(0,r.createResponseStatusError)(t,this._url);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0;this._queuedChunk=null}_onProgress(t){this.isStreamingSupported||this.onProgress?.({loaded:t.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(null!==this._queuedChunk){const t=this._queuedChunk;this._queuedChunk=null;return{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=new i.PromiseCapability;this._requests.push(t);return t.promise}cancel(t){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0;this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId);this._close()}}},(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0});e.PDFNodeStream=void 0;n(89);n(93);n(101);n(102);n(105);n(107);n(109);n(113);n(116);n(123);var i=n(1),r=n(182);const s=/^file:\/\/\/[a-zA-Z]:\//;e.PDFNodeStream=class PDFNodeStream{constructor(t){this.source=t;this.url=function parseUrl(t){const e=require("url"),n=e.parse(t);if("file:"===n.protocol||n.host)return n;if(/^[a-z]:[/\\]/i.test(t))return e.parse(`file:///${t}`);n.host||(n.protocol="file:");return n}(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(){(0,i.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once.");this._fullRequestReader=this.isFsUrl?new PDFNodeStreamFsFullReader(this):new PDFNodeStreamFullReader(this);return this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const n=this.isFsUrl?new PDFNodeStreamFsRangeReader(this,t,e):new PDFNodeStreamRangeReader(this,t,e);this._rangeRequestReaders.push(n);return n}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}};class BaseFullReader{constructor(t){this._url=t.url;this._done=!1;this._storedError=null;this.onProgress=null;const e=t.source;this._contentLength=e.length;this._loaded=0;this._filename=null;this._disableRange=e.disableRange||!1;this._rangeChunkSize=e.rangeChunkSize;this._rangeChunkSize||this._disableRange||(this._disableRange=!0);this._isStreamingSupported=!e.disableStream;this._isRangeSupported=!e.disableRange;this._readableStream=null;this._readCapability=new i.PromiseCapability;this._headersCapability=new i.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(){await this._readCapability.promise;if(this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();if(null===t){this._readCapability=new i.PromiseCapability;return this.read()}this._loaded+=t.length;this.onProgress?.({loaded:this._loaded,total:this._contentLength});return{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;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 i.AbortException("streaming is disabled"));this._storedError&&this._readableStream.destroy(this._storedError)}}class BaseRangeReader{constructor(t){this._url=t.url;this._done=!1;this._storedError=null;this.onProgress=null;this._loaded=0;this._readableStream=null;this._readCapability=new i.PromiseCapability;const e=t.source;this._isStreamingSupported=!e.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;if(this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const t=this._readableStream.read();if(null===t){this._readCapability=new i.PromiseCapability;return this.read()}this._loaded+=t.length;this.onProgress?.({loaded:this._loaded});return{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;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 createRequestOptions(t,e){return{protocol:t.protocol,auth:t.auth,host:t.hostname,port:t.port,path:t.path,method:"GET",headers:e}}class PDFNodeStreamFullReader extends BaseFullReader{constructor(t){super(t);const handleResponse=e=>{if(404===e.statusCode){const t=new i.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=t;this._headersCapability.reject(t);return}this._headersCapability.resolve();this._setReadableStream(e);const getResponseHeader=t=>this._readableStream.headers[t.toLowerCase()],{allowRangeRequests:n,suggestedLength:s}=(0,r.validateRangeRequestCapabilities)({getResponseHeader:getResponseHeader,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=n;this._contentLength=s||this._contentLength;this._filename=(0,r.extractFilenameFromHeader)(getResponseHeader)};this._request=null;if("http:"===this._url.protocol){const e=require("http");this._request=e.request(createRequestOptions(this._url,t.httpHeaders),handleResponse)}else{const e=require("https");this._request=e.request(createRequestOptions(this._url,t.httpHeaders),handleResponse)}this._request.on("error",(t=>{this._storedError=t;this._headersCapability.reject(t)}));this._request.end()}}class PDFNodeStreamRangeReader extends BaseRangeReader{constructor(t,e,n){super(t);this._httpHeaders={};for(const e in t.httpHeaders){const n=t.httpHeaders[e];void 0!==n&&(this._httpHeaders[e]=n)}this._httpHeaders.Range=`bytes=${e}-${n-1}`;const handleResponse=t=>{if(404!==t.statusCode)this._setReadableStream(t);else{const t=new i.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=t}};this._request=null;if("http:"===this._url.protocol){const t=require("http");this._request=t.request(createRequestOptions(this._url,this._httpHeaders),handleResponse)}else{const t=require("https");this._request=t.request(createRequestOptions(this._url,this._httpHeaders),handleResponse)}this._request.on("error",(t=>{this._storedError=t}));this._request.end()}}class PDFNodeStreamFsFullReader extends BaseFullReader{constructor(t){super(t);let e=decodeURIComponent(this._url.path);s.test(this._url.href)&&(e=e.replace(/^\//,""));const n=require("fs");n.lstat(e,((t,r)=>{if(t){"ENOENT"===t.code&&(t=new i.MissingPDFException(`Missing PDF "${e}".`));this._storedError=t;this._headersCapability.reject(t)}else{this._contentLength=r.size;this._setReadableStream(n.createReadStream(e));this._headersCapability.resolve()}}))}}class PDFNodeStreamFsRangeReader extends BaseRangeReader{constructor(t,e,n){super(t);let i=decodeURIComponent(this._url.path);s.test(this._url.href)&&(i=i.replace(/^\//,""));const r=require("fs");this._setReadableStream(r.createReadStream(i,{start:e,end:n-1}))}}},(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0});e.SVGGraphics=void 0;n(84);n(86);n(87);n(93);n(101);n(102);n(105);n(107);n(109);n(113);n(116);n(123);n(2);n(89);n(187);var i=n(168),r=n(1);const s="normal",a="normal",o="#000000",l=["butt","round","square"],c=["miter","round","bevel"],createObjectURL=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(URL.createObjectURL&&"undefined"!=typeof Blob&&!n)return URL.createObjectURL(new Blob([t],{type:e}));const i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let r=`data:${e};base64,`;for(let e=0,n=t.length;e>2]+i[(3&s)<<4|a>>4]+i[e+1>6:64]+i[e+2>1&2147483647:n>>1&2147483647;e[t]=n}function writePngChunk(t,n,i,r){let s=r;const a=n.length;i[s]=a>>24&255;i[s+1]=a>>16&255;i[s+2]=a>>8&255;i[s+3]=255&a;s+=4;i[s]=255&t.charCodeAt(0);i[s+1]=255&t.charCodeAt(1);i[s+2]=255&t.charCodeAt(2);i[s+3]=255&t.charCodeAt(3);s+=4;i.set(n,s);s+=n.length;const o=function crc32(t,n,i){let r=-1;for(let s=n;s>>8^e[n]}return-1^r}(i,r+4,s);i[s]=o>>24&255;i[s+1]=o>>16&255;i[s+2]=o>>8&255;i[s+3]=255&o}function deflateSyncUncompressed(t){let e=t.length;const n=65535,i=Math.ceil(e/n),r=new Uint8Array(2+e+5*i+4);let s=0;r[s++]=120;r[s++]=156;let a=0;for(;e>n;){r[s++]=0;r[s++]=255;r[s++]=255;r[s++]=0;r[s++]=0;r.set(t.subarray(a,a+n),s);s+=n;a+=n;e-=n}r[s++]=1;r[s++]=255&e;r[s++]=e>>8&255;r[s++]=255&~e;r[s++]=(65535&~e)>>8&255;r.set(t.subarray(a),s);s+=t.length-a;const o=function adler32(t,e,n){let i=1,r=0;for(let s=e;s>24&255;r[s++]=o>>16&255;r[s++]=o>>8&255;r[s++]=255&o;return r}function encode(e,n,i,s){const a=e.width,o=e.height;let l,c,h;const d=e.data;switch(n){case r.ImageKind.GRAYSCALE_1BPP:c=0;l=1;h=a+7>>3;break;case r.ImageKind.RGB_24BPP:c=2;l=8;h=3*a;break;case r.ImageKind.RGBA_32BPP:c=6;l=8;h=4*a;break;default:throw new Error("invalid format")}const u=new Uint8Array((1+h)*o);let p=0,f=0;for(let t=0;t>24&255,a>>16&255,a>>8&255,255&a,o>>24&255,o>>16&255,o>>8&255,255&o,l,c,0,0,0]),m=function deflateSync(t){if(!r.isNodeJS)return deflateSyncUncompressed(t);try{const e=parseInt(process.versions.node)>=8?t:Buffer.from(t),n=require("zlib").deflateSync(e,{level:9});return n instanceof Uint8Array?n:new Uint8Array(n)}catch(t){(0,r.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+t)}return deflateSyncUncompressed(t)}(u),b=t.length+36+g.length+m.length,v=new Uint8Array(b);let y=0;v.set(t,y);y+=t.length;writePngChunk("IHDR",g,v,y);y+=12+g.length;writePngChunk("IDATA",m,v,y);y+=12+m.length;writePngChunk("IEND",new Uint8Array(0),v,y);return createObjectURL(v,"image/png",i)}return function convertImgDataToPng(t,e,n){return encode(t,void 0===t.kind?r.ImageKind.GRAYSCALE_1BPP:t.kind,e,n)}}();class SVGExtraState{constructor(){this.fontSizeScale=1;this.fontWeight=a;this.fontSize=0;this.textMatrix=r.IDENTITY_MATRIX;this.fontMatrix=r.FONT_IDENTITY_MATRIX;this.leading=0;this.textRenderingMode=r.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=o;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 pf(t){if(Number.isInteger(t))return t.toString();const e=t.toFixed(10);let n=e.length-1;if("0"!==e[n])return e;do{n--}while("0"===e[n]);return e.substring(0,"."===e[n]?n:n+1)}function pm(t){if(0===t[4]&&0===t[5]){if(0===t[1]&&0===t[2])return 1===t[0]&&1===t[3]?"":`scale(${pf(t[0])} ${pf(t[3])})`;if(t[0]===t[3]&&t[1]===-t[2]){return`rotate(${pf(180*Math.acos(t[0])/Math.PI)})`}}else if(1===t[0]&&0===t[1]&&0===t[2]&&1===t[3])return`translate(${pf(t[4])} ${pf(t[5])})`;return`matrix(${pf(t[0])} ${pf(t[1])} ${pf(t[2])} ${pf(t[3])} ${pf(t[4])} ${pf(t[5])})`}let d=0,u=0,p=0;e.SVGGraphics=class SVGGraphics{constructor(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];(0,i.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future.");this.svgFactory=new i.DOMSVGFactory;this.current=new SVGExtraState;this.transformMatrix=r.IDENTITY_MATRIX;this.transformStack=[];this.extraStack=[];this.commonObjs=t;this.objs=e;this.pendingClip=null;this.pendingEOFill=!1;this.embedFonts=!1;this.embeddedFonts=Object.create(null);this.cssStyle=null;this.forceDataSchema=!!n;this._operatorIdMapping=[];for(const t in r.OPS)this._operatorIdMapping[r.OPS[t]]=t}getObject(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return"string"==typeof t?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):e}save(){this.transformStack.push(this.transformMatrix);const t=this.current;this.extraStack.push(t);this.current=t.clone()}restore(){this.transformMatrix=this.transformStack.pop();this.current=this.extraStack.pop();this.pendingClip=null;this.tgrp=null}group(t){this.save();this.executeOpTree(t);this.restore()}loadDependencies(t){const e=t.fnArray,n=t.argsArray;for(let t=0,i=e.length;t{t.get(e,n)}));this.current.dependencies.push(n)}return Promise.all(this.current.dependencies)}transform(t,e,n,i,s,a){const o=[t,e,n,i,s,a];this.transformMatrix=r.Util.transform(this.transformMatrix,o);this.tgrp=null}getSVG(t,e){this.viewport=e;const n=this._initialize(e);return this.loadDependencies(t).then((()=>{this.transformMatrix=r.IDENTITY_MATRIX;this.executeOpTree(this.convertOpList(t));return n}))}convertOpList(t){const e=this._operatorIdMapping,n=t.argsArray,i=t.fnArray,r=[];for(let t=0,s=i.length;t0&&(this.current.lineWidth=t)}setLineCap(t){this.current.lineCap=l[t]}setLineJoin(t){this.current.lineJoin=c[t]}setMiterLimit(t){this.current.miterLimit=t}setStrokeAlpha(t){this.current.strokeAlpha=t}setStrokeRGBColor(t,e,n){this.current.strokeColor=r.Util.makeHexColor(t,e,n)}setFillAlpha(t){this.current.fillAlpha=t}setFillRGBColor(t,e,n){this.current.fillColor=r.Util.makeHexColor(t,e,n);this.current.tspan=this.svgFactory.createElement("svg:tspan");this.current.xcoords=[];this.current.ycoords=[]}setStrokeColorN(t){this.current.strokeColor=this._makeColorN_Pattern(t)}setFillColorN(t){this.current.fillColor=this._makeColorN_Pattern(t)}shadingFill(t){const{width:e,height:n}=this.viewport,i=r.Util.inverseTransform(this.transformMatrix),[s,a,o,l]=r.Util.getAxialAlignedBoundingBox([0,0,e,n],i),c=this.svgFactory.createElement("svg:rect");c.setAttributeNS(null,"x",s);c.setAttributeNS(null,"y",a);c.setAttributeNS(null,"width",o-s);c.setAttributeNS(null,"height",l-a);c.setAttributeNS(null,"fill",this._makeShadingPattern(t));this.current.fillAlpha<1&&c.setAttributeNS(null,"fill-opacity",this.current.fillAlpha);this._ensureTransformGroup().append(c)}_makeColorN_Pattern(t){return"TilingPattern"===t[0]?this._makeTilingPattern(t):this._makeShadingPattern(t)}_makeTilingPattern(t){const e=t[1],n=t[2],i=t[3]||r.IDENTITY_MATRIX,[s,a,o,l]=t[4],c=t[5],h=t[6],d=t[7],u="shading"+p++,[f,g,m,b]=r.Util.normalizeRect([...r.Util.applyTransform([s,a],i),...r.Util.applyTransform([o,l],i)]),[v,y]=r.Util.singularValueDecompose2dScale(i),_=c*v,A=h*y,S=this.svgFactory.createElement("svg:pattern");S.setAttributeNS(null,"id",u);S.setAttributeNS(null,"patternUnits","userSpaceOnUse");S.setAttributeNS(null,"width",_);S.setAttributeNS(null,"height",A);S.setAttributeNS(null,"x",`${f}`);S.setAttributeNS(null,"y",`${g}`);const E=this.svg,x=this.transformMatrix,w=this.current.fillColor,C=this.current.strokeColor,T=this.svgFactory.create(m-f,b-g);this.svg=T;this.transformMatrix=i;if(2===d){const t=r.Util.makeHexColor(...e);this.current.fillColor=t;this.current.strokeColor=t}this.executeOpTree(this.convertOpList(n));this.svg=E;this.transformMatrix=x;this.current.fillColor=w;this.current.strokeColor=C;S.append(T.childNodes[0]);this.defs.append(S);return`url(#${u})`}_makeShadingPattern(t){"string"==typeof t&&(t=this.objs.get(t));switch(t[0]){case"RadialAxial":const e="shading"+p++,n=t[3];let i;switch(t[1]){case"axial":const n=t[4],r=t[5];i=this.svgFactory.createElement("svg:linearGradient");i.setAttributeNS(null,"id",e);i.setAttributeNS(null,"gradientUnits","userSpaceOnUse");i.setAttributeNS(null,"x1",n[0]);i.setAttributeNS(null,"y1",n[1]);i.setAttributeNS(null,"x2",r[0]);i.setAttributeNS(null,"y2",r[1]);break;case"radial":const s=t[4],a=t[5],o=t[6],l=t[7];i=this.svgFactory.createElement("svg:radialGradient");i.setAttributeNS(null,"id",e);i.setAttributeNS(null,"gradientUnits","userSpaceOnUse");i.setAttributeNS(null,"cx",a[0]);i.setAttributeNS(null,"cy",a[1]);i.setAttributeNS(null,"r",l);i.setAttributeNS(null,"fx",s[0]);i.setAttributeNS(null,"fy",s[1]);i.setAttributeNS(null,"fr",o);break;default:throw new Error(`Unknown RadialAxial type: ${t[1]}`)}for(const t of n){const e=this.svgFactory.createElement("svg:stop");e.setAttributeNS(null,"offset",t[0]);e.setAttributeNS(null,"stop-color",t[1]);i.append(e)}this.defs.append(i);return`url(#${e})`;case"Mesh":(0,r.warn)("Unimplemented pattern Mesh");return null;case"Dummy":return"hotpink";default:throw new Error(`Unknown IR type: ${t[0]}`)}}setDash(t,e){this.current.dashArray=t;this.current.dashPhase=e}constructPath(t,e){const n=this.current;let i=n.x,s=n.y,a=[],o=0;for(const n of t)switch(0|n){case r.OPS.rectangle:i=e[o++];s=e[o++];const t=i+e[o++],n=s+e[o++];a.push("M",pf(i),pf(s),"L",pf(t),pf(s),"L",pf(t),pf(n),"L",pf(i),pf(n),"Z");break;case r.OPS.moveTo:i=e[o++];s=e[o++];a.push("M",pf(i),pf(s));break;case r.OPS.lineTo:i=e[o++];s=e[o++];a.push("L",pf(i),pf(s));break;case r.OPS.curveTo:i=e[o+4];s=e[o+5];a.push("C",pf(e[o]),pf(e[o+1]),pf(e[o+2]),pf(e[o+3]),pf(i),pf(s));o+=6;break;case r.OPS.curveTo2:a.push("C",pf(i),pf(s),pf(e[o]),pf(e[o+1]),pf(e[o+2]),pf(e[o+3]));i=e[o+2];s=e[o+3];o+=4;break;case r.OPS.curveTo3:i=e[o+2];s=e[o+3];a.push("C",pf(e[o]),pf(e[o+1]),pf(i),pf(s),pf(i),pf(s));o+=4;break;case r.OPS.closePath:a.push("Z")}a=a.join(" ");if(n.path&&t.length>0&&t[0]!==r.OPS.rectangle&&t[0]!==r.OPS.moveTo)a=n.path.getAttributeNS(null,"d")+a;else{n.path=this.svgFactory.createElement("svg:path");this._ensureTransformGroup().append(n.path)}n.path.setAttributeNS(null,"d",a);n.path.setAttributeNS(null,"fill","none");n.element=n.path;n.setCurrentPoint(i,s)}endPath(){const t=this.current;t.path=null;if(!this.pendingClip)return;if(!t.element){this.pendingClip=null;return}const e="clippath"+d++,n=this.svgFactory.createElement("svg:clipPath");n.setAttributeNS(null,"id",e);n.setAttributeNS(null,"transform",pm(this.transformMatrix));const i=t.element.cloneNode(!0);"evenodd"===this.pendingClip?i.setAttributeNS(null,"clip-rule","evenodd"):i.setAttributeNS(null,"clip-rule","nonzero");this.pendingClip=null;n.append(i);this.defs.append(n);if(t.activeClipUrl){t.clipGroup=null;for(const t of this.extraStack)t.clipGroup=null;n.setAttributeNS(null,"clip-path",t.activeClipUrl)}t.activeClipUrl=`url(#${e})`;this.tgrp=null}clip(t){this.pendingClip=t}closePath(){const t=this.current;if(t.path){const e=`${t.path.getAttributeNS(null,"d")}Z`;t.path.setAttributeNS(null,"d",e)}}setLeading(t){this.current.leading=-t}setTextRise(t){this.current.textRise=t}setTextRenderingMode(t){this.current.textRenderingMode=t}setHScale(t){this.current.textHScale=t/100}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(const[e,n]of t)switch(e){case"LW":this.setLineWidth(n);break;case"LC":this.setLineCap(n);break;case"LJ":this.setLineJoin(n);break;case"ML":this.setMiterLimit(n);break;case"D":this.setDash(n[0],n[1]);break;case"RI":this.setRenderingIntent(n);break;case"FL":this.setFlatness(n);break;case"Font":this.setFont(n);break;case"CA":this.setStrokeAlpha(n);break;case"ca":this.setFillAlpha(n);break;default:(0,r.warn)(`Unimplemented graphic state operator ${e}`)}}fill(){const t=this.current;if(t.element){t.element.setAttributeNS(null,"fill",t.fillColor);t.element.setAttributeNS(null,"fill-opacity",t.fillAlpha);this.endPath()}}stroke(){const t=this.current;if(t.element){this._setStrokeAttributes(t.element);t.element.setAttributeNS(null,"fill","none");this.endPath()}}_setStrokeAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const n=this.current;let i=n.dashArray;1!==e&&i.length>0&&(i=i.map((function(t){return e*t})));t.setAttributeNS(null,"stroke",n.strokeColor);t.setAttributeNS(null,"stroke-opacity",n.strokeAlpha);t.setAttributeNS(null,"stroke-miterlimit",pf(n.miterLimit));t.setAttributeNS(null,"stroke-linecap",n.lineCap);t.setAttributeNS(null,"stroke-linejoin",n.lineJoin);t.setAttributeNS(null,"stroke-width",pf(e*n.lineWidth)+"px");t.setAttributeNS(null,"stroke-dasharray",i.map(pf).join(" "));t.setAttributeNS(null,"stroke-dashoffset",pf(e*n.dashPhase)+"px")}eoFill(){this.current.element?.setAttributeNS(null,"fill-rule","evenodd");this.fill()}fillStroke(){this.stroke();this.fill()}eoFillStroke(){this.current.element?.setAttributeNS(null,"fill-rule","evenodd");this.fillStroke()}closeStroke(){this.closePath();this.stroke()}closeFillStroke(){this.closePath();this.fillStroke()}closeEOFillStroke(){this.closePath();this.eoFillStroke()}paintSolidColorImageMask(){const t=this.svgFactory.createElement("svg:rect");t.setAttributeNS(null,"x","0");t.setAttributeNS(null,"y","0");t.setAttributeNS(null,"width","1px");t.setAttributeNS(null,"height","1px");t.setAttributeNS(null,"fill",this.current.fillColor);this._ensureTransformGroup().append(t)}paintImageXObject(t){const e=this.getObject(t);e?this.paintInlineImageXObject(e):(0,r.warn)(`Dependent image with object ID ${t} is not ready yet`)}paintInlineImageXObject(t,e){const n=t.width,i=t.height,r=h(t,this.forceDataSchema,!!e),s=this.svgFactory.createElement("svg:rect");s.setAttributeNS(null,"x","0");s.setAttributeNS(null,"y","0");s.setAttributeNS(null,"width",pf(n));s.setAttributeNS(null,"height",pf(i));this.current.element=s;this.clip("nonzero");const a=this.svgFactory.createElement("svg:image");a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r);a.setAttributeNS(null,"x","0");a.setAttributeNS(null,"y",pf(-i));a.setAttributeNS(null,"width",pf(n)+"px");a.setAttributeNS(null,"height",pf(i)+"px");a.setAttributeNS(null,"transform",`scale(${pf(1/n)} ${pf(-1/i)})`);e?e.append(a):this._ensureTransformGroup().append(a)}paintImageMaskXObject(t){const e=this.getObject(t.data,t);if(e.bitmap){(0,r.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled.");return}const n=this.current,i=e.width,s=e.height,a=n.fillColor;n.maskId="mask"+u++;const o=this.svgFactory.createElement("svg:mask");o.setAttributeNS(null,"id",n.maskId);const l=this.svgFactory.createElement("svg:rect");l.setAttributeNS(null,"x","0");l.setAttributeNS(null,"y","0");l.setAttributeNS(null,"width",pf(i));l.setAttributeNS(null,"height",pf(s));l.setAttributeNS(null,"fill",a);l.setAttributeNS(null,"mask",`url(#${n.maskId})`);this.defs.append(o);this._ensureTransformGroup().append(l);this.paintInlineImageXObject(e,o)}paintFormXObjectBegin(t,e){Array.isArray(t)&&6===t.length&&this.transform(t[0],t[1],t[2],t[3],t[4],t[5]);if(e){const t=e[2]-e[0],n=e[3]-e[1],i=this.svgFactory.createElement("svg:rect");i.setAttributeNS(null,"x",e[0]);i.setAttributeNS(null,"y",e[1]);i.setAttributeNS(null,"width",pf(t));i.setAttributeNS(null,"height",pf(n));this.current.element=i;this.clip("nonzero");this.endPath()}}paintFormXObjectEnd(){}_initialize(t){const e=this.svgFactory.create(t.width,t.height),n=this.svgFactory.createElement("svg:defs");e.append(n);this.defs=n;const i=this.svgFactory.createElement("svg:g");i.setAttributeNS(null,"transform",pm(t.transform));e.append(i);this.svg=i;return e}_ensureClipGroup(){if(!this.current.clipGroup){const t=this.svgFactory.createElement("svg:g");t.setAttributeNS(null,"clip-path",this.current.activeClipUrl);this.svg.append(t);this.current.clipGroup=t}return this.current.clipGroup}_ensureTransformGroup(){if(!this.tgrp){this.tgrp=this.svgFactory.createElement("svg:g");this.tgrp.setAttributeNS(null,"transform",pm(this.transformMatrix));this.current.activeClipUrl?this._ensureClipGroup().append(this.tgrp):this.svg.append(this.tgrp)}return this.tgrp}}},(t,e,n)=>{var i=n(3),r=n(188),s=n(193);i({target:"Array",proto:!0},{group:function group(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}});s("group")},(t,e,n)=>{var i=n(99),r=n(14),s=n(13),a=n(40),o=n(18),l=n(64),c=n(189),h=n(108),d=Array,u=r([].push);t.exports=function(t,e,n,r){for(var p,f,g,m=a(t),b=s(m),v=i(e,n),y=c(null),_=l(b),A=0;_>A;A++){g=b[A];(f=o(v(g,A,m)))in y?u(y[f],g):y[f]=[g]}if(r&&(p=r(m))!==d)for(f in y)y[f]=h(p,y[f]);return y}},(t,e,n)=>{var i,r=n(47),s=n(190),a=n(66),o=n(55),l=n(192),c=n(43),h=n(54),d="prototype",u="script",p=h("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(t){return"<"+u+">"+t+""},NullProtoObjectViaActiveX=function(t){t.write(scriptTag(""));t.close();var e=t.parentWindow.Object;t=null;return e},NullProtoObject=function(){try{i=new ActiveXObject("htmlfile")}catch(t){}NullProtoObject="undefined"!=typeof document?document.domain&&i?NullProtoObjectViaActiveX(i):function(){var t,e=c("iframe"),n="java"+u+":";e.style.display="none";l.appendChild(e);e.src=String(n);(t=e.contentWindow.document).open();t.write(scriptTag("document.F=Object"));t.close();return t.F}():NullProtoObjectViaActiveX(i);for(var t=a.length;t--;)delete NullProtoObject[d][a[t]];return NullProtoObject()};o[p]=!0;t.exports=Object.create||function create(t,e){var n;if(null!==t){EmptyConstructor[d]=r(t);n=new EmptyConstructor;EmptyConstructor[d]=null;n[p]=t}else n=NullProtoObject();return void 0===e?n:s.f(n,e)}},(t,e,n)=>{var i=n(6),r=n(46),s=n(45),a=n(47),o=n(12),l=n(191);e.f=i&&!r?Object.defineProperties:function defineProperties(t,e){a(t);for(var n,i=o(e),r=l(e),c=r.length,h=0;c>h;)s.f(t,n=r[h++],i[n]);return t}},(t,e,n)=>{var i=n(59),r=n(66);t.exports=Object.keys||function keys(t){return i(t,r)}},(t,e,n)=>{var i=n(24);t.exports=i("document","documentElement")},(t,e,n)=>{var i=n(34),r=n(189),s=n(45).f,a=i("unscopables"),o=Array.prototype;void 0===o[a]&&s(o,a,{configurable:!0,value:r(null)});t.exports=function(t){o[a][t]=!0}},(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0});e.XfaText=void 0;n(89);class XfaText{static textContent(t){const e=[],n={items:e,styles:Object.create(null)};!function walk(t){if(!t)return;let n=null;const i=t.name;if("#text"===i)n=t.value;else{if(!XfaText.shouldBuildText(i))return;t?.attributes?.textContent?n=t.attributes.textContent:t.value&&(n=t.value)}null!==n&&e.push({str:n});if(t.children)for(const e of t.children)walk(e)}(t);return n}static shouldBuildText(t){return!("textarea"===t||"input"===t||"option"===t||"select"===t)}}e.XfaText=XfaText},(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0});e.TextLayerRenderTask=void 0;e.renderTextLayer=function renderTextLayer(t){if(!t.textContentSource&&(t.textContent||t.textContentStream)){(0,r.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters will be removed in the future, please use `textContentSource` instead.");t.textContentSource=t.textContent||t.textContentStream}const{container:e,viewport:n}=t,i=getComputedStyle(e),s=i.getPropertyValue("visibility"),a=parseFloat(i.getPropertyValue("--scale-factor"));"visible"===s&&(!a||Math.abs(a-n.scale)>1e-5)&&console.error("The `--scale-factor` CSS-variable must be set, to the same value as `viewport.scale`, either on the `container`-element itself or higher up in the DOM.");const o=new TextLayerRenderTask(t);o._render();return o};e.updateTextLayer=function updateTextLayer(t){let{container:e,viewport:n,textDivs:i,textDivProperties:s,isOffscreenCanvasSupported:a,mustRotate:o=!0,mustRescale:l=!0}=t;o&&(0,r.setLayerDimensions)(e,{rotation:n.rotation});if(l){const t=getCtx(0,a),e={prevFontSize:null,prevFontFamily:null,div:null,scale:n.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:t};for(const t of i){e.properties=s.get(t);e.div=t;layout(e)}}};n(89);n(2);var i=n(1),r=n(168);const s=30,a=.8,o=new Map;function getCtx(t,e){let n;if(e&&i.FeatureTest.isOffscreenCanvasSupported)n=new OffscreenCanvas(t,t).getContext("2d",{alpha:!1});else{const e=document.createElement("canvas");e.width=e.height=t;n=e.getContext("2d",{alpha:!1})}return n}function appendText(t,e,n){const r=document.createElement("span"),l={angle:0,canvasWidth:0,hasText:""!==e.str,hasEOL:e.hasEOL,fontSize:0};t._textDivs.push(r);const c=i.Util.transform(t._transform,e.transform);let h=Math.atan2(c[1],c[0]);const d=n[e.fontName];d.vertical&&(h+=Math.PI/2);const u=Math.hypot(c[2],c[3]),p=u*function getAscent(t,e){const n=o.get(t);if(n)return n;const i=getCtx(s,e);i.font=`${s}px ${t}`;const r=i.measureText("");let l=r.fontBoundingBoxAscent,c=Math.abs(r.fontBoundingBoxDescent);if(l){const e=l/(l+c);o.set(t,e);i.canvas.width=i.canvas.height=0;return e}i.strokeStyle="red";i.clearRect(0,0,s,s);i.strokeText("g",0,0);let h=i.getImageData(0,0,s,s).data;c=0;for(let t=h.length-1-3;t>=0;t-=4)if(h[t]>0){c=Math.ceil(t/4/s);break}i.clearRect(0,0,s,s);i.strokeText("A",0,s);h=i.getImageData(0,0,s,s).data;l=0;for(let t=0,e=h.length;t0){l=s-Math.floor(t/4/s);break}i.canvas.width=i.canvas.height=0;if(l){const e=l/(l+c);o.set(t,e);return e}o.set(t,a);return a}(d.fontFamily,t._isOffscreenCanvasSupported);let f,g;if(0===h){f=c[4];g=c[5]-p}else{f=c[4]+p*Math.sin(h);g=c[5]-p*Math.cos(h)}const m="calc(var(--scale-factor)*",b=r.style;if(t._container===t._rootContainer){b.left=`${(100*f/t._pageWidth).toFixed(2)}%`;b.top=`${(100*g/t._pageHeight).toFixed(2)}%`}else{b.left=`${m}${f.toFixed(2)}px)`;b.top=`${m}${g.toFixed(2)}px)`}b.fontSize=`${m}${u.toFixed(2)}px)`;b.fontFamily=d.fontFamily;l.fontSize=u;r.setAttribute("role","presentation");r.textContent=e.str;r.dir=e.dir;t._fontInspectorEnabled&&(r.dataset.fontName=e.fontName);0!==h&&(l.angle=h*(180/Math.PI));let v=!1;if(e.str.length>1)v=!0;else if(" "!==e.str&&e.transform[0]!==e.transform[3]){const t=Math.abs(e.transform[0]),n=Math.abs(e.transform[3]);t!==n&&Math.max(t,n)/Math.min(t,n)>1.5&&(v=!0)}v&&(l.canvasWidth=d.vertical?e.height:e.width);t._textDivProperties.set(r,l);t._isReadableStream&&t._layoutText(r)}function layout(t){const{div:e,scale:n,properties:i,ctx:r,prevFontSize:s,prevFontFamily:a}=t,{style:o}=e;let l="";if(0!==i.canvasWidth&&i.hasText){const{fontFamily:c}=o,{canvasWidth:h,fontSize:d}=i;if(s!==d||a!==c){r.font=`${d*n}px ${c}`;t.prevFontSize=d;t.prevFontFamily=c}const{width:u}=r.measureText(e.textContent);u>0&&(l=`scaleX(${h*n/u})`)}0!==i.angle&&(l=`rotate(${i.angle}deg) ${l}`);l.length>0&&(o.transform=l)}class TextLayerRenderTask{constructor(t){let{textContentSource:e,container:n,viewport:s,textDivs:a,textDivProperties:o,textContentItemsStr:l,isOffscreenCanvasSupported:c}=t;this._textContentSource=e;this._isReadableStream=e instanceof ReadableStream;this._container=this._rootContainer=n;this._textDivs=a||[];this._textContentItemsStr=l||[];this._isOffscreenCanvasSupported=c;this._fontInspectorEnabled=!!globalThis.FontInspector?.enabled;this._reader=null;this._textDivProperties=o||new WeakMap;this._canceled=!1;this._capability=new i.PromiseCapability;this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:s.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:getCtx(0,c)};const{pageWidth:h,pageHeight:d,pageX:u,pageY:p}=s.rawDims;this._transform=[1,0,0,-1,-u,p+d];this._pageWidth=h;this._pageHeight=d;(0,r.setLayerDimensions)(n,s);this._capability.promise.finally((()=>{this._layoutTextParams=null})).catch((()=>{}))}get promise(){return this._capability.promise}cancel(){this._canceled=!0;if(this._reader){this._reader.cancel(new i.AbortException("TextLayer task cancelled.")).catch((()=>{}));this._reader=null}this._capability.reject(new i.AbortException("TextLayer task cancelled."))}_processItems(t,e){for(const n of t)if(void 0!==n.str){this._textContentItemsStr.push(n.str);appendText(this,n,e)}else if("beginMarkedContentProps"===n.type||"beginMarkedContent"===n.type){const t=this._container;this._container=document.createElement("span");this._container.classList.add("markedContent");null!==n.id&&this._container.setAttribute("id",`${n.id}`);t.append(this._container)}else"endMarkedContent"===n.type&&(this._container=this._container.parentNode)}_layoutText(t){const e=this._layoutTextParams.properties=this._textDivProperties.get(t);this._layoutTextParams.div=t;layout(this._layoutTextParams);e.hasText&&this._container.append(t);if(e.hasEOL){const t=document.createElement("br");t.setAttribute("role","presentation");this._container.append(t)}}_render(){const t=new i.PromiseCapability;let e=Object.create(null);if(this._isReadableStream){const pump=()=>{this._reader.read().then((n=>{let{value:i,done:r}=n;if(r)t.resolve();else{Object.assign(e,i.styles);this._processItems(i.items,e);pump()}}),t.reject)};this._reader=this._textContentSource.getReader();pump()}else{if(!this._textContentSource)throw new Error('No "textContentSource" parameter specified.');{const{items:e,styles:n}=this._textContentSource;this._processItems(e,n);t.resolve()}}t.promise.then((()=>{e=null;!function render(t){if(t._canceled)return;const e=t._textDivs,n=t._capability;if(e.length>1e5)n.resolve();else{if(!t._isReadableStream)for(const n of e)t._layoutText(n);n.resolve()}}(this)}),this._capability.reject)}}e.TextLayerRenderTask=TextLayerRenderTask},(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0});e.AnnotationEditorLayer=void 0;n(125);n(136);n(138);n(141);n(143);n(145);n(147);var i=n(1),r=n(164),s=n(197),a=n(202),o=n(168),l=n(203);class AnnotationEditorLayer{#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){let{uiManager:e,pageIndex:n,div:i,accessibilityManager:r,annotationLayer:o,viewport:c,l10n:h}=t;const d=[s.FreeTextEditor,a.InkEditor,l.StampEditor];if(!AnnotationEditorLayer._initialized){AnnotationEditorLayer._initialized=!0;for(const t of d)t.initialize(h)}e.registerEditorTypes(d);this.#Fe=e;this.pageIndex=n;this.div=i;this.#Se=r;this.#xe=o;this.viewport=c;this.#Fe.addLayer(this)}get isEmpty(){return 0===this.#Te.size}updateToolbar(t){this.#Fe.updateToolbar(t)}updateMode(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.#Fe.getMode();this.#Re();if(t===i.AnnotationEditorType.INK){this.addInkEditorIfNeeded(!1);this.disableClick()}else this.enableClick();if(t!==i.AnnotationEditorType.NONE){this.div.classList.toggle("freeTextEditing",t===i.AnnotationEditorType.FREETEXT);this.div.classList.toggle("inkEditing",t===i.AnnotationEditorType.INK);this.div.classList.toggle("stampEditing",t===i.AnnotationEditorType.STAMP);this.div.hidden=!1}}addInkEditorIfNeeded(t){if(!t&&this.#Fe.getMode()!==i.AnnotationEditorType.INK)return;if(!t)for(const t of this.#Te.values())if(t.isEmpty()){t.setInBackground();return}this.#De({offsetX:0,offsetY:0},!1).setInBackground()}setEditingState(t){this.#Fe.setEditingState(t)}addCommands(t){this.#Fe.addCommands(t)}enable(){this.div.style.pointerEvents="auto";const t=new Set;for(const e of this.#Te.values()){e.enableEditing();e.annotationElementId&&t.add(e.annotationElementId)}if(!this.#xe)return;const e=this.#xe.getEditableAnnotations();for(const n of e){n.hide();if(this.#Fe.isDeletedAnnotationElement(n.data.id))continue;if(t.has(n.data.id))continue;const e=this.deserialize(n);if(e){this.addOrRebuild(e);e.enableEditing()}}}disable(){this.#Me=!0;this.div.style.pointerEvents="none";const t=new Set;for(const e of this.#Te.values()){e.disableEditing();if(e.annotationElementId&&null===e.serialize()){this.getEditableAnnotation(e.annotationElementId)?.show();e.remove()}else t.add(e.annotationElementId)}if(this.#xe){const e=this.#xe.getEditableAnnotations();for(const n of e){const{id:e}=n.data;t.has(e)||this.#Fe.isDeletedAnnotationElement(e)||n.show()}}this.#Re();this.isEmpty&&(this.div.hidden=!0);this.#Me=!1}getEditableAnnotation(t){return this.#xe?.getEditableAnnotation(t)||null}setActiveEditor(t){this.#Fe.getActive()!==t&&this.#Fe.setActiveEditor(t)}enableClick(){this.div.addEventListener("pointerdown",this.#Ce);this.div.addEventListener("pointerup",this.#we)}disableClick(){this.div.removeEventListener("pointerdown",this.#Ce);this.div.removeEventListener("pointerup",this.#we)}attach(t){this.#Te.set(t.id,t);const{annotationElementId:e}=t;e&&this.#Fe.isDeletedAnnotationElement(e)&&this.#Fe.removeDeletedAnnotationElement(t)}detach(t){this.#Te.delete(t.id);this.#Se?.removePointerInTextLayer(t.contentDiv);!this.#Me&&t.annotationElementId&&this.#Fe.addDeletedAnnotationElement(t)}remove(t){this.detach(t);this.#Fe.removeEditor(t);t.div.contains(document.activeElement)&&setTimeout((()=>{this.#Fe.focusMainContainer()}),0);t.div.remove();t.isAttachedToDOM=!1;this.#ke||this.addInkEditorIfNeeded(!1)}changeParent(t){if(t.parent!==this){if(t.annotationElementId){this.#Fe.addDeletedAnnotationElement(t.annotationElementId);r.AnnotationEditor.deleteAnnotationElement(t);t.annotationElementId=null}this.attach(t);t.parent?.detach(t);t.setParent(this);if(t.div&&t.isAttachedToDOM){t.div.remove();this.div.append(t.div)}}}add(t){this.changeParent(t);this.#Fe.addEditor(t);this.attach(t);if(!t.isAttachedToDOM){const e=t.render();this.div.append(e);t.isAttachedToDOM=!0}t.fixAndSetPosition();t.onceAdded();this.#Fe.addToAnnotationStorage(t)}moveEditorInDOM(t){if(!t.isAttachedToDOM)return;const{activeElement:e}=document;if(t.div.contains(e)){t._focusEventsAllowed=!1;setTimeout((()=>{if(t.div.contains(document.activeElement))t._focusEventsAllowed=!0;else{t.div.addEventListener("focusin",(()=>{t._focusEventsAllowed=!0}),{once:!0});e.focus()}}),0)}t._structTreeParentId=this.#Se?.moveElementInDOM(this.div,t.div,t.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 s.FreeTextEditor(t);case i.AnnotationEditorType.INK:return new a.InkEditor(t);case i.AnnotationEditorType.STAMP:return new l.StampEditor(t)}return null}pasteEditor(t,e){this.#Fe.updateToolbar(t);this.#Fe.updateMode(t);const{offsetX:n,offsetY:i}=this.#Oe(),r=this.getNextId(),s=this.#Ie({parent:this,id:r,x:n,y:i,uiManager:this.#Fe,isCentered:!0,...e});s&&this.add(s)}deserialize(t){switch(t.annotationType??t.annotationEditorType){case i.AnnotationEditorType.FREETEXT:return s.FreeTextEditor.deserialize(t,this,this.#Fe);case i.AnnotationEditorType.INK:return a.InkEditor.deserialize(t,this,this.#Fe);case i.AnnotationEditorType.STAMP:return l.StampEditor.deserialize(t,this,this.#Fe)}return null}#De(t,e){const n=this.getNextId(),i=this.#Ie({parent:this,id:n,x:t.offsetX,y:t.offsetY,uiManager:this.#Fe,isCentered:e});i&&this.add(i);return i}#Oe(){const{x:t,y:e,width:n,height:i}=this.div.getBoundingClientRect(),r=Math.max(0,t),s=Math.max(0,e),a=(r+Math.min(window.innerWidth,t+n))/2-t,o=(s+Math.min(window.innerHeight,e+i))/2-e,[l,c]=this.viewport.rotation%180==0?[a,o]:[o,a];return{offsetX:l,offsetY:c}}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){const{isMac:e}=i.FeatureTest.platform;if(!(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){if(this.#Pe){this.#Pe=!1;return}const{isMac:e}=i.FeatureTest.platform;if(0!==t.button||t.ctrlKey&&e)return;if(t.target!==this.div)return;this.#Pe=!0;const n=this.#Fe.getActive();this.#Ee=!n||n.isEmpty()}findNewParent(t,e,n){const i=this.#Fe.findParent(e,n);if(null===i||i===this)return!1;i.changeParent(t);return!0}destroy(){if(this.#Fe.getActive()?.parent===this){this.#Fe.commitOrRemove();this.#Fe.setActiveEditor(null)}for(const 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(const t of this.#Te.values())t.isEmpty()&&t.remove();this.#ke=!1}render(t){let{viewport:e}=t;this.viewport=e;(0,o.setLayerDimensions)(this.div,e);for(const t of this.#Fe.getEditors(this.pageIndex))this.add(t);this.updateMode()}update(t){let{viewport:e}=t;this.#Fe.commitOrRemove();this.viewport=e;(0,o.setLayerDimensions)(this.div,{rotation:e.rotation});this.updateMode()}get pageDimensions(){const{pageWidth:t,pageHeight:e}=this.viewport.rawDims;return[t,e]}}e.AnnotationEditorLayer=AnnotationEditorLayer},(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0});e.FreeTextEditor=void 0;n(89);var i=n(1),r=n(165),s=n(164),a=n(198);class FreeTextEditor extends s.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(){const t=FreeTextEditor.prototype,arrowChecker=t=>t.isEmpty(),e=r.AnnotationEditorUIManager.TRANSLATE_SMALL,n=r.AnnotationEditorUIManager.TRANSLATE_BIG;return(0,i.shadow)(this,"_keyboardManager",new r.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:[-e,0],checker:arrowChecker}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t._translateEmpty,{args:[-n,0],checker:arrowChecker}],[["ArrowRight","mac+ArrowRight"],t._translateEmpty,{args:[e,0],checker:arrowChecker}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t._translateEmpty,{args:[n,0],checker:arrowChecker}],[["ArrowUp","mac+ArrowUp"],t._translateEmpty,{args:[0,-e],checker:arrowChecker}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t._translateEmpty,{args:[0,-n],checker:arrowChecker}],[["ArrowDown","mac+ArrowDown"],t._translateEmpty,{args:[0,e],checker:arrowChecker}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t._translateEmpty,{args:[0,n],checker:arrowChecker}]]))}static _type="freetext";constructor(t){super({...t,name:"freeTextEditor"});this.#Ue=t.color||FreeTextEditor._defaultColor||s.AnnotationEditor._defaultLineColor;this.#He=t.fontSize||FreeTextEditor._defaultFontSize}static initialize(t){s.AnnotationEditor.initialize(t,{strings:["free_text2_default_content","editor_free_text2_aria_label"]});const e=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(e.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,e){switch(t){case i.AnnotationEditorParamsType.FREETEXT_SIZE:FreeTextEditor._defaultFontSize=e;break;case i.AnnotationEditorParamsType.FREETEXT_COLOR:FreeTextEditor._defaultColor=e}}updateParams(t,e){switch(t){case i.AnnotationEditorParamsType.FREETEXT_SIZE:this.#Ge(e);break;case i.AnnotationEditorParamsType.FREETEXT_COLOR:this.#Ve(e)}}static get defaultPropertiesToUpdate(){return[[i.AnnotationEditorParamsType.FREETEXT_SIZE,FreeTextEditor._defaultFontSize],[i.AnnotationEditorParamsType.FREETEXT_COLOR,FreeTextEditor._defaultColor||s.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[i.AnnotationEditorParamsType.FREETEXT_SIZE,this.#He],[i.AnnotationEditorParamsType.FREETEXT_COLOR,this.#Ue]]}#Ge(t){const setFontsize=t=>{this.editorDiv.style.fontSize=`calc(${t}px * var(--scale-factor))`;this.translate(0,-(t-this.#He)*this.parentScale);this.#He=t;this.#$e()},e=this.#He;this.addCommands({cmd:()=>{setFontsize(t)},undo:()=>{setFontsize(e)},mustExec:!0,type:i.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}#Ve(t){const e=this.#Ue;this.addCommands({cmd:()=>{this.#Ue=this.editorDiv.style.color=t},undo:()=>{this.#Ue=this.editorDiv.style.color=e},mustExec:!0,type:i.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(t,e){this._uiManager.translateSelectedEditors(t,e,!0)}getInitialTranslation(){const t=this.parentScale;return[-FreeTextEditor._internalPadding*t,-(FreeTextEditor._internalPadding+this.#He)*t]}rebuild(){if(this.parent){super.rebuild();null!==this.div&&(this.isAttachedToDOM||this.parent.add(this))}}enableEditMode(){if(!this.isInEditMode()){this.parent.setEditingState(!1);this.parent.updateToolbar(i.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(){if(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){if(this._focusEventsAllowed){super.focusin(t);t.target!==this.editorDiv&&this.editorDiv.focus()}}onceAdded(){if(this.width)this.#Xe();else{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;if(this.parent){this.parent.setEditingState(!0);this.parent.div.classList.add("freeTextEditing")}super.remove()}#Ke(){const t=this.editorDiv.getElementsByTagName("div");if(0===t.length)return this.editorDiv.innerText;const e=[];for(const n of t)e.push(n.innerText.replace(/\r\n?|\n/,""));return e.join("\n")}#$e(){const[t,e]=this.parentDimensions;let n;if(this.isAttachedToDOM)n=this.div.getBoundingClientRect();else{const{currentLayer:t,div:e}=this,i=e.style.display;e.style.display="hidden";t.div.append(this.div);n=e.getBoundingClientRect();e.remove();e.style.display=i}if(this.rotation%180==this.parentRotation%180){this.width=n.width/t;this.height=n.height/e}else{this.width=n.height/t;this.height=n.width/e}this.fixAndSetPosition()}commit(){if(!this.isInEditMode())return;super.commit();this.disableEditMode();const t=this.#ze,e=this.#ze=this.#Ke().trimEnd();if(t===e)return;const setText=t=>{this.#ze=t;if(t){this.#Ye();this._uiManager.rebuild(this);this.#$e()}else this.remove()};this.addCommands({cmd:()=>{setText(e)},undo:()=>{setText(t)},mustExec:!1});this.#$e()}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode();this.editorDiv.focus()}dblclick(t){this.enterInEditMode()}keydown(t){if(t.target===this.div&&"Enter"===t.key){this.enterInEditMode();t.preventDefault()}}editorDivKeydown(t){FreeTextEditor._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)return this.div;let t,e;if(this.width){t=this.x;e=this.y}super.render();this.editorDiv=document.createElement("div");this.editorDiv.className="internal";this.editorDiv.setAttribute("id",this.#We);this.enableEditing();s.AnnotationEditor._l10nPromise.get("editor_free_text2_aria_label").then((t=>this.editorDiv?.setAttribute("aria-label",t)));s.AnnotationEditor._l10nPromise.get("free_text2_default_content").then((t=>this.editorDiv?.setAttribute("default-content",t)));this.editorDiv.contentEditable=!0;const{style:n}=this.editorDiv;n.fontSize=`calc(${this.#He}px * var(--scale-factor))`;n.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,r.bindEvents)(this,this.div,["dblclick","keydown"]);if(this.width){const[n,i]=this.parentDimensions;if(this.annotationElementId){const{position:r}=this.#qe;let[s,a]=this.getInitialTranslation();[s,a]=this.pageTranslationToScreen(s,a);const[o,l]=this.pageDimensions,[c,h]=this.pageTranslation;let d,u;switch(this.rotation){case 0:d=t+(r[0]-c)/o;u=e+this.height-(r[1]-h)/l;break;case 90:d=t+(r[0]-c)/o;u=e-(r[1]-h)/l;[s,a]=[a,-s];break;case 180:d=t-this.width+(r[0]-c)/o;u=e-(r[1]-h)/l;[s,a]=[-s,-a];break;case 270:d=t+(r[0]-c-this.height*l)/o;u=e+(r[1]-h-this.width*o)/l;[s,a]=[-a,s]}this.setAt(d*n,u*i,s,a)}else this.setAt(t*n,e*i,this.width*n,this.height*i);this.#Ye();this._isDraggable=!0;this.editorDiv.contentEditable=!1}else{this._isDraggable=!1;this.editorDiv.contentEditable=!0}return this.div}#Ye(){this.editorDiv.replaceChildren();if(this.#ze)for(const t of this.#ze.split("\n")){const e=document.createElement("div");e.append(t?document.createTextNode(t):document.createElement("br"));this.editorDiv.append(e)}}get contentDiv(){return this.editorDiv}static deserialize(t,e,n){let r=null;if(t instanceof a.FreeTextAnnotationElement){const{data:{defaultAppearanceData:{fontSize:e,fontColor:n},rect:s,rotation:a,id:o},textContent:l,textPosition:c,parent:{page:{pageNumber:h}}}=t;if(!l||0===l.length)return null;r=t={annotationType:i.AnnotationEditorType.FREETEXT,color:Array.from(n),fontSize:e,value:l.join("\n"),position:c,pageIndex:h-1,rect:s,rotation:a,id:o,deleted:!1}}const s=super.deserialize(t,e,n);s.#He=t.fontSize;s.#Ue=i.Util.makeHexColor(...t.color);s.#ze=t.value;s.annotationElementId=t.id||null;s.#qe=r;return s}serialize(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return null;if(this.deleted)return{pageIndex:this.pageIndex,id:this.annotationElementId,deleted:!0};const e=FreeTextEditor._internalPadding*this.parentScale,n=this.getRect(e,e),r=s.AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.#Ue),a={annotationType:i.AnnotationEditorType.FREETEXT,color:r,fontSize:this.#He,value:this.#ze,pageIndex:this.pageIndex,rect:n,rotation:this.rotation,structTreeParentId:this._structTreeParentId};if(t)return a;if(this.annotationElementId&&!this.#Je(a))return null;a.id=this.annotationElementId;return a}#Je(t){const{value:e,fontSize:n,color:i,rect:r,pageIndex:s}=this.#qe;return t.value!==e||t.fontSize!==n||t.rect.some(((t,e)=>Math.abs(t-r[e])>=1))||t.color.some(((t,e)=>t!==i[e]))||t.pageIndex!==s}#Xe(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.annotationElementId)return;this.#$e();if(!t&&(0===this.width||0===this.height)){setTimeout((()=>this.#Xe(!0)),0);return}const e=FreeTextEditor._internalPadding*this.parentScale;this.#qe.rect=this.getRect(e,e)}}e.FreeTextEditor=FreeTextEditor},(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0});e.StampAnnotationElement=e.InkAnnotationElement=e.FreeTextAnnotationElement=e.AnnotationLayer=void 0;n(89);n(125);n(136);n(138);n(141);n(143);n(145);n(147);var i=n(1),r=n(168),s=n(163),a=n(199),o=n(200),l=n(201);const c=1e3,h=new WeakSet;function getRectDims(t){return{width:t[2]-t[0],height:t[3]-t[1]}}class AnnotationElementFactory{static create(t){switch(t.data.annotationType){case i.AnnotationType.LINK:return new LinkAnnotationElement(t);case i.AnnotationType.TEXT:return new TextAnnotationElement(t);case i.AnnotationType.WIDGET:switch(t.data.fieldType){case"Tx":return new TextWidgetAnnotationElement(t);case"Btn":return t.data.radioButton?new RadioButtonWidgetAnnotationElement(t):t.data.checkBox?new CheckboxWidgetAnnotationElement(t):new PushButtonWidgetAnnotationElement(t);case"Ch":return new ChoiceWidgetAnnotationElement(t);case"Sig":return new SignatureWidgetAnnotationElement(t)}return new WidgetAnnotationElement(t);case i.AnnotationType.POPUP:return new PopupAnnotationElement(t);case i.AnnotationType.FREETEXT:return new FreeTextAnnotationElement(t);case i.AnnotationType.LINE:return new LineAnnotationElement(t);case i.AnnotationType.SQUARE:return new SquareAnnotationElement(t);case i.AnnotationType.CIRCLE:return new CircleAnnotationElement(t);case i.AnnotationType.POLYLINE:return new PolylineAnnotationElement(t);case i.AnnotationType.CARET:return new CaretAnnotationElement(t);case i.AnnotationType.INK:return new InkAnnotationElement(t);case i.AnnotationType.POLYGON:return new PolygonAnnotationElement(t);case i.AnnotationType.HIGHLIGHT:return new HighlightAnnotationElement(t);case i.AnnotationType.UNDERLINE:return new UnderlineAnnotationElement(t);case i.AnnotationType.SQUIGGLY:return new SquigglyAnnotationElement(t);case i.AnnotationType.STRIKEOUT:return new StrikeOutAnnotationElement(t);case i.AnnotationType.STAMP:return new StampAnnotationElement(t);case i.AnnotationType.FILEATTACHMENT:return new FileAttachmentAnnotationElement(t);default:return new AnnotationElement(t)}}}class AnnotationElement{#Qe=!1;constructor(t){let{isRenderable:e=!1,ignoreBorder:n=!1,createQuadrilaterals:i=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.isRenderable=e;this.data=t.data;this.layer=t.layer;this.linkService=t.linkService;this.downloadManager=t.downloadManager;this.imageResourcesPath=t.imageResourcesPath;this.renderForms=t.renderForms;this.svgFactory=t.svgFactory;this.annotationStorage=t.annotationStorage;this.enableScripting=t.enableScripting;this.hasJSActions=t.hasJSActions;this._fieldObjects=t.fieldObjects;this.parent=t.parent;e&&(this.container=this._createContainer(n));i&&this._createQuadrilaterals()}static _hasPopupData(t){let{titleObj:e,contentsObj:n,richText:i}=t;return!!(e?.str||n?.str||i?.str)}get hasPopupData(){return AnnotationElement._hasPopupData(this.data)}_createContainer(t){const{data:e,parent:{page:n,viewport:r}}=this,s=document.createElement("section");s.setAttribute("data-annotation-id",e.id);this instanceof WidgetAnnotationElement||(s.tabIndex=c);s.style.zIndex=this.parent.zIndex++;this.data.popupRef&&s.setAttribute("aria-haspopup","dialog");e.noRotate&&s.classList.add("norotate");const{pageWidth:a,pageHeight:o,pageX:l,pageY:h}=r.rawDims;if(!e.rect||this instanceof PopupAnnotationElement){const{rotation:t}=e;e.hasOwnCanvas||0===t||this.setRotation(t,s);return s}const{width:d,height:u}=getRectDims(e.rect),p=i.Util.normalizeRect([e.rect[0],n.view[3]-e.rect[1]+n.view[1],e.rect[2],n.view[3]-e.rect[3]+n.view[1]]);if(!t&&e.borderStyle.width>0){s.style.borderWidth=`${e.borderStyle.width}px`;const t=e.borderStyle.horizontalCornerRadius,n=e.borderStyle.verticalCornerRadius;if(t>0||n>0){const e=`calc(${t}px * var(--scale-factor)) / calc(${n}px * var(--scale-factor))`;s.style.borderRadius=e}else if(this instanceof RadioButtonWidgetAnnotationElement){const t=`calc(${d}px * var(--scale-factor)) / calc(${u}px * var(--scale-factor))`;s.style.borderRadius=t}switch(e.borderStyle.style){case i.AnnotationBorderStyleType.SOLID:s.style.borderStyle="solid";break;case i.AnnotationBorderStyleType.DASHED:s.style.borderStyle="dashed";break;case i.AnnotationBorderStyleType.BEVELED:(0,i.warn)("Unimplemented border style: beveled");break;case i.AnnotationBorderStyleType.INSET:(0,i.warn)("Unimplemented border style: inset");break;case i.AnnotationBorderStyleType.UNDERLINE:s.style.borderBottomStyle="solid"}const r=e.borderColor||null;if(r){this.#Qe=!0;s.style.borderColor=i.Util.makeHexColor(0|r[0],0|r[1],0|r[2])}else s.style.borderWidth=0}s.style.left=100*(p[0]-l)/a+"%";s.style.top=100*(p[1]-h)/o+"%";const{rotation:f}=e;if(e.hasOwnCanvas||0===f){s.style.width=100*d/a+"%";s.style.height=100*u/o+"%"}else this.setRotation(f,s);return s}setRotation(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.container;if(!this.data.rect)return;const{pageWidth:n,pageHeight:i}=this.parent.viewport.rawDims,{width:r,height:s}=getRectDims(this.data.rect);let a,o;if(t%180==0){a=100*r/n;o=100*s/i}else{a=100*s/n;o=100*r/i}e.style.width=`${a}%`;e.style.height=`${o}%`;e.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const setColor=(t,e,n)=>{const i=n.detail[t],r=i[0],s=i.slice(1);n.target.style[e]=a.ColorConverters[`${r}_HTML`](s);this.annotationStorage.setValue(this.data.id,{[e]:a.ColorConverters[`${r}_rgb`](s)})};return(0,i.shadow)(this,"_commonActions",{display:t=>{const{display:e}=t.detail,n=e%2==1;this.container.style.visibility=n?"hidden":"visible";this.annotationStorage.setValue(this.data.id,{noView:n,noPrint:1===e||2===e})},print:t=>{this.annotationStorage.setValue(this.data.id,{noPrint:!t.detail.print})},hidden:t=>{const{hidden:e}=t.detail;this.container.style.visibility=e?"hidden":"visible";this.annotationStorage.setValue(this.data.id,{noPrint:e,noView:e})},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=>{setColor("bgColor","backgroundColor",t)},fillColor:t=>{setColor("fillColor","backgroundColor",t)},fgColor:t=>{setColor("fgColor","color",t)},textColor:t=>{setColor("textColor","color",t)},borderColor:t=>{setColor("borderColor","borderColor",t)},strokeColor:t=>{setColor("strokeColor","borderColor",t)},rotation:t=>{const e=t.detail.rotation;this.setRotation(e);this.annotationStorage.setValue(this.data.id,{rotation:e})}})}_dispatchEventFromSandbox(t,e){const n=this._commonActions;for(const i of Object.keys(e.detail)){const r=t[i]||n[i];r?.(e)}}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const e=this.annotationStorage.getRawValue(this.data.id);if(!e)return;const n=this._commonActions;for(const[i,r]of Object.entries(e)){const s=n[i];if(s){s({detail:{[i]:r},target:t});delete e[i]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:t}=this.data;if(!t)return;const[e,n,i,r]=this.data.rect;if(1===t.length){const[,{x:s,y:a},{x:o,y:l}]=t[0];if(i===s&&r===a&&e===o&&n===l)return}const{style:s}=this.container;let a;if(this.#Qe){const{borderColor:t,borderWidth:e}=s;s.borderWidth=0;a=["url('data:image/svg+xml;utf8,",'',``];this.container.classList.add("hasBorder")}const o=i-e,l=r-n,{svgFactory:c}=this,h=c.createElement("svg");h.classList.add("quadrilateralsContainer");h.setAttribute("width",0);h.setAttribute("height",0);const d=c.createElement("defs");h.append(d);const u=c.createElement("clipPath"),p=`clippath_${this.data.id}`;u.setAttribute("id",p);u.setAttribute("clipPathUnits","objectBoundingBox");d.append(u);for(const[,{x:n,y:i},{x:s,y:h}]of t){const t=c.createElement("rect"),d=(s-e)/o,p=(r-i)/l,f=(n-s)/o,g=(i-h)/l;t.setAttribute("x",d);t.setAttribute("y",p);t.setAttribute("width",f);t.setAttribute("height",g);u.append(t);a?.push(``)}if(this.#Qe){a.push("')");s.backgroundImage=a.join("")}this.container.append(h);this.container.style.clipPath=`url(#${p})`}_createPopup(){const{container:t,data:e}=this;t.setAttribute("aria-haspopup","dialog");const n=new PopupAnnotationElement({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(n.render())}render(){(0,i.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=[];if(this._fieldObjects){const r=this._fieldObjects[t];if(r)for(const{page:t,id:s,exportValues:a}of r){if(-1===t)continue;if(s===e)continue;const r="string"==typeof a?a:null,o=document.querySelector(`[data-element-id="${s}"]`);!o||h.has(o)?n.push({id:s,exportValue:r,domElement:o}):(0,i.warn)(`_getElementsByName - element not allowed: ${s}`)}return n}for(const i of document.getElementsByName(t)){const{exportValue:t}=i,r=i.getAttribute("data-element-id");r!==e&&(h.has(i)&&n.push({id:r,exportValue:t,domElement:i}))}return n}show(){this.container&&(this.container.hidden=!1);this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0);this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const t=this.getElementsToTriggerPopup();if(Array.isArray(t))for(const e of t)e.classList.add("highlightArea");else t.classList.add("highlightArea")}_editOnDoubleClick(){const{annotationEditorType:t,data:{id:e}}=this;this.container.addEventListener("dblclick",(()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:t,editId:e})}))}}class LinkAnnotationElement extends AnnotationElement{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;super(t,{isRenderable:!0,ignoreBorder:!!e?.ignoreBorder,createQuadrilaterals:!0});this.isTooltipOnly=t.data.isTooltipOnly}render(){const{data:t,linkService:e}=this,n=document.createElement("a");n.setAttribute("data-element-id",t.id);let i=!1;if(t.url){e.addLinkAttributes(n,t.url,t.newWindow);i=!0}else if(t.action){this._bindNamedAction(n,t.action);i=!0}else if(t.attachment){this._bindAttachment(n,t.attachment);i=!0}else if(t.setOCGState){this.#Ze(n,t.setOCGState);i=!0}else if(t.dest){this._bindLink(n,t.dest);i=!0}else{if(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions){this._bindJSAction(n,t);i=!0}if(t.resetForm){this._bindResetFormAction(n,t.resetForm);i=!0}else if(this.isTooltipOnly&&!i){this._bindLink(n,"");i=!0}}this.container.classList.add("linkAnnotation");i&&this.container.append(n);return this.container}#tn(){this.container.setAttribute("data-internal-link","")}_bindLink(t,e){t.href=this.linkService.getDestinationHash(e);t.onclick=()=>{e&&this.linkService.goToDestination(e);return!1};(e||""===e)&&this.#tn()}_bindNamedAction(t,e){t.href=this.linkService.getAnchorUrl("");t.onclick=()=>{this.linkService.executeNamedAction(e);return!1};this.#tn()}_bindAttachment(t,e){t.href=this.linkService.getAnchorUrl("");t.onclick=()=>{this.downloadManager?.openOrDownloadData(this.container,e.content,e.filename);return!1};this.#tn()}#Ze(t,e){t.href=this.linkService.getAnchorUrl("");t.onclick=()=>{this.linkService.executeSetOCGState(e);return!1};this.#tn()}_bindJSAction(t,e){t.href=this.linkService.getAnchorUrl("");const n=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const i of Object.keys(e.actions)){const r=n.get(i);r&&(t[r]=()=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e.id,name:i}});return!1})}t.onclick||(t.onclick=()=>!1);this.#tn()}_bindResetFormAction(t,e){const n=t.onclick;n||(t.href=this.linkService.getAnchorUrl(""));this.#tn();if(this._fieldObjects)t.onclick=()=>{n?.();const{fields:t,refs:r,include:s}=e,a=[];if(0!==t.length||0!==r.length){const e=new Set(r);for(const n of t){const t=this._fieldObjects[n]||[];for(const{id:n}of t)e.add(n)}for(const t of Object.values(this._fieldObjects))for(const n of t)e.has(n.id)===s&&a.push(n)}else for(const t of Object.values(this._fieldObjects))a.push(...t);const o=this.annotationStorage,l=[];for(const t of a){const{id:e}=t;l.push(e);switch(t.type){case"text":{const n=t.defaultValue||"";o.setValue(e,{value:n});break}case"checkbox":case"radiobutton":{const n=t.defaultValue===t.exportValues;o.setValue(e,{value:n});break}case"combobox":case"listbox":{const n=t.defaultValue||"";o.setValue(e,{value:n});break}default:continue}const n=document.querySelector(`[data-element-id="${e}"]`);n&&(h.has(n)?n.dispatchEvent(new Event("resetform")):(0,i.warn)(`_bindResetFormAction - element not allowed: ${e}`))}this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:l,name:"ResetForm"}});return!1};else{(0,i.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.');n||(t.onclick=()=>!1)}}}class TextAnnotationElement extends AnnotationElement{constructor(t){super(t,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const t=document.createElement("img");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);return this.container}}class WidgetAnnotationElement extends AnnotationElement{render(){this.data.alternativeText&&(this.container.title=this.data.alternativeText);return this.container}showElementAndHideCanvas(t){if(this.data.hasOwnCanvas){"CANVAS"===t.previousSibling?.nodeName&&(t.previousSibling.hidden=!0);t.hidden=!1}}_getKeyModifier(t){const{isWin:e,isMac:n}=i.FeatureTest.platform;return e&&t.ctrlKey||n&&t.metaKey}_setEventListener(t,e,n,i,r){n.includes("mouse")?t.addEventListener(n,(t=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:r(t),shift:t.shiftKey,modifier:this._getKeyModifier(t)}})})):t.addEventListener(n,(t=>{if("blur"===n){if(!e.focused||!t.relatedTarget)return;e.focused=!1}else if("focus"===n){if(e.focused)return;e.focused=!0}r&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:r(t)}})}))}_setEventListeners(t,e,n,i){for(const[r,s]of n)if("Action"===s||this.data.actions?.[s]){"Focus"!==s&&"Blur"!==s||(e||={focused:!1});this._setEventListener(t,e,r,s,i);"Focus"!==s||this.data.actions?.Blur?"Blur"!==s||this.data.actions?.Focus||this._setEventListener(t,e,"focus","Focus",null):this._setEventListener(t,e,"blur","Blur",null)}}_setBackgroundColor(t){const e=this.data.backgroundColor||null;t.style.backgroundColor=null===e?"transparent":i.Util.makeHexColor(e[0],e[1],e[2])}_setTextStyle(t){const e=["left","center","right"],{fontColor:n}=this.data.defaultAppearanceData,r=this.data.defaultAppearanceData.fontSize||9,s=t.style;let a;const roundToOneDecimal=t=>Math.round(10*t)/10;if(this.data.multiLine){const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2),e=t/(Math.round(t/(i.LINE_FACTOR*r))||1);a=Math.min(r,roundToOneDecimal(e/i.LINE_FACTOR))}else{const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2);a=Math.min(r,roundToOneDecimal(t/i.LINE_FACTOR))}s.fontSize=`calc(${a}px * var(--scale-factor))`;s.color=i.Util.makeHexColor(n[0],n[1],n[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 TextWidgetAnnotationElement extends WidgetAnnotationElement{constructor(t){super(t,{isRenderable:t.renderForms||!t.data.hasAppearance&&!!t.data.fieldValue})}setPropertyOnSiblings(t,e,n,i){const r=this.annotationStorage;for(const s of this._getElementsByName(t.name,t.id)){s.domElement&&(s.domElement[e]=n);r.setValue(s.id,{[i]:n})}}render(){const t=this.annotationStorage,e=this.data.id;this.container.classList.add("textWidgetAnnotation");let n=null;if(this.renderForms){const i=t.getValue(e,{value:this.data.fieldValue});let r=i.value||"";const s=t.getValue(e,{charLimit:this.data.maxLen}).charLimit;s&&r.length>s&&(r=r.slice(0,s));let a=i.formattedValue||this.data.textContent?.join("\n")||null;a&&this.data.comb&&(a=a.replaceAll(/\s+/g,""));const o={userValue:r,formattedValue:a,lastCommittedValue:null,commitKey:1,focused:!1};if(this.data.multiLine){n=document.createElement("textarea");n.textContent=a??r;this.data.doNotScroll&&(n.style.overflowY="hidden")}else{n=document.createElement("input");n.type="text";n.setAttribute("value",a??r);this.data.doNotScroll&&(n.style.overflowX="hidden")}this.data.hasOwnCanvas&&(n.hidden=!0);h.add(n);n.setAttribute("data-element-id",e);n.disabled=this.data.readOnly;n.name=this.data.fieldName;n.tabIndex=c;this._setRequired(n,this.data.required);s&&(n.maxLength=s);n.addEventListener("input",(i=>{t.setValue(e,{value:i.target.value});this.setPropertyOnSiblings(n,"value",i.target.value,"value");o.formattedValue=null}));n.addEventListener("resetform",(t=>{const e=this.data.defaultFieldValue??"";n.value=o.userValue=e;o.formattedValue=null}));let blurListener=t=>{const{formattedValue:e}=o;null!=e&&(t.target.value=e);t.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){n.addEventListener("focus",(t=>{if(o.focused)return;const{target:e}=t;o.userValue&&(e.value=o.userValue);o.lastCommittedValue=e.value;o.commitKey=1;o.focused=!0}));n.addEventListener("updatefromsandbox",(n=>{this.showElementAndHideCanvas(n.target);const i={value(n){o.userValue=n.detail.value??"";t.setValue(e,{value:o.userValue.toString()});n.target.value=o.userValue},formattedValue(n){const{formattedValue:i}=n.detail;o.formattedValue=i;null!=i&&n.target!==document.activeElement&&(n.target.value=i);t.setValue(e,{formattedValue:i})},selRange(t){t.target.setSelectionRange(...t.detail.selRange)},charLimit:n=>{const{charLimit:i}=n.detail,{target:r}=n;if(0===i){r.removeAttribute("maxLength");return}r.setAttribute("maxLength",i);let s=o.userValue;if(s&&!(s.length<=i)){s=s.slice(0,i);r.value=o.userValue=s;t.setValue(e,{value:s});this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:s,willCommit:!0,commitKey:1,selStart:r.selectionStart,selEnd:r.selectionEnd}})}}};this._dispatchEventFromSandbox(i,n)}));n.addEventListener("keydown",(t=>{o.commitKey=1;let n=-1;"Escape"===t.key?n=0:"Enter"!==t.key||this.data.multiLine?"Tab"===t.key&&(o.commitKey=3):n=2;if(-1===n)return;const{value:i}=t.target;if(o.lastCommittedValue!==i){o.lastCommittedValue=i;o.userValue=i;this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:i,willCommit:!0,commitKey:n,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}})}}));const i=blurListener;blurListener=null;n.addEventListener("blur",(t=>{if(!o.focused||!t.relatedTarget)return;o.focused=!1;const{value:n}=t.target;o.userValue=n;o.lastCommittedValue!==n&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:n,willCommit:!0,commitKey:o.commitKey,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}});i(t)}));this.data.actions?.Keystroke&&n.addEventListener("beforeinput",(t=>{o.lastCommittedValue=null;const{data:n,target:i}=t,{value:r,selectionStart:s,selectionEnd:a}=i;let l=s,c=a;switch(t.inputType){case"deleteWordBackward":{const t=r.substring(0,s).match(/\w*[^\w]*$/);t&&(l-=t[0].length);break}case"deleteWordForward":{const t=r.substring(s).match(/^[^\w]*\w*/);t&&(c+=t[0].length);break}case"deleteContentBackward":s===a&&(l-=1);break;case"deleteContentForward":s===a&&(c+=1)}t.preventDefault();this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:r,change:n||"",willCommit:!1,selStart:l,selEnd:c}})}));this._setEventListeners(n,o,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.value))}blurListener&&n.addEventListener("blur",blurListener);if(this.data.comb){const t=(this.data.rect[2]-this.data.rect[0])/s;n.classList.add("comb");n.style.letterSpacing=`calc(${t}px * var(--scale-factor) - 1ch)`}}else{n=document.createElement("div");n.textContent=this.data.fieldValue;n.style.verticalAlign="middle";n.style.display="table-cell"}this._setTextStyle(n);this._setBackgroundColor(n);this._setDefaultPropertiesFromJS(n);this.container.append(n);return this.container}}class SignatureWidgetAnnotationElement extends WidgetAnnotationElement{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class CheckboxWidgetAnnotationElement extends WidgetAnnotationElement{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const t=this.annotationStorage,e=this.data,n=e.id;let i=t.getValue(n,{value:e.exportValue===e.fieldValue}).value;if("string"==typeof i){i="Off"!==i;t.setValue(n,{value:i})}this.container.classList.add("buttonWidgetAnnotation","checkBox");const r=document.createElement("input");h.add(r);r.setAttribute("data-element-id",n);r.disabled=e.readOnly;this._setRequired(r,this.data.required);r.type="checkbox";r.name=e.fieldName;i&&r.setAttribute("checked",!0);r.setAttribute("exportValue",e.exportValue);r.tabIndex=c;r.addEventListener("change",(i=>{const{name:r,checked:s}=i.target;for(const i of this._getElementsByName(r,n)){const n=s&&i.exportValue===e.exportValue;i.domElement&&(i.domElement.checked=n);t.setValue(i.id,{value:n})}t.setValue(n,{value:s})}));r.addEventListener("resetform",(t=>{const n=e.defaultFieldValue||"Off";t.target.checked=n===e.exportValue}));if(this.enableScripting&&this.hasJSActions){r.addEventListener("updatefromsandbox",(e=>{const i={value(e){e.target.checked="Off"!==e.detail.value;t.setValue(n,{value:e.target.checked})}};this._dispatchEventFromSandbox(i,e)}));this._setEventListeners(r,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(r);this._setDefaultPropertiesFromJS(r);this.container.append(r);return this.container}}class RadioButtonWidgetAnnotationElement extends WidgetAnnotationElement{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const t=this.annotationStorage,e=this.data,n=e.id;let i=t.getValue(n,{value:e.fieldValue===e.buttonValue}).value;if("string"==typeof i){i=i!==e.buttonValue;t.setValue(n,{value:i})}const r=document.createElement("input");h.add(r);r.setAttribute("data-element-id",n);r.disabled=e.readOnly;this._setRequired(r,this.data.required);r.type="radio";r.name=e.fieldName;i&&r.setAttribute("checked",!0);r.tabIndex=c;r.addEventListener("change",(e=>{const{name:i,checked:r}=e.target;for(const e of this._getElementsByName(i,n))t.setValue(e.id,{value:!1});t.setValue(n,{value:r})}));r.addEventListener("resetform",(t=>{const n=e.defaultFieldValue;t.target.checked=null!=n&&n===e.buttonValue}));if(this.enableScripting&&this.hasJSActions){const i=e.buttonValue;r.addEventListener("updatefromsandbox",(e=>{const r={value:e=>{const r=i===e.detail.value;for(const i of this._getElementsByName(e.target.name)){const e=r&&i.id===n;i.domElement&&(i.domElement.checked=e);t.setValue(i.id,{value:e})}}};this._dispatchEventFromSandbox(r,e)}));this._setEventListeners(r,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(r);this._setDefaultPropertiesFromJS(r);this.container.append(r);return this.container}}class PushButtonWidgetAnnotationElement extends LinkAnnotationElement{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){const t=super.render();t.classList.add("buttonWidgetAnnotation","pushButton");this.data.alternativeText&&(t.title=this.data.alternativeText);const e=t.lastChild;if(this.enableScripting&&this.hasJSActions&&e){this._setDefaultPropertiesFromJS(e);e.addEventListener("updatefromsandbox",(t=>{this._dispatchEventFromSandbox({},t)}))}return t}}class ChoiceWidgetAnnotationElement extends WidgetAnnotationElement{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const t=this.annotationStorage,e=this.data.id,n=t.getValue(e,{value:this.data.fieldValue}),i=document.createElement("select");h.add(i);i.setAttribute("data-element-id",e);i.disabled=this.data.readOnly;this._setRequired(i,this.data.required);i.name=this.data.fieldName;i.tabIndex=c;let r=this.data.combo&&this.data.options.length>0;if(!this.data.combo){i.size=this.data.options.length;this.data.multiSelect&&(i.multiple=!0)}i.addEventListener("resetform",(t=>{const e=this.data.defaultFieldValue;for(const t of i.options)t.selected=t.value===e}));for(const t of this.data.options){const e=document.createElement("option");e.textContent=t.displayValue;e.value=t.exportValue;if(n.value.includes(t.exportValue)){e.setAttribute("selected",!0);r=!1}i.append(e)}let s=null;if(r){const t=document.createElement("option");t.value=" ";t.setAttribute("hidden",!0);t.setAttribute("selected",!0);i.prepend(t);s=()=>{t.remove();i.removeEventListener("input",s);s=null};i.addEventListener("input",s)}const getValue=t=>{const e=t?"value":"textContent",{options:n,multiple:r}=i;return r?Array.prototype.filter.call(n,(t=>t.selected)).map((t=>t[e])):-1===n.selectedIndex?null:n[n.selectedIndex][e]};let a=getValue(!1);const getItems=t=>{const e=t.target.options;return Array.prototype.map.call(e,(t=>({displayValue:t.textContent,exportValue:t.value})))};if(this.enableScripting&&this.hasJSActions){i.addEventListener("updatefromsandbox",(n=>{const r={value(n){s?.();const r=n.detail.value,o=new Set(Array.isArray(r)?r:[r]);for(const t of i.options)t.selected=o.has(t.value);t.setValue(e,{value:getValue(!0)});a=getValue(!1)},multipleSelection(t){i.multiple=!0},remove(n){const r=i.options,s=n.detail.remove;r[s].selected=!1;i.remove(s);if(r.length>0){-1===Array.prototype.findIndex.call(r,(t=>t.selected))&&(r[0].selected=!0)}t.setValue(e,{value:getValue(!0),items:getItems(n)});a=getValue(!1)},clear(n){for(;0!==i.length;)i.remove(0);t.setValue(e,{value:null,items:[]});a=getValue(!1)},insert(n){const{index:r,displayValue:s,exportValue:o}=n.detail.insert,l=i.children[r],c=document.createElement("option");c.textContent=s;c.value=o;l?l.before(c):i.append(c);t.setValue(e,{value:getValue(!0),items:getItems(n)});a=getValue(!1)},items(n){const{items:r}=n.detail;for(;0!==i.length;)i.remove(0);for(const t of r){const{displayValue:e,exportValue:n}=t,r=document.createElement("option");r.textContent=e;r.value=n;i.append(r)}i.options.length>0&&(i.options[0].selected=!0);t.setValue(e,{value:getValue(!0),items:getItems(n)});a=getValue(!1)},indices(n){const i=new Set(n.detail.indices);for(const t of n.target.options)t.selected=i.has(t.index);t.setValue(e,{value:getValue(!0)});a=getValue(!1)},editable(t){t.target.disabled=!t.detail.editable}};this._dispatchEventFromSandbox(r,n)}));i.addEventListener("input",(n=>{const i=getValue(!0);t.setValue(e,{value:i});n.preventDefault();this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:a,changeEx:i,willCommit:!1,commitKey:1,keyDown:!1}})}));this._setEventListeners(i,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))}else i.addEventListener("input",(function(n){t.setValue(e,{value:getValue(!0)})}));this.data.combo&&this._setTextStyle(i);this._setBackgroundColor(i);this._setDefaultPropertiesFromJS(i);this.container.append(i);return this.container}}class PopupAnnotationElement extends AnnotationElement{constructor(t){const{data:e,elements:n}=t;super(t,{isRenderable:AnnotationElement._hasPopupData(e)});this.elements=n}render(){this.container.classList.add("popupAnnotation");const t=new PopupElement({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}),e=[];for(const n of this.elements){n.popup=t;e.push(n.data.id);n.addHighlightArea()}this.container.setAttribute("aria-controls",e.map((t=>`${i.AnnotationPrefix}${t}`)).join(","));return this.container}}class PopupElement{#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){let{container:e,color:n,elements:i,titleObj:s,modificationDate:a,contentsObj:o,richText:l,parent:c,rect:h,parentRect:d,open:u}=t;this.#Rt=e;this.#vn=s;this.#hn=o;this.#bn=l;this.#un=c;this.#Ue=n;this.#mn=h;this.#pn=d;this.#dn=i;const p=r.PDFDateString.toDateObject(a);p&&(this.#en=c.l10n.get("annotation_date_string",{date:p.toLocaleDateString(),time:p.toLocaleTimeString()}));this.trigger=i.flatMap((t=>t.getElementsToTriggerPopup()));for(const t of this.trigger){t.addEventListener("click",this.#ln);t.addEventListener("mouseenter",this.#an);t.addEventListener("mouseleave",this.#rn);t.classList.add("popupTriggerArea")}for(const t of i)t.container?.addEventListener("keydown",this.#nn);this.#Rt.hidden=!0;u&&this.#cn()}render(){if(this.#gn)return;const{page:{view:t},viewport:{rawDims:{pageWidth:e,pageHeight:n,pageX:r,pageY:s}}}=this.#un,a=this.#gn=document.createElement("div");a.className="popup";if(this.#Ue){const t=a.style.outlineColor=i.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{const t=.7;a.style.backgroundColor=i.Util.makeHexColor(...this.#Ue.map((e=>Math.floor(t*(255-e)+e))))}}const o=document.createElement("span");o.className="header";const c=document.createElement("h1");o.append(c);({dir:c.dir,str:c.textContent}=this.#vn);a.append(o);if(this.#en){const t=document.createElement("span");t.classList.add("popupDate");this.#en.then((e=>{t.textContent=e}));o.append(t)}const h=this.#hn,d=this.#bn;if(!d?.str||h?.str&&h.str!==d.str){const t=this._formatContents(h);a.append(t)}else{l.XfaLayer.render({xfaHtml:d.html,intent:"richText",div:a});a.lastChild.classList.add("richText","popupContent")}let u=!!this.#pn,p=u?this.#pn:this.#mn;for(const t of this.#dn)if(!p||null!==i.Util.intersect(t.data.rect,p)){p=t.data.rect;u=!0;break}const f=i.Util.normalizeRect([p[0],t[3]-p[1]+t[1],p[2],t[3]-p[3]+t[1]]),g=u?p[2]-p[0]+5:0,m=f[0]+g,b=f[1],{style:v}=this.#Rt;v.left=100*(m-r)/e+"%";v.top=100*(b-s)/n+"%";this.#Rt.append(a)}_formatContents(t){let{str:e,dir:n}=t;const i=document.createElement("p");i.classList.add("popupContent");i.dir=n;const r=e.split(/(?:\r\n?|\n)/);for(let t=0,e=r.length;t{"Enter"===t.key&&(r?t.metaKey:t.ctrlKey)&&this.#Cn()}));!e.popupRef&&this.hasPopupData?this._createPopup():n.classList.add("popupTriggerArea");t.append(n);return t}getElementsToTriggerPopup(){return this.#wn}addHighlightArea(){this.container.classList.add("highlightArea")}#Cn(){this.downloadManager?.openOrDownloadData(this.container,this.content,this.filename)}}e.AnnotationLayer=class AnnotationLayer{#Se=null;#Tn=null;#Pn=new Map;constructor(t){let{div:e,accessibilityManager:n,annotationCanvasMap:i,l10n:r,page:s,viewport:a}=t;this.div=e;this.#Se=n;this.#Tn=i;this.l10n=r;this.page=s;this.viewport=a;this.zIndex=0;this.l10n||=o.NullL10n}#kn(t,e){const n=t.firstChild||t;n.id=`${i.AnnotationPrefix}${e}`;this.div.append(t);this.#Se?.moveElementInDOM(this.div,t,n,!1)}async render(t){const{annotations:e}=t,n=this.div;(0,r.setLayerDimensions)(n,this.viewport);const a=new Map,o={data:null,layer:n,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:!1!==t.renderForms,svgFactory:new r.DOMSVGFactory,annotationStorage:t.annotationStorage||new s.AnnotationStorage,enableScripting:!0===t.enableScripting,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(const t of e){if(t.noHTML)continue;const e=t.annotationType===i.AnnotationType.POPUP;if(e){const e=a.get(t.id);if(!e)continue;o.elements=e}else{const{width:e,height:n}=getRectDims(t.rect);if(e<=0||n<=0)continue}o.data=t;const n=AnnotationElementFactory.create(o);if(!n.isRenderable)continue;if(!e&&t.popupRef){const e=a.get(t.popupRef);e?e.push(n):a.set(t.popupRef,[n])}n.annotationEditorType>0&&this.#Pn.set(n.data.id,n);const r=n.render();t.hidden&&(r.style.visibility="hidden");this.#kn(r,t.id)}this.#Mn();await this.l10n.translate(n)}update(t){let{viewport:e}=t;const n=this.div;this.viewport=e;(0,r.setLayerDimensions)(n,{rotation:e.rotation});this.#Mn();n.hidden=!1}#Mn(){if(!this.#Tn)return;const t=this.div;for(const[e,n]of this.#Tn){const i=t.querySelector(`[data-annotation-id="${e}"]`);if(!i)continue;const{firstChild:r}=i;r?"CANVAS"===r.nodeName?r.replaceWith(n):r.before(n):i.append(n)}this.#Tn.clear()}getEditableAnnotations(){return Array.from(this.#Pn.values())}getEditableAnnotation(t){return this.#Pn.get(t)}}},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0});e.ColorConverters=void 0;function makeColorComp(t){return Math.floor(255*Math.max(0,Math.min(1,t))).toString(16).padStart(2,"0")}function scaleAndClamp(t){return Math.max(0,Math.min(255,255*t))}e.ColorConverters=class ColorConverters{static CMYK_G(t){let[e,n,i,r]=t;return["G",1-Math.min(1,.3*e+.59*i+.11*n+r)]}static G_CMYK(t){let[e]=t;return["CMYK",0,0,0,1-e]}static G_RGB(t){let[e]=t;return["RGB",e,e,e]}static G_rgb(t){let[e]=t;e=scaleAndClamp(e);return[e,e,e]}static G_HTML(t){let[e]=t;const n=makeColorComp(e);return`#${n}${n}${n}`}static RGB_G(t){let[e,n,i]=t;return["G",.3*e+.59*n+.11*i]}static RGB_rgb(t){return t.map(scaleAndClamp)}static RGB_HTML(t){return`#${t.map(makeColorComp).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB(t){let[e,n,i,r]=t;return["RGB",1-Math.min(1,e+r),1-Math.min(1,i+r),1-Math.min(1,n+r)]}static CMYK_rgb(t){let[e,n,i,r]=t;return[scaleAndClamp(1-Math.min(1,e+r)),scaleAndClamp(1-Math.min(1,i+r)),scaleAndClamp(1-Math.min(1,n+r))]}static CMYK_HTML(t){const e=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(e)}static RGB_CMYK(t){let[e,n,i]=t;const r=1-e,s=1-n,a=1-i;return["CMYK",r,s,a,Math.min(r,s,a)]}}},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0});e.NullL10n=void 0;e.getL10nFallback=getL10nFallback;const n={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 getL10nFallback(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 n[t]||""}const i={getLanguage:async()=>"en-us",getDirection:async()=>"ltr",async get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function formatL10nValue(t,e){return e?t.replaceAll(/\{\{\s*(\w+)\s*\}\}/g,((t,n)=>n in e?e[n]:"{{"+n+"}}")):t}(arguments.length>2&&void 0!==arguments[2]?arguments[2]:getL10nFallback(t,e),e)},async translate(t){}};e.NullL10n=i},(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0});e.XfaLayer=void 0;n(89);var i=n(194);e.XfaLayer=class XfaLayer{static setupStorage(t,e,n,i,r){const s=i.getValue(e,{value:null});switch(n.name){case"textarea":null!==s.value&&(t.textContent=s.value);if("print"===r)break;t.addEventListener("input",(t=>{i.setValue(e,{value:t.target.value})}));break;case"input":if("radio"===n.attributes.type||"checkbox"===n.attributes.type){s.value===n.attributes.xfaOn?t.setAttribute("checked",!0):s.value===n.attributes.xfaOff&&t.removeAttribute("checked");if("print"===r)break;t.addEventListener("change",(t=>{i.setValue(e,{value:t.target.checked?t.target.getAttribute("xfaOn"):t.target.getAttribute("xfaOff")})}))}else{null!==s.value&&t.setAttribute("value",s.value);if("print"===r)break;t.addEventListener("input",(t=>{i.setValue(e,{value:t.target.value})}))}break;case"select":if(null!==s.value){t.setAttribute("value",s.value);for(const t of n.children)t.attributes.value===s.value?t.attributes.selected=!0:t.attributes.hasOwnProperty("selected")&&delete t.attributes.selected}t.addEventListener("input",(t=>{const n=t.target.options,r=-1===n.selectedIndex?"":n[n.selectedIndex].value;i.setValue(e,{value:r})}))}}static setAttributes(t){let{html:e,element:n,storage:i=null,intent:r,linkService:s}=t;const{attributes:a}=n,o=e instanceof HTMLAnchorElement;"radio"===a.type&&(a.name=`${a.name}-${r}`);for(const[t,n]of Object.entries(a))if(null!=n)switch(t){case"class":n.length&&e.setAttribute(t,n.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",n);break;case"style":Object.assign(e.style,n);break;case"textContent":e.textContent=n;break;default:(!o||"href"!==t&&"newWindow"!==t)&&e.setAttribute(t,n)}o&&s.addLinkAttributes(e,a.href,a.newWindow);i&&a.dataId&&this.setupStorage(e,a.dataId,n,i)}static render(t){const e=t.annotationStorage,n=t.linkService,r=t.xfaHtml,s=t.intent||"display",a=document.createElement(r.name);r.attributes&&this.setAttributes({html:a,element:r,intent:s,linkService:n});const o=[[r,-1,a]],l=t.div;l.append(a);if(t.viewport){const e=`matrix(${t.viewport.transform.join(",")})`;l.style.transform=e}"richText"!==s&&l.setAttribute("class","xfaLayer xfaFont");const c=[];for(;o.length>0;){const[t,r,a]=o.at(-1);if(r+1===t.children.length){o.pop();continue}const l=t.children[++o.at(-1)[1]];if(null===l)continue;const{name:h}=l;if("#text"===h){const t=document.createTextNode(l.value);c.push(t);a.append(t);continue}const d=l?.attributes?.xmlns?document.createElementNS(l.attributes.xmlns,h):document.createElement(h);a.append(d);l.attributes&&this.setAttributes({html:d,element:l,storage:e,intent:s,linkService:n});if(l.children&&l.children.length>0)o.push([l,-1,d]);else if(l.value){const t=document.createTextNode(l.value);i.XfaText.shouldBuildText(h)&&c.push(t);d.append(t)}}for(const t of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))t.setAttribute("readOnly",!0);return{textDivs:c}}static update(t){const e=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=e;t.div.hidden=!1}}},(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0});e.InkEditor=void 0;n(89);n(2);var i=n(1),r=n(164),s=n(198),a=n(168),o=n(165);class InkEditor extends r.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){r.AnnotationEditor.initialize(t,{strings:["editor_ink_canvas_aria_label","editor_ink2_aria_label"]})}static updateDefaultParams(t,e){switch(t){case i.AnnotationEditorParamsType.INK_THICKNESS:InkEditor._defaultThickness=e;break;case i.AnnotationEditorParamsType.INK_COLOR:InkEditor._defaultColor=e;break;case i.AnnotationEditorParamsType.INK_OPACITY:InkEditor._defaultOpacity=e/100}}updateParams(t,e){switch(t){case i.AnnotationEditorParamsType.INK_THICKNESS:this.#Gn(e);break;case i.AnnotationEditorParamsType.INK_COLOR:this.#Ve(e);break;case i.AnnotationEditorParamsType.INK_OPACITY:this.#Vn(e)}}static get defaultPropertiesToUpdate(){return[[i.AnnotationEditorParamsType.INK_THICKNESS,InkEditor._defaultThickness],[i.AnnotationEditorParamsType.INK_COLOR,InkEditor._defaultColor||r.AnnotationEditor._defaultLineColor],[i.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*InkEditor._defaultOpacity)]]}get propertiesToUpdate(){return[[i.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||InkEditor._defaultThickness],[i.AnnotationEditorParamsType.INK_COLOR,this.color||InkEditor._defaultColor||r.AnnotationEditor._defaultLineColor],[i.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(this.opacity??InkEditor._defaultOpacity))]]}#Gn(t){const e=this.thickness;this.addCommands({cmd:()=>{this.thickness=t;this.#$n()},undo:()=>{this.thickness=e;this.#$n()},mustExec:!0,type:i.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}#Ve(t){const e=this.color;this.addCommands({cmd:()=>{this.color=t;this.#Xn()},undo:()=>{this.color=e;this.#Xn()},mustExec:!0,type:i.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}#Vn(t){t/=100;const e=this.opacity;this.addCommands({cmd:()=>{this.opacity=t;this.#Xn()},undo:()=>{this.opacity=e;this.#Xn()},mustExec:!0,type:i.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}rebuild(){if(this.parent){super.rebuild();if(null!==this.div){if(!this.canvas){this.#Kn();this.#Yn()}if(!this.isAttachedToDOM){this.parent.add(this);this.#Jn()}this.#$n()}}}remove(){if(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(){const[t,e]=this.parentDimensions,n=this.width*t,i=this.height*e;this.setDimensions(n,i)}enableEditMode(){if(!this.#Bn&&null!==this.canvas){super.enableEditMode();this._isDraggable=!1;this.canvas.addEventListener("pointerdown",this.#Ln)}}disableEditMode(){if(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(){const{parentRotation:t,parentDimensions:[e,n]}=this;switch(t){case 90:return[0,n,n,e];case 180:return[e,n,e,n];case 270:return[e,0,n,e];default:return[0,0,e,n]}}#Zn(){const{ctx:t,color:e,opacity:n,thickness:i,parentScale:r,scaleFactor:s}=this;t.lineWidth=i*r/s;t.lineCap="round";t.lineJoin="round";t.miterLimit=10;t.strokeStyle=`${e}${(0,o.opacityToHex)(n)}`}#ti(t,e){this.canvas.addEventListener("contextmenu",a.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;if(!this.#Un){this.#Un=!0;this.#Jn();this.thickness||=InkEditor._defaultThickness;this.color||=InkEditor._defaultColor||r.AnnotationEditor._defaultLineColor;this.opacity??=InkEditor._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(t,e){const[n,i]=this.currentPath.at(-1);if(this.currentPath.length>1&&t===n&&e===i)return;const r=this.currentPath;let s=this.#Nn;r.push([t,e]);this.#jn=!0;if(r.length<=2){s.moveTo(...r[0]);s.lineTo(t,e)}else{if(3===r.length){this.#Nn=s=new Path2D;s.moveTo(...r[0])}this.#ii(s,...r.at(-3),...r.at(-2),t,e)}}#ri(){if(0===this.currentPath.length)return;const t=this.currentPath.at(-1);this.#Nn.lineTo(...t)}#si(t,e){this.#qn=null;t=Math.min(Math.max(t,0),this.canvas.width);e=Math.min(Math.max(e,0),this.canvas.height);this.#ni(t,e);this.#ri();let n;if(1!==this.currentPath.length)n=this.#ai();else{const i=[t,e];n=[[i,i.slice(),i.slice(),i]]}const i=this.#Nn,r=this.currentPath;this.currentPath=[];this.#Nn=new Path2D;this.addCommands({cmd:()=>{this.allRawPaths.push(r);this.paths.push(n);this.bezierPath2D.push(i);this.rebuild()},undo:()=>{this.allRawPaths.pop();this.paths.pop();this.bezierPath2D.pop();if(0===this.paths.length)this.remove();else{if(!this.canvas){this.#Kn();this.#Yn()}this.#$n()}},mustExec:!0})}#ei(){if(!this.#jn)return;this.#jn=!1;const t=Math.ceil(this.thickness*this.parentScale),e=this.currentPath.slice(-3),n=e.map((t=>t[0])),i=e.map((t=>t[1])),{ctx:r}=(Math.min(...n),Math.max(...n),Math.min(...i),Math.max(...i),this);r.save();r.clearRect(0,0,this.canvas.width,this.canvas.height);for(const t of this.bezierPath2D)r.stroke(t);r.stroke(this.#Nn);r.restore()}#ii(t,e,n,i,r,s,a){const o=(e+i)/2,l=(n+r)/2,c=(i+s)/2,h=(r+a)/2;t.bezierCurveTo(o+2*(i-o)/3,l+2*(r-l)/3,c+2*(i-c)/3,h+2*(r-h)/3,c,h)}#ai(){const t=this.currentPath;if(t.length<=2)return[[t[0],t[0],t.at(-1),t.at(-1)]];const e=[];let n,[i,r]=t[0];for(n=1;n{this.canvas.removeEventListener("contextmenu",a.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";r.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=>{const e=t[0].contentRect;e.width&&e.height&&this.setDimensions(e.width,e.height)}));this.#zn.observe(this.div)}get isResizable(){return!this.isEmpty()&&this.#Bn}render(){if(this.div)return this.div;let t,e;if(this.width){t=this.x;e=this.y}super.render();r.AnnotationEditor._l10nPromise.get("editor_ink2_aria_label").then((t=>this.div?.setAttribute("aria-label",t)));const[n,i,s,a]=this.#Qn();this.setAt(n,i,0,0);this.setDims(s,a);this.#Kn();if(this.width){const[n,i]=this.parentDimensions;this.setAspectRatio(this.width*n,this.height*i);this.setAt(t*n,e*i,this.width*n,this.height*i);this.#Un=!0;this.#Jn();this.setDims(this.width*n,this.height*i);this.#Xn();this.div.classList.add("disabled")}else{this.div.classList.add("editing");this.enableEditMode()}this.#Yn();return this.div}#Jn(){if(!this.#Un)return;const[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){const n=Math.round(t),i=Math.round(e);if(this.#Wn===n&&this.#Hn===i)return;this.#Wn=n;this.#Hn=i;this.canvas.style.visibility="hidden";const[r,s]=this.parentDimensions;this.width=t/r;this.height=e/s;this.fixAndSetPosition();this.#Bn&&this.#ci(t,e);this.#Jn();this.#Xn();this.canvas.style.visibility="visible";this.fixDims()}#ci(t,e){const n=this.#hi(),i=(t-n)/this.#Rn,r=(e-n)/this.#Fn;this.scaleFactor=Math.min(i,r)}#oi(){const 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(t){const e=new Path2D;for(let n=0,i=t.length;n0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return;if(!this.#Bn){this.#Xn();return}const e=this.#gi(),n=this.#hi();this.#Rn=Math.max(r.AnnotationEditor.MIN_SIZE,e[2]-e[0]);this.#Fn=Math.max(r.AnnotationEditor.MIN_SIZE,e[3]-e[1]);const i=Math.ceil(n+this.#Rn*this.scaleFactor),s=Math.ceil(n+this.#Fn*this.scaleFactor),[a,o]=this.parentDimensions;this.width=i/a;this.height=s/o;this.setAspectRatio(i,s);const l=this.translationX,c=this.translationY;this.translationX=-e[0];this.translationY=-e[1];this.#Jn();this.#Xn();this.#Wn=i;this.#Hn=s;this.setDims(i,s);const h=t?n/this.scaleFactor/2:0;this.translate(l-this.translationX-h,c-this.translationY-h)}static deserialize(t,e,n){if(t instanceof s.InkAnnotationElement)return null;const a=super.deserialize(t,e,n);a.thickness=t.thickness;a.color=i.Util.makeHexColor(...t.color);a.opacity=t.opacity;const[o,l]=a.pageDimensions,c=a.width*o,h=a.height*l,d=a.parentScale,u=t.thickness/2;a.#Bn=!0;a.#Wn=Math.round(c);a.#Hn=Math.round(h);const{paths:p,rect:f,rotation:g}=t;for(let{bezier:t}of p){t=InkEditor.#pi(t,f,g);const e=[];a.paths.push(e);let n=d*(t[0]-u),i=d*(t[1]-u);for(let r=2,s=t.length;r{Object.defineProperty(e,"__esModule",{value:!0});e.StampEditor=void 0;n(149);n(152);var i=n(1),r=n(164),s=n(168),a=n(198);class StampEditor extends r.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){r.AnnotationEditor.initialize(t)}static get supportedTypes(){return(0,i.shadow)(this,"supportedTypes",["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"].map((t=>`image/${t}`)))}static get supportedTypesStr(){return(0,i.shadow)(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(t){return this.supportedTypes.includes(t)}static paste(t,e){e.pasteEditor(i.AnnotationEditorType.STAMP,{bitmapFile:t.getAsFile()})}#wi(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t){this.#mi=t.bitmap;if(!e){this.#bi=t.id;this.#Ei=t.isSvg}this.#Kn()}else this.remove()}#Ci(){this.#vi=null;this._uiManager.enableWaiting(!1);this.#Ai&&this.div.focus()}#Ti(){if(this.#bi){this._uiManager.enableWaiting(!0);this._uiManager.imageManager.getFromId(this.#bi).then((t=>this.#wi(t,!0))).finally((()=>this.#Ci()));return}if(this.#yi){const t=this.#yi;this.#yi=null;this._uiManager.enableWaiting(!0);this.#vi=this._uiManager.imageManager.getFromUrl(t).then((t=>this.#wi(t))).finally((()=>this.#Ci()));return}if(this.#_i){const t=this.#_i;this.#_i=null;this._uiManager.enableWaiting(!0);this.#vi=this._uiManager.imageManager.getFromFile(t).then((t=>this.#wi(t))).finally((()=>this.#Ci()));return}const t=document.createElement("input");t.type="file";t.accept=StampEditor.supportedTypesStr;this.#vi=new Promise((e=>{t.addEventListener("change",(async()=>{if(t.files&&0!==t.files.length){this._uiManager.enableWaiting(!0);const e=await this._uiManager.imageManager.getFromFile(t.files[0]);this.#wi(e)}else this.remove();e()}));t.addEventListener("cancel",(()=>{this.remove();e()}))})).finally((()=>this.#Ci()));t.click()}remove(){if(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(){if(this.parent){super.rebuild();if(null!==this.div){this.#bi&&this.#Ti();this.isAttachedToDOM||this.parent.add(this)}}else 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)return this.div;let t,e;if(this.width){t=this.x;e=this.y}super.render();this.div.hidden=!0;this.#mi?this.#Kn():this.#Ti();if(this.width){const[n,i]=this.parentDimensions;this.setAt(t*n,e*i,this.width*n,this.height*i)}return this.div}#Kn(){const{div:t}=this;let{width:e,height:n}=this.#mi;const[i,r]=this.pageDimensions,s=.75;if(this.width){e=this.width*i;n=this.height*r}else if(e>s*i||n>s*r){const t=Math.min(s*i/e,s*r/n);e*=t;n*=t}const[a,o]=this.parentDimensions;this.setDims(e*a/i,n*o/r);this._uiManager.enableWaiting(!1);const l=this.#Ai=document.createElement("canvas");t.append(l);t.hidden=!1;this.#Pi(e,n);this.#Yn();if(!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){const[n,i]=this.parentDimensions;this.width=t/n;this.height=e/i;this.setDims(t,e);this._initialOptions?.isCentered?this.center():this.fixAndSetPosition();this._initialOptions=null;null!==this.#Si&&clearTimeout(this.#Si);this.#Si=setTimeout((()=>{this.#Si=null;this.#Pi(t,e)}),200)}#Mi(t,e){const{width:n,height:i}=this.#mi;let r=n,s=i,a=this.#mi;for(;r>2*t||s>2*e;){const n=r,i=s;r>2*t&&(r=r>=16384?Math.floor(r/2)-1:Math.ceil(r/2));s>2*e&&(s=s>=16384?Math.floor(s/2)-1:Math.ceil(s/2));const o=new OffscreenCanvas(r,s);o.getContext("2d").drawImage(a,0,0,n,i,0,0,r,s);a=o.transferToImageBitmap()}return a}#Pi(t,e){t=Math.ceil(t);e=Math.ceil(e);const n=this.#Ai;if(!n||n.width===t&&n.height===e)return;n.width=t;n.height=e;const i=this.#Ei?this.#mi:this.#Mi(t,e),r=n.getContext("2d");r.filter=this._uiManager.hcmFilter;r.drawImage(i,0,0,i.width,i.height,0,0,t,e)}#Fi(t){if(t){if(this.#Ei){const t=this._uiManager.imageManager.getSvgUrl(this.#bi);if(t)return t}const t=document.createElement("canvas");({width:t.width,height:t.height}=this.#mi);t.getContext("2d").drawImage(this.#mi,0,0);return t.toDataURL()}if(this.#Ei){const[t,e]=this.pageDimensions,n=Math.round(this.width*t*s.PixelsPerInch.PDF_TO_CSS_UNITS),i=Math.round(this.height*e*s.PixelsPerInch.PDF_TO_CSS_UNITS),r=new OffscreenCanvas(n,i);r.getContext("2d").drawImage(this.#mi,0,0,this.#mi.width,this.#mi.height,0,0,n,i);return r.transferToImageBitmap()}return structuredClone(this.#mi)}#Yn(){this.#zn=new ResizeObserver((t=>{const e=t[0].contentRect;e.width&&e.height&&this.#ki(e.width,e.height)}));this.#zn.observe(this.div)}static deserialize(t,e,n){if(t instanceof a.StampAnnotationElement)return null;const i=super.deserialize(t,e,n),{rect:r,bitmapUrl:s,bitmapId:o,isSvg:l,accessibilityData:c}=t;o&&n.imageManager.isValidId(o)?i.#bi=o:i.#yi=s;i.#Ei=l;const[h,d]=i.pageDimensions;i.width=(r[2]-r[0])/h;i.height=(r[3]-r[1])/d;c&&(i.altTextData=c);return i}serialize(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.isEmpty())return null;const n={annotationType:i.AnnotationEditorType.STAMP,bitmapId:this.#bi,pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:this.#Ei,structTreeParentId:this._structTreeParentId};if(t){n.bitmapUrl=this.#Fi(!0);n.accessibilityData=this.altTextData;return n}const{decorative:r,altText:s}=this.altTextData;!r&&s&&(n.accessibilityData={type:"Figure",alt:s});if(null===e)return n;e.stamps||=new Map;const a=this.#Ei?(n.rect[2]-n.rect[0])*(n.rect[3]-n.rect[1]):null;if(e.stamps.has(this.#bi)){if(this.#Ei){const t=e.stamps.get(this.#bi);if(a>t.area){t.area=a;t.serialized.bitmap.close();t.serialized.bitmap=this.#Fi(!1)}}}else{e.stamps.set(this.#bi,{area:a,serialized:n});n.bitmap=this.#Fi(!1)}return n}}e.StampEditor=StampEditor}],__webpack_module_cache__={};function __w_pdfjs_require__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var n=__webpack_module_cache__[t]={exports:{}};__webpack_modules__[t].call(n.exports,n,n.exports,__w_pdfjs_require__);return n.exports}var __webpack_exports__={};(()=>{var t=__webpack_exports__;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 s.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 a.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 n.PDFDataRangeTransport}});Object.defineProperty(t,"PDFDateString",{enumerable:!0,get:function(){return i.PDFDateString}});Object.defineProperty(t,"PDFWorker",{enumerable:!0,get:function(){return n.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 n.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 c.XfaLayer}});Object.defineProperty(t,"build",{enumerable:!0,get:function(){return n.build}});Object.defineProperty(t,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return e.createValidAbsoluteUrl}});Object.defineProperty(t,"getDocument",{enumerable:!0,get:function(){return n.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 r.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 r.updateTextLayer}});Object.defineProperty(t,"version",{enumerable:!0,get:function(){return n.version}});var e=__w_pdfjs_require__(1),n=__w_pdfjs_require__(124),i=__w_pdfjs_require__(168),r=__w_pdfjs_require__(195),s=__w_pdfjs_require__(196),a=__w_pdfjs_require__(165),o=__w_pdfjs_require__(198),l=__w_pdfjs_require__(176),c=__w_pdfjs_require__(201)})();return __webpack_exports__})())); \ No newline at end of file diff --git a/public/script/vendor.min.js b/public/script/vendor.min.js index fc2e5e5..90a88bc 100644 --- a/public/script/vendor.min.js +++ b/public/script/vendor.min.js @@ -1,4 +1,4 @@ -"use strict";(()=>{var zl=Object.defineProperty;var Hl=(e,t)=>{for(var o in t)zl(e,o,{get:t[o],enumerable:!0})};var ye={notebook:"/script/notebook.c3144c18ae.min.js",org:"/script/org.f61f262915.min.js",markdown:"/script/markdown.44f2e93820.min.js",pdf:"/script/pdf.0175d53d2f.min.js",editor:"/script/editor.4f142d3adc.min.js"};var rn=new Map,Gl=ye;function Wt(e){if(!rn.has(e)){let t=document.createElement("script");t.src=Gl[e];let o=new Promise((r,n)=>{t.onload=r,t.onerror=()=>{rn.delete(e),t.remove(),n(new Error(`Unable to load ${e}. Please retry.`))}});rn.set(e,o),document.head.appendChild(t)}return rn.get(e)}async function tr(){await Wt("editor"),ace.config.set("basePath","/script/external/ace/")}function ds(e){let t=Object.create(null);for(let o of e.split(","))t[o]=1;return o=>o in t}var Me={},Kt=[],rt=()=>{},Xn=()=>!1,us=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),cs=e=>e.startsWith("onUpdate:"),Ge=Object.assign,Ss=(e,t)=>{let o=e.indexOf(t);o>-1&&e.splice(o,1)},jl=Object.prototype.hasOwnProperty,Ae=(e,t)=>jl.call(e,t),Ee=Array.isArray,Pt=e=>Ds(e)==="[object Map]",ls=e=>Ds(e)==="[object Set]",sr=e=>Ds(e)==="[object Date]";var _e=e=>typeof e=="function",Fe=e=>typeof e=="string",ct=e=>typeof e=="symbol",Ve=e=>e!==null&&typeof e=="object",Zn=e=>(Ve(e)||_e(e))&&_e(e.then)&&_e(e.catch),rr=Object.prototype.toString,Ds=e=>rr.call(e),xn=e=>Ds(e).slice(8,-1),an=e=>Ds(e)==="[object Object]",ln=e=>Fe(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,ps=ds(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");var dn=e=>{let t=Object.create(null);return(o=>t[o]||(t[o]=e(o)))},Wl=/-\w/g,Ke=dn(e=>e.replace(Wl,t=>t.slice(1).toUpperCase())),Kl=/\B([A-Z])/g,qt=dn(e=>e.replace(Kl,"-$1").toLowerCase()),Yt=dn(e=>e.charAt(0).toUpperCase()+e.slice(1)),Rs=dn(e=>e?`on${Yt(e)}`:""),ht=(e,t)=>!Object.is(e,t),Ts=(e,...t)=>{for(let o=0;o{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:o})},eo=e=>{let t=parseFloat(e);return isNaN(t)?e:t};var nr,Os=()=>nr||(nr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Pe(e){if(Ee(e)){let t={};for(let o=0;o{if(o){let r=o.split(Jl);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function O(e){let t="";if(Fe(e))t=e;else if(Ee(e))for(let o=0;o!!(e&&e.__v_isRef===!0),c=e=>Fe(e)?e:e==null?"":Ee(e)||Ve(e)&&(e.toString===rr||!_e(e.toString))?lr(e)?c(e.value):JSON.stringify(e,dr,2):String(e),dr=(e,t)=>lr(t)?dr(e,t.value):Pt(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((o,[r,n],i)=>(o[Qn(r,i)+" =>"]=n,o),{})}:ls(t)?{[`Set(${t.size})`]:[...t.values()].map(o=>Qn(o))}:ct(t)?Qn(t):Ve(t)&&!Ee(t)&&!an(t)?String(t):t,Qn=(e,t="")=>{var o;return ct(e)?`Symbol(${(o=e.description)!=null?o:t})`:e};function ed(e,...t){console.warn(`[Vue warn] ${e}`,...t)}var Ye,Ps=class{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&Ye&&(Ye.active?(this.parent=Ye,this.index=(Ye.scopes||(Ye.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,o;if(this.scopes){let r=this.scopes.slice();for(t=0,o=r.length;t0&&--this._on===0){if(Ye===this)Ye=this.prevScope;else{let t=Ye;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let o,r;for(o=0,r=this.effects.length;o0)return;if(Vs){let t=Vs;for(Vs=void 0;t;){let o=t.next;t.next=void 0,t.flags&=-9,t=o}}let e;for(;Is;){let t=Is;for(Is=void 0;t;){let o=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){e||(e=r)}t=o}}if(e)throw e}function hr(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function vr(e){let t,o=e.depsTail,r=o;for(;r;){let n=r.prevDep;r.version===-1?(r===o&&(o=n),ho(r),td(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=n}e.deps=t,e.depsTail=o}function oo(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(yr(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function yr(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===qs)||(e.globalVersion=qs,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!oo(e))))return;e.flags|=2;let t=e.dep,o=Le,r=wt;Le=e,wt=!0;try{hr(e);let n=e.fn(e._value);(t.version===0||ht(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(n){throw t.version++,n}finally{Le=o,wt=r,vr(e),e.flags&=-3}}function ho(e,t=!1){let{dep:o,prevSub:r,nextSub:n}=e;if(r&&(r.nextSub=n,e.prevSub=void 0),n&&(n.prevSub=r,e.nextSub=void 0),o.subs===e&&(o.subs=r,!r&&o.computed)){o.computed.flags&=-5;for(let i=o.computed.deps;i;i=i.nextDep)ho(i,!0)}!t&&!--o.sc&&o.map&&o.map.delete(o.key)}function td(e){let{prevDep:t,nextDep:o}=e;t&&(t.nextDep=o,e.prevDep=void 0),o&&(o.prevDep=t,e.nextDep=void 0)}var wt=!0,gr=[];function Dt(){gr.push(wt),wt=!1}function Rt(){let e=gr.pop();wt=e===void 0?!0:e}function ur(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let o=Le;Le=void 0;try{t()}finally{Le=o}}}var qs=0,ro=class{constructor(t,o){this.sub=t,this.dep=o,this.version=o.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},Ms=class{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!Le||!wt||Le===this.computed)return;let o=this.activeLink;if(o===void 0||o.sub!==Le)o=this.activeLink=new ro(Le,this),Le.deps?(o.prevDep=Le.depsTail,Le.depsTail.nextDep=o,Le.depsTail=o):Le.deps=Le.depsTail=o,br(o);else if(o.version===-1&&(o.version=this.version,o.nextDep)){let r=o.nextDep;r.prevDep=o.prevDep,o.prevDep&&(o.prevDep.nextDep=r),o.prevDep=Le.depsTail,o.nextDep=void 0,Le.depsTail.nextDep=o,Le.depsTail=o,Le.deps===o&&(Le.deps=r)}return o}trigger(t){this.version++,qs++,this.notify(t)}notify(t){fo();try{for(let o=this.subs;o;o=o.prevSub)o.sub.notify()&&o.sub.dep.notify()}finally{mo()}}};function br(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let r=t.deps;r;r=r.nextDep)br(r)}let o=e.dep.subs;o!==e&&(e.prevSub=o,o&&(o.nextSub=e)),e.dep.subs=e}}var io=new WeakMap,Qt=Symbol(""),ao=Symbol(""),$s=Symbol("");function Xe(e,t,o){if(wt&&Le){let r=io.get(e);r||io.set(e,r=new Map);let n=r.get(o);n||(r.set(o,n=new Ms),n.map=r,n.key=o),n.track()}}function Nt(e,t,o,r,n,i){let a=io.get(e);if(!a){qs++;return}let u=m=>{m&&m.trigger()};if(fo(),t==="clear")a.forEach(u);else{let m=Ee(e),h=m&&ln(o);if(m&&o==="length"){let v=Number(r);a.forEach((k,p)=>{(p==="length"||p===$s||!ct(p)&&p>=v)&&u(k)})}else switch((o!==void 0||a.has(void 0))&&u(a.get(o)),h&&u(a.get($s)),t){case"add":m?h&&u(a.get("length")):(u(a.get(Qt)),Pt(e)&&u(a.get(ao)));break;case"delete":m||(u(a.get(Qt)),Pt(e)&&u(a.get(ao)));break;case"set":Pt(e)&&u(a.get(Qt));break}}mo()}function ms(e){let t=Ie(e);return t===e?t:(Xe(t,"iterate",$s),it(e)?t:t.map(vt))}function Ls(e){return Xe(e=Ie(e),"iterate",$s),e}function Ct(e,t){return kt(e)?Xt($t(e)?vt(t):t):vt(t)}var sd={__proto__:null,[Symbol.iterator](){return so(this,Symbol.iterator,e=>Ct(this,e))},concat(...e){return ms(this).concat(...e.map(t=>Ee(t)?ms(t):t))},entries(){return so(this,"entries",e=>(e[1]=Ct(this,e[1]),e))},every(e,t){return Mt(this,"every",e,t,void 0,arguments)},filter(e,t){return Mt(this,"filter",e,t,o=>o.map(r=>Ct(this,r)),arguments)},find(e,t){return Mt(this,"find",e,t,o=>Ct(this,o),arguments)},findIndex(e,t){return Mt(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Mt(this,"findLast",e,t,o=>Ct(this,o),arguments)},findLastIndex(e,t){return Mt(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Mt(this,"forEach",e,t,void 0,arguments)},includes(...e){return no(this,"includes",e)},indexOf(...e){return no(this,"indexOf",e)},join(e){return ms(this).join(e)},lastIndexOf(...e){return no(this,"lastIndexOf",e)},map(e,t){return Mt(this,"map",e,t,void 0,arguments)},pop(){return As(this,"pop")},push(...e){return As(this,"push",e)},reduce(e,...t){return cr(this,"reduce",e,t)},reduceRight(e,...t){return cr(this,"reduceRight",e,t)},shift(){return As(this,"shift")},some(e,t){return Mt(this,"some",e,t,void 0,arguments)},splice(...e){return As(this,"splice",e)},toReversed(){return ms(this).toReversed()},toSorted(e){return ms(this).toSorted(e)},toSpliced(...e){return ms(this).toSpliced(...e)},unshift(...e){return As(this,"unshift",e)},values(){return so(this,"values",e=>Ct(this,e))}};function so(e,t,o){let r=Ls(e),n=r[t]();return r!==e&&!it(e)&&(n._next=n.next,n.next=()=>{let i=n._next();return i.done||(i.value=o(i.value)),i}),n}var nd=Array.prototype;function Mt(e,t,o,r,n,i){let a=Ls(e),u=a!==e&&!it(e),m=a[t];if(m!==nd[t]){let k=m.apply(e,i);return u?vt(k):k}let h=o;a!==e&&(u?h=function(k,p){return o.call(this,Ct(e,k),p,e)}:o.length>2&&(h=function(k,p){return o.call(this,k,p,e)}));let v=m.call(a,h,r);return u&&n?n(v):v}function cr(e,t,o,r){let n=Ls(e),i=n!==e&&!it(e),a=o,u=!1;n!==e&&(i?(u=r.length===0,a=function(h,v,k){return u&&(u=!1,h=Ct(e,h)),o.call(this,h,Ct(e,v),k,e)}):o.length>3&&(a=function(h,v,k){return o.call(this,h,v,k,e)}));let m=n[t](a,...r);return u?Ct(e,m):m}function no(e,t,o){let r=Ie(e);Xe(r,"iterate",$s);let n=r[t](...o);return(n===-1||n===!1)&&zs(o[0])?(o[0]=Ie(o[0]),r[t](...o)):n}function As(e,t,o=[]){Dt(),fo();let r=Ie(e)[t].apply(e,o);return mo(),Rt(),r}var od=ds("__proto__,__v_isRef,__isVue"),wr=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(ct));function rd(e){ct(e)||(e=String(e));let t=Ie(this);return Xe(t,"has",e),t.hasOwnProperty(e)}var hn=class{constructor(t=!1,o=!1){this._isReadonly=t,this._isShallow=o}get(t,o,r){if(o==="__v_skip")return t.__v_skip;let n=this._isReadonly,i=this._isShallow;if(o==="__v_isReactive")return!n;if(o==="__v_isReadonly")return n;if(o==="__v_isShallow")return i;if(o==="__v_raw")return r===(n?i?md:Er:i?_r:kr).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;let a=Ee(t);if(!n){let m;if(a&&(m=sd[o]))return m;if(o==="hasOwnProperty")return rd}let u=Reflect.get(t,o,Qe(t)?t:r);if((ct(o)?wr.has(o):od(o))||(n||Xe(t,"get",o),i))return u;if(Qe(u)){let m=a&&ln(o)?u:u.value;return n&&Ve(m)?yn(m):m}return Ve(u)?n?yn(u):ze(u):u}},vn=class extends hn{constructor(t=!1){super(!1,t)}set(t,o,r,n){let i=t[o],a=Ee(t)&&ln(o);if(!this._isShallow){let h=kt(i);if(!it(r)&&!kt(r)&&(i=Ie(i),r=Ie(r)),!a&&Qe(i)&&!Qe(r))return h||(i.value=r),!0}let u=a?Number(o)e,pn=e=>Reflect.getPrototypeOf(e);function dd(e,t,o){return function(...r){let n=this.__v_raw,i=Ie(n),a=Pt(i),u=e==="entries"||e===Symbol.iterator&&a,m=e==="keys"&&a,h=n[e](...r),v=o?uo:t?Xt:vt;return!t&&Xe(i,"iterate",m?ao:Qt),Ge(Object.create(h),{next(){let{value:k,done:p}=h.next();return p?{value:k,done:p}:{value:u?[v(k[0]),v(k[1])]:v(k),done:p}}})}}function fn(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function ud(e,t){let o={get(n){let i=this.__v_raw,a=Ie(i),u=Ie(n);e||(ht(n,u)&&Xe(a,"get",n),Xe(a,"get",u));let{has:m}=pn(a),h=t?uo:e?Xt:vt;if(m.call(a,n))return h(i.get(n));if(m.call(a,u))return h(i.get(u));i!==a&&i.get(n)},get size(){let n=this.__v_raw;return!e&&Xe(Ie(n),"iterate",Qt),n.size},has(n){let i=this.__v_raw,a=Ie(i),u=Ie(n);return e||(ht(n,u)&&Xe(a,"has",n),Xe(a,"has",u)),n===u?i.has(n):i.has(n)||i.has(u)},forEach(n,i){let a=this,u=a.__v_raw,m=Ie(u),h=t?uo:e?Xt:vt;return!e&&Xe(m,"iterate",Qt),u.forEach((v,k)=>n.call(i,h(v),h(k),a))}};return Ge(o,e?{add:fn("add"),set:fn("set"),delete:fn("delete"),clear:fn("clear")}:{add(n){let i=Ie(this),a=pn(i),u=Ie(n),m=!t&&!it(n)&&!kt(n)?u:n;return a.has.call(i,m)||ht(n,m)&&a.has.call(i,n)||ht(u,m)&&a.has.call(i,u)||(i.add(m),Nt(i,"add",m,m)),this},set(n,i){!t&&!it(i)&&!kt(i)&&(i=Ie(i));let a=Ie(this),{has:u,get:m}=pn(a),h=u.call(a,n);h||(n=Ie(n),h=u.call(a,n));let v=m.call(a,n);return a.set(n,i),h?ht(i,v)&&Nt(a,"set",n,i,v):Nt(a,"add",n,i),this},delete(n){let i=Ie(this),{has:a,get:u}=pn(i),m=a.call(i,n);m||(n=Ie(n),m=a.call(i,n));let h=u?u.call(i,n):void 0,v=i.delete(n);return m&&Nt(i,"delete",n,void 0,h),v},clear(){let n=Ie(this),i=n.size!==0,a=void 0,u=n.clear();return i&&Nt(n,"clear",void 0,void 0,a),u}}),["keys","values","entries",Symbol.iterator].forEach(n=>{o[n]=dd(n,e,t)}),o}function vo(e,t){let o=ud(e,t);return(r,n,i)=>n==="__v_isReactive"?!e:n==="__v_isReadonly"?e:n==="__v_raw"?r:Reflect.get(Ae(o,n)&&n in r?o:r,n,i)}var cd={get:vo(!1,!1)},pd={get:vo(!1,!0)},fd={get:vo(!0,!1)};var kr=new WeakMap,_r=new WeakMap,Er=new WeakMap,md=new WeakMap;function hd(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function ze(e){return kt(e)?e:yo(e,!1,id,cd,kr)}function Fs(e){return yo(e,!1,ld,pd,_r)}function yn(e){return yo(e,!0,ad,fd,Er)}function yo(e,t,o,r,n){if(!Ve(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;let i=n.get(e);if(i)return i;let a=hd(xn(e));if(a===0)return e;let u=new Proxy(e,a===2?r:o);return n.set(e,u),u}function $t(e){return kt(e)?$t(e.__v_raw):!!(e&&e.__v_isReactive)}function kt(e){return!!(e&&e.__v_isReadonly)}function it(e){return!!(e&&e.__v_isShallow)}function zs(e){return e?!!e.__v_raw:!1}function Ie(e){let t=e&&e.__v_raw;return t?Ie(t):e}function go(e){return!Ae(e,"__v_skip")&&Object.isExtensible(e)&&un(e,"__v_skip",!0),e}var vt=e=>Ve(e)?ze(e):e,Xt=e=>Ve(e)?yn(e):e;function Qe(e){return e?e.__v_isRef===!0:!1}function Ze(e){return Cr(e,!1)}function bn(e){return Cr(e,!0)}function Cr(e,t){return Qe(e)?e:new co(e,t)}var co=class{constructor(t,o){this.dep=new Ms,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=o?t:Ie(t),this._value=o?t:vt(t),this.__v_isShallow=o}get value(){return this.dep.track(),this._value}set value(t){let o=this._rawValue,r=this.__v_isShallow||it(t)||kt(t);t=r?t:Ie(t),ht(t,o)&&(this._rawValue=t,this._value=r?t:vt(t),this.dep.trigger())}};function Ut(e){return Qe(e)?e.value:e}var vd={get:(e,t,o)=>t==="__v_raw"?e:Ut(Reflect.get(e,t,o)),set:(e,t,o,r)=>{let n=e[t];return Qe(n)&&!Qe(o)?(n.value=o,!0):Reflect.set(e,t,o,r)}};function wn(e){return $t(e)?e:new Proxy(e,vd)}var po=class{constructor(t,o,r){this.fn=t,this.setter=o,this._value=void 0,this.dep=new Ms(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=qs-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!o,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&Le!==this)return mr(this,!0),!0}get value(){let t=this.dep.track();return yr(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}};function Nr(e,t,o=!1){let r,n;return _e(e)?r=e:(r=e.get,n=e.set),new po(r,n,o)}var mn={},gn=new WeakMap,Jt;function Sr(e,t=!1,o=Jt){if(o){let r=gn.get(o);r||gn.set(o,r=[]),r.push(e)}}function Dr(e,t,o=Me){let{immediate:r,deep:n,once:i,scheduler:a,augmentJob:u,call:m}=o,h=A=>{(o.onWarn||ed)("Invalid watch source: ",A,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},v=A=>n?A:it(A)||n===!1||n===0?St(A,1):St(A),k,p,g,w,b=!1,T=!1;if(Qe(e)?(p=()=>e.value,b=it(e)):$t(e)?(p=()=>v(e),b=!0):Ee(e)?(T=!0,b=e.some(A=>$t(A)||it(A)),p=()=>e.map(A=>{if(Qe(A))return A.value;if($t(A))return v(A);if(_e(A))return m?m(A,2):A()})):_e(e)?t?p=m?()=>m(e,2):e:p=()=>{if(g){Dt();try{g()}finally{Rt()}}let A=Jt;Jt=k;try{return m?m(e,3,[w]):e(w)}finally{Jt=A}}:p=rt,t&&n){let A=p,P=n===!0?1/0:n;p=()=>St(A(),P)}let N=pr(),R=()=>{k.stop(),N&&N.active&&Ss(N.effects,k)};if(i&&t){let A=t;t=(...P)=>{let Z=A(...P);return R(),Z}}let I=T?new Array(e.length).fill(mn):mn,C=A=>{if(!(!(k.flags&1)||!k.dirty&&!A))if(t){let P=k.run();if(A||n||b||(T?P.some((Z,Y)=>ht(Z,I[Y])):ht(P,I))){g&&g();let Z=Jt;Jt=k;try{let Y=[P,I===mn?void 0:T&&I[0]===mn?[]:I,w];I=P,m?m(t,3,Y):t(...Y)}finally{Jt=Z}}}else k.run()};return u&&u(C),k=new hs(p),k.scheduler=a?()=>a(C,!1):C,w=A=>Sr(A,!1,k),g=k.onStop=()=>{let A=gn.get(k);if(A){if(m)m(A,4);else for(let P of A)P();gn.delete(k)}},t?r?C(!0):I=k.run():a?a(C.bind(null,!0),!0):k.run(),R.pause=k.pause.bind(k),R.resume=k.resume.bind(k),R.stop=R,R}function St(e,t=1/0,o){if(t<=0||!Ve(e)||e.__v_skip||(o=o||new Map,(o.get(e)||0)>=t))return e;if(o.set(e,t),t--,Qe(e))St(e.value,t,o);else if(Ee(e))for(let r=0;r{St(r,t,o)});else if(an(e)){for(let r in e)St(e[r],t,o);for(let r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&St(e[r],t,o)}return e}function Xs(e,t,o,r){try{return r?e(...r):e()}catch(n){Zs(n,t,o)}}function yt(e,t,o,r){if(_e(e)){let n=Xs(e,t,o,r);return n&&Zn(n)&&n.catch(i=>{Zs(i,t,o)}),n}if(Ee(e)){let n=[];for(let i=0;i>>1,n=nt[r],i=Ys(n);i=Ys(o)?nt.push(e):nt.splice(kd(t),0,e),e.flags|=1,jr()}}function jr(){En||(En=Gr.then(Yr))}function Wr(e){if(!Ee(e))jt&&e.id===-1?jt.splice(vs+1,0,e):e.flags&1||(ys.push(e),e.flags|=1);else for(let t=0;tYs(o)-Ys(r));if(ys.length=0,jt){for(let o=0;oe.id==null?e.flags&2?-1:1/0:e.id;function Yr(e){let t=rt;try{for(Ot=0;Ot{r._d&&Dn(-1);let i=Cn(t),a=es.length,u;try{u=e(...n)}finally{for(let m=es.length;m>a;m--)Ci();Cn(i),r._d&&Dn(1)}return u};return r._n=!0,r._c=!0,r._d=!0,r}function E(e,t){if(pt===null)return e;let o=$n(pt),r=e.dirs||(e.dirs=[]);for(let n=0;n1)return o&&_e(t)?t.call(r&&r.proxy):t}}var Ed=Symbol.for("v-scx"),Cd=()=>{{let e=lt(Ed);return e}};function He(e,t,o){return Qr(e,t,o)}function Qr(e,t,o=Me){let{immediate:r,deep:n,flush:i,once:a}=o,u=Ge({},o),m=t&&r||!t&&i!=="post",h;if(ws){if(i==="sync"){let g=Cd();h=g.__watcherHandles||(g.__watcherHandles=[])}else if(!m){let g=()=>{};return g.stop=rt,g.resume=rt,g.pause=rt,g}}let v=xe;u.call=(g,w,b)=>yt(g,v,w,b);let k=!1;i==="post"?u.scheduler=g=>{at(g,v&&v.suspense)}:i!=="sync"&&(k=!0,u.scheduler=(g,w)=>{w?g():Do(g)}),u.augmentJob=g=>{t&&(g.flags|=4),k&&(g.flags|=2,v&&(g.id=v.uid,g.i=v))};let p=Dr(e,t,u);return ws&&(h?h.push(p):m&&p()),p}function Nd(e,t,o){let r=this.proxy,n=Fe(e)?e.includes(".")?Xr(r,e):()=>r[e]:e.bind(r,r),i;_e(t)?i=t:(i=t.handler,o=t);let a=tn(this),u=Qr(n,i.bind(r),o);return a(),u}function Xr(e,t){let o=t.split(".");return()=>{let r=e;for(let n=0;ne.__isTeleport;var bo=Symbol("_leaveCb");function Dd(e){let t=e[0];if(e.length>1){let o=!1;for(let r of e)if(r.type!==Ft){t=r,o=!0;break}}return t}function Zr(e){if(!Vn(e))return An(e.type)&&e.children?Dd(e.children):e;if(e.component)return e.component.subTree;let{shapeFlag:t,children:o}=e;if(o){if(t&16)return o[0];if(t&32&&_e(o.default))return o.default()}}function In(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;let o=e.component.subTree;In(An(o.type)&&Zr(o)||o,t)}else e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function xs(e,t){return _e(e)?Ge({name:e.name},t,{setup:e}):e}function Ro(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Tr(e,t){let o;return!!((o=Object.getOwnPropertyDescriptor(e,t))&&!o.configurable)}var Nn=new WeakMap;function Gs(e,t,o,r,n=!1){if(Ee(e)){e.forEach((b,T)=>Gs(b,t&&(Ee(t)?t[T]:t),o,r,n));return}if(js(r)&&!n){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&Gs(e,t,o,r.component.subTree);return}let i=r.shapeFlag&4?$n(r.component):r.el,a=n?null:i,{i:u,r:m}=e,h=t&&t.r,v=u.refs===Me?u.refs={}:u.refs,k=u.setupState,p=Ie(k),g=k===Me?Xn:b=>Tr(v,b)?!1:Ae(p,b),w=(b,T)=>!(T&&Tr(v,T));if(h!=null&&h!==m){if(Or(t),Fe(h))v[h]=null,g(h)&&(k[h]=null);else if(Qe(h)){let b=t;w(h,b.k)&&(h.value=null),b.k&&(v[b.k]=null)}}if(_e(m))Xs(m,u,12,[a,v]);else{let b=Fe(m),T=Qe(m);if(b||T){let N=()=>{if(e.f){let R=b?g(m)?k[m]:v[m]:w(m)||!e.k?m.value:v[e.k];if(n)Ee(R)&&Ss(R,i);else if(Ee(R))R.includes(i)||R.push(i);else if(b)v[m]=[i],g(m)&&(k[m]=v[m]);else{let I=[i];w(m,e.k)&&(m.value=I),e.k&&(v[e.k]=I)}}else b?(v[m]=a,g(m)&&(k[m]=a)):T&&(w(m,e.k)&&(m.value=a),e.k&&(v[e.k]=a))};if(a){let R=()=>{N(),Nn.delete(e)};R.id=-1,Nn.set(e,R),at(R,o)}else Or(e),N()}}}function Or(e){let t=Nn.get(e);t&&(t.flags|=8,Nn.delete(e))}var Ar=e=>e.nodeType===8;var q4=Os().requestIdleCallback||(e=>setTimeout(e,1)),M4=Os().cancelIdleCallback||(e=>clearTimeout(e));function Rd(e,t){if(Ar(e)&&e.data==="["){let o=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(Ar(r))if(r.data==="]"){if(--o===0)break}else r.data==="["&&o++;r=r.nextSibling}}else t(e)}var js=e=>!!e.type.__asyncLoader;function xr(e){_e(e)&&(e={loader:e});let{loader:t,loadingComponent:o,errorComponent:r,delay:n=200,hydrate:i,timeout:a,suspensible:u=!0,onError:m}=e,h=null,v,k=0,p=()=>(k++,h=null,g()),g=()=>{let w;return h||(w=h=t().catch(b=>{if(b=b instanceof Error?b:new Error(String(b)),m)return new Promise((T,N)=>{m(b,()=>T(p()),()=>N(b),k+1)});throw b}).then(b=>w!==h&&h?h:(b&&(b.__esModule||b[Symbol.toStringTag]==="Module")&&(b=b.default),v=b,b)))};return xs({name:"AsyncComponentWrapper",__asyncLoader:g,__asyncHydrate(w,b,T){let N=w.isConnected,R=!1;(b.bu||(b.bu=[])).push(()=>R=!0);let I=()=>{R||!w.parentNode||N&&!w.isConnected||T()},C=i?()=>{let A=i(I,P=>Rd(w,P));A&&(b.bum||(b.bum=[])).push(A)}:I;v?C():g().then(()=>!b.isUnmounted&&C())},get __asyncResolved(){return v},setup(){let w=xe;if(Ro(w),v)return()=>kn(v,w);let b=A=>{h=null,Zs(A,w,13,!r)};if(u&&w.suspense||ws)return g().then(A=>()=>kn(A,w)).catch(A=>(b(A),()=>r?De(r,{error:A}):null));let T=Ze(!1),N=Ze(),R=Ze(!!n),I,C;return en(()=>{I!=null&&clearTimeout(I),C!=null&&clearTimeout(C)}),n&&(C=setTimeout(()=>{w.isUnmounted||(R.value=!1)},n)),a!=null&&(I=setTimeout(()=>{if(!w.isUnmounted&&!T.value&&!N.value){let A=new Error(`Async component timed out after ${a}ms.`);b(A),N.value=A}},a)),g().then(()=>{w.isUnmounted||(T.value=!0,w.parent&&Vn(w.parent.vnode)&&w.parent.update())}).catch(A=>{if(w.isUnmounted){h=null;return}b(A),N.value=A}),()=>{if(T.value&&v)return kn(v,w);if(N.value&&r)return De(r,{error:N.value});if(o&&!R.value)return kn(o,w)}}})}function kn(e,t){let{ref:o,props:r,children:n,ce:i}=t.vnode,a=De(e,r,n);return a.ref=o,a.ce=i,delete t.vnode.ce,a}var Vn=e=>e.type.__isKeepAlive;function ei(e,t){si(e,"a",t)}function ti(e,t){si(e,"da",t)}function si(e,t,o=xe){let r=e.__wdc||(e.__wdc=()=>{let n=o;for(;n;){if(n.isDeactivated)return;n=n.parent}return e()});if(Pn(t,r,o),o){let n=o.parent;for(;n&&n.parent;)Vn(n.parent.vnode)&&Td(r,t,o,n),n=n.parent}}function Td(e,t,o,r){let n=Pn(t,e,r,!0);en(()=>{Ss(r[t],n)},o)}function Pn(e,t,o=xe,r=!1){if(o){let n=o[e]||(o[e]=[]),i=t.__weh||(t.__weh=(...a)=>{Dt();let u=tn(o),m=yt(t,o,e,a);return u(),Rt(),m});return r?n.unshift(i):n.push(i),i}}var zt=e=>(t,o=xe)=>{(!ws||e==="sp")&&Pn(e,(...r)=>t(...r),o)},Od=zt("bm"),It=zt("m"),ni=zt("bu"),oi=zt("u"),ss=zt("bum"),en=zt("um"),Ad=zt("sp"),Id=zt("rtg"),Vd=zt("rtc");function Pd(e,t=xe){Pn("ec",e,t)}var ri="components",qd="directives";function et(e,t){return ii(ri,e,!0,t)||e}var Md=Symbol.for("v-ndc");function be(e){return ii(qd,e)}function ii(e,t,o=!0,r=!1){let n=pt||xe;if(n){let i=n.type;if(e===ri){let u=bu(i,!1);if(u&&(u===t||u===Ke(t)||u===Yt(Ke(t))))return i}let a=Ir(n[e]||i[e],t)||Ir(n.appContext[e],t);return!a&&r?i:a}}function Ir(e,t){return e&&(e[t]||e[Ke(t)]||e[Yt(Ke(t))])}function ne(e,t,o,r){let n,i=o&&o[r],a=Ee(e);if(a||Fe(e)){let u=a&&$t(e),m=!1,h=!1;u&&(m=!it(e),h=kt(e),e=Ls(e)),n=new Array(e.length);for(let v=0,k=e.length;vt(u,m,void 0,i&&i[m]));else{let u=Object.keys(e);n=new Array(u.length);for(let m=0,h=u.length;me?Di(e)?$n(e):Eo(e.parent):null;var Ws=Ge(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Eo(e.parent),$root:e=>Eo(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>To(e),$forceUpdate:e=>e.f||(e.f=()=>{Do(e.update)}),$nextTick:e=>e.n||(e.n=_t.bind(e.proxy)),$watch:e=>Nd.bind(e)});var wo=(e,t)=>e!==Me&&!e.__isScriptSetup&&Ae(e,t),$d={get({_:e},t){if(t==="__v_skip")return!0;let{ctx:o,setupState:r,data:n,props:i,accessCache:a,type:u,appContext:m}=e;if(t[0]!=="$"){let p=a[t];if(p!==void 0)switch(p){case 1:return r[t];case 2:return n[t];case 4:return o[t];case 3:return i[t]}else{if(wo(r,t))return a[t]=1,r[t];if(n!==Me&&Ae(n,t))return a[t]=2,n[t];if(Ae(i,t))return a[t]=3,i[t];if(o!==Me&&Ae(o,t))return a[t]=4,o[t];Co&&(a[t]=0)}}let h=Ws[t],v,k;if(h)return t==="$attrs"&&Xe(e.attrs,"get",""),h(e);if((v=u.__cssModules)&&(v=v[t]))return v;if(o!==Me&&Ae(o,t))return a[t]=4,o[t];if(k=m.config.globalProperties,Ae(k,t))return k[t]},set({_:e},t,o){let{data:r,setupState:n,ctx:i}=e;return wo(n,t)?(n[t]=o,!0):r!==Me&&Ae(r,t)?(r[t]=o,!0):Ae(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=o,!0)},has({_:{data:e,setupState:t,accessCache:o,ctx:r,appContext:n,props:i,type:a}},u){let m;return!!(o[u]||e!==Me&&u[0]!=="$"&&Ae(e,u)||wo(t,u)||Ae(i,u)||Ae(r,u)||Ae(Ws,u)||Ae(n.config.globalProperties,u)||(m=a.__cssModules)&&m[u])},defineProperty(e,t,o){return o.get!=null?e._.accessCache[t]=0:Ae(o,"value")&&this.set(e,t,o.value,null),Reflect.defineProperty(e,t,o)}};function Vr(e){return Ee(e)?e.reduce((t,o)=>(t[o]=null,t),{}):e}var Co=!0;function Ud(e){let t=To(e),o=e.proxy,r=e.ctx;Co=!1,t.beforeCreate&&Pr(t.beforeCreate,e,"bc");let{data:n,computed:i,methods:a,watch:u,provide:m,inject:h,created:v,beforeMount:k,mounted:p,beforeUpdate:g,updated:w,activated:b,deactivated:T,beforeDestroy:N,beforeUnmount:R,destroyed:I,unmounted:C,render:A,renderTracked:P,renderTriggered:Z,errorCaptured:Y,serverPrefetch:j,expose:z,inheritAttrs:ae,components:se,directives:re,filters:ue}=t;if(h&&Ld(h,r,null),a)for(let me in a){let pe=a[me];_e(pe)&&(r[me]=pe.bind(o))}if(n){let me=n.call(o,o);Ve(me)&&(e.data=ze(me))}if(Co=!0,i)for(let me in i){let pe=i[me],Te=_e(pe)?pe.bind(o,o):_e(pe.get)?pe.get.bind(o,o):rt,Re=!_e(pe)&&_e(pe.set)?pe.set.bind(o):rt,Se=tt({get:Te,set:Re});Object.defineProperty(r,me,{enumerable:!0,configurable:!0,get:()=>Se.value,set:D=>Se.value=D})}if(u)for(let me in u)ai(u[me],r,o,me);if(m){let me=_e(m)?m.call(o):m;Reflect.ownKeys(me).forEach(pe=>{ts(pe,me[pe])})}v&&Pr(v,e,"c");function he(me,pe){Ee(pe)?pe.forEach(Te=>me(Te.bind(o))):pe&&me(pe.bind(o))}if(he(Od,k),he(It,p),he(ni,g),he(oi,w),he(ei,b),he(ti,T),he(Pd,Y),he(Vd,P),he(Id,Z),he(ss,R),he(en,C),he(Ad,j),Ee(z))if(z.length){let me=e.exposed||(e.exposed={});z.forEach(pe=>{Object.defineProperty(me,pe,{get:()=>o[pe],set:Te=>o[pe]=Te,enumerable:!0})})}else e.exposed||(e.exposed={});A&&e.render===rt&&(e.render=A),ae!=null&&(e.inheritAttrs=ae),se&&(e.components=se),re&&(e.directives=re),j&&Ro(e)}function Ld(e,t,o=rt){Ee(e)&&(e=No(e));for(let r in e){let n=e[r],i;Ve(n)?"default"in n?i=lt(n.from||r,n.default,!0):i=lt(n.from||r):i=lt(n),Qe(i)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>i.value,set:a=>i.value=a}):t[r]=i}}function Pr(e,t,o){yt(Ee(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,o)}function ai(e,t,o,r){let n=r.includes(".")?Xr(o,r):()=>o[r];if(Fe(e)){let i=t[e];_e(i)&&He(n,i)}else if(_e(e))He(n,e.bind(o));else if(Ve(e))if(Ee(e))e.forEach(i=>ai(i,t,o,r));else{let i=_e(e.handler)?e.handler.bind(o):t[e.handler];_e(i)&&He(n,i,e)}}function To(e){let t=e.type,{mixins:o,extends:r}=t,{mixins:n,optionsCache:i,config:{optionMergeStrategies:a}}=e.appContext,u=i.get(t),m;return u?m=u:!n.length&&!o&&!r?m=t:(m={},n.length&&n.forEach(h=>Sn(m,h,a,!0)),Sn(m,t,a)),Ve(t)&&i.set(t,m),m}function Sn(e,t,o,r=!1){let{mixins:n,extends:i}=t;i&&Sn(e,i,o,!0),n&&n.forEach(a=>Sn(e,a,o,!0));for(let a in t)if(!(r&&a==="expose")){let u=Fd[a]||o&&o[a];e[a]=u?u(e[a],t[a]):t[a]}return e}var Fd={data:qr,props:Mr,emits:Mr,methods:Bs,computed:Bs,beforeCreate:st,created:st,beforeMount:st,mounted:st,beforeUpdate:st,updated:st,beforeDestroy:st,beforeUnmount:st,destroyed:st,unmounted:st,activated:st,deactivated:st,errorCaptured:st,serverPrefetch:st,components:Bs,directives:Bs,watch:Hd,provide:qr,inject:zd};function qr(e,t){return t?e?function(){return Ge(_e(e)?e.call(this,this):e,_e(t)?t.call(this,this):t)}:t:e}function zd(e,t){return Bs(No(e),No(t))}function No(e){if(Ee(e)){let t={};for(let o=0;ot==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Ke(t)}Modifiers`]||e[`${qt(t)}Modifiers`];function Wd(e,t,...o){if(e.isUnmounted)return;let r=e.vnode.props||Me,n=o,i=t.startsWith("update:"),a=i&&jd(r,t.slice(7));a&&(a.trim&&(n=o.map(v=>Fe(v)?v.trim():v)),a.number&&(n=n.map(eo)));let u,m=r[u=Rs(t)]||r[u=Rs(Ke(t))];!m&&i&&(m=r[u=Rs(qt(t))]),m&&yt(m,e,6,n);let h=r[u+"Once"];if(h){if(!e.emitted)e.emitted={};else if(e.emitted[u])return;e.emitted[u]=!0,yt(h,e,6,n)}}var Kd=new WeakMap;function di(e,t,o=!1){let r=o?Kd:t.emitsCache,n=r.get(e);if(n!==void 0)return n;let i=e.emits,a={},u=!1;if(!_e(e)){let m=h=>{let v=di(h,t,!0);v&&(u=!0,Ge(a,v))};!o&&t.mixins.length&&t.mixins.forEach(m),e.extends&&m(e.extends),e.mixins&&e.mixins.forEach(m)}return!i&&!u?(Ve(e)&&r.set(e,null),null):(Ee(i)?i.forEach(m=>a[m]=null):Ge(a,i),Ve(e)&&r.set(e,a),a)}function qn(e,t){return!e||!us(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),Ae(e,t[0].toLowerCase()+t.slice(1))||Ae(e,qt(t))||Ae(e,t))}function ko(e){let{type:t,vnode:o,proxy:r,withProxy:n,propsOptions:[i],slots:a,attrs:u,emit:m,render:h,renderCache:v,props:k,data:p,setupState:g,ctx:w,inheritAttrs:b}=e,T=Cn(e),N,R;try{if(o.shapeFlag&4){let A=n||r,P=A;N=At(h.call(P,A,v,k,g,p,w)),R=u}else{let A=t;N=At(A.length>1?A(k,{attrs:u,slots:a,emit:m}):A(k,null)),R=t.props?u:Yd(u)}}catch(A){es.length=0,Zs(A,e,1),N=De(Ft)}let I=N,C;if(R&&b!==!1){let A=Object.keys(R),{shapeFlag:P}=I;A.length&&P&7&&(i&&A.some(cs)&&(R=Jd(R,i)),I=bs(I,R,!1,!0))}if(o.dirs&&(I=bs(I,null,!1,!0),I.dirs=I.dirs?I.dirs.concat(o.dirs):o.dirs),o.transition){let A=An(I.type)&&Zr(I)||I;In(A,o.transition)}return N=I,Cn(T),N}var Yd=e=>{let t;for(let o in e)(o==="class"||o==="style"||us(o))&&((t||(t={}))[o]=e[o]);return t},Jd=(e,t)=>{let o={};for(let r in e)(!cs(r)||!(r.slice(9)in t))&&(o[r]=e[r]);return o};function Qd(e,t,o){let{props:r,children:n,component:i}=e,{props:a,children:u,patchFlag:m}=t,h=i.emitsOptions;if(t.dirs||t.transition)return!0;if(o&&m>=0){if(m&1024)return!0;if(m&16)return r?$r(r,a,h):!!a;if(m&8){let v=t.dynamicProps;for(let k=0;kObject.create(ci),fi=e=>Object.getPrototypeOf(e)===ci;function Zd(e,t,o,r=!1){let n={},i=pi();e.propsDefaults=Object.create(null),mi(e,t,n,i);for(let a in e.propsOptions[0])a in n||(n[a]=void 0);o?e.props=r?n:Fs(n):e.type.props?e.props=n:e.props=i,e.attrs=i}function xd(e,t,o,r){let{props:n,attrs:i,vnode:{patchFlag:a}}=e,u=Ie(n),[m]=e.propsOptions,h=!1;if((r||a>0)&&!(a&16)){if(a&8){let v=e.vnode.dynamicProps;for(let k=0;k{m=!0;let[p,g]=hi(k,t,!0);Ge(a,p),g&&u.push(...g)};!o&&t.mixins.length&&t.mixins.forEach(v),e.extends&&v(e.extends),e.mixins&&e.mixins.forEach(v)}if(!i&&!m)return Ve(e)&&r.set(e,Kt),Kt;if(Ee(i))for(let v=0;ve==="_"||e==="_ctx"||e==="$stable",Ao=e=>Ee(e)?e.map(At):[At(e)],tu=(e,t,o)=>{if(t._n)return t;let r=_d((...n)=>Ao(t(...n)),o);return r._c=!1,r},vi=(e,t,o)=>{let r=e._ctx;for(let n in e){if(Oo(n))continue;let i=e[n];if(_e(i))t[n]=tu(n,i,r);else if(i!=null){let a=Ao(i);t[n]=()=>a}}},yi=(e,t)=>{let o=Ao(t);e.slots.default=()=>o},gi=(e,t,o)=>{for(let r in t)(o||!Oo(r))&&(e[r]=t[r])},su=(e,t,o)=>{let r=e.slots=pi();if(e.vnode.shapeFlag&32){let n=t._;n?(gi(r,t,o),o&&un(r,"_",n,!0)):vi(t,r)}else t&&yi(e,t)},nu=(e,t,o)=>{let{vnode:r,slots:n}=e,i=!0,a=Me;if(r.shapeFlag&32){let u=t._;u?o&&u===1?i=!1:gi(n,t,o):(i=!t.$stable,vi(t,n)),a=t}else t&&(yi(e,t),a={default:1});if(i)for(let u in n)!Oo(u)&&a[u]==null&&delete n[u]};function ou(){let e=[]}var at=lu;function bi(e){return ru(e)}function ru(e,t){ou();let o=Os();o.__VUE__=!0;let{insert:r,remove:n,patchProp:i,createElement:a,createText:u,createComment:m,setText:h,setElementText:v,parentNode:k,nextSibling:p,setScopeId:g=rt,insertStaticContent:w}=e,b=(_,S,q,F=null,G=null,M=null,Q=void 0,x=null,X=!!S.dynamicChildren)=>{if(_===S)return;_&&!Hs(_,S)&&(F=te(_),V(_,G,M,!0),_=null),S.patchFlag===-2&&(X=!1,S.dynamicChildren=null);let{type:H,ref:de,shapeFlag:ee}=S;switch(H){case Mn:T(_,S,q,F);break;case Ft:N(_,S,q,F);break;case Ks:_==null&&R(S,q,F,Q);break;case J:re(_,S,q,F,G,M,Q,x,X);break;default:ee&1?P(_,S,q,F,G,M,Q,x,X):ee&6?ue(_,S,q,F,G,M,Q,x,X):(ee&64||ee&128)&&H.process(_,S,q,F,G,M,Q,x,X,fe)}de!=null&&G?Gs(de,_&&_.ref,M,S||_,!S):de==null&&_&&_.ref!=null&&Gs(_.ref,null,M,_,!0)},T=(_,S,q,F)=>{if(_==null)r(S.el=u(S.children),q,F);else{let G=S.el=_.el;S.children!==_.children&&h(G,S.children)}},N=(_,S,q,F)=>{_==null?r(S.el=m(S.children||""),q,F):S.el=_.el},R=(_,S,q,F)=>{[_.el,_.anchor]=w(_.children,S,q,F,_.el,_.anchor)},I=(_,S,q,F)=>{if(S.children!==_.children){let G=p(_.anchor);A(_),[S.el,S.anchor]=w(S.children,q,G,F)}else S.el=_.el,S.anchor=_.anchor},C=({el:_,anchor:S},q,F)=>{let G;for(;_&&_!==S;)G=p(_),r(_,q,F),_=G;r(S,q,F)},A=({el:_,anchor:S})=>{let q;for(;_&&_!==S;)q=p(_),n(_),_=q;n(S)},P=(_,S,q,F,G,M,Q,x,X)=>{if(S.type==="svg"?Q="svg":S.type==="math"&&(Q="mathml"),_==null)Z(S,q,F,G,M,Q,x,X);else{let H=_.el&&_.el._isVueCE?_.el:null;try{H&&H._beginPatch(),z(_,S,G,M,Q,x,X)}finally{H&&H._endPatch()}}},Z=(_,S,q,F,G,M,Q,x)=>{let X,H,{props:de,shapeFlag:ee,transition:ie,dirs:ve}=_;if(X=_.el=a(_.type,M,de&&de.is,de),ee&8?v(X,_.children):ee&16&&j(_.children,X,null,F,G,_o(_,M),Q,x),ve&&Zt(_,null,F,"created"),Y(X,_,_.scopeId,Q,F),de){for(let Ue in de)Ue!=="value"&&!ps(Ue)&&i(X,Ue,null,de[Ue],M,F);"value"in de&&i(X,"value",null,de.value,M),(H=de.onVnodeBeforeMount)&&Tt(H,F,_)}ve&&Zt(_,null,F,"beforeMount");let Oe=iu(G,ie);Oe&&ie.beforeEnter(X),r(X,S,q),((H=de&&de.onVnodeMounted)||Oe||ve)&&at(()=>{let $e;try{H&&Tt(H,F,_),Oe&&ie.enter(X),ve&&Zt(_,null,F,"mounted")}finally{}},G)},Y=(_,S,q,F,G)=>{if(q&&g(_,q),F)for(let M=0;M{for(let H=X;H<_.length;H++){let de=_[H]=x?Lt(_[H]):At(_[H]);b(null,de,S,q,F,G,M,Q,x)}},z=(_,S,q,F,G,M,Q)=>{let x=S.el=_.el,{patchFlag:X,dynamicChildren:H,dirs:de}=S;X|=_.patchFlag&16;let ee=_.props||Me,ie=S.props||Me,ve;if(q&&xt(q,!1),(ve=ie.onVnodeBeforeUpdate)&&Tt(ve,q,S,_),de&&Zt(S,_,q,"beforeUpdate"),q&&xt(q,!0),H&&(!_.dynamicChildren||_.dynamicChildren.length!==H.length)&&(X=0,Q=!1,H=null),(ee.innerHTML&&ie.innerHTML==null||ee.textContent&&ie.textContent==null)&&v(x,""),H?ae(_.dynamicChildren,H,x,q,F,_o(S,G),M):Q||Te(_,S,x,null,q,F,_o(S,G),M,!1),X>0){if(X&16)se(x,ee,ie,q,G);else if(X&2&&ee.class!==ie.class&&i(x,"class",null,ie.class,G),X&4&&i(x,"style",ee.style,ie.style,G),X&8){let Oe=S.dynamicProps;for(let Ue=0;Ue{ve&&Tt(ve,q,S,_),de&&Zt(S,_,q,"updated")},F)},ae=(_,S,q,F,G,M,Q)=>{for(let x=0;x{if(S!==q){if(S!==Me)for(let M in S)!ps(M)&&!(M in q)&&i(_,M,S[M],null,G,F);for(let M in q){if(ps(M))continue;let Q=q[M],x=S[M];Q!==x&&M!=="value"&&i(_,M,x,Q,G,F)}"value"in q&&i(_,"value",S.value,q.value,G)}},re=(_,S,q,F,G,M,Q,x,X)=>{let H=S.el=_?_.el:u(""),de=S.anchor=_?_.anchor:u(""),{patchFlag:ee,dynamicChildren:ie,slotScopeIds:ve}=S;ve&&(x=x?x.concat(ve):ve),_==null?(r(H,q,F),r(de,q,F),j(S.children||[],q,de,G,M,Q,x,X)):ee>0&&ee&64&&ie&&_.dynamicChildren&&_.dynamicChildren.length===ie.length?(ae(_.dynamicChildren,ie,q,G,M,Q,x),(S.key!=null||G&&S===G.subTree)&&wi(_,S,!0)):Te(_,S,q,de,G,M,Q,x,X)},ue=(_,S,q,F,G,M,Q,x,X)=>{S.slotScopeIds=x,_==null?S.shapeFlag&512?G.ctx.activate(S,q,F,Q,X):ke(S,q,F,G,M,Q,X):he(_,S,X)},ke=(_,S,q,F,G,M,Q)=>{let x=_.component=mu(_,F,G);if(Vn(_)&&(x.ctx.renderer=fe),hu(x,!1,Q),x.asyncDep){if(G&&G.registerDep(x,me,Q),!_.el){let X=x.subTree=De(Ft);N(null,X,S,q),_.placeholder=X.el}}else me(x,_,S,q,G,M,Q)},he=(_,S,q)=>{let F=S.component=_.component;if(Qd(_,S,q))if(F.asyncDep&&!F.asyncResolved){pe(F,S,q);return}else F.next=S,F.update();else S.el=_.el,F.vnode=S},me=(_,S,q,F,G,M,Q)=>{let x=()=>{if(_.isMounted){let{next:ee,bu:ie,u:ve,parent:Oe,vnode:Ue}=_;{let dt=ki(_);if(dt){ee&&(ee.el=Ue.el,pe(_,ee,Q)),dt.asyncDep.then(()=>{at(()=>{_.isUnmounted||H()},G)});return}}let $e=ee,je;xt(_,!1),ee?(ee.el=Ue.el,pe(_,ee,Q)):ee=Ue,ie&&Ts(ie),(je=ee.props&&ee.props.onVnodeBeforeUpdate)&&Tt(je,Oe,ee,Ue),xt(_,!0);let We=ko(_),bt=_.subTree;_.subTree=We,b(bt,We,k(bt.el),te(bt),_,G,M),ee.el=We.el,$e===null&&Xd(_,We.el),ve&&at(ve,G),(je=ee.props&&ee.props.onVnodeUpdated)&&at(()=>Tt(je,Oe,ee,Ue),G)}else{let ee,{el:ie,props:ve}=S,{bm:Oe,m:Ue,parent:$e,root:je,type:We}=_,bt=js(S);if(xt(_,!1),Oe&&Ts(Oe),!bt&&(ee=ve&&ve.onVnodeBeforeMount)&&Tt(ee,$e,S),xt(_,!0),ie&&ce){let dt=()=>{_.subTree=ko(_),ce(ie,_.subTree,_,G,null)};bt&&We.__asyncHydrate?We.__asyncHydrate(ie,_,dt):dt()}else{je.ce&&je.ce._hasShadowRoot()&&je.ce._injectChildStyle(We,_.parent?_.parent.type:void 0);let dt=_.subTree=ko(_);b(null,dt,q,F,_,G,M),S.el=dt.el}if(Ue&&at(Ue,G),!bt&&(ee=ve&&ve.onVnodeMounted)){let dt=S;at(()=>Tt(ee,$e,dt),G)}(S.shapeFlag&256||$e&&js($e.vnode)&&$e.vnode.shapeFlag&256)&&_.a&&at(_.a,G),_.isMounted=!0,S=q=F=null}};_.scope.on();let X=_.effect=new hs(x);_.scope.off();let H=_.update=X.run.bind(X),de=_.job=X.runIfDirty.bind(X);de.i=_,de.id=_.uid,X.scheduler=()=>Do(de),xt(_,!0),H()},pe=(_,S,q)=>{S.component=_;let F=_.vnode.props;_.vnode=S,_.next=null,xd(_,S.props,F,q),nu(_,S.children,q),Dt(),Rr(_),Rt()},Te=(_,S,q,F,G,M,Q,x,X=!1)=>{let H=_&&_.children,de=_?_.shapeFlag:0,ee=S.children,{patchFlag:ie,shapeFlag:ve}=S;if(ie>0){if(ie&128){Se(H,ee,q,F,G,M,Q,x,X);return}else if(ie&256){Re(H,ee,q,F,G,M,Q,x,X);return}}ve&8?(de&16&&U(H,G,M),ee!==H&&v(q,ee)):de&16?ve&16?Se(H,ee,q,F,G,M,Q,x,X):U(H,G,M,!0):(de&8&&v(q,""),ve&16&&j(ee,q,F,G,M,Q,x,X))},Re=(_,S,q,F,G,M,Q,x,X)=>{_=_||Kt,S=S||Kt;let H=_.length,de=S.length,ee=Math.min(H,de),ie;for(ie=0;iede?U(_,G,M,!0,!1,ee):j(S,q,F,G,M,Q,x,X,ee)},Se=(_,S,q,F,G,M,Q,x,X)=>{let H=0,de=S.length,ee=_.length-1,ie=de-1;for(;H<=ee&&H<=ie;){let ve=_[H],Oe=S[H]=X?Lt(S[H]):At(S[H]);if(Hs(ve,Oe))b(ve,Oe,q,null,G,M,Q,x,X);else break;H++}for(;H<=ee&&H<=ie;){let ve=_[ee],Oe=S[ie]=X?Lt(S[ie]):At(S[ie]);if(Hs(ve,Oe))b(ve,Oe,q,null,G,M,Q,x,X);else break;ee--,ie--}if(H>ee){if(H<=ie){let ve=ie+1,Oe=veie)for(;H<=ee;)V(_[H],G,M,!0),H++;else{let ve=H,Oe=H,Ue=new Map;for(H=Oe;H<=ie;H++){let ut=S[H]=X?Lt(S[H]):At(S[H]);ut.key!=null&&Ue.set(ut.key,H)}let $e,je=0,We=ie-Oe+1,bt=!1,dt=0,Ns=new Array(We);for(H=0;H=We){V(ut,G,M,!0);continue}let Et;if(ut.key!=null)Et=Ue.get(ut.key);else for($e=Oe;$e<=ie;$e++)if(Ns[$e-Oe]===0&&Hs(ut,S[$e])){Et=$e;break}Et===void 0?V(ut,G,M,!0):(Ns[Et-Oe]=H+1,Et>=dt?dt=Et:bt=!0,b(ut,S[Et],q,null,G,M,Q,x,X),je++)}let Zo=bt?au(Ns):Kt;for($e=Zo.length-1,H=We-1;H>=0;H--){let ut=Oe+H,Et=S[ut],xo=S[ut+1],er=ut+1{let{el:M,type:Q,transition:x,children:X,shapeFlag:H}=_;if(H&6){D(_.component.subTree,S,q,F);return}if(H&128){_.suspense.move(S,q,F);return}if(H&64){Q.move(_,S,q,fe);return}if(Q===J){r(M,S,q);for(let ee=0;eex.enter(M),G));else{let{leave:ee,delayLeave:ie,afterLeave:ve}=x,Oe=()=>{_.ctx.isUnmounted?n(M):r(M,S,q)},Ue=()=>{let $e=M._isLeaving||!!M[bo];M._isLeaving&&M[bo](!0),x.persisted&&!$e?Oe():ee(M,()=>{Oe(),ve&&ve()})};ie?ie(M,Oe,Ue):Ue()}else r(M,S,q)},V=(_,S,q,F=!1,G=!1)=>{let{type:M,props:Q,ref:x,children:X,dynamicChildren:H,shapeFlag:de,patchFlag:ee,dirs:ie,cacheIndex:ve,memo:Oe}=_;if(ee===-2&&(G=!1),x!=null&&(Dt(),Gs(x,null,q,_,!0),Rt()),ve!=null&&(S.renderCache[ve]=void 0),de&256){S.ctx.deactivate(_);return}let Ue=de&1&&ie,$e=!js(_),je;if($e&&(je=Q&&Q.onVnodeBeforeUnmount)&&Tt(je,S,_),de&6)le(_.component,q,F);else{if(de&128){_.suspense.unmount(q,F);return}Ue&&Zt(_,null,S,"beforeUnmount"),de&64?_.type.remove(_,S,q,fe,F):H&&!H.hasOnce&&(M!==J||ee>0&&ee&64)?U(H,S,q,!1,!0):(M===J&&ee&384||!G&&de&16)&&U(X,S,q),F&&W(_)}let We=Oe!=null&&ve==null;($e&&(je=Q&&Q.onVnodeUnmounted)||Ue||We)&&at(()=>{je&&Tt(je,S,_),Ue&&Zt(_,null,S,"unmounted"),We&&(_.el=null)},q)},W=_=>{let{type:S,el:q,anchor:F,transition:G}=_;if(S===J){oe(q,F);return}if(S===Ks){A(_);return}let M=()=>{n(q),G&&!G.persisted&&G.afterLeave&&G.afterLeave()};if(_.shapeFlag&1&&G&&!G.persisted){let{leave:Q,delayLeave:x}=G,X=()=>Q(q,M);x?x(_.el,M,X):X()}else M()},oe=(_,S)=>{let q;for(;_!==S;)q=p(_),n(_),_=q;n(S)},le=(_,S,q)=>{let{bum:F,scope:G,job:M,subTree:Q,um:x,m:X,a:H}=_;Lr(X),Lr(H),F&&Ts(F),G.stop(),M&&(M.flags|=8,V(Q,_,S,q)),x&&at(x,S),at(()=>{_.isUnmounted=!0},S)},U=(_,S,q,F=!1,G=!1,M=0)=>{for(let Q=M;Q<_.length;Q++)V(_[Q],S,q,F,G)},te=_=>{if(_.shapeFlag&6)return te(_.component.subTree);if(_.shapeFlag&128)return _.suspense.next();let S=p(_.anchor||_.el),q=S&&S[Sd];return q?p(q):S},L=!1,K=(_,S,q)=>{let F;_==null?S._vnode&&(V(S._vnode,null,null,!0),F=S._vnode.component):b(S._vnode||null,_,S,null,null,null,q),S._vnode=_,L||(L=!0,Rr(F),Kr(),L=!1)},fe={p:b,um:V,m:D,r:W,mt:ke,mc:j,pc:Te,pbc:ae,n:te,o:e},Ce,ce;return t&&([Ce,ce]=t(fe)),{render:K,hydrate:Ce,createApp:Gd(K,Ce)}}function _o({type:e,props:t},o){return o==="svg"&&e==="foreignObject"||o==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:o}function xt({effect:e,job:t},o){o?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function iu(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function wi(e,t,o=!1){let r=e.children,n=t.children;if(Ee(r)&&Ee(n))for(let i=0;i>1,e[o[u]]0&&(t[r]=o[i-1]),o[i]=r)}}for(i=o.length,a=o[i-1];i-- >0;)o[i]=a,a=t[a];return o}function ki(e){let t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:ki(t)}function Lr(e){if(e)for(let t=0;te.__isSuspense;function lu(e,t){t&&t.pendingBranch?Ee(e)?t.effects.push(...e):t.effects.push(e):Wr(e)}var J=Symbol.for("v-fgt"),Mn=Symbol.for("v-txt"),Ft=Symbol.for("v-cmt"),Ks=Symbol.for("v-stc"),es=[],ft=null;function l(e=!1){es.push(ft=e?null:[])}function Ci(){es.pop(),ft=es[es.length-1]||null}var Js=1;function Dn(e,t=!1){Js+=e,e<0&&ft&&t&&(ft.hasOnce=!0)}function Ni(e){return e.dynamicChildren=Js>0?ft||Kt:null,Ci(),Js>0&&ft&&ft.push(e),e}function d(e,t,o,r,n,i){return Ni(s(e,t,o,r,n,i,!0))}function ks(e,t,o,r,n){return Ni(De(e,t,o,r,n,!0))}function Rn(e){return e?e.__v_isVNode===!0:!1}function Hs(e,t){return e.type===t.type&&e.key===t.key}var Si=({key:e})=>e??null,_n=({ref:e,ref_key:t,ref_for:o})=>(typeof e=="number"&&(e=""+e),e!=null?Fe(e)||Qe(e)||_e(e)?{i:pt,r:e,k:t,f:!!o}:e:null);function s(e,t=null,o=null,r=0,n=null,i=e===J?0:1,a=!1,u=!1){let m={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Si(t),ref:t&&_n(t),scopeId:Jr,slotScopeIds:null,children:o,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:r,dynamicProps:n,dynamicChildren:null,appContext:null,ctx:pt};return u?(Tn(m,o),i&128&&e.normalize(m)):o&&(m.shapeFlag|=Fe(o)?8:16),Js>0&&!a&&ft&&(m.patchFlag>0||i&6)&&m.patchFlag!==32&&ft.push(m),m}var De=du;function du(e,t=null,o=null,r=0,n=null,i=!1){if((!e||e===Md)&&(e=Ft),Rn(e)){let u=bs(e,t,!0);return o&&Tn(u,o),Js>0&&!i&&ft&&(u.shapeFlag&6?ft[ft.indexOf(e)]=u:ft.push(u)),u.patchFlag=-2,u}if(wu(e)&&(e=e.__vccOpts),t){t=uu(t);let{class:u,style:m}=t;u&&!Fe(u)&&(t.class=O(u)),Ve(m)&&(zs(m)&&!Ee(m)&&(m=Ge({},m)),t.style=Pe(m))}let a=Fe(e)?1:Ei(e)?128:An(e)?64:Ve(e)?4:_e(e)?2:0;return s(e,t,o,r,n,a,i,!0)}function uu(e){return e?zs(e)||fi(e)?Ge({},e):e:null}function bs(e,t,o=!1,r=!1){let{props:n,ref:i,patchFlag:a,children:u,transition:m}=e,h=t?cu(n||{},t):n,v={__v_isVNode:!0,__v_skip:!0,type:e.type,props:h,key:h&&Si(h),ref:t&&t.ref?o&&i?Ee(i)?i.concat(_n(t)):[i,_n(t)]:_n(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:u,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==J?a===-1?16:a|16:a,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:m,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&bs(e.ssContent),ssFallback:e.ssFallback&&bs(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return m&&r&&In(v,m.clone(v)),v}function y(e=" ",t=0){return De(Mn,null,e,t)}function ge(e,t){let o=De(Ks,null,e);return o.staticCount=t,o}function f(e="",t=!1){return t?(l(),ks(Ft,null,e)):De(Ft,null,e)}function At(e){return e==null||typeof e=="boolean"?De(Ft):Ee(e)?De(J,null,e.slice()):Rn(e)?Lt(e):De(Mn,null,String(e))}function Lt(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:bs(e)}function Tn(e,t){let o=0,{shapeFlag:r}=e;if(t==null)t=null;else if(Ee(t))o=16;else if(typeof t=="object")if(r&65){let n=t.default;n&&(n._c&&(n._d=!1),Tn(e,n()),n._c&&(n._d=!0));return}else{o=32;let n=t._;!n&&!fi(t)?t._ctx=pt:n===3&&pt&&(pt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(_e(t)){if(r&65){Tn(e,{default:t});return}t={default:t,_ctx:pt},o=32}else t=String(t),r&64?(o=16,t=[y(t)]):o=8;e.children=t,e.shapeFlag|=o}function cu(...e){let t={};for(let o=0;oxe||pt,On,Qs;{let e=Os(),t=(o,r)=>{let n;return(n=e[o])||(n=e[o]=[]),n.push(r),i=>{n.length>1?n.forEach(a=>a(i)):n[0](i)}};On=t("__VUE_INSTANCE_SETTERS__",o=>xe=o),Qs=t("__VUE_SSR_SETTERS__",o=>ws=o)}var tn=e=>{let t=xe;return On(e),e.scope.on(),()=>{e.scope.off(),On(t)}},Fr=()=>{xe&&xe.scope.off(),On(null)};function Di(e){return e.vnode.shapeFlag&4}var ws=!1;function hu(e,t=!1,o=!1){t&&Qs(t);let{props:r,children:n}=e.vnode,i=Di(e);Zd(e,r,i,t),su(e,n,o||t);let a=i?vu(e,t):void 0;return t&&Qs(!1),a}function vu(e,t){let o=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,$d);let{setup:r}=o;if(r){Dt();let n=e.setupContext=r.length>1?gu(e):null,i=tn(e),a=Xs(r,e,0,[e.props,n]),u=Zn(a);if(Rt(),i(),(u||e.sp)&&!js(e)&&Ro(e),u){if(a.then(Fr,Fr),t)return a.then(m=>{Qs(!0);try{zr(e,m,t)}finally{Qs(!1)}}).catch(m=>{Zs(m,e,0)});e.asyncDep=a}else zr(e,a,t)}else Ri(e,t)}function zr(e,t,o){_e(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Ve(t)&&(e.setupState=wn(t)),Ri(e,o)}var Hr,Br;function Ri(e,t,o){let r=e.type;if(!e.render){if(!t&&Hr&&!r.render){let n=r.template||To(e).template;if(n){let{isCustomElement:i,compilerOptions:a}=e.appContext.config,{delimiters:u,compilerOptions:m}=r,h=Ge(Ge({isCustomElement:i,delimiters:u},a),m);r.render=Hr(n,h)}}e.render=r.render||rt,Br&&Br(e)}{let n=tn(e);Dt();try{Ud(e)}finally{Rt(),n()}}}var yu={get(e,t){return Xe(e,"get",""),e[t]}};function gu(e){let t=o=>{e.exposed=o||{}};return{attrs:new Proxy(e.attrs,yu),slots:e.slots,emit:e.emit,expose:t}}function $n(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(wn(go(e.exposed)),{get(t,o){if(o in t)return t[o];if(o in Ws)return Ws[o](e)},has(t,o){return o in t||o in Ws}})):e.proxy}function bu(e,t=!0){return _e(e)?e.displayName||e.name:e.name||t&&e.__name}function wu(e){return _e(e)&&"__vccOpts"in e}var tt=(e,t)=>Nr(e,t,ws);function Ne(e,t,o){try{Dn(-1);let r=arguments.length;return r===2?Ve(t)&&!Ee(t)?Rn(t)?De(e,null,[t]):De(e,t):De(e,null,t):(r>3?o=Array.prototype.slice.call(arguments,2):r===3&&Rn(o)&&(o=[o]),De(e,t,o))}finally{Dn(1)}}var ku="3.5.42";var qo,Ti=typeof window<"u"&&window.trustedTypes;if(Ti)try{qo=Ti.createPolicy("vue",{createHTML:e=>e})}catch{}var Ui=qo?e=>qo.createHTML(e):e=>e,_u="http://www.w3.org/2000/svg",Eu="http://www.w3.org/1998/Math/MathML",Ht=typeof document<"u"?document:null,Oi=Ht&&Ht.createElement("template"),Cu={insert:(e,t,o)=>{t.insertBefore(e,o||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,o,r)=>{let n=t==="svg"?Ht.createElementNS(_u,e):t==="mathml"?Ht.createElementNS(Eu,e):o?Ht.createElement(e,{is:o}):Ht.createElement(e);return e==="select"&&r&&r.multiple!=null&&n.setAttribute("multiple",r.multiple),n},createText:e=>Ht.createTextNode(e),createComment:e=>Ht.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Ht.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,o,r,n,i){let a=o?o.previousSibling:t.lastChild;if(n&&(n===i||n.nextSibling))for(;t.insertBefore(n.cloneNode(!0),o),!(n===i||!(n=n.nextSibling)););else{Oi.innerHTML=Ui(r==="svg"?`${e}`:r==="mathml"?`${e}`:e);let u=Oi.content;if(r==="svg"||r==="mathml"){let m=u.firstChild;for(;m.firstChild;)u.appendChild(m.firstChild);u.removeChild(m)}t.insertBefore(u,o)}return[a?a.nextSibling:t.firstChild,o?o.previousSibling:t.lastChild]}};var Nu=Symbol("_vtc");function Su(e,t,o){let r=e[Nu];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):o?e.setAttribute("class",t):e.className=t}var Ln=Symbol("_vod"),Li=Symbol("_vsh"),B={name:"show",beforeMount(e,{value:t},{transition:o}){e[Ln]=e.style.display==="none"?"":e.style.display,o&&t?o.beforeEnter(e):sn(e,t)},mounted(e,{value:t},{transition:o}){o&&t&&o.enter(e)},updated(e,{value:t,oldValue:o},{transition:r}){!t!=!o&&(r?t?(r.beforeEnter(e),sn(e,!0),r.enter(e)):r.leave(e,()=>{sn(e,!1)}):sn(e,t))},beforeUnmount(e,{value:t}){sn(e,t)}};function sn(e,t){e.style.display=t?e[Ln]:"none",e[Li]=!t}var Du=Symbol("");var Ru=/(?:^|;)\s*display\s*:/;function Tu(e,t,o){let r=e.style,n=Fe(o),i=!1;if(o&&!n){if(t)if(Fe(t))for(let a of t.split(";")){let u=a.slice(0,a.indexOf(":")).trim();o[u]==null&&nn(r,u,"")}else for(let a in t)o[a]==null&&nn(r,a,"");for(let a in o){a==="display"&&(i=!0);let u=o[a];u!=null?Au(e,a,!Fe(t)&&t?t[a]:void 0,u)||nn(r,a,u):nn(r,a,"")}}else if(n){if(t!==o){let a=r[Du];a&&(o+=";"+a),r.cssText=o,i=Ru.test(o)}}else t&&e.removeAttribute("style");Ln in e&&(e[Ln]=i?r.display:"",e[Li]&&(r.display="none"))}var Un=/\s*!important$/;function nn(e,t,o){if(Ee(o))o.forEach(r=>nn(e,t,r));else if(o==null&&(o=""),t.startsWith("--"))Un.test(o)?e.setProperty(t,o.replace(Un,""),"important"):e.setProperty(t,o);else{let r=Ou(e,t);Un.test(o)?e.setProperty(qt(r),o.replace(Un,""),"important"):e[r]=o}}var Ai=["Webkit","Moz","ms"],Vo={};function Ou(e,t){let o=Vo[t];if(o)return o;let r=Ke(t);if(r!=="filter"&&r in e)return Vo[t]=r;r=Yt(r);for(let n=0;nPo||(Uu.then(()=>Po=0),Po=Date.now());function Fu(e,t){let o=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=o.attached)return;let n=o.value;if(Ee(n)){let i=r.stopImmediatePropagation;r.stopImmediatePropagation=()=>{i.call(r),r._stopped=!0};let a=n.slice(),u=[r];for(let m=0;me.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,zu=(e,t,o,r,n,i)=>{let a=n==="svg";t==="class"?Su(e,r,a):t==="style"?Tu(e,o,r):us(t)?cs(t)||Pu(e,t,o,r,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Hu(e,t,r,a))?(Pi(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Vi(e,t,r,a,i,t!=="value")):e._isVueCE&&(Bu(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Fe(r)))?Pi(e,Ke(t),r,i,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),Vi(e,t,r,a))};function Hu(e,t,o,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&Mi(t)&&_e(o));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){let n=e.tagName;if(n==="IMG"||n==="VIDEO"||n==="CANVAS"||n==="SOURCE")return!1}return Mi(t)&&Fe(o)?!1:t in e}function Bu(e,t){let o=e._def.props;if(!o)return!1;let r=Ke(t);return Array.isArray(o)?o.some(n=>Ke(n)===r):Object.keys(o).some(n=>Ke(n)===r)}var Gu=["ctrl","shift","alt","meta"],ju={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Gu.some(o=>e[`${o}Key`]&&!t.includes(o))},we=(e,t)=>{if(!e)return e;let o=e._withMods||(e._withMods={}),r=t.join(".");return o[r]||(o[r]=((n,...i)=>{for(let a=0;a{let t=Ku().createApp(...e),{mount:o}=t;return t.mount=r=>{let n=Ju(r);if(!n)return;let i=t._component;!_e(i)&&!i.render&&!i.template&&(i.template=n.innerHTML),n.nodeType===1&&(n.textContent="");let a=o(n,!1,Yu(n));return n instanceof Element&&(n.removeAttribute("v-cloak"),n.setAttribute("data-v-app","")),a},t});function Yu(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Ju(e){return Fe(e)?document.querySelector(e):e}var rs=typeof document<"u";function Hi(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Qu(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&Hi(e.default)}var qe=Object.assign;function Fn(e,t){let o={};for(let r in t){let n=t[r];o[r]=gt(n)?n.map(e):e(n)}return o}var Es=()=>{},gt=Array.isArray;function Uo(e,t){let o={};for(let r in e)o[r]=r in t?t[r]:e[r];return o}var Bi=/#/g,Xu=/&/g,Zu=/\//g,xu=/=/g,ec=/\?/g,Gi=/\+/g,tc=/%5B/g,sc=/%5D/g,ji=/%5E/g,nc=/%60/g,Wi=/%7B/g,oc=/%7C/g,Ki=/%7D/g,rc=/%20/g;function Lo(e){return e==null?"":encodeURI(""+e).replace(oc,"|").replace(tc,"[").replace(sc,"]")}function Yi(e){return Lo(e).replace(Wi,"{").replace(Ki,"}").replace(ji,"^")}function Mo(e){return Lo(e).replace(Gi,"%2B").replace(rc,"+").replace(Bi,"%23").replace(Xu,"%26").replace(nc,"`").replace(Wi,"{").replace(Ki,"}").replace(ji,"^")}function ic(e){return Mo(e).replace(xu,"%3D")}function ac(e){return Lo(e).replace(Bi,"%23").replace(ec,"%3F")}function Ji(e){return ac(e).replace(Zu,"%2F")}function _s(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}var lc=/\/$/,dc=e=>e.replace(lc,"");function zn(e,t,o="/"){let r,n={},i="",a="",u=t.indexOf("#"),m=t.indexOf("?");return m=u>=0&&m>u?-1:m,m>=0&&(r=t.slice(0,m),i=t.slice(m,u>0?u:t.length),n=e(i.slice(1))),u>=0&&(r=r||t.slice(0,u),a=t.slice(u,t.length)),r=cc(r??t,o),{fullPath:r+i+a,path:r,query:n,hash:_s(a)}}function Qi(e,t){let o=t.query?e(t.query):"";return t.path+(o&&"?")+o+(t.hash||"")}function Fo(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Xi(e,t,o){let r=t.matched.length-1,n=o.matched.length-1;return r>-1&&r===n&&ns(t.matched[r],o.matched[n])&&zo(t.params,o.params)&&e(t.query)===e(o.query)&&t.hash===o.hash}function ns(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function zo(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var o in e)if(!uc(e[o],t[o]))return!1;return!0}function uc(e,t){return gt(e)?zi(e,t):gt(t)?zi(t,e):e?.valueOf()===t?.valueOf()}function zi(e,t){return gt(t)?e.length===t.length&&e.every((o,r)=>o===t[r]):e.length===1&&e[0]===t}function cc(e,t){if(e.startsWith("/"))return e;if(!e)return t;let o=t.split("/"),r=e.split("/"),n=r[r.length-1];(n===".."||n===".")&&r.push("");let i=o.length-1,a,u;for(a=0;a1&&i--;else break;return o.slice(0,i).join("/")+"/"+r.slice(a).join("/")}var Gt={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},Hn=(function(e){return e.pop="pop",e.push="push",e})({}),Bn=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function Zi(e){if(!e)if(rs){let t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),dc(e)}var pc=/^[^#]+#/;function xi(e,t){return e.replace(pc,"#")+t}function fc(e,t){let o=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-o.left-(t.left||0),top:r.top-o.top-(t.top||0)}}var on=()=>({left:window.scrollX,top:window.scrollY});function ea(e){let t;if("el"in e){let o=e.el,r=typeof o=="string"&&o.startsWith("#"),n=typeof o=="string"?r?document.getElementById(o.slice(1)):document.querySelector(o):o;if(!n)return;t=fc(n,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function Ho(e,t){return(history.state?history.state.position-t:-1)+e}var $o=new Map;function ta(e,t){$o.set(e,t)}function sa(e){let t=$o.get(e);return $o.delete(e),t}function mc(e){return typeof e=="string"||e&&typeof e=="object"}function Bo(e){return typeof e=="string"||typeof e=="symbol"}var Be=(function(e){return e[e.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",e[e.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",e[e.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",e[e.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",e[e.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",e})({}),na=Symbol("");var c5={[Be.MATCHER_NOT_FOUND]({location:e,currentLocation:t}){return`No match for +"use strict";(()=>{var zl=Object.defineProperty;var Hl=(e,t)=>{for(var o in t)zl(e,o,{get:t[o],enumerable:!0})};var ye={notebook:"/script/notebook.c3144c18ae.min.js",org:"/script/org.f61f262915.min.js",pdf:"/script/pdf.4d9cc6ff49.min.js",markdown:"/script/markdown.44f2e93820.min.js",editor:"/script/editor.4f142d3adc.min.js"};var rn=new Map,Gl=ye;function Wt(e){if(!rn.has(e)){let t=document.createElement("script");t.src=Gl[e];let o=new Promise((r,n)=>{t.onload=r,t.onerror=()=>{rn.delete(e),t.remove(),n(new Error(`Unable to load ${e}. Please retry.`))}});rn.set(e,o),document.head.appendChild(t)}return rn.get(e)}async function tr(){await Wt("editor"),ace.config.set("basePath","/script/external/ace/")}function ds(e){let t=Object.create(null);for(let o of e.split(","))t[o]=1;return o=>o in t}var Me={},Kt=[],rt=()=>{},Xn=()=>!1,us=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),cs=e=>e.startsWith("onUpdate:"),Ge=Object.assign,Ss=(e,t)=>{let o=e.indexOf(t);o>-1&&e.splice(o,1)},jl=Object.prototype.hasOwnProperty,Ae=(e,t)=>jl.call(e,t),Ee=Array.isArray,Pt=e=>Ds(e)==="[object Map]",ls=e=>Ds(e)==="[object Set]",sr=e=>Ds(e)==="[object Date]";var _e=e=>typeof e=="function",Fe=e=>typeof e=="string",ct=e=>typeof e=="symbol",Ve=e=>e!==null&&typeof e=="object",Zn=e=>(Ve(e)||_e(e))&&_e(e.then)&&_e(e.catch),rr=Object.prototype.toString,Ds=e=>rr.call(e),xn=e=>Ds(e).slice(8,-1),an=e=>Ds(e)==="[object Object]",ln=e=>Fe(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,ps=ds(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");var dn=e=>{let t=Object.create(null);return(o=>t[o]||(t[o]=e(o)))},Wl=/-\w/g,Ke=dn(e=>e.replace(Wl,t=>t.slice(1).toUpperCase())),Kl=/\B([A-Z])/g,qt=dn(e=>e.replace(Kl,"-$1").toLowerCase()),Yt=dn(e=>e.charAt(0).toUpperCase()+e.slice(1)),Rs=dn(e=>e?`on${Yt(e)}`:""),ht=(e,t)=>!Object.is(e,t),Ts=(e,...t)=>{for(let o=0;o{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:o})},eo=e=>{let t=parseFloat(e);return isNaN(t)?e:t};var nr,Os=()=>nr||(nr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Pe(e){if(Ee(e)){let t={};for(let o=0;o{if(o){let r=o.split(Jl);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function O(e){let t="";if(Fe(e))t=e;else if(Ee(e))for(let o=0;o!!(e&&e.__v_isRef===!0),c=e=>Fe(e)?e:e==null?"":Ee(e)||Ve(e)&&(e.toString===rr||!_e(e.toString))?lr(e)?c(e.value):JSON.stringify(e,dr,2):String(e),dr=(e,t)=>lr(t)?dr(e,t.value):Pt(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((o,[r,n],i)=>(o[Qn(r,i)+" =>"]=n,o),{})}:ls(t)?{[`Set(${t.size})`]:[...t.values()].map(o=>Qn(o))}:ct(t)?Qn(t):Ve(t)&&!Ee(t)&&!an(t)?String(t):t,Qn=(e,t="")=>{var o;return ct(e)?`Symbol(${(o=e.description)!=null?o:t})`:e};function ed(e,...t){console.warn(`[Vue warn] ${e}`,...t)}var Ye,Ps=class{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&Ye&&(Ye.active?(this.parent=Ye,this.index=(Ye.scopes||(Ye.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,o;if(this.scopes){let r=this.scopes.slice();for(t=0,o=r.length;t0&&--this._on===0){if(Ye===this)Ye=this.prevScope;else{let t=Ye;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let o,r;for(o=0,r=this.effects.length;o0)return;if(Vs){let t=Vs;for(Vs=void 0;t;){let o=t.next;t.next=void 0,t.flags&=-9,t=o}}let e;for(;Is;){let t=Is;for(Is=void 0;t;){let o=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){e||(e=r)}t=o}}if(e)throw e}function hr(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function vr(e){let t,o=e.depsTail,r=o;for(;r;){let n=r.prevDep;r.version===-1?(r===o&&(o=n),ho(r),td(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=n}e.deps=t,e.depsTail=o}function oo(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(yr(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function yr(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===qs)||(e.globalVersion=qs,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!oo(e))))return;e.flags|=2;let t=e.dep,o=Le,r=wt;Le=e,wt=!0;try{hr(e);let n=e.fn(e._value);(t.version===0||ht(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(n){throw t.version++,n}finally{Le=o,wt=r,vr(e),e.flags&=-3}}function ho(e,t=!1){let{dep:o,prevSub:r,nextSub:n}=e;if(r&&(r.nextSub=n,e.prevSub=void 0),n&&(n.prevSub=r,e.nextSub=void 0),o.subs===e&&(o.subs=r,!r&&o.computed)){o.computed.flags&=-5;for(let i=o.computed.deps;i;i=i.nextDep)ho(i,!0)}!t&&!--o.sc&&o.map&&o.map.delete(o.key)}function td(e){let{prevDep:t,nextDep:o}=e;t&&(t.nextDep=o,e.prevDep=void 0),o&&(o.prevDep=t,e.nextDep=void 0)}var wt=!0,gr=[];function Dt(){gr.push(wt),wt=!1}function Rt(){let e=gr.pop();wt=e===void 0?!0:e}function ur(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let o=Le;Le=void 0;try{t()}finally{Le=o}}}var qs=0,ro=class{constructor(t,o){this.sub=t,this.dep=o,this.version=o.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},Ms=class{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!Le||!wt||Le===this.computed)return;let o=this.activeLink;if(o===void 0||o.sub!==Le)o=this.activeLink=new ro(Le,this),Le.deps?(o.prevDep=Le.depsTail,Le.depsTail.nextDep=o,Le.depsTail=o):Le.deps=Le.depsTail=o,br(o);else if(o.version===-1&&(o.version=this.version,o.nextDep)){let r=o.nextDep;r.prevDep=o.prevDep,o.prevDep&&(o.prevDep.nextDep=r),o.prevDep=Le.depsTail,o.nextDep=void 0,Le.depsTail.nextDep=o,Le.depsTail=o,Le.deps===o&&(Le.deps=r)}return o}trigger(t){this.version++,qs++,this.notify(t)}notify(t){fo();try{for(let o=this.subs;o;o=o.prevSub)o.sub.notify()&&o.sub.dep.notify()}finally{mo()}}};function br(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let r=t.deps;r;r=r.nextDep)br(r)}let o=e.dep.subs;o!==e&&(e.prevSub=o,o&&(o.nextSub=e)),e.dep.subs=e}}var io=new WeakMap,Qt=Symbol(""),ao=Symbol(""),$s=Symbol("");function Xe(e,t,o){if(wt&&Le){let r=io.get(e);r||io.set(e,r=new Map);let n=r.get(o);n||(r.set(o,n=new Ms),n.map=r,n.key=o),n.track()}}function Nt(e,t,o,r,n,i){let a=io.get(e);if(!a){qs++;return}let u=m=>{m&&m.trigger()};if(fo(),t==="clear")a.forEach(u);else{let m=Ee(e),h=m&&ln(o);if(m&&o==="length"){let v=Number(r);a.forEach((k,p)=>{(p==="length"||p===$s||!ct(p)&&p>=v)&&u(k)})}else switch((o!==void 0||a.has(void 0))&&u(a.get(o)),h&&u(a.get($s)),t){case"add":m?h&&u(a.get("length")):(u(a.get(Qt)),Pt(e)&&u(a.get(ao)));break;case"delete":m||(u(a.get(Qt)),Pt(e)&&u(a.get(ao)));break;case"set":Pt(e)&&u(a.get(Qt));break}}mo()}function ms(e){let t=Ie(e);return t===e?t:(Xe(t,"iterate",$s),it(e)?t:t.map(vt))}function Ls(e){return Xe(e=Ie(e),"iterate",$s),e}function Ct(e,t){return kt(e)?Xt($t(e)?vt(t):t):vt(t)}var sd={__proto__:null,[Symbol.iterator](){return so(this,Symbol.iterator,e=>Ct(this,e))},concat(...e){return ms(this).concat(...e.map(t=>Ee(t)?ms(t):t))},entries(){return so(this,"entries",e=>(e[1]=Ct(this,e[1]),e))},every(e,t){return Mt(this,"every",e,t,void 0,arguments)},filter(e,t){return Mt(this,"filter",e,t,o=>o.map(r=>Ct(this,r)),arguments)},find(e,t){return Mt(this,"find",e,t,o=>Ct(this,o),arguments)},findIndex(e,t){return Mt(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Mt(this,"findLast",e,t,o=>Ct(this,o),arguments)},findLastIndex(e,t){return Mt(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Mt(this,"forEach",e,t,void 0,arguments)},includes(...e){return no(this,"includes",e)},indexOf(...e){return no(this,"indexOf",e)},join(e){return ms(this).join(e)},lastIndexOf(...e){return no(this,"lastIndexOf",e)},map(e,t){return Mt(this,"map",e,t,void 0,arguments)},pop(){return As(this,"pop")},push(...e){return As(this,"push",e)},reduce(e,...t){return cr(this,"reduce",e,t)},reduceRight(e,...t){return cr(this,"reduceRight",e,t)},shift(){return As(this,"shift")},some(e,t){return Mt(this,"some",e,t,void 0,arguments)},splice(...e){return As(this,"splice",e)},toReversed(){return ms(this).toReversed()},toSorted(e){return ms(this).toSorted(e)},toSpliced(...e){return ms(this).toSpliced(...e)},unshift(...e){return As(this,"unshift",e)},values(){return so(this,"values",e=>Ct(this,e))}};function so(e,t,o){let r=Ls(e),n=r[t]();return r!==e&&!it(e)&&(n._next=n.next,n.next=()=>{let i=n._next();return i.done||(i.value=o(i.value)),i}),n}var nd=Array.prototype;function Mt(e,t,o,r,n,i){let a=Ls(e),u=a!==e&&!it(e),m=a[t];if(m!==nd[t]){let k=m.apply(e,i);return u?vt(k):k}let h=o;a!==e&&(u?h=function(k,p){return o.call(this,Ct(e,k),p,e)}:o.length>2&&(h=function(k,p){return o.call(this,k,p,e)}));let v=m.call(a,h,r);return u&&n?n(v):v}function cr(e,t,o,r){let n=Ls(e),i=n!==e&&!it(e),a=o,u=!1;n!==e&&(i?(u=r.length===0,a=function(h,v,k){return u&&(u=!1,h=Ct(e,h)),o.call(this,h,Ct(e,v),k,e)}):o.length>3&&(a=function(h,v,k){return o.call(this,h,v,k,e)}));let m=n[t](a,...r);return u?Ct(e,m):m}function no(e,t,o){let r=Ie(e);Xe(r,"iterate",$s);let n=r[t](...o);return(n===-1||n===!1)&&zs(o[0])?(o[0]=Ie(o[0]),r[t](...o)):n}function As(e,t,o=[]){Dt(),fo();let r=Ie(e)[t].apply(e,o);return mo(),Rt(),r}var od=ds("__proto__,__v_isRef,__isVue"),wr=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(ct));function rd(e){ct(e)||(e=String(e));let t=Ie(this);return Xe(t,"has",e),t.hasOwnProperty(e)}var hn=class{constructor(t=!1,o=!1){this._isReadonly=t,this._isShallow=o}get(t,o,r){if(o==="__v_skip")return t.__v_skip;let n=this._isReadonly,i=this._isShallow;if(o==="__v_isReactive")return!n;if(o==="__v_isReadonly")return n;if(o==="__v_isShallow")return i;if(o==="__v_raw")return r===(n?i?md:Er:i?_r:kr).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;let a=Ee(t);if(!n){let m;if(a&&(m=sd[o]))return m;if(o==="hasOwnProperty")return rd}let u=Reflect.get(t,o,Qe(t)?t:r);if((ct(o)?wr.has(o):od(o))||(n||Xe(t,"get",o),i))return u;if(Qe(u)){let m=a&&ln(o)?u:u.value;return n&&Ve(m)?yn(m):m}return Ve(u)?n?yn(u):ze(u):u}},vn=class extends hn{constructor(t=!1){super(!1,t)}set(t,o,r,n){let i=t[o],a=Ee(t)&&ln(o);if(!this._isShallow){let h=kt(i);if(!it(r)&&!kt(r)&&(i=Ie(i),r=Ie(r)),!a&&Qe(i)&&!Qe(r))return h||(i.value=r),!0}let u=a?Number(o)e,pn=e=>Reflect.getPrototypeOf(e);function dd(e,t,o){return function(...r){let n=this.__v_raw,i=Ie(n),a=Pt(i),u=e==="entries"||e===Symbol.iterator&&a,m=e==="keys"&&a,h=n[e](...r),v=o?uo:t?Xt:vt;return!t&&Xe(i,"iterate",m?ao:Qt),Ge(Object.create(h),{next(){let{value:k,done:p}=h.next();return p?{value:k,done:p}:{value:u?[v(k[0]),v(k[1])]:v(k),done:p}}})}}function fn(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function ud(e,t){let o={get(n){let i=this.__v_raw,a=Ie(i),u=Ie(n);e||(ht(n,u)&&Xe(a,"get",n),Xe(a,"get",u));let{has:m}=pn(a),h=t?uo:e?Xt:vt;if(m.call(a,n))return h(i.get(n));if(m.call(a,u))return h(i.get(u));i!==a&&i.get(n)},get size(){let n=this.__v_raw;return!e&&Xe(Ie(n),"iterate",Qt),n.size},has(n){let i=this.__v_raw,a=Ie(i),u=Ie(n);return e||(ht(n,u)&&Xe(a,"has",n),Xe(a,"has",u)),n===u?i.has(n):i.has(n)||i.has(u)},forEach(n,i){let a=this,u=a.__v_raw,m=Ie(u),h=t?uo:e?Xt:vt;return!e&&Xe(m,"iterate",Qt),u.forEach((v,k)=>n.call(i,h(v),h(k),a))}};return Ge(o,e?{add:fn("add"),set:fn("set"),delete:fn("delete"),clear:fn("clear")}:{add(n){let i=Ie(this),a=pn(i),u=Ie(n),m=!t&&!it(n)&&!kt(n)?u:n;return a.has.call(i,m)||ht(n,m)&&a.has.call(i,n)||ht(u,m)&&a.has.call(i,u)||(i.add(m),Nt(i,"add",m,m)),this},set(n,i){!t&&!it(i)&&!kt(i)&&(i=Ie(i));let a=Ie(this),{has:u,get:m}=pn(a),h=u.call(a,n);h||(n=Ie(n),h=u.call(a,n));let v=m.call(a,n);return a.set(n,i),h?ht(i,v)&&Nt(a,"set",n,i,v):Nt(a,"add",n,i),this},delete(n){let i=Ie(this),{has:a,get:u}=pn(i),m=a.call(i,n);m||(n=Ie(n),m=a.call(i,n));let h=u?u.call(i,n):void 0,v=i.delete(n);return m&&Nt(i,"delete",n,void 0,h),v},clear(){let n=Ie(this),i=n.size!==0,a=void 0,u=n.clear();return i&&Nt(n,"clear",void 0,void 0,a),u}}),["keys","values","entries",Symbol.iterator].forEach(n=>{o[n]=dd(n,e,t)}),o}function vo(e,t){let o=ud(e,t);return(r,n,i)=>n==="__v_isReactive"?!e:n==="__v_isReadonly"?e:n==="__v_raw"?r:Reflect.get(Ae(o,n)&&n in r?o:r,n,i)}var cd={get:vo(!1,!1)},pd={get:vo(!1,!0)},fd={get:vo(!0,!1)};var kr=new WeakMap,_r=new WeakMap,Er=new WeakMap,md=new WeakMap;function hd(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function ze(e){return kt(e)?e:yo(e,!1,id,cd,kr)}function Fs(e){return yo(e,!1,ld,pd,_r)}function yn(e){return yo(e,!0,ad,fd,Er)}function yo(e,t,o,r,n){if(!Ve(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;let i=n.get(e);if(i)return i;let a=hd(xn(e));if(a===0)return e;let u=new Proxy(e,a===2?r:o);return n.set(e,u),u}function $t(e){return kt(e)?$t(e.__v_raw):!!(e&&e.__v_isReactive)}function kt(e){return!!(e&&e.__v_isReadonly)}function it(e){return!!(e&&e.__v_isShallow)}function zs(e){return e?!!e.__v_raw:!1}function Ie(e){let t=e&&e.__v_raw;return t?Ie(t):e}function go(e){return!Ae(e,"__v_skip")&&Object.isExtensible(e)&&un(e,"__v_skip",!0),e}var vt=e=>Ve(e)?ze(e):e,Xt=e=>Ve(e)?yn(e):e;function Qe(e){return e?e.__v_isRef===!0:!1}function Ze(e){return Cr(e,!1)}function bn(e){return Cr(e,!0)}function Cr(e,t){return Qe(e)?e:new co(e,t)}var co=class{constructor(t,o){this.dep=new Ms,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=o?t:Ie(t),this._value=o?t:vt(t),this.__v_isShallow=o}get value(){return this.dep.track(),this._value}set value(t){let o=this._rawValue,r=this.__v_isShallow||it(t)||kt(t);t=r?t:Ie(t),ht(t,o)&&(this._rawValue=t,this._value=r?t:vt(t),this.dep.trigger())}};function Ut(e){return Qe(e)?e.value:e}var vd={get:(e,t,o)=>t==="__v_raw"?e:Ut(Reflect.get(e,t,o)),set:(e,t,o,r)=>{let n=e[t];return Qe(n)&&!Qe(o)?(n.value=o,!0):Reflect.set(e,t,o,r)}};function wn(e){return $t(e)?e:new Proxy(e,vd)}var po=class{constructor(t,o,r){this.fn=t,this.setter=o,this._value=void 0,this.dep=new Ms(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=qs-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!o,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&Le!==this)return mr(this,!0),!0}get value(){let t=this.dep.track();return yr(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}};function Nr(e,t,o=!1){let r,n;return _e(e)?r=e:(r=e.get,n=e.set),new po(r,n,o)}var mn={},gn=new WeakMap,Jt;function Sr(e,t=!1,o=Jt){if(o){let r=gn.get(o);r||gn.set(o,r=[]),r.push(e)}}function Dr(e,t,o=Me){let{immediate:r,deep:n,once:i,scheduler:a,augmentJob:u,call:m}=o,h=A=>{(o.onWarn||ed)("Invalid watch source: ",A,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},v=A=>n?A:it(A)||n===!1||n===0?St(A,1):St(A),k,p,g,w,b=!1,T=!1;if(Qe(e)?(p=()=>e.value,b=it(e)):$t(e)?(p=()=>v(e),b=!0):Ee(e)?(T=!0,b=e.some(A=>$t(A)||it(A)),p=()=>e.map(A=>{if(Qe(A))return A.value;if($t(A))return v(A);if(_e(A))return m?m(A,2):A()})):_e(e)?t?p=m?()=>m(e,2):e:p=()=>{if(g){Dt();try{g()}finally{Rt()}}let A=Jt;Jt=k;try{return m?m(e,3,[w]):e(w)}finally{Jt=A}}:p=rt,t&&n){let A=p,P=n===!0?1/0:n;p=()=>St(A(),P)}let N=pr(),R=()=>{k.stop(),N&&N.active&&Ss(N.effects,k)};if(i&&t){let A=t;t=(...P)=>{let Z=A(...P);return R(),Z}}let I=T?new Array(e.length).fill(mn):mn,C=A=>{if(!(!(k.flags&1)||!k.dirty&&!A))if(t){let P=k.run();if(A||n||b||(T?P.some((Z,Y)=>ht(Z,I[Y])):ht(P,I))){g&&g();let Z=Jt;Jt=k;try{let Y=[P,I===mn?void 0:T&&I[0]===mn?[]:I,w];I=P,m?m(t,3,Y):t(...Y)}finally{Jt=Z}}}else k.run()};return u&&u(C),k=new hs(p),k.scheduler=a?()=>a(C,!1):C,w=A=>Sr(A,!1,k),g=k.onStop=()=>{let A=gn.get(k);if(A){if(m)m(A,4);else for(let P of A)P();gn.delete(k)}},t?r?C(!0):I=k.run():a?a(C.bind(null,!0),!0):k.run(),R.pause=k.pause.bind(k),R.resume=k.resume.bind(k),R.stop=R,R}function St(e,t=1/0,o){if(t<=0||!Ve(e)||e.__v_skip||(o=o||new Map,(o.get(e)||0)>=t))return e;if(o.set(e,t),t--,Qe(e))St(e.value,t,o);else if(Ee(e))for(let r=0;r{St(r,t,o)});else if(an(e)){for(let r in e)St(e[r],t,o);for(let r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&St(e[r],t,o)}return e}function Xs(e,t,o,r){try{return r?e(...r):e()}catch(n){Zs(n,t,o)}}function yt(e,t,o,r){if(_e(e)){let n=Xs(e,t,o,r);return n&&Zn(n)&&n.catch(i=>{Zs(i,t,o)}),n}if(Ee(e)){let n=[];for(let i=0;i>>1,n=nt[r],i=Ys(n);i=Ys(o)?nt.push(e):nt.splice(kd(t),0,e),e.flags|=1,jr()}}function jr(){En||(En=Gr.then(Yr))}function Wr(e){if(!Ee(e))jt&&e.id===-1?jt.splice(vs+1,0,e):e.flags&1||(ys.push(e),e.flags|=1);else for(let t=0;tYs(o)-Ys(r));if(ys.length=0,jt){for(let o=0;oe.id==null?e.flags&2?-1:1/0:e.id;function Yr(e){let t=rt;try{for(Ot=0;Ot{r._d&&Dn(-1);let i=Cn(t),a=es.length,u;try{u=e(...n)}finally{for(let m=es.length;m>a;m--)Ci();Cn(i),r._d&&Dn(1)}return u};return r._n=!0,r._c=!0,r._d=!0,r}function E(e,t){if(pt===null)return e;let o=$n(pt),r=e.dirs||(e.dirs=[]);for(let n=0;n1)return o&&_e(t)?t.call(r&&r.proxy):t}}var Ed=Symbol.for("v-scx"),Cd=()=>{{let e=lt(Ed);return e}};function He(e,t,o){return Qr(e,t,o)}function Qr(e,t,o=Me){let{immediate:r,deep:n,flush:i,once:a}=o,u=Ge({},o),m=t&&r||!t&&i!=="post",h;if(ws){if(i==="sync"){let g=Cd();h=g.__watcherHandles||(g.__watcherHandles=[])}else if(!m){let g=()=>{};return g.stop=rt,g.resume=rt,g.pause=rt,g}}let v=xe;u.call=(g,w,b)=>yt(g,v,w,b);let k=!1;i==="post"?u.scheduler=g=>{at(g,v&&v.suspense)}:i!=="sync"&&(k=!0,u.scheduler=(g,w)=>{w?g():Do(g)}),u.augmentJob=g=>{t&&(g.flags|=4),k&&(g.flags|=2,v&&(g.id=v.uid,g.i=v))};let p=Dr(e,t,u);return ws&&(h?h.push(p):m&&p()),p}function Nd(e,t,o){let r=this.proxy,n=Fe(e)?e.includes(".")?Xr(r,e):()=>r[e]:e.bind(r,r),i;_e(t)?i=t:(i=t.handler,o=t);let a=tn(this),u=Qr(n,i.bind(r),o);return a(),u}function Xr(e,t){let o=t.split(".");return()=>{let r=e;for(let n=0;ne.__isTeleport;var bo=Symbol("_leaveCb");function Dd(e){let t=e[0];if(e.length>1){let o=!1;for(let r of e)if(r.type!==Ft){t=r,o=!0;break}}return t}function Zr(e){if(!Vn(e))return An(e.type)&&e.children?Dd(e.children):e;if(e.component)return e.component.subTree;let{shapeFlag:t,children:o}=e;if(o){if(t&16)return o[0];if(t&32&&_e(o.default))return o.default()}}function In(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;let o=e.component.subTree;In(An(o.type)&&Zr(o)||o,t)}else e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function xs(e,t){return _e(e)?Ge({name:e.name},t,{setup:e}):e}function Ro(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Tr(e,t){let o;return!!((o=Object.getOwnPropertyDescriptor(e,t))&&!o.configurable)}var Nn=new WeakMap;function Gs(e,t,o,r,n=!1){if(Ee(e)){e.forEach((b,T)=>Gs(b,t&&(Ee(t)?t[T]:t),o,r,n));return}if(js(r)&&!n){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&Gs(e,t,o,r.component.subTree);return}let i=r.shapeFlag&4?$n(r.component):r.el,a=n?null:i,{i:u,r:m}=e,h=t&&t.r,v=u.refs===Me?u.refs={}:u.refs,k=u.setupState,p=Ie(k),g=k===Me?Xn:b=>Tr(v,b)?!1:Ae(p,b),w=(b,T)=>!(T&&Tr(v,T));if(h!=null&&h!==m){if(Or(t),Fe(h))v[h]=null,g(h)&&(k[h]=null);else if(Qe(h)){let b=t;w(h,b.k)&&(h.value=null),b.k&&(v[b.k]=null)}}if(_e(m))Xs(m,u,12,[a,v]);else{let b=Fe(m),T=Qe(m);if(b||T){let N=()=>{if(e.f){let R=b?g(m)?k[m]:v[m]:w(m)||!e.k?m.value:v[e.k];if(n)Ee(R)&&Ss(R,i);else if(Ee(R))R.includes(i)||R.push(i);else if(b)v[m]=[i],g(m)&&(k[m]=v[m]);else{let I=[i];w(m,e.k)&&(m.value=I),e.k&&(v[e.k]=I)}}else b?(v[m]=a,g(m)&&(k[m]=a)):T&&(w(m,e.k)&&(m.value=a),e.k&&(v[e.k]=a))};if(a){let R=()=>{N(),Nn.delete(e)};R.id=-1,Nn.set(e,R),at(R,o)}else Or(e),N()}}}function Or(e){let t=Nn.get(e);t&&(t.flags|=8,Nn.delete(e))}var Ar=e=>e.nodeType===8;var q4=Os().requestIdleCallback||(e=>setTimeout(e,1)),M4=Os().cancelIdleCallback||(e=>clearTimeout(e));function Rd(e,t){if(Ar(e)&&e.data==="["){let o=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(Ar(r))if(r.data==="]"){if(--o===0)break}else r.data==="["&&o++;r=r.nextSibling}}else t(e)}var js=e=>!!e.type.__asyncLoader;function xr(e){_e(e)&&(e={loader:e});let{loader:t,loadingComponent:o,errorComponent:r,delay:n=200,hydrate:i,timeout:a,suspensible:u=!0,onError:m}=e,h=null,v,k=0,p=()=>(k++,h=null,g()),g=()=>{let w;return h||(w=h=t().catch(b=>{if(b=b instanceof Error?b:new Error(String(b)),m)return new Promise((T,N)=>{m(b,()=>T(p()),()=>N(b),k+1)});throw b}).then(b=>w!==h&&h?h:(b&&(b.__esModule||b[Symbol.toStringTag]==="Module")&&(b=b.default),v=b,b)))};return xs({name:"AsyncComponentWrapper",__asyncLoader:g,__asyncHydrate(w,b,T){let N=w.isConnected,R=!1;(b.bu||(b.bu=[])).push(()=>R=!0);let I=()=>{R||!w.parentNode||N&&!w.isConnected||T()},C=i?()=>{let A=i(I,P=>Rd(w,P));A&&(b.bum||(b.bum=[])).push(A)}:I;v?C():g().then(()=>!b.isUnmounted&&C())},get __asyncResolved(){return v},setup(){let w=xe;if(Ro(w),v)return()=>kn(v,w);let b=A=>{h=null,Zs(A,w,13,!r)};if(u&&w.suspense||ws)return g().then(A=>()=>kn(A,w)).catch(A=>(b(A),()=>r?De(r,{error:A}):null));let T=Ze(!1),N=Ze(),R=Ze(!!n),I,C;return en(()=>{I!=null&&clearTimeout(I),C!=null&&clearTimeout(C)}),n&&(C=setTimeout(()=>{w.isUnmounted||(R.value=!1)},n)),a!=null&&(I=setTimeout(()=>{if(!w.isUnmounted&&!T.value&&!N.value){let A=new Error(`Async component timed out after ${a}ms.`);b(A),N.value=A}},a)),g().then(()=>{w.isUnmounted||(T.value=!0,w.parent&&Vn(w.parent.vnode)&&w.parent.update())}).catch(A=>{if(w.isUnmounted){h=null;return}b(A),N.value=A}),()=>{if(T.value&&v)return kn(v,w);if(N.value&&r)return De(r,{error:N.value});if(o&&!R.value)return kn(o,w)}}})}function kn(e,t){let{ref:o,props:r,children:n,ce:i}=t.vnode,a=De(e,r,n);return a.ref=o,a.ce=i,delete t.vnode.ce,a}var Vn=e=>e.type.__isKeepAlive;function ei(e,t){si(e,"a",t)}function ti(e,t){si(e,"da",t)}function si(e,t,o=xe){let r=e.__wdc||(e.__wdc=()=>{let n=o;for(;n;){if(n.isDeactivated)return;n=n.parent}return e()});if(Pn(t,r,o),o){let n=o.parent;for(;n&&n.parent;)Vn(n.parent.vnode)&&Td(r,t,o,n),n=n.parent}}function Td(e,t,o,r){let n=Pn(t,e,r,!0);en(()=>{Ss(r[t],n)},o)}function Pn(e,t,o=xe,r=!1){if(o){let n=o[e]||(o[e]=[]),i=t.__weh||(t.__weh=(...a)=>{Dt();let u=tn(o),m=yt(t,o,e,a);return u(),Rt(),m});return r?n.unshift(i):n.push(i),i}}var zt=e=>(t,o=xe)=>{(!ws||e==="sp")&&Pn(e,(...r)=>t(...r),o)},Od=zt("bm"),It=zt("m"),ni=zt("bu"),oi=zt("u"),ss=zt("bum"),en=zt("um"),Ad=zt("sp"),Id=zt("rtg"),Vd=zt("rtc");function Pd(e,t=xe){Pn("ec",e,t)}var ri="components",qd="directives";function et(e,t){return ii(ri,e,!0,t)||e}var Md=Symbol.for("v-ndc");function be(e){return ii(qd,e)}function ii(e,t,o=!0,r=!1){let n=pt||xe;if(n){let i=n.type;if(e===ri){let u=bu(i,!1);if(u&&(u===t||u===Ke(t)||u===Yt(Ke(t))))return i}let a=Ir(n[e]||i[e],t)||Ir(n.appContext[e],t);return!a&&r?i:a}}function Ir(e,t){return e&&(e[t]||e[Ke(t)]||e[Yt(Ke(t))])}function ne(e,t,o,r){let n,i=o&&o[r],a=Ee(e);if(a||Fe(e)){let u=a&&$t(e),m=!1,h=!1;u&&(m=!it(e),h=kt(e),e=Ls(e)),n=new Array(e.length);for(let v=0,k=e.length;vt(u,m,void 0,i&&i[m]));else{let u=Object.keys(e);n=new Array(u.length);for(let m=0,h=u.length;me?Di(e)?$n(e):Eo(e.parent):null;var Ws=Ge(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Eo(e.parent),$root:e=>Eo(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>To(e),$forceUpdate:e=>e.f||(e.f=()=>{Do(e.update)}),$nextTick:e=>e.n||(e.n=_t.bind(e.proxy)),$watch:e=>Nd.bind(e)});var wo=(e,t)=>e!==Me&&!e.__isScriptSetup&&Ae(e,t),$d={get({_:e},t){if(t==="__v_skip")return!0;let{ctx:o,setupState:r,data:n,props:i,accessCache:a,type:u,appContext:m}=e;if(t[0]!=="$"){let p=a[t];if(p!==void 0)switch(p){case 1:return r[t];case 2:return n[t];case 4:return o[t];case 3:return i[t]}else{if(wo(r,t))return a[t]=1,r[t];if(n!==Me&&Ae(n,t))return a[t]=2,n[t];if(Ae(i,t))return a[t]=3,i[t];if(o!==Me&&Ae(o,t))return a[t]=4,o[t];Co&&(a[t]=0)}}let h=Ws[t],v,k;if(h)return t==="$attrs"&&Xe(e.attrs,"get",""),h(e);if((v=u.__cssModules)&&(v=v[t]))return v;if(o!==Me&&Ae(o,t))return a[t]=4,o[t];if(k=m.config.globalProperties,Ae(k,t))return k[t]},set({_:e},t,o){let{data:r,setupState:n,ctx:i}=e;return wo(n,t)?(n[t]=o,!0):r!==Me&&Ae(r,t)?(r[t]=o,!0):Ae(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=o,!0)},has({_:{data:e,setupState:t,accessCache:o,ctx:r,appContext:n,props:i,type:a}},u){let m;return!!(o[u]||e!==Me&&u[0]!=="$"&&Ae(e,u)||wo(t,u)||Ae(i,u)||Ae(r,u)||Ae(Ws,u)||Ae(n.config.globalProperties,u)||(m=a.__cssModules)&&m[u])},defineProperty(e,t,o){return o.get!=null?e._.accessCache[t]=0:Ae(o,"value")&&this.set(e,t,o.value,null),Reflect.defineProperty(e,t,o)}};function Vr(e){return Ee(e)?e.reduce((t,o)=>(t[o]=null,t),{}):e}var Co=!0;function Ud(e){let t=To(e),o=e.proxy,r=e.ctx;Co=!1,t.beforeCreate&&Pr(t.beforeCreate,e,"bc");let{data:n,computed:i,methods:a,watch:u,provide:m,inject:h,created:v,beforeMount:k,mounted:p,beforeUpdate:g,updated:w,activated:b,deactivated:T,beforeDestroy:N,beforeUnmount:R,destroyed:I,unmounted:C,render:A,renderTracked:P,renderTriggered:Z,errorCaptured:Y,serverPrefetch:j,expose:z,inheritAttrs:ae,components:se,directives:re,filters:ue}=t;if(h&&Ld(h,r,null),a)for(let me in a){let pe=a[me];_e(pe)&&(r[me]=pe.bind(o))}if(n){let me=n.call(o,o);Ve(me)&&(e.data=ze(me))}if(Co=!0,i)for(let me in i){let pe=i[me],Te=_e(pe)?pe.bind(o,o):_e(pe.get)?pe.get.bind(o,o):rt,Re=!_e(pe)&&_e(pe.set)?pe.set.bind(o):rt,Se=tt({get:Te,set:Re});Object.defineProperty(r,me,{enumerable:!0,configurable:!0,get:()=>Se.value,set:D=>Se.value=D})}if(u)for(let me in u)ai(u[me],r,o,me);if(m){let me=_e(m)?m.call(o):m;Reflect.ownKeys(me).forEach(pe=>{ts(pe,me[pe])})}v&&Pr(v,e,"c");function he(me,pe){Ee(pe)?pe.forEach(Te=>me(Te.bind(o))):pe&&me(pe.bind(o))}if(he(Od,k),he(It,p),he(ni,g),he(oi,w),he(ei,b),he(ti,T),he(Pd,Y),he(Vd,P),he(Id,Z),he(ss,R),he(en,C),he(Ad,j),Ee(z))if(z.length){let me=e.exposed||(e.exposed={});z.forEach(pe=>{Object.defineProperty(me,pe,{get:()=>o[pe],set:Te=>o[pe]=Te,enumerable:!0})})}else e.exposed||(e.exposed={});A&&e.render===rt&&(e.render=A),ae!=null&&(e.inheritAttrs=ae),se&&(e.components=se),re&&(e.directives=re),j&&Ro(e)}function Ld(e,t,o=rt){Ee(e)&&(e=No(e));for(let r in e){let n=e[r],i;Ve(n)?"default"in n?i=lt(n.from||r,n.default,!0):i=lt(n.from||r):i=lt(n),Qe(i)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>i.value,set:a=>i.value=a}):t[r]=i}}function Pr(e,t,o){yt(Ee(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,o)}function ai(e,t,o,r){let n=r.includes(".")?Xr(o,r):()=>o[r];if(Fe(e)){let i=t[e];_e(i)&&He(n,i)}else if(_e(e))He(n,e.bind(o));else if(Ve(e))if(Ee(e))e.forEach(i=>ai(i,t,o,r));else{let i=_e(e.handler)?e.handler.bind(o):t[e.handler];_e(i)&&He(n,i,e)}}function To(e){let t=e.type,{mixins:o,extends:r}=t,{mixins:n,optionsCache:i,config:{optionMergeStrategies:a}}=e.appContext,u=i.get(t),m;return u?m=u:!n.length&&!o&&!r?m=t:(m={},n.length&&n.forEach(h=>Sn(m,h,a,!0)),Sn(m,t,a)),Ve(t)&&i.set(t,m),m}function Sn(e,t,o,r=!1){let{mixins:n,extends:i}=t;i&&Sn(e,i,o,!0),n&&n.forEach(a=>Sn(e,a,o,!0));for(let a in t)if(!(r&&a==="expose")){let u=Fd[a]||o&&o[a];e[a]=u?u(e[a],t[a]):t[a]}return e}var Fd={data:qr,props:Mr,emits:Mr,methods:Bs,computed:Bs,beforeCreate:st,created:st,beforeMount:st,mounted:st,beforeUpdate:st,updated:st,beforeDestroy:st,beforeUnmount:st,destroyed:st,unmounted:st,activated:st,deactivated:st,errorCaptured:st,serverPrefetch:st,components:Bs,directives:Bs,watch:Hd,provide:qr,inject:zd};function qr(e,t){return t?e?function(){return Ge(_e(e)?e.call(this,this):e,_e(t)?t.call(this,this):t)}:t:e}function zd(e,t){return Bs(No(e),No(t))}function No(e){if(Ee(e)){let t={};for(let o=0;ot==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Ke(t)}Modifiers`]||e[`${qt(t)}Modifiers`];function Wd(e,t,...o){if(e.isUnmounted)return;let r=e.vnode.props||Me,n=o,i=t.startsWith("update:"),a=i&&jd(r,t.slice(7));a&&(a.trim&&(n=o.map(v=>Fe(v)?v.trim():v)),a.number&&(n=n.map(eo)));let u,m=r[u=Rs(t)]||r[u=Rs(Ke(t))];!m&&i&&(m=r[u=Rs(qt(t))]),m&&yt(m,e,6,n);let h=r[u+"Once"];if(h){if(!e.emitted)e.emitted={};else if(e.emitted[u])return;e.emitted[u]=!0,yt(h,e,6,n)}}var Kd=new WeakMap;function di(e,t,o=!1){let r=o?Kd:t.emitsCache,n=r.get(e);if(n!==void 0)return n;let i=e.emits,a={},u=!1;if(!_e(e)){let m=h=>{let v=di(h,t,!0);v&&(u=!0,Ge(a,v))};!o&&t.mixins.length&&t.mixins.forEach(m),e.extends&&m(e.extends),e.mixins&&e.mixins.forEach(m)}return!i&&!u?(Ve(e)&&r.set(e,null),null):(Ee(i)?i.forEach(m=>a[m]=null):Ge(a,i),Ve(e)&&r.set(e,a),a)}function qn(e,t){return!e||!us(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),Ae(e,t[0].toLowerCase()+t.slice(1))||Ae(e,qt(t))||Ae(e,t))}function ko(e){let{type:t,vnode:o,proxy:r,withProxy:n,propsOptions:[i],slots:a,attrs:u,emit:m,render:h,renderCache:v,props:k,data:p,setupState:g,ctx:w,inheritAttrs:b}=e,T=Cn(e),N,R;try{if(o.shapeFlag&4){let A=n||r,P=A;N=At(h.call(P,A,v,k,g,p,w)),R=u}else{let A=t;N=At(A.length>1?A(k,{attrs:u,slots:a,emit:m}):A(k,null)),R=t.props?u:Yd(u)}}catch(A){es.length=0,Zs(A,e,1),N=De(Ft)}let I=N,C;if(R&&b!==!1){let A=Object.keys(R),{shapeFlag:P}=I;A.length&&P&7&&(i&&A.some(cs)&&(R=Jd(R,i)),I=bs(I,R,!1,!0))}if(o.dirs&&(I=bs(I,null,!1,!0),I.dirs=I.dirs?I.dirs.concat(o.dirs):o.dirs),o.transition){let A=An(I.type)&&Zr(I)||I;In(A,o.transition)}return N=I,Cn(T),N}var Yd=e=>{let t;for(let o in e)(o==="class"||o==="style"||us(o))&&((t||(t={}))[o]=e[o]);return t},Jd=(e,t)=>{let o={};for(let r in e)(!cs(r)||!(r.slice(9)in t))&&(o[r]=e[r]);return o};function Qd(e,t,o){let{props:r,children:n,component:i}=e,{props:a,children:u,patchFlag:m}=t,h=i.emitsOptions;if(t.dirs||t.transition)return!0;if(o&&m>=0){if(m&1024)return!0;if(m&16)return r?$r(r,a,h):!!a;if(m&8){let v=t.dynamicProps;for(let k=0;kObject.create(ci),fi=e=>Object.getPrototypeOf(e)===ci;function Zd(e,t,o,r=!1){let n={},i=pi();e.propsDefaults=Object.create(null),mi(e,t,n,i);for(let a in e.propsOptions[0])a in n||(n[a]=void 0);o?e.props=r?n:Fs(n):e.type.props?e.props=n:e.props=i,e.attrs=i}function xd(e,t,o,r){let{props:n,attrs:i,vnode:{patchFlag:a}}=e,u=Ie(n),[m]=e.propsOptions,h=!1;if((r||a>0)&&!(a&16)){if(a&8){let v=e.vnode.dynamicProps;for(let k=0;k{m=!0;let[p,g]=hi(k,t,!0);Ge(a,p),g&&u.push(...g)};!o&&t.mixins.length&&t.mixins.forEach(v),e.extends&&v(e.extends),e.mixins&&e.mixins.forEach(v)}if(!i&&!m)return Ve(e)&&r.set(e,Kt),Kt;if(Ee(i))for(let v=0;ve==="_"||e==="_ctx"||e==="$stable",Ao=e=>Ee(e)?e.map(At):[At(e)],tu=(e,t,o)=>{if(t._n)return t;let r=_d((...n)=>Ao(t(...n)),o);return r._c=!1,r},vi=(e,t,o)=>{let r=e._ctx;for(let n in e){if(Oo(n))continue;let i=e[n];if(_e(i))t[n]=tu(n,i,r);else if(i!=null){let a=Ao(i);t[n]=()=>a}}},yi=(e,t)=>{let o=Ao(t);e.slots.default=()=>o},gi=(e,t,o)=>{for(let r in t)(o||!Oo(r))&&(e[r]=t[r])},su=(e,t,o)=>{let r=e.slots=pi();if(e.vnode.shapeFlag&32){let n=t._;n?(gi(r,t,o),o&&un(r,"_",n,!0)):vi(t,r)}else t&&yi(e,t)},nu=(e,t,o)=>{let{vnode:r,slots:n}=e,i=!0,a=Me;if(r.shapeFlag&32){let u=t._;u?o&&u===1?i=!1:gi(n,t,o):(i=!t.$stable,vi(t,n)),a=t}else t&&(yi(e,t),a={default:1});if(i)for(let u in n)!Oo(u)&&a[u]==null&&delete n[u]};function ou(){let e=[]}var at=lu;function bi(e){return ru(e)}function ru(e,t){ou();let o=Os();o.__VUE__=!0;let{insert:r,remove:n,patchProp:i,createElement:a,createText:u,createComment:m,setText:h,setElementText:v,parentNode:k,nextSibling:p,setScopeId:g=rt,insertStaticContent:w}=e,b=(_,S,q,F=null,G=null,M=null,Q=void 0,x=null,X=!!S.dynamicChildren)=>{if(_===S)return;_&&!Hs(_,S)&&(F=te(_),V(_,G,M,!0),_=null),S.patchFlag===-2&&(X=!1,S.dynamicChildren=null);let{type:H,ref:de,shapeFlag:ee}=S;switch(H){case Mn:T(_,S,q,F);break;case Ft:N(_,S,q,F);break;case Ks:_==null&&R(S,q,F,Q);break;case J:re(_,S,q,F,G,M,Q,x,X);break;default:ee&1?P(_,S,q,F,G,M,Q,x,X):ee&6?ue(_,S,q,F,G,M,Q,x,X):(ee&64||ee&128)&&H.process(_,S,q,F,G,M,Q,x,X,fe)}de!=null&&G?Gs(de,_&&_.ref,M,S||_,!S):de==null&&_&&_.ref!=null&&Gs(_.ref,null,M,_,!0)},T=(_,S,q,F)=>{if(_==null)r(S.el=u(S.children),q,F);else{let G=S.el=_.el;S.children!==_.children&&h(G,S.children)}},N=(_,S,q,F)=>{_==null?r(S.el=m(S.children||""),q,F):S.el=_.el},R=(_,S,q,F)=>{[_.el,_.anchor]=w(_.children,S,q,F,_.el,_.anchor)},I=(_,S,q,F)=>{if(S.children!==_.children){let G=p(_.anchor);A(_),[S.el,S.anchor]=w(S.children,q,G,F)}else S.el=_.el,S.anchor=_.anchor},C=({el:_,anchor:S},q,F)=>{let G;for(;_&&_!==S;)G=p(_),r(_,q,F),_=G;r(S,q,F)},A=({el:_,anchor:S})=>{let q;for(;_&&_!==S;)q=p(_),n(_),_=q;n(S)},P=(_,S,q,F,G,M,Q,x,X)=>{if(S.type==="svg"?Q="svg":S.type==="math"&&(Q="mathml"),_==null)Z(S,q,F,G,M,Q,x,X);else{let H=_.el&&_.el._isVueCE?_.el:null;try{H&&H._beginPatch(),z(_,S,G,M,Q,x,X)}finally{H&&H._endPatch()}}},Z=(_,S,q,F,G,M,Q,x)=>{let X,H,{props:de,shapeFlag:ee,transition:ie,dirs:ve}=_;if(X=_.el=a(_.type,M,de&&de.is,de),ee&8?v(X,_.children):ee&16&&j(_.children,X,null,F,G,_o(_,M),Q,x),ve&&Zt(_,null,F,"created"),Y(X,_,_.scopeId,Q,F),de){for(let Ue in de)Ue!=="value"&&!ps(Ue)&&i(X,Ue,null,de[Ue],M,F);"value"in de&&i(X,"value",null,de.value,M),(H=de.onVnodeBeforeMount)&&Tt(H,F,_)}ve&&Zt(_,null,F,"beforeMount");let Oe=iu(G,ie);Oe&&ie.beforeEnter(X),r(X,S,q),((H=de&&de.onVnodeMounted)||Oe||ve)&&at(()=>{let $e;try{H&&Tt(H,F,_),Oe&&ie.enter(X),ve&&Zt(_,null,F,"mounted")}finally{}},G)},Y=(_,S,q,F,G)=>{if(q&&g(_,q),F)for(let M=0;M{for(let H=X;H<_.length;H++){let de=_[H]=x?Lt(_[H]):At(_[H]);b(null,de,S,q,F,G,M,Q,x)}},z=(_,S,q,F,G,M,Q)=>{let x=S.el=_.el,{patchFlag:X,dynamicChildren:H,dirs:de}=S;X|=_.patchFlag&16;let ee=_.props||Me,ie=S.props||Me,ve;if(q&&xt(q,!1),(ve=ie.onVnodeBeforeUpdate)&&Tt(ve,q,S,_),de&&Zt(S,_,q,"beforeUpdate"),q&&xt(q,!0),H&&(!_.dynamicChildren||_.dynamicChildren.length!==H.length)&&(X=0,Q=!1,H=null),(ee.innerHTML&&ie.innerHTML==null||ee.textContent&&ie.textContent==null)&&v(x,""),H?ae(_.dynamicChildren,H,x,q,F,_o(S,G),M):Q||Te(_,S,x,null,q,F,_o(S,G),M,!1),X>0){if(X&16)se(x,ee,ie,q,G);else if(X&2&&ee.class!==ie.class&&i(x,"class",null,ie.class,G),X&4&&i(x,"style",ee.style,ie.style,G),X&8){let Oe=S.dynamicProps;for(let Ue=0;Ue{ve&&Tt(ve,q,S,_),de&&Zt(S,_,q,"updated")},F)},ae=(_,S,q,F,G,M,Q)=>{for(let x=0;x{if(S!==q){if(S!==Me)for(let M in S)!ps(M)&&!(M in q)&&i(_,M,S[M],null,G,F);for(let M in q){if(ps(M))continue;let Q=q[M],x=S[M];Q!==x&&M!=="value"&&i(_,M,x,Q,G,F)}"value"in q&&i(_,"value",S.value,q.value,G)}},re=(_,S,q,F,G,M,Q,x,X)=>{let H=S.el=_?_.el:u(""),de=S.anchor=_?_.anchor:u(""),{patchFlag:ee,dynamicChildren:ie,slotScopeIds:ve}=S;ve&&(x=x?x.concat(ve):ve),_==null?(r(H,q,F),r(de,q,F),j(S.children||[],q,de,G,M,Q,x,X)):ee>0&&ee&64&&ie&&_.dynamicChildren&&_.dynamicChildren.length===ie.length?(ae(_.dynamicChildren,ie,q,G,M,Q,x),(S.key!=null||G&&S===G.subTree)&&wi(_,S,!0)):Te(_,S,q,de,G,M,Q,x,X)},ue=(_,S,q,F,G,M,Q,x,X)=>{S.slotScopeIds=x,_==null?S.shapeFlag&512?G.ctx.activate(S,q,F,Q,X):ke(S,q,F,G,M,Q,X):he(_,S,X)},ke=(_,S,q,F,G,M,Q)=>{let x=_.component=mu(_,F,G);if(Vn(_)&&(x.ctx.renderer=fe),hu(x,!1,Q),x.asyncDep){if(G&&G.registerDep(x,me,Q),!_.el){let X=x.subTree=De(Ft);N(null,X,S,q),_.placeholder=X.el}}else me(x,_,S,q,G,M,Q)},he=(_,S,q)=>{let F=S.component=_.component;if(Qd(_,S,q))if(F.asyncDep&&!F.asyncResolved){pe(F,S,q);return}else F.next=S,F.update();else S.el=_.el,F.vnode=S},me=(_,S,q,F,G,M,Q)=>{let x=()=>{if(_.isMounted){let{next:ee,bu:ie,u:ve,parent:Oe,vnode:Ue}=_;{let dt=ki(_);if(dt){ee&&(ee.el=Ue.el,pe(_,ee,Q)),dt.asyncDep.then(()=>{at(()=>{_.isUnmounted||H()},G)});return}}let $e=ee,je;xt(_,!1),ee?(ee.el=Ue.el,pe(_,ee,Q)):ee=Ue,ie&&Ts(ie),(je=ee.props&&ee.props.onVnodeBeforeUpdate)&&Tt(je,Oe,ee,Ue),xt(_,!0);let We=ko(_),bt=_.subTree;_.subTree=We,b(bt,We,k(bt.el),te(bt),_,G,M),ee.el=We.el,$e===null&&Xd(_,We.el),ve&&at(ve,G),(je=ee.props&&ee.props.onVnodeUpdated)&&at(()=>Tt(je,Oe,ee,Ue),G)}else{let ee,{el:ie,props:ve}=S,{bm:Oe,m:Ue,parent:$e,root:je,type:We}=_,bt=js(S);if(xt(_,!1),Oe&&Ts(Oe),!bt&&(ee=ve&&ve.onVnodeBeforeMount)&&Tt(ee,$e,S),xt(_,!0),ie&&ce){let dt=()=>{_.subTree=ko(_),ce(ie,_.subTree,_,G,null)};bt&&We.__asyncHydrate?We.__asyncHydrate(ie,_,dt):dt()}else{je.ce&&je.ce._hasShadowRoot()&&je.ce._injectChildStyle(We,_.parent?_.parent.type:void 0);let dt=_.subTree=ko(_);b(null,dt,q,F,_,G,M),S.el=dt.el}if(Ue&&at(Ue,G),!bt&&(ee=ve&&ve.onVnodeMounted)){let dt=S;at(()=>Tt(ee,$e,dt),G)}(S.shapeFlag&256||$e&&js($e.vnode)&&$e.vnode.shapeFlag&256)&&_.a&&at(_.a,G),_.isMounted=!0,S=q=F=null}};_.scope.on();let X=_.effect=new hs(x);_.scope.off();let H=_.update=X.run.bind(X),de=_.job=X.runIfDirty.bind(X);de.i=_,de.id=_.uid,X.scheduler=()=>Do(de),xt(_,!0),H()},pe=(_,S,q)=>{S.component=_;let F=_.vnode.props;_.vnode=S,_.next=null,xd(_,S.props,F,q),nu(_,S.children,q),Dt(),Rr(_),Rt()},Te=(_,S,q,F,G,M,Q,x,X=!1)=>{let H=_&&_.children,de=_?_.shapeFlag:0,ee=S.children,{patchFlag:ie,shapeFlag:ve}=S;if(ie>0){if(ie&128){Se(H,ee,q,F,G,M,Q,x,X);return}else if(ie&256){Re(H,ee,q,F,G,M,Q,x,X);return}}ve&8?(de&16&&U(H,G,M),ee!==H&&v(q,ee)):de&16?ve&16?Se(H,ee,q,F,G,M,Q,x,X):U(H,G,M,!0):(de&8&&v(q,""),ve&16&&j(ee,q,F,G,M,Q,x,X))},Re=(_,S,q,F,G,M,Q,x,X)=>{_=_||Kt,S=S||Kt;let H=_.length,de=S.length,ee=Math.min(H,de),ie;for(ie=0;iede?U(_,G,M,!0,!1,ee):j(S,q,F,G,M,Q,x,X,ee)},Se=(_,S,q,F,G,M,Q,x,X)=>{let H=0,de=S.length,ee=_.length-1,ie=de-1;for(;H<=ee&&H<=ie;){let ve=_[H],Oe=S[H]=X?Lt(S[H]):At(S[H]);if(Hs(ve,Oe))b(ve,Oe,q,null,G,M,Q,x,X);else break;H++}for(;H<=ee&&H<=ie;){let ve=_[ee],Oe=S[ie]=X?Lt(S[ie]):At(S[ie]);if(Hs(ve,Oe))b(ve,Oe,q,null,G,M,Q,x,X);else break;ee--,ie--}if(H>ee){if(H<=ie){let ve=ie+1,Oe=veie)for(;H<=ee;)V(_[H],G,M,!0),H++;else{let ve=H,Oe=H,Ue=new Map;for(H=Oe;H<=ie;H++){let ut=S[H]=X?Lt(S[H]):At(S[H]);ut.key!=null&&Ue.set(ut.key,H)}let $e,je=0,We=ie-Oe+1,bt=!1,dt=0,Ns=new Array(We);for(H=0;H=We){V(ut,G,M,!0);continue}let Et;if(ut.key!=null)Et=Ue.get(ut.key);else for($e=Oe;$e<=ie;$e++)if(Ns[$e-Oe]===0&&Hs(ut,S[$e])){Et=$e;break}Et===void 0?V(ut,G,M,!0):(Ns[Et-Oe]=H+1,Et>=dt?dt=Et:bt=!0,b(ut,S[Et],q,null,G,M,Q,x,X),je++)}let Zo=bt?au(Ns):Kt;for($e=Zo.length-1,H=We-1;H>=0;H--){let ut=Oe+H,Et=S[ut],xo=S[ut+1],er=ut+1{let{el:M,type:Q,transition:x,children:X,shapeFlag:H}=_;if(H&6){D(_.component.subTree,S,q,F);return}if(H&128){_.suspense.move(S,q,F);return}if(H&64){Q.move(_,S,q,fe);return}if(Q===J){r(M,S,q);for(let ee=0;eex.enter(M),G));else{let{leave:ee,delayLeave:ie,afterLeave:ve}=x,Oe=()=>{_.ctx.isUnmounted?n(M):r(M,S,q)},Ue=()=>{let $e=M._isLeaving||!!M[bo];M._isLeaving&&M[bo](!0),x.persisted&&!$e?Oe():ee(M,()=>{Oe(),ve&&ve()})};ie?ie(M,Oe,Ue):Ue()}else r(M,S,q)},V=(_,S,q,F=!1,G=!1)=>{let{type:M,props:Q,ref:x,children:X,dynamicChildren:H,shapeFlag:de,patchFlag:ee,dirs:ie,cacheIndex:ve,memo:Oe}=_;if(ee===-2&&(G=!1),x!=null&&(Dt(),Gs(x,null,q,_,!0),Rt()),ve!=null&&(S.renderCache[ve]=void 0),de&256){S.ctx.deactivate(_);return}let Ue=de&1&&ie,$e=!js(_),je;if($e&&(je=Q&&Q.onVnodeBeforeUnmount)&&Tt(je,S,_),de&6)le(_.component,q,F);else{if(de&128){_.suspense.unmount(q,F);return}Ue&&Zt(_,null,S,"beforeUnmount"),de&64?_.type.remove(_,S,q,fe,F):H&&!H.hasOnce&&(M!==J||ee>0&&ee&64)?U(H,S,q,!1,!0):(M===J&&ee&384||!G&&de&16)&&U(X,S,q),F&&W(_)}let We=Oe!=null&&ve==null;($e&&(je=Q&&Q.onVnodeUnmounted)||Ue||We)&&at(()=>{je&&Tt(je,S,_),Ue&&Zt(_,null,S,"unmounted"),We&&(_.el=null)},q)},W=_=>{let{type:S,el:q,anchor:F,transition:G}=_;if(S===J){oe(q,F);return}if(S===Ks){A(_);return}let M=()=>{n(q),G&&!G.persisted&&G.afterLeave&&G.afterLeave()};if(_.shapeFlag&1&&G&&!G.persisted){let{leave:Q,delayLeave:x}=G,X=()=>Q(q,M);x?x(_.el,M,X):X()}else M()},oe=(_,S)=>{let q;for(;_!==S;)q=p(_),n(_),_=q;n(S)},le=(_,S,q)=>{let{bum:F,scope:G,job:M,subTree:Q,um:x,m:X,a:H}=_;Lr(X),Lr(H),F&&Ts(F),G.stop(),M&&(M.flags|=8,V(Q,_,S,q)),x&&at(x,S),at(()=>{_.isUnmounted=!0},S)},U=(_,S,q,F=!1,G=!1,M=0)=>{for(let Q=M;Q<_.length;Q++)V(_[Q],S,q,F,G)},te=_=>{if(_.shapeFlag&6)return te(_.component.subTree);if(_.shapeFlag&128)return _.suspense.next();let S=p(_.anchor||_.el),q=S&&S[Sd];return q?p(q):S},L=!1,K=(_,S,q)=>{let F;_==null?S._vnode&&(V(S._vnode,null,null,!0),F=S._vnode.component):b(S._vnode||null,_,S,null,null,null,q),S._vnode=_,L||(L=!0,Rr(F),Kr(),L=!1)},fe={p:b,um:V,m:D,r:W,mt:ke,mc:j,pc:Te,pbc:ae,n:te,o:e},Ce,ce;return t&&([Ce,ce]=t(fe)),{render:K,hydrate:Ce,createApp:Gd(K,Ce)}}function _o({type:e,props:t},o){return o==="svg"&&e==="foreignObject"||o==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:o}function xt({effect:e,job:t},o){o?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function iu(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function wi(e,t,o=!1){let r=e.children,n=t.children;if(Ee(r)&&Ee(n))for(let i=0;i>1,e[o[u]]0&&(t[r]=o[i-1]),o[i]=r)}}for(i=o.length,a=o[i-1];i-- >0;)o[i]=a,a=t[a];return o}function ki(e){let t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:ki(t)}function Lr(e){if(e)for(let t=0;te.__isSuspense;function lu(e,t){t&&t.pendingBranch?Ee(e)?t.effects.push(...e):t.effects.push(e):Wr(e)}var J=Symbol.for("v-fgt"),Mn=Symbol.for("v-txt"),Ft=Symbol.for("v-cmt"),Ks=Symbol.for("v-stc"),es=[],ft=null;function l(e=!1){es.push(ft=e?null:[])}function Ci(){es.pop(),ft=es[es.length-1]||null}var Js=1;function Dn(e,t=!1){Js+=e,e<0&&ft&&t&&(ft.hasOnce=!0)}function Ni(e){return e.dynamicChildren=Js>0?ft||Kt:null,Ci(),Js>0&&ft&&ft.push(e),e}function d(e,t,o,r,n,i){return Ni(s(e,t,o,r,n,i,!0))}function ks(e,t,o,r,n){return Ni(De(e,t,o,r,n,!0))}function Rn(e){return e?e.__v_isVNode===!0:!1}function Hs(e,t){return e.type===t.type&&e.key===t.key}var Si=({key:e})=>e??null,_n=({ref:e,ref_key:t,ref_for:o})=>(typeof e=="number"&&(e=""+e),e!=null?Fe(e)||Qe(e)||_e(e)?{i:pt,r:e,k:t,f:!!o}:e:null);function s(e,t=null,o=null,r=0,n=null,i=e===J?0:1,a=!1,u=!1){let m={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Si(t),ref:t&&_n(t),scopeId:Jr,slotScopeIds:null,children:o,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:r,dynamicProps:n,dynamicChildren:null,appContext:null,ctx:pt};return u?(Tn(m,o),i&128&&e.normalize(m)):o&&(m.shapeFlag|=Fe(o)?8:16),Js>0&&!a&&ft&&(m.patchFlag>0||i&6)&&m.patchFlag!==32&&ft.push(m),m}var De=du;function du(e,t=null,o=null,r=0,n=null,i=!1){if((!e||e===Md)&&(e=Ft),Rn(e)){let u=bs(e,t,!0);return o&&Tn(u,o),Js>0&&!i&&ft&&(u.shapeFlag&6?ft[ft.indexOf(e)]=u:ft.push(u)),u.patchFlag=-2,u}if(wu(e)&&(e=e.__vccOpts),t){t=uu(t);let{class:u,style:m}=t;u&&!Fe(u)&&(t.class=O(u)),Ve(m)&&(zs(m)&&!Ee(m)&&(m=Ge({},m)),t.style=Pe(m))}let a=Fe(e)?1:Ei(e)?128:An(e)?64:Ve(e)?4:_e(e)?2:0;return s(e,t,o,r,n,a,i,!0)}function uu(e){return e?zs(e)||fi(e)?Ge({},e):e:null}function bs(e,t,o=!1,r=!1){let{props:n,ref:i,patchFlag:a,children:u,transition:m}=e,h=t?cu(n||{},t):n,v={__v_isVNode:!0,__v_skip:!0,type:e.type,props:h,key:h&&Si(h),ref:t&&t.ref?o&&i?Ee(i)?i.concat(_n(t)):[i,_n(t)]:_n(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:u,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==J?a===-1?16:a|16:a,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:m,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&bs(e.ssContent),ssFallback:e.ssFallback&&bs(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return m&&r&&In(v,m.clone(v)),v}function y(e=" ",t=0){return De(Mn,null,e,t)}function ge(e,t){let o=De(Ks,null,e);return o.staticCount=t,o}function f(e="",t=!1){return t?(l(),ks(Ft,null,e)):De(Ft,null,e)}function At(e){return e==null||typeof e=="boolean"?De(Ft):Ee(e)?De(J,null,e.slice()):Rn(e)?Lt(e):De(Mn,null,String(e))}function Lt(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:bs(e)}function Tn(e,t){let o=0,{shapeFlag:r}=e;if(t==null)t=null;else if(Ee(t))o=16;else if(typeof t=="object")if(r&65){let n=t.default;n&&(n._c&&(n._d=!1),Tn(e,n()),n._c&&(n._d=!0));return}else{o=32;let n=t._;!n&&!fi(t)?t._ctx=pt:n===3&&pt&&(pt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(_e(t)){if(r&65){Tn(e,{default:t});return}t={default:t,_ctx:pt},o=32}else t=String(t),r&64?(o=16,t=[y(t)]):o=8;e.children=t,e.shapeFlag|=o}function cu(...e){let t={};for(let o=0;oxe||pt,On,Qs;{let e=Os(),t=(o,r)=>{let n;return(n=e[o])||(n=e[o]=[]),n.push(r),i=>{n.length>1?n.forEach(a=>a(i)):n[0](i)}};On=t("__VUE_INSTANCE_SETTERS__",o=>xe=o),Qs=t("__VUE_SSR_SETTERS__",o=>ws=o)}var tn=e=>{let t=xe;return On(e),e.scope.on(),()=>{e.scope.off(),On(t)}},Fr=()=>{xe&&xe.scope.off(),On(null)};function Di(e){return e.vnode.shapeFlag&4}var ws=!1;function hu(e,t=!1,o=!1){t&&Qs(t);let{props:r,children:n}=e.vnode,i=Di(e);Zd(e,r,i,t),su(e,n,o||t);let a=i?vu(e,t):void 0;return t&&Qs(!1),a}function vu(e,t){let o=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,$d);let{setup:r}=o;if(r){Dt();let n=e.setupContext=r.length>1?gu(e):null,i=tn(e),a=Xs(r,e,0,[e.props,n]),u=Zn(a);if(Rt(),i(),(u||e.sp)&&!js(e)&&Ro(e),u){if(a.then(Fr,Fr),t)return a.then(m=>{Qs(!0);try{zr(e,m,t)}finally{Qs(!1)}}).catch(m=>{Zs(m,e,0)});e.asyncDep=a}else zr(e,a,t)}else Ri(e,t)}function zr(e,t,o){_e(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Ve(t)&&(e.setupState=wn(t)),Ri(e,o)}var Hr,Br;function Ri(e,t,o){let r=e.type;if(!e.render){if(!t&&Hr&&!r.render){let n=r.template||To(e).template;if(n){let{isCustomElement:i,compilerOptions:a}=e.appContext.config,{delimiters:u,compilerOptions:m}=r,h=Ge(Ge({isCustomElement:i,delimiters:u},a),m);r.render=Hr(n,h)}}e.render=r.render||rt,Br&&Br(e)}{let n=tn(e);Dt();try{Ud(e)}finally{Rt(),n()}}}var yu={get(e,t){return Xe(e,"get",""),e[t]}};function gu(e){let t=o=>{e.exposed=o||{}};return{attrs:new Proxy(e.attrs,yu),slots:e.slots,emit:e.emit,expose:t}}function $n(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(wn(go(e.exposed)),{get(t,o){if(o in t)return t[o];if(o in Ws)return Ws[o](e)},has(t,o){return o in t||o in Ws}})):e.proxy}function bu(e,t=!0){return _e(e)?e.displayName||e.name:e.name||t&&e.__name}function wu(e){return _e(e)&&"__vccOpts"in e}var tt=(e,t)=>Nr(e,t,ws);function Ne(e,t,o){try{Dn(-1);let r=arguments.length;return r===2?Ve(t)&&!Ee(t)?Rn(t)?De(e,null,[t]):De(e,t):De(e,null,t):(r>3?o=Array.prototype.slice.call(arguments,2):r===3&&Rn(o)&&(o=[o]),De(e,t,o))}finally{Dn(1)}}var ku="3.5.42";var qo,Ti=typeof window<"u"&&window.trustedTypes;if(Ti)try{qo=Ti.createPolicy("vue",{createHTML:e=>e})}catch{}var Ui=qo?e=>qo.createHTML(e):e=>e,_u="http://www.w3.org/2000/svg",Eu="http://www.w3.org/1998/Math/MathML",Ht=typeof document<"u"?document:null,Oi=Ht&&Ht.createElement("template"),Cu={insert:(e,t,o)=>{t.insertBefore(e,o||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,o,r)=>{let n=t==="svg"?Ht.createElementNS(_u,e):t==="mathml"?Ht.createElementNS(Eu,e):o?Ht.createElement(e,{is:o}):Ht.createElement(e);return e==="select"&&r&&r.multiple!=null&&n.setAttribute("multiple",r.multiple),n},createText:e=>Ht.createTextNode(e),createComment:e=>Ht.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Ht.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,o,r,n,i){let a=o?o.previousSibling:t.lastChild;if(n&&(n===i||n.nextSibling))for(;t.insertBefore(n.cloneNode(!0),o),!(n===i||!(n=n.nextSibling)););else{Oi.innerHTML=Ui(r==="svg"?`${e}`:r==="mathml"?`${e}`:e);let u=Oi.content;if(r==="svg"||r==="mathml"){let m=u.firstChild;for(;m.firstChild;)u.appendChild(m.firstChild);u.removeChild(m)}t.insertBefore(u,o)}return[a?a.nextSibling:t.firstChild,o?o.previousSibling:t.lastChild]}};var Nu=Symbol("_vtc");function Su(e,t,o){let r=e[Nu];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):o?e.setAttribute("class",t):e.className=t}var Ln=Symbol("_vod"),Li=Symbol("_vsh"),B={name:"show",beforeMount(e,{value:t},{transition:o}){e[Ln]=e.style.display==="none"?"":e.style.display,o&&t?o.beforeEnter(e):sn(e,t)},mounted(e,{value:t},{transition:o}){o&&t&&o.enter(e)},updated(e,{value:t,oldValue:o},{transition:r}){!t!=!o&&(r?t?(r.beforeEnter(e),sn(e,!0),r.enter(e)):r.leave(e,()=>{sn(e,!1)}):sn(e,t))},beforeUnmount(e,{value:t}){sn(e,t)}};function sn(e,t){e.style.display=t?e[Ln]:"none",e[Li]=!t}var Du=Symbol("");var Ru=/(?:^|;)\s*display\s*:/;function Tu(e,t,o){let r=e.style,n=Fe(o),i=!1;if(o&&!n){if(t)if(Fe(t))for(let a of t.split(";")){let u=a.slice(0,a.indexOf(":")).trim();o[u]==null&&nn(r,u,"")}else for(let a in t)o[a]==null&&nn(r,a,"");for(let a in o){a==="display"&&(i=!0);let u=o[a];u!=null?Au(e,a,!Fe(t)&&t?t[a]:void 0,u)||nn(r,a,u):nn(r,a,"")}}else if(n){if(t!==o){let a=r[Du];a&&(o+=";"+a),r.cssText=o,i=Ru.test(o)}}else t&&e.removeAttribute("style");Ln in e&&(e[Ln]=i?r.display:"",e[Li]&&(r.display="none"))}var Un=/\s*!important$/;function nn(e,t,o){if(Ee(o))o.forEach(r=>nn(e,t,r));else if(o==null&&(o=""),t.startsWith("--"))Un.test(o)?e.setProperty(t,o.replace(Un,""),"important"):e.setProperty(t,o);else{let r=Ou(e,t);Un.test(o)?e.setProperty(qt(r),o.replace(Un,""),"important"):e[r]=o}}var Ai=["Webkit","Moz","ms"],Vo={};function Ou(e,t){let o=Vo[t];if(o)return o;let r=Ke(t);if(r!=="filter"&&r in e)return Vo[t]=r;r=Yt(r);for(let n=0;nPo||(Uu.then(()=>Po=0),Po=Date.now());function Fu(e,t){let o=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=o.attached)return;let n=o.value;if(Ee(n)){let i=r.stopImmediatePropagation;r.stopImmediatePropagation=()=>{i.call(r),r._stopped=!0};let a=n.slice(),u=[r];for(let m=0;me.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,zu=(e,t,o,r,n,i)=>{let a=n==="svg";t==="class"?Su(e,r,a):t==="style"?Tu(e,o,r):us(t)?cs(t)||Pu(e,t,o,r,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Hu(e,t,r,a))?(Pi(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Vi(e,t,r,a,i,t!=="value")):e._isVueCE&&(Bu(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Fe(r)))?Pi(e,Ke(t),r,i,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),Vi(e,t,r,a))};function Hu(e,t,o,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&Mi(t)&&_e(o));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){let n=e.tagName;if(n==="IMG"||n==="VIDEO"||n==="CANVAS"||n==="SOURCE")return!1}return Mi(t)&&Fe(o)?!1:t in e}function Bu(e,t){let o=e._def.props;if(!o)return!1;let r=Ke(t);return Array.isArray(o)?o.some(n=>Ke(n)===r):Object.keys(o).some(n=>Ke(n)===r)}var Gu=["ctrl","shift","alt","meta"],ju={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Gu.some(o=>e[`${o}Key`]&&!t.includes(o))},we=(e,t)=>{if(!e)return e;let o=e._withMods||(e._withMods={}),r=t.join(".");return o[r]||(o[r]=((n,...i)=>{for(let a=0;a{let t=Ku().createApp(...e),{mount:o}=t;return t.mount=r=>{let n=Ju(r);if(!n)return;let i=t._component;!_e(i)&&!i.render&&!i.template&&(i.template=n.innerHTML),n.nodeType===1&&(n.textContent="");let a=o(n,!1,Yu(n));return n instanceof Element&&(n.removeAttribute("v-cloak"),n.setAttribute("data-v-app","")),a},t});function Yu(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Ju(e){return Fe(e)?document.querySelector(e):e}var rs=typeof document<"u";function Hi(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Qu(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&Hi(e.default)}var qe=Object.assign;function Fn(e,t){let o={};for(let r in t){let n=t[r];o[r]=gt(n)?n.map(e):e(n)}return o}var Es=()=>{},gt=Array.isArray;function Uo(e,t){let o={};for(let r in e)o[r]=r in t?t[r]:e[r];return o}var Bi=/#/g,Xu=/&/g,Zu=/\//g,xu=/=/g,ec=/\?/g,Gi=/\+/g,tc=/%5B/g,sc=/%5D/g,ji=/%5E/g,nc=/%60/g,Wi=/%7B/g,oc=/%7C/g,Ki=/%7D/g,rc=/%20/g;function Lo(e){return e==null?"":encodeURI(""+e).replace(oc,"|").replace(tc,"[").replace(sc,"]")}function Yi(e){return Lo(e).replace(Wi,"{").replace(Ki,"}").replace(ji,"^")}function Mo(e){return Lo(e).replace(Gi,"%2B").replace(rc,"+").replace(Bi,"%23").replace(Xu,"%26").replace(nc,"`").replace(Wi,"{").replace(Ki,"}").replace(ji,"^")}function ic(e){return Mo(e).replace(xu,"%3D")}function ac(e){return Lo(e).replace(Bi,"%23").replace(ec,"%3F")}function Ji(e){return ac(e).replace(Zu,"%2F")}function _s(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}var lc=/\/$/,dc=e=>e.replace(lc,"");function zn(e,t,o="/"){let r,n={},i="",a="",u=t.indexOf("#"),m=t.indexOf("?");return m=u>=0&&m>u?-1:m,m>=0&&(r=t.slice(0,m),i=t.slice(m,u>0?u:t.length),n=e(i.slice(1))),u>=0&&(r=r||t.slice(0,u),a=t.slice(u,t.length)),r=cc(r??t,o),{fullPath:r+i+a,path:r,query:n,hash:_s(a)}}function Qi(e,t){let o=t.query?e(t.query):"";return t.path+(o&&"?")+o+(t.hash||"")}function Fo(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Xi(e,t,o){let r=t.matched.length-1,n=o.matched.length-1;return r>-1&&r===n&&ns(t.matched[r],o.matched[n])&&zo(t.params,o.params)&&e(t.query)===e(o.query)&&t.hash===o.hash}function ns(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function zo(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var o in e)if(!uc(e[o],t[o]))return!1;return!0}function uc(e,t){return gt(e)?zi(e,t):gt(t)?zi(t,e):e?.valueOf()===t?.valueOf()}function zi(e,t){return gt(t)?e.length===t.length&&e.every((o,r)=>o===t[r]):e.length===1&&e[0]===t}function cc(e,t){if(e.startsWith("/"))return e;if(!e)return t;let o=t.split("/"),r=e.split("/"),n=r[r.length-1];(n===".."||n===".")&&r.push("");let i=o.length-1,a,u;for(a=0;a1&&i--;else break;return o.slice(0,i).join("/")+"/"+r.slice(a).join("/")}var Gt={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},Hn=(function(e){return e.pop="pop",e.push="push",e})({}),Bn=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function Zi(e){if(!e)if(rs){let t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),dc(e)}var pc=/^[^#]+#/;function xi(e,t){return e.replace(pc,"#")+t}function fc(e,t){let o=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-o.left-(t.left||0),top:r.top-o.top-(t.top||0)}}var on=()=>({left:window.scrollX,top:window.scrollY});function ea(e){let t;if("el"in e){let o=e.el,r=typeof o=="string"&&o.startsWith("#"),n=typeof o=="string"?r?document.getElementById(o.slice(1)):document.querySelector(o):o;if(!n)return;t=fc(n,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function Ho(e,t){return(history.state?history.state.position-t:-1)+e}var $o=new Map;function ta(e,t){$o.set(e,t)}function sa(e){let t=$o.get(e);return $o.delete(e),t}function mc(e){return typeof e=="string"||e&&typeof e=="object"}function Bo(e){return typeof e=="string"||typeof e=="symbol"}var Be=(function(e){return e[e.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",e[e.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",e[e.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",e[e.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",e[e.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",e})({}),na=Symbol("");var c5={[Be.MATCHER_NOT_FOUND]({location:e,currentLocation:t}){return`No match for ${JSON.stringify(e)}${t?` while being at `+JSON.stringify(t):""}`},[Be.NAVIGATION_GUARD_REDIRECT]({from:e,to:t}){return`Redirected from "${e.fullPath}" to "${vc(t)}" via a navigation guard.`},[Be.NAVIGATION_ABORTED]({from:e,to:t}){return`Navigation aborted from "${e.fullPath}" to "${t.fullPath}" via a navigation guard.`},[Be.NAVIGATION_CANCELLED]({from:e,to:t}){return`Navigation cancelled from "${e.fullPath}" to "${t.fullPath}" with a new navigation.`},[Be.NAVIGATION_DUPLICATED]({from:e,to:t}){return`Avoided redundant navigation to current location: "${e.fullPath}".`}};function os(e,t){return qe(new Error,{type:e,[na]:!0},t)}function Vt(e,t){return e instanceof Error&&na in e&&(t==null||!!(e.type&t))}var hc=["params","query","hash"];function vc(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;let t={};for(let o of hc)o in e&&(t[o]=e[o]);return JSON.stringify(t,null,2)}function oa(e){let t={};if(e===""||e==="?")return t;let o=(e[0]==="?"?e.slice(1):e).split("&");for(let r=0;rn&&Mo(n)):[r&&Mo(r)]).forEach(n=>{n!==void 0&&(t+=(t.length?"&":"")+o,n!=null&&(t+="="+n))})}return t}function ra(e){let t={};for(let o in e){let r=e[o];r!==void 0&&(t[o]=gt(r)?r.map(n=>n==null?null:""+n):r==null?r:""+r)}return t}var ia=Symbol(""),jo=Symbol(""),Gn=Symbol(""),jn=Symbol(""),Wn=Symbol("");function Cs(){let e=[];function t(r){return e.push(r),()=>{let n=e.indexOf(r);n>-1&&e.splice(n,1)}}function o(){e=[]}return{add:t,list:()=>e.slice(),reset:o}}function Bt(e,t,o,r,n,i=a=>a()){let a=r&&(r.enterCallbacks[n]=r.enterCallbacks[n]||[]);return()=>new Promise((u,m)=>{let h=p=>{p===!1?m(os(Be.NAVIGATION_ABORTED,{from:o,to:t})):p instanceof Error?m(p):mc(p)?m(os(Be.NAVIGATION_GUARD_REDIRECT,{from:t,to:p})):(a&&r.enterCallbacks[n]===a&&typeof p=="function"&&a.push(p),u())},v=i(()=>e.call(r&&r.instances[n],t,o,h)),k=Promise.resolve(v);e.length<3&&(k=k.then(h)),k.catch(p=>m(p))})}function Kn(e,t,o,r,n=i=>i()){let i=[];for(let a of e)for(let u in a.components){let m=a.components[u];if(!(t!=="beforeRouteEnter"&&!a.instances[u]))if(Hi(m)){let h=(m.__vccOpts||m)[t];h&&i.push(Bt(h,o,r,a,u,n))}else{let h=m();i.push(()=>h.then(v=>{if(!v)throw new Error(`Couldn't resolve component "${u}" at "${a.path}"`);let k=Qu(v)?v.default:v;a.mods[u]=v,a.components[u]=k;let p=(k.__vccOpts||k)[t];return p&&Bt(p,o,r,a,u,n)()}))}}return i}function aa(e,t){let o=[],r=[],n=[],i=Math.max(t.matched.length,e.matched.length);for(let a=0;ans(h,u))?r.push(u):o.push(u));let m=e.matched[a];m&&(t.matched.find(h=>ns(h,m))||n.push(m))}return[o,r,n]}var yc=()=>location.protocol+"//"+location.host;function ga(e,t){let{pathname:o,search:r,hash:n}=t,i=e.indexOf("#");if(i>-1){let a=n.includes(e.slice(i))?e.slice(i).length:1,u=n.slice(a);return u[0]!=="/"&&(u="/"+u),Fo(u,"")}return Fo(o,e)+r+n}function gc(e,t,o,r){let n=[],i=[],a=null,u=({state:p})=>{let g=ga(e,location),w=o.value,b=t.value,T=0;if(p){if(o.value=g,t.value=p,a&&a===w){a=null;return}T=b?p.position-b.position:0}else r(g);n.forEach(N=>{N(o.value,w,{delta:T,type:Hn.pop,direction:T?T>0?Bn.forward:Bn.back:Bn.unknown})})};function m(){a=o.value}function h(p){n.push(p);let g=()=>{let w=n.indexOf(p);w>-1&&n.splice(w,1)};return i.push(g),g}function v(){if(document.visibilityState==="hidden"){let{history:p}=window;if(!p.state)return;p.replaceState(qe({},p.state,{scroll:on()}),"")}}function k(){for(let p of i)p();i=[],window.removeEventListener("popstate",u),window.removeEventListener("pagehide",v),document.removeEventListener("visibilitychange",v)}return window.addEventListener("popstate",u),window.addEventListener("pagehide",v),document.addEventListener("visibilitychange",v),{pauseListeners:m,listen:h,destroy:k}}function la(e,t,o,r=!1,n=!1){return{back:e,current:t,forward:o,replaced:r,position:window.history.length,scroll:n?on():null}}function bc(e){let{history:t,location:o}=window,r={value:ga(e,o)},n={value:t.state};n.value||i(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function i(m,h,v){let k=e.indexOf("#"),p=k>-1?(o.host&&document.querySelector("base")?e:e.slice(k))+m:yc()+e+m;try{t[v?"replaceState":"pushState"](h,"",p),n.value=h}catch(g){console.error(g),o[v?"replace":"assign"](p)}}function a(m,h){i(m,qe({},t.state,la(n.value.back,m,n.value.forward,!0),h,{position:n.value.position}),!0),r.value=m}function u(m,h){let v=qe({},n.value,t.state,{forward:m,scroll:on()});i(v.current,v,!0),i(m,qe({},la(r.value,m,null),{position:v.position+1},h),!1),r.value=m}return{location:r,state:n,push:u,replace:a}}function ba(e){e=Zi(e);let t=bc(e),o=gc(e,t.state,t.location,t.replace);function r(i,a=!0){a||o.pauseListeners(),history.go(i)}let n=qe({location:"",base:e,go:r,createHref:xi.bind(null,e)},t,o);return Object.defineProperty(n,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(n,"state",{enumerable:!0,get:()=>t.state.value}),n}var is=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({}),Je=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e})(Je||{}),wc={type:is.Static,value:""},kc=/[a-zA-Z0-9_]/;function _c(e){if(!e)return[[]];if(e==="/")return[[wc]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(g){throw new Error(`ERR (${o})/"${h}": ${g}`)}let o=Je.Static,r=o,n=[],i;function a(){i&&n.push(i),i=[]}let u=0,m,h="",v="";function k(){h&&(o===Je.Static?i.push({type:is.Static,value:h}):o===Je.Param||o===Je.ParamRegExp||o===Je.ParamRegExpEnd?(i.length>1&&(m==="*"||m==="+")&&t(`A repeatable param (${h}) must be alone in its segment. eg: '/:ids+.`),i.push({type:is.Param,value:h,regexp:v,repeatable:m==="*"||m==="+",optional:m==="*"||m==="?"})):t("Invalid state to consume buffer"),h="")}function p(){h+=m}for(;ut.length?t.length===1&&t[0]===ot.Static+ot.Segment?1:-1:0}function wa(e,t){let o=0,r=e.score,n=t.score;for(;o0&&t[t.length-1]<0}var Dc={strict:!1,end:!0,sensitive:!1};function Rc(e,t,o){let r=Nc(_c(e.path),o),n=qe(r,{record:e,parent:t,children:[],alias:[]});return t&&!n.record.aliasOf==!t.record.aliasOf&&t.children.push(n),n}function Tc(e,t){let o=[],r=new Map;t=Uo(Dc,t);function n(k){return r.get(k)}function i(k,p,g){let w=!g,b=pa(k);b.aliasOf=g&&g.record;let T=Uo(t,k),N=[b];if("alias"in k){let C=typeof k.alias=="string"?[k.alias]:k.alias;for(let A of C)N.push(pa(qe({},b,{components:g?g.record.components:b.components,path:A,aliasOf:g?g.record:b})))}let R,I;for(let C of N){let{path:A}=C;if(p&&A[0]!=="/"){let P=p.record.path,Z=P[P.length-1]==="/"?"":"/";C.path=p.record.path+(A&&Z+A)}if(R=Rc(C,p,T),g?g.alias.push(R):(I=I||R,I!==R&&I.alias.push(R),w&&k.name&&!fa(R)&&a(k.name)),ka(R)&&m(R),b.children){let P=b.children;for(let Z=0;Z{a(I)}:Es}function a(k){if(Bo(k)){let p=r.get(k);p&&(r.delete(k),o.splice(o.indexOf(p),1),p.children.forEach(a),p.alias.forEach(a))}else{let p=o.indexOf(k);p>-1&&(o.splice(p,1),k.record.name&&r.delete(k.record.name),k.children.forEach(a),k.alias.forEach(a))}}function u(){return o}function m(k){let p=Ic(k,o);o.splice(p,0,k),k.record.name&&!fa(k)&&r.set(k.record.name,k)}function h(k,p){let g,w={},b,T;if("name"in k&&k.name){if(g=r.get(k.name),!g)throw os(Be.MATCHER_NOT_FOUND,{location:k});T=g.record.name,w=qe(ca(p.params,g.keys.filter(I=>!I.optional).concat(g.parent?g.parent.keys.filter(I=>I.optional):[]).map(I=>I.name)),k.params&&ca(k.params,g.keys.map(I=>I.name))),b=g.stringify(w)}else if(k.path!=null)b=k.path,g=o.find(I=>I.re.test(b)),g&&(w=g.parse(b),T=g.record.name);else{if(g=p.name?r.get(p.name):o.find(I=>I.re.test(p.path)),!g)throw os(Be.MATCHER_NOT_FOUND,{location:k,currentLocation:p});T=g.record.name,w=qe({},p.params,k.params),b=g.stringify(w)}let N=[],R=g;for(;R;)N.unshift(R.record),R=R.parent;return{name:T,path:b,params:w,matched:N,meta:Ac(N)}}e.forEach(k=>i(k));function v(){o.length=0,r.clear()}return{addRoute:i,resolve:h,removeRoute:a,clearRoutes:v,getRoutes:u,getRecordMatcher:n}}function ca(e,t){let o={};for(let r of t)r in e&&(o[r]=e[r]);return o}function pa(e){let t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Oc(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function Oc(e){let t={},o=e.props||!1;if("component"in e)t.default=o;else for(let r in e.components)t[r]=typeof o=="object"?o[r]:o;return t}function fa(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Ac(e){return e.reduce((t,o)=>qe(t,o.meta),{})}function Ic(e,t){let o=0,r=t.length;for(;o!==r;){let i=o+r>>1;wa(e,t[i])<0?r=i:o=i+1}let n=Vc(e);return n&&(r=t.lastIndexOf(n,r-1)),r}function Vc(e){let t=e;for(;t=t.parent;)if(ka(t)&&wa(e,t)===0)return t}function ka({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function ma(e){let t=lt(Gn),o=lt(jn),r=!1,n=null,i=tt(()=>{let v=Ut(e.to);return t.resolve(v)}),a=tt(()=>{let{matched:v}=i.value,{length:k}=v,p=v[k-1],g=o.matched;if(!p||!g.length)return-1;let w=g.findIndex(ns.bind(null,p));if(w>-1)return w;let b=ha(v[k-2]);return k>1&&ha(p)===b&&g[g.length-1].path!==b?g.findIndex(ns.bind(null,v[k-2])):w}),u=tt(()=>a.value>-1&&Uc(o.params,i.value.params)),m=tt(()=>a.value>-1&&a.value===o.matched.length-1&&zo(o.params,i.value.params));function h(v={}){if($c(v)){let k=t[Ut(e.replace)?"replace":"push"](Ut(e.to)).catch(Es);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>k),k}return Promise.resolve()}return{route:i,href:tt(()=>i.value.href),isActive:u,isExactActive:m,navigate:h}}function Pc(e){return e.length===1?e[0]:e}var qc=xs({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:ma,setup(e,{slots:t}){let o=ze(ma(e)),{options:r}=lt(Gn),n=tt(()=>({[va(e.activeClass,r.linkActiveClass,"router-link-active")]:o.isActive,[va(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:o.isExactActive}));return()=>{let i=t.default&&Pc(t.default(o));return e.custom?i:Ne("a",{"aria-current":o.isExactActive?e.ariaCurrentValue:null,href:o.href,onClick:o.navigate,class:n.value},i)}}}),Mc=qc;function $c(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){let t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function Uc(e,t){for(let o in t){let r=t[o],n=e[o];if(typeof r=="string"){if(r!==n)return!1}else if(!gt(n)||n.length!==r.length||r.some((i,a)=>i.valueOf()!==n[a].valueOf()))return!1}return!0}function ha(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}var va=(e,t,o)=>e??t??o,Lc=xs({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:o}){let r=lt(Wn),n=tt(()=>e.route||r.value),i=lt(jo,0),a=tt(()=>{let h=Ut(i),{matched:v}=n.value,k;for(;(k=v[h])&&!k.components;)h++;return h}),u=tt(()=>n.value.matched[a.value]);ts(jo,tt(()=>a.value+1)),ts(ia,u),ts(Wn,n);let m=Ze();return He(()=>[m.value,u.value,e.name],([h,v,k],[p,g,w])=>{v&&(v.instances[k]=h,g&&g!==v&&h&&h===p&&(v.leaveGuards.size||(v.leaveGuards=g.leaveGuards),v.updateGuards.size||(v.updateGuards=g.updateGuards))),h&&v&&(!g||!ns(v,g)||!p)&&(v.enterCallbacks[k]||[]).forEach(b=>b(h))},{flush:"post"}),()=>{let h=n.value,v=e.name,k=u.value,p=k&&k.components[v];if(!p)return ya(o.default,{Component:p,route:h});let g=k.props[v],w=g?g===!0?h.params:typeof g=="function"?g(h):g:null,T=Ne(p,qe({},w,t,{onVnodeUnmounted:N=>{N.component.isUnmounted&&(k.instances[v]=null)},ref:m}));return ya(o.default,{Component:T,route:h})||T}}});function ya(e,t){if(!e)return null;let o=e(t);return o.length===1?o[0]:o}var Wo=Lc;function _a(e){let t=Tc(e.routes,e),o=e.parseQuery||oa,r=e.stringifyQuery||Go,n=e.history,i=Cs(),a=Cs(),u=Cs(),m=bn(Gt),h=Gt;rs&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");let v=Fn.bind(null,U=>""+U),k=Fn.bind(null,Ji),p=Fn.bind(null,_s);function g(U,te){let L,K;return Bo(U)?(L=t.getRecordMatcher(U),K=te):K=U,t.addRoute(K,L)}function w(U){let te=t.getRecordMatcher(U);te&&t.removeRoute(te)}function b(){return t.getRoutes().map(U=>U.record)}function T(U){return!!t.getRecordMatcher(U)}function N(U,te){if(te=qe({},te||m.value),typeof U=="string"){let _=zn(o,U,te.path),S=t.resolve({path:_.path},te),q=n.createHref(_.fullPath);return qe(_,S,{params:p(S.params),hash:_s(_.hash),redirectedFrom:void 0,href:q})}let L;if(U.path!=null)L=qe({},U,{path:zn(o,U.path,te.path).path});else{let _=qe({},U.params);for(let S in _)_[S]==null&&delete _[S];L=qe({},U,{params:k(_)}),te.params=k(te.params)}let K=t.resolve(L,te),fe=U.hash||"";K.params=v(p(K.params));let Ce=Qi(r,qe({},U,{hash:Yi(fe),path:K.path})),ce=n.createHref(Ce);return qe({fullPath:Ce,hash:fe,query:r===Go?ra(U.query):U.query||{}},K,{redirectedFrom:void 0,href:ce})}function R(U){return typeof U=="string"?zn(o,U,m.value.path):qe({},U)}function I(U,te){if(h!==U)return os(Be.NAVIGATION_CANCELLED,{from:te,to:U})}function C(U){return Z(U)}function A(U){return C(qe(R(U),{replace:!0}))}function P(U,te){let L=U.matched[U.matched.length-1];if(L&&L.redirect){let{redirect:K}=L,fe=typeof K=="function"?K(U,te):K;return typeof fe=="string"&&(fe=fe.includes("?")||fe.includes("#")?fe=R(fe):{path:fe},fe.params={}),qe({query:U.query,hash:U.hash,params:fe.path!=null?{}:U.params},fe)}}function Z(U,te){let L=h=N(U),K=m.value,fe=U.state,Ce=U.force,ce=U.replace===!0,_=P(L,K);if(_)return Z(qe(R(_),{state:typeof _=="object"?qe({},fe,_.state):fe,force:Ce,replace:ce}),te||L);let S=L;S.redirectedFrom=te;let q;return!Ce&&Xi(r,K,L)&&(q=os(Be.NAVIGATION_DUPLICATED,{to:S,from:K}),Se(K,K,!0,!1)),(q?Promise.resolve(q):z(S,K)).catch(F=>Vt(F)?Vt(F,Be.NAVIGATION_GUARD_REDIRECT)?F:Re(F):pe(F,S,K)).then(F=>{if(F){if(Vt(F,Be.NAVIGATION_GUARD_REDIRECT))return Z(qe({replace:ce},R(F.to),{state:typeof F.to=="object"?qe({},fe,F.to.state):fe,force:Ce}),te||S)}else F=se(S,K,!0,ce,fe);return ae(S,K,F),F})}function Y(U,te){let L=I(U,te);return L?Promise.reject(L):Promise.resolve()}function j(U){let te=W.values().next().value;return te&&typeof te.runWithContext=="function"?te.runWithContext(U):U()}function z(U,te){let L,[K,fe,Ce]=aa(U,te);L=Kn(K.reverse(),"beforeRouteLeave",U,te);for(let _ of K)_.leaveGuards.forEach(S=>{L.push(Bt(S,U,te))});let ce=Y.bind(null,U,te);return L.push(ce),le(L).then(()=>{L=[];for(let _ of i.list())L.push(Bt(_,U,te));return L.push(ce),le(L)}).then(()=>{L=Kn(fe,"beforeRouteUpdate",U,te);for(let _ of fe)_.updateGuards.forEach(S=>{L.push(Bt(S,U,te))});return L.push(ce),le(L)}).then(()=>{L=[];for(let _ of Ce)if(_.beforeEnter)if(gt(_.beforeEnter))for(let S of _.beforeEnter)L.push(Bt(S,U,te));else L.push(Bt(_.beforeEnter,U,te));return L.push(ce),le(L)}).then(()=>(U.matched.forEach(_=>_.enterCallbacks={}),L=Kn(Ce,"beforeRouteEnter",U,te,j),L.push(ce),le(L))).then(()=>{L=[];for(let _ of a.list())L.push(Bt(_,U,te));return L.push(ce),le(L)}).catch(_=>Vt(_,Be.NAVIGATION_CANCELLED)?_:Promise.reject(_))}function ae(U,te,L){u.list().forEach(K=>j(()=>K(U,te,L)))}function se(U,te,L,K,fe){let Ce=I(U,te);if(Ce)return Ce;let ce=te===Gt,_=rs?history.state:{};L&&(K||ce?n.replace(U.fullPath,qe({scroll:ce&&_&&_.scroll},fe)):n.push(U.fullPath,fe)),m.value=U,Se(U,te,L,ce),Re()}let re;function ue(){re||(re=n.listen((U,te,L)=>{if(!oe.listening)return;let K=N(U),fe=P(K,oe.currentRoute.value);if(fe){Z(qe(fe,{replace:!0,force:!0}),K).catch(Es);return}h=K;let Ce=m.value;rs&&ta(Ho(Ce.fullPath,L.delta),on()),z(K,Ce).catch(ce=>Vt(ce,Be.NAVIGATION_ABORTED|Be.NAVIGATION_CANCELLED)?ce:Vt(ce,Be.NAVIGATION_GUARD_REDIRECT)?(Z(qe(R(ce.to),{force:!0}),K).then(_=>{Vt(_,Be.NAVIGATION_ABORTED|Be.NAVIGATION_DUPLICATED)&&!L.delta&&L.type===Hn.pop&&n.go(-1,!1)}).catch(Es),Promise.reject()):(L.delta&&n.go(-L.delta,!1),pe(ce,K,Ce))).then(ce=>{ce=ce||se(K,Ce,!1),ce&&(L.delta&&!Vt(ce,Be.NAVIGATION_CANCELLED)?n.go(-L.delta,!1):L.type===Hn.pop&&Vt(ce,Be.NAVIGATION_ABORTED|Be.NAVIGATION_DUPLICATED)&&n.go(-1,!1)),ae(K,Ce,ce)}).catch(Es)}))}let ke=Cs(),he=Cs(),me;function pe(U,te,L){Re(U);let K=he.list();return K.length?K.forEach(fe=>fe(U,te,L)):console.error(U),Promise.reject(U)}function Te(){return me&&m.value!==Gt?Promise.resolve():new Promise((U,te)=>{ke.add([U,te])})}function Re(U){return me||(me=!U,ue(),ke.list().forEach(([te,L])=>U?L(U):te()),ke.reset()),U}function Se(U,te,L,K){let{scrollBehavior:fe}=e;if(!rs||!fe)return Promise.resolve();let Ce=!L&&sa(Ho(U.fullPath,0))||(K||!L)&&history.state&&history.state.scroll||null;return _t().then(()=>fe(U,te,Ce)).then(ce=>ce&&ea(ce)).catch(ce=>pe(ce,U,te))}let D=U=>n.go(U),V,W=new Set,oe={currentRoute:m,listening:!0,addRoute:g,removeRoute:w,clearRoutes:t.clearRoutes,hasRoute:T,getRoutes:b,resolve:N,options:e,push:C,replace:A,go:D,back:()=>D(-1),forward:()=>D(1),beforeEach:i.add,beforeResolve:a.add,afterEach:u.add,onError:he.add,isReady:Te,install(U){U.component("RouterLink",Mc),U.component("RouterView",Wo),U.config.globalProperties.$router=oe,Object.defineProperty(U.config.globalProperties,"$route",{enumerable:!0,get:()=>Ut(m)}),rs&&!V&&m.value===Gt&&(V=!0,C(n.location).catch(K=>{}));let te={};for(let K in Gt)Object.defineProperty(te,K,{get:()=>m.value[K],enumerable:!0});U.provide(Gn,oe),U.provide(jn,Fs(te)),U.provide(Wn,m);let L=U.unmount;W.add(U),U.unmount=function(){W.delete(U),W.size<1&&(h=Gt,re&&re(),re=null,m.value=Gt,V=!1,me=!1),L()}}};function le(U){return U.reduce((te,L)=>te.then(()=>j(L)),Promise.resolve())}return oe}function Ea(e){return lt(jn)}function Ca(e,t){return t?.split(".").reduce((o,r)=>o?.[r],e)}function Ko(e=null,t=new Map){let o=ze({}),r=[],n=!1,i=new Proxy(o,{get(a,u){return typeof u=="string"&&u.startsWith("__v_")||Reflect.has(a,u)?Reflect.get(a,u):e?.[u]}});return Object.defineProperty(o,"parent",{value:e,configurable:!0}),Object.defineProperty(o,"viewState",{get:()=>i}),i.watch=(a,u,m=!1)=>{let h=typeof a=="function"?()=>a(i):()=>Ca(i,a),v=He(h,u,{deep:m,flush:"post"});return r.push(v),_t(()=>{n||u(h(),h())}),v},i.watchGroup=(a,u)=>i.watch(()=>a.map(m=>Ca(i,m)),u,!0),i.on=(a,u)=>{if(a==="dispose")return r.push(u),()=>{};t.has(a)||t.set(a,new Set),t.get(a).add(u);let m=()=>t.get(a)?.delete(u);return r.push(m),m},i.emit=(a,...u)=>{for(let m of[...t.get(a)||[]])m({},...u)},i.dispose=()=>{n=!0,r.splice(0).reverse().forEach(a=>a())},Us(i.dispose),i}function mt(){let e=new Set,t=new Set,o=!1,r=(i,a=0)=>{if(o)return;let u=setTimeout(()=>{e.delete(u),i()},a);return e.add(u),u};r.cancel=i=>{clearTimeout(i),e.delete(i)};let n=(i,a)=>{if(o)return;let u=setInterval(i,a);return t.add(u),u};return n.cancel=i=>{clearInterval(i),t.delete(i)},Us(()=>{o=!0,e.forEach(clearTimeout),t.forEach(clearInterval)}),{timeout:r,interval:n}}function as(){let e=[];return Us(()=>e.forEach(t=>t())),(t,o,r,n)=>{t.addEventListener(o,r,n),e.push(()=>t.removeEventListener(o,r,n))}}var Na=function(e,t,o,r){e.title="Main",e.user={status:"connection"},e.site_options,e.toasts=[],e.removeToast=function(m){let h=e.toasts.indexOf(m);h!==-1&&e.toasts.splice(h,1)},e.addToast=function(m){return e.toasts.push(m),r(function(){e.removeToast(m)},8e3),m},e.path=o.url(),e.paths=o.path().substring(1).split("/"),e.darkMode=function(m){localStorage.setItem("darkMode",m),e.isDarkMode=m;let h="/css/prism-okaidia.css",v="/css/prism.css";if(m){$("body").addClass("dark-mode");let p=document.createElement("link");p.href=h,p.rel="stylesheet",document.head.append(p),$(`link[href='${v}']`).remove()}else{$("body").removeClass("dark-mode");let p=document.createElement("link");p.href=v,p.rel="stylesheet",document.head.append(p),$(`link[href='${h}']`).remove()}var k=document.querySelector(".floatingchat-container-wrap-mo498 .floating-chat-kofi-text-container-wrap");k&&(k.style.backgroundColor=m?"#FAF9F6":"#1A1815",k.style.color=m?"#1A1815":"#FAF9F6"),e.emit("dark-mode",m)},e.darkMode(localStorage.getItem("darkMode")=="true");function n(){t.get("/api/user").then(m=>{m&&(e.user=m.data)},()=>{e.user=null})}n();function i(){t.get("/api/options").then(m=>{m&&(e.site_options=m.data)},()=>{e.site_options=null})}i();function a(){t.get("/api/message").then(m=>{m&&(e.generalMessage=m.data)},()=>{e.generalMessage=null})}a();function u(m,h){h&&(e.title=h.title),e.path=o.url(),e.paths=o.path().substring(1).split("/")}e.on("routeChange",u),e.on("routeUpdate",u)},Sa=function(e,t){let o=as()},Da=function(e,t,o,r,n){e.terms="",e.options={expirationMode:"remove",update:!1,image:!0,pdf:!0,notebook:!0,loc:!0,link:!0},e.saving=!1,e.message=null,e.error=null,n.load().then(u=>{e.quota=u},console.error);function i(){t.get("/api/user/default").then(u=>{let m=u.data||{};m.terms&&(e.terms=m.terms.join(` diff --git a/test/asset-build.test.js b/test/asset-build.test.js index e5d992c..459c3ef 100644 --- a/test/asset-build.test.js +++ b/test/asset-build.test.js @@ -66,6 +66,15 @@ describe("asset build", function () { } }); + it("ships the upstream PDF.js bytes without a second minification pass", function () { + const upstream = fs.readFileSync(path.join(path.dirname(gulpfile), groups.pdfFiles[0])); + fs.writeFileSync(path.join(directory, groups.pdfFiles[0]), upstream); + const result = build(); + expect(result.status, result.stderr).to.equal(0); + const bundled = fs.readFileSync(path.join(directory, "public/script/pdf.min.js")); + expect(bundled.equals(upstream)).to.equal(true); + }); + it("fails on missing input without publishing a manifest", function () { fs.unlinkSync(path.join(directory, groups.coreJsFiles[0])); const result = build(); @@ -75,7 +84,7 @@ describe("asset build", function () { }); it("fails on invalid JavaScript without publishing a manifest", function () { - fs.writeFileSync(path.join(directory, groups.pdfFiles[0]), "function {"); + fs.writeFileSync(path.join(directory, groups.markdownFiles[0]), "function {"); const result = build(); expect(result.status).not.to.equal(0); expect(result.stderr).to.include("uglify");