1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1859],{31755:function(module,__unused_webpack_exports,__webpack_require__){var Buffer=__webpack_require__(79644).Buffer,process=__webpack_require__(34406);!function(t,e){module.exports=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=Z,e.arraysToBytes=tt,e.assert=U,e.bytesToString=J,e.createPromiseCapability=ty,e.createValidAbsoluteUrl=W,e.escapeString=td,e.getModificationDate=tb,e.getVerbosityLevel=D,e.info=L,e.isArrayBuffer=tm,e.isArrayEqual=tv,e.isAscii=tu,e.objectFromMap=ti,e.objectSize=tr,e.setVerbosityLevel=I,e.shadow=q,e.string32=te,e.stringToBytes=Q,e.stringToPDFString=tc,e.stringToUTF16BEString=tp,e.stringToUTF8String=tf,e.unreachable=j,e.utf8StringToString=tg,e.warn=N,r(2);let i=[1,0,0,1,0,0];e.IDENTITY_MATRIX=i;let n=[.001,0,0,.001,0,0];e.FONT_IDENTITY_MATRIX=n;let s=1.35;e.LINE_FACTOR=s;let a=.35;e.LINE_DESCENT_FACTOR=a;let o={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};e.RenderingIntentFlag=o;let l={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};e.AnnotationMode=l;let h="pdfjs_internal_editor_";e.AnnotationEditorPrefix=h;let c={DISABLE:-1,NONE:0,FREETEXT:3,INK:15};e.AnnotationEditorType=c;let d={FREETEXT_SIZE:1,FREETEXT_COLOR:2,FREETEXT_OPACITY:3,INK_COLOR:11,INK_THICKNESS:12,INK_OPACITY:13};e.AnnotationEditorParamsType=d;let u={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.PermissionFlag=u;let p={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.TextRenderingMode=p;let f={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};e.ImageKind=f;let g={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.AnnotationType=g;let m={MARKED:"Marked",REVIEW:"Review"};e.AnnotationStateModelType=m;let v={MARKED:"Marked",UNMARKED:"Unmarked"};e.AnnotationMarkedState=v;let b={ACCEPTED:"Accepted",REJECTED:"Rejected",CANCELLED:"Cancelled",COMPLETED:"Completed",NONE:"None"};e.AnnotationReviewState=b;let y={GROUP:"Group",REPLY:"R"};e.AnnotationReplyType=y;let A={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};e.AnnotationFlag=A;let _={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.AnnotationFieldFlag=_;let S={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};e.AnnotationBorderStyleType=S;let x={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.AnnotationActionEventType=x;let w={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};e.DocumentActionEventType=w;let E={O:"PageOpen",C:"PageClose"};e.PageActionEventType=E;let C={UNKNOWN:"UNKNOWN",FLATE:"FLATE",LZW:"LZW",DCT:"DCT",JPX:"JPX",JBIG:"JBIG",A85:"A85",AHX:"AHX",CCF:"CCF",RLX:"RLX"};e.StreamType=C;let T={UNKNOWN:"UNKNOWN",TYPE1:"TYPE1",TYPE1STANDARD:"TYPE1STANDARD",TYPE1C:"TYPE1C",CIDFONTTYPE0:"CIDFONTTYPE0",CIDFONTTYPE0C:"CIDFONTTYPE0C",TRUETYPE:"TRUETYPE",CIDFONTTYPE2:"CIDFONTTYPE2",TYPE3:"TYPE3",OPENTYPE:"OPENTYPE",TYPE0:"TYPE0",MMTYPE1:"MMTYPE1"};e.FontType=T;let k={ERRORS:0,WARNINGS:1,INFOS:5};e.VerbosityLevel=k;let P={NONE:0,BINARY:1,STREAM:2};e.CMapCompressionType=P;let M={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,beginAnnotations:78,endAnnotations:79,beginAnnotation:80,endAnnotation:81,paintJpegXObject:82,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};e.OPS=M;let R={unknown:"unknown",forms:"forms",javaScript:"javaScript",signatures:"signatures",smask:"smask",shadingPattern:"shadingPattern",font:"font",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.UNSUPPORTED_FEATURES=R;let F={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};e.PasswordResponses=F;let O=k.WARNINGS;function I(t){Number.isInteger(t)&&(O=t)}function D(){return O}function L(t){O>=k.INFOS&&console.log(`Info: ${t}`)}function N(t){O>=k.WARNINGS&&console.log(`Warning: ${t}`)}function j(t){throw Error(t)}function U(t,e){t||j(e)}function B(t){if(!t)return!1;switch(t.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function W(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return null;try{if(r&&"string"==typeof t){if(r.addDefaultProtocol&&t.startsWith("www.")){let e=t.match(/\./g);e&&e.length>=2&&(t=`http://${t}`)}if(r.tryConvertEncoding)try{t=tf(t)}catch(t){}}let i=e?new URL(t,e):new URL(t);if(B(i))return i}catch(t){}return null}function q(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!1}),r}let G=function(){function t(e,r){this.constructor===t&&j("Cannot initialize BaseException."),this.message=e,this.name=r}return t.prototype=Error(),t.constructor=t,t}();e.BaseException=G;class z extends G{constructor(t,e){super(t,"PasswordException"),this.code=e}}e.PasswordException=z;class H extends G{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}}e.UnknownErrorException=H;class V extends G{constructor(t){super(t,"InvalidPDFException")}}e.InvalidPDFException=V;class $ extends G{constructor(t){super(t,"MissingPDFException")}}e.MissingPDFException=$;class X extends G{constructor(t,e){super(t,"UnexpectedResponseException"),this.status=e}}e.UnexpectedResponseException=X;class Y extends G{constructor(t){super(t,"FormatError")}}e.FormatError=Y;class K extends G{constructor(t){super(t,"AbortException")}}function J(t){("object"!=typeof t||null===t||void 0===t.length)&&j("Invalid argument for bytesToString");let e=t.length,r=8192;if(e<8192)return String.fromCharCode.apply(null,t);let i=[];for(let n=0;n<e;n+=r){let s=Math.min(n+r,e),a=t.subarray(n,s);i.push(String.fromCharCode.apply(null,a))}return i.join("")}function Q(t){"string"!=typeof t&&j("Invalid argument for stringToBytes");let e=t.length,r=new Uint8Array(e);for(let i=0;i<e;++i)r[i]=255&t.charCodeAt(i);return r}function Z(t){return void 0!==t.length?t.length:void 0!==t.byteLength?t.byteLength:void j("Invalid argument for arrayByteLength")}function tt(t){let e=t.length;if(1===e&&t[0]instanceof Uint8Array)return t[0];let r=0;for(let i=0;i<e;i++)r+=Z(t[i]);let i=0,n=new Uint8Array(r);for(let r=0;r<e;r++){let e=t[r];e instanceof Uint8Array||(e="string"==typeof e?Q(e):new Uint8Array(e));let s=e.byteLength;n.set(e,i),i+=s}return n}function te(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,255&t)}function tr(t){return Object.keys(t).length}function ti(t){let e=Object.create(null);for(let[r,i]of t)e[r]=i;return e}function tn(){let t=new Uint8Array(4);return t[0]=1,1===new Uint32Array(t.buffer,0,1)[0]}function ts(){try{return Function(""),!0}catch(t){return!1}}e.AbortException=K;class ta{static get isLittleEndian(){return q(this,"isLittleEndian",tn())}static get isEvalSupported(){return q(this,"isEvalSupported",ts())}static get isOffscreenCanvasSupported(){return q(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}}e.FeatureTest=ta;let to=[...Array(256).keys()].map(t=>t.toString(16).padStart(2,"0"));class tl{static makeHexColor(t,e,r){return`#${to[t]}${to[e]}${to[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){let 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]}
1static getAxialAlignedBoundingBox(t,e){let r=tl.applyTransform(t,e),i=tl.applyTransform(t.slice(2,4),e),n=tl.applyTransform([t[0],t[3]],e),s=tl.applyTransform([t[2],t[1]],e);return[Math.min(r[0],i[0],n[0],s[0]),Math.min(r[1],i[1],n[1],s[1]),Math.max(r[0],i[0],n[0],s[0]),Math.max(r[1],i[1],n[1],s[1])]}static inverseTransform(t){let 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 apply3dTransform(t,e){return[t[0]*e[0]+t[1]*e[1]+t[2]*e[2],t[3]*e[0]+t[4]*e[1]+t[5]*e[2],t[6]*e[0]+t[7]*e[1]+t[8]*e[2]]}static singularValueDecompose2dScale(t){let e=[t[0],t[2],t[1],t[3]],r=t[0]*e[0]+t[1]*e[2],i=t[0]*e[1]+t[1]*e[3],n=t[2]*e[0]+t[3]*e[2],s=t[2]*e[1]+t[3]*e[3],a=(r+s)/2,o=Math.sqrt((r+s)**2-4*(r*s-n*i))/2;return[Math.sqrt(a+o||1),Math.sqrt(a-o||1)]}static normalizeRect(t){let 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){let r=Math.max(Math.min(t[0],t[2]),Math.min(e[0],e[2])),i=Math.min(Math.max(t[0],t[2]),Math.max(e[0],e[2]));if(r>i)return null;let n=Math.max(Math.min(t[1],t[3]),Math.min(e[1],e[3])),s=Math.min(Math.max(t[1],t[3]),Math.max(e[1],e[3]));return n>s?null:[r,n,i,s]}static bezierBoundingBox(t,e,r,i,n,s,a,o){let l,h,c,d,u,p,f,g;let m=[],v=[[],[]];for(let v=0;v<2;++v){if(0===v?(h=6*t-12*r+6*n,l=-3*t+9*r-9*n+3*a,c=3*r-3*t):(h=6*e-12*i+6*s,l=-3*e+9*i-9*s+3*o,c=3*i-3*e),1e-12>Math.abs(l)){if(1e-12>Math.abs(h))continue;0<(d=-c/h)&&d<1&&m.push(d);continue}g=Math.sqrt(f=h*h-4*c*l),!(f<0)&&(0<(u=(-h+g)/(2*l))&&u<1&&m.push(u),0<(p=(-h-g)/(2*l))&&p<1&&m.push(p))}let b=m.length,y,A=b;for(;b--;)y=1-(d=m[b]),v[0][b]=y*y*y*t+3*y*y*d*r+3*y*d*d*n+d*d*d*a,v[1][b]=y*y*y*e+3*y*y*d*i+3*y*d*d*s+d*d*d*o;return v[0][A]=t,v[1][A]=e,v[0][A+1]=a,v[1][A+1]=o,v[0].length=v[1].length=A+2,[Math.min(...v[0]),Math.min(...v[1]),Math.max(...v[0]),Math.max(...v[1])]}}e.Util=tl;let th=[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 tc(t){if(t[0]>="\xef"){let e;if("\xfe"===t[0]&&"\xff"===t[1]?e="utf-16be":"\xff"===t[0]&&"\xfe"===t[1]?e="utf-16le":"\xef"===t[0]&&"\xbb"===t[1]&&"\xbf"===t[2]&&(e="utf-8"),e)try{let r=new TextDecoder(e,{fatal:!0}),i=Q(t);return r.decode(i)}catch(t){N(`stringToPDFString: "${t}".`)}}let e=[];for(let r=0,i=t.length;r<i;r++){let i=th[t.charCodeAt(r)];e.push(i?String.fromCharCode(i):t.charAt(r))}return e.join("")}function td(t){return t.replace(/([()\\\n\r])/g,t=>"\n"===t?"\\n":"\r"===t?"\\r":`\\${t}`)}function tu(t){return/^[\x00-\x7F]*$/.test(t)}function tp(t){let e=["\xfe\xff"];for(let r=0,i=t.length;r<i;r++){let i=t.charCodeAt(r);e.push(String.fromCharCode(i>>8&255),String.fromCharCode(255&i))}return e.join("")}function tf(t){return decodeURIComponent(escape(t))}function tg(t){return unescape(encodeURIComponent(t))}function tm(t){return"object"==typeof t&&null!==t&&void 0!==t.byteLength}function tv(t,e){if(t.length!==e.length)return!1;for(let r=0,i=t.length;r<i;r++)if(t[r]!==e[r])return!1;return!0}function tb(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date;return[t.getUTCFullYear().toString(),(t.getUTCMonth()+1).toString().padStart(2,"0"),t.getUTCDate().toString().padStart(2,"0"),t.getUTCHours().toString().padStart(2,"0"),t.getUTCMinutes().toString().padStart(2,"0"),t.getUTCSeconds().toString().padStart(2,"0")].join("")}function ty(){let t=Object.create(null),e=!1;return Object.defineProperty(t,"settled",{get:()=>e}),t.promise=new Promise(function(r,i){t.resolve=function(t){e=!0,r(t)},t.reject=function(t){e=!0,i(t)}}),t}},(t,e,r)=>{"use strict";var i=r(3);globalThis._pdfjsCompatibilityChecked||(globalThis._pdfjsCompatibilityChecked=!0,function(){!globalThis.btoa&&i.isNodeJS&&(globalThis.btoa=function(t){return Buffer.from(t,"binary").toString("base64")})}(),function(){!globalThis.atob&&i.isNodeJS&&(globalThis.atob=function(t){return Buffer.from(t,"base64").toString("binary")})}(),function(){!globalThis.DOMMatrix&&i.isNodeJS&&(globalThis.DOMMatrix=__webpack_require__(28393))}(),function(){!globalThis.ReadableStream&&i.isNodeJS&&(globalThis.ReadableStream=__webpack_require__(85593).ReadableStream)}(),function(){Array.prototype.at||r(4)}(),function(){Uint8Array.prototype.at||r(76)}(),function(){globalThis.structuredClone||r(86)}())},(t,e)=>{"use strict";
1Object.defineProperty(e,"__esModule",{value:!0}),e.isNodeJS=void 0;let 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);var i=r(75);t.exports=i("Array","at")},(t,e,r)=>{"use strict";var i=r(6),n=r(41),s=r(65),a=r(63),o=r(70);i({target:"Array",proto:!0},{at:function(t){var e=n(this),r=s(e),i=a(t),o=i>=0?i:r+i;return o<0||o>=r?void 0:e[o]}}),o("at")},(t,e,r)=>{var i=r(7),n=r(8).f,s=r(45),a=r(49),o=r(39),l=r(57),h=r(69);t.exports=function(t,e){var r,c,d,u,p,f=t.target,g=t.global,m=t.stat;if(r=g?i:m?i[f]||o(f,{}):(i[f]||{}).prototype)for(c in e){if(u=e[c],d=t.dontCallGetSet?(p=n(r,c))&&p.value:r[c],!h(g?c:f+(m?".":"#")+c,t.forced)&&void 0!==d){if(typeof u==typeof d)continue;l(u,d)}(t.sham||d&&d.sham)&&s(u,"sham",!0),a(r,c,u,t)}}},t=>{var e=function(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 __webpack_require__.g&&__webpack_require__.g)||function(){return this}()||Function("return this")()},(t,e,r)=>{var i=r(9),n=r(11),s=r(13),a=r(14),o=r(15),l=r(20),h=r(40),c=r(43),d=Object.getOwnPropertyDescriptor;e.f=i?d:function(t,e){if(t=o(t),e=l(e),c)try{return d(t,e)}catch(t){}if(h(t,e))return a(!n(s.f,t,e),t[e])}},(t,e,r)=>{var i=r(10);t.exports=!i(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})},t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},(t,e,r)=>{var i=r(12),n=Function.prototype.call;t.exports=i?n.bind(n):function(){return n.apply(n,arguments)}},(t,e,r)=>{var i=r(10);t.exports=!i(function(){var t=(function(){}).bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})},(t,e)=>{"use strict";var r={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,n=i&&!r.call({1:2},1);e.f=n?function(t){var e=i(this,t);return!!e&&e.enumerable}:r},t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},(t,e,r)=>{var i=r(16),n=r(19);t.exports=function(t){return i(n(t))}},(t,e,r)=>{var i=r(17),n=r(10),s=r(18),a=Object,o=i("".split);t.exports=n(function(){return!a("z").propertyIsEnumerable(0)})?function(t){return"String"==s(t)?o(t,""):a(t)}:a},(t,e,r)=>{var i=r(12),n=Function.prototype,s=n.bind,a=n.call,o=i&&s.bind(a,a);t.exports=i?function(t){return t&&o(t)}:function(t){return t&&function(){return a.apply(t,arguments)}}},(t,e,r)=>{var i=r(17),n=i({}.toString),s=i("".slice);t.exports=function(t){return s(n(t),8,-1)}},t=>{var e=TypeError;t.exports=function(t){if(void 0==t)throw e("Can't call method on "+t);return t}},(t,e,r)=>{var i=r(21),n=r(24);t.exports=function(t){var e=i(t,"string");return n(e)?e:e+""}},(t,e,r)=>{var i=r(11),n=r(22),s=r(24),a=r(31),o=r(34),l=r(35),h=TypeError,c=l("toPrimitive");t.exports=function(t,e){if(!n(t)||s(t))return t;var r,l=a(t,c);if(l){if(void 0===e&&(e="default"),!n(r=i(l,t,e))||s(r))return r;throw h("Can't convert object to primitive value")}return void 0===e&&(e="number"),o(t,e)}},(t,e,r)=>{var i=r(23);t.exports=function(t){return"object"==typeof t?null!==t:i(t)}},t=>{t.exports=function(t){return"function"==typeof t}},(t,e,r)=>{var i=r(25),n=r(23),s=r(26),a=r(27),o=Object;t.exports=a?function(t){return"symbol"==typeof t}:function(t){var e=i("Symbol");return n(e)&&s(e.prototype,o(t))}},(t,e,r)=>{var i=r(7),n=r(23),s=function(t){return n(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?s(i[t]):i[t]&&i[t][e]}},(t,e,r)=>{var i=r(17);t.exports=i({}.isPrototypeOf)},(t,e,r)=>{var i=r(28);t.exports=i&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},(t,e,r)=>{var i=r(29),n=r(10);t.exports=!!Object.getOwnPropertySymbols&&!n(function(){var t=Symbol();return!String(t)||!(Object(t) instanceof Symbol)||!Symbol.sham&&i&&i<41})},(t,e,r)=>{var i,n,s=r(7),a=r(30),o=s.process,l=s.Deno,h=o&&o.versions||l&&l.version,c=h&&h.v8;c&&(n=(i=c.split("."))[0]>0&&i[0]<4?1:+(i[0]+i[1])),!n&&a&&(!(i=a.match(/Edge\/(\d+)/))||i[1]>=74)&&(i=a.match(/Chrome\/(\d+)/))&&(n=+i[1]),t.exports=n},(t,e,r)=>{var i=r(25);t.exports=i("navigator","userAgent")||""},(t,e,r)=>{var i=r(32);t.exports=function(t,e){var r=t[e];return null==r?void 0:i(r)}},(t,e,r)=>{var i=r(23),n=r(33),s=TypeError;t.exports=function(t){if(i(t))return t;throw s(n(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),n=r(23),s=r(22),a=TypeError;t.exports=function(t,e){var r,o;
1if("string"===e&&n(r=t.toString)&&!s(o=i(r,t))||n(r=t.valueOf)&&!s(o=i(r,t))||"string"!==e&&n(r=t.toString)&&!s(o=i(r,t)))return o;throw a("Can't convert object to primitive value")}},(t,e,r)=>{var i=r(7),n=r(36),s=r(40),a=r(42),o=r(28),l=r(27),h=n("wks"),c=i.Symbol,d=c&&c.for,u=l?c:c&&c.withoutSetter||a;t.exports=function(t){if(!s(h,t)||!(o||"string"==typeof h[t])){var e="Symbol."+t;o&&s(c,t)?h[t]=c[t]:l&&d?h[t]=d(e):h[t]=u(e)}return h[t]}},(t,e,r)=>{var i=r(37),n=r(38);(t.exports=function(t,e){return n[t]||(n[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.24.1",mode:i?"pure":"global",copyright:"\xa9 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.24.1/LICENSE",source:"https://github.com/zloirock/core-js"})},t=>{t.exports=!1},(t,e,r)=>{var i=r(7),n=r(39),s="__core-js_shared__",a=i[s]||n(s,{});t.exports=a},(t,e,r)=>{var i=r(7),n=Object.defineProperty;t.exports=function(t,e){try{n(i,t,{value:e,configurable:!0,writable:!0})}catch(r){i[t]=e}return e}},(t,e,r)=>{var i=r(17),n=r(41),s=i({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return s(n(t),e)}},(t,e,r)=>{var i=r(19),n=Object;t.exports=function(t){return n(i(t))}},(t,e,r)=>{var i=r(17),n=0,s=Math.random(),a=i(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+a(++n+s,36)}},(t,e,r)=>{var i=r(9),n=r(10),s=r(44);t.exports=!i&&!n(function(){return 7!=Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a})},(t,e,r)=>{var i=r(7),n=r(22),s=i.document,a=n(s)&&n(s.createElement);t.exports=function(t){return a?s.createElement(t):{}}},(t,e,r)=>{var i=r(9),n=r(46),s=r(14);t.exports=i?function(t,e,r){return n.f(t,e,s(1,r))}:function(t,e,r){return t[e]=r,t}},(t,e,r)=>{var i=r(9),n=r(43),s=r(47),a=r(48),o=r(20),l=TypeError,h=Object.defineProperty,c=Object.getOwnPropertyDescriptor,d="enumerable",u="configurable",p="writable";e.f=i?s?function(t,e,r){if(a(t),e=o(e),a(r),"function"==typeof t&&"prototype"===e&&"value"in r&&p in r&&!r[p]){var i=c(t,e);i&&i[p]&&(t[e]=r.value,r={configurable:u in r?r[u]:i[u],enumerable:d in r?r[d]:i[d],writable:!1})}return h(t,e,r)}:h:function(t,e,r){if(a(t),e=o(e),a(r),n)try{return h(t,e,r)}catch(t){}if("get"in r||"set"in r)throw l("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},(t,e,r)=>{var i=r(9),n=r(10);t.exports=i&&n(function(){return 42!=Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})},(t,e,r)=>{var i=r(22),n=String,s=TypeError;t.exports=function(t){if(i(t))return t;throw s(n(t)+" is not an object")}},(t,e,r)=>{var i=r(23),n=r(46),s=r(50),a=r(39);t.exports=function(t,e,r,o){o||(o={});var l=o.enumerable,h=void 0!==o.name?o.name:e;if(i(r)&&s(r,h,o),o.global)l?t[e]=r:a(e,r);else{try{o.unsafe?t[e]&&(l=!0):delete t[e]}catch(t){}l?t[e]=r:n.f(t,e,{value:r,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return t}},(t,e,r)=>{var i=r(10),n=r(23),s=r(40),a=r(9),o=r(51).CONFIGURABLE,l=r(52),h=r(53),c=h.enforce,d=h.get,u=Object.defineProperty,p=a&&!i(function(){return 8!==u(function(){},"length",{value:8}).length}),f=String(String).split("String"),g=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)&&(a?u(t,"name",{value:e,configurable:!0}):t.name=e),p&&r&&s(r,"arity")&&t.length!==r.arity&&u(t,"length",{value:r.arity});try{r&&s(r,"constructor")&&r.constructor?a&&u(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var i=c(t);return s(i,"source")||(i.source=f.join("string"==typeof e?e:"")),t};Function.prototype.toString=g(function(){return n(this)&&d(this).source||l(this)},"toString")},(t,e,r)=>{var i=r(9),n=r(40),s=Function.prototype,a=i&&Object.getOwnPropertyDescriptor,o=n(s,"name"),l=o&&"something"===(function(){}).name,h=o&&(!i||i&&a(s,"name").configurable);t.exports={EXISTS:o,PROPER:l,CONFIGURABLE:h}},(t,e,r)=>{var i=r(17),n=r(23),s=r(38),a=i(Function.toString);n(s.inspectSource)||(s.inspectSource=function(t){return a(t)}),t.exports=s.inspectSource},(t,e,r)=>{var i,n,s,a=r(54),o=r(7),l=r(17),h=r(22),c=r(45),d=r(40),u=r(38),p=r(55),f=r(56),g="Object already initialized",m=o.TypeError,v=o.WeakMap,b=function(t){return s(t)?n(t):i(t,{})},y=function(t){return function(e){var r;if(!h(e)||(r=n(e)).type!==t)throw m("Incompatible receiver, "+t+" required");return r}};if(a||u.state){var A=u.state||(u.state=new v),_=l(A.get),S=l(A.has),x=l(A.set);
1i=function(t,e){if(S(A,t))throw new m(g);return e.facade=t,x(A,t,e),e},n=function(t){return _(A,t)||{}},s=function(t){return S(A,t)}}else{var w=p("state");f[w]=!0,i=function(t,e){if(d(t,w))throw new m(g);return e.facade=t,c(t,w,e),e},n=function(t){return d(t,w)?t[w]:{}},s=function(t){return d(t,w)}}t.exports={set:i,get:n,has:s,enforce:b,getterFor:y}},(t,e,r)=>{var i=r(7),n=r(23),s=r(52),a=i.WeakMap;t.exports=n(a)&&/native code/.test(s(a))},(t,e,r)=>{var i=r(36),n=r(42),s=i("keys");t.exports=function(t){return s[t]||(s[t]=n(t))}},t=>{t.exports={}},(t,e,r)=>{var i=r(40),n=r(58),s=r(8),a=r(46);t.exports=function(t,e,r){for(var o=n(e),l=a.f,h=s.f,c=0;c<o.length;c++){var d=o[c];i(t,d)||r&&i(r,d)||l(t,d,h(e,d))}}},(t,e,r)=>{var i=r(25),n=r(17),s=r(59),a=r(68),o=r(48),l=n([].concat);t.exports=i("Reflect","ownKeys")||function(t){var e=s.f(o(t)),r=a.f;return r?l(e,r(t)):e}},(t,e,r)=>{var i=r(60),n=r(67).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return i(t,n)}},(t,e,r)=>{var i=r(17),n=r(40),s=r(15),a=r(61).indexOf,o=r(56),l=i([].push);t.exports=function(t,e){var r,i=s(t),h=0,c=[];for(r in i)!n(o,r)&&n(i,r)&&l(c,r);for(;e.length>h;)n(i,r=e[h++])&&(~a(c,r)||l(c,r));return c}},(t,e,r)=>{var i=r(15),n=r(62),s=r(65),a=function(t){return function(e,r,a){var o,l=i(e),h=s(l),c=n(a,h);if(t&&r!=r){for(;h>c;)if((o=l[c++])!=o)return!0}else for(;h>c;c++)if((t||c in l)&&l[c]===r)return t||c||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},(t,e,r)=>{var i=r(63),n=Math.max,s=Math.min;t.exports=function(t,e){var r=i(t);return r<0?n(r+e,0):s(r,e)}},(t,e,r)=>{var i=r(64);t.exports=function(t){var e=+t;return e!=e||0===e?0:i(e)}},t=>{var e=Math.ceil,r=Math.floor;t.exports=Math.trunc||function(t){var i=+t;return(i>0?r:e)(i)}},(t,e,r)=>{var i=r(66);t.exports=function(t){return i(t.length)}},(t,e,r)=>{var i=r(63),n=Math.min;t.exports=function(t){return t>0?n(i(t),9007199254740991):0}},t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},(t,e)=>{e.f=Object.getOwnPropertySymbols},(t,e,r)=>{var i=r(10),n=r(23),s=/#|\.prototype\./,a=function(t,e){var r=l[o(t)];return r==c||r!=h&&(n(e)?i(e):!!e)},o=a.normalize=function(t){return String(t).replace(s,".").toLowerCase()},l=a.data={},h=a.NATIVE="N",c=a.POLYFILL="P";t.exports=a},(t,e,r)=>{var i=r(35),n=r(71),s=r(46).f,a=i("unscopables"),o=Array.prototype;void 0==o[a]&&s(o,a,{configurable:!0,value:n(null)}),t.exports=function(t){o[a][t]=!0}},(t,e,r)=>{var i,n=r(48),s=r(72),a=r(67),o=r(56),l=r(74),h=r(44),c=r(55),d=">",u="<",p="prototype",f="script",g=c("IE_PROTO"),m=function(){},v=function(t){return u+f+d+t+u+"/"+f+d},b=function(t){t.write(v("")),t.close();var e=t.parentWindow.Object;return t=null,e},y=function(){var t,e=h("iframe"),r="java"+f+":";return e.style.display="none",l.appendChild(e),e.src=String(r),(t=e.contentWindow.document).open(),t.write(v("document.F=Object")),t.close(),t.F},A=function(){try{i=new ActiveXObject("htmlfile")}catch(t){}A="undefined"!=typeof document?document.domain&&i?b(i):y():b(i);for(var t=a.length;t--;)delete A[p][a[t]];return A()};o[g]=!0,t.exports=Object.create||function(t,e){var r;return null!==t?(m[p]=n(t),r=new m,m[p]=null,r[g]=t):r=A(),void 0===e?r:s.f(r,e)}},(t,e,r)=>{var i=r(9),n=r(47),s=r(46),a=r(48),o=r(15),l=r(73);e.f=i&&!n?Object.defineProperties:function(t,e){a(t);for(var r,i=o(e),n=l(e),h=n.length,c=0;h>c;)s.f(t,r=n[c++],i[r]);return t}},(t,e,r)=>{var i=r(60),n=r(67);t.exports=Object.keys||function(t){return i(t,n)}},(t,e,r)=>{var i=r(25);t.exports=i("document","documentElement")},(t,e,r)=>{var i=r(7),n=r(17);t.exports=function(t,e){return n(i[t].prototype[e])}},(t,e,r)=>{r(77)},(t,e,r)=>{"use strict";var i=r(78),n=r(65),s=r(63),a=i.aTypedArray;(0,i.exportTypedArrayMethod)("at",function(t){var e=a(this),r=n(e),i=s(t),o=i>
1=0?i:r+i;return o<0||o>=r?void 0:e[o]})},(t,e,r)=>{"use strict";var i,n,s,a=r(79),o=r(9),l=r(7),h=r(23),c=r(22),d=r(40),u=r(80),p=r(33),f=r(45),g=r(49),m=r(46).f,v=r(26),b=r(82),y=r(84),A=r(35),_=r(42),S=r(53),x=S.enforce,w=S.get,E=l.Int8Array,C=E&&E.prototype,T=l.Uint8ClampedArray,k=T&&T.prototype,P=E&&b(E),M=C&&b(C),R=Object.prototype,F=l.TypeError,O=A("toStringTag"),I=_("TYPED_ARRAY_TAG"),D="TypedArrayConstructor",L=a&&!!y&&"Opera"!==u(l.opera),N=!1,j={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},U={BigInt64Array:8,BigUint64Array:8},B=function(t){if(!c(t))return!1;var e=u(t);return"DataView"===e||d(j,e)||d(U,e)},W=function(t){var e=b(t);if(c(e)){var r=w(e);return r&&d(r,D)?r[D]:W(e)}},q=function(t){if(!c(t))return!1;var e=u(t);return d(j,e)||d(U,e)},G=function(t){if(q(t))return t;throw F("Target is not a typed array")},z=function(t){if(h(t)&&(!y||v(P,t)))return t;throw F(p(t)+" is not a typed array constructor")},H=function(t,e,r,i){if(o){if(r)for(var n in j){var s=l[n];if(s&&d(s.prototype,t))try{delete s.prototype[t]}catch(r){try{s.prototype[t]=e}catch(t){}}}(!M[t]||r)&&g(M,t,r?e:L&&C[t]||e,i)}},V=function(t,e,r){var i,n;if(o){if(y){if(r){for(i in j)if((n=l[i])&&d(n,t))try{delete n[t]}catch(t){}}if(P[t]&&!r)return;try{return g(P,t,r?e:L&&P[t]||e)}catch(t){}}for(i in j)(n=l[i])&&(!n[t]||r)&&g(n,t,e)}};for(i in j)(s=(n=l[i])&&n.prototype)?x(s)[D]=n:L=!1;for(i in U)(s=(n=l[i])&&n.prototype)&&(x(s)[D]=n);if((!L||!h(P)||P===Function.prototype)&&(P=function(){throw F("Incorrect invocation")},L))for(i in j)l[i]&&y(l[i],P);if((!L||!M||M===R)&&(M=P.prototype,L))for(i in j)l[i]&&y(l[i].prototype,M);if(L&&b(k)!==M&&y(k,M),o&&!d(M,O))for(i in N=!0,m(M,O,{get:function(){return c(this)?this[I]:void 0}}),j)l[i]&&f(l[i],I,i);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:L,TYPED_ARRAY_TAG:N&&I,aTypedArray:G,aTypedArrayConstructor:z,exportTypedArrayMethod:H,exportTypedArrayStaticMethod:V,getTypedArrayConstructor:W,isView:B,isTypedArray:q,TypedArray:P,TypedArrayPrototype:M}},t=>{t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},(t,e,r)=>{var i=r(81),n=r(23),s=r(18),a=r(35)("toStringTag"),o=Object,l="Arguments"==s(function(){return arguments}()),h=function(t,e){try{return t[e]}catch(t){}};t.exports=i?s:function(t){var e,r,i;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=h(e=o(t),a))?r:l?s(e):"Object"==(i=s(e))&&n(e.callee)?"Arguments":i}},(t,e,r)=>{var i=r(35)("toStringTag"),n={};n[i]="z",t.exports="[object z]"===String(n)},(t,e,r)=>{var i=r(40),n=r(23),s=r(41),a=r(55),o=r(83),l=a("IE_PROTO"),h=Object,c=h.prototype;t.exports=o?h.getPrototypeOf:function(t){var e=s(t);if(i(e,l))return e[l];var r=e.constructor;return n(r)&&e instanceof r?r.prototype:e instanceof h?c:null}},(t,e,r)=>{var i=r(10);t.exports=!i(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})},(t,e,r)=>{var i=r(17),n=r(48),s=r(85);
1t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=i(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),e=r instanceof Array}catch(t){}return function(r,i){return n(r),s(i),e?t(r,i):r.__proto__=i,r}}():void 0)},(t,e,r)=>{var i=r(23),n=String,s=TypeError;t.exports=function(t){if("object"==typeof t||i(t))return t;throw s("Can't set "+n(t)+" as a prototype")}},(t,e,r)=>{r(87),r(93),r(95),r(117),r(119);var i=r(128);t.exports=i.structuredClone},(t,e,r)=>{"use strict";var i=r(15),n=r(70),s=r(88),a=r(53),o=r(46).f,l=r(89),h=r(37),c=r(9),d="Array Iterator",u=a.set,p=a.getterFor(d);t.exports=l(Array,"Array",function(t,e){u(this,{type:d,target:i(t),index:0,kind:e})},function(){var t=p(this),e=t.target,r=t.kind,i=t.index++;return!e||i>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:i,done:!1}:"values"==r?{value:e[i],done:!1}:{value:[i,e[i]],done:!1}},"values");var f=s.Arguments=s.Array;if(n("keys"),n("values"),n("entries"),!h&&c&&"values"!==f.name)try{o(f,"name",{value:"values"})}catch(t){}},t=>{t.exports={}},(t,e,r)=>{"use strict";var i=r(6),n=r(11),s=r(37),a=r(51),o=r(23),l=r(90),h=r(82),c=r(84),d=r(92),u=r(45),p=r(49),f=r(35),g=r(88),m=r(91),v=a.PROPER,b=a.CONFIGURABLE,y=m.IteratorPrototype,A=m.BUGGY_SAFARI_ITERATORS,_=f("iterator"),S="keys",x="values",w="entries",E=function(){return this};t.exports=function(t,e,r,a,f,m,C){l(r,e,a);var T,k,P,M=function(t){if(t===f&&D)return D;if(!A&&t in O)return O[t];switch(t){case S:case x:case w:return function(){return new r(this,t)}}return function(){return new r(this)}},R=e+" Iterator",F=!1,O=t.prototype,I=O[_]||O["@@iterator"]||f&&O[f],D=!A&&I||M(f),L="Array"==e&&O.entries||I;if(L&&(T=h(L.call(new t)))!==Object.prototype&&T.next&&(s||h(T)===y||(c?c(T,y):o(T[_])||p(T,_,E)),d(T,R,!0,!0),s&&(g[R]=E)),v&&f==x&&I&&I.name!==x&&(!s&&b?u(O,"name",x):(F=!0,D=function(){return n(I,this)})),f){if(k={values:M(x),keys:m?D:M(S),entries:M(w)},C)for(P in k)!A&&!F&&P in O||p(O,P,k[P]);else i({target:e,proto:!0,forced:A||F},k)}return(!s||C)&&O[_]!==D&&p(O,_,D,{name:f}),g[e]=D,k}},(t,e,r)=>{"use strict";var i=r(91).IteratorPrototype,n=r(71),s=r(14),a=r(92),o=r(88),l=function(){return this};t.exports=function(t,e,r,h){var c=e+" Iterator";return t.prototype=n(i,{next:s(+!h,r)}),a(t,c,!1,!0),o[c]=l,t}},(t,e,r)=>{"use strict";var i,n,s,a=r(10),o=r(23),l=r(71),h=r(82),c=r(49),d=r(35),u=r(37),p=d("iterator"),f=!1;[].keys&&("next"in(s=[].keys())?(n=h(h(s)))!==Object.prototype&&(i=n):f=!0),void 0==i||a(function(){var t={};return i[p].call(t)!==t})?i={}:u&&(i=l(i)),o(i[p])||c(i,p,function(){return this}),t.exports={IteratorPrototype:i,BUGGY_SAFARI_ITERATORS:f}},(t,e,r)=>{var i=r(46).f,n=r(40),s=r(35)("toStringTag");t.exports=function(t,e,r){t&&!r&&(t=t.prototype),t&&!n(t,s)&&i(t,s,{configurable:!0,value:e})}},(t,e,r)=>{var i=r(81),n=r(49),s=r(94);i||n(Object.prototype,"toString",s,{unsafe:!0})},(t,e,r)=>{"use strict";var i=r(81),n=r(80);t.exports=i?({}).toString:function(){return"[object "+n(this)+"]"}},(t,e,r)=>{r(96)},(t,e,r)=>{"use strict";r(97)("Map",function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},r(114))},(t,e,r)=>{"use strict";var i=r(6),n=r(7),s=r(17),a=r(69),o=r(49),l=r(98),h=r(105),c=r(111),d=r(23),u=r(22),p=r(10),f=r(112),g=r(92),m=r(113);t.exports=function(t,e,r){var v=-1!==t.indexOf("Map"),b=-1!==t.indexOf("Weak"),y=v?"set":"add",A=n[t],_=A&&A.prototype,S=A,x={},w=function(t){var e=s(_[t]);o(_,t,"add"==t?function(t){return e(this,0===t?0:t),this}:"delete"==t?function(t){return(!b||!!u(t))&&e(this,0===t?0:t)}:"get"==t?function(t){return b&&!u(t)?void 0:e(this,0===t?0:t)}:"has"==t?function(t){return(!b||!!u(t))&&e(this,0===t?0:t)}:function(t,r){return e(this,0===t?0:t,r),this})};if(a(t,!d(A)||!(b||_.forEach&&!p(function(){new A().entries().next()}))))S=r.getConstructor(e,t,v,y),l.enable();else if(a(t,!0)){var E=new S,C=E[y](b?{}:-0,1)!=E,T=p(function(){E.has(1)}),k=f(function(t){new A(t)}),P=!b&&p(function(){for(var t=new A,e=5;e--;)t[y](e,e);return!t.has(-0)});k||((S=e(function(t,e){c(t,_);var r=m(new A,t,S);return void 0!=e&&h(e,r[y],{that:r,AS_ENTRIES:v}),r})).prototype=_,_.constructor=S),(T||P)&&(w("delete"),w("has"),v&&w("get")),(P||C)&&w(y),b&&_.clear&&delete _.clear}return x[t]=S,i({global:!0,constructor:!0,forced:S!=A},x),g(S,t),b||r.setStrong(S,t,v),S}},(t,e,r)=>{var i=r(6),n=r(17),s=r(56),a=r(22),o=r(40),l=r(46).f,h=r(59),c=r(99),d=r(102),u=r(42),p=r(104),f=!1,g=u("meta"),m=0,v=function(t){l(t,g,{value:{objectID:"O"+m++,weakData:{}}})}
vendor: 4,966 bytes, line 1
1,b=function(t,e){if(!a(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,g)){if(!d(t))return"F";if(!e)return"E";v(t)}return t[g].objectID},y=function(t,e){if(!o(t,g)){if(!d(t))return!0;if(!e)return!1;v(t)}return t[g].weakData},A=function(t){return p&&f&&d(t)&&!o(t,g)&&v(t),t},_=function(){S.enable=function(){},f=!0;var t=h.f,e=n([].splice),r={};r[g]=1,t(r).length&&(h.f=function(r){for(var i=t(r),n=0,s=i.length;n<s;n++)if(i[n]===g){e(i,n,1);break}return i},i({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:c.f}))},S=t.exports={enable:_,fastKey:b,getWeakData:y,onFreeze:A};s[g]=!0},(t,e,r)=>{var i=r(18),n=r(15),s=r(59).f,a=r(100),o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],l=function(t){try{return s(t)}catch(t){return a(o)}};t.exports.f=function(t){return o&&"Window"==i(t)?l(t):s(n(t))}},(t,e,r)=>{var i=r(62),n=r(65),s=r(101),a=Array,o=Math.max;t.exports=function(t,e,r){for(var l=n(t),h=i(e,l),c=i(void 0===r?l:r,l),d=a(o(c-h,0)),u=0;h<c;h++,u++)s(d,u,t[h]);return d.length=u,d}},(t,e,r)=>{"use strict";var i=r(20),n=r(46),s=r(14);t.exports=function(t,e,r){var a=i(e);a in t?n.f(t,a,s(0,r)):t[a]=r}},(t,e,r)=>{var i=r(10),n=r(22),s=r(18),a=r(103),o=Object.isExtensible,l=i(function(){o(1)});t.exports=l||a?function(t){return!!n(t)&&(!a||"ArrayBuffer"!=s(t))&&(!o||o(t))}:o},(t,e,r)=>{var i=r(10);t.exports=i(function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}})},(t,e,r)=>{var i=r(10);t.exports=!i(function(){return Object.isExtensible(Object.preventExtensions({}))})},(t,e,r)=>{var i=r(106),n=r(11),s=r(48),a=r(33),o=r(107),l=r(65),h=r(26),c=r(108),d=r(109),u=r(110),p=TypeError,f=function(t,e){this.stopped=t,this.result=e},g=f.prototype;t.exports=function(t,e,r){var m,v,b,y,A,_,S,x=r&&r.that,w=!!(r&&r.AS_ENTRIES),E=!!(r&&r.IS_RECORD),C=!!(r&&r.IS_ITERATOR),T=!!(r&&r.INTERRUPTED),k=i(e,x),P=function(t){return m&&u(m,"normal",t),new f(!0,t)},M=function(t){return w?(s(t),T?k(t[0],t[1],P):k(t[0],t[1])):T?k(t,P):k(t)};if(E)m=t.iterator;else if(C)m=t;else{if(!(v=d(t)))throw p(a(t)+" is not iterable");if(o(v)){for(b=0,y=l(t);y>b;b++)if((A=M(t[b]))&&h(g,A))return A;return new f(!1)}m=c(t,v)}for(_=E?t.next:m.next;!(S=n(_,m)).done;){try{A=M(S.value)}catch(t){u(m,"throw",t)}if("object"==typeof A&&A&&h(g,A))return A}return new f(!1)}},(t,e,r)=>{var i=r(17),n=r(32),s=r(12),a=i(i.bind);t.exports=function(t,e){return n(t),void 0===e?t:s?a(t,e):function(){return t.apply(e,arguments)}}},(t,e,r)=>{var i=r(35),n=r(88),s=i("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(n.Array===t||a[s]===t)}},(t,e,r)=>{var i=r(11),n=r(32),s=r(48),a=r(33),o=r(109),l=TypeError;t.exports=function(t,e){var r=arguments.length<2?o(t):e;if(n(r))return s(i(r,t));throw l(a(t)+" is not iterable")}},(t,e,r)=>{var i=r(80),n=r(31),s=r(88),a=r(35)("iterator");t.exports=function(t){if(void 0!=t)return n(t,a)||n(t,"@@iterator")||s[i(t)]}},(t,e,r)=>{var i=r(11),n=r(48),s=r(31);t.exports=function(t,e,r){var a,o;n(t);try{if(!(a=s(t,"return"))){if("throw"===e)throw r;return r}a=i(a,t)}catch(t){o=!0,a=t}if("throw"===e)throw r;if(o)throw a;return n(a),r}},(t,e,r)=>{var i=r(26),n=TypeError;t.exports=function(t,e){if(i(e,t))return t;throw n("Incorrect invocation")}},(t,e,r)=>{var i=r(35)("iterator"),n=!1;try{var s=0,a={next:function(){return{done:!!s++}},return:function(){n=!0}};a[i]=function(){return this},Array.from(a,function(){throw 2})}catch(t){}t.exports=function(t,e){if(!e&&!n)return!1;var r=!1;try{var s={};s[i]=function(){return{next:function(){return{done:r=!0}}}},t(s)}catch(t){}return r}},(t,e,r)=>{var i=r(23),n=r(22),s=r(84);t.exports=function(t,e,r){var a,o;return s&&i(a=e.constructor)&&a!==r&&n(o=a.prototype)&&o!==r.prototype&&s(t,o),t}},(t,e,r)=>{"use strict";var i=r(46).f,n=r(71),s=r(115),a=r(106),o=r(111),l=r(105),h=r(89),c=r(116),d=r(9),u=r(98).fastKey,p=r(53),f=p.set,g=p.getterFor;t.exports={getConstructor:function(t,e,r,h){var c=t(function(t,i){o(t,p),f(t,{type:e,index:n(null),first:void 0,last:void 0,size:0}),d||(t.size=0),void 0!=i&&l(i,t[h],{that:t,AS_ENTRIES:r})}),p=c.prototype,m=g(e),v=function(t,e,r){var i,n,s=m(t),a=b(t,e);return a?a.value=r:(s.last=a={index:n=u(e,!0),key:e,value:r,previous:i=s.last,next:void 0,removed:!1},s.first||(s.first=a),i&&(i.next=a),d?s.size++:t.size++,"F"!==n&&(s.index[n]=a)),t},b=function(t,e){var r,i=m(t),n=u(e);if("F"!==n)return i.index[n];for(r=i.first;r;r=r.next)if(r.key==e)return r};return s(p,{clear:function(){for(var t=this,e=m(t),r=e.index,i=e.first;i;)i.removed=!0,i.previous&&(i.previous=i.previous.next=void 0),delete r[i.index],i=i.next;e.first=e.last=void 0,d?e.size=0:t.size=0},delete:function(t){var e=this,r=m(e),i=b(e,t);if(i){var n=i.next,s=i.previous;delete r.index[i.index],i.removed=!0,s&&(s.next=n),n&&(n.previous=s),r.first==i&&(r.first=n),r.last==i&&(r.last=s),d?r.size--:e.size--}return!!i}
1,forEach:function(t){for(var e,r=m(this),i=a(t,arguments.length>1?arguments[1]:void 0);e=e?e.next:r.first;)for(i(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!b(this,t)}}),s(p,r?{get:function(t){var e=b(this,t);return e&&e.value},set:function(t,e){return v(this,0===t?0:t,e)}}:{add:function(t){return v(this,t=0===t?0:t,t)}}),d&&i(p,"size",{get:function(){return m(this).size}}),c},setStrong:function(t,e,r){var i=e+" Iterator",n=g(e),s=g(i);h(t,e,function(t,e){f(this,{type:i,target:t,state:n(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)?"keys"==e?{value:r.key,done:!1}:"values"==e?{value:r.value,done:!1}:{value:[r.key,r.value],done:!1}:(t.target=void 0,{value:void 0,done:!0})},r?"entries":"values",!r,!0),c(e)}}},(t,e,r)=>{var i=r(49);t.exports=function(t,e,r){for(var n in e)i(t,n,e[n],r);return t}},(t,e,r)=>{"use strict";var i=r(25),n=r(46),s=r(35),a=r(9),o=s("species");t.exports=function(t){var e=i(t),r=n.f;a&&e&&!e[o]&&r(e,o,{configurable:!0,get:function(){return this}})}},(t,e,r)=>{r(118)},(t,e,r)=>{"use strict";r(97)("Set",function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},r(114))},(t,e,r)=>{var i=r(37),n=r(6),s=r(7),a=r(25),o=r(17),l=r(10),h=r(42),c=r(23),d=r(120),u=r(22),p=r(24),f=r(105),g=r(48),m=r(80),v=r(40),b=r(101),y=r(45),A=r(65),_=r(121),S=r(122),x=r(124),w=r(29),E=r(125),C=r(126),T=r(127),k=s.Object,P=s.Date,M=s.Error,R=s.EvalError,F=s.RangeError,O=s.ReferenceError,I=s.SyntaxError,D=s.TypeError,L=s.URIError,N=s.PerformanceMark,j=s.WebAssembly,U=j&&j.CompileError||M,B=j&&j.LinkError||M,W=j&&j.RuntimeError||M,q=a("DOMException"),G=a("Set"),z=a("Map"),H=z.prototype,V=o(H.has),$=o(H.get),X=o(H.set),Y=o(G.prototype.add),K=a("Object","keys"),J=o([].push),Q=o((!0).valueOf),Z=o(1..valueOf),tt=o("".valueOf),te=o(P.prototype.getTime),tr=h("structuredClone"),ti="DataCloneError",tn="Transferring",ts=function(t){return!l(function(){var e=new s.Set([7]),r=t(e),i=t(k(7));return r==e||!r.has(7)||"object"!=typeof i||7!=i})&&t},ta=function(t,e){return!l(function(){var r=new e,i=t({a:r,b:r});return!(i&&i.a===i.b&&i.a instanceof e&&i.a.stack===r.stack)})},to=function(t){return!l(function(){var e=t(new s.AggregateError([1],tr,{cause:3}));return"AggregateError"!=e.name||1!=e.errors[0]||e.message!=tr||3!=e.cause})},tl=s.structuredClone,th=i||!ta(tl,M)||!ta(tl,q)||!to(tl),tc=!tl&&ts(function(t){return new N(tr,{detail:t}).detail}),td=ts(tl)||tc,tu=function(t){throw new q("Uncloneable type: "+t,ti)},tp=function(t,e){throw new q((e||"Cloning")+" of "+t+" cannot be properly polyfilled in this engine",ti)},tf=function(t,e){if(p(t)&&tu("Symbol"),!u(t))return t;if(e){if(V(e,t))return $(e,t)}else e=new z;var r,i,n,o,l,h,f,g,_,w,E=m(t),C=!1;switch(E){case"Array":n=[],C=!0;break;case"Object":n={},C=!0;break;case"Map":n=new z,C=!0;break;case"Set":n=new G,C=!0;break;case"RegExp":n=new RegExp(t.source,S(t));break;case"Error":switch(i=t.name){case"AggregateError":n=a("AggregateError")([]);break;case"EvalError":n=R();break;case"RangeError":n=F();break;case"ReferenceError":n=O();break;case"SyntaxError":n=I();break;case"TypeError":n=D();break;case"URIError":n=L();break;case"CompileError":n=U();break;case"LinkError":n=B();break;case"RuntimeError":n=W();break;default:n=M()}C=!0;break;case"DOMException":n=new q(t.message,t.name),C=!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":u(r=s[E])||tp(E),n=new r(tf(t.buffer,e),t.byteOffset,"DataView"===E?t.byteLength:t.length);break;case"DOMQuad":try{n=new DOMQuad(tf(t.p1,e),tf(t.p2,e),tf(t.p3,e),tf(t.p4,e))}catch(e){td?n=td(t):tp(E)}break;case"FileList":if(d(r=s.DataTransfer)){for(l=0,o=new r,h=A(t);l<h;l++)o.items.add(tf(t[l],e));n=o.files}else td?n=td(t):tp(E);break;case"ImageData":try{n=new ImageData(tf(t.data,e),t.width,t.height,{colorSpace:t.colorSpace})}catch(e){td?n=td(t):tp(E)}break;default:if(td)n=td(t);else switch(E){case"BigInt":n=k(t.valueOf());break;case"Boolean":n=k(Q(t));break;case"Number":n=k(Z(t));break;case"String":n=k(tt(t));break;case"Date":n=new P(te(t));break;case"ArrayBuffer":(r=s.DataView)||"function"==typeof t.slice||tp(E);try{if("function"==typeof t.slice)n=t.slice(0);else for(l=0,h=t.byteLength,n=new ArrayBuffer(h),_=new r(t),w=new r(n);l<h;l++)w.setUint8(l,_.getUint8(l))}catch(t){throw new q("ArrayBuffer is detached",ti)}break;case"SharedArrayBuffer":n=t;break;case"Blob":try{n=t.slice(0,t.size,t.type)}catch(t){tp(E)}break;case"DOMPoint":case"DOMPointReadOnly":r=s[E];try{n=r.fromPoint?r.fromPoint(t):new r(t.x,t.y,t.z,t.w)}catch(t){tp(E)}break;case"DOMRect":case"DOMRectReadOnly":r=s[E];try{n=r.fromRect?r.fromRect(t):new r(t.x,t.y,t.width,t.height)}catch(t){tp(E)}break;case"DOMMatrix":case"DOMMatrixReadOnly":r=s[E];try{n=r.fromMatrix?r.fromMatrix(t):new r(t)}catch(t){tp(E)}break;case"AudioData":case"VideoFrame":c(t.clone)||tp(E);try{n=t.clone()}catch(t){tu(E)}break;case"File":try{n=new File([t],t.name,t)}catch(t){tp(E)}break;case"CryptoKey":case"GPUCompilationMessage":case"GPUCompilationInfo":case"ImageBitmap":case"RTCCertificate":case"WebAssembly.Module":tp(E);default:tu(E)}}if(X(e,t,n),C)switch(E){case"Array":case"Object":for(l=0,h=A(f=K(t));l<h;l++)g=f[l],b(n,g,tf(t[g],e));break;case"Map":t.forEach(function(t,r){X(n,tf(r,e),tf(t,e))});break;case"Set":t.forEach(function(t){Y(n,tf(t,e))});break;case"Error":y(n,"message",tf(t.message,e)),v(t,"cause")&&y(n,"cause",tf(t.cause,e)),"AggregateError"==i&&(n.errors=tf(t.errors,e));case"DOMException":x&&y(n,"stack",tf(t.stack,e))}return n},tg=tl&&!l(function(){if(C&&w>92||T&&w>94||E&&w>97)return!1;var t=new ArrayBuffer(8),e=tl(t,{transfer:[t]});return 0!=t.byteLength||8!=e.byteLength}),tm=function(t,e){if(!u(t))throw D("Transfer option cannot be converted to a sequence");var r,i,n,a,o,l,h=[];f(t,function(t){J(h,g(t))});var p=0,v=A(h);if(tg)for(a=tl(h,{transfer:h});p<v;)X(e,h[p],a[p++]);else for(;p<v;){if(V(e,r=h[p++]))throw new q("Duplicate transferable",ti);switch(i=m(r)){case"ImageBitmap":d(n=s.OffscreenCanvas)||tp(i,tn);try{(l=new n(r.width,r.height)).getContext("bitmaprenderer").transferFromImageBitmap(r),o=l.transferToImageBitmap()}catch(t){}break;case"AudioData":case"VideoFrame":c(r.clone)&&c(r.close)||tp(i,tn);try{o=r.clone(),r.close()}catch(t){}break;case"ArrayBuffer":case"MessagePort":case"OffscreenCanvas":case"ReadableStream":case"TransformStream":case"WritableStream":tp(i,tn)}if(void 0===o)throw new q("This object cannot be transferred: "+i,ti);X(e,r,o)}};n({global:!0,enumerable:!0,sham:!tg,forced:th},{structuredClone:function(t){var e,r=_(arguments.length,1)>1&&null!=arguments[1]?g(arguments[1]):void 0,i=r?r.transfer:void 0;return void 0!==i&&tm(i,e=new z),tf(t,e)}})},(t,e,r)=>{var i=r(17),n=r(10),s=r(23),a=r(80),o=r(25),l=r(52),h=function(){},c=[],d=o("Reflect","construct"),u=/^\s*(?:class|function)\b/,p=i(u.exec),f=!u.exec(h),g=function(t){if(!s(t))return!1;try{return d(h,c,t),!0}catch(t){return!1}},m=function(t){if(!s(t))return!1;switch(a(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return f||!!p(u,l(t))}catch(t){return!0}};
1m.sham=!0,t.exports=!d||n(function(){var t;return g(g.call)||!g(Object)||!g(function(){t=!0})||t})?m:g},t=>{var e=TypeError;t.exports=function(t,r){if(t<r)throw e("Not enough arguments");return t}},(t,e,r)=>{var i=r(11),n=r(40),s=r(26),a=r(123),o=RegExp.prototype;t.exports=function(t){var e=t.flags;return!(void 0===e&&!("flags"in o)&&!n(t,"flags")&&s(o,t))?e:i(a,t)}},(t,e,r)=>{"use strict";var i=r(48);t.exports=function(){var t=i(this),e="";return t.hasIndices&&(e+="d"),t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.unicodeSets&&(e+="v"),t.sticky&&(e+="y"),e}},(t,e,r)=>{var i=r(10),n=r(14);t.exports=!i(function(){var t=Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",n(1,7)),7!==t.stack)})},(t,e,r)=>{var i=r(126),n=r(127);t.exports=!i&&!n&&"object"==typeof window&&"object"==typeof document},t=>{t.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},(t,e,r)=>{var i=r(18),n=r(7);t.exports="process"==i(n.process)},(t,e,r)=>{var i=r(7);t.exports=i},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{"use strict";let createPDFNetworkStream;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 _document,_document$currentScri,_util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(130),_display_utils=__w_pdfjs_require__(133),_font_loader=__w_pdfjs_require__(136),_canvas=__w_pdfjs_require__(137),_worker_options=__w_pdfjs_require__(140),_is_node=__w_pdfjs_require__(3),_message_handler=__w_pdfjs_require__(141),_metadata=__w_pdfjs_require__(142),_optional_content_config=__w_pdfjs_require__(143),_transport_stream=__w_pdfjs_require__(144),_xfa_text=__w_pdfjs_require__(145);function _classPrivateMethodInitSpec(t,e){_checkPrivateRedeclaration(t,e),e.add(t)}function _classPrivateMethodGet(t,e,r){if(!e.has(t))throw TypeError("attempted to get private field on non-instance");return r}function _classPrivateFieldInitSpec(t,e,r){_checkPrivateRedeclaration(t,e),e.set(t,r)}function _checkPrivateRedeclaration(t,e){if(e.has(t))throw TypeError("Cannot initialize the same private elements twice on an object")}function _classPrivateFieldSet(t,e,r){var i=_classExtractFieldDescriptor(t,e,"set");return _classApplyDescriptorSet(t,i,r),r}function _classPrivateFieldGet(t,e){var r=_classExtractFieldDescriptor(t,e,"get");return _classApplyDescriptorGet(t,r)}function _classExtractFieldDescriptor(t,e,r){if(!e.has(t))throw TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function _classStaticPrivateFieldSpecSet(t,e,r,i){return _classCheckPrivateStaticAccess(t,e),_classCheckPrivateStaticFieldDescriptor(r,"set"),_classApplyDescriptorSet(t,r,i),i}function _classApplyDescriptorSet(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw 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 TypeError("attempted to "+e+" private static field before its declaration")}function _classCheckPrivateStaticAccess(t,e){if(t!==e)throw TypeError("Private static access of wrong provenance")}function _classApplyDescriptorGet(t,e){return e.get?e.get.call(t):e.value}let DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DefaultCanvasFactory=_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;let DefaultCMapReaderFactory=_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;let DefaultStandardFontDataFactory=_display_utils.DOMStandardFontDataFactory;if(exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory,_is_node.isNodeJS){let{NodeCanvasFactory,NodeCMapReaderFactory,NodeStandardFontDataFactory}=__w_pdfjs_require__(146);exports.DefaultCanvasFactory=DefaultCanvasFactory=NodeCanvasFactory,exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory=NodeCMapReaderFactory,exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory=NodeStandardFontDataFactory}function setPDFNetworkStreamFactory(t){createPDFNetworkStream=t}function getDocument(t){let e;let r=new PDFDocumentLoadingTask;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 Error("Invalid parameter in getDocument, need either string, URL, TypedArray, or parameter object.");if(!t.url&&!t.data&&!t.range)throw Error("Invalid parameter object: need either .data, .range or .url");e=t}let i=Object.create(null),n=null,s=null;for(let t in e){let r=e[t];switch(t){case"url":if("undefined"!=typeof window)try{i[t]=new URL(r,window.location).href;continue}catch(t){(0,_util.warn)(`Cannot create valid URL: "${t}".`)}else if("string"==typeof r||r instanceof URL){i[t]=r.toString();continue}throw Error("Invalid PDF url data: either string or URL-object is expected in the url property.");case"range":n=r;continue;case"worker":s=r;continue;case"data":if(_is_node.isNodeJS&&void 0!==Buffer&&r instanceof Buffer)i[t]=new Uint8Array(r);else if(r instanceof Uint8Array)break;else if("string"==typeof r)i[t]=(0,_util.stringToBytes)(r);else if("object"!=typeof r||null===r||isNaN(r.length)){if((0,_util.isArrayBuffer)(r))i[t]=new Uint8Array(r);else throw Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}else i[t]=new Uint8Array(r);continue}i[t]=r}if(i.CMapReaderFactory=i.CMapReaderFactory||DefaultCMapReaderFactory,i.StandardFontDataFactory=i.StandardFontDataFactory||DefaultStandardFontDataFactory,i.ignoreErrors=!0!==i.stopAtErrors,i.fontExtraProperties=!0===i.fontExtraProperties,i.pdfBug=!0===i.pdfBug,i.enableXfa=!0===i.enableXfa,(!Number.isInteger(i.rangeChunkSize)||i.rangeChunkSize<1)&&(i.rangeChunkSize=DEFAULT_RANGE_CHUNK_SIZE),("string"!=typeof i.docBaseUrl||(0,_display_utils.isDataScheme)(i.docBaseUrl))&&(i.docBaseUrl=null),(!Number.isInteger(i.maxImageSize)||i.maxImageSize<-1)&&(i.maxImageSize=-1),"string"!=typeof i.cMapUrl&&(i.cMapUrl=null),"string"!=typeof i.standardFontDataUrl&&(i.standardFontDataUrl=null),"boolean"!=typeof i.useWorkerFetch&&(i.useWorkerFetch=i.CMapReaderFactory===_display_utils.DOMCMapReaderFactory&&i.StandardFontDataFactory===_display_utils.DOMStandardFontDataFactory),"boolean"!=typeof i.isEvalSupported&&(i.isEvalSupported=!0),"boolean"!=typeof i.disableFontFace&&(i.disableFontFace=_is_node.isNodeJS),"boolean"!=typeof i.useSystemFonts&&(i.useSystemFonts=!_is_node.isNodeJS&&!i.disableFontFace),("object"!=typeof i.ownerDocument||null===i.ownerDocument)&&(i.ownerDocument=globalThis.document),"boolean"!=typeof i.disableRange&&(i.disableRange=!1),"boolean"!=typeof i.disableStream&&(i.disableStream=!1),"boolean"!=typeof i.disableAutoFetch&&(i.disableAutoFetch=!1),(0,_util.setVerbosityLevel)(i.verbosity),!s){let t={verbosity:i.verbosity,port:_worker_options.GlobalWorkerOptions.workerPort};s=t.port?PDFWorker.fromPort(t):new PDFWorker(t),r._worker=s}let a=r.docId;return s.promise.then(function(){if(r.destroyed)throw Error("Loading aborted");return Promise.all([_fetchDocument(s,i,n,a),new Promise(function(t){let e;n?e=new _transport_stream.PDFDataTransportStream({length:i.length,initialData:i.initialData,progressiveDone:i.progressiveDone,contentDispositionFilename:i.contentDispositionFilename,disableRange:i.disableRange,disableStream:i.disableStream},n):i.data||(e=createPDFNetworkStream({url:i.url,length:i.length,httpHeaders:i.httpHeaders,withCredentials:i.withCredentials,rangeChunkSize:i.rangeChunkSize,disableRange:i.disableRange,disableStream:i.disableStream})),t(e)})]).then(function(t){let[e,n]=t;if(r.destroyed)throw Error("Loading aborted");let o=new _message_handler.MessageHandler(a,e,s.port),l=new WorkerTransport(o,r,n,i);r._transport=l,o.send("Ready",null)})}).catch(r._capability.reject),r}async function _fetchDocument(t,e,r,i){if(t.destroyed)throw Error("Worker was destroyed");r&&(e.length=r.length,e.initialData=r.initialData,e.progressiveDone=r.progressiveDone,e.contentDispositionFilename=r.contentDispositionFilename);
1let n=await t.messageHandler.sendWithPromise("GetDocRequest",{docId:i,apiVersion:"2.16.105",source:{data:e.data,url:e.url,password:e.password,disableAutoFetch:e.disableAutoFetch,rangeChunkSize:e.rangeChunkSize,length:e.length},maxImageSize:e.maxImageSize,disableFontFace:e.disableFontFace,docBaseUrl:e.docBaseUrl,ignoreErrors:e.ignoreErrors,isEvalSupported:e.isEvalSupported,fontExtraProperties:e.fontExtraProperties,enableXfa:e.enableXfa,useSystemFonts:e.useSystemFonts,cMapUrl:e.useWorkerFetch?e.cMapUrl:null,standardFontDataUrl:e.useWorkerFetch?e.standardFontDataUrl:null});if(e.data&&(e.data=null),t.destroyed)throw Error("Worker was destroyed");return n}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?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){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this.length=t,this.initialData=e,this.progressiveDone=r,this.contentDispositionFilename=i,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(let r of this._rangeListeners)r(t,e)}onDataProgress(t,e){this._readyCapability.promise.then(()=>{for(let r of this._progressListeners)r(t,e)})}onDataProgressiveRead(t){this._readyCapability.promise.then(()=>{for(let e of this._progressiveReadListeners)e(t)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(let t of this._progressiveDoneListeners)t()})}transportReady(){this._readyCapability.resolve()}requestDataRange(t,e){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(t,e){this._pdfInfo=t,this._transport=e,Object.defineProperty(this,"fingerprint",{get(){return(0,_display_utils.deprecated)("`PDFDocumentProxy.fingerprint`, please use `PDFDocumentProxy.fingerprints` instead."),this.fingerprints[0]}}),Object.defineProperty(this,"getStats",{value:async()=>((0,_display_utils.deprecated)("`PDFDocumentProxy.getStats`, please use the `PDFDocumentProxy.stats`-getter instead."),this.stats||{streamTypes:{},fontTypes:{}})})}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()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._transport.startCleanup(t||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}saveDocument(){return this._transport.annotationStorage.size<=0&&(0,_display_utils.deprecated)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead."),this._transport.saveDocument()}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{constructor(t,e,r,i){let n=arguments.length>4&&void 0!==arguments[4]&&arguments[4];this._pageIndex=t,this._pageInfo=e,this._ownerDocument=i,this._transport=r,this._stats=n?new _display_utils.StatTimer:null,this._pdfBug=n,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(){let{scale:t,rotation:e=this.rotate,offsetX:r=0,offsetY:i=0,dontFlip:n=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new _display_utils.PageViewport({viewBox:this.view,scale:t,rotation:e,offsetX:r,offsetY:i,dontFlip:n})}getAnnotations(){let{intent:t="display"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}
1,e=this._transport.getRenderingIntent(t),r=this._annotationPromises.get(e.cacheKey);return r||(r=this._transport.getAnnotations(this._pageIndex,e.renderingIntent),this._annotationPromises.set(e.cacheKey,r),r=r.then(t=>{for(let e of t)void 0!==e.titleObj&&Object.defineProperty(e,"title",{get:()=>((0,_display_utils.deprecated)("`title`-property on annotation, please use `titleObj` instead."),e.titleObj.str)}),void 0!==e.contentsObj&&Object.defineProperty(e,"contents",{get:()=>((0,_display_utils.deprecated)("`contents`-property on annotation, please use `contentsObj` instead."),e.contentsObj.str)});return t})),r}getJSActions(){return this._jsActionsPromise||(this._jsActionsPromise=this._transport.getPageJSActions(this._pageIndex))}async getXfa(){var t;return(null===(t=this._transport._htmlForXfa)||void 0===t?void 0:t.children[this._pageIndex])||null}render(t){var e,r,i;let{canvasContext:n,viewport:s,intent:a="display",annotationMode:o=_util.AnnotationMode.ENABLE,transform:l=null,imageLayer:h=null,canvasFactory:c=null,background:d=null,optionalContentConfigPromise:u=null,annotationCanvasMap:p=null,pageColors:f=null,printAnnotationStorage:g=null}=t;(null===(e=arguments[0])||void 0===e?void 0:e.renderInteractiveForms)!==void 0&&((0,_display_utils.deprecated)("render no longer accepts the `renderInteractiveForms`-option, please use the `annotationMode`-option instead."),!0===arguments[0].renderInteractiveForms&&o===_util.AnnotationMode.ENABLE&&(o=_util.AnnotationMode.ENABLE_FORMS)),(null===(r=arguments[0])||void 0===r?void 0:r.includeAnnotationStorage)!==void 0&&((0,_display_utils.deprecated)("render no longer accepts the `includeAnnotationStorage`-option, please use the `annotationMode`-option instead."),!0===arguments[0].includeAnnotationStorage&&o===_util.AnnotationMode.ENABLE&&(o=_util.AnnotationMode.ENABLE_STORAGE)),this._stats&&this._stats.time("Overall");let m=this._transport.getRenderingIntent(a,o,g);this.pendingCleanup=!1,u||(u=this._transport.getOptionalContentConfig());let v=this._intentStates.get(m.cacheKey);v||(v=Object.create(null),this._intentStates.set(m.cacheKey,v)),v.streamReaderCancelTimeout&&(clearTimeout(v.streamReaderCancelTimeout),v.streamReaderCancelTimeout=null);let b=c||new DefaultCanvasFactory({ownerDocument:this._ownerDocument}),y=!!(m.renderingIntent&_util.RenderingIntentFlag.PRINT);v.displayReadyCapability||(v.displayReadyCapability=(0,_util.createPromiseCapability)(),v.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats&&this._stats.time("Page Request"),this._pumpOperatorList(m));let A=t=>{v.renderTasks.delete(_),(this.cleanupAfterRender||y)&&(this.pendingCleanup=!0),this._tryCleanup(),t?(_.capability.reject(t),this._abortOperatorList({intentState:v,reason:t instanceof Error?t:Error(t)})):_.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"))},_=new InternalRenderTask({callback:A,params:{canvasContext:n,viewport:s,transform:l,imageLayer:h,background:d},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:p,operatorList:v.operatorList,pageIndex:this._pageIndex,canvasFactory:b,useRequestAnimationFrame:!y,pdfBug:this._pdfBug,pageColors:f});((i=v).renderTasks||(i.renderTasks=new Set)).add(_);let S=_.task;return Promise.all([v.displayReadyCapability.promise,u]).then(t=>{let[e,r]=t;if(this.pendingCleanup){A();return}this._stats&&this._stats.time("Rendering"),_.initializeGraphics({transparency:e,optionalContentConfig:r}),_.operatorListChanged()}).catch(A),S}getOperatorList(){let t,{intent:e="display",annotationMode:r=_util.AnnotationMode.ENABLE,printAnnotationStorage:i=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};function n(){a.operatorList.lastChunk&&(a.opListReadCapability.resolve(a.operatorList),a.renderTasks.delete(t))}let s=this._transport.getRenderingIntent(e,r,i,!0),a=this._intentStates.get(s.cacheKey);if(a||(a=Object.create(null),this._intentStates.set(s.cacheKey,a)),!a.opListReadCapability){var o;(t=Object.create(null)).operatorListChanged=n,a.opListReadCapability=(0,_util.createPromiseCapability)(),((o=a).renderTasks||(o.renderTasks=new Set)).add(t),a.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats&&this._stats.time("Page Request"),this._pumpOperatorList(s)}return a.opListReadCapability.promise}streamTextContent(){let{disableCombineTextItems:t=!1,includeMarkedContent:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=100;return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,combineTextItems:!0!==t,includeMarkedContent:!0===e},{highWaterMark:r,size:t=>t.items.length})}getTextContent(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._transport._htmlForXfa)return this.getXfa().then(t=>_xfa_text.XfaText.textContent(t));let e=this.streamTextContent(t);return new Promise(function(t,r){function i(){n.read().then(function(e){let{value:r,done:n}=e;if(n){t(s);return}Object.assign(s.styles,r.styles),s.items.push(...r.items),i()},r)}let n=e.getReader(),s={items:[],styles:Object.create(null)};i()})}getStructTree(){return this._structTreePromise||(this._structTreePromise=this._transport.getStructTree(this._pageIndex))}_destroy(){this.destroyed=!0;let t=[];for(let e of this._intentStates.values())if(this._abortOperatorList({intentState:e,reason:Error("Page was destroyed."),force:!0}),!e.opListReadCapability)for(let r of e.renderTasks)t.push(r.completed),r.cancel();for(let t of(this.objs.clear(),this._bitmaps))t.close();return this._bitmaps.clear(),this._annotationPromises.clear(),this._jsActionsProm
1ise=null,this._structTreePromise=null,this.pendingCleanup=!1,Promise.all(t)}cleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.pendingCleanup=!0,this._tryCleanup(t)}_tryCleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.pendingCleanup)return!1;for(let{renderTasks:t,operatorList:e}of this._intentStates.values())if(t.size>0||!e.lastChunk)return!1;for(let e of(this._intentStates.clear(),this.objs.clear(),this._annotationPromises.clear(),this._jsActionsPromise=null,this._structTreePromise=null,t&&this._stats&&(this._stats=new _display_utils.StatTimer),this._bitmaps))e.close();return this._bitmaps.clear(),this.pendingCleanup=!1,!0}_startRenderPage(t,e){let r=this._intentStates.get(e);r&&(this._stats&&this._stats.timeEnd("Page Request"),r.displayReadyCapability&&r.displayReadyCapability.resolve(t))}_renderPageChunk(t,e){for(let r=0,i=t.length;r<i;r++)e.operatorList.fnArray.push(t.fnArray[r]),e.operatorList.argsArray.push(t.argsArray[r]);for(let r of(e.operatorList.lastChunk=t.lastChunk,e.operatorList.separateAnnots=t.separateAnnots,e.renderTasks))r.operatorListChanged();t.lastChunk&&this._tryCleanup()}_pumpOperatorList(t){let{renderingIntent:e,cacheKey:r,annotationStorageMap:i}=t,n=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:e,cacheKey:r,annotationStorage:i}).getReader(),s=this._intentStates.get(r);s.streamReader=n;let a=()=>{n.read().then(t=>{let{value:e,done:r}=t;if(r){s.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(e,s),a())},t=>{if(s.streamReader=null,!this._transport.destroyed){if(s.operatorList){for(let t of(s.operatorList.lastChunk=!0,s.renderTasks))t.operatorListChanged();this._tryCleanup()}if(s.displayReadyCapability)s.displayReadyCapability.reject(t);else if(s.opListReadCapability)s.opListReadCapability.reject(t);else throw t}})};a()}_abortOperatorList(t){let{intentState:e,reason:r,force:i=!1}=t;if(e.streamReader){if(!i){if(e.renderTasks.size>0)return;if(r instanceof _display_utils.RenderingCancelledException){e.streamReaderCancelTimeout=setTimeout(()=>{this._abortOperatorList({intentState:e,reason:r,force:!0}),e.streamReaderCancelTimeout=null},RENDERING_CANCELLED_TIMEOUT);return}}if(e.streamReader.cancel(new _util.AbortException(r.message)).catch(()=>{}),e.streamReader=null,!this._transport.destroyed){for(let[t,r]of this._intentStates)if(r===e){this._intentStates.delete(t);break}this.cleanup()}}}get stats(){return this._stats}}exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{constructor(){this._listeners=[],this._deferred=Promise.resolve()}postMessage(t,e){let r={data:structuredClone(t,e)};this._deferred.then(()=>{for(let t of this._listeners)t.call(this,r)})}addEventListener(t,e){this._listeners.push(e)}removeEventListener(t,e){let r=this._listeners.indexOf(e);this._listeners.splice(r,1)}terminate(){this._listeners.length=0}}exports.LoopbackPort=LoopbackPort;let PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};if(exports.PDFWorkerUtil=PDFWorkerUtil,_is_node.isNodeJS)PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if("object"==typeof document){let pdfjsFilePath=null===(_document=document)||void 0===_document?void 0:null===(_document$currentScri=_document.currentScript)||void 0===_document$currentScri?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}let i=new URL(e,r);return r.origin===i.origin},PDFWorkerUtil.createCDNWrapper=function(t){let e=`importScripts("${t}");`;return URL.createObjectURL(new Blob([e]))};class PDFWorker{constructor(){let{name:t=null,port:e=null,verbosity:r=(0,_util.getVerbosityLevel)()}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e&&_classStaticPrivateFieldSpecGet(PDFWorker,PDFWorker,_workerPorts).has(e))throw Error("Cannot use more than one PDFWorker per port.");if(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);return}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()}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:t}=PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,t)||(t=PDFWorkerUtil.createCDNWrapper(new URL(t,window.location).href));let e=new Worker(t),r=new _message_handler.MessageHandler("main","worker",e),i=()=>{e.removeEventListener("error",n),r.destroy(),e.terminate(),this.destroyed?this._readyCapability.reject(Error("Worker was destroyed")):this._setupFakeWorker()},n=()=>{this._webWorker||i()};e.addEventListener("error",n),r.on("test",t=>
1{if(e.removeEventListener("error",n),this.destroyed){i();return}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",n),this.destroyed){i();return}try{s()}catch(t){this._setupFakeWorker()}});let s=()=>{let t=new Uint8Array;r.send("test",t,[t.buffer])};s();return}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=>{if(this.destroyed){this._readyCapability.reject(Error("Worker was destroyed"));return}let e=new LoopbackPort;this._port=e;let r=`fake${PDFWorkerUtil.fakeWorkerId++}`,i=new _message_handler.MessageHandler(r+"_worker",r,e);t.setup(i,e);let n=new _message_handler.MessageHandler(r,r+"_worker",e);this._messageHandler=n,this._readyCapability.resolve(),n.send("configure",{verbosity:this.verbosity})}).catch(t=>{this._readyCapability.reject(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))throw Error("PDFWorker.fromPort - invalid method signature.");return _classStaticPrivateFieldSpecGet(this,PDFWorker,_workerPorts).has(t.port)?_classStaticPrivateFieldSpecGet(this,PDFWorker,_workerPorts).get(t.port):new PDFWorker(t)}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 Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){try{var t;return(null===(t=globalThis.pdfjsWorker)||void 0===t?void 0:t.WorkerMessageHandler)||null}catch(t){return null}}static get _setupFakeWorkerGlobal(){let loader=async()=>{let mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_is_node.isNodeJS){let worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}return await (0,_display_utils.loadScript)(this.workerSrc),window.pdfjsWorker.WorkerMessageHandler};return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}}exports.PDFWorker=PDFWorker;var _workerPorts={writable:!0,value:new WeakMap};PDFWorker.getWorkerSrc=function(){return(0,_display_utils.deprecated)("`PDFWorker.getWorkerSrc()`, please use `PDFWorker.workerSrc` instead."),this.workerSrc};var _docStats=new WeakMap,_pageCache=new WeakMap,_pagePromises=new WeakMap,_metadataPromise=new WeakMap;class WorkerTransport{constructor(t,e,r,i){_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({docId:e.docId,onUnsupportedFeature:this._onUnsupportedFeature.bind(this),ownerDocument:i.ownerDocument,styleElement:i.styleElement}),this._params=i,i.useWorkerFetch||(this.CMapReaderFactory=new i.CMapReaderFactory({baseUrl:i.cMapUrl,isCompressed:i.cMapPacked}),this.StandardFontDataFactory=new i.StandardFontDataFactory({baseUrl:i.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)}
1getRenderingIntent(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_util.AnnotationMode.ENABLE,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=_util.RenderingIntentFlag.DISPLAY,s=null;switch(t){case"any":n=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":n=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)(`getRenderingIntent - invalid intent: ${t}`)}switch(e){case _util.AnnotationMode.DISABLE:n+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:n+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:s=((n+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE)&_util.RenderingIntentFlag.PRINT&&r instanceof _annotation_storage.PrintAnnotationStorage?r:this.annotationStorage).serializable;break;default:(0,_util.warn)(`getRenderingIntent - invalid annotationMode: ${e}`)}return i&&(n+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:n,cacheKey:`${n}_${_annotation_storage.AnnotationStorage.getHash(s)}`,annotationStorageMap:s}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=(0,_util.createPromiseCapability)(),this._passwordCapability&&this._passwordCapability.reject(Error("Worker was destroyed during onPassword callback"));let t=[];for(let e of _classPrivateFieldGet(this,_pageCache).values())t.push(e._destroy());_classPrivateFieldGet(this,_pageCache).clear(),_classPrivateFieldGet(this,_pagePromises).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();let e=this.messageHandler.sendWithPromise("Terminate",null);return 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),this.destroyCapability.promise}setupMessageHandler(){let{messageHandler:t,loadingTask:e}=this;t.on("GetReader",(t,e)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=t=>{this._lastProgress={loaded:t.loaded,total:t.total}},e.onPull=()=>{this._fullReader.read().then(function(t){let{value:r,done:i}=t;if(i){e.close();return}(0,_util.assert)((0,_util.isArrayBuffer)(r),"GetReader - expected an ArrayBuffer."),e.enqueue(new Uint8Array(r),1,[r])}).catch(t=>{e.error(t)})},e.onCancel=t=>{this._fullReader.cancel(t),e.ready.catch(t=>{if(!this.destroyed)throw t})}}),t.on("ReaderHeadersReady",t=>{let r=(0,_util.createPromiseCapability)(),i=this._fullReader;return i.headersReady.then(()=>{if(!i.isStreamingSupported||!i.isRangeSupported){if(this._lastProgress){var t;null===(t=e.onProgress)||void 0===t||t.call(e,this._lastProgress)}i.onProgress=t=>{var r;null===(r=e.onProgress)||void 0===r||r.call(e,{loaded:t.loaded,total:t.total})}}r.resolve({isStreamingSupported:i.isStreamingSupported,isRangeSupported:i.isRangeSupported,contentLength:i.contentLength})},r.reject),r.promise}),t.on("GetRangeReader",(t,e)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");let r=this._networkStream.getRangeReader(t.begin,t.end);if(!r){e.close();return}e.onPull=()=>{r.read().then(function(t){let{value:r,done:i}=t;if(i){e.close();return}(0,_util.assert)((0,_util.isArrayBuffer)(r),"GetRangeReader - expected an ArrayBuffer."),e.enqueue(new Uint8Array(r),1,[r])}).catch(t=>{e.error(t)})},e.onCancel=t=>{r.cancel(t),e.ready.catch(t=>{if(!this.destroyed)throw t})}}),t.on("GetDoc",t=>{let{pdfInfo:r}=t;this._numPages=r.numPages,this._htmlForXfa=r.htmlForXfa,delete r.htmlForXfa,e._capability.resolve(new PDFDocumentProxy(r,this))}),t.on("DocException",function(t){let r;switch(t.name){case"PasswordException":r=new _util.PasswordException(t.message,t.code);break;case"InvalidPDFException":r=new _util.InvalidPDFException(t.message);break;case"MissingPDFException":r=new _util.MissingPDFException(t.message);break;case"UnexpectedResponseException":r=new _util.UnexpectedResponseException(t.message,t.status);break;case"UnknownErrorException":r=new _util.UnknownErrorException(t.message,t.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}e._capability.reject(r)}
1),t.on("PasswordRequest",t=>{if(this._passwordCapability=(0,_util.createPromiseCapability)(),e.onPassword){let r=t=>{t instanceof Error?this._passwordCapability.reject(t):this._passwordCapability.resolve({password:t})};try{e.onPassword(r,t.code)}catch(t){this._passwordCapability.reject(t)}}else this._passwordCapability.reject(new _util.PasswordException(t.message,t.code));return this._passwordCapability.promise}),t.on("DataLoaded",t=>{var r;null===(r=e.onProgress)||void 0===r||r.call(e,{loaded:t.length,total:t.length}),this.downloadInfoCapability.resolve(t)}),t.on("StartRenderPage",t=>{this.destroyed||_classPrivateFieldGet(this,_pageCache).get(t.pageIndex)._startRenderPage(t.transparency,t.cacheKey)}),t.on("commonobj",e=>{var r;let[i,n,s]=e;if(!(this.destroyed||this.commonObjs.has(i)))switch(n){case"Font":let a=this._params;if("error"in s){let t=s.error;(0,_util.warn)(`Error during font loading: ${t}`),this.commonObjs.resolve(i,t);break}let o=null;a.pdfBug&&null!==(r=globalThis.FontInspector)&&void 0!==r&&r.enabled&&(o={registerFont(t,e){globalThis.FontInspector.fontAdded(t,e)}});let l=new _font_loader.FontFaceObject(s,{isEvalSupported:a.isEvalSupported,disableFontFace:a.disableFontFace,ignoreErrors:a.ignoreErrors,onUnsupportedFeature:this._onUnsupportedFeature.bind(this),fontRegistry:o});this.fontLoader.bind(l).catch(e=>t.sendWithPromise("FontFallback",{id:i})).finally(()=>{!a.fontExtraProperties&&l.data&&(l.data=null),this.commonObjs.resolve(i,l)});break;case"FontPath":case"Image":this.commonObjs.resolve(i,s);break;default:throw Error(`Got unknown common object type ${n}`)}}),t.on("obj",t=>{let[e,r,i,n]=t;if(this.destroyed)return;let s=_classPrivateFieldGet(this,_pageCache).get(r);if(!s.objs.has(e))switch(i){case"Image":s.objs.resolve(e,n);let a=8e6;if(n){let t;if(n.bitmap){let{bitmap:e,width:r,height:i}=n;t=r*i*4,s._bitmaps.add(e)}else{var o;t=(null===(o=n.data)||void 0===o?void 0:o.length)||0}t>a&&(s.cleanupAfterRender=!0)}break;case"Pattern":s.objs.resolve(e,n);break;default:throw Error(`Got unknown object type ${i}`)}}),t.on("DocProgress",t=>{var r;this.destroyed||null===(r=e.onProgress)||void 0===r||r.call(e,{loaded:t.loaded,total:t.total})}),t.on("DocStats",t=>{this.destroyed||_classPrivateFieldSet(this,_docStats,Object.freeze({streamTypes:Object.freeze(t.streamTypes),fontTypes:Object.freeze(t.fontTypes)}))}),t.on("UnsupportedFeature",this._onUnsupportedFeature.bind(this)),t.on("FetchBuiltInCMap",t=>this.destroyed?Promise.reject(Error("Worker was destroyed.")):this.CMapReaderFactory?this.CMapReaderFactory.fetch(t):Promise.reject(Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),t.on("FetchStandardFontData",t=>this.destroyed?Promise.reject(Error("Worker was destroyed.")):this.StandardFontDataFactory?this.StandardFontDataFactory.fetch(t):Promise.reject(Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}_onUnsupportedFeature(t){var e,r;let{featureId:i}=t;this.destroyed||null===(e=(r=this.loadingTask).onUnsupportedFeature)||void 0===e||e.call(r,i)}getData(){return this.messageHandler.sendWithPromise("GetData",null)}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(Error("Invalid page request."));let e=t-1,r=_classPrivateFieldGet(this,_pagePromises).get(e);if(r)return r;let i=this.messageHandler.sendWithPromise("GetPage",{pageIndex:e}).then(t=>{if(this.destroyed)throw Error("Transport destroyed");let r=new PDFPageProxy(e,t,this,this._params.ownerDocument,this._params.pdfBug);return _classPrivateFieldGet(this,_pageCache).set(e,r),r});return _classPrivateFieldGet(this,_pagePromises).set(e,i),i}getPageIndex(t){return"object"!=typeof t||null===t||!Number.isInteger(t.num)||t.num<0||!Number.isInteger(t.gen)||t.gen<0?Promise.reject(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})}saveDocument(){var t,e;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:this.annotationStorage.serializable,filename:null!==(t=null===(e=this._fullReader)||void 0===e?void 0:e.filename)&&void 0!==t?t:null}).finally(()=>{this.annotationStorage.resetModified()})}getFieldObjects(){return this._getFieldObjectsPromise||(this._getFieldObjectsPromise=this.messageHandler.sendWithProm
1ise("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(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=>{var e,r,i,n;return{info:t[0],metadata:t[1]?new _metadata.Metadata(t[1]):null,contentDispositionFilename:null!==(e=null===(r=this._fullReader)||void 0===r?void 0:r.filename)&&void 0!==e?e:null,contentLength:null!==(i=null===(n=this._fullReader)||void 0===n?void 0:n.contentLength)&&void 0!==i?i:null}}))}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(await this.messageHandler.sendWithPromise("Cleanup",null),!this.destroyed){for(let t of _classPrivateFieldGet(this,_pageCache).values())if(!t.cleanup())throw Error(`startCleanup: Page ${t.pageNumber} is currently rendering.`);this.commonObjs.clear(),t||this.fontLoader.clear(),_classPrivateFieldSet(this,_metadataPromise,null),this._getFieldObjectsPromise=null,this._hasJSActionsPromise=null}}get loadingParams(){let 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=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e){let r=_classPrivateMethodGet(this,_ensureObj,_ensureObj2).call(this,t);return r.capability.promise.then(()=>e(r.data)),null}let r=_classPrivateFieldGet(this,_objs)[t];if(!(null!=r&&r.capability.settled))throw Error(`Requesting object that isn't resolved yet ${t}.`);return r.data}has(t){let e=_classPrivateFieldGet(this,_objs)[t];return(null==e?void 0:e.capability.settled)||!1}resolve(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=_classPrivateMethodGet(this,_ensureObj,_ensureObj2).call(this,t);r.data=e,r.capability.resolve()}clear(){_classPrivateFieldSet(this,_objs,Object.create(null))}}function _ensureObj2(t){return _classPrivateFieldGet(this,_objs)[t]||(_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(){let{separateAnnots:t}=_classPrivateFieldGet(this,_internalRenderTask).operatorList;if(!t)return!1;let{annotationCanvasMap:e}=_classPrivateFieldGet(this,_internalRenderTask);return t.form||t.canvas&&(null==e?void 0:e.size)>0}}exports.RenderTask=RenderTask;class InternalRenderTask{constructor(t){let{callback:e,params:r,objs:i,commonObjs:n,annotationCanvasMap:s,operatorList:a,pageIndex:o,canvasFactory:l,useRequestAnimationFrame:h=!1,pdfBug:c=!1,pageColors:d=null}=t;this.callback=e,this.params=r,this.objs=i,this.commonObjs=n,this.annotationCanvasMap=s,this.operatorListIdx=null,this.operatorList=a,this._pageIndex=o,this.canvasFactory=l,this._pdfBug=c,this.pageColors=d,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===h&&"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=r.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics(t){var e;let{transparency:r=!1,optionalContentConfig:i}=t;if(this.cancelled)return;
1if(this._canvas){if(_classStaticPrivateFieldSpecGet(InternalRenderTask,InternalRenderTask,_canvasInUse).has(this._canvas))throw 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!==(e=globalThis.StepperManager)&&void 0!==e&&e.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());let{canvasContext:n,viewport:s,transform:a,imageLayer:o,background:l}=this.params;this.gfx=new _canvas.CanvasGraphics(n,this.commonObjs,this.objs,this.canvasFactory,o,i,this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:a,viewport:s,transparency:r,background:l}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback&&this.graphicsReadyCallback()}cancel(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.running=!1,this.cancelled=!0,this.gfx&&this.gfx.endDrawing(),this._canvas&&_classStaticPrivateFieldSpecGet(InternalRenderTask,InternalRenderTask,_canvasInUse).delete(this._canvas),this.callback(t||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,"canvas"))}operatorListChanged(){if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}this.stepper&&this.stepper.updateOperatorList(this.operatorList),this.running||this._continue()}_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};let version="2.16.105";exports.version=version;let build="172ccdbe5";exports.build=build},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PrintAnnotationStorage=e.AnnotationStorage=void 0;var i=r(1),n=r(131),s=r(135);function a(t,e,r){p(t,e),e.set(t,r)}function o(t,e){var r=c(t,e,"get");return l(t,r)}function l(t,e){return e.get?e.get.call(t):e.value}function h(t,e,r){var i=c(t,e,"set");return d(t,i,r),r}function c(t,e,r){if(!e.has(t))throw TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function d(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw TypeError("attempted to set read only private field");e.value=r}}function u(t,e){p(t,e),e.add(t)}function p(t,e){if(e.has(t))throw TypeError("Cannot initialize the same private elements twice on an object")}function f(t,e,r){if(!e.has(t))throw TypeError("attempted to get private field on non-instance");return r}var g=new WeakSet;class m{constructor(){u(this,g),this._storage=new Map,this._modified=!1,this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,e){let r=this._storage.get(t);return void 0===r?e:Object.assign(e,r)}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(let t of this._storage.values())if(t instanceof n.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(t,e){let r=this._storage.get(t),i=!1;if(void 0!==r)for(let[t,n]of Object.entries(e))r[t]!==n&&(i=!0,r[t]=n);else i=!0,this._storage.set(t,e);i&&f(this,g,v).call(this),e instanceof n.AnnotationEditor&&"function"==typeof this.onAnnotationEditor&&this.onAnnotationEditor(e.constructor._type)}has(t){return this._storage.has(t)}getAll(){return this._storage.size>0?(0,i.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 y(this)}get serializable(){if(0===this._storage.size)return null;let t=new Map;for(let[e,r]of this._storage){let i=r instanceof n.AnnotationEditor?r.serialize():r;i&&t.set(e,i)}return t}static getHash(t){if(!t)return"";let e=new s.MurmurHash3_64;
1for(let[r,i]of t)e.update(`${r}:${JSON.stringify(i)}`);return e.hexdigest()}}function v(){this._modified||(this._modified=!0,"function"==typeof this.onSetModified&&this.onSetModified())}e.AnnotationStorage=m;var b=new WeakMap;class y extends m{constructor(t){super(),a(this,b,{writable:!0,value:null}),h(this,b,structuredClone(t.serializable))}get print(){(0,i.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return o(this,b)}}e.PrintAnnotationStorage=y},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AnnotationEditor=void 0;var i=r(132),n=r(1);function s(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function a(t,e,r){o(t,e),e.set(t,r)}function o(t,e){if(e.has(t))throw TypeError("Cannot initialize the same private elements twice on an object")}function l(t,e,r){var i=d(t,e,"set");return h(t,i,r),r}function h(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw TypeError("attempted to set read only private field");e.value=r}}function c(t,e){var r=d(t,e,"get");return u(t,r)}function d(t,e,r){if(!e.has(t))throw TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function u(t,e){return e.get?e.get.call(t):e.value}var p=new WeakMap,f=new WeakMap,g=new WeakMap,m=new WeakMap,v=new WeakMap,b=new WeakMap;class y{constructor(t){a(this,p,{writable:!0,value:this.focusin.bind(this)}),a(this,f,{writable:!0,value:this.focusout.bind(this)}),a(this,g,{writable:!0,value:!1}),a(this,m,{writable:!0,value:!1}),a(this,v,{writable:!0,value:!1}),a(this,b,{writable:!0,value:y._zIndex++}),this.constructor===y&&(0,n.unreachable)("Cannot initialize AnnotationEditor."),this.parent=t.parent,this.id=t.id,this.width=this.height=null,this.pageIndex=t.parent.pageIndex,this.name=t.name,this.div=null;let[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,n.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=c(this,b)}focusin(t){c(this,g)?l(this,g,!1):this.parent.setSelected(this)}focusout(t){if(!this.isAttachedToDOM)return;let e=t.relatedTarget;!(null!=e&&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){let 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,i){let[n,s]=this.parent.viewportBaseDimensions;[r,i]=this.screenToPageTranslation(r,i),this.x=(t+r)/n,this.y=(e+i)/s,this.div.style.left=`${100*this.x}%`,this.div.style.top=`${100*this.y}%`}translate(t,e){let[r,i]=this.parent.viewportBaseDimensions;[t,e]=this.screenToPageTranslation(t,e),this.x+=t/r,this.y+=e/i,this.div.style.left=`${100*this.x}%`,this.div.style.top=`${100*this.y}%`}screenToPageTranslation(t,e){let{rotation:r}=this.parent.viewport;switch(r){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}}setDims(t,e){let[r,i]=this.parent.viewportBaseDimensions;this.div.style.width=`${100*t/r}%`,this.div.style.height=`${100*e/i}%`}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",c(this,p)),this.div.addEventListener("focusout",c(this,f));let[t,e]=this.getInitialTranslation();return this.translate(t,e),(0,i.bindEvents)(this,this.div,["dragstart","pointerdown"]),this.div}pointerdown(t){let e=i.KeyboardManager.platform.isMac;if(0!==t.button||t.ctrlKey&&e){t.preventDefault();return}t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this),l(this,g,!0)}getRect(t,e){let[r,i]=this.parent.viewportBaseDimensions,[n,s]=this.parent.pageDimensions,a=n*t/r,o=s*e/i,l=this.x*n,h=this.y*s,c=this.width*n,d=this.height*s;switch(this.rotation){case 0:return[l+a,s-h-o-d,l+a+c,s-h-o];case 90:return[l+o,s-h+a,l+o+d,s-h+a+c];case 180:return[l-a-c,s-h+o,l-a,s-h+o+d];case 270:return[l-o-d,s-h-a-c,l-o,s-h-a];default:throw Error("Invalid rotation")}}getRectInCurrentCoords(t,e){let[r,i,n,s]=t,a=n-r,o=s-i;switch(this.rotation){case 0:return[r,e-s,a,o];case 90:return[r,e-i,o,a];case 180:return[n,e-i,a,o];case 270:return[n,e-s,o,a];default:throw Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){l(this,v,!0)}disableEditMode(){l(this,v,!1)}isInEditMode(){return c(this,v)}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var t;null===(t=this.div)||void 0===t||t.addEventListener("focusin",c(this,p))}serialize(){(0,n.unreachable)("An editor must be serializable")}static deserialize(t,e){let r=new this.prototype.constructor({parent:e,id:e.getNextId()});r.rotation=t.rotation;let[i,n]=e.pageDimensions,[s,a,o,l]=r.getRectInCurrentCoords(t.rect,n);return r.x=s/i,r.y=a/n,r.width=o/i,r.height=l/n,r}remove(){this.div.removeEventListener("focusin",c(this,p)),this.div.removeEventListener("focusout",c(this,f)),this.isEmpty()||this.commit(),this.parent.remove(this)}select(){var t;null===(t=this.div)||void 0===t||t.classList.add("selectedEditor")}unselect(){var t;null===(t=this.div)||void 0===t||t.classList.remove("selectedEditor")}updateParams(t,e){}disableEditing(){}enableEditing(){}get propertiesToUpdate(){return{}}get contentDiv(){return this.div}get isEditing(){return c(this,m)}set isEditing(t){l(this,m,t),t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null)}}e.AnnotationEditor=y,s(y,"_colorManager",new i.ColorManager),s(y,"_zIndex",1)},(t,e,r)=>{"use strict";
1Object.defineProperty(e,"__esModule",{value:!0}),e.KeyboardManager=e.CommandManager=e.ColorManager=e.AnnotationEditorUIManager=void 0,e.bindEvents=g,e.opacityToHex=m;var i=r(1),n=r(133);function s(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function a(t,e){h(t,e),e.add(t)}function o(t,e,r){if(!e.has(t))throw TypeError("attempted to get private field on non-instance");return r}function l(t,e,r){h(t,e),e.set(t,r)}function h(t,e){if(e.has(t))throw TypeError("Cannot initialize the same private elements twice on an object")}function c(t,e,r){var i=p(t,e,"set");return d(t,i,r),r}function d(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw TypeError("attempted to set read only private field");e.value=r}}function u(t,e){var r=p(t,e,"get");return f(t,r)}function p(t,e,r){if(!e.has(t))throw TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function f(t,e){return e.get?e.get.call(t):e.value}function g(t,e,r){for(let i of r)e.addEventListener(i,t[i].bind(t))}function m(t){return Math.round(Math.min(255,Math.max(1,255*t))).toString(16).padStart(2,"0")}var v=new WeakMap;class b{constructor(){l(this,v,{writable:!0,value:0})}getId(){var t,e;return`${i.AnnotationEditorPrefix}${c(this,v,(t=u(this,v),e=t++,t)),e}`}}var y=new WeakMap,A=new WeakMap,_=new WeakMap,S=new WeakMap;class x{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:128;l(this,y,{writable:!0,value:[]}),l(this,A,{writable:!0,value:!1}),l(this,_,{writable:!0,value:void 0}),l(this,S,{writable:!0,value:-1}),c(this,_,t)}add(t){let{cmd:e,undo:r,mustExec:i,type:n=NaN,overwriteIfSameType:s=!1,keepUndo:a=!1}=t;if(i&&e(),u(this,A))return;let o={cmd:e,undo:r,type:n};if(-1===u(this,S)){u(this,y).length>0&&(u(this,y).length=0),c(this,S,0),u(this,y).push(o);return}if(s&&u(this,y)[u(this,S)].type===n){a&&(o.undo=u(this,y)[u(this,S)].undo),u(this,y)[u(this,S)]=o;return}let l=u(this,S)+1;l===u(this,_)?u(this,y).splice(0,1):(c(this,S,l),l<u(this,y).length&&u(this,y).splice(l)),u(this,y).push(o)}undo(){-1!==u(this,S)&&(c(this,A,!0),u(this,y)[u(this,S)].undo(),c(this,A,!1),c(this,S,u(this,S)-1))}redo(){u(this,S)<u(this,y).length-1&&(c(this,S,u(this,S)+1),c(this,A,!0),u(this,y)[u(this,S)].cmd(),c(this,A,!1))}hasSomethingToUndo(){return -1!==u(this,S)}hasSomethingToRedo(){return u(this,S)<u(this,y).length-1}destroy(){c(this,y,null)}}e.CommandManager=x;var w=new WeakSet;class E{constructor(t){a(this,w),this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;let e=E.platform.isMac;for(let[r,i]of t)for(let t of r){let r=t.startsWith("mac+");e&&r?(this.callbacks.set(t.slice(4),i),this.allKeys.add(t.split("+").at(-1))):e||r||(this.callbacks.set(t,i),this.allKeys.add(t.split("+").at(-1)))}}static get platform(){let t="undefined"!=typeof navigator?navigator.platform:"";return(0,i.shadow)(this,"platform",{isWin:t.includes("Win"),isMac:t.includes("Mac")})}exec(t,e){if(!this.allKeys.has(e.key))return;let r=this.callbacks.get(o(this,w,C).call(this,e));r&&(r.bind(t)(),e.stopPropagation(),e.preventDefault())}}function C(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);let e=this.buffer.join("+");return this.buffer.length=0,e}e.KeyboardManager=E;var T=new WeakMap;class k{constructor(){l(this,T,{writable:!0,value:null})}copy(t){t&&(Array.isArray(t)?c(this,T,t.map(t=>t.serialize())):c(this,T,[t.serialize()]),c(this,T,u(this,T).filter(t=>!!t)),0===u(this,T).length&&c(this,T,null))}paste(){return u(this,T)}isEmpty(){return null===u(this,T)}destroy(){c(this,T,null)}}class P{get _colors(){let t=new Map([["CanvasText",null],["Canvas",null]]);return(0,n.getColorValues)(t),(0,i.shadow)(this,"_colors",t)}convert(t){let e=(0,n.getRGB)(t);if(!window.matchMedia("(forced-colors: active)").matches)return e;for(let[t,r]of this._colors)if(r.every((t,r)=>t===e[r]))return P._colorsMapping.get(t);return e}getHexCode(t){let e=this._colors.get(t);return e?i.Util.makeHexColor(...e):t}}e.ColorManager=P,s(P,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));var M=new WeakMap,R=new WeakMap,F=new WeakMap,O=new WeakMap,I=new WeakMap,D=new WeakMap,L=new WeakMap,N=new WeakMap,j=new WeakMap,U=new WeakMap,B=new WeakMap,W=new WeakMap,q=new WeakMap,G=new WeakMap,z=new WeakMap,H=new WeakMap,V=new WeakMap,$=new WeakSet,X=new WeakSet,Y=new WeakSet,K=new WeakSet,J=new WeakSet,Q=new WeakSet,Z=new WeakSet,tt=new WeakSet,te=new WeakSet;class tr{constructor(t,e){a(this,te),a(this,tt),a(this,Z),a(this,Q),a(this,J),a(this,K),a(this,Y),a(this,X),a(this,$),l(this,M,{writable:!0,value:null}),l(this,R,{writable:!0,value:new Map}),l(this,F,{writable:!0,value:new Map}),l(this,O,{writable:!0,value:new k}),l(this,I,{writable:!0,value:new x}),l(this,D,{writable:!0,value:0}),l(this,L,{writable:!0,value:null}),l(this,N,{writable:!0,value:null}),l(this,j,{writable:!0,value:new b}),l(this,U,{writable:!0,value:!1}),l(this,B,{writable:!0,value:i.AnnotationEditorType.NONE}),l(this,W,{writable:!0,value:new Set}),l(this,q,{writable:!0,value:this.keydown.bind(this)}),l(this,G,{writable:!0,value:this.onEditingAction.bind(this)}),l(this,z,{writable:!0,value:this.onPageChanging.bind(this)}),l(this,H,{writable:!0,value:{isEditing:!1,isEmpty:!0,hasEmptyClipboard:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1}}),l(this,V,{writable:!0,value:null}),c(this,V,t),c(this,N,e),u(this,N)._on("editingaction",u(this,G)),u(this,N)._on("pagechanging",u(this,z))}destroy(){for(let t of(o(this,X,tn).call(this),u(this,N)._off("editingaction",u(this,G)),u(this,N)._off("pagechanging",u(this,z)),u(this,F).values())
1)t.destroy();u(this,F).clear(),u(this,R).clear(),c(this,M,null),u(this,W).clear(),u(this,O).destroy(),u(this,I).destroy()}onPageChanging(t){let{pageNumber:e}=t;c(this,D,e-1)}focusMainContainer(){u(this,V).focus()}keydown(t){var e;null!==(e=this.getActive())&&void 0!==e&&e.shouldGetKeyboardEvents()||tr._keyboardManager.exec(this,t)}onEditingAction(t){["undo","redo","cut","copy","paste","delete","selectAll"].includes(t.name)&&this[t.name]()}setEditingState(t){t?(o(this,$,ti).call(this),o(this,Y,ts).call(this,{isEditing:u(this,B)!==i.AnnotationEditorType.NONE,isEmpty:o(this,tt,tc).call(this),hasSomethingToUndo:u(this,I).hasSomethingToUndo(),hasSomethingToRedo:u(this,I).hasSomethingToRedo(),hasSelectedEditor:!1,hasEmptyClipboard:u(this,O).isEmpty()})):(o(this,X,tn).call(this),o(this,Y,ts).call(this,{isEditing:!1}))}registerEditorTypes(t){for(let e of(c(this,L,t),u(this,L)))o(this,K,ta).call(this,e.defaultPropertiesToUpdate)}getId(){return u(this,j).getId()}addLayer(t){u(this,F).set(t.pageIndex,t),u(this,U)?t.enable():t.disable()}removeLayer(t){u(this,F).delete(t.pageIndex)}updateMode(t){if(c(this,B,t),t===i.AnnotationEditorType.NONE)this.setEditingState(!1),o(this,Q,tl).call(this);else for(let e of(this.setEditingState(!0),o(this,J,to).call(this),u(this,F).values()))e.updateMode(t)}updateToolbar(t){t!==u(this,B)&&u(this,N).dispatch("switchannotationeditormode",{source:this,mode:t})}updateParams(t,e){for(let r of u(this,W))r.updateParams(t,e);for(let r of u(this,L))r.updateDefaultParams(t,e)}getEditors(t){let e=[];for(let r of u(this,R).values())r.pageIndex===t&&e.push(r);return e}getEditor(t){return u(this,R).get(t)}addEditor(t){u(this,R).set(t.id,t)}removeEditor(t){u(this,R).delete(t.id),this.unselect(t)}setActiveEditor(t){u(this,M)!==t&&(c(this,M,t),t&&o(this,K,ta).call(this,t.propertiesToUpdate))}toggleSelected(t){if(u(this,W).has(t)){u(this,W).delete(t),t.unselect(),o(this,Y,ts).call(this,{hasSelectedEditor:this.hasSelection});return}u(this,W).add(t),t.select(),o(this,K,ta).call(this,t.propertiesToUpdate),o(this,Y,ts).call(this,{hasSelectedEditor:!0})}setSelected(t){for(let e of u(this,W))e!==t&&e.unselect();u(this,W).clear(),u(this,W).add(t),t.select(),o(this,K,ta).call(this,t.propertiesToUpdate),o(this,Y,ts).call(this,{hasSelectedEditor:!0})}isSelected(t){return u(this,W).has(t)}unselect(t){t.unselect(),u(this,W).delete(t),o(this,Y,ts).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==u(this,W).size}undo(){u(this,I).undo(),o(this,Y,ts).call(this,{hasSomethingToUndo:u(this,I).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:o(this,tt,tc).call(this)})}redo(){u(this,I).redo(),o(this,Y,ts).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:u(this,I).hasSomethingToRedo(),isEmpty:o(this,tt,tc).call(this)})}addCommands(t){u(this,I).add(t),o(this,Y,ts).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:o(this,tt,tc).call(this)})}delete(){if(u(this,M)&&u(this,M).commitOrRemove(),!this.hasSelection)return;let t=[...u(this,W)],e=()=>{for(let e of t)e.remove()},r=()=>{for(let e of t)o(this,Z,th).call(this,e)};this.addCommands({cmd:e,undo:r,mustExec:!0})}copy(){if(u(this,M)&&u(this,M).commitOrRemove(),this.hasSelection){let t=[];for(let e of u(this,W))e.isEmpty()||t.push(e);0!==t.length&&(u(this,O).copy(t),o(this,Y,ts).call(this,{hasEmptyClipboard:!1}))}}cut(){this.copy(),this.delete()}paste(){if(u(this,O).isEmpty())return;this.unselectAll();let t=u(this,F).get(u(this,D)),e=u(this,O).paste().map(e=>t.deserialize(e)),r=()=>{for(let t of e)o(this,Z,th).call(this,t);o(this,te,td).call(this,e)},i=()=>{for(let t of e)t.remove()};this.addCommands({cmd:r,undo:i,mustExec:!0})}selectAll(){for(let t of u(this,W))t.commit();o(this,te,td).call(this,u(this,R).values())}unselectAll(){if(u(this,M)){u(this,M).commitOrRemove();return}if(0!==o(this,te,td).size){for(let t of u(this,W))t.unselect();u(this,W).clear(),o(this,Y,ts).call(this,{hasSelectedEditor:!1})}}isActive(t){return u(this,M)===t}getActive(){return u(this,M)}getMode(){return u(this,B)}}function ti(){u(this,V).addEventListener("keydown",u(this,q))}function tn(){u(this,V).removeEventListener("keydown",u(this,q))}function ts(t){Object.entries(t).some(t=>{let[e,r]=t;return u(this,H)[e]!==r})&&u(this,N).dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(u(this,H),t)})}function ta(t){u(this,N).dispatch("annotationeditorparamschanged",{source:this,details:t})}function to(){if(!u(this,U))for(let t of(c(this,U,!0),u(this,F).values())
1)t.enable()}function tl(){if(this.unselectAll(),u(this,U))for(let t of(c(this,U,!1),u(this,F).values()))t.disable()}function th(t){let e=u(this,F).get(t.pageIndex);e?e.addOrRebuild(t):this.addEditor(t)}function tc(){if(0===u(this,R).size)return!0;if(1===u(this,R).size)for(let t of u(this,R).values())return t.isEmpty();return!1}function td(t){for(let e of(u(this,W).clear(),t))e.isEmpty()||(u(this,W).add(e),e.select());o(this,Y,ts).call(this,{hasSelectedEditor:!0})}e.AnnotationEditorUIManager=tr,s(tr,"_keyboardManager",new E([[["ctrl+a","mac+meta+a"],tr.prototype.selectAll],[["ctrl+c","mac+meta+c"],tr.prototype.copy],[["ctrl+v","mac+meta+v"],tr.prototype.paste],[["ctrl+x","mac+meta+x"],tr.prototype.cut],[["ctrl+z","mac+meta+z"],tr.prototype.undo],[["ctrl+y","ctrl+shift+Z","mac+meta+shift+Z"],tr.prototype.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete"],tr.prototype.delete],[["Escape","mac+Escape"],tr.prototype.unselectAll]]))},(t,e,r)=>{"use strict";let i;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=w,e.getColorValues=k,e.getCurrentTransform=P,e.getCurrentTransformInverse=M,e.getFilenameFromUrl=y,e.getPdfFilenameFromUrl=A,e.getRGB=T,e.getXfaPageViewport=C,e.isDataScheme=v,e.isPdfFile=b,e.isValidFetchUrl=S,e.loadScript=x;var n=r(134),s=r(1);function a(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}let o="http://www.w3.org/2000/svg",l="pdfjs_internal_id_";e.AnnotationPrefix=l;class h{}e.PixelsPerInch=h,a(h,"CSS",96),a(h,"PDF",72),a(h,"PDF_TO_CSS_UNITS",h.CSS/h.PDF);class c extends n.BaseCanvasFactory{constructor(){let{ownerDocument:t=globalThis.document}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),this._document=t}_createCanvas(t,e){let r=this._document.createElement("canvas");return r.width=t,r.height=e,r}}async function d(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(S(t,document.baseURI)){let r=await fetch(t);if(!r.ok)throw Error(r.statusText);return e?new Uint8Array(await r.arrayBuffer()):(0,s.stringToBytes)(await r.text())}return new Promise((r,i)=>{let n=new XMLHttpRequest;n.open("GET",t,!0),e&&(n.responseType="arraybuffer"),n.onreadystatechange=()=>{if(n.readyState===XMLHttpRequest.DONE){if(200===n.status||0===n.status){let t;if(e&&n.response?t=new Uint8Array(n.response):!e&&n.responseText&&(t=(0,s.stringToBytes)(n.responseText)),t){r(t);return}}i(Error(n.statusText))}},n.send(null)})}e.DOMCanvasFactory=c;class u extends n.BaseCMapReaderFactory{_fetchData(t,e){return d(t,this.isCompressed).then(t=>({cMapData:t,compressionType:e}))}}e.DOMCMapReaderFactory=u;class p extends n.BaseStandardFontDataFactory{_fetchData(t){return d(t,!0)}}e.DOMStandardFontDataFactory=p;class f extends n.BaseSVGFactory{_createSVG(t){return document.createElementNS(o,t)}}e.DOMSVGFactory=f;class g{constructor(t){let e,r,i,n,s,a,o,l,{viewBox:h,scale:c,rotation:d,offsetX:u=0,offsetY:p=0,dontFlip:f=!1}=t;this.viewBox=h,this.scale=c,this.rotation=d,this.offsetX=u,this.offsetY=p;let g=(h[2]+h[0])/2,m=(h[3]+h[1])/2;switch((d%=360)<0&&(d+=360),d){case 180:e=-1,r=0,i=0,n=1;break;case 90:e=0,r=1,i=1,n=0;break;case 270:e=0,r=-1,i=-1,n=0;break;case 0:e=1,r=0,i=0,n=-1;break;default:throw Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}f&&(i=-i,n=-n),0===e?(s=Math.abs(m-h[1])*c+u,a=Math.abs(g-h[0])*c+p,o=Math.abs(h[3]-h[1])*c,l=Math.abs(h[2]-h[0])*c):(s=Math.abs(g-h[0])*c+u,a=Math.abs(m-h[1])*c+p,o=Math.abs(h[2]-h[0])*c,l=Math.abs(h[3]-h[1])*c),this.transform=[e*c,r*c,i*c,n*c,s-e*c*g-i*c*m,a-r*c*g-n*c*m],this.width=o,this.height=l}clone(){let{scale:t=this.scale,rotation:e=this.rotation,offsetX:r=this.offsetX,offsetY:i=this.offsetY,dontFlip:n=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new g({viewBox:this.viewBox.slice(),scale:t,rotation:e,offsetX:r,offsetY:i,dontFlip:n})}convertToViewportPoint(t,e){return s.Util.applyTransform([t,e],this.transform)}convertToViewportRectangle(t){let e=s.Util.applyTransform([t[0],t[1]],this.transform),r=s.Util.applyTransform([t[2],t[3]],this.transform);return[e[0],e[1],r[0],r[1]]}convertToPdfPoint(t,e){return s.Util.applyInverseTransform([t,e],this.transform)}}e.PageViewport=g;class m extends s.BaseException{constructor(t,e){super(t,"RenderingCancelledException"),this.type=e}}function v(t){let e=t.length,r=0;for(;r<e&&""===t[r].trim();)r++;return"data:"===t.substring(r,r+5).toLowerCase()}function b(t){return"string"==typeof t&&/\.pdf$/i.test(t)}function y(t){let e=t.indexOf("#"),r=t.indexOf("?"),i=Math.min(e>0?e:t.length,r>0?r:t.length);return t.substring(t.lastIndexOf("/",i)+1,i)}function A(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"document.pdf";if("string"!=typeof t)return e;if(v(t))return(0,s.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;let r=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,i=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(t),n=r.exec(i[1])||r.exec(i[2])||r.exec(i[3]);if(n&&(n=n[0]).includes("%"))try{n=r.exec(decodeURIComponent(n))[0]}catch(t){}return n||e}e.RenderingCancelledException=m;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(){let t=[],e=0;for(let t of this.times){let r=t.name;r.length>e&&(e=r.length)}for(let r of this.times){let i=r.end-r.start;t.push(`${r.name.padEnd(e)} ${i}ms 2`)}return t.join("")}}function S(t,e){try{let{protocol:r}=e?new URL(t,e):new URL(t);return"http:"===r||"https:"===r}catch(t){return!1}}function x(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return new Promise((r,i)=>{let n=document.createElement("script");n.src=t,n.onload=function(t){e&&n.remove(),r(t)},n.onerror=function(){i(Error(`Cannot load script at: ${n.src}`))},(document.head||document.documentElement).append(n)})}function w(t){console.log("Deprecated API usage: "+t)}e.StatTimer=_;class E{static toDateObject(t){if(!t||"string"!=typeof t)return null;i||(i=RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));let e=i.exec(t);if(!e)return null;let r=parseInt(e[1],10),n=parseInt(e[2],10);n=n>=1&&n<=12?n-1:0;let s=parseInt(e[3],10);s=s>=1&&s<=31?s:1;let a=parseInt(e[4],10);a=a>=0&&a<=23?a:0;let o=parseInt(e[5],10);o=o>=0&&o<=59?o:0;let l=parseInt(e[6],10);l=l>=0&&l<=59?l:0;let h=e[7]||"Z",c=parseInt(e[8],10);c=c>=0&&c<=23?c:0;let d=parseInt(e[9],10)||0;return d=d>=0&&d<=59?d:0,"-"===h?(a+=c,o+=d):"+"===h&&(a-=c,o-=d),new Date(Date.UTC(r,n,s,a,o,l))}}function C(t,e){let{scale:r=1,rotation:i=0}=e,{width:n,height:s}=t.attributes.style;return new g({viewBox:[0,0,parseInt(n),parseInt(s)],scale:r,rotation:i})}function T(t){if(t.startsWith("#")){let e=parseInt(t.slice(1),16);return[(16711680&e)>>16,(65280&e)>>8,255&e]}return 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])}function k(t){let e=document.createElement("span");for(let r of(e.style.visibility="hidden",document.body.append(e),t.keys())){e.style.color=r;let i=window.getComputedStyle(e).color;t.set(r,T(i))}e.remove()}function P(t){let{a:e,b:r,c:i,d:n,e:s,f:a}=t.getTransform();return[e,r,i,n,s,a]}function M(t){let{a:e,b:r,c:i,d:n,e:s,f:a}=t.getTransform().invertSelf();return[e,r,i,n,s,a]}e.PDFDateString=E},(t,e,r)=>{"use strict";
2Object.defineProperty(e,"__esModule",{value:!0}),e.BaseStandardFontDataFactory=e.BaseSVGFactory=e.BaseCanvasFactory=e.BaseCMapReaderFactory=void 0;var i=r(1);class n{constructor(){this.constructor===n&&(0,i.unreachable)("Cannot initialize BaseCanvasFactory.")}create(t,e){if(t<=0||e<=0)throw Error("Invalid canvas size");let r=this._createCanvas(t,e);return{canvas:r,context:r.getContext("2d")}}reset(t,e,r){if(!t.canvas)throw Error("Canvas is not specified");if(e<=0||r<=0)throw Error("Invalid canvas size");t.canvas.width=e,t.canvas.height=r}destroy(t){if(!t.canvas)throw Error("Canvas is not specified");t.canvas.width=0,t.canvas.height=0,t.canvas=null,t.context=null}_createCanvas(t,e){(0,i.unreachable)("Abstract method `_createCanvas` called.")}}e.BaseCanvasFactory=n;class s{constructor(t){let{baseUrl:e=null,isCompressed:r=!1}=t;this.constructor===s&&(0,i.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=e,this.isCompressed=r}async fetch(t){let{name:e}=t;if(!this.baseUrl)throw Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!e)throw Error("CMap name must be specified.");let r=this.baseUrl+e+(this.isCompressed?".bcmap":""),n=this.isCompressed?i.CMapCompressionType.BINARY:i.CMapCompressionType.NONE;return this._fetchData(r,n).catch(t=>{throw Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${r}`)})}_fetchData(t,e){(0,i.unreachable)("Abstract method `_fetchData` called.")}}e.BaseCMapReaderFactory=s;class a{constructor(t){let{baseUrl:e=null}=t;this.constructor===a&&(0,i.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=e}async fetch(t){let{filename:e}=t;if(!this.baseUrl)throw Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!e)throw Error("Font filename must be specified.");let r=`${this.baseUrl}${e}`;return this._fetchData(r).catch(t=>{throw Error(`Unable to load font data at: ${r}`)})}_fetchData(t){(0,i.unreachable)("Abstract method `_fetchData` called.")}}e.BaseStandardFontDataFactory=a;class o{constructor(){this.constructor===o&&(0,i.unreachable)("Cannot initialize BaseSVGFactory.")}create(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t<=0||e<=0)throw Error("Invalid SVG dimensions");let i=this._createSVG("svg:svg");return i.setAttribute("version","1.1"),r||(i.setAttribute("width",`${t}px`),i.setAttribute("height",`${e}px`)),i.setAttribute("preserveAspectRatio","none"),i.setAttribute("viewBox",`0 0 ${t} ${e}`),i}createElement(t){if("string"!=typeof t)throw Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){(0,i.unreachable)("Abstract method `_createSVG` called.")}}e.BaseSVGFactory=o},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MurmurHash3_64=void 0;var i=r(1);let n=3285377520,s=4294901760,a=65535;class o{constructor(t){this.h1=t?4294967295&t:n,this.h2=t?4294967295&t:n}update(t){let e,r;if("string"==typeof t){e=new Uint8Array(2*t.length),r=0;for(let i=0,n=t.length;i<n;i++){let n=t.charCodeAt(i);n<=255?e[r++]=n:(e[r++]=n>>>8,e[r++]=255&n)}}else if((0,i.isArrayBuffer)(t))r=(e=t.slice()).byteLength;else throw Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");let n=r>>2,o=r-4*n,l=new Uint32Array(e.buffer,0,n),h=0,c=0,d=this.h1,u=this.h2,p=3432918353,f=461845907,g=3432918353&a,m=461845907&a;for(let t=0;t<n;t++)1&t?(d^=h=(h=(h=(h=l[t])*p&s|h*g&a)<<15|h>>>17)*f&s|h*m&a,d=5*(d=d<<13|d>>>19)+3864292196):(u^=c=(c=(c=(c=l[t])*p&s|c*g&a)<<15|c>>>17)*f&s|c*m&a,u=5*(u=u<<13|u>>>19)+3864292196);switch(h=0,o){case 3:h^=e[4*n+2]<<16;case 2:h^=e[4*n+1]<<8;case 1:h^=e[4*n],h=(h=(h=h*p&s|h*g&a)<<15|h>>>17)*f&s|h*m&a,1&n?d^=h:u^=h}this.h1=d,this.h2=u}hexdigest(){let t=this.h1,e=this.h2;t^=e>>>1,t=3981806797*t&s|36045*t&a,e=4283543511*e&s|((e<<16|t>>>16)*2950163797&s)>>>16,t^=e>>>1,t=444984403*t&s|60499*t&a,e=3301882366*e&s|((e<<16|t>>>16)*3120437893&s)>>>16;let r=((t^=e>>>1)>>>0).toString(16),i=(e>>>0).toString(16);return r.padStart(8,"0")+i.padStart(8,"0")}}e.MurmurHash3_64=o},(t,e,r)=>{"use strict";let i;
2Object.defineProperty(e,"__esModule",{value:!0}),e.FontLoader=e.FontFaceObject=void 0;var n=r(1);class s{constructor(t){let{docId:e,onUnsupportedFeature:r,ownerDocument:i=globalThis.document,styleElement:a=null}=t;this.constructor===s&&(0,n.unreachable)("Cannot initialize BaseFontLoader."),this.docId=e,this._onUnsupportedFeature=r,this._document=i,this.nativeFontFaces=[],this.styleElement=null}addNativeFontFace(t){this.nativeFontFaces.push(t),this._document.fonts.add(t)}insertRule(t){let e=this.styleElement;e||((e=this.styleElement=this._document.createElement("style")).id=`PDFJS_FONT_STYLE_TAG_${this.docId}`,this._document.documentElement.getElementsByTagName("head")[0].append(e));let r=e.sheet;r.insertRule(t,r.cssRules.length)}clear(){for(let t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.length=0,this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async bind(t){if(t.attached||t.missingFile)return;if(t.attached=!0,this.isFontLoadingAPISupported){let e=t.createNativeFontFace();if(e){this.addNativeFontFace(e);try{await e.loaded}catch(r){throw this._onUnsupportedFeature({featureId:n.UNSUPPORTED_FEATURES.errorFontLoadNative}),(0,n.warn)(`Failed to load font '${e.family}': '${r}'.`),t.disableFontFace=!0,r}}return}let e=t.createFontFaceRule();if(e){if(this.insertRule(e),this.isSyncFontLoadingSupported)return;await new Promise(r=>{let i=this._queueLoadingCallback(r);this._prepareFontLoadEvent([e],[t],i)})}}_queueLoadingCallback(t){(0,n.unreachable)("Abstract method `_queueLoadingCallback`.")}get isFontLoadingAPISupported(){var t;let e=!!(null!==(t=this._document)&&void 0!==t&&t.fonts);return(0,n.shadow)(this,"isFontLoadingAPISupported",e)}get isSyncFontLoadingSupported(){(0,n.unreachable)("Abstract method `isSyncFontLoadingSupported`.")}get _loadTestFont(){(0,n.unreachable)("Abstract method `_loadTestFont`.")}_prepareFontLoadEvent(t,e,r){(0,n.unreachable)("Abstract method `_prepareFontLoadEvent`.")}}e.FontLoader=i,e.FontLoader=i=class extends s{constructor(t){super(t),this.loadingContext={requests:[],nextRequestId:0},this.loadTestFontId=0}get isSyncFontLoadingSupported(){let t=!1;if("undefined"==typeof navigator)t=!0;else{let e=/Mozilla\/5.0.*?rv:(\d+).*? Gecko/.exec(navigator.userAgent);(null==e?void 0:e[1])>=14&&(t=!0)}return(0,n.shadow)(this,"isSyncFontLoadingSupported",t)}_queueLoadingCallback(t){function e(){for((0,n.assert)(!i.done,"completeRequest() cannot be called twice."),i.done=!0;r.requests.length>0&&r.requests[0].done;)setTimeout(r.requests.shift().callback,0)}let r=this.loadingContext,i={id:`pdfjs-font-loading-${r.nextRequestId++}`,done:!1,complete:e,callback:t};return r.requests.push(i),i}get _loadTestFont(){let t=function(){return atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==")};return(0,n.shadow)(this,"_loadTestFont",t())}_prepareFontLoadEvent(t,e,r){let i,s;function a(t,e){return t.charCodeAt(e)<<24|t.charCodeAt(e+1)<<16|t.charCodeAt(e+2)<<8|255&t.charCodeAt(e+3)}function o(t,e,r,i){return t.substring(0,e)+i+t.substring(e+r)}let l=this._document.createElement("canvas");l.width=1,l.height=1;let h=l.getContext("2d"),c=0;function d(t,e){if(++c>30){(0,n.warn)("Load test font never loaded."),e();return}if(h.font="30px "+t,h.fillText(".",0,20),h.getImageData(0,0,1,1).data[3]>0){e();return}setTimeout(d.bind(null,t,e))}let u=`lt${Date.now()}${this.loadTestFontId++}`,p=this._loadTestFont;p=o(p,976,u.length,u);let f=16,g=1482184792,m=a(p,16);for(i=0,s=u.length-3;i<s;i+=4)m=m-g+a(u,i)|0;i<u.length&&(m=m-g+a(u+"XXX",i)|0),p=o(p,f,4,(0,n.string32)(m));let v=`url(data:font/opentype;base64,${btoa(p)});`,b=`@font-face {font-family:"${u}";src:${v}}`;this.insertRule(b);let y=[];for(let t of e)y.push(t.loadedName);y.push(u);let A=this._document.createElement("div");for(let t of(A.style.visibility="hidden",A.style.width=A.style.height="10px",A.style.position="absolute",A.style.top=A.style.left="0px",y)){let e=this._document.createElement("span");e.textContent="Hi",e.style.fontFamily=t,A.append(e)}this._document.body.append(A),d(u,()=>{A.remove(),r.complete()})}};class a{constructor(t,e){let{isEvalSupported:r=!0,disableFontFace:i=!1,ignoreErrors:n=!1,onUnsupportedFeature:s,fontRegistry:a=null}=e;for(let e in this.compiledGlyphs=Object.create(null),t)this[e]=t[e];this.isEvalSupported=!1!==r,this.disableFontFace=!0===i,this.ignoreErrors=!0===n,this._onUnsupportedFeature=s,this.fontRegistry=a}createNativeFontFace(){let t;if(!this.data||this.disableFontFace)return null;if(this.cssFontInfo){let e={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(e.style=`oblique ${this.cssFontInfo.italicAngle}deg`),t=new FontFace(this.cssFontInfo.fontFamily,this.data,e)}else t=new FontFace(this.loadedName,this.data,{});return this.fontRegistry&&this.fontRegistry.registerFont(this),t}createFontFaceRule(){let t;if(!this.data||this.disableFontFace)return null;let e=(0,n.bytesToString)(this.data),r=`url(data:${this.mimetype};base64,${btoa(e)});`;if(this.cssFontInfo){let e=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(e+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),t=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${e}src:${r}}`}else t=`@font-face {font-family:"${this.loadedName}";src:${r}}`;return this.fontRegistry&&this.fontRegistry.registerFont(this,r),t}getPathGenerator(t,e){let r;if(void 0!==this.compiledGlyphs[e])return this.compiledGlyphs[e];try{r=t.get(this.loadedName+"_path_"+e)}catch(t){if(!this.ignoreErrors)throw t;return this._onUnsupportedFeature({featureId:n.UNSUPPORTED_FEATURES.errorFontGetPath}),(0,n.warn)(`getPathGenerator - ignoring character: "${t}".`),this.compiledGlyphs[e]=function(t,e){}}if(this.isEvalSupported&&n.FeatureTest.isEvalSupported){let t=[];for(let e of r){let r=void 0!==e.args?e.args.join(","):"";t.push("c.",e.cmd,"(",r,");\n")}return this.compiledGlyphs[e]=Function("c","size",t.join(""))}return this.compiledGlyphs[e]=function(t,e){for(let i of r)"scale"===i.cmd&&(i.args=[e,-e]),t[i.cmd].apply(t,i.args)}}}e.FontFaceObject=a},(t,e,r)=>{"use strict";
2Object.defineProperty(e,"__esModule",{value:!0}),e.CanvasGraphics=void 0;var i=r(133),n=r(1),s=r(138),a=r(139),o=r(3);function l(t,e){h(t,e),e.add(t)}function h(t,e){if(e.has(t))throw TypeError("Cannot initialize the same private elements twice on an object")}function c(t,e,r){if(!e.has(t))throw TypeError("attempted to get private field on non-instance");return r}let d=16,u=100,p=4096,f=15,g=10,m=o.isNodeJS&&"undefined"==typeof Path2D?-1:1e3,v=16;function b(t,e){if(t._removeMirroring)throw Error("Context is already forwarding operations.");t.__originalSave=t.save,t.__originalRestore=t.restore,t.__originalRotate=t.rotate,t.__originalScale=t.scale,t.__originalTranslate=t.translate,t.__originalTransform=t.transform,t.__originalSetTransform=t.setTransform,t.__originalResetTransform=t.resetTransform,t.__originalClip=t.clip,t.__originalMoveTo=t.moveTo,t.__originalLineTo=t.lineTo,t.__originalBezierCurveTo=t.bezierCurveTo,t.__originalRect=t.rect,t.__originalClosePath=t.closePath,t.__originalBeginPath=t.beginPath,t._removeMirroring=()=>{t.save=t.__originalSave,t.restore=t.__originalRestore,t.rotate=t.__originalRotate,t.scale=t.__originalScale,t.translate=t.__originalTranslate,t.transform=t.__originalTransform,t.setTransform=t.__originalSetTransform,t.resetTransform=t.__originalResetTransform,t.clip=t.__originalClip,t.moveTo=t.__originalMoveTo,t.lineTo=t.__originalLineTo,t.bezierCurveTo=t.__originalBezierCurveTo,t.rect=t.__originalRect,t.closePath=t.__originalClosePath,t.beginPath=t.__originalBeginPath,delete t._removeMirroring},t.save=function(){e.save(),this.__originalSave()},t.restore=function(){e.restore(),this.__originalRestore()},t.translate=function(t,r){e.translate(t,r),this.__originalTranslate(t,r)},t.scale=function(t,r){e.scale(t,r),this.__originalScale(t,r)},t.transform=function(t,r,i,n,s,a){e.transform(t,r,i,n,s,a),this.__originalTransform(t,r,i,n,s,a)},t.setTransform=function(t,r,i,n,s,a){e.setTransform(t,r,i,n,s,a),this.__originalSetTransform(t,r,i,n,s,a)},t.resetTransform=function(){e.resetTransform(),this.__originalResetTransform()},t.rotate=function(t){e.rotate(t),this.__originalRotate(t)},t.clip=function(t){e.clip(t),this.__originalClip(t)},t.moveTo=function(t,r){e.moveTo(t,r),this.__originalMoveTo(t,r)},t.lineTo=function(t,r){e.lineTo(t,r),this.__originalLineTo(t,r)},t.bezierCurveTo=function(t,r,i,n,s,a){e.bezierCurveTo(t,r,i,n,s,a),this.__originalBezierCurveTo(t,r,i,n,s,a)},t.rect=function(t,r,i,n){e.rect(t,r,i,n),this.__originalRect(t,r,i,n)},t.closePath=function(){e.closePath(),this.__originalClosePath()},t.beginPath=function(){e.beginPath(),this.__originalBeginPath()}}class y{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,e,r){let i;return void 0!==this.cache[t]?(i=this.cache[t],this.canvasFactory.reset(i,e,r)):(i=this.canvasFactory.create(e,r),this.cache[t]=i),i}delete(t){delete this.cache[t]}clear(){for(let t in this.cache){let e=this.cache[t];this.canvasFactory.destroy(e),delete this.cache[t]}}}function A(t,e,r,n,s,a,o,l,h,c){let[d,u,p,f,g,m]=(0,i.getCurrentTransform)(t);if(0===u&&0===p){let i=Math.round(o*d+g),v=Math.round(l*f+m),b=Math.abs(Math.round((o+h)*d+g)-i)||1,y=Math.abs(Math.round((l+c)*f+m)-v)||1;return t.setTransform(Math.sign(d),0,0,Math.sign(f),i,v),t.drawImage(e,r,n,s,a,0,0,b,y),t.setTransform(d,u,p,f,g,m),[b,y]}if(0===d&&0===f){let i=Math.round(l*p+g),v=Math.round(o*u+m),b=Math.abs(Math.round((l+c)*p+g)-i)||1,y=Math.abs(Math.round((o+h)*u+m)-v)||1;return t.setTransform(0,Math.sign(u),Math.sign(p),0,i,v),t.drawImage(e,r,n,s,a,0,0,y,b),t.setTransform(d,u,p,f,g,m),[y,b]}return t.drawImage(e,r,n,s,a,o,l,h,c),[Math.hypot(d,u)*h,Math.hypot(p,f)*c]}function _(t){let e,r,i;let{width:n,height:s}=t;if(n>m||s>m)return null;let a=1e3,o=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),l=n+1,h=new Uint8Array(l*(s+1)),c=n+7&-8,d=new Uint8Array(c*s),u=0;for(let e of t.data){let t=128;for(;t>0;)d[u++]=e&t?0:255,t>>=1}let p=0;for(0!==d[u=0]&&(h[0]=1,++p),r=1;r<n;r++)d[u]!==d[u+1]&&(h[r]=d[u]?2:1,++p),u++;for(0!==d[u]&&(h[r]=2,++p),e=1;e<s;e++){u=e*c,i=e*l,d[u-c]!==d[u]&&(h[i]=d[u]?1:8,++p);let t=(d[u]?4:0)+(d[u-c]?8:0);for(r=1;r<n;r++)o[t=(t>>2)+(d[u+1]?4:0)+(d[u-c+1]?8:0)]&&(h[i+r]=o[t],++p),u++;if(d[u-c]!==d[u]&&(h[i+r]=d[u]?2:4,++p),p>a)return null}for(u=c*(s-1),i=e*l,0!==d[u]&&(h[i]=8,++p),r=1;r<n;r++)d[u]!==d[u+1]&&(h[i+r]=d[u]?4:8,++p),u++;if(0!==d[u]&&(h[i+r]=4,++p),p>a)return null;let f=new Int32Array([0,l,-1,0,-l,0,0,0,1]),g=new Path2D;for(e=0;p&&e<=s;e++){let t=e*l,r=t+n;for(;t<r&&!h[t];)t++;if(t===r)continue;g.moveTo(t%l,e);let i=t,s=h[t];do{let e=f[s];do t+=e;while(!h[t]);let r=h[t];5!==r&&10!==r?(s=r,h[t]=0):(s=r&51*s>>4,h[t]&=s>>2|s<<2),g.lineTo(t%l,t/l|0),!h[t]&&--p}while(i!==t);--e}return d=null,h=null,function(t){t.save(),t.scale(1/n,-1/s),t.translate(0,-s),t.fill(g),t.beginPath(),t.restore(
2)}}class S{constructor(t,e){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=n.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=n.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=n.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(){let 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]=n.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){let r=n.Util.applyTransform(e,t),i=n.Util.applyTransform(e.slice(2),t);this.minX=Math.min(this.minX,r[0],i[0]),this.minY=Math.min(this.minY,r[1],i[1]),this.maxX=Math.max(this.maxX,r[0],i[0]),this.maxY=Math.max(this.maxY,r[1],i[1])}updateScalingPathMinMax(t,e){n.Util.scaleMinMax(t,e),this.minX=Math.min(this.minX,e[0]),this.maxX=Math.max(this.maxX,e[1]),this.minY=Math.min(this.minY,e[2]),this.maxY=Math.max(this.maxY,e[3])}updateCurvePathMinMax(t,e,r,i,s,a,o,l,h,c){let d=n.Util.bezierBoundingBox(e,r,i,s,a,o,l,h);if(c){c[0]=Math.min(c[0],d[0],d[2]),c[1]=Math.max(c[1],d[0],d[2]),c[2]=Math.min(c[2],d[1],d[3]),c[3]=Math.max(c[3],d[1],d[3]);return}this.updateRectMinMax(t,d)}getPathBoundingBox(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s.PathType.FILL,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=[this.minX,this.minY,this.maxX,this.maxY];if(t===s.PathType.STROKE){e||(0,n.unreachable)("Stroke bounding box must include transform.");let t=n.Util.singularValueDecompose2dScale(e),i=t[0]*this.lineWidth/2,s=t[1]*this.lineWidth/2;r[0]-=i,r[1]-=s,r[2]+=i,r[3]+=s}return r}updateClipFromPath(){let t=n.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(t){this.clipBox=t,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s.PathType.FILL,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return n.Util.intersect(this.clipBox,this.getPathBoundingBox(t,e))}}function x(t,e){let r,i,s,a,o,l,h,c,d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if("undefined"!=typeof ImageData&&e instanceof ImageData){t.putImageData(e,0,0);return}let u=e.height,p=e.width,f=u%v,g=(u-f)/v,m=0===f?g:g+1,b=t.createImageData(p,v),y=0,A,_=e.data,S=b.data;if(d)switch(d.length){case 1:o=d[0],l=d[0],h=d[0],c=d[0];break;case 4:o=d[0],l=d[1],h=d[2],c=d[3]}if(e.kind===n.ImageKind.GRAYSCALE_1BPP){let e=_.byteLength,a=new Uint32Array(S.buffer,0,S.byteLength>>2),o=a.length,l=p+7>>3,h=4294967295,d=n.FeatureTest.isLittleEndian?4278190080:255;for(c&&255===c[0]&&0===c[255]&&([h,d]=[d,h]),r=0;r<m;r++){for(i=0,s=r<g?v:f,A=0;i<s;i++){let t=e-y,r=0,i=t>l?p:8*t-7,n=-8&i,s=0,o=0;for(;r<n;r+=8)o=_[y++],a[A++]=128&o?h:d,a[A++]=64&o?h:d,a[A++]=32&o?h:d,a[A++]=16&o?h:d,a[A++]=8&o?h:d,a[A++]=4&o?h:d,a[A++]=2&o?h:d,a[A++]=1&o?h:d;for(;r<i;r++)0===s&&(o=_[y++],s=128),a[A++]=o&s?h:d,s>>=1}for(;A<o;)a[A++]=0;t.putImageData(b,0,r*v)}}else if(e.kind===n.ImageKind.RGBA_32BPP){let e=!!(o||l||h);for(r=0,i=0,a=p*v*4;r<g;r++){if(S.set(_.subarray(y,y+a)),y+=a,e)for(let t=0;t<a;t+=4)o&&(S[t+0]=o[S[t+0]]),l&&(S[t+1]=l[S[t+1]]),h&&(S[t+2]=h[S[t+2]]);t.putImageData(b,0,i),i+=v}if(r<m){if(a=p*f*4,S.set(_.subarray(y,y+a)),e)for(let t=0;t<a;t+=4)o&&(S[t+0]=o[S[t+0]]),l&&(S[t+1]=l[S[t+1]]),h&&(S[t+2]=h[S[t+2]]);t.putImageData(b,0,i)}}else if(e.kind===n.ImageKind.RGB_24BPP){let e=!!(o||l||h);for(r=0,a=p*(s=v);r<m;r++){for(r>=g&&(a=p*(s=f)),A=0,i=a;i--;)S[A++]=_[y++],S[A++]=_[y++],S[A++]=_[y++],S[A++]=255;if(e)for(let t=0;t<A;t+=4)o&&(S[t+0]=o[S[t+0]]),l&&(S[t+1]=l[S[t+1]]),h&&(S[t+2]=h[S[t+2]]);t.putImageData(b,0,r*v)}}else throw Error(`bad image kind: ${e.kind}`)}function w(t,e){if(e.bitmap){t.drawImage(e.bitmap,0,0);return}let r=e.height,i=e.width,n=r%v,s=(r-n)/v,o=0===n?s:s+1,l=t.createImageData(i,v),h=0,c=e.data,d=l.data;for(let e=0;e<o;e++){let r=e<s?v:n;({srcPos:h}=(0,a.applyMaskImageData)({src:c,srcPos:h,dest:d,width:i,height:r})),t.putImageData(l,0,e*v)}}function E(t,e){let r=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font"];for(let i=0,n=r.length;i<n;i++){let n=r[i];void 0!==t[n]&&(e[n]=t[n])}void 0!==t.setLineDash&&(e.setLineDash(t.getLineDash()),e.lineDashOffset=t.lineDashOffset)}function C(t,e){t.strokeStyle=t.fillStyle=e||"#000000",t.fillRule="nonzero",t.globalAlpha=1,t.lineWidth=1,t.lineCap="butt",t.lineJoin="miter",t.miter
2Limit=10,t.globalCompositeOperation="source-over",t.font="10px sans-serif",void 0!==t.setLineDash&&(t.setLineDash([]),t.lineDashOffset=0)}function T(t,e,r,i){let n=t.length;for(let s=3;s<n;s+=4){let n=t[s];if(0===n)t[s-3]=e,t[s-2]=r,t[s-1]=i;else if(n<255){let a=255-n;t[s-3]=t[s-3]*n+e*a>>8,t[s-2]=t[s-2]*n+r*a>>8,t[s-1]=t[s-1]*n+i*a>>8}}}function k(t,e,r){let i=t.length,n=1/255;for(let s=3;s<i;s+=4){let i=r?r[t[s]]:t[s];e[s]=e[s]*i*n|0}}function P(t,e,r){let i=t.length;for(let n=3;n<i;n+=4){let i=77*t[n-3]+152*t[n-2]+28*t[n-1];e[n]=r?e[n]*r[i>>8]>>8:e[n]*i>>16}}function M(t,e,r,i,n,s,a,o,l,h,c){let d;let u=!!s,p=u?s[0]:0,f=u?s[1]:0,g=u?s[2]:0;d="Luminosity"===n?P:k;let m=Math.min(i,Math.ceil(1048576/r));for(let n=0;n<i;n+=m){let s=Math.min(m,i-n),v=t.getImageData(o-h,n+(l-c),r,s),b=e.getImageData(o,n+l,r,s);u&&T(v.data,p,f,g),d(v.data,b.data,a),e.putImageData(b,o,n+l)}}function R(t,e,r,i){let n=i[0],s=i[1],a=i[2]-n,o=i[3]-s;0!==a&&0!==o&&(M(e.context,r,a,o,e.subtype,e.backdrop,e.transferMap,n,s,e.offsetX,e.offsetY),t.save(),t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),t.drawImage(r.canvas,0,0),t.restore())}function F(t,e){let r=n.Util.singularValueDecompose2dScale(t);r[0]=Math.fround(r[0]),r[1]=Math.fround(r[1]);let s=Math.fround((globalThis.devicePixelRatio||1)*i.PixelsPerInch.PDF_TO_CSS_UNITS);return void 0!==e?e:r[0]<=s||r[1]<=s}let O=["butt","round","square"],I=["miter","round","bevel"],D={},L={};var N=new WeakSet;class j{constructor(t,e,r,i,n,s,a,o){l(this,N),this.ctx=t,this.current=new S(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=e,this.objs=r,this.canvasFactory=i,this.imageLayer=n,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=s,this.cachedCanvases=new y(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=a,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.backgroundColor=(null==o?void 0:o.background)||null,this.foregroundColor=(null==o?void 0:o.foreground)||null,this._cachedScaleForStroking=null,this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return"string"==typeof t?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):e}beginDrawing(t){let{transform:e,viewport:r,transparency:n=!1,background:s=null}=t,a=this.ctx.canvas.width,o=this.ctx.canvas.height,l=s||"#ffffff";if(this.ctx.save(),this.foregroundColor&&this.backgroundColor){this.ctx.fillStyle=this.foregroundColor;let t=this.foregroundColor=this.ctx.fillStyle;this.ctx.fillStyle=this.backgroundColor;let e=this.backgroundColor=this.ctx.fillStyle,r=!0,n=l;if(this.ctx.fillStyle=l,r="string"==typeof(n=this.ctx.fillStyle)&&/^#[0-9A-Fa-f]{6}$/.test(n),("#000000"!==t||"#ffffff"!==e)&&t!==e&&r){let[r,s,a]=(0,i.getRGB)(n),o=t=>(t/=255)<=.03928?t/12.92:((t+.055)/1.055)**2.4,l=Math.round(.2126*o(r)+.7152*o(s)+.0722*o(a));this.selectColor=(r,i,n)=>Math.round(.2126*o(r)+.7152*o(i)+.0722*o(n))===l?e:t}else this.foregroundColor=this.backgroundColor=null}if(this.ctx.fillStyle=this.backgroundColor||l,this.ctx.fillRect(0,0,a,o),this.ctx.restore(),n){let t=this.cachedCanvases.getCanvas("transparent",a,o);this.compositeCtx=this.ctx,this.transparentCanvas=t.canvas,this.ctx=t.context,this.ctx.save(),this.ctx.transform(...(0,i.getCurrentTransform)(this.compositeCtx))}this.ctx.save(),C(this.ctx,this.foregroundColor),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[0]),this.ctx.transform(...r.transform),this.viewportScale=r.scale,this.baseTransform=(0,i.getCurrentTransform)(this.ctx),this.imageLayer&&((0,i.deprecated)("The `imageLayer` functionality will be removed in the future."),this.imageLayer.beginLayout())}executeOperatorList(t,e,r,i){let s;let a=t.argsArray,o=t.fnArray,l=e||0,h=a.length;if(h===l)return l;let c=h-l>g&&"function"==typeof r,d=c?Date.now()+f:0,u=0,p=this.commonObjs,m=this.objs;for(;;){if(void 0!==i&&l===i.nextBreakPoint)return i.breakIt(l,r),l;if((s=o[l])!==n.OPS.dependency)this[s].apply(this,a[l]);else for(let t of a[l]){let e=t.startsWith("g_")?p:m;if(!e.has(t))return e.get(t,r),l}if(++l===h)return l;if(c&&++u>g){if(Date.now()>d)return r(),l;u=0}}}endDrawing(){for(let t of(c(this,N,U).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear(),this._cachedBitmapsMap.values())
2){for(let e of t.values())"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement&&(e.width=e.height=0);t.clear()}this._cachedBitmapsMap.clear(),this.imageLayer&&this.imageLayer.endLayout()}_scaleImage(t,e){let r,i;let n=t.width,s=t.height,a=Math.max(Math.hypot(e[0],e[1]),1),o=Math.max(Math.hypot(e[2],e[3]),1),l=n,h=s,c="prescale1";for(;a>2&&l>1||o>2&&h>1;){let e=l,n=h;a>2&&l>1&&(e=Math.ceil(l/2),a/=l/e),o>2&&h>1&&(n=Math.ceil(h/2),o/=h/n),(i=(r=this.cachedCanvases.getCanvas(c,e,n)).context).clearRect(0,0,e,n),i.drawImage(t,0,0,l,h,0,0,e,n),t=r.canvas,l=e,h=n,c="prescale1"===c?"prescale2":"prescale1"}return{img:t,paintWidth:l,paintHeight:h}}_createMaskCanvas(t){let e,r,a,o;let l=this.ctx,{width:h,height:c}=t,d=this.current.fillColor,u=this.current.patternFill,p=(0,i.getCurrentTransform)(l);if((t.bitmap||t.data)&&t.count>1){let i=t.bitmap||t.data.buffer,n=p.slice(0,4);r=JSON.stringify(u?n:[n,d]),(e=this._cachedBitmapsMap.get(i))||(e=new Map,this._cachedBitmapsMap.set(i,e));let s=e.get(r);if(s&&!u)return{canvas:s,offsetX:Math.round(Math.min(p[0],p[2])+p[4]),offsetY:Math.round(Math.min(p[1],p[3])+p[5])};a=s}a||w((o=this.cachedCanvases.getCanvas("maskCanvas",h,c)).context,t);let f=n.Util.transform(p,[1/h,0,0,-1/c,0,0]);f=n.Util.transform(f,[1,0,0,1,0,-c]);let g=n.Util.applyTransform([0,0],f),m=n.Util.applyTransform([h,c],f),v=n.Util.normalizeRect([g[0],g[1],m[0],m[1]]),b=Math.round(v[2]-v[0])||1,y=Math.round(v[3]-v[1])||1,_=this.cachedCanvases.getCanvas("fillCanvas",b,y),S=_.context,x=Math.min(g[0],m[0]),E=Math.min(g[1],m[1]);S.translate(-x,-E),S.transform(...f),!a&&(a=(a=this._scaleImage(o.canvas,(0,i.getCurrentTransformInverse)(S))).img,e&&u&&e.set(r,a)),S.imageSmoothingEnabled=F((0,i.getCurrentTransform)(S),t.interpolate),A(S,a,0,0,a.width,a.height,0,0,h,c),S.globalCompositeOperation="source-in";let C=n.Util.transform((0,i.getCurrentTransformInverse)(S),[1,0,0,1,-x,-E]);return S.fillStyle=u?d.getPattern(l,this,C,s.PathType.FILL):d,S.fillRect(0,0,h,c),e&&!u&&(this.cachedCanvases.delete("fillCanvas"),e.set(r,_.canvas)),{canvas:_.canvas,offsetX:Math.round(x),offsetY:Math.round(E)}}setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking=null),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(t){this.ctx.lineCap=O[t]}setLineJoin(t){this.ctx.lineJoin=I[t]}setMiterLimit(t){this.ctx.miterLimit=t}setDash(t,e){let r=this.ctx;void 0!==r.setLineDash&&(r.setLineDash(t),r.lineDashOffset=e)}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(let e=0,r=t.length;e<r;e++){let r=t[e],i=r[0],n=r[1];switch(i){case"LW":this.setLineWidth(n);break;case"LC":this.setLineCap(n);break;case"LJ":this.setLineJoin(n);break;case"ML":this.setMiterLimit(n);break;case"D":this.setDash(n[0],n[1]);break;case"RI":this.setRenderingIntent(n);break;case"FL":this.setFlatness(n);break;case"Font":this.setFont(n[0],n[1]);break;case"CA":this.current.strokeAlpha=r[1];break;case"ca":this.current.fillAlpha=r[1],this.ctx.globalAlpha=r[1];break;case"BM":this.ctx.globalCompositeOperation=n;break;case"SMask":this.current.activeSMask=n?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.current.transferMaps=n}}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){let t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw Error("beginSMaskMode called while already in smask mode");let t=this.ctx.canvas.width,e=this.ctx.canvas.height,r="smaskGroupAt"+this.groupLevel,n=this.cachedCanvases.getCanvas(r,t,e);this.suspendedCtx=this.ctx,this.ctx=n.context;let s=this.ctx;s.setTransform(...(0,i.getCurrentTransform)(this.suspendedCtx)),E(this.suspendedCtx,s),b(s,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),E(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(t){if(!this.current.activeSMask)return;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];let e=this.current.activeSMask;R(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(
2)}save(){this.inSMaskMode?(E(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();let 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(),E(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking=null,this._cachedGetSinglePixelWidth=null)}transform(t,e,r,i,n,s){this.ctx.transform(t,e,r,i,n,s),this._cachedScaleForStroking=null,this._cachedGetSinglePixelWidth=null}constructPath(t,e,r){let s,a;let o=this.ctx,l=this.current,h=l.x,c=l.y,d=(0,i.getCurrentTransform)(o),u=0===d[0]&&0===d[3]||0===d[1]&&0===d[2],p=u?r.slice(0):null;for(let r=0,i=0,f=t.length;r<f;r++)switch(0|t[r]){case n.OPS.rectangle:h=e[i++],c=e[i++];let f=e[i++],g=e[i++],m=h+f,v=c+g;o.moveTo(h,c),0===f||0===g?o.lineTo(m,v):(o.lineTo(m,c),o.lineTo(m,v),o.lineTo(h,v)),u||l.updateRectMinMax(d,[h,c,m,v]),o.closePath();break;case n.OPS.moveTo:h=e[i++],c=e[i++],o.moveTo(h,c),u||l.updatePathMinMax(d,h,c);break;case n.OPS.lineTo:h=e[i++],c=e[i++],o.lineTo(h,c),u||l.updatePathMinMax(d,h,c);break;case n.OPS.curveTo:s=h,a=c,h=e[i+4],c=e[i+5],o.bezierCurveTo(e[i],e[i+1],e[i+2],e[i+3],h,c),l.updateCurvePathMinMax(d,s,a,e[i],e[i+1],e[i+2],e[i+3],h,c,p),i+=6;break;case n.OPS.curveTo2:s=h,a=c,o.bezierCurveTo(h,c,e[i],e[i+1],e[i+2],e[i+3]),l.updateCurvePathMinMax(d,s,a,h,c,e[i],e[i+1],e[i+2],e[i+3],p),h=e[i+2],c=e[i+3],i+=4;break;case n.OPS.curveTo3:s=h,a=c,h=e[i+2],c=e[i+3],o.bezierCurveTo(e[i],e[i+1],h,c,h,c),l.updateCurvePathMinMax(d,s,a,e[i],e[i+1],h,c,h,c,p),i+=4;break;case n.OPS.closePath:o.closePath()}u&&l.updateScalingPathMinMax(d,p),l.setCurrentPoint(h,c)}closePath(){this.ctx.closePath()}stroke(t){t=void 0===t||t;let 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,i.getCurrentTransformInverse)(e),s.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;let e=this.ctx,r=this.current.fillColor,n=this.current.patternFill,a=!1;n&&(e.save(),e.fillStyle=r.getPattern(e,this,(0,i.getCurrentTransformInverse)(e),s.PathType.FILL),a=!0);let o=this.current.getClippedPathBoundingBox();this.contentVisible&&null!==o&&(this.pendingEOFill?(e.fill("evenodd"),this.pendingEOFill=!1):e.fill()),a&&e.restore(),t&&this.consumePath(o)}eoFill(){this.pendingEOFill=!0,this.fill()}fillStroke(){this.fill(!1),this.stroke(!1),this.consumePath()}eoFillStroke(){this.pendingEOFill=!0,this.fillStroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=D}eoClip(){this.pendingClip=L}beginText(){this.current.textMatrix=n.IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){let t=this.pendingTextPaths,e=this.ctx;if(void 0===t){e.beginPath();return}for(let r of(e.save(),e.beginPath(),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(t,e){let r=this.commonObjs.get(t),i=this.current;if(!r)throw Error(`Can't find font for ${t}`);if(i.fontMatrix=r.fontMatrix||n.FONT_IDENTITY_MATRIX,(0===i.fontMatrix[0]||0===i.fontMatrix[3])&&(0,n.warn)("Invalid font matrix for font "+t),e<0?(e=-e,i.fontDirection=-1):i.fontDirection=1,this.current.font=r,this.current.fontSize=e,r.isType3Font)return;let s=r.loadedName||"sans-serif",a="normal";r.black?a="900":r.bold&&(a="bold");let o=r.italic?"italic":"normal",l=`"${s}", ${r.fallbackName}`,h=e;e<d?h=d:e>u&&(h=u),this.current.fontSizeScale=e/h,this.ctx.font=`${o} ${a} ${h}px ${l}`}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,i,n,s){this.current.textMatrix=[t,e,r,i,n,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,s){let a;let o=this.ctx,l=this.current,h=l.font,c=l.textRenderingMode,d=l.fontSize/l.fontSizeScale,u=c&n.TextRenderingMode.FILL_STROKE_MASK,p=!!(c&n.TextRenderingMode.ADD_TO_PATH_FLAG),f=l.patternFill&&!h.missingFile;(h.disableFontFace||p||f)&&(a=h.getPathGenerator(this.commonObjs,t)),h.disableFontFace||f?(o.save(),o.translate(e,r),o.beginPath(),a(o,d),s&&o.setTransform(...s),(u===n.TextRenderingMode.FILL||u===n.TextRenderingMode.FILL_STROKE)&&o.fill(),(u===n.TextRenderingMode.STROKE||u===n.TextRenderingMode.FILL_STROKE)&&o.stroke(),o.restore(
2)):((u===n.TextRenderingMode.FILL||u===n.TextRenderingMode.FILL_STROKE)&&o.fillText(t,e,r),(u===n.TextRenderingMode.STROKE||u===n.TextRenderingMode.FILL_STROKE)&&o.strokeText(t,e,r)),p&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:(0,i.getCurrentTransform)(o),x:e,y:r,fontSize:d,addToPath:a})}get isFontSubpixelAAEnabled(){let{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);t.scale(1.5,1),t.fillText("I",0,10);let e=t.getImageData(0,0,10,10).data,r=!1;for(let t=3;t<e.length;t+=4)if(e[t]>0&&e[t]<255){r=!0;break}return(0,n.shadow)(this,"isFontSubpixelAAEnabled",r)}showText(t){let e;let r=this.current,a=r.font;if(a.isType3Font)return this.showType3Text(t);let o=r.fontSize;if(0===o)return;let l=this.ctx,h=r.fontSizeScale,c=r.charSpacing,d=r.wordSpacing,u=r.fontDirection,p=r.textHScale*u,f=t.length,g=a.vertical,m=g?1:-1,v=a.defaultVMetrics,b=o*r.fontMatrix[0],y=r.textRenderingMode===n.TextRenderingMode.FILL&&!a.disableFontFace&&!r.patternFill;if(l.save(),l.transform(...r.textMatrix),l.translate(r.x,r.y+r.textRise),u>0?l.scale(p,-1):l.scale(p,1),r.patternFill){l.save();let t=r.fillColor.getPattern(l,this,(0,i.getCurrentTransformInverse)(l),s.PathType.FILL);e=(0,i.getCurrentTransform)(l),l.restore(),l.fillStyle=t}let A=r.lineWidth,_=r.textMatrixScale;if(0===_||0===A){let t=r.textRenderingMode&n.TextRenderingMode.FILL_STROKE_MASK;(t===n.TextRenderingMode.STROKE||t===n.TextRenderingMode.FILL_STROKE)&&(A=this.getSinglePixelWidth())}else A/=_;1!==h&&(l.scale(h,h),A/=h),l.lineWidth=A;let S=0,x;for(x=0;x<f;++x){let r,i,n;let s=t[x];if("number"==typeof s){S+=m*s*o/1e3;continue}let p=!1,f=(s.isSpace?d:0)+c,A=s.fontChar,_=s.accent,w=s.width;if(g){let t=s.vmetric||v,e=-(s.vmetric?t[1]:.5*w)*b,n=t[2]*b;w=t?-t[0]:w,r=e/h,i=(S+n)/h}else r=S/h,i=0;if(a.remeasure&&w>0){let t=1e3*l.measureText(A).width/o*h;if(w<t&&this.isFontSubpixelAAEnabled){let e=w/t;p=!0,l.save(),l.scale(e,1),r/=e}else w!==t&&(r+=(w-t)/2e3*o/h)}if(this.contentVisible&&(s.isInFont||a.missingFile)){if(y&&!_)l.fillText(A,r,i);else if(this.paintChar(A,r,i,e),_){let t=r+o*_.offset.x/h,n=i-o*_.offset.y/h;this.paintChar(_.fontChar,t,n,e)}}S+=n=g?w*b-f*u:w*b+f*u,p&&l.restore()}g?r.y-=S:r.x+=S*p,l.restore(),this.compose()}showType3Text(t){let e,r,i,s;let a=this.ctx,o=this.current,l=o.font,h=o.fontSize,c=o.fontDirection,d=l.vertical?1:-1,u=o.charSpacing,p=o.wordSpacing,f=o.textHScale*c,g=o.fontMatrix||n.FONT_IDENTITY_MATRIX,m=t.length;if(o.textRenderingMode!==n.TextRenderingMode.INVISIBLE&&0!==h){for(this._cachedScaleForStroking=null,this._cachedGetSinglePixelWidth=null,a.save(),a.transform(...o.textMatrix),a.translate(o.x,o.y),a.scale(f,c),e=0;e<m;++e){if("number"==typeof(r=t[e])){s=d*r*h/1e3,this.ctx.translate(s,0),o.x+=s*f;continue}let c=(r.isSpace?p:0)+u,m=l.charProcOperatorList[r.operatorListId];if(!m){(0,n.warn)(`Type3 character "${r.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=r,this.save(),a.scale(h,h),a.transform(...g),this.executeOperatorList(m),this.restore()),i=n.Util.applyTransform([r.width,0],g)[0]*h+c,a.translate(i,0),o.x+=i*f}a.restore(),this.processingType3=null}}setCharWidth(t,e){}setCharWidthAndBounds(t,e,r,i,n,s){this.ctx.rect(r,i,n-r,s-i),this.ctx.clip(),this.endPath()}getColorN_Pattern(t){let e;if("TilingPattern"===t[0]){let r=t[1],n=this.baseTransform||(0,i.getCurrentTransform)(this.ctx),a={createCanvasGraphics:t=>new j(t,this.commonObjs,this.objs,this.canvasFactory)};e=new s.TilingPattern(t,r,this.ctx,a,n)}else e=this._getPattern(t[1],t[2]);return e}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(t,e,r){var i;let s=(null===(i=this.selectColor)||void 0===i?void 0:i.call(this,t,e,r))||n.Util.makeHexColor(t,e,r);this.ctx.strokeStyle=s,this.current.strokeColor=s}setFillRGBColor(t,e,r){var i;let s=(null===(i=this.selectColor)||void 0===i?void 0:i.call(this,t,e,r))||n.Util.makeHexColor(t,e,r);this.ctx.fillStyle=s,this.current.fillColor=s,this.current.patternFill=!1}_getPattern(t){let e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.cachedPatterns.has(t)?e=this.cachedPatterns.get(t):(e=(0,s.getShadingPattern)(this.objs.get(t)),this.cachedPatterns.set(t,e)),r&&(e.matrix=r),e}shadingFill(t){if(!this.contentVisible)return;let e=this.ctx;this.save();let r=this._getPattern(t);e.fillStyle=r.getPattern(e,this,(0,i.getCurrentTransformInverse)(e),s.PathType.SHADING);let a=(0,i.getCurrentTransformInverse)(e);if(a){let t=e.canvas,r=t.width,i=t.height,s=n.Util.applyTransform([0,0],a),o=n.Util.applyTransform([0,i],a),l=n.Util.applyTransform([r,0],a),h=n.Util.applyTransform([r,i],a),c=Math.min(s[0],o[0],l[0],h[0]),d=Math.min(s[1],o[1],l[1],h[1]),u=Math.max(s[0],o[0],l[0],h[0]),p=Math.max(s[1],o[1],l[1],h[1]);this.ctx.fillRect(c,d,u-c,p-d)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore(
2)}beginInlineImage(){(0,n.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,n.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(t,e){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(t)&&6===t.length&&this.transform(...t),this.baseTransform=(0,i.getCurrentTransform)(this.ctx),e)){let t=e[2]-e[0],r=e[3]-e[1];this.ctx.rect(e[0],e[1],t,r),this.current.updateRectMinMax((0,i.getCurrentTransform)(this.ctx),e),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(t){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);let e=this.ctx;t.isolated||(0,n.info)("TODO: Support non-isolated groups."),t.knockout&&(0,n.warn)("Knockout groups not supported.");let r=(0,i.getCurrentTransform)(e);if(t.matrix&&e.transform(...t.matrix),!t.bbox)throw Error("Bounding box is required.");let s=n.Util.getAxialAlignedBoundingBox(t.bbox,(0,i.getCurrentTransform)(e)),a=[0,0,e.canvas.width,e.canvas.height],o=Math.floor((s=n.Util.intersect(s,a)||[0,0,0,0])[0]),l=Math.floor(s[1]),h=Math.max(Math.ceil(s[2])-o,1),c=Math.max(Math.ceil(s[3])-l,1),d=1,u=1;h>p&&(d=h/p,h=p),c>p&&(u=c/p,c=p),this.current.startNewPathAndClipBox([0,0,h,c]);let f="groupAt"+this.groupLevel;t.smask&&(f+="_smask_"+this.smaskCounter++%2);let g=this.cachedCanvases.getCanvas(f,h,c),m=g.context;m.scale(1/d,1/u),m.translate(-o,-l),m.transform(...r),t.smask?this.smaskStack.push({canvas:g.canvas,context:m,offsetX:o,offsetY:l,scaleX:d,scaleY:u,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null}):(e.setTransform(1,0,0,1,0,0),e.translate(o,l),e.scale(d,u),e.save()),E(e,m),this.ctx=m,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(e),this.groupLevel++}endGroup(t){if(!this.contentVisible)return;this.groupLevel--;let e=this.ctx,r=this.groupStack.pop();if(this.ctx=r,this.ctx.imageSmoothingEnabled=!1,t.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();let t=(0,i.getCurrentTransform)(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...t);let r=n.Util.getAxialAlignedBoundingBox([0,0,e.canvas.width,e.canvas.height],t);this.ctx.drawImage(e.canvas,0,0),this.ctx.restore(),this.compose(r)}}beginAnnotation(t,e,r,s,a){if(c(this,N,U).call(this),C(this.ctx,this.foregroundColor),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),Array.isArray(e)&&4===e.length){let s=e[2]-e[0],o=e[3]-e[1];if(a&&this.annotationCanvasMap){r=r.slice(),r[4]-=e[0],r[5]-=e[1],(e=e.slice())[0]=e[1]=0,e[2]=s,e[3]=o;let[a,l]=n.Util.singularValueDecompose2dScale((0,i.getCurrentTransform)(this.ctx)),{viewportScale:h}=this,c=Math.ceil(s*this.outputScaleX*h),d=Math.ceil(o*this.outputScaleY*h);this.annotationCanvas=this.canvasFactory.create(c,d);let{canvas:u,context:p}=this.annotationCanvas;this.annotationCanvasMap.set(t,u),this.annotationCanvas.savedCtx=this.ctx,this.ctx=p,this.ctx.setTransform(a,0,0,-l,0,o*l),C(this.ctx,this.foregroundColor)}else C(this.ctx,this.foregroundColor),this.ctx.rect(e[0],e[1],s,o),this.ctx.clip(),this.endPath()}this.current=new S(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...r),this.transform(...s)}endAnnotation(){this.annotationCanvas&&(this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(t){if(!this.contentVisible)return;let e=t.count;(t=this.getObject(t.data,t)).count=e;let r=this.ctx,i=this.processingType3;if(i&&(void 0===i.compiled&&(i.compiled=_(t)),i.compiled)){i.compiled(r);return}let n=this._createMaskCanvas(t),s=n.canvas;r.save(),r.setTransform(1,0,0,1,0,0),r.drawImage(s,n.offsetX,n.offsetY),r.restore(),this.compose()}paintImageMaskXObjectRepeat(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0;if(!this.contentVisible)return;t=this.getObject(t.data,t);let l=this.ctx;l.save();let h=(0,i.getCurrentTransform)(l);l.transform(e,r,s,a,0,0);let c=this._createMaskCanvas(t);l.setTransform(1,0,0,1,0,0);for(let t=0,i=o.length;t<i;t+=2){let i=n.Util.transform(h,[e,r,s,a,o[t],o[t+1]]),[d,u]=n.Util.applyTransform([0,0],i);l.drawImage(c.canvas,d,u)}
2l.restore(),this.compose()}paintImageMaskXObjectGroup(t){if(!this.contentVisible)return;let e=this.ctx,r=this.current.fillColor,n=this.current.patternFill;for(let a of t){let{data:t,width:o,height:l,transform:h}=a,c=this.cachedCanvases.getCanvas("maskCanvas",o,l),d=c.context;d.save(),w(d,this.getObject(t,a)),d.globalCompositeOperation="source-in",d.fillStyle=n?r.getPattern(d,this,(0,i.getCurrentTransformInverse)(e),s.PathType.FILL):r,d.fillRect(0,0,o,l),d.restore(),e.save(),e.transform(...h),e.scale(1,-1),A(e,c.canvas,0,0,o,l,0,-1,1,1),e.restore()}this.compose()}paintImageXObject(t){if(!this.contentVisible)return;let e=this.getObject(t);if(!e){(0,n.warn)("Dependent image isn't ready yet");return}this.paintInlineImageXObject(e)}paintImageXObjectRepeat(t,e,r,i){if(!this.contentVisible)return;let s=this.getObject(t);if(!s){(0,n.warn)("Dependent image isn't ready yet");return}let a=s.width,o=s.height,l=[];for(let t=0,n=i.length;t<n;t+=2)l.push({transform:[e,0,0,r,i[t],i[t+1]],x:0,y:0,w:a,h:o});this.paintInlineImageXObjectGroup(s,l)}paintInlineImageXObject(t){let e;if(!this.contentVisible)return;let r=t.width,s=t.height,a=this.ctx;if(this.save(),a.scale(1/r,-1/s),"function"==typeof HTMLElement&&t instanceof HTMLElement||!t.data)e=t;else{let i=this.cachedCanvases.getCanvas("inlineImage",r,s);x(i.context,t,this.current.transferMaps),e=i.canvas}let o=this._scaleImage(e,(0,i.getCurrentTransformInverse)(a));a.imageSmoothingEnabled=F((0,i.getCurrentTransform)(a),t.interpolate);let[l,h]=A(a,o.img,0,0,o.paintWidth,o.paintHeight,0,-s,r,s);if(this.imageLayer){let[e,r]=n.Util.applyTransform([0,-s],(0,i.getCurrentTransform)(this.ctx));this.imageLayer.appendImage({imgData:t,left:e,top:r,width:l,height:h})}this.compose(),this.restore()}paintInlineImageXObjectGroup(t,e){if(!this.contentVisible)return;let r=this.ctx,s=t.width,a=t.height,o=this.cachedCanvases.getCanvas("inlineImage",s,a);for(let l of(x(o.context,t,this.current.transferMaps),e)){if(r.save(),r.transform(...l.transform),r.scale(1,-1),A(r,o.canvas,l.x,l.y,l.w,l.h,0,-1,1,1),this.imageLayer){let[e,r]=n.Util.applyTransform([l.x,l.y],(0,i.getCurrentTransform)(this.ctx));this.imageLayer.appendImage({imgData:t,left:e,top:r,width:s,height:a})}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){let e=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(t);let r=this.ctx;this.pendingClip&&(e||(this.pendingClip===L?r.clip("evenodd"):r.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),r.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){let t=(0,i.getCurrentTransform)(this.ctx);if(0===t[1]&&0===t[2])this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{let e=Math.abs(t[0]*t[3]-t[2]*t[1]),r=Math.hypot(t[0],t[2]),i=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(r,i)/e}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(!this._cachedScaleForStroking){let t,e;let{lineWidth:r}=this.current,n=(0,i.getCurrentTransform)(this.ctx);if(0===n[1]&&0===n[2]){let i=Math.abs(n[0]),s=Math.abs(n[3]);if(0===r)t=1/i,e=1/s;else{let n=i*r,a=s*r;t=n<1?1/n:1,e=a<1?1/a:1}}else{let i=Math.abs(n[0]*n[3]-n[2]*n[1]),s=Math.hypot(n[0],n[1]),a=Math.hypot(n[2],n[3]);if(0===r)t=a/i,e=s/i;else{let n=r*i;t=a>n?a/n:1,e=s>n?s/n:1}}this._cachedScaleForStroking=[t,e]}return this._cachedScaleForStroking}rescaleAndStroke(t){let e,r,n;let{ctx:s}=this,{lineWidth:a}=this.current,[o,l]=this.getScaleForStroking();if(s.lineWidth=a||1,1===o&&1===l){s.stroke();return}t&&(e=(0,i.getCurrentTransform)(s),r=s.getLineDash().slice(),n=s.lineDashOffset),s.scale(o,l);let h=Math.max(o,l);s.setLineDash(s.getLineDash().map(t=>t/h)),s.lineDashOffset/=h,s.stroke(),t&&(s.setTransform(...e),s.setLineDash(r),s.lineDashOffset=n)}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}function U(){for(;this.stateStack.length||this.inSMaskMode;
2)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)}for(let t in e.CanvasGraphics=j,n.OPS)void 0!==j.prototype[t]&&(j.prototype[n.OPS[t]]=j.prototype[t])},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TilingPattern=e.PathType=void 0,e.getShadingPattern=f;var i=r(1),n=r(133),s=r(3);let a={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function o(t,e){if(!e||s.isNodeJS)return;let r=e[2]-e[0],i=e[3]-e[1],n=new Path2D;n.rect(e[0],e[1],r,i),t.clip(n)}e.PathType=a;class l{constructor(){this.constructor===l&&(0,i.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,i.unreachable)("Abstract method `getPattern` called.")}}class h extends l{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;for(let r of("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)),this._colorStops))e.addColorStop(r[0],r[1]);return e}getPattern(t,e,r,s){let l;if(s===a.STROKE||s===a.FILL){let a=e.current.getClippedPathBoundingBox(s,(0,n.getCurrentTransform)(t))||[0,0,0,0],h=Math.ceil(a[2]-a[0])||1,c=Math.ceil(a[3]-a[1])||1,d=e.cachedCanvases.getCanvas("pattern",h,c,!0),u=d.context;u.clearRect(0,0,u.canvas.width,u.canvas.height),u.beginPath(),u.rect(0,0,u.canvas.width,u.canvas.height),u.translate(-a[0],-a[1]),r=i.Util.transform(r,[1,0,0,1,a[0],a[1]]),u.transform(...e.baseTransform),this.matrix&&u.transform(...this.matrix),o(u,this._bbox),u.fillStyle=this._createGradient(u),u.fill(),l=t.createPattern(d.canvas,"no-repeat");let p=new DOMMatrix(r);try{l.setTransform(p)}catch(t){(0,i.warn)(`RadialAxialShadingPattern.getPattern: "${null==t?void 0:t.message}".`)}}else o(t,this._bbox),l=this._createGradient(t);return l}}function c(t,e,r,i,n,s,a,o){let l,h,c,d,u,p,f,g,m;let v=e.coords,b=e.colors,y=t.data,A=4*t.width;v[r+1]>v[i+1]&&(l=r,r=i,i=l,l=s,s=a,a=l),v[i+1]>v[n+1]&&(l=i,i=n,n=l,l=a,a=o,o=l),v[r+1]>v[i+1]&&(l=r,r=i,i=l,l=s,s=a,a=l);let _=(v[r]+e.offsetX)*e.scaleX,S=(v[r+1]+e.offsetY)*e.scaleY,x=(v[i]+e.offsetX)*e.scaleX,w=(v[i+1]+e.offsetY)*e.scaleY,E=(v[n]+e.offsetX)*e.scaleX,C=(v[n+1]+e.offsetY)*e.scaleY;if(S>=C)return;let T=b[s],k=b[s+1],P=b[s+2],M=b[a],R=b[a+1],F=b[a+2],O=b[o],I=b[o+1],D=b[o+2],L=Math.round(S),N=Math.round(C);for(let t=L;t<=N;t++){let e;if(t<w){let e;h=_-(_-x)*(e=t<S?0:(S-t)/(S-w)),c=T-(T-M)*e,d=k-(k-R)*e,u=P-(P-F)*e}else{let e;h=x-(x-E)*(e=t>C?1:w===C?0:(w-t)/(w-C)),c=M-(M-O)*e,d=R-(R-I)*e,u=F-(F-D)*e}p=_-(_-E)*(e=t<S?0:t>C?1:(S-t)/(S-C)),f=T-(T-O)*e,g=k-(k-I)*e,m=P-(P-D)*e;let r=Math.round(Math.min(h,p)),i=Math.round(Math.max(h,p)),n=A*t+4*r;for(let t=r;t<=i;t++)(e=(h-t)/(h-p))<0?e=0:e>1&&(e=1),y[n++]=c-(c-f)*e|0,y[n++]=d-(d-g)*e|0,y[n++]=u-(u-m)*e|0,y[n++]=255}}function d(t,e,r){let i,n;let s=e.coords,a=e.colors;switch(e.type){case"lattice":let o=e.verticesPerRow,l=Math.floor(s.length/o)-1,h=o-1;for(i=0;i<l;i++){let e=i*o;for(let i=0;i<h;i++,e++)c(t,r,s[e],s[e+1],s[e+o],a[e],a[e+1],a[e+o]),c(t,r,s[e+o+1],s[e+1],s[e+o],a[e+o+1],a[e+1],a[e+o])}break;case"triangles":for(i=0,n=s.length;i<n;i+=3)c(t,r,s[i],s[i+1],s[i+2],a[i],a[i+1],a[i+2]);break;default:throw Error("illegal figure")}}class u extends l{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,e,r){let i=1.1,n=3e3,s=2,a=Math.floor(this._bounds[0]),o=Math.floor(this._bounds[1]),l=Math.ceil(this._bounds[2])-a,h=Math.ceil(this._bounds[3])-o,c=Math.min(Math.ceil(Math.abs(l*t[0]*i)),n),u=Math.min(Math.ceil(Math.abs(h*t[1]*i)),n),p=l/c,f=h/u,g={coords:this._coords,colors:this._colors,offsetX:-a,offsetY:-o,scaleX:1/p,scaleY:1/f},m=c+2*s,v=u+2*s,b=r.getCanvas("mesh",m,v,!1),y=b.context,A=y.createImageData(c,u);if(e){let t=A.data;for(let r=0,i=t.length;r<i;r+=4)t[r]=e[0],t[r+1]=e[1],t[r+2]=e[2],t[r+3]=255}for(let t of this._figures)d(A,t,g);return y.putImageData(A,s,s),{canvas:b.canvas,offsetX:a-s*p,offsetY:o-s*f,scaleX:p,scaleY:f}}getPattern(t,e,r,s){let l;if(o(t,this._bbox),s===a.SHADING)l=i.Util.singularValueDecompose2dScale((0,n.getCurrentTransform)(t));else if(l=i.Util.singularValueDecompose2dScale(e.baseTransform),this.matrix
2){let t=i.Util.singularValueDecompose2dScale(this.matrix);l=[l[0]*t[0],l[1]*t[1]]}let h=this._createMeshCanvas(l,s===a.SHADING?null:this._background,e.cachedCanvases);return s!==a.SHADING&&(t.setTransform(...e.baseTransform),this.matrix&&t.transform(...this.matrix)),t.translate(h.offsetX,h.offsetY),t.scale(h.scaleX,h.scaleY),t.createPattern(h.canvas,"no-repeat")}}class p extends l{getPattern(){return"hotpink"}}function f(t){switch(t[0]){case"RadialAxial":return new h(t);case"Mesh":return new u(t);case"Dummy":return new p}throw Error(`Unknown IR type: ${t[0]}`)}let g={COLORED:1,UNCOLORED:2};class m{static get MAX_PATTERN_SIZE(){return(0,i.shadow)(this,"MAX_PATTERN_SIZE",3e3)}constructor(t,e,r,i,n){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=i,this.baseTransform=n}createPatternCanvas(t){let e=this.operatorList,r=this.bbox,s=this.xstep,a=this.ystep,o=this.paintType,l=this.tilingType,h=this.color,c=this.canvasGraphicsFactory;(0,i.info)("TilingType: "+l);let d=r[0],u=r[1],p=r[2],f=r[3],g=i.Util.singularValueDecompose2dScale(this.matrix),m=i.Util.singularValueDecompose2dScale(this.baseTransform),v=[g[0]*m[0],g[1]*m[1]],b=this.getSizeAndScale(s,this.ctx.canvas.width,v[0]),y=this.getSizeAndScale(a,this.ctx.canvas.height,v[1]),A=t.cachedCanvases.getCanvas("pattern",b.size,y.size,!0),_=A.context,S=c.createCanvasGraphics(_);S.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(S,o,h);let x=d,w=u,E=p,C=f;return d<0&&(x=0,E+=Math.abs(d)),u<0&&(w=0,C+=Math.abs(u)),_.translate(-(b.scale*x),-(y.scale*w)),S.transform(b.scale,0,0,y.scale,0,0),_.save(),this.clipBbox(S,x,w,E,C),S.baseTransform=(0,n.getCurrentTransform)(S.ctx),S.executeOperatorList(e),S.endDrawing(),{canvas:A.canvas,scaleX:b.scale,scaleY:y.scale,offsetX:x,offsetY:w}}getSizeAndScale(t,e,r){t=Math.abs(t);let i=Math.max(m.MAX_PATTERN_SIZE,e),n=Math.ceil(t*r);return n>=i?n=i:r=n/t,{scale:r,size:n}}clipBbox(t,e,r,i,s){let a=i-e,o=s-r;t.ctx.rect(e,r,a,o),t.current.updateRectMinMax((0,n.getCurrentTransform)(t.ctx),[e,r,i,s]),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,e,r){let n=t.ctx,s=t.current;switch(e){case g.COLORED:let a=this.ctx;n.fillStyle=a.fillStyle,n.strokeStyle=a.strokeStyle,s.fillColor=a.fillStyle,s.strokeColor=a.strokeStyle;break;case g.UNCOLORED:let o=i.Util.makeHexColor(r[0],r[1],r[2]);n.fillStyle=o,n.strokeStyle=o,s.fillColor=o,s.strokeColor=o;break;default:throw new i.FormatError(`Unsupported paint type: ${e}`)}}getPattern(t,e,r,n){let s=r;n!==a.SHADING&&(s=i.Util.transform(s,e.baseTransform),this.matrix&&(s=i.Util.transform(s,this.matrix)));let o=this.createPatternCanvas(e),l=new DOMMatrix(s);l=(l=l.translate(o.offsetX,o.offsetY)).scale(1/o.scaleX,1/o.scaleY);let h=t.createPattern(o.canvas,"repeat");try{h.setTransform(l)}catch(t){(0,i.warn)(`TilingPattern.getPattern: "${null==t?void 0:t.message}".`)}return h}}e.TilingPattern=m},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.applyMaskImageData=n;var i=r(1);function n(t){let{src:e,srcPos:r=0,dest:n,destPos:s=0,width:a,height:o,inverseDecode:l=!1}=t,h=i.FeatureTest.isLittleEndian?4278190080:255,[c,d]=l?[0,h]:[h,0],u=a>>3,p=7&a,f=e.length;n=new Uint32Array(n.buffer);for(let t=0;t<o;t++){for(let t=r+u;r<t;r++){let t=r<f?e[r]:255;n[s++]=128&t?d:c,n[s++]=64&t?d:c,n[s++]=32&t?d:c,n[s++]=16&t?d:c,n[s++]=8&t?d:c,n[s++]=4&t?d:c,n[s++]=2&t?d:c,n[s++]=1&t?d:c}if(0===p)continue;let t=r<f?e[r++]:255;for(let e=0;e<p;e++)n[s++]=t&1<<7-e?d:c}return{srcPos:r,destPos:s}}},(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GlobalWorkerOptions=void 0;let r=Object.create(null);e.GlobalWorkerOptions=r,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 i=r(1);let n={DATA:1,ERROR:2},s={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function a(t){switch(t instanceof Error||"object"==typeof t&&null!==t||(0,i.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new i.AbortException(t.message);case"MissingPDFException":return new i.MissingPDFException(t.message);case"PasswordException":return new i.PasswordException(t.message,t.code);case"UnexpectedResponseException":return new i.UnexpectedResponseException(t.message,t.status);case"UnknownErrorException":return new i.UnknownErrorException(t.message,t.details);default:return new i.UnknownErrorException(t.message,t.toString())}}class o{constructor(t,e,r){this.sourceName=t,this.targetName=e,this.comObj=r,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=t=>{let e=t.data;if(e.targetName!==this.sourceName)return;if(e.stream){this._processStreamMessage(e);return}if(e.callback){let t=e.callbackId,r=this.callbackCapabilities[t];if(!r)throw Error(`Cannot resolve callback ${t}`);if(delete this.callbackCapabilities[t],e.callback===n.DATA)r.resolve(e.data);else if(e.callback===n.ERROR)r.reject(a(e.reason));else throw Error("Unexpected callback case");return}let i=this.actionHandler[e.action];if(!i)throw Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){let t=this.sourceName,s=e.sourceName;new Promise(function(t){t(i(e.data))}).then(function(i){r.postMessage({sourceName:t,targetName:s,callback:n.DATA,callbackId:e.callbackId,data:i})},function(i){r.postMessage({sourceName:t,targetName:s,callback:n.ERROR,callbackId:e.callbackId,reason:a(i)})});return}if(e.streamId){this._createStreamSink(e);return}i(e.data)},r.addEventListener("message",this._onComObjOnMessage)}on(t,e){let r=this.actionHandler;if(r[t])throw 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)}
2sendWithPromise(t,e,r){let n=this.callbackId++,s=(0,i.createPromiseCapability)();this.callbackCapabilities[n]=s;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:n,data:e},r)}catch(t){s.reject(t)}return s.promise}sendWithStream(t,e,r,n){let o=this.streamId++,l=this.sourceName,h=this.targetName,c=this.comObj;return new ReadableStream({start:r=>{let s=(0,i.createPromiseCapability)();return this.streamControllers[o]={controller:r,startCall:s,pullCall:null,cancelCall:null,isClosed:!1},c.postMessage({sourceName:l,targetName:h,action:t,streamId:o,data:e,desiredSize:r.desiredSize},n),s.promise},pull:t=>{let e=(0,i.createPromiseCapability)();return this.streamControllers[o].pullCall=e,c.postMessage({sourceName:l,targetName:h,stream:s.PULL,streamId:o,desiredSize:t.desiredSize}),e.promise},cancel:t=>{(0,i.assert)(t instanceof Error,"cancel must have a valid reason");let e=(0,i.createPromiseCapability)();return this.streamControllers[o].cancelCall=e,this.streamControllers[o].isClosed=!0,c.postMessage({sourceName:l,targetName:h,stream:s.CANCEL,streamId:o,reason:a(t)}),e.promise}},r)}_createStreamSink(t){let e=t.streamId,r=this.sourceName,n=t.sourceName,o=this.comObj,l=this,h=this.actionHandler[t.action],c={enqueue(t){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,l=arguments.length>2?arguments[2]:void 0;if(this.isCancelled)return;let h=this.desiredSize;this.desiredSize-=a,h>0&&this.desiredSize<=0&&(this.sinkCapability=(0,i.createPromiseCapability)(),this.ready=this.sinkCapability.promise),o.postMessage({sourceName:r,targetName:n,stream:s.ENQUEUE,streamId:e,chunk:t},l)},close(){this.isCancelled||(this.isCancelled=!0,o.postMessage({sourceName:r,targetName:n,stream:s.CLOSE,streamId:e}),delete l.streamSinks[e])},error(t){(0,i.assert)(t instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,o.postMessage({sourceName:r,targetName:n,stream:s.ERROR,streamId:e,reason:a(t)}))},sinkCapability:(0,i.createPromiseCapability)(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};c.sinkCapability.resolve(),c.ready=c.sinkCapability.promise,this.streamSinks[e]=c,new Promise(function(e){e(h(t.data,c))}).then(function(){o.postMessage({sourceName:r,targetName:n,stream:s.START_COMPLETE,streamId:e,success:!0})},function(t){o.postMessage({sourceName:r,targetName:n,stream:s.START_COMPLETE,streamId:e,reason:a(t)})})}_processStreamMessage(t){let e=t.streamId,r=this.sourceName,n=t.sourceName,o=this.comObj,l=this.streamControllers[e],h=this.streamSinks[e];switch(t.stream){case s.START_COMPLETE:t.success?l.startCall.resolve():l.startCall.reject(a(t.reason));break;case s.PULL_COMPLETE:t.success?l.pullCall.resolve():l.pullCall.reject(a(t.reason));break;case s.PULL:if(!h){o.postMessage({sourceName:r,targetName:n,stream:s.PULL_COMPLETE,streamId:e,success:!0});break}h.desiredSize<=0&&t.desiredSize>0&&h.sinkCapability.resolve(),h.desiredSize=t.desiredSize,new Promise(function(t){t(h.onPull&&h.onPull())}).then(function(){o.postMessage({sourceName:r,targetName:n,stream:s.PULL_COMPLETE,streamId:e,success:!0})},function(t){o.postMessage({sourceName:r,targetName:n,stream:s.PULL_COMPLETE,streamId:e,reason:a(t)})});break;case s.ENQUEUE:if((0,i.assert)(l,"enqueue should have stream controller"),l.isClosed)break;l.controller.enqueue(t.chunk);break;case s.CLOSE:if((0,i.assert)(l,"close should have stream controller"),l.isClosed)break;l.isClosed=!0,l.controller.close(),this._deleteStreamController(l,e);break;case s.ERROR:(0,i.assert)(l,"error should have stream controller"),l.controller.error(a(t.reason)),this._deleteStreamController(l,e);break;case s.CANCEL_COMPLETE:t.success?l.cancelCall.resolve():l.cancelCall.reject(a(t.reason)),this._deleteStreamController(l,e);break;case s.CANCEL:if(!h)break;new Promise(function(e){e(h.onCancel&&h.onCancel(a(t.reason)))}).then(function(){o.postMessage({sourceName:r,targetName:n,stream:s.CANCEL_COMPLETE,streamId:e,success:!0})},function(t){o.postMessage({sourceName:r,targetName:n,stream:s.CANCEL_COMPLETE,streamId:e,reason:a(t)})}),h.sinkCapability.reject(a(t.reason)),h.isCancelled=!0,delete this.streamSinks[e];break;default:throw 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)}}e.MessageHandler=o},(t,e,r)=>{"use strict";
2Object.defineProperty(e,"__esModule",{value:!0}),e.Metadata=void 0;var i=r(1);function n(t,e,r){s(t,e),e.set(t,r)}function s(t,e){if(e.has(t))throw TypeError("Cannot initialize the same private elements twice on an object")}function a(t,e){var r=h(t,e,"get");return o(t,r)}function o(t,e){return e.get?e.get.call(t):e.value}function l(t,e,r){var i=h(t,e,"set");return c(t,i,r),r}function h(t,e,r){if(!e.has(t))throw TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function c(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw TypeError("attempted to set read only private field");e.value=r}}var d=new WeakMap,u=new WeakMap;class p{constructor(t){let{parsedData:e,rawData:r}=t;n(this,d,{writable:!0,value:void 0}),n(this,u,{writable:!0,value:void 0}),l(this,d,e),l(this,u,r)}getRaw(){return a(this,u)}get(t){var e;return null!==(e=a(this,d).get(t))&&void 0!==e?e:null}getAll(){return(0,i.objectFromMap)(a(this,d))}has(t){return a(this,d).has(t)}}e.Metadata=p},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.OptionalContentConfig=void 0;var i=r(1);function n(t,e){o(t,e),e.add(t)}function s(t,e,r){if(!e.has(t))throw TypeError("attempted to get private field on non-instance");return r}function a(t,e,r){o(t,e),e.set(t,r)}function o(t,e){if(e.has(t))throw TypeError("Cannot initialize the same private elements twice on an object")}function l(t,e,r){var i=d(t,e,"set");return h(t,i,r),r}function h(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw TypeError("attempted to set read only private field");e.value=r}}function c(t,e){var r=d(t,e,"get");return u(t,r)}function d(t,e,r){if(!e.has(t))throw TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function u(t,e){return e.get?e.get.call(t):e.value}let p=Symbol("INTERNAL");var f=new WeakMap;class g{constructor(t,e){a(this,f,{writable:!0,value:!0}),this.name=t,this.intent=e}get visible(){return c(this,f)}_setVisible(t,e){t!==p&&(0,i.unreachable)("Internal method `_setVisible` called."),l(this,f,e)}}var m=new WeakMap,v=new WeakMap,b=new WeakMap,y=new WeakMap,A=new WeakSet;class _{constructor(t){if(n(this,A),a(this,m,{writable:!0,value:!0}),a(this,v,{writable:!0,value:new Map}),a(this,b,{writable:!0,value:null}),a(this,y,{writable:!0,value:null}),this.name=null,this.creator=null,null===t)return;for(let e of(this.name=t.name,this.creator=t.creator,l(this,y,t.order),t.groups))c(this,v).set(e.id,new g(e.name,e.intent));if("OFF"===t.baseState)for(let t of c(this,v).values())t._setVisible(p,!1);for(let e of t.on)c(this,v).get(e)._setVisible(p,!0);for(let e of t.off)c(this,v).get(e)._setVisible(p,!1);for(let[t,e]of(l(this,b,new Map),c(this,v)))c(this,b).set(t,e.visible)}isVisible(t){if(0===c(this,v).size)return!0;if(!t)return(0,i.warn)("Optional content group not defined."),!0;if("OCG"===t.type)return c(this,v).has(t.id)?c(this,v).get(t.id).visible:((0,i.warn)(`Optional content group not found: ${t.id}`),!0);if("OCMD"===t.type){if(t.expression)return s(this,A,S).call(this,t.expression);if(t.policy&&"AnyOn"!==t.policy){if("AllOn"===t.policy){for(let e of t.ids){if(!c(this,v).has(e)){(0,i.warn)(`Optional content group not found: ${e}`);break}if(!c(this,v).get(e).visible)return!1}return!0}if("AnyOff"===t.policy){for(let e of t.ids){if(!c(this,v).has(e))return(0,i.warn)(`Optional content group not found: ${e}`),!0;if(!c(this,v).get(e).visible)return!0}return!1}if("AllOff"===t.policy){for(let e of t.ids){if(!c(this,v).has(e)){(0,i.warn)(`Optional content group not found: ${e}`);break}if(c(this,v).get(e).visible)return!1}return!0}}else{for(let e of t.ids){if(!c(this,v).has(e))return(0,i.warn)(`Optional content group not found: ${e}`),!0;if(c(this,v).get(e).visible)return!0}return!1}return(0,i.warn)(`Unknown optional content policy ${t.policy}.`),!0}return(0,i.warn)(`Unknown group type ${t.type}.`),!0}setVisibility(t){let e=!(arguments.length>1)||void 0===arguments[1]||arguments[1];if(!c(this,v).has(t)){(0,i.warn)(`Optional content group not found: ${t}`);return}c(this,v).get(t)._setVisible(p,!!e),l(this,m,null)}get hasInitialVisibility(){if(null!==c(this,m))return c(this,m);for(let[t,e]of c(this,v)){let r=c(this,b).get(t);if(e.visible!==r)return l(this,m,!1)}return l(this,m,!0)}getOrder(){return c(this,v).size?c(this,y)?c(this,y).slice():[...c(this,v).keys()]:null}getGroups(){return c(this,v).size>0?(0,i.objectFromMap)(c(this,v)):null}getGroup(t){return c(this,v).get(t)||null}}function S(t){let e=t.length;if(e<2)return!0;let r=t[0];for(let n=1;n<e;n++){let e;let a=t[n];if(Array.isArray(a))e=s(this,A,S).call(this,a);else{if(!c(this,v).has(a))return(0,i.warn)(`Optional content group not found: ${a}`),!0;e=c(this,v).get(a).visible}switch(r){case"And":if(!e)return!1;break;case"Or":if(e)return!0;break;case"Not":return!e;default:return!0}}return"And"===r}e.OptionalContentConfig=_},(t,e,r)=>{"use strict";
2Object.defineProperty(e,"__esModule",{value:!0}),e.PDFDataTransportStream=void 0;var i=r(1),n=r(133);class s{constructor(t,e){(0,i.assert)(e,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=t.progressiveDone||!1,this._contentDispositionFilename=t.contentDispositionFilename||null;let r=t.initialData;if((null==r?void 0:r.length)>0){let t=new Uint8Array(r).buffer;this._queuedChunks.push(t)}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(t){let e=new Uint8Array(t.chunk).buffer;if(void 0===t.begin)this._fullRequestReader?this._fullRequestReader._enqueue(e):this._queuedChunks.push(e);else{let r=this._rangeReaders.some(function(r){return r._begin===t.begin&&(r._enqueue(e),!0)});(0,i.assert)(r,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var t,e;return null!==(t=null===(e=this._fullRequestReader)||void 0===e?void 0:e._loaded)&&void 0!==t?t:0}_onProgress(t){if(void 0===t.total){let e=this._rangeReaders[0];null!=e&&e.onProgress&&e.onProgress({loaded:t.loaded})}else{let e=this._fullRequestReader;null!=e&&e.onProgress&&e.onProgress({loaded:t.loaded,total:t.total})}}_onProgressiveDone(){this._fullRequestReader&&this._fullRequestReader.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){let e=this._rangeReaders.indexOf(t);e>=0&&this._rangeReaders.splice(e,1)}getFullReader(){(0,i.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");let t=this._queuedChunks;return this._queuedChunks=null,new a(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;let r=new o(this,t,e);return this._pdfDataRangeTransport.requestDataRange(t,e),this._rangeReaders.push(r),r}cancelAllRequests(t){for(let e of(this._fullRequestReader&&this._fullRequestReader.cancel(t),this._rangeReaders.slice(0)))e.cancel(t);this._pdfDataRangeTransport.abort()}}e.PDFDataTransportStream=s;class a{constructor(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;for(let s of(this._stream=t,this._done=r||!1,this._filename=(0,n.isPdfFile)(i)?i:null,this._queuedChunks=e||[],this._loaded=0,this._queuedChunks))this._loaded+=s.byteLength;this._requests=[],this._headersReady=Promise.resolve(),t._fullRequestReader=this,this.onProgress=null}_enqueue(t){this._done||(this._requests.length>0?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(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};let t=(0,i.createPromiseCapability)();return this._requests.push(t),t.promise}cancel(t){for(let t of(this._done=!0,this._requests))t.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class o{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{for(let e of(this._requests.shift().resolve({value:t,done:!1}),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(){if(this._queuedChunk){let t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};let t=(0,i.createPromiseCapability)();return this._requests.push(t),t.promise}cancel(t){for(let t of(this._done=!0,this._requests))t.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}},(t,e)=>{"use strict";
2Object.defineProperty(e,"__esModule",{value:!0}),e.XfaText=void 0;class r{static textContent(t){let e=[],i={items:e,styles:Object.create(null)};function n(t){var i;if(!t)return;let s=null,a=t.name;if("#text"===a)s=t.value;else{if(!r.shouldBuildText(a))return;null!=t&&null!==(i=t.attributes)&&void 0!==i&&i.textContent?s=t.attributes.textContent:t.value&&(s=t.value)}if(null!==s&&e.push({str:s}),t.children)for(let e of t.children)n(e)}return n(t),i}static shouldBuildText(t){return!("textarea"===t||"input"===t||"option"===t||"select"===t)}}e.XfaText=r},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NodeStandardFontDataFactory=e.NodeCanvasFactory=e.NodeCMapReaderFactory=void 0;var i=r(134);let n=function(t){return new Promise((e,r)=>{__webpack_require__(64160).readFile(t,(t,i)=>{if(t||!i){r(Error(t));return}e(new Uint8Array(i))})})};class s extends i.BaseCanvasFactory{_createCanvas(t,e){return __webpack_require__(44505).createCanvas(t,e)}}e.NodeCanvasFactory=s;class a extends i.BaseCMapReaderFactory{_fetchData(t,e){return n(t).then(t=>({cMapData:t,compressionType:e}))}}e.NodeCMapReaderFactory=a;class o extends i.BaseStandardFontDataFactory{_fetchData(t){return n(t)}}e.NodeStandardFontDataFactory=o},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AnnotationEditorLayer=void 0;var i=r(132),n=r(1),s=r(148),a=r(149);function o(t,e){c(t,e),e.add(t)}function l(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function h(t,e,r){c(t,e),e.set(t,r)}function c(t,e){if(e.has(t))throw TypeError("Cannot initialize the same private elements twice on an object")}function d(t,e,r){if(!e.has(t))throw TypeError("attempted to get private field on non-instance");return r}function u(t,e){var r=g(t,e,"get");return p(t,r)}function p(t,e){return e.get?e.get.call(t):e.value}function f(t,e,r){var i=g(t,e,"set");return m(t,i,r),r}function g(t,e,r){if(!e.has(t))throw TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function m(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw TypeError("attempted to set read only private field");e.value=r}}var v=new WeakMap,b=new WeakMap,y=new WeakMap,A=new WeakMap,_=new WeakMap,S=new WeakMap,x=new WeakMap,w=new WeakMap,E=new WeakSet,C=new WeakSet,T=new WeakSet,k=new WeakSet;class P{constructor(t){o(this,k),o(this,T),o(this,C),o(this,E),h(this,v,{writable:!0,value:void 0}),h(this,b,{writable:!0,value:!1}),h(this,y,{writable:!0,value:this.pointerup.bind(this)}),h(this,A,{writable:!0,value:this.pointerdown.bind(this)}),h(this,_,{writable:!0,value:new Map}),h(this,S,{writable:!0,value:!1}),h(this,x,{writable:!0,value:!1}),h(this,w,{writable:!0,value:void 0}),P._initialized||(P._initialized=!0,s.FreeTextEditor.initialize(t.l10n),a.InkEditor.initialize(t.l10n),t.uiManager.registerEditorTypes([s.FreeTextEditor,a.InkEditor])),f(this,w,t.uiManager),this.annotationStorage=t.annotationStorage,this.pageIndex=t.pageIndex,this.div=t.div,f(this,v,t.accessibilityManager),u(this,w).addLayer(this)}updateToolbar(t){u(this,w).updateToolbar(t)}updateMode(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u(this,w).getMode();d(this,k,O).call(this),t===n.AnnotationEditorType.INK?(this.addInkEditorIfNeeded(!1),this.disableClick()):this.enableClick(),u(this,w).unselectAll()}addInkEditorIfNeeded(t){if(t||u(this,w).getMode()===n.AnnotationEditorType.INK){if(!t){for(let t of u(this,_).values())if(t.isEmpty()){t.setInBackground();return}}d(this,T,F).call(this,{offsetX:0,offsetY:0}).setInBackground()}}setEditingState(t){u(this,w).setEditingState(t)}addCommands(t){u(this,w).addCommands(t)}enable(){for(let t of(this.div.style.pointerEvents="auto",u(this,_).values()))t.enableEditing()}disable(){for(let t of(this.div.style.pointerEvents="none",u(this,_).values()))t.disableEditing()}setActiveEditor(t){u(this,w).getActive()!==t&&u(this,w).setActiveEditor(t)}enableClick(){this.div.addEventListener("pointerdown",u(this,A)),this.div.addEventListener("pointerup",u(this,y))}disableClick(){this.div.removeEventListener("pointerdown",u(this,A)),this.div.removeEventListener("pointerup",u(this,y))}attach(t){u(this,_).set(t.id,t)}detach(t){var e;u(this,_).delete(t.id),null===(e=u(this,v))||void 0===e||e.removePointerInTextLayer(t.contentDiv)}remove(t){u(this,w).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&&u(this,w).focusMainContainer()}
2,0),u(this,x)||this.addInkEditorIfNeeded(!1)}add(t){if(d(this,E,M).call(this,t),u(this,w).addEditor(t),this.attach(t),!t.isAttachedToDOM){let e=t.render();this.div.append(e),t.isAttachedToDOM=!0}this.moveEditorInDOM(t),t.onceAdded(),this.addToAnnotationStorage(t)}moveEditorInDOM(t){var e;null===(e=u(this,v))||void 0===e||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){let e=()=>{this.addOrRebuild(t)},r=()=>{t.remove()};this.addCommands({cmd:e,undo:r,mustExec:!0})}addUndoableEditor(t){let e=()=>{this.addOrRebuild(t)},r=()=>{t.remove()};this.addCommands({cmd:e,undo:r,mustExec:!1})}getNextId(){return u(this,w).getId()}deserialize(t){switch(t.annotationType){case n.AnnotationEditorType.FREETEXT:return s.FreeTextEditor.deserialize(t,this);case n.AnnotationEditorType.INK:return a.InkEditor.deserialize(t,this)}return null}setSelected(t){u(this,w).setSelected(t)}toggleSelected(t){u(this,w).toggleSelected(t)}isSelected(t){return u(this,w).isSelected(t)}unselect(t){u(this,w).unselect(t)}pointerup(t){let e=i.KeyboardManager.platform.isMac;if(0===t.button&&(!t.ctrlKey||!e)&&t.target===this.div&&u(this,S)){if(f(this,S,!1),!u(this,b)){f(this,b,!0);return}d(this,T,F).call(this,t)}}pointerdown(t){let e=i.KeyboardManager.platform.isMac;if(0!==t.button||t.ctrlKey&&e||t.target!==this.div)return;f(this,S,!0);let r=u(this,w).getActive();f(this,b,!r||r.isEmpty())}drop(t){let e=t.dataTransfer.getData("text/plain"),r=u(this,w).getEditor(e);if(!r)return;t.preventDefault(),t.dataTransfer.dropEffect="move",d(this,E,M).call(this,r);let i=this.div.getBoundingClientRect(),n=t.clientX-i.x,s=t.clientY-i.y;r.translate(n-r.startX,s-r.startY),this.moveEditorInDOM(r),r.div.focus()}dragover(t){t.preventDefault()}destroy(){var t,e;for(let r of((null===(t=u(this,w).getActive())||void 0===t?void 0:t.parent)===this&&u(this,w).setActiveEditor(null),u(this,_).values()))null===(e=u(this,v))||void 0===e||e.removePointerInTextLayer(r.contentDiv),r.isAttachedToDOM=!1,r.div.remove(),r.parent=null;this.div=null,u(this,_).clear(),u(this,w).removeLayer(this)}render(t){for(let e of(this.viewport=t.viewport,(0,i.bindEvents)(this,this.div,["dragover","drop"]),this.setDimensions(),u(this,w).getEditors(this.pageIndex)))this.add(e);this.updateMode()}update(t){this.viewport=t.viewport,this.setDimensions(),this.updateMode()}get scaleFactor(){return this.viewport.scale}get pageDimensions(){let[t,e,r,i]=this.viewport.viewBox;return[r-t,i-e]}get viewportBaseDimensions(){let{width:t,height:e,rotation:r}=this.viewport;return r%180==0?[t,e]:[e,t]}setDimensions(){let{width:t,height:e,rotation:r}=this.viewport,i=r%180!=0,n=Math.floor(t)+"px",s=Math.floor(e)+"px";this.div.style.width=i?s:n,this.div.style.height=i?n:s,this.div.setAttribute("data-main-rotation",r)}}function M(t){var e;t.parent!==this&&(this.attach(t),t.pageIndex=this.pageIndex,null===(e=t.parent)||void 0===e||e.detach(t),t.parent=this,t.div&&t.isAttachedToDOM&&(t.div.remove(),this.div.append(t.div)))}function R(t){switch(u(this,w).getMode()){case n.AnnotationEditorType.FREETEXT:return new s.FreeTextEditor(t);case n.AnnotationEditorType.INK:return new a.InkEditor(t)}return null}function F(t){let e=this.getNextId(),r=d(this,C,R).call(this,{parent:this,id:e,x:t.offsetX,y:t.offsetY});return r&&this.add(r),r}function O(){for(let t of(f(this,x,!0),u(this,_).values()))t.isEmpty()&&t.remove();f(this,x,!1)}e.AnnotationEditorLayer=P,l(P,"_initialized",!1)},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FreeTextEditor=void 0;var i=r(1),n=r(132),s=r(131);function a(t,e){h(t,e),e.add(t)}function o(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function l(t,e,r){h(t,e),e.set(t,r)}function h(t,e){if(e.has(t))throw TypeError("Cannot initialize the same private elements twice on an object")}function c(t,e){var r=f(t,e,"get");return d(t,r)}function d(t,e){return e.get?e.get.call(t):e.value}function u(t,e,r){if(!e.has(t))throw TypeError("attempted to get private field on non-instance");return r}function p(t,e,r){var i=f(t,e,"set");
2return g(t,i,r),r}function f(t,e,r){if(!e.has(t))throw TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function g(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw TypeError("attempted to set read only private field");e.value=r}}var m=new WeakMap,v=new WeakMap,b=new WeakMap,y=new WeakMap,A=new WeakMap,_=new WeakMap,S=new WeakMap,x=new WeakSet,w=new WeakSet,E=new WeakSet,C=new WeakSet;class T extends s.AnnotationEditor{constructor(t){super({...t,name:"freeTextEditor"}),a(this,C),a(this,E),a(this,w),a(this,x),l(this,m,{writable:!0,value:this.editorDivBlur.bind(this)}),l(this,v,{writable:!0,value:this.editorDivFocus.bind(this)}),l(this,b,{writable:!0,value:this.editorDivKeydown.bind(this)}),l(this,y,{writable:!0,value:void 0}),l(this,A,{writable:!0,value:""}),l(this,_,{writable:!0,value:!1}),l(this,S,{writable:!0,value:void 0}),p(this,y,t.color||T._defaultColor||s.AnnotationEditor._defaultLineColor),p(this,S,t.fontSize||T._defaultFontSize)}static initialize(t){this._l10nPromise=new Map(["free_text_default_content","editor_free_text_aria_label"].map(e=>[e,t.get(e)]));let e=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(e.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,e){switch(t){case i.AnnotationEditorParamsType.FREETEXT_SIZE:T._defaultFontSize=e;break;case i.AnnotationEditorParamsType.FREETEXT_COLOR:T._defaultColor=e}}updateParams(t,e){switch(t){case i.AnnotationEditorParamsType.FREETEXT_SIZE:u(this,x,k).call(this,e);break;case i.AnnotationEditorParamsType.FREETEXT_COLOR:u(this,w,P).call(this,e)}}static get defaultPropertiesToUpdate(){return[[i.AnnotationEditorParamsType.FREETEXT_SIZE,T._defaultFontSize],[i.AnnotationEditorParamsType.FREETEXT_COLOR,T._defaultColor||s.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[i.AnnotationEditorParamsType.FREETEXT_SIZE,c(this,S)],[i.AnnotationEditorParamsType.FREETEXT_COLOR,c(this,y)]]}getInitialTranslation(){return[-T._internalPadding*this.parent.scaleFactor,-(T._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(i.AnnotationEditorType.FREETEXT),super.enableEditMode(),this.enableEditing(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this.div.draggable=!1,this.editorDiv.addEventListener("keydown",c(this,b)),this.editorDiv.addEventListener("focus",c(this,v)),this.editorDiv.addEventListener("blur",c(this,m)))}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.disableEditing(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.draggable=!0,this.editorDiv.removeEventListener("keydown",c(this,b)),this.editorDiv.removeEventListener("focus",c(this,v)),this.editorDiv.removeEventListener("blur",c(this,m)),this.div.focus(),this.isEditing=!1)}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),super.remove()}commit(){super.commit(),c(this,_)||(p(this,_,!0),this.parent.addUndoableEditor(this)),this.disableEditMode(),p(this,A,u(this,E,M).call(this).trimEnd()),u(this,C,R).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){T._keyboardManager.exec(this,t)}editorDivFocus(t){this.isEditing=!0}editorDivBlur(t){this.isEditing=!1}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){let t,e;if(this.div)return this.div;this.width&&(t=this.x,e=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",`${this.id}-editor`),this.enableEditing(),T._l10nPromise.get("editor_free_text_aria_label").then(t=>{var e;return null===(e=this.editorDiv)||void 0===e?void 0:e.setAttribute("aria-label",t)}),T._l10nPromise.get("free_text_default_content").then(t=>{var e;return null===(e=this.editorDiv)||void 0===e?void 0:e.setAttribute("default-content",t)}),this.editorDiv.contentEditable=!0;let{style:r}=this.editorDiv;if(r.fontSize=`calc(${c(this,S)}px * var(--scale-factor))`,r.color=c(this,y),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){let[r,i]=this.parent.viewportBaseDimensions;for(let n of(this.setAt(t*r,e*i,this.width*r,this.height*i),c(this,A).split("\n"))){let t=document.createElement("div");t.append(n?document.createTextNode(n):document.createElement("br")),this.editorDiv.append(t)}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){let r=super.deserialize(t,e);return p(r,S,t.fontSize),p(r,y,i.Util.makeHexColor(...t.color)),p(r,A,t.value),r}serialize(){if(this.isEmpty())return null;let t=T._internalPadding*this.parent.scaleFactor,e=this.getRect(t,t),r=s.AnnotationEditor._colorManager.convert(getComputedStyle(this.editorDiv).color);return{annotationType:i.AnnotationEditorType.FREETEXT,color:r,fontSize:c(this,S),value:c(this,A),pageIndex:this.parent.pageIndex,rect:e,rotation:this.rotation}}}function k(t){let e=t=>{this.editorDiv.style.fontSize=`calc(${t}px * var(--scale-factor))`,this.translate(0,-(t-c(this,S))*this.parent.scaleFactor),p(this,S,t),u(this,C,R).call(this)},r=c(this,S);this.parent.addCommands({cmd:()=>{e(t)}
2,undo:()=>{e(r)},mustExec:!0,type:i.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}function P(t){let e=c(this,y);this.parent.addCommands({cmd:()=>{p(this,y,t),this.editorDiv.style.color=t},undo:()=>{p(this,y,e),this.editorDiv.style.color=e},mustExec:!0,type:i.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function M(){let t=this.editorDiv.getElementsByTagName("div");if(0===t.length)return this.editorDiv.innerText;let e=[];for(let r=0,i=t.length;r<i;r++){let i=t[r].firstChild;(null==i?void 0:i.nodeName)==="#text"?e.push(i.data):e.push("")}return e.join("\n")}function R(){let[t,e]=this.parent.viewportBaseDimensions,r=this.div.getBoundingClientRect();this.width=r.width/t,this.height=r.height/e}e.FreeTextEditor=T,o(T,"_freeTextDefaultContent",""),o(T,"_l10nPromise",void 0),o(T,"_internalPadding",0),o(T,"_defaultColor",null),o(T,"_defaultFontSize",10),o(T,"_keyboardManager",new n.KeyboardManager([[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],T.prototype.commitOrRemove]])),o(T,"_type","freetext")},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.InkEditor=void 0,Object.defineProperty(e,"fitCurve",{enumerable:!0,get:function(){return s.fitCurve}});var i=r(1),n=r(131),s=r(150),a=r(132);function o(t,e){c(t,e),e.add(t)}function l(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function h(t,e,r){c(t,e),e.set(t,r)}function c(t,e){if(e.has(t))throw TypeError("Cannot initialize the same private elements twice on an object")}function d(t,e,r){return u(t,e),r}function u(t,e){if(t!==e)throw TypeError("Private static access of wrong provenance")}function p(t,e,r){var i=m(t,e,"set");return f(t,i,r),r}function f(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw TypeError("attempted to set read only private field");e.value=r}}function g(t,e){var r=m(t,e,"get");return v(t,r)}function m(t,e,r){if(!e.has(t))throw TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}function v(t,e){return e.get?e.get.call(t):e.value}function b(t,e,r){if(!e.has(t))throw TypeError("attempted to get private field on non-instance");return r}let y=16;var A=new WeakMap,_=new WeakMap,S=new WeakMap,x=new WeakMap,w=new WeakMap,E=new WeakMap,C=new WeakMap,T=new WeakMap,k=new WeakMap,P=new WeakMap,M=new WeakMap,R=new WeakMap,F=new WeakMap,O=new WeakMap,I=new WeakSet,D=new WeakSet,L=new WeakSet,N=new WeakSet,j=new WeakSet,U=new WeakSet,B=new WeakSet,W=new WeakSet,q=new WeakSet,G=new WeakSet,z=new WeakSet,H=new WeakSet,V=new WeakSet,$=new WeakSet,X=new WeakSet,Y=new WeakSet,K=new WeakSet,J=new WeakSet,Q=new WeakSet,Z=new WeakSet,tt=new WeakSet,te=new WeakSet;class tr extends n.AnnotationEditor{constructor(t){super({...t,name:"inkEditor"}),o(this,te),o(this,tt),o(this,Z),o(this,Q),o(this,J),o(this,K),o(this,Y),o(this,X),o(this,$),o(this,V),o(this,H),o(this,z),o(this,G),o(this,q),o(this,W),o(this,B),o(this,U),o(this,j),o(this,N),o(this,L),o(this,D),o(this,I),h(this,A,{writable:!0,value:0}),h(this,_,{writable:!0,value:0}),h(this,S,{writable:!0,value:0}),h(this,x,{writable:!0,value:this.canvasPointermove.bind(this)}),h(this,w,{writable:!0,value:this.canvasPointerleave.bind(this)}),h(this,E,{writable:!0,value:this.canvasPointerup.bind(this)}),h(this,C,{writable:!0,value:this.canvasPointerdown.bind(this)}),h(this,T,{writable:!0,value:!1}),h(this,k,{writable:!0,value:!1}),h(this,P,{writable:!0,value:null}),h(this,M,{writable:!0,value:null}),h(this,R,{writable:!0,value:0}),h(this,F,{writable:!0,value:0}),h(this,O,{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(t){this._l10nPromise=new Map(["editor_ink_canvas_aria_label","editor_ink_aria_label"].map(e=>[e,t.get(e)]))}static updateDefaultParams(t,e){switch(t){case i.AnnotationEditorParamsType.INK_THICKNESS:tr._defaultThickness=e;break;case i.AnnotationEditorParamsType.INK_COLOR:tr._defaultColor=e;break;case i.AnnotationEditorParamsType.INK_OPACITY:tr._defaultOpacity=e/100}}updateParams(t,e){switch(t){case i.AnnotationEditorParamsType.INK_THICKNESS:b(this,I,ti).call(this,e);break;case i.AnnotationEditorParamsType.INK_COLOR:b(this,D,tn).call(this,e);break;case i.AnnotationEditorParamsType.INK_OPACITY:b(this,L,ts).call(this,e)}}static get defaultPropertiesToUpdate(){return[[i.AnnotationEditorParamsType.INK_THICKNESS,tr._defaultThickness],[i.AnnotationEditorParamsType.INK_COLOR,tr._defaultColor||n.AnnotationEditor._defaultLineColor],[i.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*tr._defaultOpacity)]]}get propertiesToUpdate(){var t;return[[i.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||tr._defaultThickness],[i.AnnotationEditorParamsType.INK_COLOR,this.color||tr._defaultColor||n.AnnotationEditor._defaultLineColor],[i.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(null!==(t=this.opacity)&&void 0!==t?t:tr._defaultOpacity))]]}rebuild(){super.rebuild(),null!==this.div&&(this.canvas||(b(this,z,tp).call(this),b(this,H,tf).call(this)),this.isAttachedToDOM||(this.parent.add(this),b(this,V,tg).call(this)),b(this,tt,tw).c
2all(this))}remove(){null!==this.canvas&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,g(this,M).disconnect(),p(this,M,null),super.remove())}enableEditMode(){g(this,T)||null===this.canvas||(super.enableEditMode(),this.div.draggable=!1,this.canvas.addEventListener("pointerdown",g(this,C)),this.canvas.addEventListener("pointerup",g(this,E)))}disableEditMode(){this.isInEditMode()&&null!==this.canvas&&(super.disableEditMode(),this.div.draggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",g(this,C)),this.canvas.removeEventListener("pointerup",g(this,E)))}onceAdded(){this.div.draggable=!this.isEmpty()}isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}commit(){g(this,T)||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),p(this,T,!0),this.div.classList.add("disabled"),b(this,tt,tw).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()||g(this,T)||(this.setInForeground(),"mouse"!==t.type&&this.div.focus(),t.stopPropagation(),this.canvas.addEventListener("pointerleave",g(this,w)),this.canvas.addEventListener("pointermove",g(this,x)),b(this,U,tl).call(this,t.offsetX,t.offsetY))}canvasPointermove(t){t.stopPropagation(),b(this,B,th).call(this,t.offsetX,t.offsetY)}canvasPointerup(t){0===t.button&&this.isInEditMode()&&0!==this.currentPath.length&&(t.stopPropagation(),b(this,G,tu).call(this,t),this.setInBackground())}canvasPointerleave(t){b(this,G,tu).call(this,t),this.setInBackground()}render(){let t,e;if(this.div)return this.div;this.width&&(t=this.x,e=this.y),super.render(),tr._l10nPromise.get("editor_ink_aria_label").then(t=>{var e;return null===(e=this.div)||void 0===e?void 0:e.setAttribute("aria-label",t)});let[r,i,n,s]=b(this,N,ta).call(this);if(this.setAt(r,i,0,0),this.setDims(n,s),b(this,z,tp).call(this),this.width){let[r,i]=this.parent.viewportBaseDimensions;this.setAt(t*r,e*i,this.width*r,this.height*i),p(this,k,!0),b(this,V,tg).call(this),this.setDims(this.width*r,this.height*i),b(this,q,td).call(this),b(this,te,tE).call(this),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return b(this,H,tf).call(this),this.div}setDimensions(t,e){let r=Math.round(t),i=Math.round(e);if(g(this,R)===r&&g(this,F)===i)return;p(this,R,r),p(this,F,i),this.canvas.style.visibility="hidden",g(this,A)&&Math.abs(g(this,A)-t/e)>.01&&(e=Math.ceil(t/g(this,A)),this.setDims(t,e));let[n,s]=this.parent.viewportBaseDimensions;this.width=t/n,this.height=e/s,g(this,T)&&b(this,$,tm).call(this,t,e),b(this,V,tg).call(this),b(this,q,td).call(this),this.canvas.style.visibility="visible"}static deserialize(t,e){let r=super.deserialize(t,e);r.thickness=t.thickness,r.color=i.Util.makeHexColor(...t.color),r.opacity=t.opacity;let[n,s]=e.pageDimensions,a=r.width*n,o=r.height*s,l=e.scaleFactor,h=t.thickness/2;for(let{bezier:e}of(p(r,A,a/o),p(r,T,!0),p(r,R,Math.round(a)),p(r,F,Math.round(o)),t.paths)){let t=[];r.paths.push(t);let i=l*(e[0]-h),n=l*(o-e[1]-h);for(let r=2,s=e.length;r<s;r+=6){let s=l*(e[r]-h),a=l*(o-e[r+1]-h),c=l*(e[r+2]-h),d=l*(o-e[r+3]-h),u=l*(e[r+4]-h),p=l*(o-e[r+5]-h);t.push([[i,n],[s,a],[c,d],[u,p]]),i=u,n=p}let s=d(this,tr,tb).call(this,t);r.bezierPath2D.push(s)}let c=b(r,Q,tS).call(r);return p(r,S,Math.max(y,c[2]-c[0])),p(r,_,Math.max(y,c[3]-c[1])),b(r,$,tm).call(r,a,o),r}serialize(){if(this.isEmpty())return null;let t=this.getRect(0,0),e=this.rotation%180==0?t[3]-t[1]:t[2]-t[0],r=n.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);return{annotationType:i.AnnotationEditorType.INK,color:r,thickness:this.thickness,opacity:this.opacity,paths:b(this,Y,ty).call(this,this.scaleFactor/this.parent.scaleFactor,this.translationX,this.translationY,e),pageIndex:this.parent.pageIndex,rect:t,rotation:this.rotation}}}function ti(t){let e=this.thickness;this.parent.addCommands({cmd:()=>
2{this.thickness=t,b(this,tt,tw).call(this)},undo:()=>{this.thickness=e,b(this,tt,tw).call(this)},mustExec:!0,type:i.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}function tn(t){let e=this.color;this.parent.addCommands({cmd:()=>{this.color=t,b(this,q,td).call(this)},undo:()=>{this.color=e,b(this,q,td).call(this)},mustExec:!0,type:i.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function ts(t){t/=100;let e=this.opacity;this.parent.addCommands({cmd:()=>{this.opacity=t,b(this,q,td).call(this)},undo:()=>{this.opacity=e,b(this,q,td).call(this)},mustExec:!0,type:i.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}function ta(){let{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 to(){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,a.opacityToHex)(this.opacity)}`}function tl(t,e){if(this.isEditing=!0,!g(this,k)){var r;p(this,k,!0),b(this,V,tg).call(this),this.thickness||(this.thickness=tr._defaultThickness),this.color||(this.color=tr._defaultColor||n.AnnotationEditor._defaultLineColor),null!==(r=this.opacity)&&void 0!==r||(this.opacity=tr._defaultOpacity)}this.currentPath.push([t,e]),p(this,P,null),b(this,j,to).call(this),this.ctx.beginPath(),this.ctx.moveTo(t,e),p(this,O,()=>{g(this,O)&&(g(this,P)&&(this.isEmpty()?(this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height)):b(this,q,td).call(this),this.ctx.lineTo(...g(this,P)),p(this,P,null),this.ctx.stroke()),window.requestAnimationFrame(g(this,O)))}),window.requestAnimationFrame(g(this,O))}function th(t,e){let[r,i]=this.currentPath.at(-1);(t!==r||e!==i)&&(this.currentPath.push([t,e]),p(this,P,[t,e]))}function tc(t,e){let r;this.ctx.closePath(),p(this,O,null),t=Math.min(Math.max(t,0),this.canvas.width),e=Math.min(Math.max(e,0),this.canvas.height);let[i,n]=this.currentPath.at(-1);if((t!==i||e!==n)&&this.currentPath.push([t,e]),1!==this.currentPath.length)r=(0,s.fitCurve)(this.currentPath,30,null);else{let i=[t,e];r=[[i,i.slice(),i.slice(),i]]}let a=d(tr,tr,tb).call(tr,r);this.currentPath.length=0;let o=()=>{this.paths.push(r),this.bezierPath2D.push(a),this.rebuild()},l=()=>{this.paths.pop(),this.bezierPath2D.pop(),0===this.paths.length?this.remove():(this.canvas||(b(this,z,tp).call(this),b(this,H,tf).call(this)),b(this,tt,tw).call(this))};this.parent.addCommands({cmd:o,undo:l,mustExec:!0})}function td(){if(this.isEmpty()){b(this,X,tv).call(this);return}b(this,j,to).call(this);let{canvas:t,ctx:e}=this;for(let r of(e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,t.width,t.height),b(this,X,tv).call(this),this.bezierPath2D))e.stroke(r)}function tu(t){b(this,W,tc).call(this,t.offsetX,t.offsetY),this.canvas.removeEventListener("pointerleave",g(this,w)),this.canvas.removeEventListener("pointermove",g(this,x)),this.parent.addToAnnotationStorage(this)}function tp(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",tr._l10nPromise.get("editor_ink_canvas_aria_label").then(t=>{var e;return null===(e=this.canvas)||void 0===e?void 0:e.setAttribute("aria-label",t)}),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")}function tf(){p(this,M,new ResizeObserver(t=>{let e=t[0].contentRect;e.width&&e.height&&this.setDimensions(e.width,e.height)})),g(this,M).observe(this.div)}function tg(){if(!g(this,k))return;let[t,e]=this.parent.viewportBaseDimensions;this.canvas.width=Math.ceil(this.width*t),this.canvas.height=Math.ceil(this.height*e),b(this,X,tv).call(this)}function tm(t,e){let r=b(this,Z,tx).call(this),i=(t-r)/g(this,S),n=(e-r)/g(this,_);this.scaleFactor=Math.min(i,n)}function tv(){let t=b(this,Z,tx).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+t,this.translationY*this.scaleFactor+t)}
2function tb(t){let e=new Path2D;for(let r=0,i=t.length;r<i;r++){let[i,n,s,a]=t[r];0===r&&e.moveTo(...i),e.bezierCurveTo(n[0],n[1],s[0],s[1],a[0],a[1])}return e}function ty(t,e,r,i){let n,s;let a=4,o=[],l=this.thickness/2;for(let h of this.paths){n=[],s=[];for(let o=0,c=h.length;o<c;o++){let[c,d,u,p]=h[o],f=t*(c[0]+e)+l,g=i-t*(c[1]+r)-l,m=t*(d[0]+e)+l,v=i-t*(d[1]+r)-l,y=t*(u[0]+e)+l,A=i-t*(u[1]+r)-l,_=t*(p[0]+e)+l,S=i-t*(p[1]+r)-l;0===o&&(n.push(f,g),s.push(f,g)),n.push(m,v,y,A,_,S),b(this,K,tA).call(this,f,g,m,v,y,A,_,S,a,s)}o.push({bezier:n,points:s})}return o}function tA(t,e,r,i,n,s,a,o,l,h){if(b(this,J,t_).call(this,t,e,r,i,n,s,a,o)){h.push(a,o);return}for(let c=1;c<l-1;c++){let d=c/l,u=1-d,p=d*t+u*r,f=d*e+u*i,g=d*r+u*n,m=d*i+u*s,v=d*n+u*a,b=d*s+u*o;p=d*p+u*g,f=d*f+u*m,g=d*g+u*v,m=d*m+u*b,p=d*p+u*g,f=d*f+u*m,h.push(p,f)}h.push(a,o)}function t_(t,e,r,i,n,s,a,o){return Math.max((3*r-2*t-a)**2,(3*n-t-2*a)**2)+Math.max((3*i-2*e-o)**2,(3*s-e-2*o)**2)<=10}function tS(){let t=1/0,e=-1/0,r=1/0,n=-1/0;for(let s of this.paths)for(let[a,o,l,h]of s){let s=i.Util.bezierBoundingBox(...a,...o,...l,...h);t=Math.min(t,s[0]),r=Math.min(r,s[1]),e=Math.max(e,s[2]),n=Math.max(n,s[3])}return[t,r,e,n]}function tx(){return g(this,T)?Math.ceil(this.thickness*this.parent.scaleFactor):0}function tw(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return;if(!g(this,T)){b(this,q,td).call(this);return}let e=b(this,Q,tS).call(this),r=b(this,Z,tx).call(this);p(this,S,Math.max(y,e[2]-e[0])),p(this,_,Math.max(y,e[3]-e[1]));let i=Math.ceil(r+g(this,S)*this.scaleFactor),n=Math.ceil(r+g(this,_)*this.scaleFactor),[s,a]=this.parent.viewportBaseDimensions;this.width=i/s,this.height=n/a,p(this,A,i/n),b(this,te,tE).call(this);let o=this.translationX,l=this.translationY;this.translationX=-e[0],this.translationY=-e[1],b(this,V,tg).call(this),b(this,q,td).call(this),p(this,R,i),p(this,F,n),this.setDims(i,n);let h=t?r/this.scaleFactor/2:0;this.translate(o-this.translationX-h,l-this.translationY-h)}function tE(){let{style:t}=this.div;g(this,A)>=1?(t.minHeight=`${y}px`,t.minWidth=`${Math.round(g(this,A)*y)}px`):(t.minWidth=`${y}px`,t.minHeight=`${Math.round(y/g(this,A))}px`)}e.InkEditor=tr,l(tr,"_defaultColor",null),l(tr,"_defaultOpacity",1),l(tr,"_defaultThickness",1),l(tr,"_l10nPromise",void 0),l(tr,"_type","ink")},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.fitCurve=void 0;let i=r(151);e.fitCurve=i},t=>{"use strict";function e(t,e,i){if(!Array.isArray(t))throw TypeError("First argument should be an array");if(t.forEach(e=>{if(!Array.isArray(e)||e.some(t=>"number"!=typeof t)||e.length!==t[0].length)throw Error("Each point should be an array of numbers. Each point should have the same amount of numbers.")}),(t=t.filter((e,r)=>0===r||!e.every((e,i)=>e===t[r-1][i]))).length<2)return[];let n=t.length,s=d(t[1],t[0]),a=d(t[n-2],t[n-1]);return r(t,s,a,e,i)}function r(t,e,n,a,l){var h,c,d,p,f,g,m,v,b,y,A,_,S;let x=20;if(2===t.length)return _=u.vectorLen(u.subtract(t[0],t[1]))/3,[h=[t[0],u.addArrays(t[0],u.mulItems(e,_)),u.addArrays(t[1],u.mulItems(n,_)),t[1]]];if(c=o(t),[h,p,g]=i(t,c,c,e,n,l),0===p||p<a)return[h];if(p<a*a)for(S=0,d=c,f=p,m=g;S<x;S++){if(d=s(h,t,d),[h,p,g]=i(t,c,d,e,n,l),p<a)return[h];if(g===m){let t=p/f;if(t>.9999&&t<1.0001)break}f=p,m=g}return A=[],(v=u.subtract(t[g-1],t[g+1])).every(t=>0===t)&&(v=u.subtract(t[g-1],t[g]),[v[0],v[1]]=[-v[1],v[0]]),b=u.normalize(v),y=u.mulItems(b,-1),A=(A=A.concat(r(t.slice(0,g+1),e,b,a,l))).concat(r(t.slice(g),y,n,a,l))}function i(t,e,r,i,s,a){var o,h,c;return o=n(t,r,i,s,a),[h,c]=l(t,o,e),a&&a({bez:o,points:t,params:e,maxErr:h,maxPoint:c}),[o,h,c]}function n(t,e,r,i){var n,s,a,o,l,h,c,d,f,g,m,v,b,y,A,_,S,x=t[0],w=t[t.length-1];for(b=0,n=[x,null,null,w],s=u.zeros_Xx2x2(e.length),y=e.length;b<y;b++)S=1-(_=e[b]),(a=s[b])[0]=u.mulItems(r,3*_*(S*S)),a[1]=u.mulItems(i,3*S*(_*_));for(b=0,o=[[0,0],[0,0]],l=[0,0],y=t.length;b<y;b++)_=e[b],a=s[b],o[0][0]+=u.dot(a[0],a[0]),o[0][1]+=u.dot(a[0],a[1]),o[1][0]+=u.dot(a[0],a[1]),o[1][1]+=u.dot(a[1],a[1]),A=u.subtract(t[b],p.q([x,x,w,w],_)),l[0]+=u.dot(a[0],A),l[1]+=u.dot(a[1],A);
2return h=o[0][0]*o[1][1]-o[1][0]*o[0][1],c=o[0][0]*l[1]-o[1][0]*l[0],d=l[0]*o[1][1]-l[1]*o[0][1],f=0===h?0:d/h,g=0===h?0:c/h,f<(m=1e-6*(v=u.vectorLen(u.subtract(x,w))))||g<m?(n[1]=u.addArrays(x,u.mulItems(r,v/3)),n[2]=u.addArrays(w,u.mulItems(i,v/3))):(n[1]=u.addArrays(x,u.mulItems(r,f)),n[2]=u.addArrays(w,u.mulItems(i,g))),n}function s(t,e,r){return r.map((r,i)=>a(t,e[i],r))}function a(t,e,r){var i=u.subtract(p.q(t,r),e),n=p.qprime(t,r),s=u.mulMatrix(i,n),a=u.sum(u.squareItems(n))+2*u.mulMatrix(i,p.qprimeprime(t,r));return 0===a?r:r-s/a}function o(t){var e,r,i,n=[];return t.forEach((t,s)=>{e=s?r+u.vectorLen(u.subtract(t,i)):0,n.push(e),r=e,i=t}),n=n.map(t=>t/r)}function l(t,e,r){var i,n,s,a,o,l,d,f;n=0,s=Math.floor(t.length/2);let g=h(e,10);for(o=0,l=t.length;o<l;o++)d=t[o],f=c(e,r[o],g,10),(i=(a=u.subtract(p.q(e,f),d))[0]*a[0]+a[1]*a[1])>n&&(n=i,s=o);return[n,s]}var h=function(t,e){for(var r,i=[0],n=t[0],s=0,a=1;a<=e;a++)r=p.q(t,a/e),i.push(s+=u.vectorLen(u.subtract(r,n))),n=r;return i.map(t=>t/s)};function c(t,e,r,i){if(e<0)return 0;if(e>1)return 1;for(var n,s,a,o,l=1;l<=i;l++)if(e<=r[l]){a=(l-1)/i,s=l/i,o=(e-(n=r[l-1]))/(r[l]-n)*(s-a)+a;break}return o}function d(t,e){return u.normalize(u.subtract(t,e))}class u{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,e){return t.reduce((t,r,i)=>t+r*e[i],0)}static subtract(t,e){return t.map((t,r)=>t-e[r])}static addArrays(t,e){return t.map((t,r)=>t+e[r])}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 u.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 p{static q(t,e){var r=1-e,i=u.mulItems(t[0],r*r*r),n=u.mulItems(t[1],3*r*r*e),s=u.mulItems(t[2],3*r*e*e),a=u.mulItems(t[3],e*e*e);return u.addArrays(u.addArrays(i,n),u.addArrays(s,a))}static qprime(t,e){var r=1-e,i=u.mulItems(u.subtract(t[1],t[0]),3*r*r),n=u.mulItems(u.subtract(t[2],t[1]),6*r*e),s=u.mulItems(u.subtract(t[3],t[2]),3*e*e);return u.addArrays(u.addArrays(i,n),s)}static qprimeprime(t,e){return u.addArrays(u.mulItems(u.addArrays(u.subtract(t[2],u.mulItems(t[1],2)),t[0]),6*(1-e)),u.mulItems(u.addArrays(u.subtract(t[3],u.mulItems(t[2],2)),t[1]),6*e))}}t.exports=e,t.exports.fitCubic=r,t.exports.createTangent=d},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AnnotationLayer=void 0;var i=r(1),n=r(133),s=r(130),a=r(153),o=r(154);function l(t,e,r){return h(t,e),r}function h(t,e){if(t!==e)throw TypeError("Private static access of wrong provenance")}let c=1e3,d=9,u=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 i.AnnotationType.LINK:return new m(t);case i.AnnotationType.TEXT:return new v(t);case i.AnnotationType.WIDGET:switch(t.data.fieldType){case"Tx":return new y(t);case"Btn":if(t.data.radioButton)return new _(t);if(t.data.checkBox)return new A(t);return new S(t);case"Ch":return new x(t)}return new b(t);case i.AnnotationType.POPUP:return new w(t);case i.AnnotationType.FREETEXT:return new C(t);case i.AnnotationType.LINE:return new T(t);case i.AnnotationType.SQUARE:return new k(t);case i.AnnotationType.CIRCLE:return new P(t);case i.AnnotationType.POLYLINE:return new M(t);case i.AnnotationType.CARET:return new F(t);case i.AnnotationType.INK:return new O(t);case i.AnnotationType.POLYGON:return new R(t);case i.AnnotationType.HIGHLIGHT:return new I(t);case i.AnnotationType.UNDERLINE:return new D(t);case i.AnnotationType.SQUIGGLY:return new L(t);case i.AnnotationType.STRIKEOUT:return new N(t);case i.AnnotationType.STAMP:return new j(t);case i.AnnotationType.FILEATTACHMENT:return new U(t);default:return new g(t)}}}class g{constructor(t){let{isRenderable:e=!1,ignoreBorder:r=!1,createQuadrilaterals:i=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.isRenderable=e,this.data=t.data,this.layer=t.layer,this.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)),i&&(this.quadrilaterals=this._createQuadrilaterals(r))}_createContainer(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.data,r=this.page,n=this.viewport,s=document.createElement("section"),{width:a,height:o}=p(e.rect),[l,h,c,d]=n.viewBox,u=c-l,f=d-h;s.setAttribute("data-annotation-id",e.id);let g=i.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&&e.borderStyle.width>0){s.style.borderWidth=`${e.borderStyle.width}px`;let t=e.borderStyle.horizontalCornerRadius,r=e.borderStyle.verticalCornerRadius;if(t>0||r>0){let e=`calc(${t}px * var(--scale-factor)) / calc(${r}px * var(--scale-factor))`;s.style.borderRadius=e}else if(this instanceof _){let t=`calc(${a}px * var(--scale-factor)) / calc(${o}px * var(--scale-factor))`;s.style.borderRadius=t}switch(e.borderStyle.style){case i.AnnotationBorderStyleType.SOLID:s.style.borderStyle="solid";break;case i.AnnotationBorderStyleType.DASHED:s.style.borderStyle="dashed";break;case i.AnnotationBorderStyleType.BEVELED:(0,i.warn)("Unimplemented border style: beveled");break;case i.AnnotationBorderStyleType.INSET:(0,i.warn)("Unimplemented border style: inset");break;case i.AnnotationBorderStyleType.UNDERLINE:s.style.borderBottomStyle="solid"}let n=e.borderColor||null;n?s.style.borderColor=i.Util.makeHexColor(0|n[0],0|n[1],0|n[2]):s.style.borderWidth=0}s.style.left=`${100*(g[0]-l)/u}%`,s.style.top=`${100*(g[1]-h)/f}%`;let{rotation:m}=e;return e.hasOwnCanvas||0===m?(s.style.width=`${100*a/u}%`,s.style.height=`${100*o/f}%`):this.setRotation(m,s),s}setRotation(t){let e,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.container,[n,s,a,o]=this.viewport.viewBox,l=a-n,h=o-s,{width:c,height:d}=p(this.data.rect);t%180==0?(e=100*c/l,r=100*d/h):(e=100*d/l,r=100*c/h),i.style.width=`${e}%`,i.style.height=`${r}%`,i.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){let t=(t,e,r)=>{let i=r.detail[t];r.target.style[e]=a.ColorConverters[`${i[0]}_HTML`](i.slice(1))};return(0,i.shadow)(this,"_commonActions",{display:t=>{let 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(()=>
2t.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:e=>{t("bgColor","backgroundColor",e)},fillColor:e=>{t("fillColor","backgroundColor",e)},fgColor:e=>{t("fgColor","color",e)},textColor:e=>{t("textColor","color",e)},borderColor:e=>{t("borderColor","borderColor",e)},strokeColor:e=>{t("strokeColor","borderColor",e)},rotation:t=>{let e=t.detail.rotation;this.setRotation(e),this.annotationStorage.setValue(this.data.id,{rotation:e})}})}_dispatchEventFromSandbox(t,e){let r=this._commonActions;for(let i of Object.keys(e.detail)){let n=t[i]||r[i];n&&n(e)}}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;let e=this.annotationStorage.getRawValue(this.data.id);if(!e)return;let r=this._commonActions;for(let[i,n]of Object.entries(e)){let s=r[i];s&&(s({detail:{[i]:n},target:t}),delete e[i])}}_createQuadrilaterals(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.data.quadPoints)return null;let e=[],r=this.data.rect;for(let r of this.data.quadPoints)this.data.rect=[r[2].x,r[2].y,r[1].x,r[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));let i=new E({container:r,trigger:t,color:e.color,titleObj:e.titleObj,modificationDate:e.modificationDate,contentsObj:e.contentsObj,richText:e.richText,hideWrapper:!0}).render();i.style.left="100%",r.append(i)}_renderQuadrilaterals(t){for(let e of this.quadrilaterals)e.className=t;return this.quadrilaterals}render(){(0,i.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=[];if(this._fieldObjects){let n=this._fieldObjects[t];if(n)for(let{page:t,id:s,exportValues:a}of n){if(-1===t||s===e)continue;let n="string"==typeof a?a:null,o=document.querySelector(`[data-element-id="${s}"]`);if(o&&!u.has(o)){(0,i.warn)(`_getElementsByName - element not allowed: ${s}`);continue}r.push({id:s,exportValue:n,domElement:o})}return r}for(let i of document.getElementsByName(t)){let{id:t,exportValue:n}=i;t!==e&&u.has(i)&&r.push({id:t,exportValue:n,domElement:i})}return r}static get platform(){let t="undefined"!=typeof navigator?navigator.platform:"";return(0,i.shadow)(this,"platform",{isWin:t.includes("Win"),isMac:t.includes("Mac")})}}class m extends g{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;super(t,{isRenderable:!0,ignoreBorder:!!(null!=e&&e.ignoreBorder),createQuadrilaterals:!0}),this.isTooltipOnly=t.data.isTooltipOnly}render(){let{data:t,linkService:e}=this,r=document.createElement("a");r.setAttribute("data-element-id",t.id);let i=!1;return(t.url?(e.addLinkAttributes(r,t.url,t.newWindow),i=!0):t.action?(this._bindNamedAction(r,t.action),i=!0):t.dest?(this._bindLink(r,t.dest),i=!0):(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(r,t),i=!0),t.resetForm?(this._bindResetFormAction(r,t.resetForm),i=!0):this.isTooltipOnly&&!i&&(this._bindLink(r,""),i=!0)),this.quadrilaterals)?this._renderQuadrilaterals("linkAnnotation").map((t,e)=>{let i=0===e?r:r.cloneNode();return t.append(i),t}):(this.container.className="linkAnnotation",i&&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"}_bindJSAction(t,e){t.href=this.linkService.getAnchorUrl("");let r=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(let i of Object.keys(e.actions)){let n=r.get(i);n&&(t[n]=()=>{var t;
2return null===(t=this.linkService.eventBus)||void 0===t||t.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e.id,name:i}}),!1})}t.onclick||(t.onclick=()=>!1),t.className="internalLink"}_bindResetFormAction(t,e){let r=t.onclick;if(r||(t.href=this.linkService.getAnchorUrl("")),t.className="internalLink",!this._fieldObjects){(0,i.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),r||(t.onclick=()=>!1);return}t.onclick=()=>{r&&r();let{fields:t,refs:n,include:s}=e,a=[];if(0!==t.length||0!==n.length){let e=new Set(n);for(let r of t)for(let{id:t}of this._fieldObjects[r]||[])e.add(t);for(let t of Object.values(this._fieldObjects))for(let r of t)e.has(r.id)===s&&a.push(r)}else for(let t of Object.values(this._fieldObjects))a.push(...t);let o=this.annotationStorage,l=[];for(let t of a){let{id:e}=t;switch(l.push(e),t.type){case"text":{let r=t.defaultValue||"";o.setValue(e,{value:r});break}case"checkbox":case"radiobutton":{let r=t.defaultValue===t.exportValues;o.setValue(e,{value:r});break}case"combobox":case"listbox":{let r=t.defaultValue||"";o.setValue(e,{value:r});break}default:continue}let r=document.querySelector(`[data-element-id="${e}"]`);if(r){if(!u.has(r)){(0,i.warn)(`_bindResetFormAction - element not allowed: ${e}`);continue}r.dispatchEvent(new Event("resetform"))}}if(this.enableScripting){var h;null===(h=this.linkService.eventBus)||void 0===h||h.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:l,name:"ResetForm"}})}return!1}}}class v extends g{constructor(t){var e,r,i;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(r=t.data.contentsObj)&&void 0!==r&&r.str||null!==(i=t.data.r
2ichText)&&void 0!==i&&i.str)})}render(){this.container.className="textAnnotation";let 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 b extends g{render(){return this.data.alternativeText&&(this.container.title=this.data.alternativeText),this.container}_getKeyModifier(t){let{isWin:e,isMac:r}=g.platform;return e&&t.ctrlKey||r&&t.metaKey}_setEventListener(t,e,r,i){e.includes("mouse")?t.addEventListener(e,t=>{var e;null===(e=this.linkService.eventBus)||void 0===e||e.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:r,value:i(t),shift:t.shiftKey,modifier:this._getKeyModifier(t)}})}):t.addEventListener(e,t=>{var e;null===(e=this.linkService.eventBus)||void 0===e||e.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:r,value:i(t)}})})}_setEventListeners(t,e,r){for(let[n,s]of e){var i;("Action"===s||null!==(i=this.data.actions)&&void 0!==i&&i[s])&&this._setEventListener(t,n,s,r)}}_setBackgroundColor(t){let e=this.data.backgroundColor||null;t.style.backgroundColor=null===e?"transparent":i.Util.makeHexColor(e[0],e[1],e[2])}_setTextStyle(t){let e;let r=["left","center","right"],{fontColor:n}=this.data.defaultAppearanceData,s=this.data.defaultAppearanceData.fontSize||d,a=t.style;if(this.data.multiLine){let t=Math.abs(this.data.rect[3]-this.data.rect[1]),r=Math.round(t/(i.LINE_FACTOR*s))||1;e=Math.min(s,Math.round(t/r/i.LINE_FACTOR))}else e=Math.min(s,Math.round(Math.abs(this.data.rect[3]-this.data.rect[1])/i.LINE_FACTOR));a.fontSize=`calc(${e}px * var(--scale-factor))`,a.color=i.Util.makeHexColor(n[0],n[1],n[2]),null!==this.data.textAlignment&&(a.textAlign=r[this.data.textAlignment])}_setRequired(t,e){e?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",e)}}class y extends b{constructor(t){super(t,{isRenderable:t.renderForms||!t.data.hasAppearance&&!!t.data.fieldValue})}setPropertyOnSiblings(t,e,r,i){let n=this.annotationStorage;
2for(let s of this._getElementsByName(t.name,t.id))s.domElement&&(s.domElement[e]=r),n.setValue(s.id,{[i]:r})}render(){let t=this.annotationStorage,e=this.data.id;this.container.className="textWidgetAnnotation";let r=null;if(this.renderForms){let n=t.getValue(e,{value:this.data.fieldValue}),s=n.formattedValue||n.value||"",a=t.getValue(e,{charLimit:this.data.maxLen}).charLimit;a&&s.length>a&&(s=s.slice(0,a));let o={userValue:s,formattedValue:null,valueOnFocus:""};this.data.multiLine?((r=document.createElement("textarea")).textContent=s,this.data.doNotScroll&&(r.style.overflowY="hidden")):((r=document.createElement("input")).type="text",r.setAttribute("value",s),this.data.doNotScroll&&(r.style.overflowX="hidden")),u.add(r),r.setAttribute("data-element-id",e),r.disabled=this.data.readOnly,r.name=this.data.fieldName,r.tabIndex=c,this._setRequired(r,this.data.required),a&&(r.maxLength=a),r.addEventListener("input",i=>{t.setValue(e,{value:i.target.value}),this.setPropertyOnSiblings(r,"value",i.target.value,"value")}),r.addEventListener("resetform",t=>{var e;let i=null!==(e=this.data.defaultFieldValue)&&void 0!==e?e:"";r.value=o.userValue=i,o.formattedValue=null});let l=t=>{let{formattedValue:e}=o;null!=e&&(t.target.value=e),t.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){var i;r.addEventListener("focus",t=>{o.userValue&&(t.target.value=o.userValue),o.valueOnFocus=t.target.value}),r.addEventListener("updatefromsandbox",r=>{let i={value(r){var i;o.userValue=null!==(i=r.detail.value)&&void 0!==i?i:"",t.setValue(e,{value:o.userValue.toString()}),r.target.value=o.userValue},formattedValue(r){let{formattedValue:i}=r.detail;o.formattedValue=i,null!=i&&r.target!==document.activeElement&&(r.target.value=i),t.setValue(e,{formattedValue:i})},selRange(t){t.target.setSelectionRange(...t.detail.selRange)},charLimit:r=>{var i;let{charLimit:n}=r.detail,{target:s}=r;if(0===n){s.removeAttribute("maxLength");return}s.setAttribute("maxLength",n);let a=o.userValue;a&&!(a.length<=n)&&(a=a.slice(0,n),s.value=o.userValue=a,t.setValue(e,{value:a}),null===(i=this.linkService.eventBus)||void 0===i||i.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:a,willCommit:!0,commitKey:1,selStart:s.selectionStart,selEnd:s.selectionEnd}}))}};this._dispatchEventFromSandbox(i,r)}),r.addEventListener("keydown",t=>{var r;let i=-1;
2if("Escape"===t.key?i=0:"Enter"===t.key?i=2:"Tab"===t.key&&(i=3),-1===i)return;let{value:n}=t.target;o.valueOnFocus!==n&&(o.userValue=n,null===(r=this.linkService.eventBus)||void 0===r||r.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:n,willCommit:!0,commitKey:i,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}))});let n=l;l=null,r.addEventListener("blur",t=>{let{value:r}=t.target;if(o.userValue=r,this._mouseState.isDown&&o.valueOnFocus!==r){var i;null===(i=this.linkService.eventBus)||void 0===i||i.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:r,willCommit:!0,commitKey:1,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}})}n(t)}),null!==(i=this.data.actions)&&void 0!==i&&i.Keystroke&&r.addEventListener("beforeinput",t=>{var r;let{data:i,target:n}=t,{value:s,selectionStart:a,selectionEnd:o}=n,l=a,h=o;switch(t.inputType){case"deleteWordBackward":{let t=s.substring(0,a).match(/\w*[^\w]*$/);t&&(l-=t[0].length);break}
2case"deleteWordForward":{let t=s.substring(a).match(/^[^\w]*\w*/);t&&(h+=t[0].length);break}case"deleteContentBackward":a===o&&(l-=1);break;case"deleteContentForward":a===o&&(h+=1)}t.preventDefault(),null===(r=this.linkService.eventBus)||void 0===r||r.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:s,change:i||"",willCommit:!1,selStart:l,selEnd:h}})}),this._setEventListeners(r,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],t=>t.target.value)}if(l&&r.addEventListener("blur",l),this.data.comb){let t=(this.data.rect[2]-this.data.rect[0])/a;r.classList.add("comb"),r.style.letterSpacing=`calc(${t}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 b{constructor(t){super(t,{isRenderable:t.renderForms})}render(){let t=this.annotationStorage,e=this.data,r=e.id,i=t.getValue(r,{value:e.exportValue===e.fieldValue}).value;"string"==typeof i&&(i="Off"!==i,t.setValue(r,{value:i})),this.container.className="buttonWidgetAnnotation checkBox";let n=document.createElement("input");return u.add(n),n.setAttribute("data-element-id",r),n.disabled=e.readOnly,this._setRequired(n,this.data.required),n.type="checkbox",n.name=e.fieldName,i&&n.setAttribute("checked",!0),n.setAttribute("exportValue",e.exportValue),n.tabIndex=c,n.addEventListener("change",i=>{let{name:n,checked:s}=i.target;for(let i of this._getElementsByName(n,r)){let r=s&&i.exportValue===e.exportValue;i.domElement&&(i.domElement.checked=r),t.setValue(i.id,{value:r})}t.setValue(r,{value:s})}),n.addEventListener("resetform",t=>{let r=e.defaultFieldValue||"Off";t.target.checked=r===e.exportValue}),this.enableScripting&&this.hasJSActions&&(n.addEventListener("updatefromsandbox",e=>{let i={value(e){e.target.checked="Off"!==e.detail.value,t.setValue(r,{value:e.target.checked})}};this._dispatchEventFromSandbox(i,e)}),this._setEventListeners(n,[["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(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class _ extends b{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.className="buttonWidgetAnnotation radioButton";let t=this.annotationStorage,e=this.data,r=e.id,i=t.getValue(r,{value:e.fieldValue===e.buttonValue}).value;"string"==typeof i&&(i=i!==e.buttonValue,t.setValue(r,{value:i}));let n=document.createElement("input");if(u.add(n),n.setAttribute("data-element-id",r),n.disabled=e.readOnly,this._setRequired(n,this.data.required),n.type="radio",n.name=e.fieldName,i&&n.setAttribute("checked",!0),n.tabIndex=c,n.addEventListener("change",e=>{let{name:i,checked:n}=e.target;for(let e of this._getElementsByName(i,r))t.setValue(e.id,{value:!1});t.setValue(r,{value:n})}),n.addEventListener("resetform",t=>{let r=e.defaultFieldValue;t.target.checked=null!=r&&r===e.buttonValue}),this.enableScripting&&this.hasJSActions){let i=e.buttonValue;n.addEventListener("updatefromsandbox",e=>{let n={value:e=>{let n=i===e.detail.value;for(let i of this._getElementsByName(e.target.name)){let e=n&&i.id===r;i.domElement&&(i.domElement.checked=e),t.setValue(i.id,{value:e})}}};this._dispatchEventFromSandbox(n,e)}),this._setEventListeners(n,[["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(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class S extends m{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){let t=super.render();t.className="buttonWidgetAnnotation pushButton",this.data.alternativeText&&(t.title=this.data.alternativeText);let e=t.lastChild;return this.enableScripting&&this.hasJSActions&&e&&(this._setDefaultPropertiesFromJS(e),e.addEventListener("updatefromsandbox",t=>{this._dispatchEventFromSandbox({},t)})),t}}class x extends b{constructor(t){super(t,{isRenderable:t.renderForms})}
2render(){this.container.className="choiceWidgetAnnotation";let t=this.annotationStorage,e=this.data.id,r=t.getValue(e,{value:this.data.fieldValue}),i=document.createElement("select");u.add(i),i.setAttribute("data-element-id",e),i.disabled=this.data.readOnly,this._setRequired(i,this.data.required),i.name=this.data.fieldName,i.tabIndex=c;let n=this.data.combo&&this.data.options.length>0;for(let t of(!this.data.combo&&(i.size=this.data.options.length,this.data.multiSelect&&(i.multiple=!0)),i.addEventListener("resetform",t=>{let e=this.data.defaultFieldValue;for(let t of i.options)t.selected=t.value===e}),this.data.options)){let e=document.createElement("option");e.textContent=t.displayValue,e.value=t.exportValue,r.value.includes(t.exportValue)&&(e.setAttribute("selected",!0),n=!1),i.append(e)}let s=null;if(n){let t=document.createElement("option");t.value=" ",t.setAttribute("hidden",!0),t.setAttribute("selected",!0),i.prepend(t),s=()=>{t.remove(),i.removeEventListener("input",s),s=null},i.addEventListener("input",s)}let a=(t,e)=>{let r=e?"value":"textContent",i=t.target.options;return t.target.multiple?Array.prototype.filter.call(i,t=>t.selected).map(t=>t[r]):-1===i.selectedIndex?null:i[i.selectedIndex][r]},o=t=>{let e=t.target.options;return Array.prototype.map.call(e,t=>({displayValue:t.textContent,exportValue:t.value}))};return this.enableScripting&&this.hasJSActions?(i.addEventListener("updatefromsandbox",r=>{let n={value(r){var n;null===(n=s)||void 0===n||n();let o=r.detail.value,l=new Set(Array.isArray(o)?o:[o]);for(let t of i.options)t.selected=l.has(t.value);t.setValue(e,{value:a(r,!0)})},multipleSelection(t){i.multiple=!0},remove(r){let n=i.options,s=r.detail.remove;n[s].selected=!1,i.remove(s),n.length>0&&-1===Array.prototype.findIndex.call(n,t=>t.selected)&&(n[0].selected=!0),t.setValue(e,{value:a(r,!0),items:o(r)})},clear(r){for(;0!==i.length;)i.remove(0);t.setValue(e,{value:null,items:[]})},insert(r){let{index:n,displayValue:s,exportValue:l}=r.detail.insert,h=i.children[n],c=document.createElement("option");c.textContent=s,c.value=l,h?h.before(c):i.append(c),t.setValue(e,{value:a(r,!0),items:o(r)})},items(r){let{items:n}=r.detail;for(;0!==i.length;)i.remove(0);for(let t of n){let{displayValue:e,exportValue:r}=t,n=document.createElement("option");n.textContent=e,n.value=r,i.append(n)}i.options.length>0&&(i.options[0].selected=!0),t.setValue(e,{value:a(r,!0),items:o(r)})},indices(r){let i=new Set(r.detail.indices);for(let t of r.target.options)t.selected=i.has(t.index);t.setValue(e,{value:a(r,!0)})},editable(t){t.target.disabled=!t.detail.editable}};this._dispatchEventFromSandbox(n,r)}),i.addEventListener("input",r=>{var i;let n=a(r,!0),s=a(r,!1);t.setValue(e,{value:n}),null===(i=this.linkService.eventBus)||void 0===i||i.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:s,changeEx:n,willCommit:!0,commitKey:1,keyDown:!1}})}),this._setEventListeners(i,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"]],t=>t.target.checked)):i.addEventListener("input",function(r){t.setValue(e,{value:a(r,!0)})}),this.data.combo&&this._setTextStyle(i),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class w extends g{constructor(t){var e,r,i;super(t,{isRenderable:!!(null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(r=t.data.contentsObj)&&void 0!==r&&r.str||null!==(i=t.data.r
2ichText)&&void 0!==i&&i.str)})}render(){let t=["Line","Square","Circle","PolyLine","Polygon","Ink"];if(this.container.className="popupAnnotation",t.includes(this.data.parentType))return this.container;let e=`[data-annotation-id="${this.data.parentId}"]`,r=this.layer.querySelectorAll(e);if(0===r.length)return this.container;let n=new E({container:this.container,trigger:Array.from(r),color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText}),s=this.page,a=i.Util.normalizeRect([this.data.parentRect[0],s.view[3]-this.data.parentRect[1]+s.view[1],this.data.parentRect[2],s.view[3]-this.data.parentRect[3]+s.view[1]]),o=a[0]+this.data.parentRect[2]-this.data.parentRect[0],l=a[1],[h,c,d,u]=this.viewport.viewBox,p=d-h,f=u-c;return this.container.style.left=`${100*(o-h)/p}%`,this.container.style.top=`${100*(l-c)/f}%`,this.container.append(n.render()),this.container}}class E{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,e;let r=.7,s=document.createElement("div");s.className="popupWrapper",this.hideElement=this.hideWrapper?s:this.container,this.hideElement.hidden=!0;let a=document.createElement("div");a.className="popup";let l=this.color;if(l){let t=r*(255-l[0])+l[0],e=r*(255-l[1])+l[1],n=r*(255-l[2])+l[2];a.style.backgroundColor=i.Util.makeHexColor(0|t,0|e,0|n)}let h=document.createElement("h1");h.dir=this.titleObj.dir,h.textContent=this.titleObj.str,a.append(h);let c=n.PDFDateString.toDateObject(this.modificationDate);if(c){let t=document.createElement("span");t.className="popupDate",t.textContent="{{date}}, {{time}}",t.dataset.l10nId="annotation_date_string",t.dataset.l10nArgs=JSON.stringify({date:c.toLocaleDateString(),time:c.toLocaleTimeString()}),a.append(t)}if(null!==(t=this.richText)&&void 0!==t&&t.str&&(!(null!==(e=this.contentsObj)&&void 0!==e&&e.str)||this.contentsObj.str===this.richText.str))o.XfaLayer.render({xfaHtml:this.richText.html,intent:"richText",div:a}),a.lastChild.className="richText popupContent";else{let t=this._formatContents(this.contentsObj);a.append(t)}for(let t of(Array.isArray(this.trigger)||(this.trigger=[this.trigger]),this.trigger))t.addEventListener("click",this._toggle.bind(this)),t.addEventListener("mouseover",this._show.bind(this,!1)),t.addEventListener("mouseout",this._hide.bind(this,!1));return a.addEventListener("click",this._hide.bind(this,!0)),s.append(a),s}_formatContents(t){let{str:e,dir:r}=t,i=document.createElement("p");i.className="popupContent",i.dir=r;let n=e.split(/(?:\r\n?|\n)/);for(let t=0,e=n.length;t<e;++t){let r=n[t];i.append(document.createTextNode(r)),t<e-1&&i.append(document.createElement("br"))}return i}
2_toggle(){this.pinned?this._hide(!0):this._show(!0)}_show(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];t&&(this.pinned=!0),this.hideElement.hidden&&(this.hideElement.hidden=!1,this.container.style.zIndex=parseInt(this.container.style.zIndex)+1e3)}_hide(){let t=!(arguments.length>0)||void 0===arguments[0]||arguments[0];t&&(this.pinned=!1),this.hideElement.hidden||this.pinned||(this.hideElement.hidden=!0,this.container.style.zIndex=parseInt(this.container.style.zIndex)-1e3)}}class C extends g{constructor(t){var e,r,i;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(r=t.data.contentsObj)&&void 0!==r&&r.str||null!==(i=t.data.richText)&&void 0!==i&&i.str),ignoreBorder:!0}),this.textContent=t.data.textContent}render(){if(this.container.className="freeTextAnnotation",this.textContent){let t=document.createElement("div");for(let e of(t.className="annotationTextContent",t.setAttribute("role","comment"),this.textContent)){let r=document.createElement("span");r.textContent=e,t.append(r)}this.container.append(t)}return this.data.hasPopup||this._createPopup(null,this.data),this.container}}class T extends g{constructor(t){var e,r,i;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(r=t.data.contentsObj)&&void 0!==r&&r.str||null!==(i=t.data.r
2ichText)&&void 0!==i&&i.str),ignoreBorder:!0})}render(){this.container.className="lineAnnotation";let t=this.data,{width:e,height:r}=p(t.rect),i=this.svgFactory.create(e,r,!0),n=this.svgFactory.createElement("svg:line");return n.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]),n.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]),n.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]),n.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]),n.setAttribute("stroke-width",t.borderStyle.width||1),n.setAttribute("stroke","transparent"),n.setAttribute("fill","transparent"),i.append(n),this.container.append(i),this._createPopup(n,t),this.container}}class k extends g{constructor(t){var e,r,i;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(r=t.data.contentsObj)&&void 0!==r&&r.str||null!==(i=t.data.richText)&&void 0!==i&&i.str),ignoreBorder:!0})}render(){this.container.className="squareAnnotation";let t=this.data,{width:e,height:r}=p(t.rect),i=this.svgFactory.create(e,r,!0),n=t.borderStyle.width,s=this.svgFactory.createElement("svg:rect");return s.setAttribute("x",n/2),s.setAttribute("y",n/2),s.setAttribute("width",e-n),s.setAttribute("height",r-n),s.setAttribute("stroke-width",n||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),i.append(s),this.container.append(i),this._createPopup(s,t),this.container}}class P extends g{constructor(t){var e,r,i;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(r=t.data.contentsObj)&&void 0!==r&&r.str||null!==(i=t.data.r
2ichText)&&void 0!==i&&i.str),ignoreBorder:!0})}render(){this.container.className="circleAnnotation";let t=this.data,{width:e,height:r}=p(t.rect),i=this.svgFactory.create(e,r,!0),n=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-n/2),s.setAttribute("ry",r/2-n/2),s.setAttribute("stroke-width",n||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),i.append(s),this.container.append(i),this._createPopup(s,t),this.container}}class M extends g{constructor(t){var e,r,i;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(r=t.data.contentsObj)&&void 0!==r&&r.str||null!==(i=t.data.richText)&&void 0!==i&&i.str),ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.className=this.containerClassName;let t=this.data,{width:e,height:r}=p(t.rect),i=this.svgFactory.create(e,r,!0),n=[];for(let e of t.vertices){let r=e.x-t.rect[0],i=t.rect[3]-e.y;n.push(r+","+i)}n=n.join(" ");let s=this.svgFactory.createElement(this.svgElementName);return s.setAttribute("points",n),s.setAttribute("stroke-width",t.borderStyle.width||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),i.append(s),this.container.append(i),this._createPopup(s,t),this.container}}class R extends M{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class F extends g{constructor(t){var e,r,i;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(r=t.data.contentsObj)&&void 0!==r&&r.str||null!==(i=t.data.r
2ichText)&&void 0!==i&&i.str),ignoreBorder:!0})}render(){return this.container.className="caretAnnotation",this.data.hasPopup||this._createPopup(null,this.data),this.container}}class O extends g{constructor(t){var e,r,i;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(r=t.data.contentsObj)&&void 0!==r&&r.str||null!==(i=t.data.richText)&&void 0!==i&&i.str),ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline"}render(){this.container.className=this.containerClassName;let t=this.data,{width:e,height:r}=p(t.rect),i=this.svgFactory.create(e,r,!0);for(let e of t.inkLists){let r=[];for(let i of e){let e=i.x-t.rect[0],n=t.rect[3]-i.y;r.push(`${e},${n}`)}r=r.join(" ");let n=this.svgFactory.createElement(this.svgElementName);n.setAttribute("points",r),n.setAttribute("stroke-width",t.borderStyle.width||1),n.setAttribute("stroke","transparent"),n.setAttribute("fill","transparent"),this._createPopup(n,t),i.append(n)}return this.container.append(i),this.container}}class I extends g{constructor(t){var e,r,i;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(r=t.data.contentsObj)&&void 0!==r&&r.str||null!==(i=t.data.r
2ichText)&&void 0!==i&&i.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 D extends g{constructor(t){var e,r,i;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(r=t.data.contentsObj)&&void 0!==r&&r.str||null!==(i=t.data.richText)&&void 0!==i&&i.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 L extends g{constructor(t){var e,r,i;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(r=t.data.contentsObj)&&void 0!==r&&r.str||null!==(i=t.data.richText)&&void 0!==i&&i.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 N extends g{constructor(t){var e,r,i;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(r=t.data.contentsObj)&&void 0!==r&&r.str||null!==(i=t.data.r
2ichText)&&void 0!==i&&i.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 j extends g{constructor(t){var e,r,i;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(r=t.data.contentsObj)&&void 0!==r&&r.str||null!==(i=t.data.richText)&&void 0!==i&&i.str),ignoreBorder:!0})}render(){return this.container.className="stampAnnotation",this.data.hasPopup||this._createPopup(null,this.data),this.container}}class U extends g{constructor(t){var e;super(t,{isRenderable:!0});let{filename:r,content:i}=this.data.file;this.filename=(0,n.getFilenameFromUrl)(r),this.content=i,null===(e=this.linkService.eventBus)||void 0===e||e.dispatch("fileattachmentannotation",{source:this,filename:r,content:i})}render(){var t,e;this.container.className="fileAttachmentAnnotation";let r=document.createElement("div");return r.className="popupTriggerArea",r.addEventListener("dblclick",this._download.bind(this)),!this.data.hasPopup&&(null!==(t=this.data.titleObj)&&void 0!==t&&t.str||null!==(e=this.data.contentsObj)&&void 0!==e&&e.str||this.data.richText)&&this._createPopup(r,this.data),this.container.append(r),this.container}_download(){var t;null===(t=this.downloadManager)||void 0===t||t.openOrDownloadData(this.container,this.content,this.filename)}}
2class B{static render(t){let{annotations:e,div:r,viewport:a,accessibilityManager:o}=t;l(this,B,q).call(this,r,a);let h=0;for(let c of e){if(c.annotationType!==i.AnnotationType.POPUP){let{width:t,height:e}=p(c.rect);if(t<=0||e<=0)continue}let e=f.create({data:c,layer:r,page:t.page,viewport:a,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:!1!==t.renderForms,svgFactory:new n.DOMSVGFactory,annotationStorage:t.annotationStorage||new s.AnnotationStorage,enableScripting:t.enableScripting,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,mouseState:t.mouseState||{isDown:!1}});if(e.isRenderable){let t=e.render();if(c.hidden&&(t.style.visibility="hidden"),Array.isArray(t))for(let e of t)e.style.zIndex=h++,l(B,B,W).call(B,e,c.id,r,o);else t.style.zIndex=h++,e instanceof w?r.prepend(t):l(B,B,W).call(B,t,c.id,r,o)}}l(this,B,G).call(this,r,t.annotationCanvasMap)}static update(t){let{annotationCanvasMap:e,div:r,viewport:i}=t;l(this,B,q).call(this,r,i),l(this,B,G).call(this,r,e),r.hidden=!1}}function W(t,e,r,i){let s=t.firstChild||t;s.id=`${n.AnnotationPrefix}${e}`,r.append(t),null==i||i.moveElementInDOM(r,t,s,!1)}function q(t,e){let{width:r,height:i,rotation:n}=e,{style:s}=t,a=n%180!=0,o=Math.floor(r)+"px",l=Math.floor(i)+"px";s.width=a?l:o,s.height=a?o:l,t.setAttribute("data-main-rotation",n)}function G(t,e){if(e){for(let[r,i]of e){let e=t.querySelector(`[data-annotation-id="${r}"]`);if(!e)continue;let{firstChild:n}=e;n?"CANVAS"===n.nodeName?n.replaceWith(i):n.before(i):e.append(i)}e.clear()}}e.AnnotationLayer=B},(t,e)=>{"use strict";function r(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;class i{static CMYK_G(t){let[e,r,i,n]=t;return["G",1-Math.min(1,.3*e+.59*i+.11*r+n)]}static G_CMYK(t){let[e]=t;return["CMYK",0,0,0,1-e]}static G_RGB(t){let[e]=t;return["RGB",e,e,e]}static G_HTML(t){let[e]=t,i=r(e);return`#${i}${i}${i}`}static RGB_G(t){let[e,r,i]=t;return["G",.3*e+.59*r+.11*i]}static RGB_HTML(t){let[e,i,n]=t,s=r(e),a=r(i),o=r(n);return`#${s}${a}${o}`}static T_HTML(){return"#00000000"}static CMYK_RGB(t){let[e,r,i,n]=t;return["RGB",1-Math.min(1,e+n),1-Math.min(1,i+n),1-Math.min(1,r+n)]}static CMYK_HTML(t){let e=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(e)}static RGB_CMYK(t){let[e,r,i]=t,n=1-e,s=1-r,a=1-i,o=Math.min(n,s,a);return["CMYK",n,s,a,o]}}e.ColorConverters=i},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.XfaLayer=void 0;var i=r(145);class n{static setupStorage(t,e,r,i,n){let s=i.getValue(e,{value:null});switch(r.name){case"textarea":if(null!==s.value&&(t.textContent=s.value),"print"===n)break;t.addEventListener("input",t=>{i.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"===n)break;t.addEventListener("change",t=>{i.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"===n)break;t.addEventListener("input",t=>{i.setValue(e,{value:t.target.value})})}break;case"select":if(null!==s.value)for(let t of r.children)t.attributes.value===s.value&&(t.attributes.selected=!0);t.addEventListener("input",t=>{let r=t.target.options,n=-1===r.selectedIndex?"":r[r.selectedIndex].value;i.setValue(e,{value:n})})}}static setAttributes(t){let{html:e,element:r,storage:i=null,intent:n,linkService:s}=t,{attributes:a}=r,o=e instanceof HTMLAnchorElement;for(let[t,r]of("radio"===a.type&&(a.name=`${a.name}-${n}`),Object.entries(a)))if(null!=r)switch(t){case"class":r.length&&e.setAttribute(t,r.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",r);break;case"style":Object.assign(e.style,r);break;case"textContent":e.textContent=r;break;default:o&&("href"===t||"newWindow"===t)||e.setAttribute(t,r)}o&&s.addLinkAttributes(e,a.href,a.newWindow),i&&a.dataId&&this.setupStorage(e,a.dataId,r,i)}static render(t){let e=t.annotationStorage,r=t.linkService,n=t.xfaHtml,s=t.
2intent||"display",a=document.createElement(n.name);n.attributes&&this.setAttributes({html:a,element:n,intent:s,linkService:r});let o=[[n,-1,a]],l=t.div;if(l.append(a),t.viewport){let e=`matrix(${t.viewport.transform.join(",")})`;l.style.transform=e}"richText"!==s&&l.setAttribute("class","xfaLayer xfaFont");let h=[];for(;o.length>0;){var c;let t;let[n,a,l]=o.at(-1);if(a+1===n.children.length){o.pop();continue}let d=n.children[++o.at(-1)[1]];if(null===d)continue;let{name:u}=d;if("#text"===u){let t=document.createTextNode(d.value);h.push(t),l.append(t);continue}if(t=null!=d&&null!==(c=d.attributes)&&void 0!==c&&c.xmlns?document.createElementNS(d.attributes.xmlns,u):document.createElement(u),l.append(t),d.attributes&&this.setAttributes({html:t,element:d,storage:e,intent:s,linkService:r}),d.children&&d.children.length>0)o.push([d,-1,t]);else if(d.value){let e=document.createTextNode(d.value);i.XfaText.shouldBuildText(u)&&h.push(e),t.append(e)}}for(let t of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))t.setAttribute("readOnly",!0);return{textDivs:h}}static update(t){let e=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=e,t.div.hidden=!1}}e.XfaLayer=n},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TextLayerRenderTask=void 0,e.renderTextLayer=b;var i=r(1),n=r(133);let s=1e5,a=30,o=.8,l=new Map,h=/^\s+$/g;function c(t,e){let r=l.get(t);if(r)return r;e.save(),e.font=`${a}px ${t}`;let i=e.measureText(""),n=i.fontBoundingBoxAscent,s=Math.abs(i.fontBoundingBoxDescent);if(n){e.restore();let r=n/(n+s);return l.set(t,r),r}e.strokeStyle="red",e.clearRect(0,0,a,a),e.strokeText("g",0,0);let h=e.getImageData(0,0,a,a).data;s=0;for(let t=h.length-1-3;t>=0;t-=4)if(h[t]>0){s=Math.ceil(t/4/a);break}e.clearRect(0,0,a,a),e.strokeText("A",0,a),h=e.getImageData(0,0,a,a).data,n=0;for(let t=0,e=h.length;t<e;t+=4)if(h[t]>0){n=a-Math.floor(t/4/a);break}if(e.restore(),n){let e=n/(n+s);return l.set(t,e),e}return l.set(t,o),o}function d(t,e,r,n){let s,a;let o=document.createElement("span"),l=t._enhanceTextSelection?{angle:0,canvasWidth:0,hasText:""!==e.str,hasEOL:e.hasEOL,originalTransform:null,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0,scale:1,fontSize:0}:{angle:0,canvasWidth:0,hasText:""!==e.str,hasEOL:e.hasEOL,fontSize:0};t._textDivs.push(o);let d=i.Util.transform(t._viewport.transform,e.transform),u=Math.atan2(d[1],d[0]),p=r[e.fontName];p.vertical&&(u+=Math.PI/2);let f=Math.hypot(d[2],d[3]),g=f*c(p.fontFamily,n);0===u?(s=d[4],a=d[5]-g):(s=d[4]+g*Math.sin(u),a=d[5]-g*Math.cos(u)),o.style.left=`${s}px`,o.style.top=`${a}px`,o.style.fontSize=`${f}px`,o.style.fontFamily=p.fontFamily,l.fontSize=f,o.setAttribute("role","presentation"),o.textContent=e.str,o.dir=e.dir,t._fontInspectorEnabled&&(o.dataset.fontName=e.fontName),0!==u&&(l.angle=180/Math.PI*u);let m=!1;if(e.str.length>1||t._enhanceTextSelection&&h.test(e.str))m=!0;else if(" "!==e.str&&e.transform[0]!==e.transform[3]){let t=Math.abs(e.transform[0]),r=Math.abs(e.transform[3]);t!==r&&Math.max(t,r)/Math.min(t,r)>1.5&&(m=!0)}if(m&&(p.vertical?l.canvasWidth=e.height*t._viewport.scale:l.canvasWidth=e.width*t._viewport.scale),t._textDivProperties.set(o,l),t._textContentStream&&t._layoutText(o),t._enhanceTextSelection&&l.hasText){let r,n,l=1,h=0;0!==u&&(l=Math.cos(u),h=Math.sin(u));let c=(p.vertical?e.height:e.width)*t._viewport.scale,d=f;0!==u?(r=[l,h,-h,l,s,a],n=i.Util.getAxialAlignedBoundingBox([0,0,c,d],r)):n=[s,a,s+c,a+d],t._bounds.push({left:n[0],top:n[1],right:n[2],bottom:n[3],div:o,size:[c,d],m:r})}}function u(t){if(t._canceled)return;let e=t._textDivs,r=t._capability,i=e.length;if(i>s){t._renderingDone=!0,r.resolve();return}if(!t._textContentStream)for(let r=0;r<i;r++)t._layoutText(e[r]);t._renderingDone=!0,r.resolve()}function p(t,e,r){let i=0;for(let n=0;n<r;n++){let r=t[e++];r>0&&(i=i?Math.min(r,i):r)}return i}function f(t){let e=t._bounds,r=t._viewport,n=g(r.width,r.height,e);for(let r=0;r<n.length;r++){let s=e[r].div,a=t._textDivProperties.get(s);if(0===a.angle){a.paddingLeft=e[r].left-n[r].left,a.paddingTop=e[r].top-n[r].top,a.paddingRight=n[r].right-e[r].right,a.paddingBottom=n[r].bottom-e[r].bottom,t._textDivProperties.set(s,a);continue}let o=n[r],l=e[r],h=l.m,c=h[0],d=h[1],u=[[0,0],[0,l.size[1]],[l.size[0],0],l.size],f=new Float64Array(64);for(let t=0,e=u.length;t<e;t++){let e=i.Util.applyTransform(u[t],h);f[t+0]=c&&(o.left-e[0])/c,f[t+4]=d&&(o.top-e[1])/d,f[t+8]=c&&(o.right-e[0])/c,f[t+12]=d&&(o.bottom-e[1])/d,f[t+16]=d&&-((o.left-e[0])/d),f[t+20]=c&&(o.top-e[1])/c,f[t+24]=d&&-((o.right-e[0])/d),f[t+28]=c&&(o.bottom-e[1])/c,f[t+32]=c&&-((o.left-e[0])/c),f[t+36]=d&&-((o.top-e[1])/d),f[t+40]=c&&-((o.right-e[0])/c),f[t+44]=d&&-((o.bottom-e[1])/d),f[t+48]=d&&(o.left-e[0])/d,f[t+52]=c&&-((o.top-e[1])/c),f[t+56]=d&&(o.right-e[0])/d,f[t+60]=c&&-((o.bottom-e[1])/c)}let g=1+Math.min(Math.abs(c),Math.abs(d));a.paddingLeft=p(f,32,16)/g,a.paddingTop=p(f,48,16)/g,a.paddingRight=p(f,0,16)/g,a.paddingBottom=p(f,16,16)/g,t._textDivProperties.set(s,a)}}function g(t,e,r){let i=r.map(function(t,e){return{x1:t.left,y1:t.top,x2:t.right,y2:t.bottom,index:e,x1New:void 0,x2New:void 0}});m(t,i);let n=Array(r.length);for(let t of i)n[t.index]={left:t.x1New,top:0,right:t.x2New,bottom:0};for(let s of(r.map(function(e,r){let s=n[r],a=i[r];a.x1=e.top,a.y1=t-s.right,a.x2=e.bottom,a.y2=t-s.left,a.index=r,a.x1New=void 0,a.x2New=void 0}),m(e,i),i)){let t=s.index;n[t].top=s.x1New,n[t].bottom=s.x2New}return n}function m(t,e){e.sort(function(t,e){return t.x1-e.x1||t.index-e.index});let r=[{start:-1/0,end:1/0,boundary:{x1:-1/0,y1:-1/0,x2:0,y2:1/0,index:-1,x1New:0,x2New:0}}];for(let t of e){let e,i,n=0;for(;n<r.length&&r[n].end<=t.y1;)n++;let s=r.length-1;for(;s>=0&&r[s].start>=t.y2;)s--;let a,o,l=-1/0;for(a=n;a<=s;a++){let n;(n=(i=(e=r[a]).boundary).x2>t.x1?i.index>t.index?i.x1New:t.x1:void 0===i.x2New?(i.x2+t.x1)/2:i.x2New)>l&&(l=n)}for(t.x1New=l,a=n;a<=s;a++)void 0===(i=(e=r[a]).boundary).x2New?i.x2>t.x1?i.index>t.index&&(i.x2New=i.x2):i.x2New=l:i.x2New>l&&(i.x2New=Math.max(l,i.x2));let h=[],c=null;for(a=n;a<=s;a++){let n=(i=(e=r[a]).boundary).x2>t.x2?i:t;c===n?h.at(-1).end=e.end:(h.push({start:e.start,end:e.end,boundary:n}),c=n)}for(r[n].start<t.y1&&(h[0].start=t.y1,h.unshift({start:r[n].start,end:t.y1,boundary:r[n].boundary})),t.y2<r[s].end&&(h.at(-1).end=t.y2,h.push({start:t.y2,end:r[s].end,boundary:r[s].boundary})),a=n;a<=s;a++){if(void 0!==(i=(e=r[a]).boundary).x2New)continue;let t=!1;for(o=n-1;!t&&o>=0&&r[o].start>=i.y1;o--)t=r[o].boundary===i;for(o=s+1;!t&&o<r.length&&r[o].end<=i.y2;o++)t=r[o].boundary===i;for(o=0;!t&&o<h.length;o++)t=h[o].boundary===i;t||(i.x2New=l)}Array.prototype.splice.apply(r,[n,s-n+1,...h])}for(let e of r){let r=e.boundary;void 0===r.x2New&&(r.x2New=Math.max(t,r.x2))}}class v{constructor(t){var e;let{textContent:r,textContentStream:s,container:a,viewport:o,textDivs:l,textContentItemsStr:h,enhanceTextSelection:c}=t;c&&(0,n.deprecated)("The `enhanceTextSelection` functionality will be removed in the future."),this._textContent=r,this._textContentStream=s,this._container=a,this._document=a.ownerDocument,this._viewport=o,this._textDivs=l||[],this._textContentItemsStr=h||[],this._enhanceTextSelection=!!c,this._fontInspectorEnabled=!!(null!==(e=globalThis.FontInspector)&&void 0!==e&&e.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,i.createPromiseCapability)(),this._renderTimer=null,this._bounds=[],this._devicePixelRatio=globalThis.devicePixelRatio||1,this._capability.promise.finally(()=>{this._enhanceTextSelection||(this._textDivProperties=null),this._layoutTextCtx&&(this._layoutTextCtx.canvas.width=0,this._layoutTextCtx.canvas.height=0,this._layoutTextCtx=null)}
2).catch(()=>{})}get promise(){return this._capability.promise}cancel(){this._canceled=!0,this._reader&&(this._reader.cancel(new i.AbortException("TextLayer task cancelled.")).catch(()=>{}),this._reader=null),null!==this._renderTimer&&(clearTimeout(this._renderTimer),this._renderTimer=null),this._capability.reject(Error("TextLayer task cancelled."))}_processItems(t,e){for(let r=0,i=t.length;r<i;r++){if(void 0===t[r].str){if("beginMarkedContentProps"===t[r].type||"beginMarkedContent"===t[r].type){let e=this._container;this._container=document.createElement("span"),this._container.classList.add("markedContent"),null!==t[r].id&&this._container.setAttribute("id",`${t[r].id}`),e.append(this._container)}else"endMarkedContent"===t[r].type&&(this._container=this._container.parentNode);continue}this._textContentItemsStr.push(t[r].str),d(this,t[r],e,this._layoutTextCtx)}}_layoutText(t){let e=this._textDivProperties.get(t),r="";if(0!==e.canvasWidth&&e.hasText){let{fontFamily:i}=t.style,{fontSize:n}=e;(n!==this._layoutTextLastFontSize||i!==this._layoutTextLastFontFamily)&&(this._layoutTextCtx.font=`${n*this._devicePixelRatio}px ${i}`,this._layoutTextLastFontSize=n,this._layoutTextLastFontFamily=i);let{width:s}=this._layoutTextCtx.measureText(t.textContent);if(s>0){let t=this._devicePixelRatio*e.canvasWidth/s;this._enhanceTextSelection&&(e.scale=t),r=`scaleX(${t})`}}if(0!==e.angle&&(r=`rotate(${e.angle}deg) ${r}`),r.length>0&&(this._enhanceTextSelection&&(e.originalTransform=r),t.style.transform=r),e.hasText&&this._container.append(t),e.hasEOL){let t=document.createElement("br");t.setAttribute("role","presentation"),this._container.append(t)}}_render(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=(0,i.createPromiseCapability)(),r=Object.create(null),n=this._document.createElement("canvas");if(n.height=n.width=a,this._layoutTextCtx=n.getContext("2d",{alpha:!1}),this._textContent){let t=this._textContent.items,r=this._textContent.styles;this._processItems(t,r),e.resolve()}else if(this._textContentStream){let t=()=>{this._reader.read().then(i=>{let{value:n,done:s}=i;if(s){e.resolve();return}Object.assign(r,n.styles),this._processItems(n.items,r),t()},e.reject)};this._reader=this._textContentStream.getReader(),t()}else throw Error('Neither "textContent" nor "textContentStream" parameters specified.');e.promise.then(()=>{r=null,t?this._renderTimer=setTimeout(()=>{u(this),this._renderTimer=null},t):u(this)},this._capability.reject)}expandTextDivs(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this._enhanceTextSelection||!this._renderingDone)return;null!==this._bounds&&(f(this),this._bounds=null);let e=[],r=[];for(let i=0,n=this._textDivs.length;i<n;i++){let n=this._textDivs[i],s=this._textDivProperties.get(n);s.hasText&&(t?(e.length=0,r.length=0,s.originalTransform&&e.push(s.originalTransform),s.paddingTop>0?(r.push(`${s.paddingTop}px`),e.push(`translateY(${-s.paddingTop}px)`)):r.push(0),s.paddingRight>0?r.push(`${s.paddingRight/s.scale}px`):r.push(0),s.paddingBottom>0?r.push(`${s.paddingBottom}px`):r.push(0),s.paddingLeft>0?(r.push(`${s.paddingLeft/s.scale}px`),e.push(`translateX(${-s.paddingLeft/s.scale}px)`)):r.push(0),n.style.padding=r.join(" "),e.length&&(n.style.transform=e.join(" "))):(n.style.padding=null,n.style.transform=s.originalTransform))}}}function b(t){let e=new v({textContent:t.textContent,textContentStream:t.textContentStream,container:t.container,viewport:t.viewport,textDivs:t.textDivs,textContentItemsStr:t.textContentItemsStr,enhanceTextSelection:t.enhanceTextSelection});return e._render(t.timeout),e}e.TextLayerRenderTask=v},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SVGGraphics=void 0;var i=r(133),n=r(1),s=r(3);let a=class{constructor(){(0,n.unreachable)("Not implemented: SVGGraphics")}};e.SVGGraphics=a;{let t={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},r="http://www.w3.org/XML/1998/namespace",c="http://www.w3.org/1999/xlink",d=["butt","round","square"],u=["miter","round","bevel"],p=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(URL.createObjectURL&&"undefined"!=typeof Blob&&!r)return URL.createObjectURL(new Blob([t],{type:e}));let i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
2+/=",n=`data:${e};base64,`;for(let e=0,r=t.length;e<r;e+=3){let s=255&t[e],a=255&t[e+1],o=255&t[e+2],l=s>>2,h=(3&s)<<4|a>>4,c=e+1<r?(15&a)<<2|o>>6:64,d=e+2<r?63&o:64;n+=i[l]+i[h]+i[c]+i[d]}return n},f=function(){let t=new Uint8Array([137,80,78,71,13,10,26,10]),e=12,r=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;r[t]=e}function i(t,e,i){let n=-1;for(let s=e;s<i;s++){let e=r[(n^t[s])&255];n=n>>>8^e}return -1^n}function a(t,e,r,n){let s=n,a=e.length;r[s]=a>>24&255,r[s+1]=a>>16&255,r[s+2]=a>>8&255,r[s+3]=255&a,r[s+=4]=255&t.charCodeAt(0),r[s+1]=255&t.charCodeAt(1),r[s+2]=255&t.charCodeAt(2),r[s+3]=255&t.charCodeAt(3),s+=4,r.set(e,s);let o=i(r,n+4,s+=e.length);r[s]=o>>24&255,r[s+1]=o>>16&255,r[s+2]=o>>8&255,r[s+3]=255&o}function o(t,e,r){let i=1,n=0;for(let s=e;s<r;++s)n=(n+(i=(i+(255&t[s]))%65521))%65521;return n<<16|i}function l(t){if(!s.isNodeJS)return h(t);try{let e;e=parseInt(process.versions.node)>=8?t:Buffer.from(t);let r=__webpack_require__(89728).deflateSync(e,{level:9});return r instanceof Uint8Array?r:new Uint8Array(r)}catch(t){(0,n.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+t)}return h(t)}function h(t){let e=t.length,r=65535,i=Math.ceil(e/65535),n=new Uint8Array(2+e+5*i+4),s=0;n[s++]=120,n[s++]=156;let a=0;for(;e>r;)n[s++]=0,n[s++]=255,n[s++]=255,n[s++]=0,n[s++]=0,n.set(t.subarray(a,a+r),s),s+=r,a+=r,e-=r;n[s++]=1,n[s++]=255&e,n[s++]=e>>8&255,n[s++]=255&~e,n[s++]=(65535&~e)>>8&255,n.set(t.subarray(a),s),s+=t.length-a;let l=o(t,0,t.length);return n[s++]=l>>24&255,n[s++]=l>>16&255,n[s++]=l>>8&255,n[s++]=255&l,n}function c(r,i,s,o){let h,c,d;let u=r.width,f=r.height,g=r.data;switch(i){case n.ImageKind.GRAYSCALE_1BPP:c=0,h=1,d=u+7>>3;break;case n.ImageKind.RGB_24BPP:c=2,h=8,d=3*u;break;case n.ImageKind.RGBA_32BPP:c=6,h=8,d=4*u;break;default:throw Error("invalid format")}let m=new Uint8Array((1+d)*f),v=0,b=0;for(let t=0;t<f;
2++t)m[v++]=0,m.set(g.subarray(b,b+d),v),b+=d,v+=d;if(i===n.ImageKind.GRAYSCALE_1BPP&&o){v=0;for(let t=0;t<f;t++){v++;for(let t=0;t<d;t++)m[v++]^=255}}let y=new Uint8Array([u>>24&255,u>>16&255,u>>8&255,255&u,f>>24&255,f>>16&255,f>>8&255,255&f,h,c,0,0,0]),A=l(m),_=new Uint8Array(t.length+3*e+y.length+A.length),S=0;return _.set(t,S),a("IHDR",y,_,S+=t.length),a("IDATA",A,_,S+=e+y.length),S+=e+A.length,a("IEND",new Uint8Array(0),_,S),p(_,"image/png",s)}return function(t,e,r){let i=void 0===t.kind?n.ImageKind.GRAYSCALE_1BPP:t.kind;return c(t,i,e,r)}}();class g{constructor(){this.fontSizeScale=1,this.fontWeight=t.fontWeight,this.fontSize=0,this.textMatrix=n.IDENTITY_MATRIX,this.fontMatrix=n.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=n.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=t.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 o(t){let e=[],r=[];for(let i of t){if("save"===i.fn){e.push({fnId:92,fn:"group",items:[]}),r.push(e),e=e.at(-1).items;continue}"restore"===i.fn?e=r.pop():e.push(i)}return e}function l(t){if(Number.isInteger(t))return t.toString();let e=t.toFixed(10),r=e.length-1;if("0"!==e[r])return e;do r--;while("0"===e[r]);return e.substring(0,"."===e[r]?r:r+1)}function h(t){if(0===t[4]&&0===t[5]){if(0===t[1]&&0===t[2])return 1===t[0]&&1===t[3]?"":`scale(${l(t[0])} ${l(t[3])})`;if(t[0]===t[3]&&t[1]===-t[2]){let e=180*Math.acos(t[0])/Math.PI;return`rotate(${l(e)})`}}else if(1===t[0]&&0===t[1]&&0===t[2]&&1===t[3])return`translate(${l(t[4])} ${l(t[5])})`;return`matrix(${l(t[0])} ${l(t[1])} ${l(t[2])} ${l(t[3])} ${l(t[4])} ${l(t[5])})`}let m=0,v=0,b=0;e.SVGGraphics=a=class{constructor(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];for(let s in(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 g,this.transformMatrix=n.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=[],n.OPS)this._operatorIdMapping[n.OPS[s]]=s}save(){this.transformStack.push(this.transformMatrix);let 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){let e=t.fnArray,r=t.argsArray;for(let t=0,i=e.length;t<i;t++)if(e[t]===n.OPS.dependency)for(let e of r[t]){let t=e.startsWith("g_")?this.commonObjs:this.objs,r=new Promise(r=>{t.get(e,r)});this.current.dependencies.push(r)}return Promise.all(this.current.dependencies)}transform(t,e,r,i,s,a){let o=[t,e,r,i,s,a];this.transformMatrix=n.Util.transform(this.transformMatrix,o),this.tgrp=null}getSVG(t,e){this.viewport=e;let r=this._initialize(e);return this.loadDependencies(t).then(()=>(this.transformMatrix=n.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(t)),r))}convertOpList(t){let e=this._operatorIdMapping,r=t.argsArray,i=t.fnArray,n=[];for(let t=0,s=i.length;t<s;t++){let s=i[t];n.push({fnId:s,fn:e[s],args:r[t]})}return o(n)}executeOpTree(t){for(let e of t){let t=e.fn,r=e.fnId,i=e.args;switch(0|r){case n.OPS.beginText:this.beginText();break;case n.OPS.dependency:break;case n.OPS.setLeading:this.setLeading(i);break;case n.OPS.setLeadingMoveText:this.setLeadingMoveText(i[0],i[1]);break;case n.OPS.setFont:this.setFont(i);break;case n.OPS.showText:case n.OPS.showSpacedText:this.showText(i[0]);break;case n.OPS.endText:this.endText();break;case n.OPS.moveText:this.moveText(i[0],i[1]);break;case n.OPS.setCharSpacing:this.setCharSpacing(i[0]);break;case n.OPS.setWordSpacing:this.setWordSpacing(i[0]);break;case n.OPS.setHScale:this.setHScale(i[0]);break;case n.OPS.setTextMatrix:this.setTextMatrix(i[0],i[1],i[2],i[3],i[4],i[5]);break;case n.OPS.setTextRise:this.setTextRise(i[0]);break;case n.OPS.setTextRenderingMode:this.setTextRenderingMode(i[0]);break;
2case n.OPS.setLineWidth:this.setLineWidth(i[0]);break;case n.OPS.setLineJoin:this.setLineJoin(i[0]);break;case n.OPS.setLineCap:this.setLineCap(i[0]);break;case n.OPS.setMiterLimit:this.setMiterLimit(i[0]);break;case n.OPS.setFillRGBColor:this.setFillRGBColor(i[0],i[1],i[2]);break;case n.OPS.setStrokeRGBColor:this.setStrokeRGBColor(i[0],i[1],i[2]);break;case n.OPS.setStrokeColorN:this.setStrokeColorN(i);break;case n.OPS.setFillColorN:this.setFillColorN(i);break;case n.OPS.shadingFill:this.shadingFill(i[0]);break;case n.OPS.setDash:this.setDash(i[0],i[1]);break;case n.OPS.setRenderingIntent:this.setRenderingIntent(i[0]);break;case n.OPS.setFlatness:this.setFlatness(i[0]);break;case n.OPS.setGState:this.setGState(i[0]);break;case n.OPS.fill:this.fill();break;case n.OPS.eoFill:this.eoFill();break;case n.OPS.stroke:this.stroke();break;case n.OPS.fillStroke:this.fillStroke();break;case n.OPS.eoFillStroke:this.eoFillStroke();break;case n.OPS.clip:this.clip("nonzero");break;case n.OPS.eoClip:this.clip("evenodd");break;case n.OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case n.OPS.paintImageXObject:this.paintImageXObject(i[0]);break;case n.OPS.paintInlineImageXObject:this.paintInlineImageXObject(i[0]);break;case n.OPS.paintImageMaskXObject:this.paintImageMaskXObject(i[0]);break;case n.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(i[0],i[1]);break;case n.OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case n.OPS.closePath:this.closePath();break;case n.OPS.closeStroke:this.closeStroke();break;case n.OPS.closeFillStroke:this.closeFillStroke();break;case n.OPS.closeEOFillStroke:this.closeEOFillStroke();break;case n.OPS.nextLine:this.nextLine();break;case n.OPS.transform:this.transform(i[0],i[1],i[2],i[3],i[4],i[5]);break;case n.OPS.constructPath:this.constructPath(i[0],i[1]);break;case n.OPS.endPath:this.endPath();break;case 92:this.group(e.items);break;default:(0,n.warn)(`Unimplemented operator ${t}`)}}}setWordSpacing(t){this.current.wordSpacing=t}setCharSpacing(t){this.current.charSpacing=t}nextLine(){this.moveText(0,this.current.leading)}setTextMatrix(t,e,r,i,n,s){let a=this.current;a.textMatrix=a.lineMatrix=[t,e,r,i,n,s],a.textMatrixScale=Math.hypot(t,e),a.x=a.lineX=0,a.y=a.lineY=0,a.xcoords=[],a.ycoords=[],a.tspan=this.svgFactory.createElement("svg:tspan"),a.tspan.setAttributeNS(null,"font-family",a.fontFamily),a.tspan.setAttributeNS(null,"font-size",`${l(a.fontSize)}px`),a.tspan.setAttributeNS(null,"y",l(-a.y)),a.txtElement=this.svgFactory.createElement("svg:text"),a.txtElement.append(a.tspan)}beginText(){let t=this.current;t.x=t.lineX=0,t.y=t.lineY=0,t.textMatrix=n.IDENTITY_MATRIX,t.lineMatrix=n.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){let 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",`${l(r.fontSize)}px`),r.tspan.setAttributeNS(null,"y",l(-r.y))}showText(e){let i=this.current,s=i.font,a=i.fontSize;if(0===a)return;let o=i.fontSizeScale,c=i.charSpacing,d=i.wordSpacing,u=i.fontDirection,p=i.textHScale*u,f=s.vertical,g=f?1:-1,m=s.defaultVMetrics,v=a*i.fontMatrix[0],b=0;for(let t of e){let e,r,n;if(null===t){b+=u*d;continue}if("number"==typeof t){b+=g*t*a/1e3;continue}let l=(t.isSpace?d:0)+c,h=t.fontChar,p=t.width;if(f){let i;let n=t.vmetric||m;i=-(i=t.vmetric?n[1]:.5*p)*v;let s=n[2]*v;p=n?-n[0]:p,e=i/o,r=(b+s)/o}else e=b/o,r=0;(t.isInFont||s.missingFile)&&(i.xcoords.push(i.x+e),f&&i.ycoords.push(-i.y+r),i.tspan.textContent+=h),b+=n=f?p*v-l*u:p*v+l*u}i.tspan.setAttributeNS(null,"x",i.xcoords.map(l).join(" ")),f?i.tspan.setAttributeNS(null,"y",i.ycoords.map(l).join(" ")):i.tspan.setAttributeNS(null,"y",l(-i.y)),f?i.y-=b:i.x+=b*p,i.tspan.setAttributeNS(null,"font-family",i.fontFamily),i.tspan.setAttributeNS(null,"font-size",`${l(i.fontSize)}px`),i.fontStyle!==t.fontStyle&&i.tspan.setAttributeNS(null,"font-style",i.fontStyle),i.fontWeight!==t.fontWeight&&i.tspan.setAttributeNS(null,"font-weight",i.fontWeight);let y=i.textRenderingMode&n.TextRenderingMode.FILL_STROKE_MASK;if(y===n.TextRenderingMode.FILL||y===n.TextRenderingMode.FILL_STROKE?(i.fillColor!==t.fillColor&&i.tspan.setAttributeNS(null,"fill",i.fillColor),i.fillAlpha<1&&i.tspan.setAttributeNS(null,"fill-opacity",i.fillAlpha)):i.textRenderingMode===n.TextRenderingMode.ADD_TO_PATH?i.tspan.setAttributeNS(null,"fill","transparent"):i.tspan.setAttributeNS(null,"fill","none"),y===n.TextRenderingMode.STROKE||y===n.TextRenderingMode.FILL_STROKE){let t=1/(i.textMatrixScale||1);this._setStrokeAttributes(i.tspan,t)}let A=i.textMatrix;0!==i.textRise&&(A=A.slice(),A[5]+=i.textRise),i.txtElement.setAttributeNS(null,"transform",`${h(A)} scale(${l(p)}, -1)`),i.txtElement.setAttributeNS(r,"xml:space","preserve"),i.txtElement.append(i.tspan),i.txtgrp.append(i.txtElement),this._ensureTransformGroup().append(i.txtElement)}setLeadingMoveText(t,e){this.setLeading(-e),this.moveText(t,e)}addFontStyle(t){if(!t.data)throw 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));let e=p(t.data,t.mimetype,this.forceDataSchema);this.cssStyle.textContent+=`@font-face { font-family: "${t.loadedName}"; src: url(${e}); } 3`}setFont(t){let e=this.current,r=this.commonObjs.get(t[0]),i=t[1];e.font=r,!this.embedFonts||r.missingFile||this.embeddedFonts[r.loadedName]||(this.addFontStyle(r),this.embeddedFonts[r.loadedName]=r),e.fontMatrix=r.fontMatrix||n.FONT_IDENTITY_MATRIX;let s="normal";r.black?s="900":r.bold&&(s="bold");let a=r.italic?"italic":"normal";i<0?(i=-i,e.fontDirection=-1):e.fontDirection=1,e.fontSize=i,e.fontFamily=r.loadedName,e.fontWeight=s,e.fontStyle=a,e.tspan=this.svgFactory.createElement("svg:tspan"),e.tspan.setAttributeNS(null,"y",l(-e.y)),e.xcoords=[],e.ycoords=[]}endText(){var t;let e=this.current;e.textRenderingMode&n.TextRenderingMode.ADD_TO_PATH_FLAG&&null!==(t=e.txtElement)&&void 0!==t&&t.hasChildNodes()&&(e.element=e.txtElement,this.clip("nonzero"),this.endPath())}setLineWidth(t){t>0&&(this.current.lineWidth=t)}setLineCap(t){this.current.lineCap=d[t]}setLineJoin(t){this.current.lineJoin=u[t]}setMiterLimit(t){this.current.miterLimit=t}setStrokeAlpha(t){this.current.strokeAlpha=t}setStrokeRGBColor(t,e,r){this.current.strokeColor=n.Util.makeHexColor(t,e,r)}setFillAlpha(t){this.current.fillAlpha=t}setFillRGBColor(t,e,r){this.current.fillColor=n.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){let e=this.viewport.width,r=this.viewport.height,i=n.Util.inverseTransform(this.transformMatrix),s=n.Util.applyTransform([0,0],i),a=n.Util.applyTransform([0,r],i),o=n.Util.applyTransform([e,0],i),l=n.Util.applyTransform([e,r],i),h=Math.min(s[0],a[0],o[0],l[0]),c=Math.min(s[1],a[1],o[1],l[1]),d=Math.max(s[0],a[0],o[0],l[0]),u=Math.max(s[1],a[1],o[1],l[1]),p=this.svgFactory.createElement("svg:rect");p.setAttributeNS(null,"x",h),p.setAttributeNS(null,"y",c),p.setAttributeNS(null,"width",d-h),p.setAttributeNS(null,"height",u-c),p.setAttributeNS(null,"fill",this._makeShadingPattern(t)),this.current.fillAlpha<1&&p.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(p)}_makeColorN_Pattern(t){return"TilingPattern"===t[0]?this._makeTilingPattern(t):this._makeShadingPattern(t)}_makeTilingPattern(t){let e=t[1],r=t[2],i=t[3]||n.IDENTITY_MATRIX,[s,a,o,l]=t[4],h=t[5],c=t[6],d=t[7],u=`shading${b++}`,[p,f,g,m]=n.Util.normalizeRect([...n.Util.applyTransform([s,a],i),...n.Util.applyTransform([o,l],i)]),[v,y]=n.Util.singularValueDecompose2dScale(i),A=h*v,_=c*y,S=this.svgFactory.createElement("svg:pattern");S.setAttributeNS(null,"id",u),S.setAttributeNS(null,"patternUnits","userSpaceOnUse"),S.setAttributeNS(null,"width",A),S.setAttributeNS(null,"height",_),S.setAttributeNS(null,"x",`${p}`),S.setAttributeNS(null,"y",`${f}`);let x=this.svg,w=this.transformMatrix,E=this.current.fillColor,C=this.current.strokeColor,T=this.svgFactory.create(g-p,m-f);if(this.svg=T,this.transformMatrix=i,2===d){let t=n.Util.makeHexColor(...e);this.current.fillColor=t,this.current.strokeColor=t}return this.executeOpTree(this.convertOpList(r)),this.svg=x,this.transformMatrix=w,this.current.fillColor=E,this.current.strokeColor=C,S.append(T.childNodes[0]),this.defs.append(S),`url(#${u})`}_makeShadingPattern(t){switch("string"==typeof t&&(t=this.objs.get(t)),t[0]){case"RadialAxial":let e;let r=`shading${b++}`,i=t[3];switch(t[1]){case"axial":let s=t[4],a=t[5];(e=this.svgFactory.createElement("svg:linearGradient")).setAttributeNS(null,"id",r),e.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),e.setAttributeNS(null,"x1",s[0]),e.setAttributeNS(null,"y1",s[1]),e.setAttributeNS(null,"x2",a[0]),e.setAttributeNS(null,"y2",a[1]);break;case"radial":let o=t[4],l=t[5],h=t[6],c=t[7];(e=this.svgFactory.createElement("svg:radialGradient")).setAttributeNS(null,"id",r),e.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),e.setAttributeNS(null,"cx",l[0]),e.setAttributeNS(null,"cy",l[1]),e.setAttributeNS(null,"r",c),e.setAttributeNS(null,"fx",o[0]),e.setAttributeNS(null,"fy",o[1]),e.setAttributeNS(null,"fr",h);break;default:throw Error(`Unknown RadialAxial type: ${t[1]}`)}for(let t of i){let r=this.svgFactory.createElement("svg:stop");
3r.setAttributeNS(null,"offset",t[0]),r.setAttributeNS(null,"stop-color",t[1]),e.append(r)}return this.defs.append(e),`url(#${r})`;case"Mesh":return(0,n.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw Error(`Unknown IR type: ${t[0]}`)}}setDash(t,e){this.current.dashArray=t,this.current.dashPhase=e}constructPath(t,e){let r=this.current,i=r.x,s=r.y,a=[],o=0;for(let r of t)switch(0|r){case n.OPS.rectangle:i=e[o++],s=e[o++];let t=e[o++],h=e[o++],c=i+t,d=s+h;a.push("M",l(i),l(s),"L",l(c),l(s),"L",l(c),l(d),"L",l(i),l(d),"Z");break;case n.OPS.moveTo:i=e[o++],s=e[o++],a.push("M",l(i),l(s));break;case n.OPS.lineTo:i=e[o++],s=e[o++],a.push("L",l(i),l(s));break;case n.OPS.curveTo:i=e[o+4],s=e[o+5],a.push("C",l(e[o]),l(e[o+1]),l(e[o+2]),l(e[o+3]),l(i),l(s)),o+=6;break;case n.OPS.curveTo2:a.push("C",l(i),l(s),l(e[o]),l(e[o+1]),l(e[o+2]),l(e[o+3])),i=e[o+2],s=e[o+3],o+=4;break;case n.OPS.curveTo3:i=e[o+2],s=e[o+3],a.push("C",l(e[o]),l(e[o+1]),l(i),l(s),l(i),l(s)),o+=4;break;case n.OPS.closePath:a.push("Z")}a=a.join(" "),r.path&&t.length>0&&t[0]!==n.OPS.rectangle&&t[0]!==n.OPS.moveTo?a=r.path.getAttributeNS(null,"d")+a:(r.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().append(r.path)),r.path.setAttributeNS(null,"d",a),r.path.setAttributeNS(null,"fill","none"),r.element=r.path,r.setCurrentPoint(i,s)}endPath(){let t=this.current;if(t.path=null,!this.pendingClip)return;if(!t.element){this.pendingClip=null;return}let e=`clippath${m++}`,r=this.svgFactory.createElement("svg:clipPath");r.setAttributeNS(null,"id",e),r.setAttributeNS(null,"transform",h(this.transformMatrix));let i=t.element.cloneNode(!0);if("evenodd"===this.pendingClip?i.setAttributeNS(null,"clip-rule","evenodd"):i.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,r.append(i),this.defs.append(r),t.activeClipUrl){for(let e of(t.clipGroup=null,this.extraStack))e.clipGroup=null;r.setAttributeNS(null,"clip-path",t.activeClipUrl)}t.activeClipUrl=`url(#${e})`,this.tgrp=null}clip(t){this.pendingClip=t}closePath(){let t=this.current;if(t.path){let e=`${t.path.getAttributeNS(null,"d")}Z`;t.path.setAttributeNS(null,"d",e)}}setLeading(t){this.current.leading=-t}setTextRise(t){this.current.textRise=t}setTextRenderingMode(t){this.current.textRenderingMode=t}setHScale(t){this.current.textHScale=t/100}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(let[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,n.warn)(`Unimplemented graphic state operator ${e}`)}}fill(){let t=this.current;t.element&&(t.element.setAttributeNS(null,"fill",t.fillColor),t.element.setAttributeNS(null,"fill-opacity",t.fillAlpha),this.endPath())}stroke(){let t=this.current;t.element&&(this._setStrokeAttributes(t.element),t.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=this.current,i=r.dashArray;1!==e&&i.length>0&&(i=i.map(function(t){return e*t})),t.setAttributeNS(null,"stroke",r.strokeColor),t.setAttributeNS(null,"stroke-opacity",r.strokeAlpha),t.setAttributeNS(null,"stroke-miterlimit",l(r.miterLimit)),t.setAttributeNS(null,"stroke-linecap",r.lineCap),t.setAttributeNS(null,"stroke-linejoin",r.lineJoin),t.setAttributeNS(null,"stroke-width",l(e*r.lineWidth)+"px"),t.setAttributeNS(null,"stroke-dasharray",i.map(l).join(" ")),t.setAttributeNS(null,"stroke-dashoffset",l(e*r.dashPhase)+"px")}eoFill(){this.current.element&&this.current.element.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){this.current.element&&this.current.element.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}closeStroke(){this.closePath(),this.stroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.closePath(),this.eoFillStroke()}paintSolidColorImageMask(){let 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){let e=t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t);if(!e){(0,n.warn)(`Dependent image with object ID ${t} is not ready yet`);return}this.paintInlineImageXObject(e)}paintInlineImageXObject(t,e){let r=t.width,i=t.height,n=f(t,this.forceDataSchema,!!e),s=this.svgFactory.createElement("svg:rect");s.setAttributeNS(null,"x","0"),s.setAttributeNS(null,"y","0"),s.setAttributeNS(null,"width",l(r)),s.setAttributeNS(null,"height",l(i)),this.current.element=s,this.clip("nonzero");let a=this.svgFactory.createElement("svg:image");a.setAttributeNS(c,"xlink:href",n),a.setAttributeNS(null,"x","0"),a.setAttributeNS(null,"y",l(-i)),a.setAttributeNS(null,"width",l(r)+"px"),a.setAttributeNS(null,"height",l(i)+"px"),a.setAttributeNS(null,"transform",`scale(${l(1/r)} ${l(-1/i)})`),e?e.append(a):this._ensureTransformGroup().append(a)}paintImageMaskXObject(t){let e=this.current,r=t.width,i=t.height,n=e.fillColor;e.maskId=`mask${v++}`;let s=this.svgFactory.createElement("svg:mask");s.setAttributeNS(null,"id",e.maskId);let a=this.svgFactory.createElement("svg:rect");a.setAttributeNS(null,"x","0"),a.setAttributeNS(null,"y","0"),a.setAttributeNS(null,"width",l(r)),a.setAttributeNS(null,"height",l(i)),a.setAttributeNS(null,"fill",n),a.setAttributeNS(null,"mask",`url(#${e.maskId})`),this.defs.append(s),this._ensureTransformGroup().append(a),this.paintInlineImageXObject(t,s)}paintFormXObjectBegin(t,e){if(Array.isArray(t)&&6===t.length&&this.transform(t[0],t[1],t[2],t[3],t[4],t[5]),e){let t=e[2]-e[0],r=e[3]-e[1],i=this.svgFactory.createElement("svg:rect");i.setAttributeNS(null,"x",e[0]),i.setAttributeNS(null,"y",e[1]),i.setAttributeNS(null,"width",l(t)),i.setAttributeNS(null,"height",l(r)),this.current.element=i,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(t){let e=this.svgFactory.create(t.width,t.height),r=this.svgFactory.createElement("svg:defs");e.append(r),this.defs=r;let i=this.svgFactory.createElement("svg:g");return i.setAttributeNS(null,"transform",h(t.transform)),e.append(i),this.svg=i,e}_ensureClipGroup(){if(!this.current.clipGroup){let t=this.svgFactory.createElement("svg:g");t.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.append(t),this.current.clipGroup=t}return this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",h(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().append(this.tgrp):this.svg.append(this.tgrp)),this.tgrp}}}},(t,e,r)=>{"use strict";
3Object.defineProperty(e,"__esModule",{value:!0}),e.PDFNodeStream=void 0;var i=r(1),n=r(158);let s=__webpack_require__(64160),a=__webpack_require__(66115),o=__webpack_require__(90922),l=__webpack_require__(38398),h=/^file:\/\/\/[a-zA-Z]:\//;function c(t){let e=l.parse(t);return"file:"===e.protocol||e.host?e:/^[a-z]:[/\\]/i.test(t)?l.parse(`file:///${t}`):(e.host||(e.protocol="file:"),e)}class d{constructor(t){this.source=t,this.url=c(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,e;return null!==(t=null===(e=this._fullRequestReader)||void 0===e?void 0:e._loaded)&&void 0!==t?t:0}getFullReader(){return(0,i.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new v(this):new g(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;let r=this.isFsUrl?new b(this,t,e):new m(this,t,e);return this._rangeRequestReaders.push(r),r}cancelAllRequests(t){for(let e of(this._fullRequestReader&&this._fullRequestReader.cancel(t),this._rangeRequestReaders.slice(0)))e.cancel(t)}}e.PDFNodeStream=d;class u{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null;let e=t.source;this._contentLength=e.length,this._loaded=0,this._filename=null,this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange,this._readableStream=null,this._readCapability=(0,i.createPromiseCapability)(),this._headersCapability=(0,i.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(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;let t=this._readableStream.read();return null===t?(this._readCapability=(0,i.createPromiseCapability)(),this.read()):(this._loaded+=t.length,this.onProgress&&this.onProgress({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){if(!this._readableStream){this._error(t);return}this._readableStream.destroy(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",t=>{this._error(t)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new i.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class p{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=(0,i.createPromiseCapability)();let e=t.source;this._isStreamingSupported=!e.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;let t=this._readableStream.read();return null===t?(this._readCapability=(0,i.createPromiseCapability)(),this.read()):(this._loaded+=t.length,this.onProgress&&this.onProgress({loaded:this._loaded}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){if(!this._readableStream){this._error(t);return}this._readableStream.destroy(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",t=>{this._error(t)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function f(t,e){return{protocol:t.protocol,auth:t.auth,host:t.hostname,port:t.port,path:t.path,method:"GET",headers:e}}class g extends u{constructor(t){super(t);let e=e=>{if(404===e.statusCode){let t=new i.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=t,this._headersCapability.reject(t);return}this._headersCapability.resolve(),this._setReadableStream(e);let r=t=>this._readableStream.headers[t.toLowerCase()],{allowRangeRequests:s,suggestedLength:a}=(0,n.validateRangeRequestCapabilities)({getResponseHeader:r,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=s,this._contentLength=a||this._contentLength,this._filename=(0,n.extractFilenameFromHeader)(r)};this._request=null,"http:"===this._url.protocol?this._request=a.request(f(this._url,t.httpHeaders),e):this._request=o.request(f(this._url,t.httpHeaders),e),this._request.on("error",t=>{this._storedError=t,this._headersCapability.reject(t)}),this._request.end()}}class m extends p{constructor(t,e,r){for(let e in super(t),this._httpHeaders={},t.httpHeaders){let r=t.httpHeaders[e];void 0!==r&&(this._httpHeaders[e]=r)}this._httpHeaders.Range=`bytes=${e}-${r-1}`;let n=t=>{if(404===t.statusCode){let t=new i.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=t;return}this._setReadableStream(t)};this._request=null,"http:"===this._url.protocol?this._request=a.request(f(this._url,this._httpHeaders),n):this._request=o.request(f(this._url,this._httpHeaders),n),this._request.on("error",t=>{this._storedError=t}),this._request.end()}}class v extends u{constructor(t){super(t);let e=decodeURIComponent(this._url.path);h.test(this._url.href)&&(e=e.replace(/^\//,"")),s.lstat(e,(t,r)=>{if(t){"ENOENT"===t.code&&(t=new i.MissingPDFException(`Missing PDF "${e}".`)),this._storedError=t,this._headersCapability.reject(t);return}this._contentLength=r.size,this._setReadableStream(s.createReadStream(e)),this._headersCapability.resolve()})}}class b extends p{constructor(t,e,r){super(t);let i=decodeURIComponent(this._url.path);h.test(this._url.href)&&(i=i.replace(/^\//,"")),this._setReadableStream(s.createReadStream(i,{start:e,end:r-1}))}}},(t,e,r)=>{"use strict";
3Object.defineProperty(e,"__esModule",{value:!0}),e.createResponseStatusError=l,e.extractFilenameFromHeader=o,e.validateRangeRequestCapabilities=a,e.validateResponseStatus=h;var i=r(1),n=r(159),s=r(133);function a(t){let{getResponseHeader:e,isHttp:r,rangeChunkSize:i,disableRange:n}=t,s={allowRangeRequests:!1,suggestedLength:void 0},a=parseInt(e("Content-Length"),10);return Number.isInteger(a)&&(s.suggestedLength=a,a<=2*i||n||!r||"bytes"!==e("Accept-Ranges")||"identity"!==(e("Content-Encoding")||"identity")||(s.allowRangeRequests=!0)),s}function o(t){let e=t("Content-Disposition");if(e){let t=(0,n.getFilenameFromContentDispositionHeader)(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch(t){}if((0,s.isPdfFile)(t))return t}return null}function l(t,e){return 404===t||0===t&&e.startsWith("file:")?new i.MissingPDFException('Missing PDF "'+e+'".'):new i.UnexpectedResponseException(`Unexpected server response (${t}) while retrieving PDF "${e}".`,t)}function h(t){return 200===t||206===t}},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getFilenameFromContentDispositionHeader=n;var i=r(1);function n(t){let e=!0,r=n("filename\\*","i").exec(t);if(r){let t=l(r=r[1]);return a(t=c(t=h(t=unescape(t))))}if(r=o(t))return a(c(r));if(r=n("filename","i").exec(t)){let t=l(r=r[1]);return a(t=c(t))}function n(t,e){return RegExp("(?:^|;)\\s*"+t+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',e)}function s(t,r){if(t){if(!/^[\x00-\xFF]+$/.test(r))return r;try{let n=new TextDecoder(t,{fatal:!0}),s=(0,i.stringToBytes)(r);r=n.decode(s),e=!1}catch(t){}}return r}function a(t){return e&&/[\x80-\xff]/.test(t)&&(t=s("utf-8",t),e&&(t=s("iso-8859-1",t))),t}function o(t){let e;let r=[],i=n("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(e=i.exec(t));){let[,t,i,n]=e;if((t=parseInt(t,10))in r){if(0===t)break;continue}r[t]=[i,n]}let s=[];for(let t=0;t<r.length&&(t in r);++t){let[e,i]=r[t];i=l(i),e&&(i=unescape(i),0===t&&(i=h(i))),s.push(i)}return s.join("")}function l(t){if(t.startsWith('"')){let e=t.slice(1).split('\\"');for(let t=0;t<e.length;++t){let 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){let e=t.indexOf("'");return -1===e?t:s(t.slice(0,e),t.slice(e+1).replace(/^[^']*'/,""))}function c(t){return!t.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(t)?t:t.replace(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(t,e,r,i){if("q"===r||"Q"===r)return s(e,i=(i=i.replace(/_/g," ")).replace(/=([0-9a-fA-F]{2})/g,function(t,e){return String.fromCharCode(parseInt(e,16))}));try{i=atob(i)}catch(t){}return s(e,i)})}return""}},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PDFNetworkStream=void 0;var i=r(1),n=r(158);let s=200,a=206;function o(t){let e=t.response;return"string"!=typeof e?e:(0,i.stringToBytes)(e).buffer}class l{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.url=t,this.isHttp=/^https?:/i.test(t),this.httpHeaders=this.isHttp&&e.httpHeaders||Object.create(null),this.withCredentials=e.withCredentials||!1,this.getXhr=e.getXhr||function(){return new XMLHttpRequest},this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(t,e,r){let i={begin:t,end:e};for(let t in r)i[t]=r[t];return this.request(i)}requestFull(t){return this.request(t)}request(t){let e=this.getXhr(),r=this.currXhrId++,i=this.pendingRequests[r]={xhr:e};for(let t in e.open("GET",this.url),e.withCredentials=this.withCredentials,this.httpHeaders){let r=this.httpHeaders[t];void 0!==r&&e.setRequestHeader(t,r)}return this.isHttp&&"begin"in t&&"end"in t?(e.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`),i.expectedStatus=a):i.expectedStatus=s,e.responseType="arraybuffer",t.onError&&(e.onerror=function(r){t.onError(e.status)}),e.onreadystatechange=this.onStateChange.bind(this,r),e.onprogress=this.onProgress.bind(this,r),i.onHeadersReceived=t.onHeadersReceived,i.onDone=t.onDone,i.onError=t.onError,i.onProgress=t.onProgress,e.send(null),r}onProgress(t,e){var r;let i=this.pendingRequests[t];i&&(null===(r=i.onProgress)||void 0===r||r.call(i,e))}onStateChange(t,e){var r,i,n;let l=this.pendingRequests[t];if(!l)return;let h=l.xhr;if(h.readyState>=2&&l.onHeadersReceived&&(l.onHeadersReceived(),delete l.onHeadersReceived),4!==h.readyState||!(t in this.pendingRequests))return;if(delete this.pendingRequests[t],0===h.status&&this.isHttp){null===(r=l.onError)||void 0===r||r.call(l,h.status);return}let c=h.status||s;if(!(c===s&&l.expectedStatus===a)&&c!==l.expectedStatus){null===(i=l.onError)||void 0===i||i.call(l,h.status);return}let d=o(h);if(c===a){let t=h.getResponseHeader("Content-Range"),e=/bytes (\d+)-(\d+)\/(\d+)/.exec(t);l.onDone({begin:parseInt(e[1],10),chunk:d})}else d?l.onDone({begin:0,chunk:d}):null===(n=l.onError)||void 0===n||n.call(l,h.status)}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}
3abortRequest(t){let e=this.pendingRequests[t].xhr;delete this.pendingRequests[t],e.abort()}}class h{constructor(t){this._source=t,this._manager=new l(t.url,{httpHeaders:t.httpHeaders,withCredentials:t.withCredentials}),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){let e=this._rangeRequestReaders.indexOf(t);e>=0&&this._rangeRequestReaders.splice(e,1)}getFullReader(){return(0,i.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new c(this._manager,this._source),this._fullRequestReader}getRangeReader(t,e){let r=new d(this._manager,t,e);return r.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(r),r}cancelAllRequests(t){var e;for(let r of(null===(e=this._fullRequestReader)||void 0===e||e.cancel(t),this._rangeRequestReaders.slice(0)))r.cancel(t)}}e.PDFNetworkStream=h;class c{constructor(t,e){this._manager=t;let 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,i.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(){let t=this._fullRequestId,e=this._manager.getRequestXhr(t),r=t=>e.getResponseHeader(t),{allowRangeRequests:i,suggestedLength:s}=(0,n.validateRangeRequestCapabilities)({getResponseHeader:r,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});i&&(this._isRangeSupported=!0),this._contentLength=s||this._contentLength,this._filename=(0,n.extractFilenameFromHeader)(r),this._isRangeSupported&&this._manager.abortRequest(t),this._headersReceivedCapability.resolve()}_onDone(t){if(t&&(this._requests.length>0?this._requests.shift().resolve({value:t.chunk,done:!1}):this._cachedChunks.push(t.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(let t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(t){for(let e of(this._storedError=(0,n.createResponseStatusError)(t,this._url),this._headersReceivedCapability.reject(this._storedError),this._requests))e.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(t){var e;null===(e=this.onProgress)||void 0===e||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;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};let t=(0,i.createPromiseCapability)();return this._requests.push(t),t.promise}cancel(t){for(let e of(this._done=!0,this._headersReceivedCapability.reject(t),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 d{constructor(t,e,r){this._manager=t;let i={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url,this._requestId=t.requestRange(e,r,i),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)||void 0===t||t.call(this,this)}_onDone(t){let e=t.chunk;for(let t of(this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunk=e,this._done=!0,this._requests))t.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(t){for(let e of(this._storedError=(0,n.createResponseStatusError)(t,this._url),this._requests))e.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){if(!this.isStreamingSupported){var e;null===(e=this.onProgress)||void 0===e||e.call(this,{loaded:t.loaded})}}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(null!==this._queuedChunk){let t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};let t=(0,i.createPromiseCapability)();return this._requests.push(t),t.promise}cancel(t){for(let t of(this._done=!0,this._requests))t.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest
3(this._requestId),this._close()}}},(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PDFFetchStream=void 0;var i=r(1),n=r(158);function s(t,e,r){return{method:"GET",headers:t,signal:r.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function a(t){let e=new Headers;for(let r in t){let i=t[r];void 0!==i&&e.append(r,i)}return e}class o{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,e;return null!==(t=null===(e=this._fullRequestReader)||void 0===e?void 0:e._loaded)&&void 0!==t?t:0}getFullReader(){return(0,i.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new l(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;let r=new h(this,t,e);return this._rangeRequestReaders.push(r),r}cancelAllRequests(t){for(let e of(this._fullRequestReader&&this._fullRequestReader.cancel(t),this._rangeRequestReaders.slice(0)))e.cancel(t)}}e.PDFFetchStream=o;class l{constructor(t){this._stream=t,this._reader=null,this._loaded=0,this._filename=null;let e=t.source;this._withCredentials=e.withCredentials||!1,this._contentLength=e.length,this._headersCapability=(0,i.createPromiseCapability)(),this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange,this._headers=a(this._stream.httpHeaders);let r=e.url;fetch(r,s(this._headers,this._withCredentials,this._abortController)).then(t=>{if(!(0,n.validateResponseStatus)(t.status))throw(0,n.createResponseStatusError)(t.status,r);this._reader=t.body.getReader(),this._headersCapability.resolve();let e=e=>t.headers.get(e),{allowRangeRequests:s,suggestedLength:a}=(0,n.validateRangeRequestCapabilities)({getResponseHeader:e,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=s,this._contentLength=a||this._contentLength,this._filename=(0,n.extractFilenameFromHeader)(e),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new i.AbortException("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._headersCapability.promise;let{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:(this._loaded+=t.byteLength,this.onProgress&&this.onProgress({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){this._reader&&this._reader.cancel(t),this._abortController.abort()}}class h{constructor(t,e,r){this._stream=t,this._reader=null,this._loaded=0;let o=t.source;this._withCredentials=o.withCredentials||!1,this._readCapability=(0,i.createPromiseCapability)(),this._isStreamingSupported=!o.disableStream,this._abortController=new AbortController,this._headers=a(this._stream.httpHeaders),this._headers.append("Range",`bytes=${e}-${r-1}`);let l=o.url;fetch(l,s(this._headers,this._withCredentials,this._abortController)).then(t=>{if(!(0,n.validateResponseStatus)(t.status))throw(0,n.createResponseStatusError)(t.status,l);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;let{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:(this._loaded+=t.byteLength,this.onProgress&&this.onProgress({loaded:this._loaded}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){this._reader&&this._reader.cancel(t),this._abortController.abort()}}}],__webpack_module_cache__={};function __w_pdfjs_require__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var r=__webpack_module_cache__[t]={exports:{}};return __webpack_modules__[t](r,r.exports,__w_pdfjs_require__),r.exports}var __nested_webpack_exports__={};return(()=>{"use strict";var t=__nested_webpack_exports__;
3Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"AnnotationEditorLayer",{enumerable:!0,get:function(){return n.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 a.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,"LoopbackPort",{enumerable:!0,get:function(){return r.LoopbackPort}}),Object.defineProperty(t,"MissingPDFException",{enumerable:!0,get:function(){return e.MissingPDFException}}),Object.defineProperty(t,"OPS",{enumerable:!0,get:function(){return e.OPS}}),Object.defineProperty(t,"PDFDataRangeTransport",{enumerable:!0,get:function(){return r.PDFDataRangeTransport}}),Object.defineProperty(t,"PDFDateString",{enumerable:!0,get:function(){return i.PDFDateString}}),Object.defineProperty(t,"PDFWorker",{enumerable:!0,get:function(){return r.PDFWorker}}),Object.defineProperty(t,"PasswordResponses",{enumerable:!0,get:function(){return e.PasswordResponses}}),Object.defineProperty(t,"PermissionFlag",{enumerable:!0,get:function(){return e.PermissionFlag}}),Object.defineProperty(t,"PixelsPerInch",{enumerable:!0,get:function(){return i.PixelsPerInch}}),Object.defineProperty(t,"RenderingCancelledException",{enumerable:!0,get:function(){return i.RenderingCancelledException}}),Object.defineProperty(t,"SVGGraphics",{enumerable:!0,get:function(){return c.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 d.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 i.getFilenameFromUrl}}),Object.defineProperty(t,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return i.getPdfFilenameFromUrl}}),Object.defineProperty(t,"getXfaPageViewport",{enumerable:!0,get:function(){return i.getXfaPageViewport}}),Object.defineProperty(t,"isPdfFile",{enumerable:!0,get:function(){return i.isPdfFile}}),Object.defineProperty(t,"loadScript",{enumerable:!0,get:function(){return i.loadScript}}),Object.defineProperty(t,"renderTextLayer",{enumerable:!0,get:function(){return h.renderTextLayer}}),Object.defineProperty(t,"shadow",{enumerable:!0,get:function(){return e.shadow}}),Object.defineProperty(t,"version",{enumerable:!0,get:function(){return r.version}});var e=__w_pdfjs_require__(1),r=__w_pdfjs_require__(129),i=__w_pdfjs_require__(133),n=__w_pdfjs_require__(147),s=__w_pdfjs_require__(132),a=__w_pdfjs_require__(152),o=__w_pdfjs_require__(140),l=__w_pdfjs_require__(3),h=__w_pdfjs_require__(155),c=__w_pdfjs_require__(156),d=__w_pdfjs_require__(154);
3if(l.isNodeJS){let{PDFNodeStream:t}=__w_pdfjs_require__(157);(0,r.setPDFNetworkStreamFactory)(e=>new t(e))}else{let{PDFNetworkStream:t}=__w_pdfjs_require__(160),{PDFFetchStream:e}=__w_pdfjs_require__(161);(0,r.setPDFNetworkStreamFactory)(r=>(0,i.isValidFetchUrl)(r.url)?new e(r):new t(r))}})(),__nested_webpack_exports__})())}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.