/**
 * @licstart The following is the entire license notice for the
 * JavaScript code in this page
 *
 * Copyright 2022 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(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("pdfjs-dist/build/pdf",[],e):"object"==typeof exports?exports["pdfjs-dist/build/pdf"]=e():t["pdfjs-dist/build/pdf"]=t.pdfjsLib=e()}(globalThis,()=>(()=>{var __webpack_modules__=[,(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VerbosityLevel=e.Util=e.UnknownErrorException=e.UnexpectedResponseException=e.UNSUPPORTED_FEATURES=e.TextRenderingMode=e.StreamType=e.RenderingIntentFlag=e.PermissionFlag=e.PasswordResponses=e.PasswordException=e.PageActionEventType=e.OPS=e.MissingPDFException=e.LINE_FACTOR=e.LINE_DESCENT_FACTOR=e.InvalidPDFException=e.ImageKind=e.IDENTITY_MATRIX=e.FormatError=e.FontType=e.FeatureTest=e.FONT_IDENTITY_MATRIX=e.DocumentActionEventType=e.CMapCompressionType=e.BaseException=e.AnnotationType=e.AnnotationStateModelType=e.AnnotationReviewState=e.AnnotationReplyType=e.AnnotationMode=e.AnnotationMarkedState=e.AnnotationFlag=e.AnnotationFieldFlag=e.AnnotationEditorType=e.AnnotationEditorPrefix=e.AnnotationEditorParamsType=e.AnnotationBorderStyleType=e.AnnotationActionEventType=e.AbortException=void 0,e.arrayByteLength=v,e.arraysToBytes=function(r){var a=r.length;if(1===a&&r[0]instanceof Uint8Array)return r[0];let e=0;for(let t=0;t<a;t++)e+=v(r[t]);let i=0;var s=new Uint8Array(e);for(let e=0;e<a;e++){let t=r[e];var n=(t=t instanceof Uint8Array?t:"string"==typeof t?m(t):new Uint8Array(t)).byteLength;s.set(t,i),i+=n}return s},e.assert=function(t,e){t||s(e)},e.bytesToString=function(e){"object"==typeof e&&null!==e&&void 0!==e.length||s("Invalid argument for bytesToString");var r=e.length;if(r<8192)return String.fromCharCode.apply(null,e);var a=[];for(let t=0;t<r;t+=8192){var i=Math.min(t+8192,r),i=e.subarray(t,i);a.push(String.fromCharCode.apply(null,i))}return a.join("")},e.createPromiseCapability=function(){const t=Object.create(null);let a=!1;return Object.defineProperty(t,"settled",{get(){return a}}),t.promise=new Promise(function(e,r){t.resolve=function(t){a=!0,e(t)},t.reject=function(t){a=!0,r(t)}}),t},e.createValidAbsoluteUrl=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(t)try{var a;if(r&&"string"==typeof t)if(r.addDefaultProtocol&&t.startsWith("www.")&&(a=t.match(/\./g))&&2<=a.length&&(t="http://"+t),r.tryConvertEncoding)try{t=A(t)}catch(t){}var i=e?new URL(t,e):new URL(t);if(function(t){if(!t)return;switch(t.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return 1;default:return}}(i))return i}catch(t){}return null},e.escapeString=function(t){return t.replace(/([()\\\n\r])/g,t=>"\n"===t?"\\n":"\r"===t?"\\r":"\\"+t)},e.getModificationDate=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new Date;t=[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")];return t.join("")},e.getVerbosityLevel=function(){return i},e.info=function(t){i>=a.INFOS&&console.log("Info: "+t)},e.isArrayBuffer=function(t){return"object"==typeof t&&null!==t&&void 0!==t.byteLength},e.isArrayEqual=function(r,a){if(r.length!==a.length)return!1;for(let t=0,e=r.length;t<e;t++)if(r[t]!==a[t])return!1;return!0},e.isAscii=function(t){return/^[\x00-\x7F]*$/.test(t)},e.objectFromMap=function(t){var e=Object.create(null);for(var[r,a]of t)e[r]=a;return e},e.objectSize=function(t){return Object.keys(t).length},e.setVerbosityLevel=function(t){Number.isInteger(t)&&(i=t)},e.shadow=o,e.string32=function(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,255&t)},e.stringToBytes=m,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}),a=m(r);return e.decode(a)}catch(t){n(`stringToPDFString: "${t}".`)}}var i=[];for(let t=0,e=r.length;t<e;t++){var s=y[r.charCodeAt(t)];i.push(s?String.fromCharCode(s):r.charAt(t))}return i.join("")},e.stringToUTF16BEString=function(r){var a=["þÿ"];for(let t=0,e=r.length;t<e;t++){var i=r.charCodeAt(t);a.push(String.fromCharCode(i>>8&255),String.fromCharCode(255&i))}return a.join("")},e.stringToUTF8String=A,e.unreachable=s,e.utf8StringToString=function(t){return unescape(encodeURIComponent(t))},e.warn=n,globalThis._pdfjsCompatibilityChecked||(globalThis._pdfjsCompatibilityChecked=!0,r(2));e.IDENTITY_MATRIX=[1,0,0,1,0,0],e.FONT_IDENTITY_MATRIX=[.001,0,0,.001,0,0],e.LINE_FACTOR=1.35,e.LINE_DESCENT_FACTOR=.35,e.RenderingIntentFlag={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256},e.AnnotationMode={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},e.AnnotationEditorPrefix="pdfjs_internal_editor_",e.AnnotationEditorType={DISABLE:-1,NONE:0,FREETEXT:3,INK:15},e.AnnotationEditorParamsType={FREETEXT_SIZE:1,FREETEXT_COLOR:2,FREETEXT_OPACITY:3,INK_COLOR:11,INK_THICKNESS:12,INK_OPACITY:13},e.PermissionFlag={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},e.TextRenderingMode={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},e.ImageKind={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},e.AnnotationType={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26},e.AnnotationStateModelType={MARKED:"Marked",REVIEW:"Review"},e.AnnotationMarkedState={MARKED:"Marked",UNMARKED:"Unmarked"},e.AnnotationReviewState={ACCEPTED:"Accepted",REJECTED:"Rejected",CANCELLED:"Cancelled",COMPLETED:"Completed",NONE:"None"},e.AnnotationReplyType={GROUP:"Group",REPLY:"R"},e.AnnotationFlag={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512},e.AnnotationFieldFlag={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864},e.AnnotationBorderStyleType={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},e.AnnotationActionEventType={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"},e.DocumentActionEventType={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"},e.PageActionEventType={O:"PageOpen",C:"PageClose"},e.StreamType={UNKNOWN:"UNKNOWN",FLATE:"FLATE",LZW:"LZW",DCT:"DCT",JPX:"JPX",JBIG:"JBIG",A85:"A85",AHX:"AHX",CCF:"CCF",RLX:"RLX"};e.FontType={UNKNOWN:"UNKNOWN",TYPE1:"TYPE1",TYPE1STANDARD:"TYPE1STANDARD",TYPE1C:"TYPE1C",CIDFONTTYPE0:"CIDFONTTYPE0",CIDFONTTYPE0C:"CIDFONTTYPE0C",TRUETYPE:"TRUETYPE",CIDFONTTYPE2:"CIDFONTTYPE2",TYPE3:"TYPE3",OPENTYPE:"OPENTYPE",TYPE0:"TYPE0",MMTYPE1:"MMTYPE1"};const a={ERRORS:0,WARNINGS:1,INFOS:5};e.VerbosityLevel=a;e.CMapCompressionType={NONE:0,BINARY:1},e.OPS={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91},e.UNSUPPORTED_FEATURES={forms:"forms",javaScript:"javaScript",signatures:"signatures",smask:"smask",shadingPattern:"shadingPattern",errorTilingPattern:"errorTilingPattern",errorExtGState:"errorExtGState",errorXObject:"errorXObject",errorFontLoadType3:"errorFontLoadType3",errorFontState:"errorFontState",errorFontMissing:"errorFontMissing",errorFontTranslate:"errorFontTranslate",errorColorSpace:"errorColorSpace",errorOperatorList:"errorOperatorList",errorFontToUnicode:"errorFontToUnicode",errorFontLoadNative:"errorFontLoadNative",errorFontBuildPath:"errorFontBuildPath",errorFontGetPath:"errorFontGetPath",errorMarkedContent:"errorMarkedContent",errorContentSubStream:"errorContentSubStream"};e.PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let i=a.WARNINGS;function n(t){i>=a.WARNINGS&&console.log("Warning: "+t)}function s(t){throw new Error(t)}function o(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!1}),r}l.prototype=new Error;r=l.constructor=l;function l(t,e){this.constructor===l&&s("Cannot initialize BaseException."),this.message=t,this.name=e}class h extends(e.BaseException=r){constructor(t,e){super(t,"PasswordException"),this.code=e}}e.PasswordException=h;class c extends r{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}}e.UnknownErrorException=c;class d extends r{constructor(t){super(t,"InvalidPDFException")}}e.InvalidPDFException=d;class u extends r{constructor(t){super(t,"MissingPDFException")}}e.MissingPDFException=u;class p extends r{constructor(t,e){super(t,"UnexpectedResponseException"),this.status=e}}e.UnexpectedResponseException=p;class f extends r{constructor(t){super(t,"FormatError")}}e.FormatError=f;class g extends r{constructor(t){super(t,"AbortException")}}function m(e){"string"!=typeof e&&s("Invalid argument for stringToBytes");var r=e.length,a=new Uint8Array(r);for(let t=0;t<r;++t)a[t]=255&e.charCodeAt(t);return a}function v(t){return void 0!==t.length?t.length:void 0!==t.byteLength?t.byteLength:void s("Invalid argument for arrayByteLength")}e.AbortException=g;e.FeatureTest=class{static get isLittleEndian(){return o(this,"isLittleEndian",((t=new Uint8Array(4))[0]=1)===(t=new Uint32Array(t.buffer,0,1))[0]);var t}static get isEvalSupported(){return o(this,"isEvalSupported",function(){try{return new Function(""),!0}catch(t){return!1}}())}static get isOffscreenCanvasSupported(){return o(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}};const b=[...Array(256).keys()].map(t=>t.toString(16).padStart(2,"0"));class _{static makeHexColor(t,e,r){return"#"+b[t]+b[e]+b[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=_.applyTransform(t,e),a=_.applyTransform(t.slice(2,4),e),i=_.applyTransform([t[0],t[3]],e),t=_.applyTransform([t[2],t[1]],e);return[Math.min(r[0],a[0],i[0],t[0]),Math.min(r[1],a[1],i[1],t[1]),Math.max(r[0],a[0],i[0],t[0]),Math.max(r[1],a[1],i[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],a=t[0]*e[1]+t[1]*e[3],i=t[2]*e[0]+t[3]*e[2],t=t[2]*e[1]+t[3]*e[3],e=(r+t)/2,r=Math.sqrt((r+t)**2-4*(r*t-i*a))/2,t=e-r||1;return[Math.sqrt(e+r||1),Math.sqrt(t)]}static normalizeRect(t){var e=t.slice(0);return t[0]>t[2]&&(e[0]=t[2],e[2]=t[0]),t[1]>t[3]&&(e[1]=t[3],e[3]=t[1]),e}static intersect(t,e){var r,a=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]));return i<a||(r=Math.max(Math.min(t[1],t[3]),Math.min(e[1],e[3])),(t=Math.min(Math.max(t[1],t[3]),Math.max(e[1],e[3])))<r)?null:[a,r,i,t]}static bezierBoundingBox(e,r,a,i,s,n,o,l){var h=[],t=[[],[]];let c,d,u,p,f,g,m,v;for(let t=0;t<2;++t)u=0===t?(d=6*e-12*a+6*s,c=-3*e+9*a-9*s+3*o,3*a-3*e):(d=6*r-12*i+6*n,c=-3*r+9*i-9*n+3*l,3*i-3*r),Math.abs(c)<1e-12?Math.abs(d)<1e-12||0<(p=-u/d)&&p<1&&h.push(p):(m=d*d-4*u*c,v=Math.sqrt(m),m<0||(0<(f=(-d+v)/(2*c))&&f<1&&h.push(f),0<(g=(-d-v)/(2*c))&&g<1&&h.push(g)));let b=h.length,_;for(var y=b;b--;)_=1-(p=h[b]),t[0][b]=_*_*_*e+3*_*_*p*a+3*_*p*p*s+p*p*p*o,t[1][b]=_*_*_*r+3*_*_*p*i+3*_*p*p*n+p*p*p*l;return t[0][y]=e,t[1][y]=r,t[0][y+1]=o,t[1][y+1]=l,t[0].length=t[1].length=y+2,[Math.min(...t[0]),Math.min(...t[1]),Math.max(...t[0]),Math.max(...t[1])]}}e.Util=_;const y=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function A(t){return decodeURIComponent(escape(t))}},(t,e,r)=>{"use strict";var a=r(3);!globalThis.btoa&&a.isNodeJS&&(globalThis.btoa=function(t){return Buffer.from(t,"binary").toString("base64")}),!globalThis.atob&&a.isNodeJS&&(globalThis.atob=function(t){return Buffer.from(t,"base64").toString("binary")}),!globalThis.DOMMatrix&&a.isNodeJS&&(globalThis.DOMMatrix=require("canvas").DOMMatrix),!globalThis.ReadableStream&&a.isNodeJS&&(globalThis.ReadableStream=require("web-streams-polyfill/dist/ponyfill.js").ReadableStream),Array.prototype.at||r(4),Uint8Array.prototype.at||r(79),globalThis.structuredClone||r(89)},(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isNodeJS=void 0;var r=!("object"!=typeof process||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type);e.isNodeJS=r},(t,e,r)=>{r(5);r=r(78);t.exports=r("Array","at")},(t,e,r)=>{"use strict";var a=r(6),i=r(44),s=r(68),n=r(66),r=r(73);a({target:"Array",proto:!0},{at:function(t){var e=i(this),r=s(e),t=n(t),t=0<=t?t:r+t;return t<0||r<=t?void 0:e[t]}}),r("at")},(t,e,r)=>{var h=r(7),c=r(8).f,d=r(48),u=r(52),p=r(42),f=r(60),g=r(72);t.exports=function(t,e){var r,a,i,s=t.target,n=t.global,o=t.stat,l=n?h:o?h[s]||p(s,{}):(h[s]||{}).prototype;if(l)for(r in e){if(a=e[r],i=t.dontCallGetSet?(i=c(l,r))&&i.value:l[r],!g(n?r:s+(o?".":"#")+r,t.forced)&&void 0!==i){if(typeof a==typeof i)continue;f(a,i)}(t.sham||i&&i.sham)&&d(a,"sham",!0),u(l,r,a,t)}}},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}()||Function("return this")()},(t,e,r)=>{var a=r(9),i=r(11),s=r(13),n=r(14),o=r(15),l=r(22),h=r(43),c=r(46),d=Object.getOwnPropertyDescriptor;e.f=a?d:function(t,e){if(t=o(t),e=l(e),c)try{return d(t,e)}catch(t){}if(h(t,e))return n(!i(s.f,t,e),t[e])}},(t,e,r)=>{r=r(10);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(12),a=Function.prototype.call;t.exports=r?a.bind(a):function(){return a.apply(a,arguments)}},(t,e,r)=>{r=r(10);t.exports=!r(function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})},(t,e)=>{"use strict";var r={}.propertyIsEnumerable,a=Object.getOwnPropertyDescriptor,i=a&&!r.call({1:2},1);e.f=i?function(t){t=a(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 a=r(16),i=r(20);t.exports=function(t){return a(i(t))}},(t,e,r)=>{var a=r(17),i=r(10),s=r(18),n=Object,o=a("".split);t.exports=i(function(){return!n("z").propertyIsEnumerable(0)})?function(t){return"String"==s(t)?o(t,""):n(t)}:n},(t,e,r)=>{var a=r(18),i=r(19);t.exports=function(t){if("Function"===a(t))return i(t)}},(t,e,r)=>{var r=r(19),a=r({}.toString),i=r("".slice);t.exports=function(t){return i(a(t),8,-1)}},(t,e,r)=>{var r=r(12),a=Function.prototype,i=a.call,a=r&&a.bind.bind(i,i);t.exports=r?a:function(t){return function(){return i.apply(t,arguments)}}},(t,e,r)=>{var a=r(21),i=TypeError;t.exports=function(t){if(a(t))throw i("Can't call method on "+t);return t}},t=>{t.exports=function(t){return null==t}},(t,e,r)=>{var a=r(23),i=r(27);t.exports=function(t){t=a(t,"string");return i(t)?t:t+""}},(t,e,r)=>{var a=r(11),i=r(24),s=r(27),n=r(34),o=r(37),r=r(38),l=TypeError,h=r("toPrimitive");t.exports=function(t,e){if(!i(t)||s(t))return t;var r=n(t,h);if(r){if(r=a(r,t,e=void 0===e?"default":e),!i(r)||s(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 a=r(25),r=r(26),i=r.all;t.exports=r.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:a(t)||t===i}:function(t){return"object"==typeof t?null!==t:a(t)}},(t,e,r)=>{var r=r(26),a=r.all;t.exports=r.IS_HTMLDDA?function(t){return"function"==typeof t||t===a}: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 a=r(28),i=r(25),s=r(29),r=r(30),n=Object;t.exports=r?function(t){return"symbol"==typeof t}:function(t){var e=a("Symbol");return i(e)&&s(e.prototype,n(t))}},(t,e,r)=>{var a=r(7),i=r(25);t.exports=function(t,e){return arguments.length<2?(r=a[t],i(r)?r:void 0):a[t]&&a[t][e];var r}},(t,e,r)=>{r=r(17);t.exports=r({}.isPrototypeOf)},(t,e,r)=>{r=r(31);t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},(t,e,r)=>{var a=r(32),r=r(10);t.exports=!!Object.getOwnPropertySymbols&&!r(function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&a&&a<41})},(t,e,r)=>{var a,i,s=r(7),r=r(33),n=s.process,s=s.Deno,n=n&&n.versions||s&&s.version,s=n&&n.v8;!(i=s?0<(a=s.split("."))[0]&&a[0]<4?1:+(a[0]+a[1]):i)&&r&&(!(a=r.match(/Edge\/(\d+)/))||74<=a[1])&&(a=r.match(/Chrome\/(\d+)/))&&(i=+a[1]),t.exports=i},(t,e,r)=>{r=r(28);t.exports=r("navigator","userAgent")||""},(t,e,r)=>{var a=r(35),i=r(21);t.exports=function(t,e){t=t[e];return i(t)?void 0:a(t)}},(t,e,r)=>{var a=r(25),i=r(36),s=TypeError;t.exports=function(t){if(a(t))return t;throw s(i(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 i=r(11),s=r(25),n=r(24),o=TypeError;t.exports=function(t,e){var r,a;if("string"===e&&s(r=t.toString)&&!n(a=i(r,t)))return a;if(s(r=t.valueOf)&&!n(a=i(r,t)))return a;if("string"!==e&&s(r=t.toString)&&!n(a=i(r,t)))return a;throw o("Can't convert object to primitive value")}},(t,e,r)=>{var a=r(7),i=r(39),s=r(43),n=r(45),o=r(31),l=r(30),h=i("wks"),c=a.Symbol,d=c&&c.for,u=l?c:c&&c.withoutSetter||n;t.exports=function(t){var e;return s(h,t)&&(o||"string"==typeof h[t])||(e="Symbol."+t,o&&s(c,t)?h[t]=c[t]:h[t]=(l&&d?d:u)(e)),h[t]}},(t,e,r)=>{var a=r(40),i=r(41);(t.exports=function(t,e){return i[t]||(i[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.26.0",mode:a?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.26.0/LICENSE",source:"https://github.com/zloirock/core-js"})},t=>{t.exports=!1},(t,e,r)=>{var a=r(7),r=r(42),i="__core-js_shared__",a=a[i]||r(i,{});t.exports=a},(t,e,r)=>{var a=r(7),i=Object.defineProperty;t.exports=function(e,r){try{i(a,e,{value:r,configurable:!0,writable:!0})}catch(t){a[e]=r}return r}},(t,e,r)=>{var a=r(17),i=r(44),s=a({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return s(i(t),e)}},(t,e,r)=>{var a=r(20),i=Object;t.exports=function(t){return i(a(t))}},(t,e,r)=>{var r=r(17),a=0,i=Math.random(),s=r(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+s(++a+i,36)}},(t,e,r)=>{var a=r(9),i=r(10),s=r(47);t.exports=!a&&!i(function(){return 7!=Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a})},(t,e,r)=>{var a=r(7),r=r(24),i=a.document,s=r(i)&&r(i.createElement);t.exports=function(t){return s?i.createElement(t):{}}},(t,e,r)=>{var a=r(9),i=r(49),s=r(14);t.exports=a?function(t,e,r){return i.f(t,e,s(1,r))}:function(t,e,r){return t[e]=r,t}},(t,e,r)=>{var a=r(9),i=r(46),s=r(50),n=r(51),o=r(22),l=TypeError,h=Object.defineProperty,c=Object.getOwnPropertyDescriptor,d="enumerable",u="configurable",p="writable";e.f=a?s?function(t,e,r){var a;return n(t),e=o(e),n(r),"function"==typeof t&&"prototype"===e&&"value"in r&&p in r&&!r[p]&&(a=c(t,e))&&a[p]&&(t[e]=r.value,r={configurable:(u in r?r:a)[u],enumerable:(d in r?r:a)[d],writable:!1}),h(t,e,r)}:h:function(t,e,r){if(n(t),e=o(e),n(r),i)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 a=r(9),r=r(10);t.exports=a&&r(function(){return 42!=Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})},(t,e,r)=>{var a=r(24),i=String,s=TypeError;t.exports=function(t){if(a(t))return t;throw s(i(t)+" is not an object")}},(t,e,r)=>{var n=r(25),o=r(49),l=r(53),h=r(42);t.exports=function(t,e,r,a){var i=(a=a||{}).enumerable,s=void 0!==a.name?a.name:e;if(n(r)&&l(r,s,a),a.global)i?t[e]=r:h(e,r);else{try{a.unsafe?t[e]&&(i=!0):delete t[e]}catch(t){}i?t[e]=r:o.f(t,e,{value:r,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return t}},(t,e,r)=>{var a=r(10),i=r(25),s=r(43),n=r(9),o=r(54).CONFIGURABLE,l=r(55),r=r(56),h=r.enforce,c=r.get,d=Object.defineProperty,u=n&&!a(function(){return 8!==d(function(){},"length",{value:8}).length}),p=String(String).split("String"),r=t.exports=function(t,e,r){"Symbol("===String(e).slice(0,7)&&(e="["+String(e).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!s(t,"name")||o&&t.name!==e)&&(n?d(t,"name",{value:e,configurable:!0}):t.name=e),u&&r&&s(r,"arity")&&t.length!==r.arity&&d(t,"length",{value:r.arity});try{r&&s(r,"constructor")&&r.constructor?n&&d(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}r=h(t);return s(r,"source")||(r.source=p.join("string"==typeof e?e:"")),t};Function.prototype.toString=r(function(){return i(this)&&c(this).source||l(this)},"toString")},(t,e,r)=>{var a=r(9),r=r(43),i=Function.prototype,s=a&&Object.getOwnPropertyDescriptor,r=r(i,"name"),n=r&&"something"===function(){}.name,a=r&&(!a||s(i,"name").configurable);t.exports={EXISTS:r,PROPER:n,CONFIGURABLE:a}},(t,e,r)=>{var a=r(17),i=r(25),r=r(41),s=a(Function.toString);i(r.inspectSource)||(r.inspectSource=function(t){return s(t)}),t.exports=r.inspectSource},(t,e,r)=>{var a,i,s,n,o=r(57),l=r(7),h=r(24),c=r(48),d=r(43),u=r(41),p=r(58),r=r(59),f="Object already initialized",g=l.TypeError,l=l.WeakMap,m=o||u.state?((s=u.state||(u.state=new l)).get=s.get,s.has=s.has,s.set=s.set,a=function(t,e){if(s.has(t))throw g(f);return e.facade=t,s.set(t,e),e},i=function(t){return s.get(t)||{}},function(t){return s.has(t)}):(r[n=p("state")]=!0,a=function(t,e){if(d(t,n))throw g(f);return e.facade=t,c(t,n,e),e},i=function(t){return d(t,n)?t[n]:{}},function(t){return d(t,n)});t.exports={set:a,get:i,has:m,enforce:function(t){return m(t)?i(t):a(t,{})},getterFor:function(e){return function(t){if(h(t)&&(t=i(t)).type===e)return t;throw g("Incompatible receiver, "+e+" required")}}}},(t,e,r)=>{var a=r(7),r=r(25),a=a.WeakMap;t.exports=r(a)&&/native code/.test(String(a))},(t,e,r)=>{var a=r(39),i=r(45),s=a("keys");t.exports=function(t){return s[t]||(s[t]=i(t))}},t=>{t.exports={}},(t,e,r)=>{var l=r(43),h=r(61),c=r(8),d=r(49);t.exports=function(t,e,r){for(var a=h(e),i=d.f,s=c.f,n=0;n<a.length;n++){var o=a[n];l(t,o)||r&&l(r,o)||i(t,o,s(e,o))}}},(t,e,r)=>{var a=r(28),i=r(17),s=r(62),n=r(71),o=r(51),l=i([].concat);t.exports=a("Reflect","ownKeys")||function(t){var e=s.f(o(t)),r=n.f;return r?l(e,r(t)):e}},(t,e,r)=>{var a=r(63),i=r(70).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return a(t,i)}},(t,e,r)=>{var a=r(17),n=r(43),o=r(15),l=r(64).indexOf,h=r(59),c=a([].push);t.exports=function(t,e){var r,a=o(t),i=0,s=[];for(r in a)!n(h,r)&&n(a,r)&&c(s,r);for(;e.length>i;)!n(a,r=e[i++])||~l(s,r)||c(s,r);return s}},(t,e,r)=>{function a(o){return function(t,e,r){var a,i=l(t),s=c(i),n=h(r,s);if(o&&e!=e){for(;n<s;)if((a=i[n++])!=a)return!0}else for(;n<s;n++)if((o||n in i)&&i[n]===e)return o||n||0;return!o&&-1}}var l=r(15),h=r(65),c=r(68);t.exports={includes:a(!0),indexOf:a(!1)}},(t,e,r)=>{var a=r(66),i=Math.max,s=Math.min;t.exports=function(t,e){t=a(t);return t<0?i(t+e,0):s(t,e)}},(t,e,r)=>{var a=r(67);t.exports=function(t){t=+t;return t!=t||0==t?0:a(t)}},t=>{var e=Math.ceil,r=Math.floor;t.exports=Math.trunc||function(t){t=+t;return(0<t?r:e)(t)}},(t,e,r)=>{var a=r(69);t.exports=function(t){return a(t.length)}},(t,e,r)=>{var a=r(66),i=Math.min;t.exports=function(t){return 0<t?i(a(t),9007199254740991):0}},t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},(t,e)=>{e.f=Object.getOwnPropertySymbols},(t,e,r)=>{function a(t,e){return(t=l[o(t)])==c||t!=h&&(s(e)?i(e):!!e)}var i=r(10),s=r(25),n=/#|\.prototype\./,o=a.normalize=function(t){return String(t).replace(n,".").toLowerCase()},l=a.data={},h=a.NATIVE="N",c=a.POLYFILL="P";t.exports=a},(t,e,r)=>{var a=r(38),i=r(74),r=r(49).f,s=a("unscopables"),n=Array.prototype;null==n[s]&&r(n,s,{configurable:!0,value:i(null)}),t.exports=function(t){n[s][t]=!0}},(t,e,r)=>{function a(){}function i(t){t.write(g("")),t.close();var e=t.parentWindow.Object;return t=null,e}var s,n=r(51),o=r(75),l=r(70),h=r(59),c=r(77),d=r(47),r=r(58),u="prototype",p="script",f=r("IE_PROTO"),g=function(t){return"<"+p+">"+t+"</"+p+">"},m=function(){try{s=new ActiveXObject("htmlfile")}catch(t){}m="undefined"==typeof document||document.domain&&s?i(s):(t=d("iframe"),e="java"+p+":",t.style.display="none",c.appendChild(t),t.src=String(e),(e=t.contentWindow.document).open(),e.write(g("document.F=Object")),e.close(),e.F);for(var t,e,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?(a[u]=n(t),r=new a,a[u]=null,r[f]=t):r=m(),void 0===e?r:o.f(r,e)}},(t,e,r)=>{var a=r(9),i=r(50),o=r(49),l=r(51),h=r(15),c=r(76);e.f=a&&!i?Object.defineProperties:function(t,e){l(t);for(var r,a=h(e),i=c(e),s=i.length,n=0;n<s;)o.f(t,r=i[n++],a[r]);return t}},(t,e,r)=>{var a=r(63),i=r(70);t.exports=Object.keys||function(t){return a(t,i)}},(t,e,r)=>{r=r(28);t.exports=r("document","documentElement")},(t,e,r)=>{var a=r(7),i=r(17);t.exports=function(t,e){return i(a[t].prototype[e])}},(t,e,r)=>{r(80)},(t,e,r)=>{"use strict";var a=r(81),i=r(68),s=r(66),n=a.aTypedArray;(0,a.exportTypedArrayMethod)("at",function(t){var e=n(this),r=i(e),t=s(t),t=0<=t?t:r+t;return t<0||r<=t?void 0:e[t]})},(t,e,r)=>{"use strict";function a(t){var e,t=y(t);if(u(t))return(e=E(t))&&p(e,R)?e[R]:a(t)}function i(t){return!!u(t)&&(t=f(t),p(D,t)||p(I,t))}var s,n,o,l=r(82),h=r(9),c=r(7),d=r(25),u=r(24),p=r(43),f=r(83),g=r(36),m=r(48),v=r(52),b=r(49).f,_=r(29),y=r(85),A=r(87),S=r(38),w=r(45),r=r(56),x=r.enforce,E=r.get,r=c.Int8Array,C=r&&r.prototype,k=c.Uint8ClampedArray,k=k&&k.prototype,P=r&&y(r),T=C&&y(C),r=Object.prototype,M=c.TypeError,S=S("toStringTag"),F=w("TYPED_ARRAY_TAG"),R="TypedArrayConstructor",O=l&&!!A&&"Opera"!==f(c.opera),w=!1,D={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},I={BigInt64Array:8,BigUint64Array:8};for(s in D)(o=(n=c[s])&&n.prototype)?x(o)[R]=n:O=!1;for(s in I)(o=(n=c[s])&&n.prototype)&&(x(o)[R]=n);if((!O||!d(P)||P===Function.prototype)&&(P=function(){throw M("Incorrect invocation")},O))for(s in D)c[s]&&A(c[s],P);if((!O||!T||T===r)&&(T=P.prototype,O))for(s in D)c[s]&&A(c[s].prototype,T);if(O&&y(k)!==T&&A(k,T),h&&!p(T,S))for(s in w=!0,b(T,S,{get:function(){return u(this)?this[F]:void 0}}),D)c[s]&&m(c[s],F,s);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:O,TYPED_ARRAY_TAG:w&&F,aTypedArray:function(t){if(i(t))return t;throw M("Target is not a typed array")},aTypedArrayConstructor:function(t){if(!d(t)||A&&!_(P,t))throw M(g(t)+" is not a typed array constructor");return t},exportTypedArrayMethod:function(e,r,t,a){if(h){if(t)for(var i in D){i=c[i];if(i&&p(i.prototype,e))try{delete i.prototype[e]}catch(t){try{i.prototype[e]=r}catch(t){}}}T[e]&&!t||v(T,e,!t&&O&&C[e]||r,a)}},exportTypedArrayStaticMethod:function(t,e,r){var a,i;if(h){if(A){if(r)for(a in D)if((i=c[a])&&p(i,t))try{delete i[t]}catch(t){}if(P[t]&&!r)return;try{return v(P,t,!r&&O&&P[t]||e)}catch(t){}}for(a in D)!(i=c[a])||i[t]&&!r||v(i,t,e)}},getTypedArrayConstructor:a,isView:function(t){return!!u(t)&&("DataView"===(t=f(t))||p(D,t)||p(I,t))},isTypedArray:i,TypedArray:P,TypedArrayPrototype:T}},t=>{t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},(t,e,r)=>{var a=r(84),i=r(25),s=r(18),n=r(38)("toStringTag"),o=Object,l="Arguments"==s(function(){return arguments}());t.exports=a?s:function(t){var e;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(e=function(t,e){try{return t[e]}catch(t){}}(t=o(t),n))?e:l?s(t):"Object"==(e=s(t))&&i(t.callee)?"Arguments":e}},(t,e,r)=>{var a={};a[r(38)("toStringTag")]="z",t.exports="[object z]"===String(a)},(t,e,r)=>{var a=r(43),i=r(25),s=r(44),n=r(58),r=r(86),o=n("IE_PROTO"),l=Object,h=l.prototype;t.exports=r?l.getPrototypeOf:function(t){var e,t=s(t);return a(t,o)?t[o]:(e=t.constructor,i(e)&&t instanceof e?e.prototype:t instanceof l?h:null)}},(t,e,r)=>{r=r(10);t.exports=!r(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})},(t,e,r)=>{var i=r(17),s=r(51),n=r(88);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var r,a=!1,t={};try{(r=i(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(t,[]),a=t instanceof Array}catch(t){}return function(t,e){return s(t),n(e),a?r(t,e):t.__proto__=e,t}}():void 0)},(t,e,r)=>{var a=r(25),i=String,s=TypeError;t.exports=function(t){if("object"==typeof t||a(t))return t;throw s("Can't set "+i(t)+" as a prototype")}},(t,e,r)=>{r(90),r(97),r(99),r(121),r(123);r=r(132);t.exports=r.structuredClone},(t,e,r)=>{"use strict";var a=r(15),i=r(73),s=r(91),n=r(56),o=r(49).f,l=r(92),h=r(96),c=r(40),r=r(9),d="Array Iterator",u=n.set,p=n.getterFor(d),n=(t.exports=l(Array,"Array",function(t,e){u(this,{type:d,target:a(t),index:0,kind:e})},function(){var t=p(this),e=t.target,r=t.kind,a=t.index++;return!e||a>=e.length?(t.target=void 0,h(void 0,!0)):h("keys"==r?a:"values"==r?e[a]:[a,e[a]],!1)},"values"),s.Arguments=s.Array);if(i("keys"),i("values"),i("entries"),!c&&r&&"values"!==n.name)try{o(n,"name",{value:"values"})}catch(t){}},t=>{t.exports={}},(t,e,r)=>{"use strict";function g(){return this}var m=r(6),v=r(11),b=r(40),a=r(54),_=r(25),y=r(93),A=r(85),S=r(87),w=r(95),x=r(48),E=r(52),i=r(38),C=r(91),r=r(94),k=a.PROPER,P=a.CONFIGURABLE,T=r.IteratorPrototype,M=r.BUGGY_SAFARI_ITERATORS,F=i("iterator"),R="values",O="entries";t.exports=function(t,e,r,a,i,s,n){y(r,e,a);function o(t){if(t===i&&p)return p;if(!M&&t in d)return d[t];switch(t){case"keys":case R:case O:return function(){return new r(this,t)}}return function(){return new r(this)}}var l,h,a=e+" Iterator",c=!1,d=t.prototype,u=d[F]||d["@@iterator"]||i&&d[i],p=!M&&u||o(i),f="Array"==e&&d.entries||u;if(f&&(f=A(f.call(new t)))!==Object.prototype&&f.next&&(b||A(f)===T||(S?S(f,T):_(f[F])||E(f,F,g)),w(f,a,!0,!0),b)&&(C[a]=g),k&&i==R&&u&&u.name!==R&&(!b&&P?x(d,"name",R):(c=!0,p=function(){return v(u,this)})),i)if(l={values:o(R),keys:s?p:o("keys"),entries:o(O)},n)for(h in l)!M&&!c&&h in d||E(d,h,l[h]);else m({target:e,proto:!0,forced:M||c},l);return b&&!n||d[F]===p||E(d,F,p,{name:i}),C[e]=p,l}},(t,e,r)=>{"use strict";function i(){return this}var s=r(94).IteratorPrototype,n=r(74),o=r(14),l=r(95),h=r(91);t.exports=function(t,e,r,a){e+=" Iterator";return t.prototype=n(s,{next:o(+!a,r)}),l(t,e,!1,!0),h[e]=i,t}},(t,e,r)=>{"use strict";var a,i,s=r(10),n=r(25),o=r(24),l=r(74),h=r(85),c=r(52),d=r(38),r=r(40),u=d("iterator"),d=!1;[].keys&&("next"in(i=[].keys())?(h=h(h(i)))!==Object.prototype&&(a=h):d=!0),!o(a)||s(function(){var t={};return a[u].call(t)!==t})?a={}:r&&(a=l(a)),n(a[u])||c(a,u,function(){return this}),t.exports={IteratorPrototype:a,BUGGY_SAFARI_ITERATORS:d}},(t,e,r)=>{var a=r(49).f,i=r(43),s=r(38)("toStringTag");t.exports=function(t,e,r){(t=t&&!r?t.prototype:t)&&!i(t,s)&&a(t,s,{configurable:!0,value:e})}},t=>{t.exports=function(t,e){return{value:t,done:e}}},(t,e,r)=>{var a=r(84),i=r(52),r=r(98);a||i(Object.prototype,"toString",r,{unsafe:!0})},(t,e,r)=>{"use strict";var a=r(84),i=r(83);t.exports=a?{}.toString:function(){return"[object "+i(this)+"]"}},(t,e,r)=>{r(100)},(t,e,r)=>{"use strict";r(101)("Map",function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},r(118))},(t,e,r)=>{"use strict";var m=r(6),v=r(7),b=r(17),_=r(72),y=r(52),A=r(102),S=r(109),w=r(115),x=r(25),E=r(21),C=r(24),k=r(10),P=r(116),T=r(95),M=r(117);t.exports=function(t,e,r){function a(t){var r=b(p[t]);y(p,t,"add"==t?function(t){return r(this,0===t?0:t),this}:"delete"==t?function(t){return!(c&&!C(t))&&r(this,0===t?0:t)}:"get"==t?function(t){return c&&!C(t)?void 0:r(this,0===t?0:t)}:"has"==t?function(t){return!(c&&!C(t))&&r(this,0===t?0:t)}:function(t,e){return r(this,0===t?0:t,e),this})}var i,s,n,o,l,h=-1!==t.indexOf("Map"),c=-1!==t.indexOf("Weak"),d=h?"set":"add",u=v[t],p=u&&u.prototype,f=u,g={};return _(t,!x(u)||!(c||p.forEach&&!k(function(){(new u).entries().next()})))?(f=r.getConstructor(e,t,h,d),A.enable()):_(t,!0)&&(s=(i=new f)[d](c?{}:-0,1)!=i,n=k(function(){i.has(1)}),o=P(function(t){new u(t)}),l=!c&&k(function(){for(var t=new u,e=5;e--;)t[d](e,e);return!t.has(-0)}),o||(((f=e(function(t,e){w(t,p);t=M(new u,t,f);return E(e)||S(e,t[d],{that:t,AS_ENTRIES:h}),t})).prototype=p).constructor=f),(n||l)&&(a("delete"),a("has"),h)&&a("get"),(l||s)&&a(d),c)&&p.clear&&delete p.clear,m({global:!0,constructor:!0,forced:(g[t]=f)!=u},g),T(f,t),c||r.setStrong(f,t,h),f}},(t,e,r)=>{function a(t){h(t,m,{value:{objectID:"O"+v++,weakData:{}}})}var n=r(6),o=r(17),i=r(59),s=r(24),l=r(43),h=r(49).f,c=r(62),d=r(103),u=r(106),p=r(45),f=r(108),g=!1,m=p("meta"),v=0,b=t.exports={enable:function(){b.enable=function(){},g=!0;var i=c.f,s=o([].splice),t={};t[m]=1,i(t).length&&(c.f=function(t){for(var e=i(t),r=0,a=e.length;r<a;r++)if(e[r]===m){s(e,r,1);break}return e},n({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:d.f}))},fastKey:function(t,e){if(!s(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!l(t,m)){if(!u(t))return"F";if(!e)return"E";a(t)}return t[m].objectID},getWeakData:function(t,e){if(!l(t,m)){if(!u(t))return!0;if(!e)return!1;a(t)}return t[m].weakData},onFreeze:function(t){return f&&g&&u(t)&&!l(t,m)&&a(t),t}};i[m]=!0},(t,e,r)=>{var a=r(18),i=r(15),s=r(62).f,n=r(104),o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){if(!o||"Window"!=a(t))return s(i(t));try{return s(t)}catch(t){return n(o)}}},(t,e,r)=>{var l=r(65),h=r(68),c=r(105),d=Array,u=Math.max;t.exports=function(t,e,r){for(var a=h(t),i=l(e,a),s=l(void 0===r?a:r,a),n=d(u(s-i,0)),o=0;i<s;i++,o++)c(n,o,t[i]);return n.length=o,n}},(t,e,r)=>{"use strict";var a=r(22),i=r(49),s=r(14);t.exports=function(t,e,r){e=a(e);e in t?i.f(t,e,s(0,r)):t[e]=r}},(t,e,r)=>{var a=r(10),i=r(24),s=r(18),n=r(107),o=Object.isExtensible,r=a(function(){o(1)});t.exports=r||n?function(t){return!(!i(t)||n&&"ArrayBuffer"==s(t))&&(!o||o(t))}:o},(t,e,r)=>{r=r(10);t.exports=r(function(){var t;"function"==typeof ArrayBuffer&&(t=new ArrayBuffer(8),Object.isExtensible(t))&&Object.defineProperty(t,"a",{value:8})})},(t,e,r)=>{r=r(10);t.exports=!r(function(){return Object.isExtensible(Object.preventExtensions({}))})},(t,e,r)=>{function v(t,e){this.stopped=t,this.result=e}var b=r(110),_=r(11),y=r(51),A=r(36),S=r(111),w=r(68),x=r(29),E=r(112),C=r(113),k=r(114),P=TypeError,T=v.prototype;t.exports=function(t,e,r){function a(t){return s&&k(s,"normal",t),new v(!0,t)}function i(t){return u?(y(t),g?m(t[0],t[1],a):m(t[0],t[1])):g?m(t,a):m(t)}var s,n,o,l,h,c,d=r&&r.that,u=!(!r||!r.AS_ENTRIES),p=!(!r||!r.IS_RECORD),f=!(!r||!r.IS_ITERATOR),g=!(!r||!r.INTERRUPTED),m=b(e,d);if(p)s=t.iterator;else if(f)s=t;else{if(!(r=C(t)))throw P(A(t)+" is not iterable");if(S(r)){for(n=0,o=w(t);n<o;n++)if((l=i(t[n]))&&x(T,l))return l;return new v(!1)}s=E(t,r)}for(h=(p?t:s).next;!(c=_(h,s)).done;){try{l=i(c.value)}catch(t){k(s,"throw",t)}if("object"==typeof l&&l&&x(T,l))return l}return new v(!1)}},(t,e,r)=>{var a=r(17),i=r(35),s=r(12),n=a(a.bind);t.exports=function(t,e){return i(t),void 0===e?t:s?n(t,e):function(){return t.apply(e,arguments)}}},(t,e,r)=>{var a=r(38),i=r(91),s=a("iterator"),n=Array.prototype;t.exports=function(t){return void 0!==t&&(i.Array===t||n[s]===t)}},(t,e,r)=>{var a=r(11),i=r(35),s=r(51),n=r(36),o=r(113),l=TypeError;t.exports=function(t,e){var r=arguments.length<2?o(t):e;if(i(r))return s(a(r,t));throw l(n(t)+" is not iterable")}},(t,e,r)=>{var a=r(83),i=r(34),s=r(21),n=r(91),o=r(38)("iterator");t.exports=function(t){if(!s(t))return i(t,o)||i(t,"@@iterator")||n[a(t)]}},(t,e,r)=>{var s=r(11),n=r(51),o=r(34);t.exports=function(t,e,r){var a,i;n(t);try{if(!(a=o(t,"return"))){if("throw"===e)throw r;return r}a=s(a,t)}catch(t){i=!0,a=t}if("throw"===e)throw r;if(i)throw a;return n(a),r}},(t,e,r)=>{var a=r(29),i=TypeError;t.exports=function(t,e){if(a(e,t))return t;throw i("Incorrect invocation")}},(t,e,r)=>{var i=r(38)("iterator"),s=!1;try{var a=0,n={next:function(){return{done:!!a++}},return:function(){s=!0}};n[i]=function(){return this},Array.from(n,function(){throw 2})}catch(t){}t.exports=function(t,e){if(!e&&!s)return!1;var r=!1;try{var a={};a[i]=function(){return{next:function(){return{done:r=!0}}}},t(a)}catch(t){}return r}},(t,e,r)=>{var a=r(25),i=r(24),s=r(87);t.exports=function(t,e,r){return s&&a(e=e.constructor)&&e!==r&&i(e=e.prototype)&&e!==r.prototype&&s(t,e),t}},(t,e,r)=>{"use strict";var h=r(49).f,c=r(74),d=r(119),u=r(110),p=r(115),f=r(21),g=r(109),n=r(92),o=r(96),l=r(120),m=r(9),v=r(102).fastKey,r=r(56),b=r.set,_=r.getterFor;t.exports={getConstructor:function(t,r,a,i){function s(t,e,r){var a,i=l(t),s=n(t,e);return s?s.value=r:(i.last=s={index:a=v(e,!0),key:e,value:r,previous:e=i.last,next:void 0,removed:!1},i.first||(i.first=s),e&&(e.next=s),m?i.size++:t.size++,"F"!==a&&(i.index[a]=s)),t}function n(t,e){var r,t=l(t),a=v(e);if("F"!==a)return t.index[a];for(r=t.first;r;r=r.next)if(r.key==e)return r}var t=t(function(t,e){p(t,o),b(t,{type:r,index:c(null),first:void 0,last:void 0,size:0}),m||(t.size=0),f(e)||g(e,t[i],{that:t,AS_ENTRIES:a})}),o=t.prototype,l=_(r);return d(o,{clear:function(){for(var t=l(this),e=t.index,r=t.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete e[r.index],r=r.next;t.first=t.last=void 0,m?t.size=0:this.size=0},delete:function(t){var e,r,a=l(this),t=n(this,t);return t&&(e=t.next,r=t.previous,delete a.index[t.index],t.removed=!0,r&&(r.next=e),e&&(e.previous=r),a.first==t&&(a.first=e),a.last==t&&(a.last=r),m?a.size--:this.size--),!!t},forEach:function(t){for(var e,r=l(this),a=u(t,1<arguments.length?arguments[1]:void 0);e=e?e.next:r.first;)for(a(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!n(this,t)}}),d(o,a?{get:function(t){t=n(this,t);return t&&t.value},set:function(t,e){return s(this,0===t?0:t,e)}}:{add:function(t){return s(this,t=0===t?0:t,t)}}),m&&h(o,"size",{get:function(){return l(this).size}}),t},setStrong:function(t,e,r){var a=e+" Iterator",i=_(e),s=_(a);n(t,e,function(t,e){b(this,{type:a,target:t,state:i(t),kind:e,last:void 0})},function(){for(var t=s(this),e=t.kind,r=t.last;r&&r.removed;)r=r.previous;return t.target&&(t.last=r=r?r.next:t.state.first)?o("keys"==e?r.key:"values"==e?r.value:[r.key,r.value],!1):(t.target=void 0,o(void 0,!0))},r?"entries":"values",!r,!0),l(e)}}},(t,e,r)=>{var i=r(52);t.exports=function(t,e,r){for(var a in e)i(t,a,e[a],r);return t}},(t,e,r)=>{"use strict";var a=r(28),i=r(49),s=r(38),n=r(9),o=s("species");t.exports=function(t){var t=a(t),e=i.f;n&&t&&!t[o]&&e(t,o,{configurable:!0,get:function(){return this}})}},(t,e,r)=>{r(122)},(t,e,r)=>{"use strict";r(101)("Set",function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},r(118))},(d,u,t)=>{function e(a){return!o(function(){var t=new v.Set([7]),e=a(t),r=a(x(7));return e==t||!e.has(7)||"object"!=typeof r||7!=r})&&a}function r(r,a){return!o(function(){var t=new a,e=r({a:t,b:t});return!(e&&e.a===e.b&&e.a instanceof a&&e.a.stack===t.stack)})}function f(t){throw new P("Uncloneable type: "+t,O)}function g(t,e){throw new P((e||"Cloning")+" of "+t+" cannot be properly polyfilled in this engine",O)}function m(e,r){if(W(e)&&f("Symbol"),!y(e))return e;if(r){if(F(r,e))return st(r,e)}else r=new M;var t,a,i,s,n,o,l,h,c,d,u=A(e),p=!1;switch(u){case"Array":i=[],p=!0;break;case"Object":i={},p=!0;break;case"Map":i=new M,p=!0;break;case"Set":i=new T,p=!0;break;case"RegExp":i=new RegExp(e.source,z(e));break;case"Error":switch(a=e.name){case"AggregateError":i=b("AggregateError")([]);break;case"EvalError":i=J();break;case"RangeError":i=$();break;case"ReferenceError":i=Q();break;case"SyntaxError":i=Z();break;case"TypeError":i=k();break;case"URIError":i=tt();break;case"CompileError":i=rt();break;case"LinkError":i=at();break;case"RuntimeError":i=it();break;default:i=C()}p=!0;break;case"DOMException":i=new P(e.message,e.name),p=!0;break;case"DataView":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":t=v[u],y(t)||g(u),i=new t(m(e.buffer,r),e.byteOffset,"DataView"===u?e.byteLength:e.length);break;case"DOMQuad":try{i=new DOMQuad(m(e.p1,r),m(e.p2,r),m(e.p3,r),m(e.p4,r))}catch(t){L?i=L(e):g(u)}break;case"FileList":if(s=function(){var e;try{e=new v.DataTransfer}catch(t){try{e=new v.ClipboardEvent("").clipboardData}catch(t){}}return e&&e.items&&e.files?e:null}()){for(n=0,o=w(e);n<o;n++)s.items.add(m(e[n],r));i=s.files}else L?i=L(e):g(u);break;case"ImageData":try{i=new ImageData(m(e.data,r),e.width,e.height,{colorSpace:e.colorSpace})}catch(t){L?i=L(e):g(u)}break;default:if(L)i=L(e);else switch(u){case"BigInt":i=x(e.valueOf());break;case"Boolean":i=x(ht(e));break;case"Number":i=x(ct(e));break;case"String":i=x(dt(e));break;case"Date":i=new E(ut(e));break;case"ArrayBuffer":(t=v.DataView)||"function"==typeof e.slice||g(u);try{if("function"==typeof e.slice)i=e.slice(0);else for(o=e.byteLength,i=new ArrayBuffer(o),c=new t(e),d=new t(i),n=0;n<o;n++)d.setUint8(n,c.getUint8(n))}catch(t){throw new P("ArrayBuffer is detached",O)}break;case"SharedArrayBuffer":i=e;break;case"Blob":try{i=e.slice(0,e.size,e.type)}catch(t){g(u)}break;case"DOMPoint":case"DOMPointReadOnly":t=v[u];try{i=t.fromPoint?t.fromPoint(e):new t(e.x,e.y,e.z,e.w)}catch(t){g(u)}break;case"DOMRect":case"DOMRectReadOnly":t=v[u];try{i=t.fromRect?t.fromRect(e):new t(e.x,e.y,e.width,e.height)}catch(t){g(u)}break;case"DOMMatrix":case"DOMMatrixReadOnly":t=v[u];try{i=t.fromMatrix?t.fromMatrix(e):new t(e)}catch(t){g(u)}break;case"AudioData":case"VideoFrame":_(e.clone)||g(u);try{i=e.clone()}catch(t){f(u)}break;case"File":try{i=new File([e],e.name,e)}catch(t){g(u)}break;case"CropTarget":case"CryptoKey":case"FileSystemDirectoryHandle":case"FileSystemFileHandle":case"FileSystemHandle":case"GPUCompilationInfo":case"GPUCompilationMessage":case"ImageBitmap":case"RTCCertificate":case"WebAssembly.Module":g(u);default:f(u)}}if(R(r,e,i),p)switch(u){case"Array":case"Object":for(l=ot(e),n=0,o=w(l);n<o;n++)h=l[n],q(i,h,m(e[h],r));break;case"Map":e.forEach(function(t,e){R(i,m(e,r),m(t,r))});break;case"Set":e.forEach(function(t){nt(i,m(t,r))});break;case"Error":S(i,"message",m(e.message,r)),G(e,"cause")&&S(i,"cause",m(e.cause,r)),"AggregateError"==a&&(i.errors=m(e.errors,r));case"DOMException":V&&S(i,"stack",m(e.stack,r))}return i}var a,i=t(40),s=t(6),v=t(7),b=t(28),n=t(17),o=t(10),l=t(45),_=t(25),j=t(124),U=t(21),y=t(24),W=t(27),B=t(109),p=t(51),A=t(83),G=t(43),q=t(105),S=t(48),w=t(68),H=t(125),z=t(126),V=t(128),h=t(32),X=t(129),Y=t(130),K=t(131),x=v.Object,E=v.Date,C=v.Error,J=v.EvalError,$=v.RangeError,Q=v.ReferenceError,Z=v.SyntaxError,k=v.TypeError,tt=v.URIError,et=v.PerformanceMark,t=v.WebAssembly,rt=t&&t.CompileError||C,at=t&&t.LinkError||C,it=t&&t.RuntimeError||C,P=b("DOMException"),T=b("Set"),M=b("Map"),t=M.prototype,F=n(t.has),st=n(t.get),R=n(t.set),nt=n(T.prototype.add),ot=b("Object","keys"),lt=n([].push),ht=n((!0).valueOf),ct=n(1..valueOf),dt=n("".valueOf),ut=n(E.prototype.getTime),c=l("structuredClone"),O="DataCloneError",D="Transferring",I=v.structuredClone,t=i||!r(I,C)||!r(I,P)||(a=I,!!o(function(){var t=a(new v.AggregateError([1],c,{cause:3}));return"AggregateError"!=t.name||1!=t.errors[0]||t.message!=c||3!=t.cause})),n=!I&&e(function(t){return new et(c,{detail:t}).detail}),L=e(I)||n,N=I&&!o(function(){var t,e;return!(Y&&92<h||K&&94<h||X&&97<h)&&(t=new ArrayBuffer(8),e=I(t,{transfer:[t]}),0!=t.byteLength||8!=e.byteLength)});s({global:!0,enumerable:!0,sham:!N,forced:t},{structuredClone:function(t){var e=1<H(arguments.length,1)&&!U(arguments[1])?p(arguments[1]):void 0,e=e?e.transfer:void 0;if(void 0!==e){var r=new M,a=r;if(!y(e))throw k("Transfer option cannot be converted to a sequence");var i,s,n,o,l,h,c=[],d=(B(e,function(t){lt(c,p(t))}),0),u=w(c);if(N)for(o=I(c,{transfer:c});d<u;)R(a,c[d],o[d++]);else for(;d<u;){if(i=c[d++],F(a,i))throw new P("Duplicate transferable",O);switch(s=A(i)){case"ImageBitmap":n=v.OffscreenCanvas,j(n)||g(s,D);try{(h=new n(i.width,i.height)).getContext("bitmaprenderer").transferFromImageBitmap(i),l=h.transferToImageBitmap()}catch(t){}break;case"AudioData":case"VideoFrame":_(i.clone)&&_(i.close)||g(s,D);try{l=i.clone(),i.close()}catch(t){}break;case"ArrayBuffer":case"MediaSourceHandle":case"MessagePort":case"OffscreenCanvas":case"ReadableStream":case"TransformStream":case"WritableStream":g(s,D)}if(void 0===l)throw new P("This object cannot be transferred: "+s,O);R(a,i,l)}}return m(t,r)}})},(t,e,r)=>{function a(){}function i(t){if(!l(t))return!1;try{return p(a,u,t),!0}catch(t){return!1}}function s(t){if(!l(t))return!1;switch(h(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return m||!!g(f,d(t))}catch(t){return!0}}var n=r(17),o=r(10),l=r(25),h=r(83),c=r(28),d=r(55),u=[],p=c("Reflect","construct"),f=/^\s*(?:class|function)\b/,g=n(f.exec),m=!f.exec(a);s.sham=!0,t.exports=!p||o(function(){var t;return i(i.call)||!i(Object)||!i(function(){t=!0})||t})?s:i},t=>{var r=TypeError;t.exports=function(t,e){if(t<e)throw r("Not enough arguments");return t}},(t,e,r)=>{var a=r(11),i=r(43),s=r(29),n=r(127),o=RegExp.prototype;t.exports=function(t){var e=t.flags;return void 0!==e||"flags"in o||i(t,"flags")||!s(o,t)?e:a(n,t)}},(t,e,r)=>{"use strict";var a=r(51);t.exports=function(){var t=a(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 a=r(10),i=r(14);t.exports=!a(function(){var t=Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",i(1,7)),7!==t.stack)})},(t,e,r)=>{var a=r(130),r=r(131);t.exports=!a&&!r&&"object"==typeof window&&"object"==typeof document},t=>{t.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},(t,e,r)=>{var a=r(18),r=r(7);t.exports="process"==a(r.process)},(t,e,r)=>{r=r(7);t.exports=r},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.build=exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0,exports.getDocument=getDocument,exports.setPDFNetworkStreamFactory=setPDFNetworkStreamFactory,exports.version=void 0;var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(134),_display_utils=__w_pdfjs_require__(137),_font_loader=__w_pdfjs_require__(140),_canvas=__w_pdfjs_require__(141),_worker_options=__w_pdfjs_require__(144),_is_node=__w_pdfjs_require__(3),_message_handler=__w_pdfjs_require__(145),_metadata=__w_pdfjs_require__(146),_optional_content_config=__w_pdfjs_require__(147),_transport_stream=__w_pdfjs_require__(148),_xfa_text=__w_pdfjs_require__(149);function _classPrivateMethodInitSpec(t,e){_checkPrivateRedeclaration(t,e),e.add(t)}function _classPrivateMethodGet(t,e,r){if(e.has(t))return r;throw new TypeError("attempted to get private field on non-instance")}function _classPrivateFieldSet(t,e,r){return _classApplyDescriptorSet(t,_classExtractFieldDescriptor(t,e,"set"),r),r}function _classPrivateFieldInitSpec(t,e,r){_checkPrivateRedeclaration(t,e),e.set(t,r)}function _checkPrivateRedeclaration(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classPrivateFieldGet(t,e){return _classApplyDescriptorGet(t,_classExtractFieldDescriptor(t,e,"get"))}function _classExtractFieldDescriptor(t,e,r){if(e.has(t))return e.get(t);throw new TypeError("attempted to "+r+" private field on non-instance")}function _classStaticPrivateFieldSpecSet(t,e,r,a){_classCheckPrivateStaticAccess(t,e),_classCheckPrivateStaticFieldDescriptor(r,"set"),_classApplyDescriptorSet(t,r,a)}function _classApplyDescriptorSet(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}function _classStaticPrivateFieldSpecGet(t,e,r){return _classCheckPrivateStaticAccess(t,e),_classCheckPrivateStaticFieldDescriptor(r,"get"),_classApplyDescriptorGet(t,r)}function _classCheckPrivateStaticFieldDescriptor(t,e){if(void 0===t)throw new TypeError("attempted to "+e+" private static field before its declaration")}function _classCheckPrivateStaticAccess(t,e){if(t!==e)throw new TypeError("Private static access of wrong provenance")}function _classApplyDescriptorGet(t,e){return e.get?e.get.call(t):e.value}const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100;let DefaultCanvasFactory=_display_utils.DOMCanvasFactory,DefaultCMapReaderFactory=(exports.DefaultCanvasFactory=DefaultCanvasFactory,_display_utils.DOMCMapReaderFactory),DefaultStandardFontDataFactory=(exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory,_display_utils.DOMStandardFontDataFactory);if(exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory,_is_node.isNodeJS){const{NodeCanvasFactory,NodeCMapReaderFactory,NodeStandardFontDataFactory}=__w_pdfjs_require__(150);exports.DefaultCanvasFactory=DefaultCanvasFactory=NodeCanvasFactory,exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory=NodeCMapReaderFactory,exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory=NodeStandardFontDataFactory}let createPDFNetworkStream;function setPDFNetworkStreamFactory(t){createPDFNetworkStream=t}function getDocument(t){const r=new PDFDocumentLoadingTask;let e;if("string"==typeof t||t instanceof URL)e={url:t};else if((0,_util.isArrayBuffer)(t))e={data:t};else if(t instanceof PDFDataRangeTransport)e={range:t};else{if("object"!=typeof t)throw new Error("Invalid parameter in getDocument, need either string, URL, TypedArray, or parameter object.");if(!t.url&&!t.data&&!t.range)throw new Error("Invalid parameter object: need either .data, .range or .url");e=t}const a=Object.create(null);let i=null,s=null;for(const l in e){var n=e[l];switch(l){case"url":if("undefined"!=typeof window)try{a[l]=new URL(n,window.location).href;continue}catch(t){(0,_util.warn)(`Cannot create valid URL: "${t}".`)}else if("string"==typeof n||n instanceof URL){a[l]=n.toString();continue}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.");case"range":i=n;continue;case"worker":s=n;continue;case"data":if(_is_node.isNodeJS&&"undefined"!=typeof Buffer&&n instanceof Buffer)a[l]=new Uint8Array(n);else{if(n instanceof Uint8Array)break;if("string"==typeof n)a[l]=(0,_util.stringToBytes)(n);else{if(("object"!=typeof n||null===n||isNaN(n.length))&&!(0,_util.isArrayBuffer)(n))throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.");a[l]=new Uint8Array(n)}}continue}a[l]=n}a.CMapReaderFactory=a.CMapReaderFactory||DefaultCMapReaderFactory,a.StandardFontDataFactory=a.StandardFontDataFactory||DefaultStandardFontDataFactory,a.ignoreErrors=!0!==a.stopAtErrors,a.fontExtraProperties=!0===a.fontExtraProperties,a.pdfBug=!0===a.pdfBug,a.enableXfa=!0===a.enableXfa,(!Number.isInteger(a.rangeChunkSize)||a.rangeChunkSize<1)&&(a.rangeChunkSize=DEFAULT_RANGE_CHUNK_SIZE),"string"==typeof a.docBaseUrl&&!(0,_display_utils.isDataScheme)(a.docBaseUrl)||(a.docBaseUrl=null),(!Number.isInteger(a.maxImageSize)||a.maxImageSize<-1)&&(a.maxImageSize=-1),"string"!=typeof a.cMapUrl&&(a.cMapUrl=null),"string"!=typeof a.standardFontDataUrl&&(a.standardFontDataUrl=null),"boolean"!=typeof a.useWorkerFetch&&(a.useWorkerFetch=a.CMapReaderFactory===_display_utils.DOMCMapReaderFactory&&a.StandardFontDataFactory===_display_utils.DOMStandardFontDataFactory),"boolean"!=typeof a.isEvalSupported&&(a.isEvalSupported=!0),"boolean"!=typeof a.isOffscreenCanvasSupported&&(a.isOffscreenCanvasSupported=!_is_node.isNodeJS),"boolean"!=typeof a.disableFontFace&&(a.disableFontFace=_is_node.isNodeJS),"boolean"!=typeof a.useSystemFonts&&(a.useSystemFonts=!_is_node.isNodeJS&&!a.disableFontFace),"object"==typeof a.ownerDocument&&null!==a.ownerDocument||(a.ownerDocument=globalThis.document),"boolean"!=typeof a.disableRange&&(a.disableRange=!1),"boolean"!=typeof a.disableStream&&(a.disableStream=!1),"boolean"!=typeof a.disableAutoFetch&&(a.disableAutoFetch=!1),(0,_util.setVerbosityLevel)(a.verbosity),s||(t={verbosity:a.verbosity,port:_worker_options.GlobalWorkerOptions.workerPort},s=t.port?PDFWorker.fromPort(t):new PDFWorker(t),r._worker=s);const o=r.docId;return s.promise.then(function(){if(r.destroyed)throw new Error("Loading aborted");var t=_fetchDocument(s,a,i,o),e=new Promise(function(t){let e;i?e=new _transport_stream.PDFDataTransportStream({length:a.length,initialData:a.initialData,progressiveDone:a.progressiveDone,contentDispositionFilename:a.contentDispositionFilename,disableRange:a.disableRange,disableStream:a.disableStream},i):a.data||(e=createPDFNetworkStream({url:a.url,length:a.length,httpHeaders:a.httpHeaders,withCredentials:a.withCredentials,rangeChunkSize:a.rangeChunkSize,disableRange:a.disableRange,disableStream:a.disableStream})),t(e)});return Promise.all([t,e]).then(function(t){var[t,e]=t;if(r.destroyed)throw new Error("Loading aborted");t=new _message_handler.MessageHandler(o,t,s.port),e=new WorkerTransport(t,r,e,a);r._transport=e,t.send("Ready",null)})}).catch(r._capability.reject),r}async function _fetchDocument(t,e,r,a){if(t.destroyed)throw new Error("Worker was destroyed");r&&(e.length=r.length,e.initialData=r.initialData,e.progressiveDone=r.progressiveDone,e.contentDispositionFilename=r.contentDispositionFilename);r=await t.messageHandler.sendWithPromise("GetDocRequest",{docId:a,apiVersion:"3.0.279",data:e.data,password:e.password,disableAutoFetch:e.disableAutoFetch,rangeChunkSize:e.rangeChunkSize,length:e.length,docBaseUrl:e.docBaseUrl,enableXfa:e.enableXfa,evaluatorOptions:{maxImageSize:e.maxImageSize,disableFontFace:e.disableFontFace,ignoreErrors:e.ignoreErrors,isEvalSupported:e.isEvalSupported,isOffscreenCanvasSupported:e.isOffscreenCanvasSupported,fontExtraProperties:e.fontExtraProperties,useSystemFonts:e.useSystemFonts,cMapUrl:e.useWorkerFetch?e.cMapUrl:null,standardFontDataUrl:e.useWorkerFetch?e.standardFontDataUrl:null}});if(e.data&&(e.data=null),t.destroyed)throw new Error("Worker was destroyed");return r}class PDFDocumentLoadingTask{constructor(){var t,e;this._capability=(0,_util.createPromiseCapability)(),this._transport=null,this._worker=null,this.docId="d"+(_classStaticPrivateFieldSpecSet(PDFDocumentLoadingTask,PDFDocumentLoadingTask,_docId,(t=_classStaticPrivateFieldSpecGet(PDFDocumentLoadingTask,PDFDocumentLoadingTask,_docId),e=t++,t)),e),this.destroyed=!1,this.onPassword=null,this.onProgress=null,this.onUnsupportedFeature=null}get promise(){return this._capability.promise}async destroy(){var t;this.destroyed=!0,await(null==(t=this._transport)?void 0:t.destroy()),this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}}exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;var _docId={writable:!0,value:0};class PDFDataRangeTransport{constructor(t,e){var r=2<arguments.length&&void 0!==arguments[2]&&arguments[2],a=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;this.length=t,this.initialData=e,this.progressiveDone=r,this.contentDispositionFilename=a,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=(0,_util.createPromiseCapability)()}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 r of this._rangeListeners)r(t,e)}onDataProgress(e,r){this._readyCapability.promise.then(()=>{for(const t of this._progressListeners)t(e,r)})}onDataProgressiveRead(e){this._readyCapability.promise.then(()=>{for(const t of this._progressiveReadListeners)t(e)})}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}get annotationStorage(){return this._transport.annotationStorage}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get stats(){return this._transport.stats}get isPureXfa(){return!!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()}getJavaScript(){return this._transport.getJavaScript()}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<arguments.length&&void 0!==arguments[0]&&arguments[0]||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{constructor(t,e,r,a){var i=4<arguments.length&&void 0!==arguments[4]&&arguments[4];this._pageIndex=t,this._pageInfo=e,this._ownerDocument=a,this._transport=r,this._stats=i?new _display_utils.StatTimer:null,this._pdfBug=i,this.commonObjs=r.commonObjs,this.objs=new PDFObjects,this._bitmaps=new Set,this.cleanupAfterRender=!1,this.pendingCleanup=!1,this._intentStates=new Map,this._annotationPromises=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(){var{scale:t,rotation:e=this.rotate,offsetX:r=0,offsetY:a=0,dontFlip:i=!1}=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new _display_utils.PageViewport({viewBox:this.view,scale:t,rotation:e,offsetX:r,offsetY:a,dontFlip:i})}getAnnotations(){var{intent:t="display"}=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=this._transport.getRenderingIntent(t);let e=this._annotationPromises.get(t.cacheKey);return e||(e=this._transport.getAnnotations(this._pageIndex,t.renderingIntent),this._annotationPromises.set(t.cacheKey,e)),e}getJSActions(){return this._jsActionsPromise||(this._jsActionsPromise=this._transport.getPageJSActions(this._pageIndex))}async getXfa(){var t;return(null==(t=this._transport._htmlForXfa)?void 0:t.children[this._pageIndex])||null}render(t){let{canvasContext:e,viewport:r,intent:a="display",annotationMode:i=_util.AnnotationMode.ENABLE,transform:s=null,canvasFactory:n=null,background:o=null,optionalContentConfigPromise:l=null,annotationCanvasMap:h=null,pageColors:c=null,printAnnotationStorage:d=null}=t;null!=(t=this._stats)&&t.time("Overall");t=this._transport.getRenderingIntent(a,i,d);this.pendingCleanup=!1,l=l||this._transport.getOptionalContentConfig();let u=this._intentStates.get(t.cacheKey);u||(u=Object.create(null),this._intentStates.set(t.cacheKey,u)),u.streamReaderCancelTimeout&&(clearTimeout(u.streamReaderCancelTimeout),u.streamReaderCancelTimeout=null);var p,f=n||new DefaultCanvasFactory({ownerDocument:this._ownerDocument});const g=!!(t.renderingIntent&_util.RenderingIntentFlag.PRINT),m=(u.displayReadyCapability||(u.displayReadyCapability=(0,_util.createPromiseCapability)(),u.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},null!=(p=this._stats)&&p.time("Page Request"),this._pumpOperatorList(t)),t=>{u.renderTasks.delete(v),(this.cleanupAfterRender||g)&&(this.pendingCleanup=!0),this._tryCleanup(),t?(v.capability.reject(t),this._abortOperatorList({intentState:u,reason:t instanceof Error?t:new Error(t)})):v.capability.resolve(),null!=(t=this._stats)&&t.timeEnd("Rendering"),null!=(t=this._stats)&&t.timeEnd("Overall")}),v=new InternalRenderTask({callback:m,params:{canvasContext:e,viewport:r,transform:s,background:o},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:h,operatorList:u.operatorList,pageIndex:this._pageIndex,canvasFactory:f,useRequestAnimationFrame:!g,pdfBug:this._pdfBug,pageColors:c});((p=u).renderTasks||(p.renderTasks=new Set)).add(v);t=v.task;return Promise.all([u.displayReadyCapability.promise,l]).then(t=>{var e,[t,r]=t;this.pendingCleanup?m():(null!=(e=this._stats)&&e.time("Rendering"),v.initializeGraphics({transparency:t,optionalContentConfig:r}),v.operatorListChanged())}).catch(m),t}getOperatorList(){var{intent:t="display",annotationMode:e=_util.AnnotationMode.ENABLE,printAnnotationStorage:r=null}=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};t=this._transport.getRenderingIntent(t,e,r,!0);let a=this._intentStates.get(t.cacheKey);a||(a=Object.create(null),this._intentStates.set(t.cacheKey,a));let i;return a.opListReadCapability||((i=Object.create(null)).operatorListChanged=function(){a.operatorList.lastChunk&&(a.opListReadCapability.resolve(a.operatorList),a.renderTasks.delete(i))},a.opListReadCapability=(0,_util.createPromiseCapability)(),((e=a).renderTasks||(e.renderTasks=new Set)).add(i),a.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},null!=(r=this._stats)&&r.time("Page Request"),this._pumpOperatorList(t)),a.opListReadCapability.promise}streamTextContent(){var{disableCombineTextItems:t=!1,includeMarkedContent:e=!1}=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,combineTextItems:!0!==t,includeMarkedContent:!0===e},{highWaterMark:100,size(t){return t.items.length}})}getTextContent(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(this._transport._htmlForXfa)return this.getXfa().then(t=>_xfa_text.XfaText.textContent(t));const r=this.streamTextContent(t);return new Promise(function(a,t){const e=r.getReader(),i={items:[],styles:Object.create(null)};!function r(){e.read().then(function(t){var{value:t,done:e}=t;e?a(i):(Object.assign(i.styles,t.styles),i.items.push(...t.items),r())},t)}()})}getStructTree(){return this._structTreePromise||(this._structTreePromise=this._transport.getStructTree(this._pageIndex))}_destroy(){this.destroyed=!0;var t=[];for(const e of this._intentStates.values())if(this._abortOperatorList({intentState:e,reason:new Error("Page was destroyed."),force:!0}),!e.opListReadCapability)for(const r of e.renderTasks)t.push(r.completed),r.cancel();this.objs.clear();for(const a of this._bitmaps)a.close();return this._bitmaps.clear(),this._annotationPromises.clear(),this._jsActionsPromise=null,this._structTreePromise=null,this.pendingCleanup=!1,Promise.all(t)}cleanup(){var t=0<arguments.length&&void 0!==arguments[0]&&arguments[0];return this.pendingCleanup=!0,this._tryCleanup(t)}_tryCleanup(){var t,e,r=0<arguments.length&&void 0!==arguments[0]&&arguments[0];if(!this.pendingCleanup)return!1;for({renderTasks:t,operatorList:e}of this._intentStates.values())if(0<t.size||!e.lastChunk)return!1;this._intentStates.clear(),this.objs.clear(),this._annotationPromises.clear(),this._jsActionsPromise=null,this._structTreePromise=null,r&&this._stats&&(this._stats=new _display_utils.StatTimer);for(const a of this._bitmaps)a.close();return this._bitmaps.clear(),!(this.pendingCleanup=!1)}_startRenderPage(t,e){var r,e=this._intentStates.get(e);e&&(null!=(r=this._stats)&&r.timeEnd("Page Request"),null!=(r=e.displayReadyCapability))&&r.resolve(t)}_renderPageChunk(r,a){for(let t=0,e=r.length;t<e;t++)a.operatorList.fnArray.push(r.fnArray[t]),a.operatorList.argsArray.push(r.argsArray[t]);a.operatorList.lastChunk=r.lastChunk,a.operatorList.separateAnnots=r.separateAnnots;for(const t of a.renderTasks)t.operatorListChanged();r.lastChunk&&this._tryCleanup()}_pumpOperatorList(t){var{renderingIntent:t,cacheKey:e,annotationStorageMap:r}=t;const a=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:t,cacheKey:e,annotationStorage:r}).getReader(),i=this._intentStates.get(e),s=(i.streamReader=a,()=>{a.read().then(t=>{var{value:t,done:e}=t;e?i.streamReader=null:this._transport.destroyed||(this._renderPageChunk(t,i),s())},t=>{if(i.streamReader=null,!this._transport.destroyed){if(i.operatorList){i.operatorList.lastChunk=!0;for(const e of i.renderTasks)e.operatorListChanged();this._tryCleanup()}if(i.displayReadyCapability)i.displayReadyCapability.reject(t);else{if(!i.opListReadCapability)throw t;i.opListReadCapability.reject(t)}}})});s()}_abortOperatorList(t){let{intentState:e,reason:r,force:a=!1}=t;if(e.streamReader){if(!a){if(0<e.renderTasks.size)return;if(r instanceof _display_utils.RenderingCancelledException)return void(e.streamReaderCancelTimeout=setTimeout(()=>{this._abortOperatorList({intentState:e,reason:r,force:!0}),e.streamReaderCancelTimeout=null},RENDERING_CANCELLED_TIMEOUT))}if(e.streamReader.cancel(new _util.AbortException(r.message)).catch(()=>{}),e.streamReader=null,!this._transport.destroyed){for(var[i,s]of this._intentStates)if(s===e){this._intentStates.delete(i);break}this.cleanup()}}}get stats(){return this._stats}}exports.PDFPageProxy=PDFPageProxy;var _listeners=new WeakMap,_deferred=new WeakMap,_document,_document$currentScri;class LoopbackPort{constructor(){_classPrivateFieldInitSpec(this,_listeners,{writable:!0,value:[]}),_classPrivateFieldInitSpec(this,_deferred,{writable:!0,value:Promise.resolve()})}postMessage(t,e){const r={data:structuredClone(t,e)};_classPrivateFieldGet(this,_deferred).then(()=>{for(const t of _classPrivateFieldGet(this,_listeners))t.call(this,r)})}addEventListener(t,e){_classPrivateFieldGet(this,_listeners).push(e)}removeEventListener(t,e){e=_classPrivateFieldGet(this,_listeners).indexOf(e);_classPrivateFieldGet(this,_listeners).splice(e,1)}terminate(){_classPrivateFieldGet(this,_listeners).length=0}}exports.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};if(exports.PDFWorkerUtil=PDFWorkerUtil,_is_node.isNodeJS&&"function"==typeof require)PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if("object"==typeof document){const pdfjsFilePath=null==(_document=document)||null==(_document$currentScri=_document.currentScript)?void 0:_document$currentScri.src;pdfjsFilePath&&(PDFWorkerUtil.fallbackWorkerSrc=pdfjsFilePath.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(t){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{constructor(){var{name:t=null,port:e=null,verbosity:r=(0,_util.getVerbosityLevel)()}=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(e&&_classStaticPrivateFieldSpecGet(PDFWorker,PDFWorker,_workerPorts).has(e))throw new Error("Cannot use more than one PDFWorker per port.");this.name=t,this.destroyed=!1,this.verbosity=r,this._readyCapability=(0,_util.createPromiseCapability)(),this._port=null,this._webWorker=null,this._messageHandler=null,e?(_classStaticPrivateFieldSpecGet(PDFWorker,PDFWorker,_workerPorts).set(e,this),this._initializeFromPort(e)):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 t=PDFWorker["workerSrc"];try{PDFWorkerUtil.isSameOrigin(window.location.href,t)||(t=PDFWorkerUtil.createCDNWrapper(new URL(t,window.location).href));const e=new Worker(t),r=new _message_handler.MessageHandler("main","worker",e),a=()=>{e.removeEventListener("error",i),r.destroy(),e.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},i=()=>{this._webWorker||a()},s=(e.addEventListener("error",i),r.on("test",t=>{e.removeEventListener("error",i),this.destroyed?a():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",i),this.destroyed)a();else try{s()}catch(t){this._setupFakeWorker()}}),()=>{var t=new Uint8Array;r.send("test",t,[t.buffer])});return void s()}catch(t){(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,a;this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):(e=new LoopbackPort,this._port=e,r="fake"+PDFWorkerUtil.fakeWorkerId++,a=new _message_handler.MessageHandler(r+"_worker",r,e),t.setup(a,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),_classStaticPrivateFieldSpecGet(PDFWorker,PDFWorker,_workerPorts).delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(t){if(null!=t&&t.port)return _classStaticPrivateFieldSpecGet(this,PDFWorker,_workerPorts).has(t.port)?_classStaticPrivateFieldSpecGet(this,PDFWorker,_workerPorts).get(t.port):new PDFWorker(t);throw new Error("PDFWorker.fromPort - invalid method signature.")}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(null!==PDFWorkerUtil.fallbackWorkerSrc)return _is_node.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){try{var t;return(null==(t=globalThis.pdfjsWorker)?void 0:t.WorkerMessageHandler)||null}catch(t){return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_is_node.isNodeJS&&"function"==typeof require){const 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;var _workerPorts={writable:!0,value:new WeakMap},_docStats=new WeakMap,_pageCache=new WeakMap,_pagePromises=new WeakMap,_metadataPromise=new WeakMap;class WorkerTransport{constructor(t,e,r,a){_classPrivateFieldInitSpec(this,_docStats,{writable:!0,value:null}),_classPrivateFieldInitSpec(this,_pageCache,{writable:!0,value:new Map}),_classPrivateFieldInitSpec(this,_pagePromises,{writable:!0,value:new Map}),_classPrivateFieldInitSpec(this,_metadataPromise,{writable:!0,value:null}),this.messageHandler=t,this.loadingTask=e,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({onUnsupportedFeature:this._onUnsupportedFeature.bind(this),ownerDocument:a.ownerDocument,styleElement:a.styleElement}),(this._params=a).useWorkerFetch||(this.CMapReaderFactory=new a.CMapReaderFactory({baseUrl:a.cMapUrl,isCompressed:a.cMapPacked}),this.StandardFontDataFactory=new a.StandardFontDataFactory({baseUrl:a.standardFontDataUrl})),this.destroyed=!1,this.destroyCapability=null,this._passwordCapability=null,this._networkStream=r,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=(0,_util.createPromiseCapability)(),this.setupMessageHandler()}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}get stats(){return _classPrivateFieldGet(this,_docStats)}getRenderingIntent(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:_util.AnnotationMode.ENABLE,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,a=3<arguments.length&&void 0!==arguments[3]&&arguments[3];let i=_util.RenderingIntentFlag.DISPLAY,s=null;switch(t){case"any":i=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":i=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)("getRenderingIntent - invalid intent: "+t)}switch(e){case _util.AnnotationMode.DISABLE:i+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:i+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:var n=(i+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE)&_util.RenderingIntentFlag.PRINT&&r instanceof _annotation_storage.PrintAnnotationStorage?r:this.annotationStorage;s=n.serializable;break;default:(0,_util.warn)("getRenderingIntent - invalid annotationMode: "+e)}return a&&(i+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:i,cacheKey:i+"_"+_annotation_storage.AnnotationStorage.getHash(s),annotationStorageMap:s}}destroy(){if(!this.destroyCapability){this.destroyed=!0,this.destroyCapability=(0,_util.createPromiseCapability)(),this._passwordCapability&&this._passwordCapability.reject(new Error("Worker was destroyed during onPassword callback"));var t=[];for(const r of _classPrivateFieldGet(this,_pageCache).values())t.push(r._destroy());_classPrivateFieldGet(this,_pageCache).clear(),_classPrivateFieldGet(this,_pagePromises).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();var e=this.messageHandler.sendWithPromise("Terminate",null);t.push(e),Promise.all(t).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),_classPrivateFieldSet(this,_metadataPromise,null),this._getFieldObjectsPromise=null,this._hasJSActionsPromise=null,this._networkStream&&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(){const{messageHandler:o,loadingTask:a}=this;o.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)((0,_util.isArrayBuffer)(t),"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})}}),o.on("ReaderHeadersReady",t=>{const e=(0,_util.createPromiseCapability)(),r=this._fullReader;return r.headersReady.then(()=>{var t;r.isStreamingSupported&&r.isRangeSupported||(this._lastProgress&&null!=(t=a.onProgress)&&t.call(a,this._lastProgress),r.onProgress=t=>{var e;null!=(e=a.onProgress)&&e.call(a,{loaded:t.loaded,total:t.total})}),e.resolve({isStreamingSupported:r.isStreamingSupported,isRangeSupported:r.isRangeSupported,contentLength:r.contentLength})},e.reject),e.promise}),o.on("GetRangeReader",(t,r)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const 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)((0,_util.isArrayBuffer)(t),"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()}),o.on("GetDoc",t=>{t=t.pdfInfo;this._numPages=t.numPages,this._htmlForXfa=t.htmlForXfa,delete t.htmlForXfa,a._capability.resolve(new PDFDocumentProxy(t,this))}),o.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.")}a._capability.reject(e)}),o.on("PasswordRequest",t=>{if(this._passwordCapability=(0,_util.createPromiseCapability)(),a.onPassword){var e=t=>{t instanceof Error?this._passwordCapability.reject(t):this._passwordCapability.resolve({password:t})};try{a.onPassword(e,t.code)}catch(t){this._passwordCapability.reject(t)}}else this._passwordCapability.reject(new _util.PasswordException(t.message,t.code));return this._passwordCapability.promise}),o.on("DataLoaded",t=>{var e;null!=(e=a.onProgress)&&e.call(a,{loaded:t.length,total:t.length}),this.downloadInfoCapability.resolve(t)}),o.on("StartRenderPage",t=>{this.destroyed||_classPrivateFieldGet(this,_pageCache).get(t.pageIndex)._startRenderPage(t.transparency,t.cacheKey)}),o.on("commonobj",t=>{let[e,r,a]=t;if(!this.destroyed&&!this.commonObjs.has(e))switch(r){case"Font":const s=this._params;if("error"in a){var i=a.error;(0,_util.warn)("Error during font loading: "+i),this.commonObjs.resolve(e,i)}else{let t=null;s.pdfBug&&null!=(i=globalThis.FontInspector)&&i.enabled&&(t={registerFont(t,e){globalThis.FontInspector.fontAdded(t,e)}});const n=new _font_loader.FontFaceObject(a,{isEvalSupported:s.isEvalSupported,disableFontFace:s.disableFontFace,ignoreErrors:s.ignoreErrors,onUnsupportedFeature:this._onUnsupportedFeature.bind(this),fontRegistry:t});this.fontLoader.bind(n).catch(t=>o.sendWithPromise("FontFallback",{id:e})).finally(()=>{!s.fontExtraProperties&&n.data&&(n.data=null),this.commonObjs.resolve(e,n)})}break;case"FontPath":case"Image":this.commonObjs.resolve(e,a);break;default:throw new Error("Got unknown common object type "+r)}}),o.on("obj",t=>{var[e,t,r,a]=t;if(!this.destroyed){var i=_classPrivateFieldGet(this,_pageCache).get(t);if(!i.objs.has(e))switch(r){case"Image":i.objs.resolve(e,a);var s,n,o;if(a){let t;a.bitmap?({bitmap:s,width:o,height:n}=a,t=o*n*4,i._bitmaps.add(s)):t=(null==(o=a.data)?void 0:o.length)||0,8e6<t&&(i.cleanupAfterRender=!0)}break;case"Pattern":i.objs.resolve(e,a);break;default:throw new Error("Got unknown object type "+r)}}}),o.on("DocProgress",t=>{var e;this.destroyed||null!=(e=a.onProgress)&&e.call(a,{loaded:t.loaded,total:t.total})}),o.on("DocStats",t=>{this.destroyed||_classPrivateFieldSet(this,_docStats,Object.freeze({streamTypes:Object.freeze(t.streamTypes),fontTypes:Object.freeze(t.fontTypes)}))}),o.on("UnsupportedFeature",this._onUnsupportedFeature.bind(this)),o.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."))),o.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.")))}_onUnsupportedFeature(t){var e,r,t=t["featureId"];this.destroyed||null!=(e=(r=this.loadingTask).onUnsupportedFeature)&&e.call(r,t)}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var t;return this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead."),this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:this.annotationStorage.serializable,filename:(null==(t=this._fullReader)?void 0:t.filename)??null}).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,r=_classPrivateFieldGet(this,_pagePromises).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.ownerDocument,this._params.pdfBug);return _classPrivateFieldGet(this,_pageCache).set(e,t),t}),_classPrivateFieldGet(this,_pagePromises).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._getFieldObjectsPromise||(this._getFieldObjectsPromise=this.messageHandler.sendWithPromise("GetFieldObjects",null))}hasJSActions(){return this._hasJSActionsPromise||(this._hasJSActionsPromise=this.messageHandler.sendWithPromise("HasJSActions",null))}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)}getJavaScript(){return this.messageHandler.sendWithPromise("GetJavaScript",null)}getDocJSActions(){return this.messageHandler.sendWithPromise("GetDocJSActions",null)}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(){return _classPrivateFieldGet(this,_metadataPromise)||_classPrivateFieldSet(this,_metadataPromise,this.messageHandler.sendWithPromise("GetMetadata",null).then(t=>{return{info:t[0],metadata:t[1]?new _metadata.Metadata(t[1]):null,contentDispositionFilename:(null==(t=this._fullReader)?void 0:t.filename)??null,contentLength:(null==(t=this._fullReader)?void 0:t.contentLength)??null}}))}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(){var t=0<arguments.length&&void 0!==arguments[0]&&arguments[0];if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const e of _classPrivateFieldGet(this,_pageCache).values())if(!e.cleanup())throw new Error(`startCleanup: Page ${e.pageNumber} is currently rendering.`);this.commonObjs.clear(),t||this.fontLoader.clear(),_classPrivateFieldSet(this,_metadataPromise,null),this._getFieldObjectsPromise=null,this._hasJSActionsPromise=null}}get loadingParams(){var t=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:t.disableAutoFetch,enableXfa:t.enableXfa})}}var _objs=new WeakMap,_ensureObj=new WeakSet;class PDFObjects{constructor(){_classPrivateMethodInitSpec(this,_ensureObj),_classPrivateFieldInitSpec(this,_objs,{writable:!0,value:Object.create(null)})}get(t){let e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;if(e){const r=_classPrivateMethodGet(this,_ensureObj,_ensureObj2).call(this,t);return r.capability.promise.then(()=>e(r.data)),null}const r=_classPrivateFieldGet(this,_objs)[t];if(null!==r&&void 0!==r&&r.capability.settled)return r.data;throw new Error(`Requesting object that isn't resolved yet ${t}.`)}has(t){t=_classPrivateFieldGet(this,_objs)[t];return(null==t?void 0:t.capability.settled)||!1}resolve(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,t=_classPrivateMethodGet(this,_ensureObj,_ensureObj2).call(this,t);t.data=e,t.capability.resolve()}clear(){_classPrivateFieldSet(this,_objs,Object.create(null))}}function _ensureObj2(t){var e=_classPrivateFieldGet(this,_objs)[t];return e||(_classPrivateFieldGet(this,_objs)[t]={capability:(0,_util.createPromiseCapability)(),data:null})}var _internalRenderTask=new WeakMap;class RenderTask{constructor(t){_classPrivateFieldInitSpec(this,_internalRenderTask,{writable:!0,value:null}),_classPrivateFieldSet(this,_internalRenderTask,t),this.onContinue=null}get promise(){return _classPrivateFieldGet(this,_internalRenderTask).capability.promise}cancel(){_classPrivateFieldGet(this,_internalRenderTask).cancel()}get separateAnnots(){var t,e=_classPrivateFieldGet(this,_internalRenderTask).operatorList["separateAnnots"];return!!e&&(t=_classPrivateFieldGet(this,_internalRenderTask)["annotationCanvasMap"],e.form||e.canvas&&0<(null==t?void 0:t.size))}}exports.RenderTask=RenderTask;class InternalRenderTask{constructor(t){var{callback:t,params:e,objs:r,commonObjs:a,annotationCanvasMap:i,operatorList:s,pageIndex:n,canvasFactory:o,useRequestAnimationFrame:l=!1,pdfBug:h=!1,pageColors:c=null}=t;this.callback=t,this.params=e,this.objs=r,this.commonObjs=a,this.annotationCanvasMap=i,this.operatorListIdx=null,this.operatorList=s,this._pageIndex=n,this.canvasFactory=o,this._pdfBug=h,this.pageColors=c,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===l&&"undefined"!=typeof window,this.cancelled=!1,this.capability=(0,_util.createPromiseCapability)(),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=e.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics(t){var{transparency:t=!1,optionalContentConfig:e}=t;if(!this.cancelled){if(this._canvas){if(_classStaticPrivateFieldSpecGet(InternalRenderTask,InternalRenderTask,_canvasInUse).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.");_classStaticPrivateFieldSpecGet(InternalRenderTask,InternalRenderTask,_canvasInUse).add(this._canvas)}this._pdfBug&&null!=(r=globalThis.StepperManager)&&r.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());var{canvasContext:r,viewport:a,transform:i,background:s}=this.params;this.gfx=new _canvas.CanvasGraphics(r,this.commonObjs,this.objs,this.canvasFactory,e,this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:i,viewport:a,transparency:t,background:s}),this.operatorListIdx=0,this.graphicsReady=!0,null!=(r=this.graphicsReadyCallback)&&r.call(this)}}cancel(){var t,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null;this.running=!1,this.cancelled=!0,null!=(t=this.gfx)&&t.endDrawing(),this._canvas&&_classStaticPrivateFieldSpecGet(InternalRenderTask,InternalRenderTask,_canvasInUse).delete(this._canvas),this.callback(e||new _display_utils.RenderingCancelledException("Rendering cancelled, page "+(this._pageIndex+1),"canvas"))}operatorListChanged(){var t;this.graphicsReady?(null!=(t=this.stepper)&&t.updateOperatorList(this.operatorList),this.running||this._continue()):this.graphicsReadyCallback||(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(){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(),this._canvas&&_classStaticPrivateFieldSpecGet(InternalRenderTask,InternalRenderTask,_canvasInUse).delete(this._canvas),this.callback()))}}var _canvasInUse={writable:!0,value:new WeakSet};const version="3.0.279",build=(exports.version=version,"d0823066c");exports.build=build},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PrintAnnotationStorage=e.AnnotationStorage=void 0;var a=r(1),n=r(135),i=r(139);function s(t,e,r){e=o(t,e,"set");if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}function o(t,e,r){if(e.has(t))return e.get(t);throw new TypeError("attempted to "+r+" private field on non-instance")}function l(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}var h=new WeakSet;class c{constructor(){var t,e;l(t=this,e=h),e.add(t),this._storage=new Map,this._modified=!1,this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,e){t=this._storage.get(t);return void 0===t?e:Object.assign(e,t)}getRawValue(t){return this._storage.get(t)}remove(t){if(this._storage.delete(t),0===this._storage.size&&this.resetModified(),"function"==typeof this.onAnnotationEditor){for(const e of this._storage.values())if(e instanceof n.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(t,e){var r=this._storage.get(t);let a=!1;if(void 0!==r)for(var[i,s]of Object.entries(e))r[i]!==s&&(a=!0,r[i]=s);else a=!0,this._storage.set(t,e);a&&!function(t,e,r){if(e.has(t))return r;throw new TypeError("attempted to get private field on non-instance")}(this,h,d).call(this),e instanceof n.AnnotationEditor&&"function"==typeof this.onAnnotationEditor&&this.onAnnotationEditor(e.constructor._type)}has(t){return this._storage.has(t)}getAll(){return 0<this._storage.size?(0,a.objectFromMap)(this._storage):null}get size(){return this._storage.size}resetModified(){this._modified&&(this._modified=!1,"function"==typeof this.onResetModified)&&this.onResetModified()}get print(){return new p(this)}get serializable(){if(0===this._storage.size)return null;var t,e,r=new Map;for([t,e]of this._storage){var a=e instanceof n.AnnotationEditor?e.serialize():e;a&&r.set(t,a)}return r}static getHash(t){if(!t)return"";var e,r,a=new i.MurmurHash3_64;for([e,r]of t)a.update(e+":"+JSON.stringify(r));return a.hexdigest()}}function d(){this._modified||(this._modified=!0,"function"==typeof this.onSetModified&&this.onSetModified())}e.AnnotationStorage=c;var u=new WeakMap;class p extends c{constructor(t){var e,r,a;super(),a={writable:!0,value:null},l(e=this,r=u),r.set(e,a),s(this,u,structuredClone(t.serializable))}get print(){(0,a.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return(e=o(t=this,e=u,"get")).get?e.get.call(t):e.value;var t,e}}e.PrintAnnotationStorage=p},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AnnotationEditor=void 0;var a=r(136),i=r(1);function s(t,e,r){e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}function n(t,e,r){var a=t;if(e.has(a))throw new TypeError("Cannot initialize the same private elements twice on an object");e.set(t,r)}function o(t,e,r){e=h(t,e,"set");if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}function l(t,e){e=h(t,e,"get");return e.get?e.get.call(t):e.value}function h(t,e,r){if(e.has(t))return e.get(t);throw new TypeError("attempted to "+r+" private field on non-instance")}var c=new WeakMap,d=new WeakMap,u=new WeakMap,p=new WeakMap,f=new WeakMap,g=new WeakMap;class m{constructor(t){n(this,c,{writable:!0,value:this.focusin.bind(this)}),n(this,d,{writable:!0,value:this.focusout.bind(this)}),n(this,u,{writable:!0,value:!1}),n(this,p,{writable:!0,value:!1}),n(this,f,{writable:!0,value:!1}),n(this,g,{writable:!0,value:m._zIndex++}),this.constructor===m&&(0,i.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;var[e,r]=this.parent.viewportBaseDimensions;this.x=t.x/e,this.y=t.y/r,this.rotation=this.parent.viewport.rotation,this.isAttachedToDOM=!1}static get _defaultLineColor(){return(0,i.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=l(this,g)}focusin(t){l(this,u)?o(this,u,!1):this.parent.setSelected(this)}focusout(t){var e;!this.isAttachedToDOM||null!=(e=t.relatedTarget)&&e.closest("#"+this.id)||(t.preventDefault(),this.parent.isMultipleSelection)||this.commitOrRemove()}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.parent.addToAnnotationStorage(this)}dragstart(t){var e=this.parent.div.getBoundingClientRect();this.startX=t.clientX-e.x,this.startY=t.clientY-e.y,t.dataTransfer.setData("text/plain",this.id),t.dataTransfer.effectAllowed="move"}setAt(t,e,r,a){var[i,s]=this.parent.viewportBaseDimensions;[r,a]=this.screenToPageTranslation(r,a),this.x=(t+r)/i,this.y=(e+a)/s,this.div.style.left=100*this.x+"%",this.div.style.top=100*this.y+"%"}translate(t,e){var[r,a]=this.parent.viewportBaseDimensions;[t,e]=this.screenToPageTranslation(t,e),this.x+=t/r,this.y+=e/a,this.div.style.left=100*this.x+"%",this.div.style.top=100*this.y+"%"}screenToPageTranslation(t,e){var r=this.parent.viewport["rotation"];switch(r){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}}setDims(t,e){var[r,a]=this.parent.viewportBaseDimensions;this.div.style.width=100*t/r+"%",this.div.style.height=100*e/a+"%"}fixDims(){var t,e,r=this.div["style"],{height:a,width:i}=r,s=i.endsWith("%"),n=a.endsWith("%");s&&n||([t,e]=this.parent.viewportBaseDimensions,s||(r.width=100*parseFloat(i)/t+"%"),n)||(r.height=100*parseFloat(a)/e+"%")}getInitialTranslation(){return[0,0]}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",l(this,c)),this.div.addEventListener("focusout",l(this,d));var[t,e]=this.getInitialTranslation();return this.translate(t,e),(0,a.bindEvents)(this,this.div,["dragstart","pointerdown"]),this.div}pointerdown(t){var e=a.KeyboardManager.platform.isMac;0!==t.button||t.ctrlKey&&e?t.preventDefault():(t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this),o(this,u,!0))}getRect(t,e){var[r,a]=this.parent.viewportBaseDimensions,[i,s]=this.parent.pageDimensions,n=i*t/r,o=s*e/a,l=this.x*i,h=this.y*s,c=this.width*i,d=this.height*s;switch(this.rotation){case 0:return[l+n,s-h-o-d,l+n+c,s-h-o];case 90:return[l+o,s-h+n,l+o+d,s-h+n+c];case 180:return[l-n-c,s-h+o,l-n,s-h+o+d];case 270:return[l-o-d,s-h-n-c,l-o,s-h-n];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,e){var[r,a,i,s]=t,n=i-r,o=s-a;switch(this.rotation){case 0:return[r,e-s,n,o];case 90:return[r,e-a,o,n];case 180:return[i,e-a,n,o];case 270:return[i,e-s,o,n];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){o(this,f,!0)}disableEditMode(){o(this,f,!1)}isInEditMode(){return l(this,f)}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var t;null!=(t=this.div)&&t.addEventListener("focusin",l(this,c))}serialize(){(0,i.unreachable)("An editor must be serializable")}static deserialize(t,e){var r=new this.prototype.constructor({parent:e,id:e.getNextId()}),[e,a]=(r.rotation=t.rotation,e.pageDimensions),[t,i,s,n]=r.getRectInCurrentCoords(t.rect,a);return r.x=t/e,r.y=i/a,r.width=s/e,r.height=n/a,r}remove(){this.div.removeEventListener("focusin",l(this,c)),this.div.removeEventListener("focusout",l(this,d)),this.isEmpty()||this.commit(),this.parent.remove(this)}select(){var t;null!=(t=this.div)&&t.classList.add("selectedEditor")}unselect(){var t;null!=(t=this.div)&&t.classList.remove("selectedEditor")}updateParams(t,e){}disableEditing(){}enableEditing(){}get propertiesToUpdate(){return{}}get contentDiv(){return this.div}get isEditing(){return l(this,p)}set isEditing(t){o(this,p,t),t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null)}}s(e.AnnotationEditor=m,"_colorManager",new a.ColorManager),s(m,"_zIndex",1)},(L,t,N)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeyboardManager=t.CommandManager=t.ColorManager=t.AnnotationEditorUIManager=void 0,t.bindEvents=function(t,e,r){for(const a of r)e.addEventListener(a,t[a].bind(t))},t.opacityToHex=function(t){return Math.round(Math.min(255,Math.max(1,255*t))).toString(16).padStart(2,"0")};var n=N(1),j=N(137);function U(t,e,r){e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}function o(t,e){W(t,e),e.add(t)}function l(t,e,r){if(e.has(t))return r;throw new TypeError("attempted to get private field on non-instance")}function r(t,e,r){W(t,e),e.set(t,r)}function W(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function h(t,e,r){e=B(t,e,"set");if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}function c(t,e){e=B(t,e,"get");return e.get?e.get.call(t):e.value}function B(t,e,r){if(e.has(t))return e.get(t);throw new TypeError("attempted to "+r+" private field on non-instance")}var a=new WeakMap;class G{constructor(){r(this,a,{writable:!0,value:0})}getId(){var t,e;return""+n.AnnotationEditorPrefix+(h(this,a,(t=c(this,a),e=t++,t)),e)}}var d=new WeakMap,u=new WeakMap,p=new WeakMap,f=new WeakMap;class q{constructor(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:128;r(this,d,{writable:!0,value:[]}),r(this,u,{writable:!0,value:!1}),r(this,p,{writable:!0,value:void 0}),r(this,f,{writable:!0,value:-1}),h(this,p,t)}add(t){var{cmd:t,undo:e,mustExec:r,type:a=NaN,overwriteIfSameType:i=!1,keepUndo:s=!1}=t;r&&t(),c(this,u)||(r={cmd:t,undo:e,type:a},-1===c(this,f)?(0<c(this,d).length&&(c(this,d).length=0),h(this,f,0),c(this,d).push(r)):i&&c(this,d)[c(this,f)].type===a?(s&&(r.undo=c(this,d)[c(this,f)].undo),c(this,d)[c(this,f)]=r):((t=c(this,f)+1)===c(this,p)?c(this,d).splice(0,1):(h(this,f,t),t<c(this,d).length&&c(this,d).splice(t)),c(this,d).push(r)))}undo(){-1!==c(this,f)&&(h(this,u,!0),c(this,d)[c(this,f)].undo(),h(this,u,!1),h(this,f,c(this,f)-1))}redo(){c(this,f)<c(this,d).length-1&&(h(this,f,c(this,f)+1),h(this,u,!0),c(this,d)[c(this,f)].cmd(),h(this,u,!1))}hasSomethingToUndo(){return-1!==c(this,f)}hasSomethingToRedo(){return c(this,f)<c(this,d).length-1}destroy(){h(this,d,null)}}t.CommandManager=q;var H=new WeakSet;class g{constructor(t){o(this,H),this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;var e,r,a=g.platform.isMac;for([e,r]of t)for(const s of e){var i=s.startsWith("mac+");a&&i?(this.callbacks.set(s.slice(4),r),this.allKeys.add(s.split("+").at(-1))):a||i||(this.callbacks.set(s,r),this.allKeys.add(s.split("+").at(-1)))}}static get platform(){var t="undefined"!=typeof navigator?navigator.platform:"";return(0,n.shadow)(this,"platform",{isWin:t.includes("Win"),isMac:t.includes("Mac")})}exec(t,e){var r;this.allKeys.has(e.key)&&(r=this.callbacks.get(l(this,H,z).call(this,e)))&&(r.bind(t)(),e.stopPropagation(),e.preventDefault())}}function z(t){t.altKey&&this.buffer.push("alt"),t.ctrlKey&&this.buffer.push("ctrl"),t.metaKey&&this.buffer.push("meta"),t.shiftKey&&this.buffer.push("shift"),this.buffer.push(t.key);t=this.buffer.join("+");return this.buffer.length=0,t}t.KeyboardManager=g;class V{get _colors(){var t=new Map([["CanvasText",null],["Canvas",null]]);return(0,j.getColorValues)(t),(0,n.shadow)(this,"_colors",t)}convert(t){const r=(0,j.getRGB)(t);if(window.matchMedia("(forced-colors: active)").matches)for(var[e,a]of this._colors)if(a.every((t,e)=>t===r[e]))return V._colorsMapping.get(e);return r}getHexCode(t){var e=this._colors.get(t);return e?n.Util.makeHexColor(...e):t}}U(t.ColorManager=V,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));var i=new WeakMap,s=new WeakMap,m=new WeakMap,v=new WeakMap,b=new WeakMap,_=new WeakMap,y=new WeakMap,X=new WeakMap,A=new WeakMap,S=new WeakMap,w=new WeakMap,x=new WeakMap,E=new WeakMap,C=new WeakMap,k=new WeakMap,P=new WeakMap,Y=new WeakMap,K=new WeakMap,T=new WeakMap,J=new WeakSet,$=new WeakSet,Q=new WeakSet,Z=new WeakSet,M=new WeakSet,F=new WeakSet,tt=new WeakSet,et=new WeakSet,rt=new WeakSet,R=new WeakSet,at=new WeakSet;class O{constructor(t,e){o(this,at),o(this,R),o(this,rt),o(this,et),o(this,tt),o(this,F),o(this,M),o(this,Z),o(this,Q),o(this,$),o(this,J),r(this,i,{writable:!0,value:null}),r(this,s,{writable:!0,value:new Map}),r(this,m,{writable:!0,value:new Map}),r(this,v,{writable:!0,value:new q}),r(this,b,{writable:!0,value:0}),r(this,_,{writable:!0,value:null}),r(this,y,{writable:!0,value:null}),r(this,X,{writable:!0,value:new G}),r(this,A,{writable:!0,value:!1}),r(this,S,{writable:!0,value:n.AnnotationEditorType.NONE}),r(this,w,{writable:!0,value:new Set}),r(this,x,{writable:!0,value:this.copy.bind(this)}),r(this,E,{writable:!0,value:this.cut.bind(this)}),r(this,C,{writable:!0,value:this.paste.bind(this)}),r(this,k,{writable:!0,value:this.keydown.bind(this)}),r(this,P,{writable:!0,value:this.onEditingAction.bind(this)}),r(this,Y,{writable:!0,value:this.onPageChanging.bind(this)}),r(this,K,{writable:!0,value:{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1}}),r(this,T,{writable:!0,value:null}),h(this,T,t),h(this,y,e),c(this,y)._on("editingaction",c(this,P)),c(this,y)._on("pagechanging",c(this,Y))}destroy(){l(this,$,st).call(this),c(this,y)._off("editingaction",c(this,P)),c(this,y)._off("pagechanging",c(this,Y));for(const t of c(this,m).values())t.destroy();c(this,m).clear(),c(this,s).clear(),h(this,i,null),c(this,w).clear(),c(this,v).destroy()}onPageChanging(t){t=t.pageNumber;h(this,b,t-1)}focusMainContainer(){c(this,T).focus()}copy(t){if(t.preventDefault(),c(this,i)&&c(this,i).commitOrRemove(),this.hasSelection){var e=[];for(const r of c(this,w))r.isEmpty()||e.push(r.serialize());0!==e.length&&t.clipboardData.setData("application/pdfjs",JSON.stringify(e))}}cut(t){this.copy(t),this.delete()}paste(t){t.preventDefault();let e=t.clipboardData.getData("application/pdfjs");if(e){try{e=JSON.parse(e)}catch(t){return void(0,n.warn)(`paste: "${t.message}".`)}if(Array.isArray(e)){this.unselectAll();var r=c(this,m).get(c(this,b));try{const i=[];for(const s of e){var a=r.deserialize(s);if(!a)return;i.push(a)}this.addCommands({cmd:()=>{for(const t of i)l(this,rt,ct).call(this,t);l(this,at,dt).call(this,i)},undo:()=>{for(const t of i)t.remove()},mustExec:!0})}catch(t){(0,n.warn)(`paste: "${t.message}".`)}}}}keydown(t){var e;null!=(e=this.getActive())&&e.shouldGetKeyboardEvents()||O._keyboardManager.exec(this,t)}onEditingAction(t){["undo","redo","delete","selectAll"].includes(t.name)&&this[t.name]()}setEditingState(t){t?(l(this,J,it).call(this),l(this,Q,nt).call(this),l(this,M,D).call(this,{isEditing:c(this,S)!==n.AnnotationEditorType.NONE,isEmpty:l(this,R,e).call(this),hasSomethingToUndo:c(this,v).hasSomethingToUndo(),hasSomethingToRedo:c(this,v).hasSomethingToRedo(),hasSelectedEditor:!1})):(l(this,$,st).call(this),l(this,Z,ot).call(this),l(this,M,D).call(this,{isEditing:!1}))}registerEditorTypes(t){if(!c(this,_)){h(this,_,t);for(const e of c(this,_))l(this,F,I).call(this,e.defaultPropertiesToUpdate)}}getId(){return c(this,X).getId()}addLayer(t){c(this,m).set(t.pageIndex,t),c(this,A)?t.enable():t.disable()}removeLayer(t){c(this,m).delete(t.pageIndex)}updateMode(t){if(h(this,S,t),t===n.AnnotationEditorType.NONE)this.setEditingState(!1),l(this,et,ht).call(this);else{this.setEditingState(!0),l(this,tt,lt).call(this);for(const e of c(this,m).values())e.updateMode(t)}}updateToolbar(t){t!==c(this,S)&&c(this,y).dispatch("switchannotationeditormode",{source:this,mode:t})}updateParams(t,e){if(c(this,_)){for(const r of c(this,w))r.updateParams(t,e);for(const a of c(this,_))a.updateDefaultParams(t,e)}}getEditors(t){var e=[];for(const r of c(this,s).values())r.pageIndex===t&&e.push(r);return e}getEditor(t){return c(this,s).get(t)}addEditor(t){c(this,s).set(t.id,t)}removeEditor(t){c(this,s).delete(t.id),this.unselect(t)}setActiveEditor(t){c(this,i)!==t&&(h(this,i,t),t)&&l(this,F,I).call(this,t.propertiesToUpdate)}toggleSelected(t){c(this,w).has(t)?(c(this,w).delete(t),t.unselect(),l(this,M,D).call(this,{hasSelectedEditor:this.hasSelection})):(c(this,w).add(t),t.select(),l(this,F,I).call(this,t.propertiesToUpdate),l(this,M,D).call(this,{hasSelectedEditor:!0}))}setSelected(t){for(const e of c(this,w))e!==t&&e.unselect();c(this,w).clear(),c(this,w).add(t),t.select(),l(this,F,I).call(this,t.propertiesToUpdate),l(this,M,D).call(this,{hasSelectedEditor:!0})}isSelected(t){return c(this,w).has(t)}unselect(t){t.unselect(),c(this,w).delete(t),l(this,M,D).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==c(this,w).size}undo(){c(this,v).undo(),l(this,M,D).call(this,{hasSomethingToUndo:c(this,v).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:l(this,R,e).call(this)})}redo(){c(this,v).redo(),l(this,M,D).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:c(this,v).hasSomethingToRedo(),isEmpty:l(this,R,e).call(this)})}addCommands(t){c(this,v).add(t),l(this,M,D).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:l(this,R,e).call(this)})}delete(){if(this.commitOrRemove(),this.hasSelection){const e=[...c(this,w)];this.addCommands({cmd:()=>{for(const t of e)t.remove()},undo:()=>{for(const t of e)l(this,rt,ct).call(this,t)},mustExec:!0})}}commitOrRemove(){var t;null!=(t=c(this,i))&&t.commitOrRemove()}selectAll(){for(const t of c(this,w))t.commit();l(this,at,dt).call(this,c(this,s).values())}unselectAll(){if(c(this,i))c(this,i).commitOrRemove();else if(0!==c(this,w).size){for(const t of c(this,w))t.unselect();c(this,w).clear(),l(this,M,D).call(this,{hasSelectedEditor:!1})}}isActive(t){return c(this,i)===t}getActive(){return c(this,i)}getMode(){return c(this,S)}}function it(){c(this,T).addEventListener("keydown",c(this,k))}function st(){c(this,T).removeEventListener("keydown",c(this,k))}function nt(){document.addEventListener("copy",c(this,x)),document.addEventListener("cut",c(this,E)),document.addEventListener("paste",c(this,C))}function ot(){document.removeEventListener("copy",c(this,x)),document.removeEventListener("cut",c(this,E)),document.removeEventListener("paste",c(this,C))}function D(t){Object.entries(t).some(t=>{var[t,e]=t;return c(this,K)[t]!==e})&&c(this,y).dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(c(this,K),t)})}function I(t){c(this,y).dispatch("annotationeditorparamschanged",{source:this,details:t})}function lt(){if(!c(this,A)){h(this,A,!0);for(const t of c(this,m).values())t.enable()}}function ht(){if(this.unselectAll(),c(this,A)){h(this,A,!1);for(const t of c(this,m).values())t.disable()}}function ct(t){var e=c(this,m).get(t.pageIndex);e?e.addOrRebuild(t):this.addEditor(t)}function e(){if(0===c(this,s).size)return!0;if(1===c(this,s).size)for(const t of c(this,s).values())return t.isEmpty();return!1}function dt(t){c(this,w).clear();for(const e of t)e.isEmpty()||(c(this,w).add(e),e.select());l(this,M,D).call(this,{hasSelectedEditor:!0})}U(t.AnnotationEditorUIManager=O,"_keyboardManager",new g([[["ctrl+a","mac+meta+a"],O.prototype.selectAll],[["ctrl+z","mac+meta+z"],O.prototype.undo],[["ctrl+y","ctrl+shift+Z","mac+meta+shift+Z"],O.prototype.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete"],O.prototype.delete],[["Escape","mac+Escape"],O.prototype.unselectAll]]))},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StatTimer=e.RenderingCancelledException=e.PixelsPerInch=e.PageViewport=e.PDFDateString=e.DOMStandardFontDataFactory=e.DOMSVGFactory=e.DOMCanvasFactory=e.DOMCMapReaderFactory=e.AnnotationPrefix=void 0,e.deprecated=function(t){console.log("Deprecated API usage: "+t)},e.getColorValues=function(t){var e=document.createElement("span");e.style.visibility="hidden",document.body.append(e);for(const a of t.keys()){e.style.color=a;var r=window.getComputedStyle(e).color;t.set(a,v(r))}e.remove()},e.getCurrentTransform=function(t){var{a:t,b:e,c:r,d:a,e:i,f:s}=t.getTransform();return[t,e,r,a,i,s]},e.getCurrentTransformInverse=function(t){var{a:t,b:e,c:r,d:a,e:i,f:s}=t.getTransform().invertSelf();return[t,e,r,a,i,s]},e.getFilenameFromUrl=function(t){var e=t.indexOf("#"),r=t.indexOf("?"),e=Math.min(0<e?e:t.length,0<r?r:t.length);return t.substring(t.lastIndexOf("/",e)+1,e)},e.getPdfFilenameFromUrl=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"document.pdf";if("string"!=typeof t)return e;if(f(t))return(0,s.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;var r=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,t=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(t);let a=r.exec(t[1])||r.exec(t[2])||r.exec(t[3]);if(a&&(a=a[0]).includes("%"))try{a=r.exec(decodeURIComponent(a))[0]}catch(t){}return a||e},e.getRGB=v,e.getXfaPageViewport=function(t,e){var{scale:e=1,rotation:r=0}=e;var{width:t,height:a}=t.attributes.style,t=[0,0,parseInt(t),parseInt(a)];return new u({viewBox:t,scale:e,rotation:r})},e.isDataScheme=f,e.isPdfFile=function(t){return"string"==typeof t&&/\.pdf$/i.test(t)},e.isValidFetchUrl=g,e.loadScript=function(a){let i=1<arguments.length&&void 0!==arguments[1]&&arguments[1];return new Promise((e,t)=>{const r=document.createElement("script");r.src=a,r.onload=function(t){i&&r.remove(),e(t)},r.onerror=function(){t(new Error("Cannot load script at: "+r.src))},(document.head||document.documentElement).append(r)})};var a=r(138),s=r(1);function i(t,e,r){e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}e.AnnotationPrefix="pdfjs_internal_id_";class n{}i(e.PixelsPerInch=n,"CSS",96),i(n,"PDF",72),i(n,"PDF_TO_CSS_UNITS",n.CSS/n.PDF);class o extends a.BaseCanvasFactory{constructor(){var{ownerDocument:t=globalThis.document}=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};super(),this._document=t}_createCanvas(t,e){var r=this._document.createElement("canvas");return r.width=t,r.height=e,r}}async function l(a,t){let i=1<arguments.length&&void 0!==t&&t;if(g(a,document.baseURI)){t=await fetch(a);if(t.ok)return i?new Uint8Array(await t.arrayBuffer()):(0,s.stringToBytes)(await t.text());throw new Error(t.statusText)}return new Promise((e,t)=>{const r=new XMLHttpRequest;r.open("GET",a,!0),i&&(r.responseType="arraybuffer"),r.onreadystatechange=()=>{if(r.readyState===XMLHttpRequest.DONE){if(200===r.status||0===r.status){let t;if(i&&r.response?t=new Uint8Array(r.response):!i&&r.responseText&&(t=(0,s.stringToBytes)(r.responseText)),t)return void e(t)}t(new Error(r.statusText))}},r.send(null)})}e.DOMCanvasFactory=o;class h extends a.BaseCMapReaderFactory{_fetchData(t,e){return l(t,this.isCompressed).then(t=>({cMapData:t,compressionType:e}))}}e.DOMCMapReaderFactory=h;class c extends a.BaseStandardFontDataFactory{_fetchData(t){return l(t,!0)}}e.DOMStandardFontDataFactory=c;class d extends a.BaseSVGFactory{_createSVG(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}}e.DOMSVGFactory=d;class u{constructor(t){let{viewBox:e,scale:r,rotation:a,offsetX:i=0,offsetY:s=0,dontFlip:n=!1}=t;this.viewBox=e,this.scale=r,this.rotation=a,this.offsetX=i,this.offsetY=s;var t=(e[2]+e[0])/2,o=(e[3]+e[1])/2;let l,h,c,d;switch((a%=360)<0&&(a+=360),a){case 180:l=-1,h=0,c=0,d=1;break;case 90:l=0,h=1,c=1,d=0;break;case 270:l=0,h=-1,c=-1,d=0;break;case 0:l=1,h=0,c=0,d=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}n&&(c=-c,d=-d);let u,p,f,g;g=0===l?(u=Math.abs(o-e[1])*r+i,p=Math.abs(t-e[0])*r+s,f=Math.abs(e[3]-e[1])*r,Math.abs(e[2]-e[0])*r):(u=Math.abs(t-e[0])*r+i,p=Math.abs(o-e[1])*r+s,f=Math.abs(e[2]-e[0])*r,Math.abs(e[3]-e[1])*r),this.transform=[l*r,h*r,c*r,d*r,u-l*r*t-c*r*o,p-h*r*t-d*r*o],this.width=f,this.height=g}clone(){var{scale:t=this.scale,rotation:e=this.rotation,offsetX:r=this.offsetX,offsetY:a=this.offsetY,dontFlip:i=!1}=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new u({viewBox:this.viewBox.slice(),scale:t,rotation:e,offsetX:r,offsetY:a,dontFlip:i})}convertToViewportPoint(t,e){return s.Util.applyTransform([t,e],this.transform)}convertToViewportRectangle(t){var e=s.Util.applyTransform([t[0],t[1]],this.transform),t=s.Util.applyTransform([t[2],t[3]],this.transform);return[e[0],e[1],t[0],t[1]]}convertToPdfPoint(t,e){return s.Util.applyInverseTransform([t,e],this.transform)}}e.PageViewport=u;class p extends s.BaseException{constructor(t,e){super(t,"RenderingCancelledException"),this.type=e}}function f(t){var e=t.length;let r=0;for(;r<e&&""===t[r].trim();)r++;return"data:"===t.substring(r,r+5).toLowerCase()}e.RenderingCancelledException=p;function g(t,e){try{var r=(e?new URL(t,e):new URL(t))["protocol"];return"http:"===r||"https:"===r}catch(t){return!1}}e.StatTimer=class{constructor(){this.started=Object.create(null),this.times=[]}time(t){t in this.started&&(0,s.warn)("Timer is already running for "+t),this.started[t]=Date.now()}timeEnd(t){t in this.started||(0,s.warn)("Timer has not been started for "+t),this.times.push({name:t,start:this.started[t],end:Date.now()}),delete this.started[t]}toString(){var t=[];let e=0;for(const i of this.times){var r=i.name;r.length>e&&(e=r.length)}for(const s of this.times){var a=s.end-s.start;t.push(s.name.padEnd(e)+` ${a}ms
`)}return t.join("")}};let m;function v(t){var e;return t.startsWith("#")?[(16711680&(e=parseInt(t.slice(1),16)))>>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,s.warn)(`Not a valid color format: "${t}"`),[0,0,0])}e.PDFDateString=class{static toDateObject(t){if(!t||"string"!=typeof t)return null;t=(m=m||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,a=1<=(a=parseInt(t[3],10))&&a<=31?a:1;let i=parseInt(t[4],10),s=(i=0<=i&&i<=23?i:0,parseInt(t[5],10));s=0<=s&&s<=59?s: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?(i+=l,s+=t):"+"===o&&(i-=l,s-=t),new Date(Date.UTC(e,r,a,i,s,n))}}},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BaseStandardFontDataFactory=e.BaseSVGFactory=e.BaseCanvasFactory=e.BaseCMapReaderFactory=void 0;var a=r(1);e.BaseCanvasFactory=class i{constructor(){this.constructor===i&&(0,a.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,a.unreachable)("Abstract method `_createCanvas` called.")}};e.BaseCMapReaderFactory=class s{constructor(t){var{baseUrl:t=null,isCompressed:e=!1}=t;this.constructor===s&&(0,a.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.");const e=this.baseUrl+t+(this.isCompressed?".bcmap":"");return t=this.isCompressed?a.CMapCompressionType.BINARY:a.CMapCompressionType.NONE,this._fetchData(e,t).catch(t=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: `+e)})}_fetchData(t,e){(0,a.unreachable)("Abstract method `_fetchData` called.")}};e.BaseStandardFontDataFactory=class n{constructor(t){var{baseUrl:t=null}=t;this.constructor===n&&(0,a.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.");const e=""+this.baseUrl+t;return this._fetchData(e).catch(t=>{throw new Error("Unable to load font data at: "+e)})}_fetchData(t){(0,a.unreachable)("Abstract method `_fetchData` called.")}};e.BaseSVGFactory=class o{constructor(){this.constructor===o&&(0,a.unreachable)("Cannot initialize BaseSVGFactory.")}create(t,e){var r=2<arguments.length&&void 0!==arguments[2]&&arguments[2];if(t<=0||e<=0)throw new Error("Invalid SVG dimensions");var a=this._createSVG("svg:svg");return a.setAttribute("version","1.1"),r||(a.setAttribute("width",t+"px"),a.setAttribute("height",e+"px")),a.setAttribute("preserveAspectRatio","none"),a.setAttribute("viewBox",`0 0 ${t} `+e),a}createElement(t){if("string"!=typeof t)throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){(0,a.unreachable)("Abstract method `_createSVG` called.")}}},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MurmurHash3_64=void 0;var p=r(1);const a=3285377520,f=4294901760,g=65535;e.MurmurHash3_64=class{constructor(t){this.h1=t?4294967295&t:a,this.h2=t?4294967295&t:a}update(r){let a,i;if("string"==typeof r){a=new Uint8Array(2*r.length);for(let t=i=0,e=r.length;t<e;t++){var s=r.charCodeAt(t);s<=255?a[i++]=s:(a[i++]=s>>>8,a[i++]=255&s)}}else{if(!(0,p.isArrayBuffer)(r))throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");a=r.slice(),i=a.byteLength}var e=i>>2,t=i-4*e,n=new Uint32Array(a.buffer,0,e);let o=0,l,h=this.h1,c=this.h2;var d=3432918353,u=461845907;for(let t=0;t<e;t++)1&t?(o=(o=(o=(o=n[t])*d&f|11601*o&g)<<15|o>>>17)*u&f|13715*o&g,h=5*(h=(h^=o)<<13|h>>>19)+3864292196):(l=(l=(l=(l=n[t])*d&f|11601*l&g)<<15|l>>>17)*u&f|13715*l&g,c=5*(c=(c^=l)<<13|c>>>19)+3864292196);switch(o=0,t){case 3:o^=a[4*e+2]<<16;case 2:o^=a[4*e+1]<<8;case 1:o=(o=(o=(o^=a[4*e])*d&f|11601*o&g)<<15|o>>>17)*u&f|13715*o&g,1&e?h^=o:c^=o}this.h1=h,this.h2=c}hexdigest(){var t=this.h1,e=this.h2,t=(t=3981806797*(t^=e>>>1)&f|36045*t&g,t=444984403*(t^=(e=4283543511*e&f|(2950163797*(e<<16|t>>>16)&f)>>>16)>>>1)&f|60499*t&g,((t^=(e=3301882366*e&f|(3120437893*(e<<16|t>>>16)&f)>>>16)>>>1)>>>0).toString(16)),e=(e>>>0).toString(16);return t.padStart(8,"0")+e.padStart(8,"0")}}},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FontLoader=e.FontFaceObject=void 0;var m=r(1);e.FontLoader=class{constructor(t){var{onUnsupportedFeature:t,ownerDocument:e=globalThis.document}=t;this._onUnsupportedFeature=t,this._document=e,this.nativeFontFaces=[],this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(t){this.nativeFontFaces.push(t),this._document.fonts.add(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(const t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.length=0,this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async bind(e){if(!e.attached&&!e.missingFile)if(e.attached=!0,this.isFontLoadingAPISupported){var r=e.createNativeFontFace();if(r){this.addNativeFontFace(r);try{await r.loaded}catch(t){throw this._onUnsupportedFeature({featureId:m.UNSUPPORTED_FEATURES.errorFontLoadNative}),(0,m.warn)(`Failed to load font '${r.family}': '${t}'.`),e.disableFontFace=!0,t}}}else{r=e.createFontFaceRule();r&&(this.insertRule(r),this.isSyncFontLoadingSupported||await new Promise(t=>{t=this._queueLoadingCallback(t);this._prepareFontLoadEvent(e,t)}))}}get isFontLoadingAPISupported(){var t=!(null==(t=this._document)||!t.fonts);return(0,m.shadow)(this,"isFontLoadingAPISupported",t)}get isSyncFontLoadingSupported(){let t=!1;var e;return("undefined"==typeof navigator||14<=(null==(e=/Mozilla\/5.0.*?rv:(\d+).*? Gecko/.exec(navigator.userAgent))?void 0:e[1]))&&(t=!0),(0,m.shadow)(this,"isSyncFontLoadingSupported",t)}_queueLoadingCallback(t){const e=this["loadingRequests"],r={done:!1,complete:function(){for((0,m.assert)(!r.done,"completeRequest() cannot be called twice."),r.done=!0;0<e.length&&e[0].done;){var t=e.shift();setTimeout(t.callback,0)}},callback:t};return e.push(r),r}get _loadTestFont(){var t=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,m.shadow)(this,"_loadTestFont",t)}_prepareFontLoadEvent(t,e){function r(t,e){return t.charCodeAt(e)<<24|t.charCodeAt(e+1)<<16|t.charCodeAt(e+2)<<8|255&t.charCodeAt(e+3)}function a(t,e,r,a){return t.substring(0,e)+a+t.substring(e+r)}let i,s;var n=this._document.createElement("canvas");n.width=1,n.height=1;const o=n.getContext("2d");let l=0;function h(t,e){30<++l?((0,m.warn)("Load test font never loaded."),e()):(o.font="30px "+t,o.fillText(".",0,20),0<o.getImageData(0,0,1,1).data[3]?e():setTimeout(h.bind(null,t,e)))}var c="lt"+Date.now()+this.loadTestFontId++,d=1482184792;let u=r(n=a(this._loadTestFont,976,c.length,c),16);for(i=0,s=c.length-3;i<s;i+=4)u=u-d+r(c,i)|0;i<c.length&&(u=u-d+r(c+"XXX",i)|0),n=a(n,16,4,(0,m.string32)(u));n=`url(data:font/opentype;base64,${btoa(n)});`;this.insertRule(`@font-face {font-family:"${c}";src:${n}}`);const p=this._document.createElement("div");p.style.visibility="hidden",p.style.width=p.style.height="10px",p.style.position="absolute",p.style.top=p.style.left="0px";for(const g of[t.loadedName,c]){var f=this._document.createElement("span");f.textContent="Hi",f.style.fontFamily=g,p.append(f)}this._document.body.append(p),h(c,()=>{p.remove(),e.complete()})}};e.FontFaceObject=class{constructor(t,e){var{isEvalSupported:e=!0,disableFontFace:r=!1,ignoreErrors:a=!1,onUnsupportedFeature:i,fontRegistry:s=null}=e;this.compiledGlyphs=Object.create(null);for(const n in t)this[n]=t[n];this.isEvalSupported=!1!==e,this.disableFontFace=!0===r,this.ignoreErrors=!0===a,this._onUnsupportedFeature=i,this.fontRegistry=s}createNativeFontFace(){var t;if(!this.data||this.disableFontFace)return null;let e;return e=this.cssFontInfo?(t={weight:this.cssFontInfo.fontWeight},this.cssFontInfo.italicAngle&&(t.style=`oblique ${this.cssFontInfo.italicAngle}deg`),new FontFace(this.cssFontInfo.fontFamily,this.data,t)):new FontFace(this.loadedName,this.data,{}),null!=(t=this.fontRegistry)&&t.registerFont(this),e}createFontFaceRule(){var t;if(!this.data||this.disableFontFace)return null;var e=(0,m.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 null!=(t=this.fontRegistry)&&t.registerFont(this,e),r}getPathGenerator(t,e){if(void 0!==this.compiledGlyphs[e])return this.compiledGlyphs[e];let a;try{a=t.get(this.loadedName+"_path_"+e)}catch(t){if(this.ignoreErrors)return this._onUnsupportedFeature({featureId:m.UNSUPPORTED_FEATURES.errorFontGetPath}),(0,m.warn)(`getPathGenerator - ignoring character: "${t}".`),this.compiledGlyphs[e]=function(t,e){};throw t}if(this.isEvalSupported&&m.FeatureTest.isEvalSupported){var r=[];for(const s of a){var i=void 0!==s.args?s.args.join(","):"";r.push("c.",s.cmd,"(",i,");\n")}return this.compiledGlyphs[e]=new Function("c","size",r.join(""))}return this.compiledGlyphs[e]=function(t,e){for(const r of a)"scale"===r.cmd&&(r.args=[e,-e]),t[r.cmd].apply(t,r.args)}}}},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CanvasGraphics=void 0;var M=r(1),T=r(137),F=r(142),u=r(143),r=r(3);function o(t,e){var r=t;if(e.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object");e.add(t)}function c(t,e,r){if(e.has(t))return r;throw new TypeError("attempted to get private field on non-instance")}const p=4096,y=r.isNodeJS&&"undefined"==typeof Path2D?-1:1e3;class l{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,e,r){let a;return void 0!==this.cache[t]?(a=this.cache[t],this.canvasFactory.reset(a,e,r)):(a=this.canvasFactory.create(e,r),this.cache[t]=a),a}delete(t){delete this.cache[t]}clear(){for(const e in this.cache){var t=this.cache[e];this.canvasFactory.destroy(t),delete this.cache[e]}}}function v(t,e,r,a,i,s,n,o,l,h){var c,d,u,p,[f,g,m,v,b,_]=(0,T.getCurrentTransform)(t);0===g&&0===m?(c=Math.round(n*f+b),d=Math.round(o*v+_),u=Math.abs(Math.round((n+l)*f+b)-c)||1,p=Math.abs(Math.round((o+h)*v+_)-d)||1,t.setTransform(Math.sign(f),0,0,Math.sign(v),c,d),t.drawImage(e,r,a,i,s,0,0,u,p),t.setTransform(f,g,m,v,b,_)):0===f&&0===v?(c=Math.round(o*m+b),d=Math.round(n*g+_),u=Math.abs(Math.round((o+h)*m+b)-c)||1,p=Math.abs(Math.round((n+l)*g+_)-d)||1,t.setTransform(0,Math.sign(g),Math.sign(m),0,c,d),t.drawImage(e,r,a,i,s,0,0,p,u),t.setTransform(f,g,m,v,b,_)):(t.drawImage(e,r,a,i,s,n,o,l,h),Math.hypot(f,g),Math.hypot(m,v))}class d{constructor(t,e){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=M.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=M.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=M.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=null,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]=M.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=M.Util.applyTransform(e,t),e=M.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){M.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,a,i,s,n,o,l,h){e=M.Util.bezierBoundingBox(e,r,a,i,s,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(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:F.PathType.FILL,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,r=[this.minX,this.minY,this.maxX,this.maxY];return t===F.PathType.STROKE&&(e||(0,M.unreachable)("Stroke bounding box must include transform."),e=(t=M.Util.singularValueDecompose2dScale(e))[0]*this.lineWidth/2,t=t[1]*this.lineWidth/2,r[0]-=e,r[1]-=t,r[2]+=e,r[3]+=t),r}updateClipFromPath(){var t=M.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(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:F.PathType.FILL;return M.Util.intersect(this.clipBox,this.getPathBoundingBox(t,1<arguments.length&&void 0!==arguments[1]?arguments[1]:null))}}function h(c,d,u){var p=2<arguments.length&&void 0!==u?u:null;if("undefined"!=typeof ImageData&&d instanceof ImageData)c.putImageData(d,0,0);else{var u=d.height,f=d.width,g=u%16,m=(u-g)/16,v=0==g?m:1+m,b=c.createImageData(f,16);let s=0,n;var _=d.data,y=b.data;let t,e,r,a,i,o,l,h;if(p)switch(p.length){case 1:i=p[0],o=p[0],l=p[0],h=p[0];break;case 4:i=p[0],o=p[1],l=p[2],h=p[3]}if(d.kind===M.ImageKind.GRAYSCALE_1BPP){var A=_.byteLength,S=new Uint32Array(y.buffer,0,y.byteLength>>2),w=S.length,x=f+7>>3;let a=4294967295,i=M.FeatureTest.isLittleEndian?4278190080:255;for(h&&255===h[0]&&0===h[255]&&([a,i]=[i,a]),t=0;t<v;t++){for(r=t<m?16:g,n=0,e=0;e<r;e++){var E=A-s;let t=0;var C=x<E?f:8*E-7,k=-8&C;let e=0,r=0;for(;t<k;t+=8)r=_[s++],S[n++]=128&r?a:i,S[n++]=64&r?a:i,S[n++]=32&r?a:i,S[n++]=16&r?a:i,S[n++]=8&r?a:i,S[n++]=4&r?a:i,S[n++]=2&r?a:i,S[n++]=1&r?a:i;for(;t<C;t++)0===e&&(r=_[s++],e=128),S[n++]=r&e?a:i,e>>=1}for(;n<w;)S[n++]=0;c.putImageData(b,0,16*t)}}else if(d.kind===M.ImageKind.RGBA_32BPP){var P=!!(i||o||l);for(e=0,a=16*f*4,t=0;t<m;t++){if(y.set(_.subarray(s,s+a)),s+=a,P)for(let t=0;t<a;t+=4)i&&(y[t+0]=i[y[t+0]]),o&&(y[t+1]=o[y[t+1]]),l&&(y[t+2]=l[y[t+2]]);c.putImageData(b,0,e),e+=16}if(t<v){if(a=f*g*4,y.set(_.subarray(s,s+a)),P)for(let t=0;t<a;t+=4)i&&(y[t+0]=i[y[t+0]]),o&&(y[t+1]=o[y[t+1]]),l&&(y[t+2]=l[y[t+2]]);c.putImageData(b,0,e)}}else{if(d.kind!==M.ImageKind.RGB_24BPP)throw new Error("bad image kind: "+d.kind);var T=!!(i||o||l);for(r=16,a=f*r,t=0;t<v;t++){for(t>=m&&(r=g,a=f*r),n=0,e=a;e--;)y[n++]=_[s++],y[n++]=_[s++],y[n++]=_[s++],y[n++]=255;if(T)for(let t=0;t<n;t+=4)i&&(y[t+0]=i[y[t+0]]),o&&(y[t+1]=o[y[t+1]]),l&&(y[t+2]=l[y[t+2]]);c.putImageData(b,0,16*t)}}}}function b(r,t){if(t.bitmap)r.drawImage(t.bitmap,0,0);else{var a=t.height,i=t.width,s=a%16,n=(a-s)/16,o=0==s?n:1+n,l=r.createImageData(i,16);let e=0;var h=t.data,c=l.data;for(let t=0;t<o;t++){var d=t<n?16:s;({srcPos:e}=(0,u.applyMaskImageData)({src:h,srcPos:e,dest:c,width:i,height:d})),r.putImageData(l,0,16*t)}}}function f(t,e){for(const r of["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font"])void 0!==t[r]&&(e[r]=t[r]);void 0!==t.setLineDash&&(e.setLineDash(t.getLineDash()),e.lineDashOffset=t.lineDashOffset)}function g(t,e){t.strokeStyle=t.fillStyle=e||"#000000",t.fillRule="nonzero",t.globalAlpha=1,t.lineWidth=1,t.lineCap="butt",t.lineJoin="miter",t.miterLimit=10,t.globalCompositeOperation="source-over",t.font="10px sans-serif",void 0!==t.setLineDash&&(t.setLineDash([]),t.lineDashOffset=0)}function R(e,r,a){var i=e.length;for(let t=3;t<i;t+=4){var s=a?a[e[t]]:e[t];r[t]=r[t]*s*(1/255)|0}}function O(e,r,a){var i=e.length;for(let t=3;t<i;t+=4){var s=77*e[t-3]+152*e[t-2]+28*e[t-1];r[t]=a?r[t]*a[s>>8]>>8:r[t]*s>>16}}function a(t,r,a,i){var s=i[0],n=i[1],o=i[2]-s,i=i[3]-n;if(0!=o&&0!=i){{var l=r.context;var h=a;var c=o;var d=i;o=r.subtype;i=r.backdrop;var u=r.transferMap;var p=s;var f=n;var g=r.offsetX;var m=r.offsetY;var v=!!i,b=v?i[0]:0,_=v?i[1]:0,y=v?i[2]:0;let e;e="Luminosity"===o?O:R;var A=Math.min(d,Math.ceil(1048576/c));for(let t=0;t<d;t+=A){var S=Math.min(A,d-t),w=l.getImageData(p-g,t+(f-m),c,S),S=h.getImageData(p,t+f,c,S);if(v){T=M=P=k=C=E=x=void 0;var x=w.data,E=b,C=_,k=y,P=x.length;for(let t=3;t<P;t+=4){var T,M=x[t];0===M?(x[t-3]=E,x[t-2]=C,x[t-1]=k):M<255&&(T=255-M,x[t-3]=x[t-3]*M+E*T>>8,x[t-2]=x[t-2]*M+C*T>>8,x[t-1]=x[t-1]*M+k*T>>8)}}e(w.data,S.data,u),h.putImageData(S,p,t+f)}}t.save(),t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),t.drawImage(a.canvas,0,0),t.restore()}}function _(t,e){var t=M.Util.singularValueDecompose2dScale(t),r=(t[0]=Math.fround(t[0]),t[1]=Math.fround(t[1]),Math.fround((globalThis.devicePixelRatio||1)*T.PixelsPerInch.PDF_TO_CSS_UNITS));return void 0!==e?e:t[0]<=r||t[1]<=r}const i=["butt","round","square"],s=["miter","round","bevel"],n={},m={};var A=new WeakSet;class S{constructor(t,e,r,a,i,s,n){o(this,A),this.ctx=t,this.current=new d(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=a,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=[],this.optionalContentConfig=i,this.cachedCanvases=new l(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=s,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.backgroundColor=(null==n?void 0:n.background)||null,this.foregroundColor=(null==n?void 0:n.foreground)||null,this._cachedScaleForStroking=null,this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;return"string"==typeof t?(t.startsWith("g_")?this.commonObjs:this.objs).get(t):e}beginDrawing(t){var{transform:t,viewport:e,transparency:r=!1,background:a=null}=t,i=this.ctx.canvas.width,s=this.ctx.canvas.height,a=a||"#ffffff";if(this.ctx.save(),this.foregroundColor&&this.backgroundColor){this.ctx.fillStyle=this.foregroundColor;const h=this.foregroundColor=this.ctx.fillStyle,c=(this.ctx.fillStyle=this.backgroundColor,this.backgroundColor=this.ctx.fillStyle);if(this.ctx.fillStyle=a,n="string"==typeof(o=this.ctx.fillStyle)&&/^#[0-9A-Fa-f]{6}$/.test(o),"#000000"===h&&"#ffffff"===c||h===c||!n)this.foregroundColor=this.backgroundColor=null;else{var[n,o,l]=(0,T.getRGB)(o);const d=t=>(t/=255)<=.03928?t/12.92:((t+.055)/1.055)**2.4,u=Math.round(.2126*d(n)+.7152*d(o)+.0722*d(l));this.selectColor=(t,e,r)=>{t=.2126*d(t)+.7152*d(e)+.0722*d(r);return Math.round(t)===u?c:h}}}this.ctx.fillStyle=this.backgroundColor||a,this.ctx.fillRect(0,0,i,s),this.ctx.restore(),r&&(n=this.cachedCanvases.getCanvas("transparent",i,s),this.compositeCtx=this.ctx,this.transparentCanvas=n.canvas,this.ctx=n.context,this.ctx.save(),this.ctx.transform(...(0,T.getCurrentTransform)(this.compositeCtx))),this.ctx.save(),g(this.ctx,this.foregroundColor),t&&(this.ctx.transform(...t),this.outputScaleX=t[0],this.outputScaleY=t[0]),this.ctx.transform(...e.transform),this.viewportScale=e.scale,this.baseTransform=(0,T.getCurrentTransform)(this.ctx)}executeOperatorList(t,e,r,a){var i=t.argsArray,s=t.fnArray;let n=e||0;var o=i.length;if(o===n)return n;var l=10<o-n&&"function"==typeof r,h=l?Date.now()+15:0;let c=0;for(var d,u=this.commonObjs,p=this.objs;;){if(void 0!==a&&n===a.nextBreakPoint)return a.breakIt(n,r),n;if((d=s[n])!==M.OPS.dependency)this[d].apply(this,i[n]);else for(const g of i[n]){var f=g.startsWith("g_")?u:p;if(!f.has(g))return f.get(g,r),n}if(++n===o)return n;if(l&&10<++c){if(Date.now()>h)return r(),n;c=0}}}endDrawing(){c(this,A,w).call(this),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()}_scaleImage(r,t){var a,i,e=r.width,s=r.height;let n=Math.max(Math.hypot(t[0],t[1]),1),o=Math.max(Math.hypot(t[2],t[3]),1),l=e,h=s,c="prescale1";for(;2<n&&1<l||2<o&&1<h;){let t=l,e=h;2<n&&1<l&&(t=Math.ceil(l/2),n/=l/t),2<o&&1<h&&(e=Math.ceil(h/2),o/=h/e),(i=(a=this.cachedCanvases.getCanvas(c,t,e)).context).clearRect(0,0,t,e),i.drawImage(r,0,0,l,h,0,0,t,e),r=a.canvas,l=t,h=e,c="prescale1"===c?"prescale2":"prescale1"}return{img:r,paintWidth:l,paintHeight:h}}_createMaskCanvas(t){var e=this.ctx,{width:r,height:a}=t,i=this.current.fillColor,s=this.current.patternFill,n=(0,T.getCurrentTransform)(e);let o,l,h,c;if((t.bitmap||t.data)&&1<t.count){var d=t.bitmap||t.data.buffer,d=(l=JSON.stringify(s?n:[n.slice(0,4),i]),(o=this._cachedBitmapsMap.get(d))||(o=new Map,this._cachedBitmapsMap.set(d,o)),o.get(l));if(d&&!s){const g=Math.round(Math.min(n[0],n[2])+n[4]),m=Math.round(Math.min(n[1],n[3])+n[5]);return{canvas:d,offsetX:g,offsetY:m}}h=d}h||b((c=this.cachedCanvases.getCanvas("maskCanvas",r,a)).context,t);var d=M.Util.transform(n,[1/r,0,0,-1/a,0,0]),d=M.Util.transform(d,[1,0,0,1,0,-a]),n=M.Util.applyTransform([0,0],d),u=M.Util.applyTransform([r,a],d),p=M.Util.normalizeRect([n[0],n[1],u[0],u[1]]),f=Math.round(p[2]-p[0])||1,p=Math.round(p[3]-p[1])||1,f=this.cachedCanvases.getCanvas("fillCanvas",f,p),p=f.context;const g=Math.min(n[0],u[0]),m=Math.min(n[1],u[1]);p.translate(-g,-m),p.transform(...d),h||(h=(h=this._scaleImage(c.canvas,(0,T.getCurrentTransformInverse)(p))).img,o&&s&&o.set(l,h)),p.imageSmoothingEnabled=_((0,T.getCurrentTransform)(p),t.interpolate),v(p,h,0,0,h.width,h.height,0,0,r,a),p.globalCompositeOperation="source-in";n=M.Util.transform((0,T.getCurrentTransformInverse)(p),[1,0,0,1,-g,-m]);return p.fillStyle=s?i.getPattern(e,this,n,F.PathType.FILL):i,p.fillRect(0,0,r,a),o&&!s&&(this.cachedCanvases.delete("fillCanvas"),o.set(l,f.canvas)),{canvas:f.canvas,offsetX:Math.round(g),offsetY:Math.round(m)}}setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking=null),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(t){this.ctx.lineCap=i[t]}setLineJoin(t){this.ctx.lineJoin=s[t]}setMiterLimit(t){this.ctx.miterLimit=t}setDash(t,e){var r=this.ctx;void 0!==r.setLineDash&&(r.setLineDash(t),r.lineDashOffset=e)}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(var[e,r]of t)switch(e){case"LW":this.setLineWidth(r);break;case"LC":this.setLineCap(r);break;case"LJ":this.setLineJoin(r);break;case"ML":this.setMiterLimit(r);break;case"D":this.setDash(r[0],r[1]);break;case"RI":this.setRenderingIntent(r);break;case"FL":this.setFlatness(r);break;case"Font":this.setFont(r[0],r[1]);break;case"CA":this.current.strokeAlpha=r;break;case"ca":this.current.fillAlpha=r,this.ctx.globalAlpha=r;break;case"BM":this.ctx.globalCompositeOperation=r;break;case"SMask":this.current.activeSMask=r?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.current.transferMaps=r}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){var 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");var t=this.ctx.canvas.width,e=this.ctx.canvas.height,r="smaskGroupAt"+this.groupLevel,r=this.cachedCanvases.getCanvas(r,t,e),t=(this.suspendedCtx=this.ctx,this.ctx=r.context,this.ctx),a=(t.setTransform(...(0,T.getCurrentTransform)(this.suspendedCtx)),f(this.suspendedCtx,t),t),n=this.suspendedCtx;if(a._removeMirroring)throw new Error("Context is already forwarding operations.");a.__originalSave=a.save,a.__originalRestore=a.restore,a.__originalRotate=a.rotate,a.__originalScale=a.scale,a.__originalTranslate=a.translate,a.__originalTransform=a.transform,a.__originalSetTransform=a.setTransform,a.__originalResetTransform=a.resetTransform,a.__originalClip=a.clip,a.__originalMoveTo=a.moveTo,a.__originalLineTo=a.lineTo,a.__originalBezierCurveTo=a.bezierCurveTo,a.__originalRect=a.rect,a.__originalClosePath=a.closePath,a.__originalBeginPath=a.beginPath,a._removeMirroring=()=>{a.save=a.__originalSave,a.restore=a.__originalRestore,a.rotate=a.__originalRotate,a.scale=a.__originalScale,a.translate=a.__originalTranslate,a.transform=a.__originalTransform,a.setTransform=a.__originalSetTransform,a.resetTransform=a.__originalResetTransform,a.clip=a.__originalClip,a.moveTo=a.__originalMoveTo,a.lineTo=a.__originalLineTo,a.bezierCurveTo=a.__originalBezierCurveTo,a.rect=a.__originalRect,a.closePath=a.__originalClosePath,a.beginPath=a.__originalBeginPath,delete a._removeMirroring},a.save=function(){n.save(),this.__originalSave()},a.restore=function(){n.restore(),this.__originalRestore()},a.translate=function(t,e){n.translate(t,e),this.__originalTranslate(t,e)},a.scale=function(t,e){n.scale(t,e),this.__originalScale(t,e)},a.transform=function(t,e,r,a,i,s){n.transform(t,e,r,a,i,s),this.__originalTransform(t,e,r,a,i,s)},a.setTransform=function(t,e,r,a,i,s){n.setTransform(t,e,r,a,i,s),this.__originalSetTransform(t,e,r,a,i,s)},a.resetTransform=function(){n.resetTransform(),this.__originalResetTransform()},a.rotate=function(t){n.rotate(t),this.__originalRotate(t)},a.clip=function(t){n.clip(t),this.__originalClip(t)},a.moveTo=function(t,e){n.moveTo(t,e),this.__originalMoveTo(t,e)},a.lineTo=function(t,e){n.lineTo(t,e),this.__originalLineTo(t,e)},a.bezierCurveTo=function(t,e,r,a,i,s){n.bezierCurveTo(t,e,r,a,i,s),this.__originalBezierCurveTo(t,e,r,a,i,s)},a.rect=function(t,e,r,a){n.rect(t,e,r,a),this.__originalRect(t,e,r,a)},a.closePath=function(){n.closePath(),this.__originalClosePath()},a.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){var e;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],e=this.current.activeSMask,a(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(){(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=null,this._cachedGetSinglePixelWidth=null)}transform(t,e,r,a,i,s){this.ctx.transform(t,e,r,a,i,s),this._cachedScaleForStroking=null,this._cachedGetSinglePixelWidth=null}constructPath(a,i,t){var s=this.ctx,n=this.current;let o=n.x,l=n.y,h,c;var d=(0,T.getCurrentTransform)(s),u=0===d[0]&&0===d[3]||0===d[1]&&0===d[2],p=u?t.slice(0):null;for(let t=0,e=0,r=a.length;t<r;t++)switch(0|a[t]){case M.OPS.rectangle:o=i[e++],l=i[e++];var f=i[e++],g=i[e++],m=o+f,v=l+g;s.moveTo(o,l),0===f||0===g?s.lineTo(m,v):(s.lineTo(m,l),s.lineTo(m,v),s.lineTo(o,v)),u||n.updateRectMinMax(d,[o,l,m,v]),s.closePath();break;case M.OPS.moveTo:o=i[e++],l=i[e++],s.moveTo(o,l),u||n.updatePathMinMax(d,o,l);break;case M.OPS.lineTo:o=i[e++],l=i[e++],s.lineTo(o,l),u||n.updatePathMinMax(d,o,l);break;case M.OPS.curveTo:h=o,c=l,o=i[e+4],l=i[e+5],s.bezierCurveTo(i[e],i[e+1],i[e+2],i[e+3],o,l),n.updateCurvePathMinMax(d,h,c,i[e],i[e+1],i[e+2],i[e+3],o,l,p),e+=6;break;case M.OPS.curveTo2:h=o,c=l,s.bezierCurveTo(o,l,i[e],i[e+1],i[e+2],i[e+3]),n.updateCurvePathMinMax(d,h,c,o,l,i[e],i[e+1],i[e+2],i[e+3],p),o=i[e+2],l=i[e+3],e+=4;break;case M.OPS.curveTo3:h=o,c=l,o=i[e+2],l=i[e+3],s.bezierCurveTo(i[e],i[e+1],o,l,o,l),n.updateCurvePathMinMax(d,h,c,i[e],i[e+1],o,l,o,l,p),e+=4;break;case M.OPS.closePath:s.closePath()}u&&n.updateScalingPathMinMax(d,p),n.setCurrentPoint(o,l)}closePath(){this.ctx.closePath()}stroke(t){t=void 0===t||t;var e=this.ctx,r=this.current.strokeColor;e.globalAlpha=this.current.strokeAlpha,this.contentVisible&&("object"==typeof r&&null!=r&&r.getPattern?(e.save(),e.strokeStyle=r.getPattern(e,this,(0,T.getCurrentTransformInverse)(e),F.PathType.STROKE),this.rescaleAndStroke(!1),e.restore()):this.rescaleAndStroke(!0)),t&&this.consumePath(this.current.getClippedPathBoundingBox()),e.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(t){t=void 0===t||t;var e=this.ctx,r=this.current.fillColor;let a=!1;this.current.patternFill&&(e.save(),e.fillStyle=r.getPattern(e,this,(0,T.getCurrentTransformInverse)(e),F.PathType.FILL),a=!0);r=this.current.getClippedPathBoundingBox();this.contentVisible&&null!==r&&(this.pendingEOFill?(e.fill("evenodd"),this.pendingEOFill=!1):e.fill()),a&&e.restore(),t&&this.consumePath(r)}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=n}eoClip(){this.pendingClip=m}beginText(){this.current.textMatrix=M.IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){var t=this.pendingTextPaths,e=this.ctx;if(void 0===t)e.beginPath();else{e.save(),e.beginPath();for(const r of t)e.setTransform(...r.transform),e.translate(r.x,r.y),r.addToPath(e,r.fontSize);e.restore(),e.clip(),e.beginPath(),delete this.pendingTextPaths}}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(r,a){var i=this.commonObjs.get(r),s=this.current;if(!i)throw new Error("Can't find font for "+r);if(s.fontMatrix=i.fontMatrix||M.FONT_IDENTITY_MATRIX,0!==s.fontMatrix[0]&&0!==s.fontMatrix[3]||(0,M.warn)("Invalid font matrix for font "+r),a<0?(a=-a,s.fontDirection=-1):s.fontDirection=1,this.current.font=i,this.current.fontSize=a,!i.isType3Font){r=i.loadedName||"sans-serif";let t="normal";i.black?t="900":i.bold&&(t="bold");s=i.italic?"italic":"normal",r=`"${r}", `+i.fallbackName;let e=a;a<16?e=16:100<a&&(e=100),this.current.fontSizeScale=a/e,this.ctx.font=s+` ${t} ${e}px `+r}}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,r,a,i,s){this.current.textMatrix=[t,e,r,a,i,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,r,a){var i=this.ctx,s=this.current,n=s.font,o=s.textRenderingMode,l=s.fontSize/s.fontSizeScale,h=o&M.TextRenderingMode.FILL_STROKE_MASK,o=!!(o&M.TextRenderingMode.ADD_TO_PATH_FLAG),s=s.patternFill&&!n.missingFile;let c;(n.disableFontFace||o||s)&&(c=n.getPathGenerator(this.commonObjs,t)),n.disableFontFace||s?(i.save(),i.translate(e,r),i.beginPath(),c(i,l),a&&i.setTransform(...a),h!==M.TextRenderingMode.FILL&&h!==M.TextRenderingMode.FILL_STROKE||i.fill(),h!==M.TextRenderingMode.STROKE&&h!==M.TextRenderingMode.FILL_STROKE||i.stroke(),i.restore()):(h!==M.TextRenderingMode.FILL&&h!==M.TextRenderingMode.FILL_STROKE||i.fillText(t,e,r),h!==M.TextRenderingMode.STROKE&&h!==M.TextRenderingMode.FILL_STROKE||i.strokeText(t,e,r)),o&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:(0,T.getCurrentTransform)(i),x:e,y:r,fontSize:l,addToPath:c})}get isFontSubpixelAAEnabled(){var t=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10)["context"],e=(t.scale(1.5,1),t.fillText("I",0,10),t.getImageData(0,0,10,10).data);let r=!1;for(let t=3;t<e.length;t+=4)if(0<e[t]&&e[t]<255){r=!0;break}return(0,M.shadow)(this,"isFontSubpixelAAEnabled",r)}showText(r){var a=this.current,o=a.font;if(o.isType3Font)return this.showType3Text(r);var l=a.fontSize;if(0!==l){var h=this.ctx,c=a.fontSizeScale,d=a.charSpacing,u=a.wordSpacing,p=a.fontDirection,i=a.textHScale*p,f=r.length,g=o.vertical,m=g?1:-1,v=o.defaultVMetrics,b=l*a.fontMatrix[0],_=a.textRenderingMode===M.TextRenderingMode.FILL&&!o.disableFontFace&&!a.patternFill;h.save(),h.transform(...a.textMatrix),h.translate(a.x,a.y+a.textRise),0<p?h.scale(i,-1):h.scale(i,1);let s,t=(a.patternFill&&(h.save(),A=a.fillColor.getPattern(h,this,(0,T.getCurrentTransformInverse)(h),F.PathType.FILL),s=(0,T.getCurrentTransform)(h),h.restore(),h.fillStyle=A),a.lineWidth);var y,A=a.textMatrixScale;0===A||0===t?(y=a.textRenderingMode&M.TextRenderingMode.FILL_STROKE_MASK)!==M.TextRenderingMode.STROKE&&y!==M.TextRenderingMode.FILL_STROKE||(t=this.getSinglePixelWidth()):t/=A,1!==c&&(h.scale(c,c),t/=c),h.lineWidth=t;let n=0,e;for(e=0;e<f;++e){var S=r[e];if("number"==typeof S)n+=m*S*l/1e3;else{let t=!1;var w,x,E,C=(S.isSpace?u:0)+d,k=S.fontChar,P=S.accent;let e,r,a=S.width;r=g?(w=S.vmetric||v,x=-(S.vmetric?w[1]:.5*a)*b,E=w[2]*b,a=w?-w[0]:a,e=x/c,(n+E)/c):(e=n/c,0),o.remeasure&&0<a&&(w=1e3*h.measureText(k).width/l*c,a<w&&this.isFontSubpixelAAEnabled?(x=a/w,t=!0,h.save(),h.scale(x,1),e/=x):a!==w&&(e+=(a-w)/2e3*l/c)),this.contentVisible&&(S.isInFont||o.missingFile)&&(_&&!P?h.fillText(k,e,r):(this.paintChar(k,e,r,s),P&&(E=e+l*P.offset.x/c,S=r-l*P.offset.y/c,this.paintChar(P.fontChar,E,S,s))));let i;i=g?a*b-C*p:a*b+C*p,n+=i,t&&h.restore()}}g?a.y-=n:a.x+=n*i,h.restore(),this.compose()}}showType3Text(t){var e,r,a=this.ctx,i=this.current,s=i.font,n=i.fontSize,o=i.fontDirection,l=s.vertical?1:-1,h=i.charSpacing,c=i.wordSpacing,d=i.textHScale*o,u=i.fontMatrix||M.FONT_IDENTITY_MATRIX,p=t.length,f=i.textRenderingMode===M.TextRenderingMode.INVISIBLE;let g,m,v,b;if(!f&&0!==n){for(this._cachedScaleForStroking=null,this._cachedGetSinglePixelWidth=null,a.save(),a.transform(...i.textMatrix),a.translate(i.x,i.y),a.scale(d,o),g=0;g<p;++g)"number"==typeof(m=t[g])?(this.ctx.translate(b=l*m*n/1e3,0),i.x+=b*d):(e=(m.isSpace?c:0)+h,(r=s.charProcOperatorList[m.operatorListId])?(this.contentVisible&&(this.processingType3=m,this.save(),a.scale(n,n),a.transform(...u),this.executeOperatorList(r),this.restore()),v=M.Util.applyTransform([m.width,0],u)[0]*n+e,a.translate(v,0),i.x+=v*d):(0,M.warn)(`Type3 character "${m.operatorListId}" is not available.`));a.restore(),this.processingType3=null}}setCharWidth(t,e){}setCharWidthAndBounds(t,e,r,a,i,s){this.ctx.rect(r,a,i-r,s-a),this.ctx.clip(),this.endPath()}getColorN_Pattern(t){let e;var r,a;return e="TilingPattern"===t[0]?(r=t[1],a=this.baseTransform||(0,T.getCurrentTransform)(this.ctx),new F.TilingPattern(t,r,this.ctx,{createCanvasGraphics:t=>new S(t,this.commonObjs,this.objs,this.canvasFactory)},a)):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){var a=(null==(a=this.selectColor)?void 0:a.call(this,t,e,r))||M.Util.makeHexColor(t,e,r);this.ctx.strokeStyle=a,this.current.strokeColor=a}setFillRGBColor(t,e,r){var a=(null==(a=this.selectColor)?void 0:a.call(this,t,e,r))||M.Util.makeHexColor(t,e,r);this.ctx.fillStyle=a,this.current.fillColor=a,this.current.patternFill=!1}_getPattern(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;let r;return this.cachedPatterns.has(t)?r=this.cachedPatterns.get(t):(r=(0,F.getShadingPattern)(this.objs.get(t)),this.cachedPatterns.set(t,r)),e&&(r.matrix=e),r}shadingFill(t){var e,r,a,i,s,n;this.contentVisible&&(i=this.ctx,this.save(),t=this._getPattern(t),i.fillStyle=t.getPattern(i,this,(0,T.getCurrentTransformInverse)(i),F.PathType.SHADING),(t=(0,T.getCurrentTransformInverse)(i))?(a=(i=i.canvas).width,i=i.height,n=M.Util.applyTransform([0,0],t),e=M.Util.applyTransform([0,i],t),r=M.Util.applyTransform([a,0],t),a=M.Util.applyTransform([a,i],t),i=Math.min(n[0],e[0],r[0],a[0]),t=Math.min(n[1],e[1],r[1],a[1]),s=Math.max(n[0],e[0],r[0],a[0]),n=Math.max(n[1],e[1],r[1],a[1]),this.ctx.fillRect(i,t,s-i,n-t)):this.ctx.fillRect(-1e10,-1e10,2e10,2e10),this.compose(this.current.getClippedPathBoundingBox()),this.restore())}beginInlineImage(){(0,M.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,M.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(t,e){var r;this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(t)&&6===t.length&&this.transform(...t),this.baseTransform=(0,T.getCurrentTransform)(this.ctx),e)&&(t=e[2]-e[0],r=e[3]-e[1],this.ctx.rect(e[0],e[1],t,r),this.current.updateRectMinMax((0,T.getCurrentTransform)(this.ctx),e),this.clip(),this.endPath())}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(s){if(this.contentVisible){this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);var n=this.ctx,o=(s.isolated||(0,M.info)("TODO: Support non-isolated groups."),s.knockout&&(0,M.warn)("Knockout groups not supported."),(0,T.getCurrentTransform)(n));if(s.matrix&&n.transform(...s.matrix),!s.bbox)throw new Error("Bounding box is required.");var l=M.Util.getAxialAlignedBoundingBox(s.bbox,(0,T.getCurrentTransform)(n)),h=[0,0,n.canvas.width,n.canvas.height],l=M.Util.intersect(l,h)||[0,0,0,0],h=Math.floor(l[0]),c=Math.floor(l[1]);let t=Math.max(Math.ceil(l[2])-h,1),e=Math.max(Math.ceil(l[3])-c,1),r=1,a=1,i=(t>p&&(r=t/p,t=p),e>p&&(a=e/p,e=p),this.current.startNewPathAndClipBox([0,0,t,e]),"groupAt"+this.groupLevel);s.smask&&(i+="_smask_"+this.smaskCounter++%2);var l=this.cachedCanvases.getCanvas(i,t,e),d=l.context;d.scale(1/r,1/a),d.translate(-h,-c),d.transform(...o),s.smask?this.smaskStack.push({canvas:l.canvas,context:d,offsetX:h,offsetY:c,scaleX:r,scaleY:a,subtype:s.smask.subtype,backdrop:s.smask.backdrop,transferMap:s.smask.transferMap||null,startTransformInverse:null}):(n.setTransform(1,0,0,1,0,0),n.translate(h,c),n.scale(r,a),n.save()),f(n,d),this.ctx=d,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(n),this.groupLevel++}}endGroup(t){var e,r;this.contentVisible&&(this.groupLevel--,e=this.ctx,r=this.groupStack.pop(),this.ctx=r,this.ctx.imageSmoothingEnabled=!1,t.smask?(this.tempSMask=this.smaskStack.pop(),this.restore()):(this.ctx.restore(),r=(0,T.getCurrentTransform)(this.ctx),this.restore(),this.ctx.save(),this.ctx.setTransform(...r),t=M.Util.getAxialAlignedBoundingBox([0,0,e.canvas.width,e.canvas.height],r),this.ctx.drawImage(e.canvas,0,0),this.ctx.restore(),this.compose(t)))}beginAnnotation(t,e,r,a,i){var s,n,o,l,h;c(this,A,w).call(this),g(this.ctx,this.foregroundColor),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),Array.isArray(e)&&4===e.length&&(s=e[2]-e[0],n=e[3]-e[1],i&&this.annotationCanvasMap?((r=r.slice())[4]-=e[0],r[5]-=e[1],(e=e.slice())[0]=e[1]=0,e[2]=s,e[3]=n,[i,o]=M.Util.singularValueDecompose2dScale((0,T.getCurrentTransform)(this.ctx)),h=this["viewportScale"],l=Math.ceil(s*this.outputScaleX*h),h=Math.ceil(n*this.outputScaleY*h),{canvas:l,context:h}=(this.annotationCanvas=this.canvasFactory.create(l,h),this.annotationCanvas),this.annotationCanvasMap.set(t,l),this.annotationCanvas.savedCtx=this.ctx,this.ctx=h,this.ctx.setTransform(i,0,0,-o,0,n*o),g(this.ctx,this.foregroundColor)):(g(this.ctx,this.foregroundColor),this.ctx.rect(e[0],e[1],s,n),this.ctx.clip(),this.endPath())),this.current=new d(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...r),this.transform(...a)}endAnnotation(){this.annotationCanvas&&(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=function(t){const{width:r,height:e}=t;if(r>y||e>y)return null;var a=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),i=r+1;let s=new Uint8Array(i*(e+1)),n,o,l;var h=r+7&-8;let c=new Uint8Array(h*e),d=0;for(const _ of t.data){let t=128;for(;0<t;)c[d++]=_&t?0:255,t>>=1}let u=0;for((d=0)!==c[d]&&(s[0]=1,++u),o=1;o<r;o++)c[d]!==c[d+1]&&(s[o]=c[d]?2:1,++u),d++;for(0!==c[d]&&(s[o]=2,++u),n=1;n<e;n++){d=n*h,l=n*i,c[d-h]!==c[d]&&(s[l]=c[d]?1:8,++u);let t=(c[d]?4:0)+(c[d-h]?8:0);for(o=1;o<r;o++)a[t=(t>>2)+(c[d+1]?4:0)+(c[d-h+1]?8:0)]&&(s[l+o]=a[t],++u),d++;if(c[d-h]!==c[d]&&(s[l+o]=c[d]?2:4,++u),1e3<u)return null}for(d=h*(e-1),l=n*i,0!==c[d]&&(s[l]=8,++u),o=1;o<r;o++)c[d]!==c[d+1]&&(s[l+o]=c[d]?4:8,++u),d++;if(0!==c[d]&&(s[l+o]=4,++u),1e3<u)return null;var p=new Int32Array([0,i,-1,0,-i,0,0,0,1]);const f=new Path2D;for(n=0;u&&n<=e;n++){let e=n*i;for(var g=e+r;e<g&&!s[e];)e++;if(e!==g){f.moveTo(e%i,n);var m=e;let t=s[e];do{for(var v=p[t];e+=v,!s[e];);var b=s[e];5!==b&&10!==b?(t=b,s[e]=0):(t=b&51*t>>4,s[e]&=t>>2|t<<2),f.lineTo(e%i,e/i|0),s[e]||--u}while(m!==e);--n}}return c=null,s=null,function(t){t.save(),t.scale(1/r,-1/e),t.translate(0,-e),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,r){var a=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0,i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:0,s=4<arguments.length?arguments[4]:void 0,n=5<arguments.length?arguments[5]:void 0;if(this.contentVisible){t=this.getObject(t.data,t);var o=this.ctx,l=(o.save(),(0,T.getCurrentTransform)(o)),h=(o.transform(r,a,i,s,0,0),this._createMaskCanvas(t));o.setTransform(1,0,0,1,0,0);for(let t=0,e=n.length;t<e;t+=2){var c=M.Util.transform(l,[r,a,i,s,n[t],n[t+1]]),[c,d]=M.Util.applyTransform([0,0],c);o.drawImage(h.canvas,c,d)}o.restore(),this.compose()}}paintImageMaskXObjectGroup(t){if(this.contentVisible){var e=this.ctx,r=this.current.fillColor,a=this.current.patternFill;for(const c of t){var{data:i,width:s,height:n,transform:o}=c,l=this.cachedCanvases.getCanvas("maskCanvas",s,n),h=l.context,i=(h.save(),this.getObject(i,c));b(h,i),h.globalCompositeOperation="source-in",h.fillStyle=a?r.getPattern(h,this,(0,T.getCurrentTransformInverse)(e),F.PathType.FILL):r,h.fillRect(0,0,s,n),h.restore(),e.save(),e.transform(...o),e.scale(1,-1),v(e,l.canvas,0,0,s,n,0,-1,1,1),e.restore()}this.compose()}}paintImageXObject(t){this.contentVisible&&((t=this.getObject(t))?this.paintInlineImageXObject(t):(0,M.warn)("Dependent image isn't ready yet"))}paintImageXObjectRepeat(t,r,a,i){if(this.contentVisible){t=this.getObject(t);if(t){var s=t.width,n=t.height,o=[];for(let t=0,e=i.length;t<e;t+=2)o.push({transform:[r,0,0,a,i[t],i[t+1]],x:0,y:0,w:s,h:n});this.paintInlineImageXObjectGroup(t,o)}else(0,M.warn)("Dependent image isn't ready yet")}}paintInlineImageXObject(e){if(this.contentVisible){var r=e.width,a=e.height,i=this.ctx;this.save(),i.scale(1/r,-1/a);let t;t="function"==typeof HTMLElement&&e instanceof HTMLElement||!e.data?e:(h((s=this.cachedCanvases.getCanvas("inlineImage",r,a)).context,e,this.current.transferMaps),s.canvas);var s=this._scaleImage(t,(0,T.getCurrentTransformInverse)(i));i.imageSmoothingEnabled=_((0,T.getCurrentTransform)(i),e.interpolate),v(i,s.img,0,0,s.paintWidth,s.paintHeight,0,-a,r,a),this.compose(),this.restore()}}paintInlineImageXObjectGroup(t,e){if(this.contentVisible){var r=this.ctx,a=t.width,i=t.height,s=this.cachedCanvases.getCanvas("inlineImage",a,i);h(s.context,t,this.current.transferMaps);for(const n of e)r.save(),r.transform(...n.transform),r.scale(1,-1),v(r,s.canvas,n.x,n.y,n.w,n.h,0,-1,1,1),r.restore();this.compose()}}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t){}markPointProps(t,e){}beginMarkedContent(t){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,e){"OC"===t?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(e)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(t){var e=this.current.isEmptyClip(),t=(this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(t),this.ctx);this.pendingClip&&(e||(this.pendingClip===m?t.clip("evenodd"):t.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),t.beginPath()}getSinglePixelWidth(){var t,e,r;return this._cachedGetSinglePixelWidth||(0===(r=(0,T.getCurrentTransform)(this.ctx))[1]&&0===r[2]?this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(r[0]),Math.abs(r[3])):(t=Math.abs(r[0]*r[3]-r[2]*r[1]),e=Math.hypot(r[0],r[2]),r=Math.hypot(r[1],r[3]),this._cachedGetSinglePixelWidth=Math.max(e,r)/t)),this._cachedGetSinglePixelWidth}getScaleForStroking(){if(!this._cachedScaleForStroking){var r,a,i=this.current["lineWidth"],s=(0,T.getCurrentTransform)(this.ctx);let t,e;e=0===s[1]&&0===s[2]?(r=Math.abs(s[0]),a=Math.abs(s[3]),0===i?(t=1/r,1/a):(r=r*i,a=a*i,t=r<1?1/r:1,a<1?1/a:1)):(r=Math.abs(s[0]*s[3]-s[2]*s[1]),a=Math.hypot(s[0],s[1]),s=Math.hypot(s[2],s[3]),0===i?(t=s/r,a/r):(i=i*r,t=i<s?s/i:1,i<a?a/i:1)),this._cachedScaleForStroking=[t,e]}return this._cachedScaleForStroking}rescaleAndStroke(a){var i=this["ctx"],t=this.current["lineWidth"],[s,n]=this.getScaleForStroking();if(i.lineWidth=t||1,1===s&&1===n)i.stroke();else{let t,e,r;a&&(t=(0,T.getCurrentTransform)(i),e=i.getLineDash().slice(),r=i.lineDashOffset),i.scale(s,n);const o=Math.max(s,n);i.setLineDash(i.getLineDash().map(t=>t/o)),i.lineDashOffset/=o,i.stroke(),a&&(i.setTransform(...t),i.setLineDash(e),i.lineDashOffset=r)}}isContentVisible(){for(let t=this.markedContentStack.length-1;0<=t;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}function w(){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)}e.CanvasGraphics=S;for(const x in M.OPS)void 0!==S.prototype[x]&&(S.prototype[M.OPS[x]]=S.prototype[x])},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TilingPattern=e.PathType=void 0,e.getShadingPattern=function(t){switch(t[0]){case"RadialAxial":return new i(t);case"Mesh":return new n(t);case"Dummy":return new h}throw new Error("Unknown IR type: "+t[0])};var v=r(1),b=r(137),s=r(3);const o={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function l(t,e){var r,a,i;e&&!s.isNodeJS&&(r=e[2]-e[0],a=e[3]-e[1],(i=new Path2D).rect(e[0],e[1],r,a),t.clip(i))}e.PathType=o;class a{constructor(){this.constructor===a&&(0,v.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,v.unreachable)("Abstract method `getPattern` called.")}}class i extends a{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 r of this._colorStops)e.addColorStop(r[0],r[1]);return e}getPattern(t,e,r,a){let i;var s,n;return a===o.STROKE||a===o.FILL?(a=e.current.getClippedPathBoundingBox(a,(0,b.getCurrentTransform)(t))||[0,0,0,0],s=Math.ceil(a[2]-a[0])||1,n=Math.ceil(a[3]-a[1])||1,(n=(s=e.cachedCanvases.getCanvas("pattern",s,n,!0)).context).clearRect(0,0,n.canvas.width,n.canvas.height),n.beginPath(),n.rect(0,0,n.canvas.width,n.canvas.height),n.translate(-a[0],-a[1]),r=v.Util.transform(r,[1,0,0,1,a[0],a[1]]),n.transform(...e.baseTransform),this.matrix&&n.transform(...this.matrix),l(n,this._bbox),n.fillStyle=this._createGradient(n),n.fill(),i=t.createPattern(s.canvas,"no-repeat"),a=new DOMMatrix(r),i.setTransform(a)):(l(t,this._bbox),i=this._createGradient(t)),i}}function A(t,e,r,a,i,l,h,c){var s=e.coords,d=e.colors,u=t.data,p=4*t.width;let n;s[r+1]>s[a+1]&&(n=r,r=a,a=n,n=l,l=h,h=n),s[a+1]>s[i+1]&&(n=a,a=i,i=n,n=h,h=c,c=n),s[r+1]>s[a+1]&&(n=r,r=a,a=n,n=l,l=h,h=n);var f=(s[r]+e.offsetX)*e.scaleX,g=(s[r+1]+e.offsetY)*e.scaleY,m=(s[a]+e.offsetX)*e.scaleX,v=(s[a+1]+e.offsetY)*e.scaleY,b=(s[i]+e.offsetX)*e.scaleX,_=(s[i+1]+e.offsetY)*e.scaleY;if(!(_<=g)){var y=d[l],A=d[l+1],S=d[l+2],w=d[h],x=d[h+1],E=d[h+2],C=d[c],k=d[c+1],P=d[c+2],t=Math.round(g),T=Math.round(_);let i,s,n,o;for(let a=t;a<=T;a++){if(a<v){let t;t=a<g?0:(g-a)/(g-v),i=f-(f-m)*t,s=y-(y-w)*t,n=A-(A-x)*t,o=S-(S-E)*t}else{let t;t=a>_?1:v==_?0:(v-a)/(v-_),i=m-(m-b)*t,s=w-(w-C)*t,n=x-(x-k)*t,o=E-(E-P)*t}let e;var M=f-(f-b)*(e=a<g?0:a>_?1:(g-a)/(g-_)),F=y-(y-C)*e,R=A-(A-k)*e,O=S-(S-P)*e,D=Math.round(Math.min(i,M)),I=Math.round(Math.max(i,M));let r=p*a+4*D;for(let t=D;t<=I;t++)(e=(i-t)/(i-M))<0?e=0:1<e&&(e=1),u[r++]=s-(s-F)*e|0,u[r++]=n-(n-R)*e|0,u[r++]=o-(o-O)*e|0,u[r++]=255}}}class n extends a{constructor(t){super(),this._coords=t[2],this._colors=t[3],this._figures=t[4],this._bounds=t[5],this._bbox=t[7],this._background=t[8],this.matrix=null}_createMeshCanvas(t,r,e){var a=Math.floor(this._bounds[0]),i=Math.floor(this._bounds[1]),s=Math.ceil(this._bounds[2])-a,n=Math.ceil(this._bounds[3])-i,o=Math.min(Math.ceil(Math.abs(s*t[0]*1.1)),3e3),t=Math.min(Math.ceil(Math.abs(n*t[1]*1.1)),3e3),s=s/o,n=n/t,l={coords:this._coords,colors:this._colors,offsetX:-a,offsetY:-i,scaleX:1/s,scaleY:1/n},e=e.getCanvas("mesh",o+4,t+4,!1),h=e.context,c=h.createImageData(o,t);if(r){var d=c.data;for(let t=0,e=d.length;t<e;t+=4)d[t]=r[0],d[t+1]=r[1],d[t+2]=r[2],d[t+3]=255}for(const y of this._figures){u=void 0;p=void 0;f=void 0;g=void 0;m=void 0;v=void 0;b=void 0;_=void 0;var u=c;var p=y;var f=l;var g=p.coords,m=p.colors;let t,e;switch(p.type){case"lattice":var v=p.verticesPerRow,b=Math.floor(g.length/v)-1,_=v-1;for(t=0;t<b;t++){let e=t*v;for(let t=0;t<_;t++,e++)A(u,f,g[e],g[e+1],g[e+v],m[e],m[e+1],m[e+v]),A(u,f,g[e+v+1],g[e+1],g[e+v],m[e+v+1],m[e+1],m[e+v])}break;case"triangles":for(t=0,e=g.length;t<e;t+=3)A(u,f,g[t],g[t+1],g[t+2],m[t],m[t+1],m[t+2]);break;default:throw new Error("illegal figure")}}return h.putImageData(c,2,2),{canvas:e.canvas,offsetX:a-2*s,offsetY:i-2*n,scaleX:s,scaleY:n}}getPattern(t,e,r,a){l(t,this._bbox);let i;a===o.SHADING?i=v.Util.singularValueDecompose2dScale((0,b.getCurrentTransform)(t)):(i=v.Util.singularValueDecompose2dScale(e.baseTransform),this.matrix&&(s=v.Util.singularValueDecompose2dScale(this.matrix),i=[i[0]*s[0],i[1]*s[1]]));var s=this._createMeshCanvas(i,a===o.SHADING?null:this._background,e.cachedCanvases);return a!==o.SHADING&&(t.setTransform(...e.baseTransform),this.matrix)&&t.transform(...this.matrix),t.translate(s.offsetX,s.offsetY),t.scale(s.scaleX,s.scaleY),t.createPattern(s.canvas,"no-repeat")}}class h extends a{getPattern(){return"hotpink"}}const c={COLORED:1,UNCOLORED:2};e.TilingPattern=class d{static get MAX_PATTERN_SIZE(){return(0,v.shadow)(this,"MAX_PATTERN_SIZE",3e3)}constructor(t,e,r,a,i){this.operatorList=t[2],this.matrix=t[3]||[1,0,0,1,0,0],this.bbox=t[4],this.xstep=t[5],this.ystep=t[6],this.paintType=t[7],this.tilingType=t[8],this.color=e,this.ctx=r,this.canvasGraphicsFactory=a,this.baseTransform=i}createPatternCanvas(t){var e=this.operatorList,r=this.bbox,a=this.xstep,i=this.ystep,s=this.paintType,n=this.tilingType,o=this.color,l=this.canvasGraphicsFactory,n=((0,v.info)("TilingType: "+n),r[0]),h=r[1],c=r[2],r=r[3],d=v.Util.singularValueDecompose2dScale(this.matrix),u=v.Util.singularValueDecompose2dScale(this.baseTransform),d=[d[0]*u[0],d[1]*u[1]],u=this.getSizeAndScale(a,this.ctx.canvas.width,d[0]),a=this.getSizeAndScale(i,this.ctx.canvas.height,d[1]),d=(i=t.cachedCanvases.getCanvas("pattern",u.size,a.size,!0)).context;(l=l.createCanvasGraphics(d)).groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(l,s,o);let p=n,f=h,g=c,m=r;return n<0&&(p=0,g+=Math.abs(n)),h<0&&(f=0,m+=Math.abs(h)),d.translate(-(u.scale*p),-(a.scale*f)),l.transform(u.scale,0,0,a.scale,0,0),d.save(),this.clipBbox(l,p,f,g,m),l.baseTransform=(0,b.getCurrentTransform)(l.ctx),l.executeOperatorList(e),l.endDrawing(),{canvas:i.canvas,scaleX:u.scale,scaleY:a.scale,offsetX:p,offsetY:f}}getSizeAndScale(t,e,r){t=Math.abs(t),e=Math.max(d.MAX_PATTERN_SIZE,e);let a=Math.ceil(t*r);return a>=e?a=e:r=a/t,{scale:r,size:a}}clipBbox(t,e,r,a,i){t.ctx.rect(e,r,a-e,i-r),t.current.updateRectMinMax((0,b.getCurrentTransform)(t.ctx),[e,r,a,i]),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,e,r){var a=t.ctx,i=t.current;switch(e){case c.COLORED:var s=this.ctx;a.fillStyle=s.fillStyle,a.strokeStyle=s.strokeStyle,i.fillColor=s.fillStyle,i.strokeColor=s.strokeStyle;break;case c.UNCOLORED:s=v.Util.makeHexColor(r[0],r[1],r[2]),a.fillStyle=s,a.strokeStyle=s,i.fillColor=s,i.strokeColor=s;break;default:throw new v.FormatError("Unsupported paint type: "+e)}}getPattern(t,e,r,a){let i=r,s=(a!==o.SHADING&&(i=v.Util.transform(i,e.baseTransform),this.matrix)&&(i=v.Util.transform(i,this.matrix)),r=this.createPatternCanvas(e),new DOMMatrix(i));return s=(s=s.translate(r.offsetX,r.offsetY)).scale(1/r.scaleX,1/r.scaleY),(a=t.createPattern(r.canvas,"repeat")).setTransform(s),a}}},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.applyMaskImageData=function(t){let{src:e,srcPos:r=0,dest:a,destPos:i=0,width:s,height:n,inverseDecode:o=!1}=t;var t=m.FeatureTest.isLittleEndian?4278190080:255,[l,h]=o?[0,t]:[t,0],c=s>>3,d=7&s,u=e.length;a=new Uint32Array(a.buffer);for(let t=0;t<n;t++){for(var p=r+c;r<p;r++){var f=r<u?e[r]:255;a[i++]=128&f?h:l,a[i++]=64&f?h:l,a[i++]=32&f?h:l,a[i++]=16&f?h:l,a[i++]=8&f?h:l,a[i++]=4&f?h:l,a[i++]=2&f?h:l,a[i++]=1&f?h:l}if(0!=d){var g=r<u?e[r++]:255;for(let t=0;t<d;t++)a[i++]=g&1<<7-t?h:l}}return{srcPos:r,destPos:i}};var m=r(1)},(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GlobalWorkerOptions=void 0;var r=Object.create(null);(e.GlobalWorkerOptions=r).workerPort=void 0===r.workerPort?null:r.workerPort,r.workerSrc=void 0===r.workerSrc?"":r.workerSrc},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MessageHandler=void 0;var h=r(1);const o={UNKNOWN:0,DATA:1,ERROR:2},c={UNKNOWN:0,CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};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,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)if(e.stream)this._processStreamMessage(e);else if(e.callback){var t=e.callbackId,r=this.callbackCapabilities[t];if(!r)throw new Error("Cannot resolve callback "+t);if(delete this.callbackCapabilities[t],e.callback===o.DATA)r.resolve(e.data);else{if(e.callback!==o.ERROR)throw new Error("Unexpected callback case");r.reject(d(e.reason))}}else{const a=this.actionHandler[e.action];if(!a)throw new Error("Unknown action from worker: "+e.action);if(e.callbackId){const i=this.sourceName,s=e.sourceName;void new Promise(function(t){t(a(e.data))}).then(function(t){n.postMessage({sourceName:i,targetName:s,callback:o.DATA,callbackId:e.callbackId,data:t})},function(t){n.postMessage({sourceName:i,targetName:s,callback:o.ERROR,callbackId:e.callbackId,reason:d(t)})})}else e.streamId?this._createStreamSink(e):a(e.data)}},n.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 a=this.callbackId++,i=(0,h.createPromiseCapability)();this.callbackCapabilities[a]=i;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:a,data:e},r)}catch(t){i.reject(t)}return i.promise}sendWithStream(r,a,t,i){const s=this.streamId++,n=this.sourceName,o=this.targetName,l=this.comObj;return new ReadableStream({start:t=>{var e=(0,h.createPromiseCapability)();return this.streamControllers[s]={controller:t,startCall:e,pullCall:null,cancelCall:null,isClosed:!1},l.postMessage({sourceName:n,targetName:o,action:r,streamId:s,data:a,desiredSize:t.desiredSize},i),e.promise},pull:t=>{var e=(0,h.createPromiseCapability)();return this.streamControllers[s].pullCall=e,l.postMessage({sourceName:n,targetName:o,stream:c.PULL,streamId:s,desiredSize:t.desiredSize}),e.promise},cancel:t=>{(0,h.assert)(t instanceof Error,"cancel must have a valid reason");var e=(0,h.createPromiseCapability)();return this.streamControllers[s].cancelCall=e,this.streamControllers[s].isClosed=!0,l.postMessage({sourceName:n,targetName:o,stream:c.CANCEL,streamId:s,reason:d(t)}),e.promise}},t)}_createStreamSink(e){const i=e.streamId,s=this.sourceName,n=e.sourceName,o=this.comObj,t=this,r=this.actionHandler[e.action],a={enqueue(t){var e,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1,a=2<arguments.length?arguments[2]:void 0;this.isCancelled||(e=this.desiredSize,this.desiredSize-=r,0<e&&this.desiredSize<=0&&(this.sinkCapability=(0,h.createPromiseCapability)(),this.ready=this.sinkCapability.promise),o.postMessage({sourceName:s,targetName:n,stream:c.ENQUEUE,streamId:i,chunk:t},a))},close(){this.isCancelled||(this.isCancelled=!0,o.postMessage({sourceName:s,targetName:n,stream:c.CLOSE,streamId:i}),delete t.streamSinks[i])},error(t){(0,h.assert)(t instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,o.postMessage({sourceName:s,targetName:n,stream:c.ERROR,streamId:i,reason:d(t)}))},sinkCapability:(0,h.createPromiseCapability)(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};a.sinkCapability.resolve(),a.ready=a.sinkCapability.promise,this.streamSinks[i]=a,new Promise(function(t){t(r(e.data,a))}).then(function(){o.postMessage({sourceName:s,targetName:n,stream:c.START_COMPLETE,streamId:i,success:!0})},function(t){o.postMessage({sourceName:s,targetName:n,stream:c.START_COMPLETE,streamId:i,reason:d(t)})})}_processStreamMessage(e){const r=e.streamId,a=this.sourceName,i=e.sourceName,s=this.comObj,t=this.streamControllers[r],n=this.streamSinks[r];switch(e.stream){case c.START_COMPLETE:e.success?t.startCall.resolve():t.startCall.reject(d(e.reason));break;case c.PULL_COMPLETE:e.success?t.pullCall.resolve():t.pullCall.reject(d(e.reason));break;case c.PULL:n?(n.desiredSize<=0&&0<e.desiredSize&&n.sinkCapability.resolve(),n.desiredSize=e.desiredSize,new Promise(function(t){t(n.onPull&&n.onPull())}).then(function(){s.postMessage({sourceName:a,targetName:i,stream:c.PULL_COMPLETE,streamId:r,success:!0})},function(t){s.postMessage({sourceName:a,targetName:i,stream:c.PULL_COMPLETE,streamId:r,reason:d(t)})})):s.postMessage({sourceName:a,targetName:i,stream:c.PULL_COMPLETE,streamId:r,success:!0});break;case c.ENQUEUE:(0,h.assert)(t,"enqueue should have stream controller"),t.isClosed||t.controller.enqueue(e.chunk);break;case c.CLOSE:(0,h.assert)(t,"close should have stream controller"),t.isClosed||(t.isClosed=!0,t.controller.close(),this._deleteStreamController(t,r));break;case c.ERROR:(0,h.assert)(t,"error should have stream controller"),t.controller.error(d(e.reason)),this._deleteStreamController(t,r);break;case c.CANCEL_COMPLETE:e.success?t.cancelCall.resolve():t.cancelCall.reject(d(e.reason)),this._deleteStreamController(t,r);break;case c.CANCEL:n&&(new Promise(function(t){t(n.onCancel&&n.onCancel(d(e.reason)))}).then(function(){s.postMessage({sourceName:a,targetName:i,stream:c.CANCEL_COMPLETE,streamId:r,success:!0})},function(t){s.postMessage({sourceName:a,targetName:i,stream:c.CANCEL_COMPLETE,streamId:r,reason:d(t)})}),n.sinkCapability.reject(d(e.reason)),n.isCancelled=!0,delete this.streamSinks[r]);break;default:throw new Error("Unexpected stream case")}}async _deleteStreamController(t,e){await Promise.allSettled([t.startCall&&t.startCall.promise,t.pullCall&&t.pullCall.promise,t.cancelCall&&t.cancelCall.promise]),delete this.streamControllers[e]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Metadata=void 0;var a=r(1);function i(t,e,r){var a=t;if(e.has(a))throw new TypeError("Cannot initialize the same private elements twice on an object");e.set(t,r)}function s(t,e){e=o(t,e,"get");return e.get?e.get.call(t):e.value}function n(t,e,r){e=o(t,e,"set");if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}function o(t,e,r){if(e.has(t))return e.get(t);throw new TypeError("attempted to "+r+" private field on non-instance")}var l=new WeakMap,h=new WeakMap;e.Metadata=class{constructor(t){var{parsedData:t,rawData:e}=t;i(this,l,{writable:!0,value:void 0}),i(this,h,{writable:!0,value:void 0}),n(this,l,t),n(this,h,e)}getRaw(){return s(this,h)}get(t){return s(this,l).get(t)??null}getAll(){return(0,a.objectFromMap)(s(this,l))}has(t){return s(this,l).has(t)}}},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.OptionalContentConfig=void 0;var s=r(1),a=r(139);function n(t,e,r){if(e.has(t))return r;throw new TypeError("attempted to get private field on non-instance")}function o(t,e,r){l(t,e),e.set(t,r)}function l(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function h(t,e,r){var e=i(t,e,"set"),a=r;if(e.set)e.set.call(t,a);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=a}return r}function c(t,e){e=i(t,e,"get");return e.get?e.get.call(t):e.value}function i(t,e,r){if(e.has(t))return e.get(t);throw new TypeError("attempted to "+r+" private field on non-instance")}const d=Symbol("INTERNAL");var u=new WeakMap;class p{constructor(t,e){o(this,u,{writable:!0,value:!0}),this.name=t,this.intent=e}get visible(){return c(this,u)}_setVisible(t,e){t!==d&&(0,s.unreachable)("Internal method `_setVisible` called."),h(this,u,e)}}var f=new WeakMap,g=new WeakMap,m=new WeakMap,v=new WeakMap,b=new WeakSet;function _(r){var t=r.length;if(t<2)return!0;var a=r[0];for(let e=1;e<t;e++){var i=r[e];let t;if(Array.isArray(i))t=n(this,b,_).call(this,i);else{if(!c(this,g).has(i))return(0,s.warn)("Optional content group not found: "+i),!0;t=c(this,g).get(i).visible}switch(a){case"And":if(t)break;return!1;case"Or":if(t)return!0;break;case"Not":return!t;default:return!0}}return"And"===a}e.OptionalContentConfig=class{constructor(t){var e,r;if(l(e=this,r=b),r.add(e),o(this,f,{writable:!0,value:null}),o(this,g,{writable:!0,value:new Map}),o(this,m,{writable:!0,value:null}),o(this,v,{writable:!0,value:null}),this.name=null,(this.creator=null)!==t){this.name=t.name,this.creator=t.creator,h(this,v,t.order);for(const a of t.groups)c(this,g).set(a.id,new p(a.name,a.intent));if("OFF"===t.baseState)for(const i of c(this,g).values())i._setVisible(d,!1);for(const s of t.on)c(this,g).get(s)._setVisible(d,!0);for(const n of t.off)c(this,g).get(n)._setVisible(d,!1);h(this,m,this.getHash())}}isVisible(t){if(0!==c(this,g).size)if(t){if("OCG"===t.type)return c(this,g).has(t.id)?c(this,g).get(t.id).visible:((0,s.warn)("Optional content group not found: "+t.id),!0);if("OCMD"===t.type){if(t.expression)return n(this,b,_).call(this,t.expression);if(!t.policy||"AnyOn"===t.policy){for(const e of t.ids){if(!c(this,g).has(e))return(0,s.warn)("Optional content group not found: "+e),!0;if(c(this,g).get(e).visible)return!0}return!1}if("AllOn"===t.policy)for(const r of t.ids){if(!c(this,g).has(r))return(0,s.warn)("Optional content group not found: "+r),!0;if(!c(this,g).get(r).visible)return!1}else{if("AnyOff"===t.policy){for(const a of t.ids){if(!c(this,g).has(a))return(0,s.warn)("Optional content group not found: "+a),!0;if(!c(this,g).get(a).visible)return!0}return!1}if("AllOff"===t.policy)for(const i of t.ids){if(!c(this,g).has(i))return(0,s.warn)("Optional content group not found: "+i),!0;if(c(this,g).get(i).visible)return!1}else(0,s.warn)(`Unknown optional content policy ${t.policy}.`)}}else(0,s.warn)(`Unknown group type ${t.type}.`)}else(0,s.warn)("Optional content group not defined.");return!0}setVisibility(t){var e=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];c(this,g).has(t)?(c(this,g).get(t)._setVisible(d,!!e),h(this,f,null)):(0,s.warn)("Optional content group not found: "+t)}get hasInitialVisibility(){return this.getHash()===c(this,m)}getOrder(){return c(this,g).size?c(this,v)?c(this,v).slice():[...c(this,g).keys()]:null}getGroups(){return 0<c(this,g).size?(0,s.objectFromMap)(c(this,g)):null}getGroup(t){return c(this,g).get(t)||null}getHash(){if(null!==c(this,f))return c(this,f);var t,e,r=new a.MurmurHash3_64;for([t,e]of c(this,g))r.update(t+":"+e.visible);return h(this,f,r.hexdigest())}}},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PDFDataTransportStream=void 0;var a=r(1),s=r(137);e.PDFDataTransportStream=class{constructor(t,e){(0,a.assert)(e,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=t.progressiveDone||!1,this._contentDispositionFilename=t.contentDispositionFilename||null;var r=t.initialData;0<(null==r?void 0:r.length)&&(r=new Uint8Array(r).buffer,this._queuedChunks.push(r)),this._pdfDataRangeTransport=e,this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._contentLength=t.length,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(e){const r=new Uint8Array(e.chunk).buffer;var t;void 0===e.begin?this._fullRequestReader?this._fullRequestReader._enqueue(r):this._queuedChunks.push(r):(t=this._rangeReaders.some(function(t){return t._begin===e.begin&&(t._enqueue(r),!0)}),(0,a.assert)(t,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found."))}get _progressiveDataLength(){var t;return(null==(t=this._fullRequestReader)?void 0:t._loaded)??0}_onProgress(t){var e,r;void 0===t.total?null!=(r=this._rangeReaders[0])&&null!=(e=r.onProgress)&&e.call(r,{loaded:t.loaded}):null!=(e=this._fullRequestReader)&&null!=(r=e.onProgress)&&r.call(e,{loaded:t.loaded,total:t.total})}_onProgressiveDone(){var t;null!=(t=this._fullRequestReader)&&t.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){t=this._rangeReaders.indexOf(t);0<=t&&this._rangeReaders.splice(t,1)}getFullReader(){(0,a.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 n(this,t,e),this._pdfDataRangeTransport.requestDataRange(t,e),this._rangeReaders.push(r),r)}cancelAllRequests(t){var e;null!=(e=this._fullRequestReader)&&e.cancel(t);for(const r of this._rangeReaders.slice(0))r.cancel(t);this._pdfDataRangeTransport.abort()}};class i{constructor(t,e){var r=2<arguments.length&&void 0!==arguments[2]&&arguments[2],a=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;this._stream=t,this._done=r||!1,this._filename=(0,s.isPdfFile)(a)?a:null,this._queuedChunks=e||[],this._loaded=0;for(const i of this._queuedChunks)this._loaded+=i.byteLength;this._requests=[],this._headersReady=Promise.resolve(),(t._fullRequestReader=this).onProgress=null}_enqueue(t){this._done||(0<this._requests.length?this._requests.shift().resolve({value:t,done:!1}):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(){var t;return 0<this._queuedChunks.length?{value:this._queuedChunks.shift(),done:!1}:this._done?{value:void 0,done:!0}:(t=(0,a.createPromiseCapability)(),this._requests.push(t),t.promise)}cancel(t){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class n{constructor(t,e,r){this._stream=t,this._begin=e,this._end=r,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 e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){var t;return this._queuedChunk?(t=this._queuedChunk,this._queuedChunk=null,{value:t,done:!1}):this._done?{value:void 0,done:!0}:(t=(0,a.createPromiseCapability)(),this._requests.push(t),t.promise)}cancel(t){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}},(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.XfaText=void 0;class n{static textContent(t){const s=[];var e={items:s,styles:Object.create(null)};return function e(r){if(r){let t=null;var a=r.name;if("#text"===a)t=r.value;else{if(!n.shouldBuildText(a))return;null!=r&&null!=(a=r.attributes)&&a.textContent?t=r.attributes.textContent:r.value&&(t=r.value)}if(null!==t&&s.push({str:t}),r.children)for(const i of r.children)e(i)}}(t),e}static shouldBuildText(t){return!("textarea"===t||"input"===t||"option"===t||"select"===t)}}e.XfaText=n},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NodeStandardFontDataFactory=e.NodeCanvasFactory=e.NodeCMapReaderFactory=void 0;r=r(138);function a(t){return new Promise((r,a)=>{require("fs").readFile(t,(t,e)=>{t||!e?a(new Error(t)):r(new Uint8Array(e))})})}class i extends r.BaseCanvasFactory{_createCanvas(t,e){return require("canvas").createCanvas(t,e)}}e.NodeCanvasFactory=i;class s extends r.BaseCMapReaderFactory{_fetchData(t,e){return a(t).then(t=>({cMapData:t,compressionType:e}))}}e.NodeCMapReaderFactory=s;class n extends r.BaseStandardFontDataFactory{_fetchData(t){return a(t)}}e.NodeStandardFontDataFactory=n},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AnnotationEditorLayer=void 0;var a=r(136),i=r(1),s=r(152),n=r(153);function o(t,e){h(t,e),e.add(t)}function l(t,e,r){h(t,e),e.set(t,r)}function h(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function c(t,e,r){if(e.has(t))return r;throw new TypeError("attempted to get private field on non-instance")}function d(t,e){e=p(t,e,"get");return e.get?e.get.call(t):e.value}function u(t,e,r){e=p(t,e,"set");if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}function p(t,e,r){if(e.has(t))return e.get(t);throw new TypeError("attempted to "+r+" private field on non-instance")}var f,g=new WeakMap,m=new WeakMap,v=new WeakMap,b=new WeakMap,_=new WeakMap,y=new WeakMap,A=new WeakMap,S=new WeakMap,w=new WeakSet,x=new WeakSet,E=new WeakSet,C=new WeakSet;class k{constructor(t){o(this,C),o(this,E),o(this,x),o(this,w),l(this,g,{writable:!0,value:void 0}),l(this,m,{writable:!0,value:!1}),l(this,v,{writable:!0,value:this.pointerup.bind(this)}),l(this,b,{writable:!0,value:this.pointerdown.bind(this)}),l(this,_,{writable:!0,value:new Map}),l(this,y,{writable:!0,value:!1}),l(this,A,{writable:!0,value:!1}),l(this,S,{writable:!0,value:void 0}),k._initialized||(k._initialized=!0,s.FreeTextEditor.initialize(t.l10n),n.InkEditor.initialize(t.l10n)),t.uiManager.registerEditorTypes([s.FreeTextEditor,n.InkEditor]),u(this,S,t.uiManager),this.annotationStorage=t.annotationStorage,this.pageIndex=t.pageIndex,this.div=t.div,u(this,g,t.accessibilityManager),d(this,S).addLayer(this)}updateToolbar(t){d(this,S).updateToolbar(t)}updateMode(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:d(this,S).getMode();c(this,C,F).call(this),t===i.AnnotationEditorType.INK?(this.addInkEditorIfNeeded(!1),this.disableClick()):this.enableClick(),d(this,S).unselectAll(),this.div.classList.toggle("freeTextEditing",t===i.AnnotationEditorType.FREETEXT),this.div.classList.toggle("inkEditing",t===i.AnnotationEditorType.INK)}addInkEditorIfNeeded(t){if(t||d(this,S).getMode()===i.AnnotationEditorType.INK){if(!t)for(const e of d(this,_).values())if(e.isEmpty())return void e.setInBackground();const e=c(this,E,M).call(this,{offsetX:0,offsetY:0});e.setInBackground()}}setEditingState(t){d(this,S).setEditingState(t)}addCommands(t){d(this,S).addCommands(t)}enable(){this.div.style.pointerEvents="auto";for(const t of d(this,_).values())t.enableEditing()}disable(){this.div.style.pointerEvents="none";for(const t of d(this,_).values())t.disableEditing()}setActiveEditor(t){d(this,S).getActive()!==t&&d(this,S).setActiveEditor(t)}enableClick(){this.div.addEventListener("pointerdown",d(this,b)),this.div.addEventListener("pointerup",d(this,v))}disableClick(){this.div.removeEventListener("pointerdown",d(this,b)),this.div.removeEventListener("pointerup",d(this,v))}attach(t){d(this,_).set(t.id,t)}detach(t){var e;d(this,_).delete(t.id),null!=(e=d(this,g))&&e.removePointerInTextLayer(t.contentDiv)}remove(t){d(this,S).removeEditor(t),this.detach(t),this.annotationStorage.remove(t.id),t.div.style.display="none",setTimeout(()=>{t.div.style.display="",t.div.remove(),t.isAttachedToDOM=!1,document.activeElement===document.body&&d(this,S).focusMainContainer()},0),d(this,A)||this.addInkEditorIfNeeded(!1)}add(t){var e;c(this,w,P).call(this,t),d(this,S).addEditor(t),this.attach(t),t.isAttachedToDOM||(e=t.render(),this.div.append(e),t.isAttachedToDOM=!0),this.moveEditorInDOM(t),t.onceAdded(),this.addToAnnotationStorage(t)}moveEditorInDOM(t){var e;null!=(e=d(this,g))&&e.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}addToAnnotationStorage(t){t.isEmpty()||this.annotationStorage.has(t.id)||this.annotationStorage.setValue(t.id,t)}addOrRebuild(t){t.needsToBeRebuilt()?t.rebuild():this.add(t)}addANewEditor(t){this.addCommands({cmd:()=>{this.addOrRebuild(t)},undo:()=>{t.remove()},mustExec:!0})}addUndoableEditor(t){this.addCommands({cmd:()=>{this.addOrRebuild(t)},undo:()=>{t.remove()},mustExec:!1})}getNextId(){return d(this,S).getId()}deserialize(t){switch(t.annotationType){case i.AnnotationEditorType.FREETEXT:return s.FreeTextEditor.deserialize(t,this);case i.AnnotationEditorType.INK:return n.InkEditor.deserialize(t,this)}return null}setSelected(t){d(this,S).setSelected(t)}toggleSelected(t){d(this,S).toggleSelected(t)}isSelected(t){return d(this,S).isSelected(t)}unselect(t){d(this,S).unselect(t)}pointerup(t){var e=a.KeyboardManager.platform.isMac;0!==t.button||t.ctrlKey&&e||t.target===this.div&&d(this,y)&&(u(this,y,!1),d(this,m)?c(this,E,M).call(this,t):u(this,m,!0))}pointerdown(t){var e=a.KeyboardManager.platform.isMac;0!==t.button||t.ctrlKey&&e||t.target===this.div&&(u(this,y,!0),e=d(this,S).getActive(),u(this,m,!e||e.isEmpty()))}drop(t){var e,r,a=t.dataTransfer.getData("text/plain"),a=d(this,S).getEditor(a);a&&(t.preventDefault(),t.dataTransfer.dropEffect="move",c(this,w,P).call(this,a),e=this.div.getBoundingClientRect(),r=t.clientX-e.x,t=t.clientY-e.y,a.translate(r-a.startX,t-a.startY),this.moveEditorInDOM(a),a.div.focus())}dragover(t){t.preventDefault()}destroy(){var t,e;(null==(t=d(this,S).getActive())?void 0:t.parent)===this&&d(this,S).setActiveEditor(null);for(const r of d(this,_).values())null!=(e=d(this,g))&&e.removePointerInTextLayer(r.contentDiv),r.isAttachedToDOM=!1,r.div.remove(),r.parent=null;this.div=null,d(this,_).clear(),d(this,S).removeLayer(this)}render(t){this.viewport=t.viewport,(0,a.bindEvents)(this,this.div,["dragover","drop"]),this.setDimensions();for(const e of d(this,S).getEditors(this.pageIndex))this.add(e);this.updateMode()}update(t){d(this,S).commitOrRemove(),this.viewport=t.viewport,this.setDimensions(),this.updateMode()}get scaleFactor(){return this.viewport.scale}get pageDimensions(){var[t,e,r,a]=this.viewport.viewBox;return[r-t,a-e]}get viewportBaseDimensions(){var{width:t,height:e,rotation:r}=this.viewport;return r%180==0?[t,e]:[e,t]}setDimensions(){var{width:t,height:e,rotation:r}=this.viewport,a=r%180!=0,t=Math.floor(t)+"px",e=Math.floor(e)+"px";this.div.style.width=a?e:t,this.div.style.height=a?t:e,this.div.setAttribute("data-main-rotation",r)}}function P(t){var e;t.parent!==this&&(this.attach(t),t.pageIndex=this.pageIndex,null!=(e=t.parent)&&e.detach(t),t.parent=this,t.div)&&t.isAttachedToDOM&&(t.div.remove(),this.div.append(t.div))}function T(t){switch(d(this,S).getMode()){case i.AnnotationEditorType.FREETEXT:return new s.FreeTextEditor(t);case i.AnnotationEditorType.INK:return new n.InkEditor(t)}return null}function M(t){var e=this.getNextId(),e=c(this,x,T).call(this,{parent:this,id:e,x:t.offsetX,y:t.offsetY});return e&&this.add(e),e}function F(){u(this,A,!0);for(const t of d(this,_).values())t.isEmpty()&&t.remove();u(this,A,!1)}e.AnnotationEditorLayer=k,r=k,f=!(e="_initialized"),e in r?Object.defineProperty(r,e,{value:f,enumerable:!0,configurable:!0,writable:!0}):r[e]=f},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FreeTextEditor=void 0;var a=r(1),n=r(136),i=r(135);function s(t,e){h(t,e),e.add(t)}function o(t,e,r){e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}function l(t,e,r){h(t,e),e.set(t,r)}function h(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function c(t,e){e=p(t,e,"get");return e.get?e.get.call(t):e.value}function d(t,e,r){if(e.has(t))return r;throw new TypeError("attempted to get private field on non-instance")}function u(t,e,r){e=p(t,e,"set");if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}function p(t,e,r){if(e.has(t))return e.get(t);throw new TypeError("attempted to "+r+" private field on non-instance")}var f=new WeakMap,g=new WeakMap,m=new WeakMap,v=new WeakMap,b=new WeakMap,_=new WeakMap,y=new WeakMap,A=new WeakMap,S=new WeakMap,w=new WeakSet,x=new WeakSet,E=new WeakSet,C=new WeakSet;class k extends i.AnnotationEditor{constructor(t){super({...t,name:"freeTextEditor"}),s(this,C),s(this,E),s(this,x),s(this,w),l(this,f,{writable:!0,value:this.editorDivBlur.bind(this)}),l(this,g,{writable:!0,value:this.editorDivFocus.bind(this)}),l(this,m,{writable:!0,value:this.editorDivInput.bind(this)}),l(this,v,{writable:!0,value:this.editorDivKeydown.bind(this)}),l(this,b,{writable:!0,value:void 0}),l(this,_,{writable:!0,value:""}),l(this,y,{writable:!0,value:this.id+"-editor"}),l(this,A,{writable:!0,value:!1}),l(this,S,{writable:!0,value:void 0}),u(this,b,t.color||k._defaultColor||i.AnnotationEditor._defaultLineColor),u(this,S,t.fontSize||k._defaultFontSize)}static initialize(e){this._l10nPromise=new Map(["free_text2_default_content","editor_free_text2_aria_label"].map(t=>[t,e.get(t)]));var t=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(t.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,e){switch(t){case a.AnnotationEditorParamsType.FREETEXT_SIZE:k._defaultFontSize=e;break;case a.AnnotationEditorParamsType.FREETEXT_COLOR:k._defaultColor=e}}updateParams(t,e){switch(t){case a.AnnotationEditorParamsType.FREETEXT_SIZE:d(this,w,P).call(this,e);break;case a.AnnotationEditorParamsType.FREETEXT_COLOR:d(this,x,T).call(this,e)}}static get defaultPropertiesToUpdate(){return[[a.AnnotationEditorParamsType.FREETEXT_SIZE,k._defaultFontSize],[a.AnnotationEditorParamsType.FREETEXT_COLOR,k._defaultColor||i.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[a.AnnotationEditorParamsType.FREETEXT_SIZE,c(this,S)],[a.AnnotationEditorParamsType.FREETEXT_COLOR,c(this,b)]]}getInitialTranslation(){return[-k._internalPadding*this.parent.scaleFactor,-(k._internalPadding+c(this,S))*this.parent.scaleFactor]}rebuild(){super.rebuild(),null===this.div||this.isAttachedToDOM||this.parent.add(this)}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(a.AnnotationEditorType.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this.div.draggable=!1,this.div.removeAttribute("aria-activedescendant"),this.editorDiv.addEventListener("keydown",c(this,v)),this.editorDiv.addEventListener("focus",c(this,g)),this.editorDiv.addEventListener("blur",c(this,f)),this.editorDiv.addEventListener("input",c(this,m)))}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",c(this,y)),this.div.draggable=!0,this.editorDiv.removeEventListener("keydown",c(this,v)),this.editorDiv.removeEventListener("focus",c(this,g)),this.editorDiv.removeEventListener("blur",c(this,f)),this.editorDiv.removeEventListener("input",c(this,m)),this.div.focus(),this.isEditing=!1,this.parent.div.classList.add("freeTextEditing"))}focusin(t){super.focusin(t),t.target!==this.editorDiv&&this.editorDiv.focus()}onceAdded(){this.width||(this.enableEditMode(),this.editorDiv.focus())}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1,this.parent.setEditingState(!0),this.parent.div.classList.add("freeTextEditing"),super.remove()}commit(){super.commit(),c(this,A)||(u(this,A,!0),this.parent.addUndoableEditor(this)),this.disableEditMode(),u(this,_,d(this,E,M).call(this).trimEnd()),d(this,C,F).call(this)}shouldGetKeyboardEvents(){return this.isInEditMode()}dblclick(t){this.enableEditMode(),this.editorDiv.focus()}keydown(t){t.target===this.div&&"Enter"===t.key&&(this.enableEditMode(),this.editorDiv.focus())}editorDivKeydown(t){k._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 t,e;this.width&&(t=this.x,e=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",c(this,y)),this.enableEditing(),k._l10nPromise.get("editor_free_text2_aria_label").then(t=>{var e;return null==(e=this.editorDiv)?void 0:e.setAttribute("aria-label",t)}),k._l10nPromise.get("free_text2_default_content").then(t=>{var e;return null==(e=this.editorDiv)?void 0:e.setAttribute("default-content",t)}),this.editorDiv.contentEditable=!0;var r=this.editorDiv["style"];if(r.fontSize=`calc(${c(this,S)}px * var(--scale-factor))`,r.color=c(this,b),this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),(0,n.bindEvents)(this,this.div,["dblclick","keydown"]),this.width){var[r,a]=this.parent.viewportBaseDimensions;this.setAt(t*r,e*a,this.width*r,this.height*a);for(const s of c(this,_).split("\n")){var i=document.createElement("div");i.append(s?document.createTextNode(s):document.createElement("br")),this.editorDiv.append(i)}this.div.draggable=!0,this.editorDiv.contentEditable=!1}else this.div.draggable=!1,this.editorDiv.contentEditable=!0}return this.div}get contentDiv(){return this.editorDiv}static deserialize(t,e){e=super.deserialize(t,e);return u(e,S,t.fontSize),u(e,b,a.Util.makeHexColor(...t.color)),u(e,_,t.value),e}serialize(){var t,e;return this.isEmpty()?null:(t=k._internalPadding*this.parent.scaleFactor,t=this.getRect(t,t),e=i.AnnotationEditor._colorManager.convert(getComputedStyle(this.editorDiv).color),{annotationType:a.AnnotationEditorType.FREETEXT,color:e,fontSize:c(this,S),value:c(this,_),pageIndex:this.parent.pageIndex,rect:t,rotation:this.rotation})}}function P(t){const e=t=>{this.editorDiv.style.fontSize=`calc(${t}px * var(--scale-factor))`,this.translate(0,-(t-c(this,S))*this.parent.scaleFactor),u(this,S,t),d(this,C,F).call(this)},r=c(this,S);this.parent.addCommands({cmd:()=>{e(t)},undo:()=>{e(r)},mustExec:!0,type:a.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}function T(t){const e=c(this,b);this.parent.addCommands({cmd:()=>{u(this,b,t),this.editorDiv.style.color=t},undo:()=>{u(this,b,e),this.editorDiv.style.color=e},mustExec:!0,type:a.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function M(){var t=this.editorDiv.getElementsByTagName("div");if(0===t.length)return this.editorDiv.innerText;var e=[];for(const a of t){var r=a.firstChild;"#text"===(null==r?void 0:r.nodeName)?e.push(r.data):e.push("")}return e.join("\n")}function F(){var[t,e]=this.parent.viewportBaseDimensions,r=this.div.getBoundingClientRect();this.width=r.width/t,this.height=r.height/e}o(e.FreeTextEditor=k,"_freeTextDefaultContent",""),o(k,"_l10nPromise",void 0),o(k,"_internalPadding",0),o(k,"_defaultColor",null),o(k,"_defaultFontSize",10),o(k,"_keyboardManager",new n.KeyboardManager([[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],k.prototype.commitOrRemove]])),o(k,"_type","freetext")},(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InkEditor=void 0,Object.defineProperty(t,"fitCurve",{enumerable:!0,get:function(){return N.fitCurve}});var v=e(1),a=e(135),N=e(154),j=e(136);function r(t,e){U(t,e),e.add(t)}function i(t,e,r){e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}function s(t,e,r){U(t,e),e.set(t,r)}function U(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function W(t,e,r){if(t!==e)throw new TypeError("Private static access of wrong provenance");return r}function b(t,e,r){e=B(t,e,"set");if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}}function o(t,e){e=B(t,e,"get");return e.get?e.get.call(t):e.value}function B(t,e,r){if(e.has(t))return e.get(t);throw new TypeError("attempted to "+r+" private field on non-instance")}function _(t,e,r){if(e.has(t))return r;throw new TypeError("attempted to get private field on non-instance")}const y=16,G=100;var A=new WeakMap,S=new WeakMap,w=new WeakMap,n=new WeakMap,l=new WeakMap,h=new WeakMap,c=new WeakMap,x=new WeakMap,d=new WeakMap,u=new WeakMap,p=new WeakMap,E=new WeakMap,C=new WeakMap,f=new WeakMap,q=new WeakSet,H=new WeakSet,z=new WeakSet,V=new WeakSet,X=new WeakSet,Y=new WeakSet,K=new WeakSet,J=new WeakSet,g=new WeakSet,$=new WeakSet,m=new WeakSet,k=new WeakSet,P=new WeakSet,Q=new WeakSet,T=new WeakSet,Z=new WeakSet,tt=new WeakSet,et=new WeakSet,rt=new WeakSet,M=new WeakSet,F=new WeakSet,at=new WeakSet;class R extends a.AnnotationEditor{constructor(t){super({...t,name:"inkEditor"}),r(this,at),r(this,F),r(this,M),r(this,rt),r(this,et),r(this,tt),r(this,Z),r(this,T),r(this,Q),r(this,P),r(this,k),r(this,m),r(this,$),r(this,g),r(this,J),r(this,K),r(this,Y),r(this,X),r(this,V),r(this,z),r(this,H),r(this,q),s(this,A,{writable:!0,value:0}),s(this,S,{writable:!0,value:0}),s(this,w,{writable:!0,value:0}),s(this,n,{writable:!0,value:this.canvasPointermove.bind(this)}),s(this,l,{writable:!0,value:this.canvasPointerleave.bind(this)}),s(this,h,{writable:!0,value:this.canvasPointerup.bind(this)}),s(this,c,{writable:!0,value:this.canvasPointerdown.bind(this)}),s(this,x,{writable:!0,value:!1}),s(this,d,{writable:!0,value:!1}),s(this,u,{writable:!0,value:null}),s(this,p,{writable:!0,value:null}),s(this,E,{writable:!0,value:0}),s(this,C,{writable:!0,value:0}),s(this,f,{writable:!0,value:null}),this.color=t.color||null,this.thickness=t.thickness||null,this.opacity=t.opacity||null,this.paths=[],this.bezierPath2D=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0}static initialize(e){this._l10nPromise=new Map(["editor_ink_canvas_aria_label","editor_ink2_aria_label"].map(t=>[t,e.get(t)]))}static updateDefaultParams(t,e){switch(t){case v.AnnotationEditorParamsType.INK_THICKNESS:R._defaultThickness=e;break;case v.AnnotationEditorParamsType.INK_COLOR:R._defaultColor=e;break;case v.AnnotationEditorParamsType.INK_OPACITY:R._defaultOpacity=e/100}}updateParams(t,e){switch(t){case v.AnnotationEditorParamsType.INK_THICKNESS:_(this,q,it).call(this,e);break;case v.AnnotationEditorParamsType.INK_COLOR:_(this,H,st).call(this,e);break;case v.AnnotationEditorParamsType.INK_OPACITY:_(this,z,nt).call(this,e)}}static get defaultPropertiesToUpdate(){return[[v.AnnotationEditorParamsType.INK_THICKNESS,R._defaultThickness],[v.AnnotationEditorParamsType.INK_COLOR,R._defaultColor||a.AnnotationEditor._defaultLineColor],[v.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*R._defaultOpacity)]]}get propertiesToUpdate(){return[[v.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||R._defaultThickness],[v.AnnotationEditorParamsType.INK_COLOR,this.color||R._defaultColor||a.AnnotationEditor._defaultLineColor],[v.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(this.opacity??R._defaultOpacity))]]}rebuild(){super.rebuild(),null!==this.div&&(this.canvas||(_(this,m,pt).call(this),_(this,k,ft).call(this)),this.isAttachedToDOM||(this.parent.add(this),_(this,P,D).call(this)),_(this,F,I).call(this))}remove(){null!==this.canvas&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,o(this,p).disconnect(),b(this,p,null),super.remove())}enableEditMode(){o(this,x)||null===this.canvas||(super.enableEditMode(),this.div.draggable=!1,this.canvas.addEventListener("pointerdown",o(this,c)),this.canvas.addEventListener("pointerup",o(this,h)))}disableEditMode(){this.isInEditMode()&&null!==this.canvas&&(super.disableEditMode(),this.div.draggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",o(this,c)),this.canvas.removeEventListener("pointerup",o(this,h)))}onceAdded(){this.div.draggable=!this.isEmpty()}isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}commit(){o(this,x)||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),b(this,x,!0),this.div.classList.add("disabled"),_(this,F,I).call(this,!0),this.parent.addInkEditorIfNeeded(!0),this.parent.moveEditorInDOM(this),this.div.focus())}focusin(t){super.focusin(t),this.enableEditMode()}canvasPointerdown(t){0===t.button&&this.isInEditMode()&&!o(this,x)&&(this.setInForeground(),"mouse"!==t.type&&this.div.focus(),t.stopPropagation(),this.canvas.addEventListener("pointerleave",o(this,l)),this.canvas.addEventListener("pointermove",o(this,n)),_(this,Y,ht).call(this,t.offsetX,t.offsetY))}canvasPointermove(t){t.stopPropagation(),_(this,K,ct).call(this,t.offsetX,t.offsetY)}canvasPointerup(t){0===t.button&&this.isInEditMode()&&0!==this.currentPath.length&&(t.stopPropagation(),_(this,$,ut).call(this,t),this.setInBackground())}canvasPointerleave(t){_(this,$,ut).call(this,t),this.setInBackground()}render(){if(!this.div){let t,e;this.width&&(t=this.x,e=this.y),super.render(),R._l10nPromise.get("editor_ink2_aria_label").then(t=>{var e;return null==(e=this.div)?void 0:e.setAttribute("aria-label",t)});var[r,a,i,s]=_(this,V,ot).call(this);this.setAt(r,a,0,0),this.setDims(i,s),_(this,m,pt).call(this),this.width?([r,a]=this.parent.viewportBaseDimensions,this.setAt(t*r,e*a,this.width*r,this.height*a),b(this,d,!0),_(this,P,D).call(this),this.setDims(this.width*r,this.height*a),_(this,g,O).call(this),_(this,at,wt).call(this),this.div.classList.add("disabled")):(this.div.classList.add("editing"),this.enableEditMode()),_(this,k,ft).call(this)}return this.div}setDimensions(t,e){var r=Math.round(t),a=Math.round(e);o(this,E)===r&&o(this,C)===a||(b(this,E,r),b(this,C,a),this.canvas.style.visibility="hidden",o(this,A)&&.01<Math.abs(o(this,A)-t/e)&&(e=Math.ceil(t/o(this,A)),this.setDims(t,e)),[r,a]=this.parent.viewportBaseDimensions,this.width=t/r,this.height=e/a,o(this,x)&&_(this,Q,gt).call(this,t,e),_(this,P,D).call(this),_(this,g,O).call(this),this.canvas.style.visibility="visible")}static deserialize(t,e){var i,s=super.deserialize(t,e),[r,a]=(s.thickness=t.thickness,s.color=v.Util.makeHexColor(...t.color),s.opacity=t.opacity,e.pageDimensions),r=s.width*r,n=s.height*a,o=e.scaleFactor,l=t.thickness/2;b(s,A,r/n),b(s,x,!0),b(s,E,Math.round(r)),b(s,C,Math.round(n));for({bezier:i}of t.paths){var h=[];s.paths.push(h);let r=o*(i[0]-l),a=o*(n-i[1]-l);for(let t=2,e=i.length;t<e;t+=6){var c=o*(i[t]-l),d=o*(n-i[t+1]-l),u=o*(i[t+2]-l),p=o*(n-i[t+3]-l),f=o*(i[t+4]-l),g=o*(n-i[t+5]-l);h.push([[r,a],[c,d],[u,p],[f,g]]),r=f,a=g}var m=W(this,R,vt).call(this,h);s.bezierPath2D.push(m)}a=_(s,rt,At).call(s);return b(s,w,Math.max(y,a[2]-a[0])),b(s,S,Math.max(y,a[3]-a[1])),_(s,Q,gt).call(s,r,n),s}serialize(){var t,e,r;return this.isEmpty()?null:(t=this.getRect(0,0),e=this.rotation%180==0?t[3]-t[1]:t[2]-t[0],r=a.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle),{annotationType:v.AnnotationEditorType.INK,color:r,thickness:this.thickness,opacity:this.opacity,paths:_(this,Z,bt).call(this,this.scaleFactor/this.parent.scaleFactor,this.translationX,this.translationY,e),pageIndex:this.parent.pageIndex,rect:t,rotation:this.rotation})}}function it(t){const e=this.thickness;this.parent.addCommands({cmd:()=>{this.thickness=t,_(this,F,I).call(this)},undo:()=>{this.thickness=e,_(this,F,I).call(this)},mustExec:!0,type:v.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}function st(t){const e=this.color;this.parent.addCommands({cmd:()=>{this.color=t,_(this,g,O).call(this)},undo:()=>{this.color=e,_(this,g,O).call(this)},mustExec:!0,type:v.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function nt(t){t/=100;const e=this.opacity;this.parent.addCommands({cmd:()=>{this.opacity=t,_(this,g,O).call(this)},undo:()=>{this.opacity=e,_(this,g,O).call(this)},mustExec:!0,type:v.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}function ot(){var{width:t,height:e,rotation:r}=this.parent.viewport;switch(r){case 90:return[0,t,t,e];case 180:return[t,e,t,e];case 270:return[e,0,t,e];default:return[0,0,t,e]}}function lt(){this.ctx.lineWidth=this.thickness*this.parent.scaleFactor/this.scaleFactor,this.ctx.lineCap="round",this.ctx.lineJoin="round",this.ctx.miterLimit=10,this.ctx.strokeStyle=""+this.color+(0,j.opacityToHex)(this.opacity)}function ht(t,e){this.isEditing=!0,o(this,d)||(b(this,d,!0),_(this,P,D).call(this),this.thickness||(this.thickness=R._defaultThickness),this.color||(this.color=R._defaultColor||a.AnnotationEditor._defaultLineColor),this.opacity??(this.opacity=R._defaultOpacity)),this.currentPath.push([t,e]),b(this,u,null),_(this,X,lt).call(this),this.ctx.beginPath(),this.ctx.moveTo(t,e),b(this,f,()=>{o(this,f)&&(o(this,u)&&(this.isEmpty()?(this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height)):_(this,g,O).call(this),this.ctx.lineTo(...o(this,u)),b(this,u,null),this.ctx.stroke()),window.requestAnimationFrame(o(this,f)))}),window.requestAnimationFrame(o(this,f))}function ct(t,e){var[r,a]=this.currentPath.at(-1);t===r&&e===a||(this.currentPath.push([t,e]),b(this,u,[t,e]))}function dt(t,e){this.ctx.closePath(),b(this,f,null),t=Math.min(Math.max(t,0),this.canvas.width),e=Math.min(Math.max(e,0),this.canvas.height);var[r,a]=this.currentPath.at(-1);t===r&&e===a||this.currentPath.push([t,e]);let i;i=1!==this.currentPath.length?(0,N.fitCurve)(this.currentPath,30,null):[[r=[t,e],r.slice(),r.slice(),r]];const s=W(R,R,vt).call(R,i);this.currentPath.length=0;this.parent.addCommands({cmd:()=>{this.paths.push(i),this.bezierPath2D.push(s),this.rebuild()},undo:()=>{this.paths.pop(),this.bezierPath2D.pop(),0===this.paths.length?this.remove():(this.canvas||(_(this,m,pt).call(this),_(this,k,ft).call(this)),_(this,F,I).call(this))},mustExec:!0})}function O(){if(this.isEmpty())_(this,T,mt).call(this);else{_(this,X,lt).call(this);var{canvas:t,ctx:e}=this;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,t.width,t.height),_(this,T,mt).call(this);for(const r of this.bezierPath2D)e.stroke(r)}}function ut(t){_(this,J,dt).call(this,t.offsetX,t.offsetY),this.canvas.removeEventListener("pointerleave",o(this,l)),this.canvas.removeEventListener("pointermove",o(this,n)),this.parent.addToAnnotationStorage(this)}function pt(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",R._l10nPromise.get("editor_ink_canvas_aria_label").then(t=>{var e;return null==(e=this.canvas)?void 0:e.setAttribute("aria-label",t)}),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")}function ft(){let e=null;b(this,p,new ResizeObserver(t=>{t=t[0].contentRect;t.width&&t.height&&(null!==e&&clearTimeout(e),e=setTimeout(()=>{this.fixDims(),e=null},G),this.setDimensions(t.width,t.height))})),o(this,p).observe(this.div)}function D(){var t,e;o(this,d)&&([t,e]=this.parent.viewportBaseDimensions,this.canvas.width=Math.ceil(this.width*t),this.canvas.height=Math.ceil(this.height*e),_(this,T,mt).call(this))}function gt(t,e){var r=_(this,M,St).call(this),t=(t-r)/o(this,w),e=(e-r)/o(this,S);this.scaleFactor=Math.min(t,e)}function mt(){var t=_(this,M,St).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+t,this.translationY*this.scaleFactor+t)}function vt(r){var a=new Path2D;for(let t=0,e=r.length;t<e;t++){var[i,s,n,o]=r[t];0===t&&a.moveTo(...i),a.bezierCurveTo(s[0],s[1],n[0],n[1],o[0],o[1])}return a}function bt(r,a,i,s){var n,o,t=[],l=this.thickness/2;for(const v of this.paths){n=[],o=[];for(let t=0,e=v.length;t<e;t++){var[h,c,d,u]=v[t],p=r*(h[0]+a)+l,h=s-r*(h[1]+i)-l,f=r*(c[0]+a)+l,c=s-r*(c[1]+i)-l,g=r*(d[0]+a)+l,d=s-r*(d[1]+i)-l,m=r*(u[0]+a)+l,u=s-r*(u[1]+i)-l;0===t&&(n.push(p,h),o.push(p,h)),n.push(f,c,g,d,m,u),_(this,tt,_t).call(this,p,h,f,c,g,d,m,u,4,o)}t.push({bezier:n,points:o})}return t}function _t(e,r,a,i,s,n,o,l,h,c){if(!_(this,et,yt).call(this,e,r,a,i,s,n,o,l))for(let t=1;t<h-1;t++){var d=t/h,u=1-d,p=d*a+u*s,f=d*i+u*n;c.push(d*(d*(d*e+u*a)+u*p)+u*(d*p+u*(d*s+u*o)),d*(d*(d*r+u*i)+u*f)+u*(d*f+u*(d*n+u*l)))}c.push(o,l)}function yt(t,e,r,a,i,s,n,o){a=(3*a-2*e-o)**2,s=(3*s-e-2*o)**2;return Math.max((3*r-2*t-n)**2,(3*i-t-2*n)**2)+Math.max(a,s)<=10}function At(){let t=1/0,e=-1/0,r=1/0,a=-1/0;for(const l of this.paths)for(var[i,s,n,o]of l){i=v.Util.bezierBoundingBox(...i,...s,...n,...o);t=Math.min(t,i[0]),r=Math.min(r,i[1]),e=Math.max(e,i[2]),a=Math.max(a,i[3])}return[t,r,e,a]}function St(){return o(this,x)?Math.ceil(this.thickness*this.parent.scaleFactor):0}function I(){var t,e,r,a,i,s,n=0<arguments.length&&void 0!==arguments[0]&&arguments[0];this.isEmpty()||(o(this,x)?(s=_(this,rt,At).call(this),t=_(this,M,St).call(this),b(this,w,Math.max(y,s[2]-s[0])),b(this,S,Math.max(y,s[3]-s[1])),e=Math.ceil(t+o(this,w)*this.scaleFactor),r=Math.ceil(t+o(this,S)*this.scaleFactor),[a,i]=this.parent.viewportBaseDimensions,this.width=e/a,this.height=r/i,b(this,A,e/r),_(this,at,wt).call(this),a=this.translationX,i=this.translationY,this.translationX=-s[0],this.translationY=-s[1],_(this,P,D).call(this),_(this,g,O).call(this),b(this,E,e),b(this,C,r),this.setDims(e,r),s=n?t/this.scaleFactor/2:0,this.translate(a-this.translationX-s,i-this.translationY-s)):_(this,g,O).call(this))}function wt(){var t=this.div["style"];1<=o(this,A)?(t.minHeight=y+"px",t.minWidth=Math.round(o(this,A)*y)+"px"):(t.minWidth=y+"px",t.minHeight=Math.round(y/o(this,A))+"px")}i(t.InkEditor=R,"_defaultColor",null),i(R,"_defaultOpacity",1),i(R,"_defaultThickness",1),i(R,"_l10nPromise",void 0),i(R,"_type","ink")},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.fitCurve=void 0;r=r(155);e.fitCurve=r},t=>{"use strict";function A(t,e,r,a,i){var s,n,o,l,h,c,d,u,p,f,g,m,v,b,_;if(2===t.length)return f=w.vectorLen(w.subtract(t[0],t[1]))/3,[s=[t[0],w.addArrays(t[0],w.mulItems(e,f)),w.addArrays(t[1],w.mulItems(r,f)),t[1]]];if(_=[],t.forEach((t,e)=>{m=e?v+w.vectorLen(w.subtract(t,b)):0,_.push(m),v=m,b=t}),[s,l,c]=S(t,n=_=_.map(t=>t/v),n,e,r,i),0===l||l<a)return[s];if(l<a*a)for(o=n,h=l,d=c,g=0;g<20;g++){if([s,l,c]=S(t,n,o=function(s,n,t){return t.map((t,e)=>{return r=s,e=n[e],t=t,e=w.subtract(x.q(r,t),e),a=x.qprime(r,t),i=w.mulMatrix(e,a),0===(a=w.sum(w.squareItems(a))+2*w.mulMatrix(e,x.qprimeprime(r,t)))?t:t-i/a;var r,a,i})}(s,t,o),e,r,i),l<a)return[s];if(c===d){var y=l/h;if(.9999<y&&y<1.0001)break}h=l,d=c}return f=[],(u=w.subtract(t[c-1],t[c+1])).every(t=>0===t)&&(u=w.subtract(t[c-1],t[c]),[u[0],u[1]]=[-u[1],u[0]]),u=w.normalize(u),p=w.mulItems(u,-1),f=(f=f.concat(A(t.slice(0,c+1),e,u,a,i))).concat(A(t.slice(c),p,r,a,i))}function S(t,e,r,a,i,s){r=function(t,e,r,a){var i,s,n,o,l,h,c,d,u,p,f,g,m,v,b=t[0],_=t[t.length-1];for(i=[b,null,null,_],s=w.zeros_Xx2x2(e.length),p=0,f=e.length;p<f;p++)m=e[p],v=1-m,(n=s[p])[0]=w.mulItems(r,3*m*(v*v)),n[1]=w.mulItems(a,3*v*(m*m));for(o=[[0,0],[0,0]],l=[0,0],p=0,f=t.length;p<f;p++)m=e[p],n=s[p],o[0][0]+=w.dot(n[0],n[0]),o[0][1]+=w.dot(n[0],n[1]),o[1][0]+=w.dot(n[0],n[1]),o[1][1]+=w.dot(n[1],n[1]),g=w.subtract(t[p],x.q([b,b,_,_],m)),l[0]+=w.dot(n[0],g),l[1]+=w.dot(n[1],g);u=o[0][0]*o[1][1]-o[1][0]*o[0][1],c=o[0][0]*l[1]-o[1][0]*l[0],h=l[0]*o[1][1]-l[1]*o[0][1],h=0==u?0:h/u,c=0==u?0:c/u,u=w.vectorLen(w.subtract(b,_)),h<(d=1e-6*u)||c<d?(i[1]=w.addArrays(b,w.mulItems(r,u/3)),i[2]=w.addArrays(_,w.mulItems(a,u/3))):(i[1]=w.addArrays(b,w.mulItems(r,h)),i[2]=w.addArrays(_,w.mulItems(a,c)));return i}(t,r,a,i);return[a,i]=function(t,e,r){var a,i,s,n,o,l;a=0,i=Math.floor(t.length/2);var h=c(e,10);for(s=0,n=t.length;s<n;s++)o=t[s],l=function(t,e,r){if(t<0)return 0;if(1<t)return 1;for(var a,i,s,n,o,l=1;l<=r;l++)if(t<=e[l]){n=(l-1)/r,s=l/r,i=e[l-1],a=e[l],o=(t-i)/(a-i)*(s-n)+n;break}return o}(r[s],h,10),l=w.subtract(x.q(e,l),o),o=l[0]*l[0]+l[1]*l[1],a<o&&(a=o,i=s);return[a,i]}(t,r,e),s&&s({bez:r,points:t,params:e,maxErr:a,maxPoint:i}),[r,a,i]}var c=function(t,e){for(var r,a=[0],i=t[0],s=0,n=1;n<=e;n++)r=x.q(t,n/e),s+=w.vectorLen(w.subtract(r,i)),a.push(s),i=r;return a=a.map(t=>t/s)};function s(t,e){return w.normalize(w.subtract(t,e))}class w{static zeros_Xx2x2(t){for(var e=[];t--;)e.push([0,0]);return e}static mulItems(t,e){return t.map(t=>t*e)}static mulMatrix(t,a){return t.reduce((t,e,r)=>t+e*a[r],0)}static subtract(t,r){return t.map((t,e)=>t-r[e])}static addArrays(t,r){return t.map((t,e)=>t+r[e])}static addItems(t,e){return t.map(t=>t+e)}static sum(t){return t.reduce((t,e)=>t+e)}static dot(t,e){return w.mulMatrix(t,e)}static vectorLen(t){return Math.hypot(...t)}static divItems(t,e){return t.map(t=>t/e)}static squareItems(t){return t.map(t=>t*t)}static normalize(t){return this.divItems(t,this.vectorLen(t))}}class x{static q(t,e){var r=1-e,a=w.mulItems(t[0],r*r*r),i=w.mulItems(t[1],3*r*r*e),r=w.mulItems(t[2],3*r*e*e),t=w.mulItems(t[3],e*e*e);return w.addArrays(w.addArrays(a,i),w.addArrays(r,t))}static qprime(t,e){var r=1-e,a=w.mulItems(w.subtract(t[1],t[0]),3*r*r),r=w.mulItems(w.subtract(t[2],t[1]),6*r*e),t=w.mulItems(w.subtract(t[3],t[2]),3*e*e);return w.addArrays(w.addArrays(a,r),t)}static qprimeprime(t,e){return w.addArrays(w.mulItems(w.addArrays(w.subtract(t[2],w.mulItems(t[1],2)),t[0]),6*(1-e)),w.mulItems(w.addArrays(w.subtract(t[3],w.mulItems(t[2],2)),t[1]),6*e))}}t.exports=function(a,t,e){var r,i;if(Array.isArray(a))return a.forEach(t=>{if(!Array.isArray(t)||t.some(t=>"number"!=typeof t)||t.length!==a[0].length)throw Error("Each point should be an array of numbers. Each point should have the same amount of numbers.")}),(a=a.filter((t,r)=>0===r||!t.every((t,e)=>t===a[r-1][e]))).length<2?[]:(i=a.length,r=s(a[1],a[0]),i=s(a[i-2],a[i-1]),A(a,r,i,t,e));throw new TypeError("First argument should be an array")},t.exports.fitCubic=A,t.exports.createTangent=s},(L,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnnotationLayer=void 0;var _=e(1),c=e(137),d=e(134),a=e(157),n=e(158);function u(t,e,r){if(t!==e)throw new TypeError("Private static access of wrong provenance");return r}function r(t,e){var r=t;if(e.has(r))throw new TypeError("Cannot initialize the same private elements twice on an object");e.add(t)}const y=new WeakSet;function p(t){return{width:t[2]-t[0],height:t[3]-t[1]}}class f{static create(t){switch(t.data.annotationType){case _.AnnotationType.LINK:return new h(t);case _.AnnotationType.TEXT:return new m(t);case _.AnnotationType.WIDGET:switch(t.data.fieldType){case"Tx":return new b(t);case"Btn":return t.data.radioButton?new S(t):new(t.data.checkBox?A:w)(t);case"Ch":return new x(t)}return new v(t);case _.AnnotationType.POPUP:return new E(t);case _.AnnotationType.FREETEXT:return new k(t);case _.AnnotationType.LINE:return new P(t);case _.AnnotationType.SQUARE:return new T(t);case _.AnnotationType.CIRCLE:return new M(t);case _.AnnotationType.POLYLINE:return new F(t);case _.AnnotationType.CARET:return new j(t);case _.AnnotationType.INK:return new U(t);case _.AnnotationType.POLYGON:return new N(t);case _.AnnotationType.HIGHLIGHT:return new W(t);case _.AnnotationType.UNDERLINE:return new B(t);case _.AnnotationType.SQUIGGLY:return new G(t);case _.AnnotationType.STRIKEOUT:return new q(t);case _.AnnotationType.STAMP:return new H(t);case _.AnnotationType.FILEATTACHMENT:return new z(t);default:return new i(t)}}}class i{constructor(t){var{isRenderable:e=!1,ignoreBorder:r=!1,createQuadrilaterals:a=!1}=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};this.isRenderable=e,this.data=t.data,this.layer=t.layer,this.page=t.page,this.viewport=t.viewport,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._mouseState=t.mouseState,e&&(this.container=this._createContainer(r)),a&&(this.quadrilaterals=this._createQuadrilaterals(r))}_createContainer(){var t=0<arguments.length&&void 0!==arguments[0]&&arguments[0],e=this.data,r=this.page,a=this.viewport,i=document.createElement("section"),{width:s,height:n}=p(e.rect),[a,o,l,h]=a.viewBox,l=l-a,h=h-o,r=(i.setAttribute("data-annotation-id",e.id),_.Util.normalizeRect([e.rect[0],r.view[3]-e.rect[1]+r.view[1],e.rect[2],r.view[3]-e.rect[3]+r.view[1]]));if(!t&&0<e.borderStyle.width){i.style.borderWidth=e.borderStyle.width+"px";var t=e.borderStyle.horizontalCornerRadius,c=e.borderStyle.verticalCornerRadius;switch(0<t||0<c?i.style.borderRadius=`calc(${t}px * var(--scale-factor)) / calc(${c}px * var(--scale-factor))`:this instanceof S&&(i.style.borderRadius=`calc(${s}px * var(--scale-factor)) / calc(${n}px * var(--scale-factor))`),e.borderStyle.style){case _.AnnotationBorderStyleType.SOLID:i.style.borderStyle="solid";break;case _.AnnotationBorderStyleType.DASHED:i.style.borderStyle="dashed";break;case _.AnnotationBorderStyleType.BEVELED:(0,_.warn)("Unimplemented border style: beveled");break;case _.AnnotationBorderStyleType.INSET:(0,_.warn)("Unimplemented border style: inset");break;case _.AnnotationBorderStyleType.UNDERLINE:i.style.borderBottomStyle="solid"}t=e.borderColor||null;t?i.style.borderColor=_.Util.makeHexColor(0|t[0],0|t[1],0|t[2]):i.style.borderWidth=0}i.style.left=100*(r[0]-a)/l+"%",i.style.top=100*(r[1]-o)/h+"%";c=e.rotation;return e.hasOwnCanvas||0===c?(i.style.width=100*s/l+"%",i.style.height=100*n/h+"%"):this.setRotation(c,i),i}setRotation(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.container,[r,a,i,s]=this.viewport.viewBox,i=i-r,r=s-a,{width:s,height:a}=p(this.data.rect);let n,o;o=t%180==0?(n=100*s/i,100*a/r):(n=100*a/i,100*s/r),e.style.width=n+"%",e.style.height=o+"%",e.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const e=(t,e,r)=>{t=r.detail[t];r.target.style[e]=a.ColorConverters[t[0]+"_HTML"](t.slice(1))};return(0,_.shadow)(this,"_commonActions",{display:t=>{var e=t.detail.display%2==1;this.container.style.visibility=e?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{hidden:e,print:0===t.detail.display||3===t.detail.display})},print:t=>{this.annotationStorage.setValue(this.data.id,{print:t.detail.print})},hidden:t=>{this.container.style.visibility=t.detail.hidden?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{hidden:t.detail.hidden})},focus:t=>{setTimeout(()=>t.target.focus({preventScroll:!1}),0)},userName:t=>{t.target.title=t.detail.userName},readonly:t=>{t.detail.readonly?t.target.setAttribute("readonly",""):t.target.removeAttribute("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=this._commonActions;for(const i of Object.keys(e.detail)){var a=t[i]||r[i];null!=a&&a(e)}}_setDefaultPropertiesFromJS(t){if(this.enableScripting){var e=this.annotationStorage.getRawValue(this.data.id);if(e){var r,a,i=this._commonActions;for([r,a]of Object.entries(e)){var s=i[r];s&&(s({detail:{[r]:a},target:t}),delete e[r])}}}}_createQuadrilaterals(){var t=0<arguments.length&&void 0!==arguments[0]&&arguments[0];if(!this.data.quadPoints)return null;var e=[],r=this.data.rect;for(const a of this.data.quadPoints)this.data.rect=[a[2].x,a[2].y,a[1].x,a[1].y],e.push(this._createContainer(t));return this.data.rect=r,e}_createPopup(t,e){let r=this.container;this.quadrilaterals&&(t=t||this.quadrilaterals,r=this.quadrilaterals[0]),t||((t=document.createElement("div")).className="popupTriggerArea",r.append(t));t=new C({container:r,trigger:t,color:e.color,titleObj:e.titleObj,modificationDate:e.modificationDate,contentsObj:e.contentsObj,richText:e.richText,hideWrapper:!0}).render();t.style.left="100%",r.append(t)}_renderQuadrilaterals(t){for(const e of this.quadrilaterals)e.className=t;return this.quadrilaterals}render(){(0,_.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,r=[];if(this._fieldObjects){var a=this._fieldObjects[t];if(a)for(var{page:i,id:s,exportValues:n}of a)-1!==i&&s!==e&&(i="string"==typeof n?n:null,(n=document.querySelector(`[data-element-id="${s}"]`))&&!y.has(n)?(0,_.warn)("_getElementsByName - element not allowed: "+s):r.push({id:s,exportValue:i,domElement:n}))}else for(const h of document.getElementsByName(t)){var o=h["exportValue"],l=h.getAttribute("data-element-id");l!==e&&y.has(h)&&r.push({id:l,exportValue:o,domElement:h})}return r}static get platform(){var t="undefined"!=typeof navigator?navigator.platform:"";return(0,_.shadow)(this,"platform",{isWin:t.includes("Win"),isMac:t.includes("Mac")})}}var s,o,l=new WeakSet;class h extends i{constructor(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;super(t,{isRenderable:!0,ignoreBorder:!(null==e||!e.ignoreBorder),createQuadrilaterals:!0}),r(this,l),this.isTooltipOnly=t.data.isTooltipOnly}render(){var{data:t,linkService:e}=this;const r=document.createElement("a");r.setAttribute("data-element-id",t.id);let a=!1;return t.url?(e.addLinkAttributes(r,t.url,t.newWindow),a=!0):t.action?(this._bindNamedAction(r,t.action),a=!0):t.attachment?(this._bindAttachment(r,t.attachment),a=!0):t.setOCGState?(function(t,e,r){if(e.has(t))return r;throw new TypeError("attempted to get private field on non-instance")}(this,l,g).call(this,r,t.setOCGState),a=!0):t.dest?(this._bindLink(r,t.dest),a=!0):(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(r,t),a=!0),t.resetForm?(this._bindResetFormAction(r,t.resetForm),a=!0):this.isTooltipOnly&&!a&&(this._bindLink(r,""),a=!0)),this.quadrilaterals?this._renderQuadrilaterals("linkAnnotation").map((t,e)=>{e=0===e?r:r.cloneNode();return t.append(e),t}):(this.container.className="linkAnnotation",a&&this.container.append(r),this.container)}_bindLink(t,e){t.href=this.linkService.getDestinationHash(e),t.onclick=()=>(e&&this.linkService.goToDestination(e),!1),!e&&""!==e||(t.className="internalLink")}_bindNamedAction(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(e),!1),t.className="internalLink"}_bindAttachment(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>{var t;return null!=(t=this.downloadManager)&&t.openOrDownloadData(this.container,e.content,e.filename),!1},t.className="internalLink"}_bindJSAction(t,e){t.href=this.linkService.getAnchorUrl("");var r=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const i of Object.keys(e.actions)){var a=r.get(i);a&&(t[a]=()=>{var t;return null!=(t=this.linkService.eventBus)&&t.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e.id,name:i}}),!1})}t.onclick||(t.onclick=()=>!1),t.className="internalLink"}_bindResetFormAction(t,v){const b=t.onclick;b||(t.href=this.linkService.getAnchorUrl("")),t.className="internalLink",this._fieldObjects?t.onclick=()=>{null!==b&&void 0!==b&&b();var{fields:t,refs:e,include:r}=v,a=[];if(0!==t.length||0!==e.length){var i,s=new Set(e);for(const u of t)for({id:i}of this._fieldObjects[u]||[])s.add(i);for(const p of Object.values(this._fieldObjects))for(const f of p)s.has(f.id)===r&&a.push(f)}else for(const g of Object.values(this._fieldObjects))a.push(...g);var n=this.annotationStorage,o=[];for(const m of a){var l=m["id"];switch(o.push(l),m.type){case"text":var h=m.defaultValue||"";n.setValue(l,{value:h});break;case"checkbox":case"radiobutton":h=m.defaultValue===m.exportValues;n.setValue(l,{value:h});break;case"combobox":case"listbox":var c=m.defaultValue||"";n.setValue(l,{value:c});break;default:continue}var d=document.querySelector(`[data-element-id="${l}"]`);d&&(y.has(d)?d.dispatchEvent(new Event("resetform")):(0,_.warn)("_bindResetFormAction - element not allowed: "+l))}return this.enableScripting&&null!=(e=this.linkService.eventBus)&&e.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:o,name:"ResetForm"}}),!1}:((0,_.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),b||(t.onclick=()=>!1))}}function g(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(e),!1),t.className="internalLink"}class m extends i{constructor(t){var e;super(t,{isRenderable:!!(t.data.hasPopup||null!=(e=t.data.titleObj)&&e.str||null!=(e=t.data.contentsObj)&&e.str||null!=(e=t.data.richText)&&e.str)})}render(){this.container.className="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.hasPopup||this._createPopup(t,this.data),this.container.append(t),this.container}}class v extends i{render(){return this.data.alternativeText&&(this.container.title=this.data.alternativeText),this.container}_getKeyModifier(t){var{isWin:e,isMac:r}=i.platform;return e&&t.ctrlKey||r&&t.metaKey}_setEventListener(t,e,r,a){e.includes("mouse")?t.addEventListener(e,t=>{var e;null!=(e=this.linkService.eventBus)&&e.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:r,value:a(t),shift:t.shiftKey,modifier:this._getKeyModifier(t)}})}):t.addEventListener(e,t=>{var e;null!=(e=this.linkService.eventBus)&&e.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:r,value:a(t)}})})}_setEventListeners(t,e,r){for(var[a,i]of e){var s;("Action"===i||null!=(s=this.data.actions)&&s[i])&&this._setEventListener(t,a,i,r)}}_setBackgroundColor(t){var e=this.data.backgroundColor||null;t.style.backgroundColor=null===e?"transparent":_.Util.makeHexColor(e[0],e[1],e[2])}_setTextStyle(t){var e=this.data.defaultAppearanceData["fontColor"],r=this.data.defaultAppearanceData.fontSize||9,t=t.style;let a;var i,s,n=t=>Math.round(10*t)/10;a=this.data.multiLine?(s=Math.abs(this.data.rect[3]-this.data.rect[1]-2),i=Math.round(s/(_.LINE_FACTOR*r))||1,Math.min(r,n(s/i/_.LINE_FACTOR))):(s=Math.abs(this.data.rect[3]-this.data.rect[1]-2),Math.min(r,n(s/_.LINE_FACTOR))),t.fontSize=`calc(${a}px * var(--scale-factor))`,t.color=_.Util.makeHexColor(e[0],e[1],e[2]),null!==this.data.textAlignment&&(t.textAlign=["left","center","right"][this.data.textAlignment])}_setRequired(t,e){e?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",e)}}class b extends v{constructor(t){super(t,{isRenderable:t.renderForms||!t.data.hasAppearance&&!!t.data.fieldValue})}setPropertyOnSiblings(t,e,r,a){var i=this.annotationStorage;for(const s of this._getElementsByName(t.name,t.id))s.domElement&&(s.domElement[e]=r),i.setValue(s.id,{[a]:r})}render(){const a=this.annotationStorage,h=this.data.id;this.container.className="textWidgetAnnotation";let r=null;if(this.renderForms){var i=a.getValue(h,{value:this.data.fieldValue});let t=i.formattedValue||i.value||"";var s,i=a.getValue(h,{charLimit:this.data.maxLen}).charLimit;const n={userValue:t=i&&t.length>i?t.slice(0,i):t,formattedValue:null,valueOnFocus:""};this.data.multiLine?((r=document.createElement("textarea")).textContent=t,this.data.doNotScroll&&(r.style.overflowY="hidden")):((r=document.createElement("input")).type="text",r.setAttribute("value",t),this.data.doNotScroll&&(r.style.overflowX="hidden")),y.add(r),r.setAttribute("data-element-id",h),r.disabled=this.data.readOnly,r.name=this.data.fieldName,r.tabIndex=1e3,this._setRequired(r,this.data.required),i&&(r.maxLength=i),r.addEventListener("input",t=>{a.setValue(h,{value:t.target.value}),this.setPropertyOnSiblings(r,"value",t.target.value,"value")}),r.addEventListener("resetform",t=>{var e=this.data.defaultFieldValue??"";r.value=n.userValue=e,n.formattedValue=null});let e=t=>{var e=n["formattedValue"];null!=e&&(t.target.value=e),t.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){r.addEventListener("focus",t=>{n.userValue&&(t.target.value=n.userValue),n.valueOnFocus=t.target.value}),r.addEventListener("updatefromsandbox",t=>{this._dispatchEventFromSandbox({value(t){n.userValue=t.detail.value??"",a.setValue(h,{value:n.userValue.toString()}),t.target.value=n.userValue},formattedValue(t){var e=t.detail["formattedValue"];null!=(n.formattedValue=e)&&t.target!==document.activeElement&&(t.target.value=e),a.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=n.userValue;!t||t.length<=r||(t=t.slice(0,r),e.value=n.userValue=t,a.setValue(h,{value:t}),null!=(r=this.linkService.eventBus)&&r.dispatch("dispatcheventinsandbox",{source:this,detail:{id:h,name:"Keystroke",value:t,willCommit:!0,commitKey:1,selStart:e.selectionStart,selEnd:e.selectionEnd}}))}}},t)}),r.addEventListener("keydown",t=>{var e,r;let a=-1;"Escape"===t.key?a=0:"Enter"!==t.key||this.data.multiLine?"Tab"===t.key&&(a=3):a=2,-1!==a&&(r=t.target.value,n.valueOnFocus!==r)&&(n.userValue=r,null!=(e=this.linkService.eventBus))&&e.dispatch("dispatcheventinsandbox",{source:this,detail:{id:h,name:"Keystroke",value:r,willCommit:!0,commitKey:a,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}})});const o=e;e=null,r.addEventListener("blur",t=>{var e,r=t.target["value"];n.userValue=r,this._mouseState.isDown&&n.valueOnFocus!==r&&null!=(e=this.linkService.eventBus)&&e.dispatch("dispatcheventinsandbox",{source:this,detail:{id:h,name:"Keystroke",value:r,willCommit:!0,commitKey:1,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}),o(t)}),null!=(s=this.data.actions)&&s.Keystroke&&r.addEventListener("beforeinput",t=>{var{data:e,target:r}=t,{value:a,selectionStart:i,selectionEnd:s}=r;let n=i,o=s;switch(t.inputType){case"deleteWordBackward":var l=a.substring(0,i).match(/\w*[^\w]*$/);l&&(n-=l[0].length);break;case"deleteWordForward":l=a.substring(i).match(/^[^\w]*\w*/);l&&(o+=l[0].length);break;case"deleteContentBackward":i===s&&--n;break;case"deleteContentForward":i===s&&(o+=1)}t.preventDefault(),null!=(r=this.linkService.eventBus)&&r.dispatch("dispatcheventinsandbox",{source:this,detail:{id:h,name:"Keystroke",value:a,change:e||"",willCommit:!1,selStart:n,selEnd:o}})}),this._setEventListeners(r,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],t=>t.target.value)}e&&r.addEventListener("blur",e),this.data.comb&&(s=(this.data.rect[2]-this.data.rect[0])/i,r.classList.add("comb"),r.style.letterSpacing=`calc(${s}px * var(--scale-factor) - 1ch)`)}else(r=document.createElement("div")).textContent=this.data.fieldValue,r.style.verticalAlign="middle",r.style.display="table-cell";return this._setTextStyle(r),this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}class A extends v{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const i=this.annotationStorage,s=this.data,n=s.id;let t=i.getValue(n,{value:s.exportValue===s.fieldValue}).value;"string"==typeof t&&(t="Off"!==t,i.setValue(n,{value:t})),this.container.className="buttonWidgetAnnotation checkBox";var e=document.createElement("input");return y.add(e),e.setAttribute("data-element-id",n),e.disabled=s.readOnly,this._setRequired(e,this.data.required),e.type="checkbox",e.name=s.fieldName,t&&e.setAttribute("checked",!0),e.setAttribute("exportValue",s.exportValue),e.tabIndex=1e3,e.addEventListener("change",t=>{var{name:t,checked:e}=t.target;for(const a of this._getElementsByName(t,n)){var r=e&&a.exportValue===s.exportValue;a.domElement&&(a.domElement.checked=r),i.setValue(a.id,{value:r})}i.setValue(n,{value:e})}),e.addEventListener("resetform",t=>{var e=s.defaultFieldValue||"Off";t.target.checked=e===s.exportValue}),this.enableScripting&&this.hasJSActions&&(e.addEventListener("updatefromsandbox",t=>{this._dispatchEventFromSandbox({value(t){t.target.checked="Off"!==t.detail.value,i.setValue(n,{value:t.target.checked})}},t)}),this._setEventListeners(e,[["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 S extends v{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.className="buttonWidgetAnnotation radioButton";const i=this.annotationStorage,r=this.data,s=r.id;let t=i.getValue(s,{value:r.fieldValue===r.buttonValue}).value;"string"==typeof t&&(t=t!==r.buttonValue,i.setValue(s,{value:t}));var e=document.createElement("input");if(y.add(e),e.setAttribute("data-element-id",s),e.disabled=r.readOnly,this._setRequired(e,this.data.required),e.type="radio",e.name=r.fieldName,t&&e.setAttribute("checked",!0),e.tabIndex=1e3,e.addEventListener("change",t=>{var{name:t,checked:e}=t.target;for(const r of this._getElementsByName(t,s))i.setValue(r.id,{value:!1});i.setValue(s,{value:e})}),e.addEventListener("resetform",t=>{var e=r.defaultFieldValue;t.target.checked=null!=e&&e===r.buttonValue}),this.enableScripting&&this.hasJSActions){const n=r.buttonValue;e.addEventListener("updatefromsandbox",t=>{this._dispatchEventFromSandbox({value:t=>{var e=n===t.detail.value;for(const a of this._getElementsByName(t.target.name)){var r=e&&a.id===s;a.domElement&&(a.domElement.checked=r),i.setValue(a.id,{value:r})}}},t)}),this._setEventListeners(e,[["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(e),this._setDefaultPropertiesFromJS(e),this.container.append(e),this.container}}class w extends h{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){var t=super.render(),e=(t.className="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 x extends v{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.className="choiceWidgetAnnotation";const n=this.annotationStorage,o=this.data.id;var t=n.getValue(o,{value:this.data.fieldValue});const l=document.createElement("select");y.add(l),l.setAttribute("data-element-id",o),l.disabled=this.data.readOnly,this._setRequired(l,this.data.required),l.name=this.data.fieldName,l.tabIndex=1e3;let e=this.data.combo&&0<this.data.options.length;this.data.combo||(l.size=this.data.options.length,this.data.multiSelect&&(l.multiple=!0)),l.addEventListener("resetform",t=>{var e=this.data.defaultFieldValue;for(const r of l.options)r.selected=r.value===e});for(const a of this.data.options){var r=document.createElement("option");r.textContent=a.displayValue,r.value=a.exportValue,t.value.includes(a.exportValue)&&(r.setAttribute("selected",!0),e=!1),l.append(r)}let i=null;if(e){const s=document.createElement("option");s.value=" ",s.setAttribute("hidden",!0),s.setAttribute("selected",!0),l.prepend(s),i=()=>{s.remove(),l.removeEventListener("input",i),i=null},l.addEventListener("input",i)}const h=(t,e)=>{const r=e?"value":"textContent";e=t.target.options;return t.target.multiple?Array.prototype.filter.call(e,t=>t.selected).map(t=>t[r]):-1===e.selectedIndex?null:e[e.selectedIndex][r]},c=t=>{t=t.target.options;return Array.prototype.map.call(t,t=>({displayValue:t.textContent,exportValue:t.value}))};return this.enableScripting&&this.hasJSActions?(l.addEventListener("updatefromsandbox",t=>{this._dispatchEventFromSandbox({value(t){null!=(e=i)&&e();var e=t.detail.value,r=new Set(Array.isArray(e)?e:[e]);for(const a of l.options)a.selected=r.has(a.value);n.setValue(o,{value:h(t,!0)})},multipleSelection(t){l.multiple=!0},remove(t){var e=l.options,r=t.detail.remove;e[r].selected=!1,l.remove(r),0<e.length&&-1===Array.prototype.findIndex.call(e,t=>t.selected)&&(e[0].selected=!0),n.setValue(o,{value:h(t,!0),items:c(t)})},clear(t){for(;0!==l.length;)l.remove(0);n.setValue(o,{value:null,items:[]})},insert(t){var{index:e,displayValue:r,exportValue:a}=t.detail.insert,e=l.children[e],i=document.createElement("option");i.textContent=r,i.value=a,e?e.before(i):l.append(i),n.setValue(o,{value:h(t,!0),items:c(t)})},items(t){for(var e=t.detail["items"];0!==l.length;)l.remove(0);for(const s of e){var{displayValue:r,exportValue:a}=s,i=document.createElement("option");i.textContent=r,i.value=a,l.append(i)}0<l.options.length&&(l.options[0].selected=!0),n.setValue(o,{value:h(t,!0),items:c(t)})},indices(t){var e=new Set(t.detail.indices);for(const r of t.target.options)r.selected=e.has(r.index);n.setValue(o,{value:h(t,!0)})},editable(t){t.target.disabled=!t.detail.editable}},t)}),l.addEventListener("input",t=>{var e,r=h(t,!0),t=h(t,!1);n.setValue(o,{value:r}),null!=(e=this.linkService.eventBus)&&e.dispatch("dispatcheventinsandbox",{source:this,detail:{id:o,name:"Keystroke",value:t,changeEx:r,willCommit:!0,commitKey:1,keyDown:!1}})}),this._setEventListeners(l,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"]],t=>t.target.checked)):l.addEventListener("input",function(t){n.setValue(o,{value:h(t,!0)})}),this.data.combo&&this._setTextStyle(l),this._setBackgroundColor(l),this._setDefaultPropertiesFromJS(l),this.container.append(l),this.container}}class E extends i{constructor(t){var e=t["data"];super(t,{isRenderable:!E.IGNORE_TYPES.has(e.parentType)&&!!(null!=(t=e.titleObj)&&t.str||null!=(t=e.contentsObj)&&t.str||null!=(t=e.richText)&&t.str)})}render(){this.container.className="popupAnnotation";var t,e,r,a,i,s,n=this.layer.querySelectorAll(`[data-annotation-id="${this.data.parentId}"]`);return 0!==n.length&&(n=new C({container:this.container,trigger:Array.from(n),color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText}),e=this.page,t=(e=_.Util.normalizeRect([this.data.parentRect[0],e.view[3]-this.data.parentRect[1]+e.view[1],this.data.parentRect[2],e.view[3]-this.data.parentRect[3]+e.view[1]]))[0]+this.data.parentRect[2]-this.data.parentRect[0],e=e[1],[r,a,i,s]=this.viewport.viewBox,s=s-a,this.container.style.left=100*(t-r)/(i-r)+"%",this.container.style.top=100*(e-a)/s+"%",this.container.append(n.render())),this.container}}e=E,s="IGNORE_TYPES",o=new Set(["Line","Square","Circle","PolyLine","Polygon","Ink"]),s in e?Object.defineProperty(e,s,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[s]=o;class C{constructor(t){this.container=t.container,this.trigger=t.trigger,this.color=t.color,this.titleObj=t.titleObj,this.modificationDate=t.modificationDate,this.contentsObj=t.contentsObj,this.richText=t.richText,this.hideWrapper=t.hideWrapper||!1,this.pinned=!1}render(){var t=document.createElement("div"),e=(t.className="popupWrapper",this.hideElement=this.hideWrapper?t:this.container,this.hideElement.hidden=!0,document.createElement("div")),r=(e.className="popup",this.color),a=(r&&(a=.7*(255-r[0])+r[0],i=.7*(255-r[1])+r[1],r=.7*(255-r[2])+r[2],e.style.backgroundColor=_.Util.makeHexColor(0|a,0|i,0|r)),document.createElement("h1")),i=(a.dir=this.titleObj.dir,a.textContent=this.titleObj.str,e.append(a),c.PDFDateString.toDateObject(this.modificationDate));i&&((r=document.createElement("span")).className="popupDate",r.textContent="{{date}}, {{time}}",r.dataset.l10nId="annotation_date_string",r.dataset.l10nArgs=JSON.stringify({date:i.toLocaleDateString(),time:i.toLocaleTimeString()}),e.append(r)),null==(a=this.richText)||!a.str||null!=(i=this.contentsObj)&&i.str&&this.contentsObj.str!==this.richText.str?(r=this._formatContents(this.contentsObj),e.append(r)):(n.XfaLayer.render({xfaHtml:this.richText.html,intent:"richText",div:e}),e.lastChild.className="richText popupContent"),Array.isArray(this.trigger)||(this.trigger=[this.trigger]);for(const s of this.trigger)s.addEventListener("click",this._toggle.bind(this)),s.addEventListener("mouseover",this._show.bind(this,!1)),s.addEventListener("mouseout",this._hide.bind(this,!1));return e.addEventListener("click",this._hide.bind(this,!0)),t.append(e),t}_formatContents(t){var{str:t,dir:e}=t,r=document.createElement("p"),a=(r.className="popupContent",r.dir=e,t.split(/(?:\r\n?|\n)/));for(let t=0,e=a.length;t<e;++t){var i=a[t];r.append(document.createTextNode(i)),t<e-1&&r.append(document.createElement("br"))}return r}_toggle(){this.pinned?this._hide(!0):this._show(!0)}_show(){0<arguments.length&&void 0!==arguments[0]&&arguments[0]&&(this.pinned=!0),this.hideElement.hidden&&(this.hideElement.hidden=!1,this.container.style.zIndex=parseInt(this.container.style.zIndex)+1e3)}_hide(){0<arguments.length&&void 0!==arguments[0]&&!arguments[0]||(this.pinned=!1),this.hideElement.hidden||this.pinned||(this.hideElement.hidden=!0,this.container.style.zIndex=parseInt(this.container.style.zIndex)-1e3)}}class k extends i{constructor(t){var e;super(t,{isRenderable:!!(t.data.hasPopup||null!=(e=t.data.titleObj)&&e.str||null!=(e=t.data.contentsObj)&&e.str||null!=(e=t.data.richText)&&e.str),ignoreBorder:!0}),this.textContent=t.data.textContent}render(){if(this.container.className="freeTextAnnotation",this.textContent){var t=document.createElement("div");t.className="annotationTextContent",t.setAttribute("role","comment");for(const r of this.textContent){var e=document.createElement("span");e.textContent=r,t.append(e)}this.container.append(t)}return this.data.hasPopup||this._createPopup(null,this.data),this.container}}class P extends i{constructor(t){var e;super(t,{isRenderable:!!(t.data.hasPopup||null!=(e=t.data.titleObj)&&e.str||null!=(e=t.data.contentsObj)&&e.str||null!=(e=t.data.richText)&&e.str),ignoreBorder:!0})}render(){this.container.className="lineAnnotation";var t=this.data,{width:e,height:r}=p(t.rect),e=this.svgFactory.create(e,r,!0),r=this.svgFactory.createElement("svg:line");return r.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]),r.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]),r.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]),r.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]),r.setAttribute("stroke-width",t.borderStyle.width||1),r.setAttribute("stroke","transparent"),r.setAttribute("fill","transparent"),e.append(r),this.container.append(e),this._createPopup(r,t),this.container}}class T extends i{constructor(t){var e;super(t,{isRenderable:!!(t.data.hasPopup||null!=(e=t.data.titleObj)&&e.str||null!=(e=t.data.contentsObj)&&e.str||null!=(e=t.data.richText)&&e.str),ignoreBorder:!0})}render(){this.container.className="squareAnnotation";var t=this.data,{width:e,height:r}=p(t.rect),a=this.svgFactory.create(e,r,!0),i=t.borderStyle.width,s=this.svgFactory.createElement("svg:rect");return s.setAttribute("x",i/2),s.setAttribute("y",i/2),s.setAttribute("width",e-i),s.setAttribute("height",r-i),s.setAttribute("stroke-width",i||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),a.append(s),this.container.append(a),this._createPopup(s,t),this.container}}class M extends i{constructor(t){var e;super(t,{isRenderable:!!(t.data.hasPopup||null!=(e=t.data.titleObj)&&e.str||null!=(e=t.data.contentsObj)&&e.str||null!=(e=t.data.richText)&&e.str),ignoreBorder:!0})}render(){this.container.className="circleAnnotation";var t=this.data,{width:e,height:r}=p(t.rect),a=this.svgFactory.create(e,r,!0),i=t.borderStyle.width,s=this.svgFactory.createElement("svg:ellipse");return s.setAttribute("cx",e/2),s.setAttribute("cy",r/2),s.setAttribute("rx",e/2-i/2),s.setAttribute("ry",r/2-i/2),s.setAttribute("stroke-width",i||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),a.append(s),this.container.append(a),this._createPopup(s,t),this.container}}class F extends i{constructor(t){var e;super(t,{isRenderable:!!(t.data.hasPopup||null!=(e=t.data.titleObj)&&e.str||null!=(e=t.data.contentsObj)&&e.str||null!=(e=t.data.richText)&&e.str),ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.className=this.containerClassName;var t=this.data,{width:e,height:r}=p(t.rect),e=this.svgFactory.create(e,r,!0);let a=[];for(const n of t.vertices){var i=n.x-t.rect[0],s=t.rect[3]-n.y;a.push(i+","+s)}a=a.join(" ");r=this.svgFactory.createElement(this.svgElementName);return r.setAttribute("points",a),r.setAttribute("stroke-width",t.borderStyle.width||1),r.setAttribute("stroke","transparent"),r.setAttribute("fill","transparent"),e.append(r),this.container.append(e),this._createPopup(r,t),this.container}}class N extends F{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class j extends i{constructor(t){var e;super(t,{isRenderable:!!(t.data.hasPopup||null!=(e=t.data.titleObj)&&e.str||null!=(e=t.data.contentsObj)&&e.str||null!=(e=t.data.richText)&&e.str),ignoreBorder:!0})}render(){return this.container.className="caretAnnotation",this.data.hasPopup||this._createPopup(null,this.data),this.container}}class U extends i{constructor(t){var e;super(t,{isRenderable:!!(t.data.hasPopup||null!=(e=t.data.titleObj)&&e.str||null!=(e=t.data.contentsObj)&&e.str||null!=(e=t.data.richText)&&e.str),ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline"}render(){this.container.className=this.containerClassName;var e=this.data,{width:t,height:r}=p(e.rect),a=this.svgFactory.create(t,r,!0);for(const o of e.inkLists){let t=[];for(const l of o){var i=l.x-e.rect[0],s=e.rect[3]-l.y;t.push(i+","+s)}t=t.join(" ");var n=this.svgFactory.createElement(this.svgElementName);n.setAttribute("points",t),n.setAttribute("stroke-width",e.borderStyle.width||1),n.setAttribute("stroke","transparent"),n.setAttribute("fill","transparent"),this._createPopup(n,e),a.append(n)}return this.container.append(a),this.container}}class W extends i{constructor(t){var e;super(t,{isRenderable:!!(t.data.hasPopup||null!=(e=t.data.titleObj)&&e.str||null!=(e=t.data.contentsObj)&&e.str||null!=(e=t.data.richText)&&e.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("highlightAnnotation"):(this.container.className="highlightAnnotation",this.container)}}class B extends i{constructor(t){var e;super(t,{isRenderable:!!(t.data.hasPopup||null!=(e=t.data.titleObj)&&e.str||null!=(e=t.data.contentsObj)&&e.str||null!=(e=t.data.richText)&&e.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("underlineAnnotation"):(this.container.className="underlineAnnotation",this.container)}}class G extends i{constructor(t){var e;super(t,{isRenderable:!!(t.data.hasPopup||null!=(e=t.data.titleObj)&&e.str||null!=(e=t.data.contentsObj)&&e.str||null!=(e=t.data.richText)&&e.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("squigglyAnnotation"):(this.container.className="squigglyAnnotation",this.container)}}class q extends i{constructor(t){var e;super(t,{isRenderable:!!(t.data.hasPopup||null!=(e=t.data.titleObj)&&e.str||null!=(e=t.data.contentsObj)&&e.str||null!=(e=t.data.richText)&&e.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){return this.data.hasPopup||this._createPopup(null,this.data),this.quadrilaterals?this._renderQuadrilaterals("strikeoutAnnotation"):(this.container.className="strikeoutAnnotation",this.container)}}class H extends i{constructor(t){var e;super(t,{isRenderable:!!(t.data.hasPopup||null!=(e=t.data.titleObj)&&e.str||null!=(e=t.data.contentsObj)&&e.str||null!=(e=t.data.richText)&&e.str),ignoreBorder:!0})}render(){return this.container.className="stampAnnotation",this.data.hasPopup||this._createPopup(null,this.data),this.container}}class z extends i{constructor(t){super(t,{isRenderable:!0});var e,{filename:t,content:r}=this.data.file;this.filename=(0,c.getFilenameFromUrl)(t),this.content=r,null!=(e=this.linkService.eventBus)&&e.dispatch("fileattachmentannotation",{source:this,filename:t,content:r})}render(){this.container.className="fileAttachmentAnnotation";var t,e=document.createElement("div");return e.className="popupTriggerArea",e.addEventListener("dblclick",this._download.bind(this)),!this.data.hasPopup&&(null!=(t=this.data.titleObj)&&t.str||null!=(t=this.data.contentsObj)&&t.str||this.data.richText)&&this._createPopup(e,this.data),this.container.append(e),this.container}_download(){var t;null!=(t=this.downloadManager)&&t.openOrDownloadData(this.container,this.content,this.filename)}}function R(t,e,r,a){var i=t.firstChild||t;i.id=""+c.AnnotationPrefix+e,r.append(t),null!=a&&a.moveElementInDOM(r,t,i,!1)}function O(t,e){var{width:e,height:r,rotation:a}=e,i=t["style"],s=a%180!=0,e=Math.floor(e)+"px",r=Math.floor(r)+"px";i.width=s?r:e,i.height=s?e:r,t.setAttribute("data-main-rotation",a)}function D(t,e){if(e){for(var[r,a]of e){var i,r=t.querySelector(`[data-annotation-id="${r}"]`);r&&(i=r["firstChild"],i?"CANVAS"===i.nodeName?i.replaceWith(a):i.before(a):r.append(a))}e.clear()}}t.AnnotationLayer=class I{static render(t){var{annotations:e,div:r,viewport:a,accessibilityManager:i}=t;u(this,I,O).call(this,r,a);let s=0;for(const l of e){if(l.annotationType!==_.AnnotationType.POPUP){var{width:n,height:o}=p(l.rect);if(n<=0||o<=0)continue}if((n=f.create({data:l,layer:r,page:t.page,viewport:a,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:!1!==t.renderForms,svgFactory:new c.DOMSVGFactory,annotationStorage:t.annotationStorage||new d.AnnotationStorage,enableScripting:t.enableScripting,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,mouseState:t.mouseState||{isDown:!1}})).isRenderable)if(o=n.render(),l.hidden&&(o.style.visibility="hidden"),Array.isArray(o))for(const h of o)h.style.zIndex=s++,u(I,I,R).call(I,h,l.id,r,i);else o.style.zIndex=s++,n instanceof E?r.prepend(o):u(I,I,R).call(I,o,l.id,r,i)}u(this,I,D).call(this,r,t.annotationCanvasMap)}static update(t){var{annotationCanvasMap:t,div:e,viewport:r}=t;u(this,I,O).call(this,e,r),u(this,I,D).call(this,e,t),e.hidden=!1}}},(t,e)=>{"use strict";function a(t){return Math.floor(255*Math.max(0,Math.min(1,t))).toString(16).padStart(2,"0")}Object.defineProperty(e,"__esModule",{value:!0}),e.ColorConverters=void 0;e.ColorConverters=class{static CMYK_G(t){var[t,e,r,a]=t;return["G",1-Math.min(1,.3*t+.59*r+.11*e+a)]}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_HTML(t){var[t]=t,t=a(t);return"#"+t+t+t}static RGB_G(t){var[t,e,r]=t;return["G",.3*t+.59*e+.11*r]}static RGB_HTML(t){var[t,e,r]=t;return"#"+a(t)+a(e)+a(r)}static T_HTML(){return"#00000000"}static CMYK_RGB(t){var[t,e,r,a]=t;return["RGB",1-Math.min(1,t+a),1-Math.min(1,r+a),1-Math.min(1,e+a)]}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,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.XfaLayer=void 0;var p=r(149);e.XfaLayer=class{static setupStorage(t,e,r,a,i){var s=a.getValue(e,{value:null});switch(r.name){case"textarea":null!==s.value&&(t.textContent=s.value),"print"!==i&&t.addEventListener("input",t=>{a.setValue(e,{value:t.target.value})});break;case"input":if("radio"===r.attributes.type||"checkbox"===r.attributes.type){if(s.value===r.attributes.xfaOn?t.setAttribute("checked",!0):s.value===r.attributes.xfaOff&&t.removeAttribute("checked"),"print"===i)break;t.addEventListener("change",t=>{a.setValue(e,{value:t.target.checked?t.target.getAttribute("xfaOn"):t.target.getAttribute("xfaOff")})})}else{if(null!==s.value&&t.setAttribute("value",s.value),"print"===i)break;t.addEventListener("input",t=>{a.setValue(e,{value:t.target.value})})}break;case"select":if(null!==s.value)for(const n of r.children)n.attributes.value===s.value&&(n.attributes.selected=!0);t.addEventListener("input",t=>{t=t.target.options,t=-1===t.selectedIndex?"":t[t.selectedIndex].value;a.setValue(e,{value:t})})}}static setAttributes(t){var e,r,{html:a,element:t,storage:i=null,intent:s,linkService:n}=t,o=t["attributes"],l=a instanceof HTMLAnchorElement;"radio"===o.type&&(o.name=o.name+"-"+s);for([e,r]of Object.entries(o))if(null!==r&&void 0!==r)switch(e){case"class":r.length&&a.setAttribute(e,r.join(" "));break;case"dataId":break;case"id":a.setAttribute("data-element-id",r);break;case"style":Object.assign(a.style,r);break;case"textContent":a.textContent=r;break;default:l&&("href"===e||"newWindow"===e)||a.setAttribute(e,r)}l&&n.addLinkAttributes(a,o.href,o.newWindow),i&&o.dataId&&this.setupStorage(a,o.dataId,t,i)}static render(t){for(var e=t.annotationStorage,r=t.linkService,a=t.xfaHtml,i=t.intent||"display",s=document.createElement(a.name),n=(a.attributes&&this.setAttributes({html:s,element:a,intent:i,linkService:r}),[[a,-1,s]]),a=t.div,o=(a.append(s),t.viewport&&(s=`matrix(${t.viewport.transform.join(",")})`,a.style.transform=s),"richText"!==i&&a.setAttribute("class","xfaLayer xfaFont"),[]);0<n.length;){var[l,h,c]=n.at(-1);if(h+1===l.children.length)n.pop();else{h=l.children[++n.at(-1)[1]];if(null!==h){l=h["name"];if("#text"===l){var d=document.createTextNode(h.value);o.push(d),c.append(d)}else{let t;t=null!=h&&null!=(d=h.attributes)&&d.xmlns?document.createElementNS(h.attributes.xmlns,l):document.createElement(l),c.append(t),h.attributes&&this.setAttributes({html:t,element:h,storage:e,intent:i,linkService:r}),h.children&&0<h.children.length?n.push([h,-1,t]):h.value&&(c=document.createTextNode(h.value),p.XfaText.shouldBuildText(l)&&o.push(c),t.append(c))}}}}for(const u of a.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))u.setAttribute("readOnly",!0);return{textDivs:o}}static update(t){var e=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=e,t.div.hidden=!1}}},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TextLayerRenderTask=void 0,e.renderTextLayer=function(t){var e=new a({textContent:t.textContent,textContentStream:t.textContentStream,container:t.container,viewport:t.viewport,textDivs:t.textDivs,textContentItemsStr:t.textContentItemsStr});return e._render(t.timeout),e};var u=r(1);const p=30,f=.8,g=new Map;function i(t,e,r,a){var i=document.createElement("span"),s={angle:0,canvasWidth:0,hasText:""!==e.str,hasEOL:e.hasEOL,fontSize:0},n=(t._textDivs.push(i),u.Util.transform(t._viewport.transform,e.transform));let o=Math.atan2(n[1],n[0]);var r=r[e.fontName],l=(r.vertical&&(o+=Math.PI/2),Math.hypot(n[2],n[3])),a=l*function(t,e){var r=g.get(t);if(r)return r;e.save(),e.font=p+"px "+t;let a=(r=e.measureText("")).fontBoundingBoxAscent,i=Math.abs(r.fontBoundingBoxDescent);if(a)return e.restore(),r=a/(a+i),g.set(t,r),r;e.strokeStyle="red",e.clearRect(0,0,p,p),e.strokeText("g",0,0);let s=e.getImageData(0,0,p,p).data;i=0;for(let t=s.length-1-3;0<=t;t-=4)if(0<s[t]){i=Math.ceil(t/4/p);break}e.clearRect(0,0,p,p),e.strokeText("A",0,p),s=e.getImageData(0,0,p,p).data;for(let t=a=0,e=s.length;t<e;t+=4)if(0<s[t]){a=p-Math.floor(t/4/p);break}return e.restore(),a?(r=a/(a+i),g.set(t,r),r):(g.set(t,f),f)}(r.fontFamily,a);let h,c,d=(c=0===o?(h=n[4],n[5]-a):(h=n[4]+a*Math.sin(o),n[5]-a*Math.cos(o)),i.style.left=h+"px",i.style.top=c+"px",i.style.fontSize=l+"px",i.style.fontFamily=r.fontFamily,s.fontSize=l,i.setAttribute("role","presentation"),i.textContent=e.str,i.dir=e.dir,t._fontInspectorEnabled&&(i.dataset.fontName=e.fontName),0!==o&&(s.angle=o*(180/Math.PI)),!1);(d=1<e.str.length||" "!==e.str&&e.transform[0]!==e.transform[3]&&(n=Math.abs(e.transform[0]))!==(a=Math.abs(e.transform[3]))&&1.5<Math.max(n,a)/Math.min(n,a)?!0:d)&&(r.vertical?s.canvasWidth=e.height*t._viewport.scale:s.canvasWidth=e.width*t._viewport.scale),t._textDivProperties.set(i,s),t._textContentStream&&t._layoutText(i)}function n(t){if(!t._canceled){var e=t._textDivs,r=t._capability,a=e.length;if(!(1e5<a||t._textContentStream))for(const i of e)t._layoutText(i);t._renderingDone=!0,r.resolve()}}class a{constructor(t){var{textContent:t,textContentStream:e,container:r,viewport:a,textDivs:i,textContentItemsStr:s}=t;this._textContent=t,this._textContentStream=e,this._container=r,this._document=r.ownerDocument,this._viewport=a,this._textDivs=i||[],this._textContentItemsStr=s||[],this._fontInspectorEnabled=!(null==(t=globalThis.FontInspector)||!t.enabled),this._reader=null,this._layoutTextLastFontSize=null,this._layoutTextLastFontFamily=null,this._layoutTextCtx=null,this._textDivProperties=new WeakMap,this._renderingDone=!1,this._canceled=!1,this._capability=(0,u.createPromiseCapability)(),this._renderTimer=null,this._bounds=[],this._devicePixelRatio=globalThis.devicePixelRatio||1,this._capability.promise.finally(()=>{this._textDivProperties=null,this._layoutTextCtx&&(this._layoutTextCtx.canvas.width=0,this._layoutTextCtx.canvas.height=0,this._layoutTextCtx=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),null!==this._renderTimer&&(clearTimeout(this._renderTimer),this._renderTimer=null),this._capability.reject(new Error("TextLayer task cancelled."))}_processItems(t,e){for(const a of t){var r;void 0===a.str?"beginMarkedContentProps"===a.type||"beginMarkedContent"===a.type?(r=this._container,this._container=document.createElement("span"),this._container.classList.add("markedContent"),null!==a.id&&this._container.setAttribute("id",""+a.id),r.append(this._container)):"endMarkedContent"===a.type&&(this._container=this._container.parentNode):(this._textContentItemsStr.push(a.str),i(this,a,e,this._layoutTextCtx))}}_layoutText(t){var e,r,a=this._textDivProperties.get(t);let i="";0!==a.canvasWidth&&a.hasText&&(r=t.style["fontFamily"],e=a["fontSize"],e=(e===this._layoutTextLastFontSize&&r===this._layoutTextLastFontFamily||(this._layoutTextCtx.font=e*this._devicePixelRatio+"px "+r,this._layoutTextLastFontSize=e,this._layoutTextLastFontFamily=r),this._layoutTextCtx.measureText(t.textContent))["width"],0<e)&&(i=`scaleX(${this._devicePixelRatio*a.canvasWidth/e})`),0<(i=0!==a.angle?`rotate(${a.angle}deg) `+i:i).length&&(t.style.transform=i),a.hasText&&this._container.append(t),a.hasEOL&&((r=document.createElement("br")).setAttribute("role","presentation"),this._container.append(r))}_render(){let t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0;const r=(0,u.createPromiseCapability)();let a=Object.create(null);var e=this._document.createElement("canvas");if(e.height=e.width=p,this._layoutTextCtx=e.getContext("2d",{alpha:!1}),this._textContent){var e=this._textContent.items,i=this._textContent.styles;this._processItems(e,i),r.resolve()}else{if(!this._textContentStream)throw new Error('Neither "textContent" nor "textContentStream" parameters specified.');{const s=()=>{this._reader.read().then(t=>{var{value:t,done:e}=t;e?r.resolve():(Object.assign(a,t.styles),this._processItems(t.items,a),s())},r.reject)};this._reader=this._textContentStream.getReader(),s()}}r.promise.then(()=>{a=null,t?this._renderTimer=setTimeout(()=>{n(this),this._renderTimer=null},t):n(this)},this._capability.reject)}}e.TextLayerRenderTask=a},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SVGGraphics=void 0;var i=r(137),A=r(1),v=r(3);e.SVGGraphics=class{constructor(){(0,A.unreachable)("Not implemented: SVGGraphics")}};{const x={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},a=["butt","round","square"],n=["miter","round","bevel"],b=function(r){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"";if(URL.createObjectURL&&"undefined"!=typeof Blob&&!(2<arguments.length&&void 0!==arguments[2]&&arguments[2]))return URL.createObjectURL(new Blob([r],{type:t}));var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let i=`data:${t};base64,`;for(let t=0,e=r.length;t<e;t+=3){var s=255&r[t],n=255&r[t+1],o=255&r[t+2],l=t+1<e?(15&n)<<2|o>>6:64,o=t+2<e?63&o:64;i+=a[s>>2]+a[(3&s)<<4|n>>4]+a[l]+a[o]}return i},l=function(){const 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,a){var i=a,s=e.length,s=(r[i]=s>>24&255,r[i+1]=s>>16&255,r[i+2]=s>>8&255,r[i+3]=255&s,r[i+=4]=255&t.charCodeAt(0),r[i+1]=255&t.charCodeAt(1),r[i+2]=255&t.charCodeAt(2),r[i+3]=255&t.charCodeAt(3),r.set(e,i+=4),function(e,r,a){let i=-1;for(let t=r;t<a;t++){var s=255&(i^e[t]),s=n[s];i=i>>>8^s}return-1^i}(r,a+4,i+=e.length));r[i]=s>>24&255,r[i+1]=s>>16&255,r[i+2]=s>>8&255,r[i+3]=255&s}function m(t){let e=t.length;var r=65535,a=Math.ceil(e/r),i=new Uint8Array(2+e+5*a+4);let s=0,n=(i[s++]=120,i[s++]=156,0);for(;e>r;)i[s++]=0,i[s++]=255,i[s++]=255,i[s++]=0,i[s++]=0,i.set(t.subarray(n,n+r),s),s+=r,n+=r,e-=r;i[s++]=1,i[s++]=255&e,i[s++]=e>>8&255,i[s++]=255&~e,i[s++]=(65535&~e)>>8&255,i.set(t.subarray(n),s),s+=t.length-n;a=function(e,r,a){let i=1,s=0;for(let t=r;t<a;++t)i=(i+(255&e[t]))%65521,s=(s+i)%65521;return s<<16|i}(t,0,t.length);return i[s++]=a>>24&255,i[s++]=a>>16&255,i[s++]=a>>8&255,i[s++]=255&a,i}function a(t,e,r,a){var i=t.width,s=t.height;let n,o,l;var h=t.data;switch(e){case A.ImageKind.GRAYSCALE_1BPP:o=0,n=1,l=i+7>>3;break;case A.ImageKind.RGB_24BPP:o=2,n=8,l=3*i;break;case A.ImageKind.RGBA_32BPP:o=6,n=8,l=4*i;break;default:throw new Error("invalid format")}var c=new Uint8Array((1+l)*s);let d=0,u=0;for(let t=0;t<s;++t)c[d++]=0,c.set(h.subarray(u,u+l),d),u+=l,d+=l;if(e===A.ImageKind.GRAYSCALE_1BPP&&a)for(let t=d=0;t<s;t++){d++;for(let t=0;t<l;t++)c[d++]^=255}var t=new Uint8Array([i>>24&255,i>>16&255,i>>8&255,255&i,s>>24&255,s>>16&255,s>>8&255,255&s,n,o,0,0,0]),e=function(e){if(v.isNodeJS)try{let t;t=8<=parseInt(process.versions.node)?e:Buffer.from(e);var r=require("zlib").deflateSync(t,{level:9});return r instanceof Uint8Array?r:new Uint8Array(r)}catch(t){(0,A.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+t)}return m(e)}(c),a=f.length+36+t.length+e.length,a=new Uint8Array(a),p=0;return a.set(f,0),g("IHDR",t,a,p+=f.length),g("IDATA",e,a,p+=12+t.length),p+=12+e.length,g("IEND",new Uint8Array(0),a,p),b(a,"image/png",r)}return function(t,e,r){return a(t,void 0===t.kind?A.ImageKind.GRAYSCALE_1BPP:t.kind,e,r)}}();class h{constructor(){this.fontSizeScale=1,this.fontWeight=x.fontWeight,this.fontSize=0,this.textMatrix=A.IDENTITY_MATRIX,this.fontMatrix=A.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=A.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=x.fillColor,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 S(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 w(t){if(0===t[4]&&0===t[5]){if(0===t[1]&&0===t[2])return 1===t[0]&&1===t[3]?"":`scale(${S(t[0])} ${S(t[3])})`;if(t[0]===t[3]&&t[1]===-t[2])return`rotate(${S(180*Math.acos(t[0])/Math.PI)})`}else if(1===t[0]&&0===t[1]&&0===t[2]&&1===t[3])return`translate(${S(t[4])} ${S(t[5])})`;return`matrix(${S(t[0])} ${S(t[1])} ${S(t[2])} ${S(t[3])} ${S(t[4])} `+S(t[5])+")"}let s=0,o=0,f=0;e.SVGGraphics=class{constructor(t,e){var r=2<arguments.length&&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 h,this.transformMatrix=A.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=!!r,this._operatorIdMapping=[];for(const a in A.OPS)this._operatorIdMapping[A.OPS[a]]=a}getObject(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;return"string"==typeof t?(t.startsWith("g_")?this.commonObjs:this.objs).get(t):e}save(){this.transformStack.push(this.transformMatrix);var 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){var r=t.fnArray,a=t.argsArray;for(let t=0,e=r.length;t<e;t++)if(r[t]===A.OPS.dependency)for(const s of a[t]){const n=s.startsWith("g_")?this.commonObjs:this.objs;var i=new Promise(t=>{n.get(s,t)});this.current.dependencies.push(i)}return Promise.all(this.current.dependencies)}transform(t,e,r,a,i,s){this.transformMatrix=A.Util.transform(this.transformMatrix,[t,e,r,a,i,s]),this.tgrp=null}getSVG(t,e){this.viewport=e;const r=this._initialize(e);return this.loadDependencies(t).then(()=>(this.transformMatrix=A.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(t)),r))}convertOpList(e){var r=this._operatorIdMapping,a=e.argsArray,i=e.fnArray,s=[];for(let t=0,e=i.length;t<e;t++){var n=i[t];s.push({fnId:n,fn:r[n],args:a[t]})}{let t=[];var o=[];for(const l of e=s)"save"===l.fn?(t.push({fnId:92,fn:"group",items:[]}),o.push(t),t=t.at(-1).items):"restore"===l.fn?t=o.pop():t.push(l);return t}}executeOpTree(t){for(const i of t){var e=i.fn,r=i.fnId,a=i.args;switch(0|r){case A.OPS.beginText:this.beginText();break;case A.OPS.dependency:break;case A.OPS.setLeading:this.setLeading(a);break;case A.OPS.setLeadingMoveText:this.setLeadingMoveText(a[0],a[1]);break;case A.OPS.setFont:this.setFont(a);break;case A.OPS.showText:case A.OPS.showSpacedText:this.showText(a[0]);break;case A.OPS.endText:this.endText();break;case A.OPS.moveText:this.moveText(a[0],a[1]);break;case A.OPS.setCharSpacing:this.setCharSpacing(a[0]);break;case A.OPS.setWordSpacing:this.setWordSpacing(a[0]);break;case A.OPS.setHScale:this.setHScale(a[0]);break;case A.OPS.setTextMatrix:this.setTextMatrix(a[0],a[1],a[2],a[3],a[4],a[5]);break;case A.OPS.setTextRise:this.setTextRise(a[0]);break;case A.OPS.setTextRenderingMode:this.setTextRenderingMode(a[0]);break;case A.OPS.setLineWidth:this.setLineWidth(a[0]);break;case A.OPS.setLineJoin:this.setLineJoin(a[0]);break;case A.OPS.setLineCap:this.setLineCap(a[0]);break;case A.OPS.setMiterLimit:this.setMiterLimit(a[0]);break;case A.OPS.setFillRGBColor:this.setFillRGBColor(a[0],a[1],a[2]);break;case A.OPS.setStrokeRGBColor:this.setStrokeRGBColor(a[0],a[1],a[2]);break;case A.OPS.setStrokeColorN:this.setStrokeColorN(a);break;case A.OPS.setFillColorN:this.setFillColorN(a);break;case A.OPS.shadingFill:this.shadingFill(a[0]);break;case A.OPS.setDash:this.setDash(a[0],a[1]);break;case A.OPS.setRenderingIntent:this.setRenderingIntent(a[0]);break;case A.OPS.setFlatness:this.setFlatness(a[0]);break;case A.OPS.setGState:this.setGState(a[0]);break;case A.OPS.fill:this.fill();break;case A.OPS.eoFill:this.eoFill();break;case A.OPS.stroke:this.stroke();break;case A.OPS.fillStroke:this.fillStroke();break;case A.OPS.eoFillStroke:this.eoFillStroke();break;case A.OPS.clip:this.clip("nonzero");break;case A.OPS.eoClip:this.clip("evenodd");break;case A.OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case A.OPS.paintImageXObject:this.paintImageXObject(a[0]);break;case A.OPS.paintInlineImageXObject:this.paintInlineImageXObject(a[0]);break;case A.OPS.paintImageMaskXObject:this.paintImageMaskXObject(a[0]);break;case A.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(a[0],a[1]);break;case A.OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case A.OPS.closePath:this.closePath();break;case A.OPS.closeStroke:this.closeStroke();break;case A.OPS.closeFillStroke:this.closeFillStroke();break;case A.OPS.closeEOFillStroke:this.closeEOFillStroke();break;case A.OPS.nextLine:this.nextLine();break;case A.OPS.transform:this.transform(a[0],a[1],a[2],a[3],a[4],a[5]);break;case A.OPS.constructPath:this.constructPath(a[0],a[1]);break;case A.OPS.endPath:this.endPath();break;case 92:this.group(i.items);break;default:(0,A.warn)("Unimplemented operator "+e)}}}setWordSpacing(t){this.current.wordSpacing=t}setCharSpacing(t){this.current.charSpacing=t}nextLine(){this.moveText(0,this.current.leading)}setTextMatrix(t,e,r,a,i,s){var n=this.current;n.textMatrix=n.lineMatrix=[t,e,r,a,i,s],n.textMatrixScale=Math.hypot(t,e),n.x=n.lineX=0,n.y=n.lineY=0,n.xcoords=[],n.ycoords=[],n.tspan=this.svgFactory.createElement("svg:tspan"),n.tspan.setAttributeNS(null,"font-family",n.fontFamily),n.tspan.setAttributeNS(null,"font-size",S(n.fontSize)+"px"),n.tspan.setAttributeNS(null,"y",S(-n.y)),n.txtElement=this.svgFactory.createElement("svg:text"),n.txtElement.append(n.tspan)}beginText(){var t=this.current;t.x=t.lineX=0,t.y=t.lineY=0,t.textMatrix=A.IDENTITY_MATRIX,t.lineMatrix=A.IDENTITY_MATRIX,t.textMatrixScale=1,t.tspan=this.svgFactory.createElement("svg:tspan"),t.txtElement=this.svgFactory.createElement("svg:text"),t.txtgrp=this.svgFactory.createElement("svg:g"),t.xcoords=[],t.ycoords=[]}moveText(t,e){var r=this.current;r.x=r.lineX+=t,r.y=r.lineY+=e,r.xcoords=[],r.ycoords=[],r.tspan=this.svgFactory.createElement("svg:tspan"),r.tspan.setAttributeNS(null,"font-family",r.fontFamily),r.tspan.setAttributeNS(null,"font-size",S(r.fontSize)+"px"),r.tspan.setAttributeNS(null,"y",S(-r.y))}showText(e){var s=this.current,n=s.font,r=s.fontSize;if(0!==r){var o=s.fontSizeScale,l=s.charSpacing,h=s.wordSpacing,c=s.fontDirection,a=s.textHScale*c,d=n.vertical,u=d?1:-1,p=n.defaultVMetrics,f=r*s.fontMatrix[0];let i=0;for(const y of e)if(null===y)i+=c*h;else if("number"==typeof y)i+=u*y*r/1e3;else{var g,m,v,b=(y.isSpace?h:0)+l,_=y.fontChar;let t,e,r=y.width;e=d?(g=y.vmetric||p,m=y.vmetric?g[1]:.5*r,v=g[2]*f,r=g?-g[0]:r,t=(m=-m*f)/o,(i+v)/o):(t=i/o,0),(y.isInFont||n.missingFile)&&(s.xcoords.push(s.x+t),d&&s.ycoords.push(-s.y+e),s.tspan.textContent+=_);let a;a=d?r*f-b*c:r*f+b*c,i+=a}s.tspan.setAttributeNS(null,"x",s.xcoords.map(S).join(" ")),d?s.tspan.setAttributeNS(null,"y",s.ycoords.map(S).join(" ")):s.tspan.setAttributeNS(null,"y",S(-s.y)),d?s.y-=i:s.x+=i*a,s.tspan.setAttributeNS(null,"font-family",s.fontFamily),s.tspan.setAttributeNS(null,"font-size",S(s.fontSize)+"px"),s.fontStyle!==x.fontStyle&&s.tspan.setAttributeNS(null,"font-style",s.fontStyle),s.fontWeight!==x.fontWeight&&s.tspan.setAttributeNS(null,"font-weight",s.fontWeight);var e=s.textRenderingMode&A.TextRenderingMode.FILL_STROKE_MASK;e===A.TextRenderingMode.FILL||e===A.TextRenderingMode.FILL_STROKE?(s.fillColor!==x.fillColor&&s.tspan.setAttributeNS(null,"fill",s.fillColor),s.fillAlpha<1&&s.tspan.setAttributeNS(null,"fill-opacity",s.fillAlpha)):s.textRenderingMode===A.TextRenderingMode.ADD_TO_PATH?s.tspan.setAttributeNS(null,"fill","transparent"):s.tspan.setAttributeNS(null,"fill","none"),e!==A.TextRenderingMode.STROKE&&e!==A.TextRenderingMode.FILL_STROKE||(e=1/(s.textMatrixScale||1),this._setStrokeAttributes(s.tspan,e));let t=s.textMatrix;0!==s.textRise&&((t=t.slice())[5]+=s.textRise),s.txtElement.setAttributeNS(null,"transform",`${w(t)} scale(${S(a)}, -1)`),s.txtElement.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),s.txtElement.append(s.tspan),s.txtgrp.append(s.txtElement),this._ensureTransformGroup().append(s.txtElement)}}setLeadingMoveText(t,e){this.setLeading(-e),this.moveText(t,e)}addFontStyle(t){if(!t.data)throw new Error('addFontStyle: No font data available, ensure that the "fontExtraProperties" API parameter is set.');this.cssStyle||(this.cssStyle=this.svgFactory.createElement("svg:style"),this.cssStyle.setAttributeNS(null,"type","text/css"),this.defs.append(this.cssStyle));var e=b(t.data,t.mimetype,this.forceDataSchema);this.cssStyle.textContent+=`@font-face { font-family: "${t.loadedName}";`+` src: url(${e}); }
`}setFont(t){var e=this.current,r=this.commonObjs.get(t[0]);let a=t[1],i=(e.font=r,!this.embedFonts||r.missingFile||this.embeddedFonts[r.loadedName]||(this.addFontStyle(r),this.embeddedFonts[r.loadedName]=r),e.fontMatrix=r.fontMatrix||A.FONT_IDENTITY_MATRIX,"normal");r.black?i="900":r.bold&&(i="bold");t=r.italic?"italic":"normal";a<0?(a=-a,e.fontDirection=-1):e.fontDirection=1,e.fontSize=a,e.fontFamily=r.loadedName,e.fontWeight=i,e.fontStyle=t,e.tspan=this.svgFactory.createElement("svg:tspan"),e.tspan.setAttributeNS(null,"y",S(-e.y)),e.xcoords=[],e.ycoords=[]}endText(){var t,e=this.current;e.textRenderingMode&A.TextRenderingMode.ADD_TO_PATH_FLAG&&null!=(t=e.txtElement)&&t.hasChildNodes()&&(e.element=e.txtElement,this.clip("nonzero"),this.endPath())}setLineWidth(t){0<t&&(this.current.lineWidth=t)}setLineCap(t){this.current.lineCap=a[t]}setLineJoin(t){this.current.lineJoin=n[t]}setMiterLimit(t){this.current.miterLimit=t}setStrokeAlpha(t){this.current.strokeAlpha=t}setStrokeRGBColor(t,e,r){this.current.strokeColor=A.Util.makeHexColor(t,e,r)}setFillAlpha(t){this.current.fillAlpha=t}setFillRGBColor(t,e,r){this.current.fillColor=A.Util.makeHexColor(t,e,r),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){var e=this.viewport.width,r=this.viewport.height,a=A.Util.inverseTransform(this.transformMatrix),i=A.Util.applyTransform([0,0],a),s=A.Util.applyTransform([0,r],a),n=A.Util.applyTransform([e,0],a),e=A.Util.applyTransform([e,r],a),r=Math.min(i[0],s[0],n[0],e[0]),a=Math.min(i[1],s[1],n[1],e[1]),o=Math.max(i[0],s[0],n[0],e[0]),i=Math.max(i[1],s[1],n[1],e[1]),s=this.svgFactory.createElement("svg:rect");s.setAttributeNS(null,"x",r),s.setAttributeNS(null,"y",a),s.setAttributeNS(null,"width",o-r),s.setAttributeNS(null,"height",i-a),s.setAttributeNS(null,"fill",this._makeShadingPattern(t)),this.current.fillAlpha<1&&s.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(s)}_makeColorN_Pattern(t){return"TilingPattern"===t[0]?this._makeTilingPattern(t):this._makeShadingPattern(t)}_makeTilingPattern(t){var e=t[1],r=t[2],a=t[3]||A.IDENTITY_MATRIX,[i,s,n,o]=t[4],l=t[5],h=t[6],t=t[7],c="shading"+f++,[i,s,n,o]=A.Util.normalizeRect([...A.Util.applyTransform([i,s],a),...A.Util.applyTransform([n,o],a)]),[d,u]=A.Util.singularValueDecompose2dScale(a),l=l*d,d=h*u,h=this.svgFactory.createElement("svg:pattern"),u=(h.setAttributeNS(null,"id",c),h.setAttributeNS(null,"patternUnits","userSpaceOnUse"),h.setAttributeNS(null,"width",l),h.setAttributeNS(null,"height",d),h.setAttributeNS(null,"x",""+i),h.setAttributeNS(null,"y",""+s),this.svg),l=this.transformMatrix,d=this.current.fillColor,p=this.current.strokeColor,n=this.svgFactory.create(n-i,o-s);return this.svg=n,this.transformMatrix=a,2===t&&(i=A.Util.makeHexColor(...e),this.current.fillColor=i,this.current.strokeColor=i),this.executeOpTree(this.convertOpList(r)),this.svg=u,this.transformMatrix=l,this.current.fillColor=d,this.current.strokeColor=p,h.append(n.childNodes[0]),this.defs.append(h),`url(#${c})`}_makeShadingPattern(e){switch((e="string"==typeof e?this.objs.get(e):e)[0]){case"RadialAxial":var r="shading"+f++,a=e[3];let t;switch(e[1]){case"axial":var i=e[4],s=e[5];(t=this.svgFactory.createElement("svg:linearGradient")).setAttributeNS(null,"id",r),t.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),t.setAttributeNS(null,"x1",i[0]),t.setAttributeNS(null,"y1",i[1]),t.setAttributeNS(null,"x2",s[0]),t.setAttributeNS(null,"y2",s[1]);break;case"radial":var i=e[4],s=e[5],n=e[6],o=e[7];(t=this.svgFactory.createElement("svg:radialGradient")).setAttributeNS(null,"id",r),t.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),t.setAttributeNS(null,"cx",s[0]),t.setAttributeNS(null,"cy",s[1]),t.setAttributeNS(null,"r",o),t.setAttributeNS(null,"fx",i[0]),t.setAttributeNS(null,"fy",i[1]),t.setAttributeNS(null,"fr",n);break;default:throw new Error("Unknown RadialAxial type: "+e[1])}for(const h of a){var l=this.svgFactory.createElement("svg:stop");l.setAttributeNS(null,"offset",h[0]),l.setAttributeNS(null,"stop-color",h[1]),t.append(l)}return this.defs.append(t),`url(#${r})`;case"Mesh":return(0,A.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error("Unknown IR type: "+e[0])}}setDash(t,e){this.current.dashArray=t,this.current.dashPhase=e}constructPath(t,e){var r=this.current;let a=r.x,i=r.y,s=[],n=0;for(const h of t)switch(0|h){case A.OPS.rectangle:a=e[n++],i=e[n++];var o=e[n++],l=e[n++],o=a+o,l=i+l;s.push("M",S(a),S(i),"L",S(o),S(i),"L",S(o),S(l),"L",S(a),S(l),"Z");break;case A.OPS.moveTo:a=e[n++],i=e[n++],s.push("M",S(a),S(i));break;case A.OPS.lineTo:a=e[n++],i=e[n++],s.push("L",S(a),S(i));break;case A.OPS.curveTo:a=e[n+4],i=e[n+5],s.push("C",S(e[n]),S(e[n+1]),S(e[n+2]),S(e[n+3]),S(a),S(i)),n+=6;break;case A.OPS.curveTo2:s.push("C",S(a),S(i),S(e[n]),S(e[n+1]),S(e[n+2]),S(e[n+3])),a=e[n+2],i=e[n+3],n+=4;break;case A.OPS.curveTo3:a=e[n+2],i=e[n+3],s.push("C",S(e[n]),S(e[n+1]),S(a),S(i),S(a),S(i)),n+=4;break;case A.OPS.closePath:s.push("Z")}s=s.join(" "),r.path&&0<t.length&&t[0]!==A.OPS.rectangle&&t[0]!==A.OPS.moveTo?s=r.path.getAttributeNS(null,"d")+s:(r.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().append(r.path)),r.path.setAttributeNS(null,"d",s),r.path.setAttributeNS(null,"fill","none"),r.element=r.path,r.setCurrentPoint(a,i)}endPath(){var t=this.current;if(t.path=null,this.pendingClip)if(t.element){var e="clippath"+s++,r=this.svgFactory.createElement("svg:clipPath"),a=(r.setAttributeNS(null,"id",e),r.setAttributeNS(null,"transform",w(this.transformMatrix)),t.element.cloneNode(!0));if("evenodd"===this.pendingClip?a.setAttributeNS(null,"clip-rule","evenodd"):a.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,r.append(a),this.defs.append(r),t.activeClipUrl){t.clipGroup=null;for(const i of this.extraStack)i.clipGroup=null;r.setAttributeNS(null,"clip-path",t.activeClipUrl)}t.activeClipUrl=`url(#${e})`,this.tgrp=null}else this.pendingClip=null}clip(t){this.pendingClip=t}closePath(){var t,e=this.current;e.path&&(t=e.path.getAttributeNS(null,"d")+"Z",e.path.setAttributeNS(null,"d",t))}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(var[e,r]of t)switch(e){case"LW":this.setLineWidth(r);break;case"LC":this.setLineCap(r);break;case"LJ":this.setLineJoin(r);break;case"ML":this.setMiterLimit(r);break;case"D":this.setDash(r[0],r[1]);break;case"RI":this.setRenderingIntent(r);break;case"FL":this.setFlatness(r);break;case"Font":this.setFont(r);break;case"CA":this.setStrokeAlpha(r);break;case"ca":this.setFillAlpha(r);break;default:(0,A.warn)("Unimplemented graphic state operator "+e)}}fill(){var t=this.current;t.element&&(t.element.setAttributeNS(null,"fill",t.fillColor),t.element.setAttributeNS(null,"fill-opacity",t.fillAlpha),this.endPath())}stroke(){var t=this.current;t.element&&(this._setStrokeAttributes(t.element),t.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(t){let e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1;var r=this.current;let a=r.dashArray;1!==e&&0<a.length&&(a=a.map(function(t){return e*t})),t.setAttributeNS(null,"stroke",r.strokeColor),t.setAttributeNS(null,"stroke-opacity",r.strokeAlpha),t.setAttributeNS(null,"stroke-miterlimit",S(r.miterLimit)),t.setAttributeNS(null,"stroke-linecap",r.lineCap),t.setAttributeNS(null,"stroke-linejoin",r.lineJoin),t.setAttributeNS(null,"stroke-width",S(e*r.lineWidth)+"px"),t.setAttributeNS(null,"stroke-dasharray",a.map(S).join(" ")),t.setAttributeNS(null,"stroke-dashoffset",S(e*r.dashPhase)+"px")}eoFill(){var t;null!=(t=this.current.element)&&t.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){var t;null!=(t=this.current.element)&&t.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}closeStroke(){this.closePath(),this.stroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.closePath(),this.eoFillStroke()}paintSolidColorImageMask(){var 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){var e=this.getObject(t);e?this.paintInlineImageXObject(e):(0,A.warn)(`Dependent image with object ID ${t} is not ready yet`)}paintInlineImageXObject(t,e){var r=t.width,a=t.height,t=l(t,this.forceDataSchema,!!e),i=this.svgFactory.createElement("svg:rect"),i=(i.setAttributeNS(null,"x","0"),i.setAttributeNS(null,"y","0"),i.setAttributeNS(null,"width",S(r)),i.setAttributeNS(null,"height",S(a)),this.current.element=i,this.clip("nonzero"),this.svgFactory.createElement("svg:image"));i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t),i.setAttributeNS(null,"x","0"),i.setAttributeNS(null,"y",S(-a)),i.setAttributeNS(null,"width",S(r)+"px"),i.setAttributeNS(null,"height",S(a)+"px"),i.setAttributeNS(null,"transform",`scale(${S(1/r)} ${S(-1/a)})`),(e||this._ensureTransformGroup()).append(i)}paintImageMaskXObject(t){var e,r,a,i,s,n,t=this.getObject(t.data,t);t.bitmap?(0,A.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled."):(e=this.current,r=t.width,a=t.height,i=e.fillColor,e.maskId="mask"+o++,(s=this.svgFactory.createElement("svg:mask")).setAttributeNS(null,"id",e.maskId),(n=this.svgFactory.createElement("svg:rect")).setAttributeNS(null,"x","0"),n.setAttributeNS(null,"y","0"),n.setAttributeNS(null,"width",S(r)),n.setAttributeNS(null,"height",S(a)),n.setAttributeNS(null,"fill",i),n.setAttributeNS(null,"mask",`url(#${e.maskId})`),this.defs.append(s),this._ensureTransformGroup().append(n),this.paintInlineImageXObject(t,s))}paintFormXObjectBegin(t,e){var r,a;Array.isArray(t)&&6===t.length&&this.transform(t[0],t[1],t[2],t[3],t[4],t[5]),e&&(t=e[2]-e[0],r=e[3]-e[1],(a=this.svgFactory.createElement("svg:rect")).setAttributeNS(null,"x",e[0]),a.setAttributeNS(null,"y",e[1]),a.setAttributeNS(null,"width",S(t)),a.setAttributeNS(null,"height",S(r)),this.current.element=a,this.clip("nonzero"),this.endPath())}paintFormXObjectEnd(){}_initialize(t){var e=this.svgFactory.create(t.width,t.height),r=this.svgFactory.createElement("svg:defs"),r=(e.append(r),this.defs=r,this.svgFactory.createElement("svg:g"));return r.setAttributeNS(null,"transform",w(t.transform)),e.append(r),this.svg=r,e}_ensureClipGroup(){var t;return this.current.clipGroup||((t=this.svgFactory.createElement("svg:g")).setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.append(t),this.current.clipGroup=t),this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",w(this.transformMatrix)),(this.current.activeClipUrl?this._ensureClipGroup():this.svg).append(this.tgrp)),this.tgrp}}}},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PDFNodeStream=void 0;var s=r(1),i=r(162);const n=require("fs"),o=require("http"),l=require("https"),a=require("url"),h=/^file:\/\/\/[a-zA-Z]:\//;e.PDFNodeStream=class{constructor(t){this.source=t,this.url=function(t){var e=a.parse(t);if("file:"!==e.protocol&&!e.host){if(/^[a-z]:[/\\]/i.test(t))return a.parse("file:///"+t);e.host||(e.protocol="file:")}return e}(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(){var t;return(null==(t=this._fullRequestReader)?void 0:t._loaded)??0}getFullReader(){return(0,s.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=new(this.isFsUrl?g:p)(this),this._fullRequestReader}getRangeReader(t,e){return e<=this._progressiveDataLength?null:(t=new(this.isFsUrl?m:f)(this,t,e),this._rangeRequestReaders.push(t),t)}cancelAllRequests(t){var e;null!=(e=this._fullRequestReader)&&e.cancel(t);for(const r of this._rangeRequestReaders.slice(0))r.cancel(t)}};class c{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=(0,s.createPromiseCapability)(),this._headersCapability=(0,s.createPromiseCapability)()}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(){var t;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;var e=this._readableStream.read();return null===e?(this._readCapability=(0,s.createPromiseCapability)(),this.read()):(this._loaded+=e.length,null!=(t=this.onProgress)&&t.call(this,{loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(e).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 d{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=(0,s.createPromiseCapability)();t=t.source;this._isStreamingSupported=!t.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){var t;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;var e=this._readableStream.read();return null===e?(this._readCapability=(0,s.createPromiseCapability)(),this.read()):(this._loaded+=e.length,null!=(t=this.onProgress)&&t.call(this,{loaded:this._loaded}),{value:new Uint8Array(e).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 u(t,e){return{protocol:t.protocol,auth:t.auth,host:t.hostname,port:t.port,path:t.path,method:"GET",headers:e}}class p extends c{constructor(a){super(a);var t=t=>{var e,r;404===t.statusCode?(e=new s.MissingPDFException(`Missing PDF "${this._url}".`),this._storedError=e,this._headersCapability.reject(e)):(this._headersCapability.resolve(),this._setReadableStream(t),{allowRangeRequests:t,suggestedLength:r}=(0,i.validateRangeRequestCapabilities)({getResponseHeader:e=t=>this._readableStream.headers[t.toLowerCase()],isHttp:a.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange}),this._isRangeSupported=t,this._contentLength=r||this._contentLength,this._filename=(0,i.extractFilenameFromHeader)(e))};this._request=null,"http:"===this._url.protocol?this._request=o.request(u(this._url,a.httpHeaders),t):this._request=l.request(u(this._url,a.httpHeaders),t),this._request.on("error",t=>{this._storedError=t,this._headersCapability.reject(t)}),this._request.end()}}class f extends d{constructor(t,e,r){super(t),this._httpHeaders={};for(const i in t.httpHeaders){var a=t.httpHeaders[i];void 0!==a&&(this._httpHeaders[i]=a)}this._httpHeaders.Range=`bytes=${e}-`+(r-1);e=t=>{var e;404===t.statusCode?(e=new s.MissingPDFException(`Missing PDF "${this._url}".`),this._storedError=e):this._setReadableStream(t)};this._request=null,"http:"===this._url.protocol?this._request=o.request(u(this._url,this._httpHeaders),e):this._request=l.request(u(this._url,this._httpHeaders),e),this._request.on("error",t=>{this._storedError=t}),this._request.end()}}class g extends c{constructor(t){super(t);let r=decodeURIComponent(this._url.path);h.test(this._url.href)&&(r=r.replace(/^\//,"")),n.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(n.createReadStream(r)),this._headersCapability.resolve())})}}class m extends d{constructor(t,e,r){super(t);let a=decodeURIComponent(this._url.path);h.test(this._url.href)&&(a=a.replace(/^\//,"")),this._setReadableStream(n.createReadStream(a,{start:e,end:r-1}))}}},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createResponseStatusError=function(t,e){if(404===t||0===t&&e.startsWith("file:"))return new a.MissingPDFException('Missing PDF "'+e+'".');return new a.UnexpectedResponseException(`Unexpected server response (${t}) while retrieving PDF "${e}".`,t)},e.extractFilenameFromHeader=function(e){e=e("Content-Disposition");if(e){let t=(0,i.getFilenameFromContentDispositionHeader)(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch(t){}if((0,s.isPdfFile)(t))return t}return null},e.validateRangeRequestCapabilities=function(t){var{getResponseHeader:t,isHttp:e,rangeChunkSize:r,disableRange:a}=t;var i={allowRangeRequests:!1,suggestedLength:void 0},s=parseInt(t("Content-Length"),10);return!Number.isInteger(s)||(i.suggestedLength=s)<=2*r||!a&&e&&"bytes"===t("Accept-Ranges")&&"identity"===(t("Content-Encoding")||"identity")&&(i.allowRangeRequests=!0),i},e.validateResponseStatus=function(t){return 200===t||206===t};var a=r(1),i=r(163),s=r(137)},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getFilenameFromContentDispositionHeader=function(t){let i=!0,e=o("filename\\*","i").exec(t);{var r;if(e)return r=l(e=e[1]),a(r=n(r=h(r=unescape(r))))}if(e=function(t){var a=[];var e=o("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(r=e.exec(t));){var[,r,i,s]=r;if((r=parseInt(r,10))in a){if(0===r)break}else a[r]=[i,s]}var n=[];for(let r=0;r<a.length&&r in a;++r){let[t,e]=a[r];e=l(e),t&&(e=unescape(e),0===r)&&(e=h(e)),n.push(e)}return n.join("")}(t))return a(n(e));if(e=o("filename","i").exec(t))return e=e[1],a(n(l(e)));function o(t,e){return new RegExp("(?:^|;)\\s*"+t+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',e)}function s(t,e){if(t){if(!/^[\x00-\xFF]+$/.test(e))return e;try{var r=new TextDecoder(t,{fatal:!0}),a=(0,c.stringToBytes)(e);e=r.decode(a),i=!1}catch(t){}}return e}function a(t){return t=i&&/[\x80-\xff]/.test(t)&&(t=s("utf-8",t),i)?s("iso-8859-1",t):t}function l(t){if(t.startsWith('"')){var e=t.slice(1).split('\\"');for(let t=0;t<e.length;++t){var r=e[t].indexOf('"');-1!==r&&(e[t]=e[t].slice(0,r),e.length=t+1),e[t]=e[t].replace(/\\(.)/g,"$1")}t=e.join('"')}return t}function h(t){var e=t.indexOf("'");return-1===e?t:s(t.slice(0,e),t.slice(e+1).replace(/^[^']*'/,""))}function n(t){return!t.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(t)?t:t.replace(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(t,e,r,a){if("q"===r||"Q"===r)return s(e,a=(a=a.replace(/_/g," ")).replace(/=([0-9a-fA-F]{2})/g,function(t,e){return String.fromCharCode(parseInt(e,16))}));try{a=atob(a)}catch(t){}return s(e,a)})}return""};var c=r(1)},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PDFNetworkStream=void 0;var s=r(1),n=r(162);class a{constructor(t){var e=1<arguments.length&&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.getXhr=e.getXhr||function(){return new XMLHttpRequest},this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(t,e,r){var a={begin:t,end:e};for(const i in r)a[i]=r[i];return this.request(a)}requestFull(t){return this.request(t)}request(e){const r=this.getXhr();var t=this.currXhrId++,a=this.pendingRequests[t]={xhr:r};r.open("GET",this.url),r.withCredentials=this.withCredentials;for(const s in this.httpHeaders){var i=this.httpHeaders[s];void 0!==i&&r.setRequestHeader(s,i)}return this.isHttp&&"begin"in e&&"end"in e?(r.setRequestHeader("Range",`bytes=${e.begin}-`+(e.end-1)),a.expectedStatus=206):a.expectedStatus=200,r.responseType="arraybuffer",e.onError&&(r.onerror=function(t){e.onError(r.status)}),r.onreadystatechange=this.onStateChange.bind(this,t),r.onprogress=this.onProgress.bind(this,t),a.onHeadersReceived=e.onHeadersReceived,a.onDone=e.onDone,a.onError=e.onError,a.onProgress=e.onProgress,r.send(null),t}onProgress(t,e){var r,t=this.pendingRequests[t];t&&null!=(r=t.onProgress)&&r.call(t,e)}onStateChange(t,e){var r,a,i=this.pendingRequests[t];i&&(2<=(r=i.xhr).readyState&&i.onHeadersReceived&&(i.onHeadersReceived(),delete i.onHeadersReceived),4===r.readyState)&&t in this.pendingRequests&&(delete this.pendingRequests[t],0===r.status&&this.isHttp?null!=(t=i.onError)&&t.call(i,r.status):200===(t=r.status||200)&&206===i.expectedStatus||t===i.expectedStatus?(a="string"!=typeof(a=(a=r).response)?a:(0,s.stringToBytes)(a).buffer,206===t?(t=r.getResponseHeader("Content-Range"),t=/bytes (\d+)-(\d+)\/(\d+)/.exec(t),i.onDone({begin:parseInt(t[1],10),chunk:a})):a?i.onDone({begin:0,chunk:a}):null!=(t=i.onError)&&t.call(i,r.status)):null!=(a=i.onError)&&a.call(i,r.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 a(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,s.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new i(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){var e;null!=(e=this._fullRequestReader)&&e.cancel(t);for(const r of this._rangeRequestReaders.slice(0))r.cancel(t)}};class i{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=(0,s.createPromiseCapability)(),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(){var t=this._fullRequestId;const e=this._manager.getRequestXhr(t);var r=t=>e.getResponseHeader(t),{allowRangeRequests:a,suggestedLength:i}=(0,n.validateRangeRequestCapabilities)({getResponseHeader:r,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});a&&(this._isRangeSupported=!0),this._contentLength=i||this._contentLength,this._filename=(0,n.extractFilenameFromHeader)(r),this._isRangeSupported&&this._manager.abortRequest(t),this._headersReceivedCapability.resolve()}_onDone(t){if(t&&(0<this._requests.length?this._requests.shift().resolve({value:t.chunk,done:!1}):this._cachedChunks.push(t.chunk)),this._done=!0,!(0<this._cachedChunks.length)){for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(t){this._storedError=(0,n.createResponseStatusError)(t,this._url),this._headersReceivedCapability.reject(this._storedError);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(t){var e;null!=(e=this.onProgress)&&e.call(this,{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;var t;return 0<this._cachedChunks.length?{value:this._cachedChunks.shift(),done:!1}:this._done?{value:void 0,done:!0}:(t=(0,s.createPromiseCapability)(),this._requests.push(t),t.promise)}cancel(t){this._done=!0,this._headersReceivedCapability.reject(t);for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class o{constructor(t,e,r){this._manager=t;var a={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url,this._requestId=t.requestRange(e,r,a),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){var t;null!=(t=this.onClosed)&&t.call(this,this)}_onDone(t){t=t.chunk;0<this._requests.length?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunk=t,this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(t){this._storedError=(0,n.createResponseStatusError)(t,this._url);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){var e;this.isStreamingSupported||null!=(e=this.onProgress)&&e.call(this,{loaded:t.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;var t;return null!==this._queuedChunk?(t=this._queuedChunk,this._queuedChunk=null,{value:t,done:!1}):this._done?{value:void 0,done:!0}:(t=(0,s.createPromiseCapability)(),this._requests.push(t),t.promise)}cancel(t){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PDFFetchStream=void 0;var s=r(1),n=r(162);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=new Headers;for(const a in t){var r=t[a];void 0!==r&&e.append(a,r)}return e}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(){var t;return(null==(t=this._fullRequestReader)?void 0:t._loaded)??0}getFullReader(){return(0,s.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new a(this),this._fullRequestReader}getRangeReader(t,e){return e<=this._progressiveDataLength?null:(t=new i(this,t,e),this._rangeRequestReaders.push(t),t)}cancelAllRequests(t){var e;null!=(e=this._fullRequestReader)&&e.cancel(t);for(const r of this._rangeRequestReaders.slice(0))r.cancel(t)}};class a{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=(0,s.createPromiseCapability)(),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);const i=t.url;fetch(i,o(this._headers,this._withCredentials,this._abortController)).then(e=>{if(!(0,n.validateResponseStatus)(e.status))throw(0,n.createResponseStatusError)(e.status,i);this._reader=e.body.getReader(),this._headersCapability.resolve();var t=t=>e.headers.get(t),{allowRangeRequests:r,suggestedLength:a}=(0,n.validateRangeRequestCapabilities)({getResponseHeader:t,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=r,this._contentLength=a||this._contentLength,this._filename=(0,n.extractFilenameFromHeader)(t),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new s.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,null!=(e=this.onProgress)&&e.call(this,{loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){var e;null!=(e=this._reader)&&e.cancel(t),this._abortController.abort()}}class i{constructor(t,e,r){this._stream=t,this._reader=null,this._loaded=0;t=t.source;this._withCredentials=t.withCredentials||!1,this._readCapability=(0,s.createPromiseCapability)(),this._isStreamingSupported=!t.disableStream,this._abortController=new AbortController,this._headers=l(this._stream.httpHeaders),this._headers.append("Range",`bytes=${e}-`+(r-1));const a=t.url;fetch(a,o(this._headers,this._withCredentials,this._abortController)).then(t=>{if(!(0,n.validateResponseStatus)(t.status))throw(0,n.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;var{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:(this._loaded+=t.byteLength,null!=(e=this.onProgress)&&e.call(this,{loaded:this._loaded}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){var e;null!=(e=this._reader)&&e.cancel(t),this._abortController.abort()}}}],__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](e,e.exports,__w_pdfjs_require__)),e.exports}var __webpack_exports__={};return(()=>{"use strict";var t=__webpack_exports__,e=(Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"AnnotationEditorLayer",{enumerable:!0,get:function(){return i.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 s.AnnotationEditorUIManager}}),Object.defineProperty(t,"AnnotationLayer",{enumerable:!0,get:function(){return n.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,"GlobalWorkerOptions",{enumerable:!0,get:function(){return o.GlobalWorkerOptions}}),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 a.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 a.PixelsPerInch}}),Object.defineProperty(t,"RenderingCancelledException",{enumerable:!0,get:function(){return a.RenderingCancelledException}}),Object.defineProperty(t,"SVGGraphics",{enumerable:!0,get:function(){return h.SVGGraphics}}),Object.defineProperty(t,"UNSUPPORTED_FEATURES",{enumerable:!0,get:function(){return e.UNSUPPORTED_FEATURES}}),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 r.build}}),Object.defineProperty(t,"createPromiseCapability",{enumerable:!0,get:function(){return e.createPromiseCapability}}),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 a.getFilenameFromUrl}}),Object.defineProperty(t,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return a.getPdfFilenameFromUrl}}),Object.defineProperty(t,"getXfaPageViewport",{enumerable:!0,get:function(){return a.getXfaPageViewport}}),Object.defineProperty(t,"isPdfFile",{enumerable:!0,get:function(){return a.isPdfFile}}),Object.defineProperty(t,"loadScript",{enumerable:!0,get:function(){return a.loadScript}}),Object.defineProperty(t,"renderTextLayer",{enumerable:!0,get:function(){return l.renderTextLayer}}),Object.defineProperty(t,"shadow",{enumerable:!0,get:function(){return e.shadow}}),Object.defineProperty(t,"version",{enumerable:!0,get:function(){return r.version}}),__w_pdfjs_require__(1)),r=__w_pdfjs_require__(133),a=__w_pdfjs_require__(137),i=__w_pdfjs_require__(151),s=__w_pdfjs_require__(136),n=__w_pdfjs_require__(156),o=__w_pdfjs_require__(144),t=__w_pdfjs_require__(3),l=__w_pdfjs_require__(159),h=__w_pdfjs_require__(160),c=__w_pdfjs_require__(158);if(t.isNodeJS){const d=__w_pdfjs_require__(161)["PDFNodeStream"];(0,r.setPDFNetworkStreamFactory)(t=>new d(t))}else{const u=__w_pdfjs_require__(164)["PDFNetworkStream"],p=__w_pdfjs_require__(165)["PDFFetchStream"];(0,r.setPDFNetworkStreamFactory)(t=>new((0,a.isValidFetchUrl)(t.url)?p:u)(t))}})(),__webpack_exports__})());