PageSourceSearch

https://rabbitcare.com/_next/static/chunks/e991514e.a390fbf7f08f4154.js

js rabbitcare.com collected 2026-09-26 00:29:07 UTC 360,557 bytes, 4 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4175],{32569:function(module,__unused_webpack_exports,__webpack_require__){var process=__webpack_require__(81551),Buffer=__webpack_require__(43204).lW;!function(t,e){module.exports=t.pdfjsLib=e()}(globalThis,()=>(()=>{"use strict";var __webpack_modules__=[,(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.VerbosityLevel=e.Util=e.UnknownErrorException=e.UnexpectedResponseException=e.TextRenderingMode=e.RenderingIntentFlag=e.PromiseCapability=e.PermissionFlag=e.PasswordResponses=e.PasswordException=e.PageActionEventType=e.OPS=e.MissingPDFException=e.MAX_IMAGE_SIZE_TO_CACHE=e.LINE_FACTOR=e.LINE_DESCENT_FACTOR=e.InvalidPDFException=e.ImageKind=e.IDENTITY_MATRIX=e.FormatError=e.FeatureTest=e.FONT_IDENTITY_MATRIX=e.DocumentActionEventType=e.CMapCompressionType=e.BaseException=e.BASELINE_FACTOR=e.AnnotationType=e.AnnotationReplyType=e.AnnotationPrefix=e.AnnotationMode=e.AnnotationFlag=e.AnnotationFieldFlag=e.AnnotationEditorType=e.AnnotationEditorPrefix=e.AnnotationEditorParamsType=e.AnnotationBorderStyleType=e.AnnotationActionEventType=e.AbortException=void 0,e.assert=L,e.bytesToString=X,e.createValidAbsoluteUrl=B,e.getModificationDate=td,e.getUuid=tg,e.getVerbosityLevel=F,e.info=I,e.isArrayBuffer=tl,e.isArrayEqual=th,e.isNodeJS=void 0,e.normalizeUnicode=tf,e.objectFromMap=Q,e.objectSize=J,e.setVerbosityLevel=R,e.shadow=U,e.string32=Y,e.stringToBytes=K,e.stringToPDFString=ts,e.stringToUTF8String=ta,e.unreachable=O,e.utf8StringToString=to,e.warn=D,i(2),i(84),i(86),i(87),i(89),i(93),i(101),i(102),i(105),i(107),i(109),i(113),i(116),i(123);let r="object"==typeof process&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&"browser"!==process.type);e.isNodeJS=r;let n=[1,0,0,1,0,0];e.IDENTITY_MATRIX=n;let s=[.001,0,0,.001,0,0];e.FONT_IDENTITY_MATRIX=s;let a=1e7;e.MAX_IMAGE_SIZE_TO_CACHE=a;let o=1.35;e.LINE_FACTOR=o;let l=.35;e.LINE_DESCENT_FACTOR=l;let h=l/o;e.BASELINE_FACTOR=h;let d={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};e.RenderingIntentFlag=d;let c={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};e.AnnotationMode=c;let u="pdfjs_internal_editor_";e.AnnotationEditorPrefix=u;let p={DISABLE:-1,NONE:0,FREETEXT:3,STAMP:13,INK:15};e.AnnotationEditorType=p;let f={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23};e.AnnotationEditorParamsType=f;let g={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=g;let m={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=m;let b={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};e.ImageKind=b;let v={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=v;let A={GROUP:"Group",REPLY:"R"};e.AnnotationReplyType=A;let y={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};e.AnnotationFlag=y;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 E={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=E;let x={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};e.DocumentActionEventType=x;let w={O:"PageOpen",C:"PageClose"};e.PageActionEventType=w;let C={ERRORS:0,WARNINGS:1,INFOS:5};e.VerbosityLevel=C;let T={NONE:0,BINARY:1};e.CMapCompressionType=T;let P={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};e.OPS=P;let M={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};e.PasswordResponses=M;let k=C.WARNINGS;function R(t){Number.isInteger(t)&&(k=t)}function F(){return k}function I(t){k>=C.INFOS&&console.log(`Info: ${t}`)}function D(t){k>=C.WARNINGS&&console.log(`Warning: ${t}`)}function O(t){throw Error(t)}function L(t,e){t||O(e)}function N(t){switch(t?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function B(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return null;try{if(i&&"string"==typeof t){if(i.addDefaultProtocol&&t.startsWith("www.")){let e=t.match(/\./g);e?.length>=2&&(t=`http://${t}`)}if(i.tryConvertEncoding)try{t=ta(t)}catch{}}let r=e?new URL(t,e):new URL(t);if(N(r))return r}catch{}return null}function U(t,e,i){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return Object.defineProperty(t,e,{value:i,enumerable:!r,configurable:!0,writable:!1}),i}let j=function(){function t(e,i){this.constructor===t&&O("Cannot initialize BaseException."),this.message=e,this.name=i}return t.prototype=Error(),t.constructor=t,t}();e.BaseException=j;class z extends j{constructor(t,e){super(t,"PasswordException"),this.code=e}}e.PasswordException=z;class H extends j{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}}e.UnknownErrorException=H;class G extends j{constructor(t){super(t,"InvalidPDFException")}}e.InvalidPDFException=G;class W extends j{constructor(t){super(t,"MissingPDFException")}}e.MissingPDFException=W;class V extends j{constructor(t,e){super(t,"UnexpectedResponseException"),this.status=e}}e.UnexpectedResponseException=V;class $ extends j{constructor(t){super(t,"FormatError")}}e.FormatError=$;class q extends j{constructor(t){super(t,"AbortException")}}function X(t){("object"!=typeof t||t?.length===void 0)&&O("Invalid argument for bytesToString");let e=t.length,i=8192;if(e<8192)return String.fromCharCode.apply(null,t);let r=[];for(let n=0;n<e;n+=i){let s=Math.min(n+i,e),a=t.subarray(n,s);r.push(String.fromCharCode.apply(null,a))}return r.join("")}function K(t){"string"!=typeof t&&O("Invalid argument for stringToBytes");let e=t.length,i=new Uint8Array(e);for(let r=0;r<e;++r)i[r]=255&t.charCodeAt(r);return i}function Y(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,255&t)}function J(t){return Object.keys(t).length}function Q(t){let e=Object.create(null);for(let[i,r]of t)e[i]=r;return e}function Z(){let t=new Uint8Array(4);return t[0]=1,1===new Uint32Array(t.buffer,0,1)[0]}function tt(){try{return Function(""),!0}catch{return!1}}e.AbortException=q;class te{static get isLittleEndian(){return U(this,"isLittleEndian",Z())}static get isEvalSupported(){return U(this,"isEvalSupported",tt())}static get isOffscreenCanvasSupported(){return U(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}static get platform(){return"undefined"==typeof navigator?U(this,"platform",{isWin:!1,isMac:!1}):U(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}static get isCSSRoundSupported(){return U(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}}e.FeatureTest=te;let ti=[...Array(256).keys()].map(t=>t.toString(16).padStart(2,"0"));class tr{static makeHexColor(t,e,i){return`#${ti[t]}${ti[e]}${ti[i]}`}static scaleMinMax(t,e){let i;t[0]?(t[0]<0&&(i=e[0],e[0]=e[1],e[1]=i),e[0]*=t[0],e[1]*=t[0],t[3]<0&&(i=e[2],e[2]=e[3],e[3]=i),e[2]*=t[3],e[3]*=t[3]):(i=e[0],e[0]=e[2],e[2]=i,i=e[1],e[1]=e[3],e[3]=i,t[1]<0&&(i=e[2],e[2]=e[3],e[3]=i),e[2]*=t[1],e[3]*=t[1],t[2]<0&&(i=e[0],e[0]=e[1],e[1]=i),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 i=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])/i,(-t[0]*e[1]+t[1]*e[0]+e[4]*e[1]-e[5]*e[0])/i]}static getAxialAlignedBoundingBox(t,e){let i=this.applyTransform(t,e),r=this.applyTransform(t.slice(2,4),e),n=this.applyTransform([t[0],t[3]],e),s=this.applyTransform([t[2],t[1]],e);return[Math.min(i[0],r[0],n[0],s[0]),Math.min(i[1],r[1],n[1],s[1]),Math.max(i[0],r[0],n[0],s[0]),Math.max(i[1],r[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 singularValueDecompose2dScale(t){let e=[t[0],t[2],t[1],t[3]],i=t[0]*e[0]+t[1]*e[2],r=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=(i+s)/2,o=Math.sqrt((i+s)**2-4*(i*s-n*r))/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 i=Math.max(Math.min(t[0],t[2]),Math.min(e[0],e[2])),r
1=Math.min(Math.max(t[0],t[2]),Math.max(e[0],e[2]));if(i>r)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:[i,n,r,s]}static bezierBoundingBox(t,e,i,r,n,s,a,o){let l,h,d,c,u,p,f,g;let m=[],b=[[],[]];for(let b=0;b<2;++b){if(0===b?(h=6*t-12*i+6*n,l=-3*t+9*i-9*n+3*a,d=3*i-3*t):(h=6*e-12*r+6*s,l=-3*e+9*r-9*s+3*o,d=3*r-3*e),1e-12>Math.abs(l)){if(1e-12>Math.abs(h))continue;0<(c=-d/h)&&c<1&&m.push(c);continue}g=Math.sqrt(f=h*h-4*d*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 v=m.length,A,y=v;for(;v--;)A=1-(c=m[v]),b[0][v]=A*A*A*t+3*A*A*c*i+3*A*c*c*n+c*c*c*a,b[1][v]=A*A*A*e+3*A*A*c*r+3*A*c*c*s+c*c*c*o;return b[0][y]=t,b[1][y]=e,b[0][y+1]=a,b[1][y+1]=o,b[0].length=b[1].length=y+2,[Math.min(...b[0]),Math.min(...b[1]),Math.max(...b[0]),Math.max(...b[1])]}}e.Util=tr;let tn=[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 ts(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 i=new TextDecoder(e,{fatal:!0}),r=K(t);return i.decode(r)}catch(t){D(`stringToPDFString: "${t}".`)}}let e=[];for(let i=0,r=t.length;i<r;i++){let r=tn[t.charCodeAt(i)];e.push(r?String.fromCharCode(r):t.charAt(i))}return e.join("")}function ta(t){return decodeURIComponent(escape(t))}function to(t){return unescape(encodeURIComponent(t))}function tl(t){return"object"==typeof t&&t?.byteLength!==void 0}function th(t,e){if(t.length!==e.length)return!1;for(let i=0,r=t.length;i<r;i++)if(t[i]!==e[i])return!1;return!0}function td(){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("")}class tc{#t=!1;constructor(){this.promise=new Promise((t,e)=>{this.resolve=e=>{this.#t=!0,t(e)},this.reject=t=>{this.#t=!0,e(t)}})}get settled(){return this.#t}}e.PromiseCapability=tc;let tu=null,tp=null;function tf(t){return tu||(tu=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,tp=new Map([["ſt","ſt"]])),t.replaceAll(tu,(t,e,i)=>e?e.normalize("NFKC"):tp.get(i))}function tg(){if("undefined"!=typeof crypto&&"function"==typeof crypto?.randomUUID)return crypto.randomUUID();let t=new Uint8Array(32);if("undefined"!=typeof crypto&&"function"==typeof crypto?.getRandomValues)crypto.getRandomValues(t);else for(let e=0;e<32;e++)t[e]=Math.floor(255*Math.random());return X(t)}let tm="pdfjs_internal_id_";e.AnnotationPrefix=tm},(t,e,i)=>{var r=i(3),n=i(4),s=i(69),a=i(70),o="WebAssembly",l=n[o],h=7!==Error("e",{cause:7}).cause,d=function(t,e){var i={};i[t]=a(t,e,h),r({global:!0,constructor:!0,arity:1,forced:h},i)},c=function(t,e){if(l&&l[t]){var i={};i[t]=a(o+"."+t,e,h),r({target:o,stat:!0,constructor:!0,arity:1,forced:h},i)}};d("Error",function(t){return function(e){return s(t,this,arguments)}}),d("EvalError",function(t){return function(e){return s(t,this,arguments)}}),d("RangeError",function(t){return function(e){return s(t,this,arguments)}}),d("ReferenceError",function(t){return function(e){return s(t,this,arguments)}}),d("SyntaxError",function(t){return function(e){return s(t,this,arguments)}}),d("TypeError",function(t){return function(e){return s(t,this,arguments)}}),d("URIError",function(t){return function(e){return s(t,this,arguments)}}),c("CompileError",function(t){return function(e){return s(t,this,arguments)}}),c("LinkError",function(t){return function(e){return s(t,this,arguments)}}),c("RuntimeError",function(t){return function(e){return s(t,this,arguments)}})},(t,e,i)=>{var r=i(4),n=i(5).f,s=i(44),a=i(48),o=i(38),l=i(56),h=i(68);t.exports=function(t,e){var i,d,c,u,p,f=t.target,g=t.global,m=t.stat;if(i=g?r:m?r[f]||o(f,{}):(r[f]||{}).prototype)for(d in e){if(u=e[d],c=t.dontCallGetSet?(p=n(i,d))&&p.value:i[d],!h(g?d:f+(m?".":"#")+d,t.forced)&&void 0!==c){if(typeof u==typeof c)continue;l(u,c)}(t.sham||c&&c.sham)&&s(u,"sham",!0),a(i,d,u,t)}}},function(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}()||this||Function("return this")()},(t,e,i)=>{var r=i(6),n=i(8),s=i(10),a=i(11),o=i(12),l=i(18),h=i(39),d=i(42),c=Object.getOwnPropertyDescriptor;e.f=r?c:function(t,e){if(t=o(t),e=l(e),d)try{return c(t,e)}catch(t){}if(h(t,e))return a(!n(s.f,t,e),t[e])}},(t,e,i)=>{var r=i(7);t.exports=!r(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}}
1)[1]})},t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},(t,e,i)=>{var r=i(9),n=Function.prototype.call;t.exports=r?n.bind(n):function(){return n.apply(n,arguments)}},(t,e,i)=>{var r=i(7);t.exports=!r(function(){var t=(function(){}).bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})},(t,e)=>{var i={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,n=r&&!i.call({1:2},1);e.f=n?function(t){var e=r(this,t);return!!e&&e.enumerable}:i},t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},(t,e,i)=>{var r=i(13),n=i(16);t.exports=function(t){return r(n(t))}},(t,e,i)=>{var r=i(14),n=i(7),s=i(15),a=Object,o=r("".split);t.exports=n(function(){return!a("z").propertyIsEnumerable(0)})?function(t){return"String"===s(t)?o(t,""):a(t)}:a},(t,e,i)=>{var r=i(9),n=Function.prototype,s=n.call,a=r&&n.bind.bind(s,s);t.exports=r?a:function(t){return function(){return s.apply(t,arguments)}}},(t,e,i)=>{var r=i(14),n=r({}.toString),s=r("".slice);t.exports=function(t){return s(n(t),8,-1)}},(t,e,i)=>{var r=i(17),n=TypeError;t.exports=function(t){if(r(t))throw n("Can't call method on "+t);return t}},t=>{t.exports=function(t){return null==t}},(t,e,i)=>{var r=i(19),n=i(23);t.exports=function(t){var e=r(t,"string");return n(e)?e:e+""}},(t,e,i)=>{var r=i(8),n=i(20),s=i(23),a=i(30),o=i(33),l=i(34),h=TypeError,d=l("toPrimitive");t.exports=function(t,e){if(!n(t)||s(t))return t;var i,l=a(t,d);if(l){if(void 0===e&&(e="default"),!n(i=r(l,t,e))||s(i))return i;throw h("Can't convert object to primitive value")}return void 0===e&&(e="number"),o(t,e)}},(t,e,i)=>{var r=i(21),n=i(22),s=n.all;t.exports=n.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:r(t)||t===s}:function(t){return"object"==typeof t?null!==t:r(t)}
1},(t,e,i)=>{var r=i(22),n=r.all;t.exports=r.IS_HTMLDDA?function(t){return"function"==typeof t||t===n}:function(t){return"function"==typeof t}},t=>{var e="object"==typeof document&&document.all,i=void 0===e&&void 0!==e;t.exports={all:e,IS_HTMLDDA:i}},(t,e,i)=>{var r=i(24),n=i(21),s=i(25),a=i(26),o=Object;t.exports=a?function(t){return"symbol"==typeof t}:function(t){var e=r("Symbol");return n(e)&&s(e.prototype,o(t))}},(t,e,i)=>{var r=i(4),n=i(21),s=function(t){return n(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?s(r[t]):r[t]&&r[t][e]}},(t,e,i)=>{var r=i(14);t.exports=r({}.isPrototypeOf)},(t,e,i)=>{var r=i(27);t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},(t,e,i)=>{var r=i(28),n=i(7),s=i(4).String;t.exports=!!Object.getOwnPropertySymbols&&!n(function(){var t=Symbol("symbol detection");return!s(t)||!(Object(t) instanceof Symbol)||!Symbol.sham&&r&&r<41})},(t,e,i)=>{var r,n,s=i(4),a=i(29),o=s.process,l=s.Deno,h=o&&o.versions||l&&l.version,d=h&&h.v8;d&&(n=(r=d.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!n&&a&&(!(r=a.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/))&&(n=+r[1]),t.exports=n},t=>{t.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},(t,e,i)=>{var r=i(31),n=i(17);t.exports=function(t,e){var i=t[e];return n(i)?void 0:r(i)}},(t,e,i)=>{var r=i(21),n=i(32),s=TypeError;t.exports=function(t){if(r(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,i)=>{var r=i(8),n=i(21),s=i(20),a=TypeError;t.exports=function(t,e){var i,o;if("string"===e&&n(i=t.toString)&&!s(o=r(i,t))||n(i=t.valueOf)&&!s(o=r(i,t))||"string"!==e&&n(i=t.toString)&&!s(o=r(i,t)))return o;throw a("Can't convert object to primitive value")}},(t,e,i)=>{var r=i(4),n=i(35),s=i(39),a=i(41),o=i(27),l=i(26),h=r.Symbol,d=n("wks"),c=l?h.for||h:h&&h.withoutSetter||a;t.exports=function(t){return s(d,t)||(d[t]=o&&s(h,t)?h[t]:c("Symbol."+t)),d[t]}},(t,e,i)=>{var r=i(36),n=i(37);(t.exports=function(t,e){return n[t]||(n[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.32.2",mode:r?"pure":"global",copyright:"\xa9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.32.2/LICENSE",source:"https://github.com/zloirock/core-js"})},t=>{t.exports=!1},(t,e,i)=>{var r=i(4),n=i(38),s="__core-js_shared__",a=r[s]||n(s,{});t.exports=a},(t,e,i)=>{var r=i(4),n=Object.defineProperty;t.exports=function(t,e){try{n(r,t,{value:e,configurable:!0,writable:!0})}catch(i){r[t]=e}return e}},(t,e,i)=>{var r=i(14),n=i(40),s=r({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return s(n(t),e)}},(t,e,i)=>{var r=i(16),n=Object;t.exports=function(t){return n(r(t))}},(t,e,i)=>{var r=i(14),n=0,s=Math.random(),a=r(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+a(++n+s,36)}},(t,e,i)=>{var r=i(6),n=i(7),s=i(43);t.exports=!r&&!n(function(){return 7!==Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a})},(t,e,i)=>{var r=i(4),n=i(20),s=r.document,a=n(s)&&n(s.createElement);t.exports=function(t){return a?s.createElement(t):{}}},(t,e,i)=>{var r=i(6),n=i(45),s=i(11);t.exports=r?function(t,e,i){return n.f(t,e,s(1,i))}:function(t,e,i){return t[e]=i,t}},(t,e,i)=>{var r=i(6),n=i(42),s=i(46),a=i(47),o=i(18),l=TypeError,h=Object.defineProperty,d=Object.getOwnPropertyDescriptor,c="enumerable",u="configurable",p="writable";e.f=r?s?function(t,e,i){if(a(t),e=o(e),a(i),"function"==typeof t&&"prototype"===e&&"value"in i&&p in i&&!i[p]){var r=d(t,e);r&&r[p]&&(t[e]=i.value,i={configurable:u in i?i[u]:r[u],enumerable:c in i?i[c]:r[c],writable:!1})}return h(t,e,i)}:h:function(t,e,i){if(a(t),e=o(e),a(i),n)try{return h(t,e,i)}catch(t){}if("get"in i||"set"in i)throw l("Accessors not supported");return"value"in i&&(t[e]=i.value),t}},(t,e,i)=>{var r=i(6),n=i(7);t.exports=r&&n(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})},(t,e,i)=>{var r=i(20),n=String,s=TypeError;t.exports=function(t){if(r(t))return t;throw s(n(t)+" is not an object")}},(t,e,i)=>{var r=i(21),n=i(45),s=i(49),a=i(38);
vendor: 4,561 bytes, line 1
1t.exports=function(t,e,i,o){o||(o={});var l=o.enumerable,h=void 0!==o.name?o.name:e;if(r(i)&&s(i,h,o),o.global)l?t[e]=i:a(e,i);else{try{o.unsafe?t[e]&&(l=!0):delete t[e]}catch(t){}l?t[e]=i:n.f(t,e,{value:i,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return t}},(t,e,i)=>{var r=i(14),n=i(7),s=i(21),a=i(39),o=i(6),l=i(50).CONFIGURABLE,h=i(51),d=i(52),c=d.enforce,u=d.get,p=String,f=Object.defineProperty,g=r("".slice),m=r("".replace),b=r([].join),v=o&&!n(function(){return 8!==f(function(){},"length",{value:8}).length}),A=String(String).split("String"),y=t.exports=function(t,e,i){"Symbol("===g(p(e),0,7)&&(e="["+m(p(e),/^Symbol\(([^)]*)\)/,"$1")+"]"),i&&i.getter&&(e="get "+e),i&&i.setter&&(e="set "+e),(!a(t,"name")||l&&t.name!==e)&&(o?f(t,"name",{value:e,configurable:!0}):t.name=e),v&&i&&a(i,"arity")&&t.length!==i.arity&&f(t,"length",{value:i.arity});try{i&&a(i,"constructor")&&i.constructor?o&&f(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var r=c(t);return a(r,"source")||(r.source=b(A,"string"==typeof e?e:"")),t};Function.prototype.toString=y(function(){return s(this)&&u(this).source||h(this)},"toString")},(t,e,i)=>{var r=i(6),n=i(39),s=Function.prototype,a=r&&Object.getOwnPropertyDescriptor,o=n(s,"name"),l=o&&"something"===(function(){}).name,h=o&&(!r||r&&a(s,"name").configurable);t.exports={EXISTS:o,PROPER:l,CONFIGURABLE:h}},(t,e,i)=>{var r=i(14),n=i(21),s=i(37),a=r(Function.toString);n(s.inspectSource)||(s.inspectSource=function(t){return a(t)}),t.exports=s.inspectSource},(t,e,i)=>{var r,n,s,a=i(53),o=i(4),l=i(20),h=i(44),d=i(39),c=i(37),u=i(54),p=i(55),f="Object already initialized",g=o.TypeError,m=o.WeakMap,b=function(t){return s(t)?n(t):r(t,{})},v=function(t){return function(e){var i;if(!l(e)||(i=n(e)).type!==t)throw g("Incompatible receiver, "+t+" required");return i}};if(a||c.state){var A=c.state||(c.state=new m);A.get=A.get,A.has=A.has,A.set=A.set,r=function(t,e){if(A.has(t))throw g(f);return e.facade=t,A.set(t,e),e},n=function(t){return A.get(t)||{}},s=function(t){return A.has(t)}}else{var y=u("state");p[y]=!0,r=function(t,e){if(d(t,y))throw g(f);return e.facade=t,h(t,y,e),e},n=function(t){return d(t,y)?t[y]:{}},s=function(t){return d(t,y)}}t.exports={set:r,get:n,has:s,enforce:b,getterFor:v}},(t,e,i)=>{var r=i(4),n=i(21),s=r.WeakMap;t.exports=n(s)&&/native code/.test(String(s))},(t,e,i)=>{var r=i(35),n=i(41),s=r("keys");t.exports=function(t){return s[t]||(s[t]=n(t))}},t=>{t.exports={}},(t,e,i)=>{var r=i(39),n=i(57),s=i(5),a=i(45);t.exports=function(t,e,i){for(var o=n(e),l=a.f,h=s.f,d=0;d<o.length;d++){var c=o[d];r(t,c)||i&&r(i,c)||l(t,c,h(e,c))}}},(t,e,i)=>{var r=i(24),n=i(14),s=i(58),a=i(67),o=i(47),l=n([].concat);t.exports=r("Reflect","ownKeys")||function(t){var e=s.f(o(t)),i=a.f;return i?l(e,i(t)):e}},(t,e,i)=>{var r=i(59),n=i(66).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,n)}},(t,e,i)=>{var r=i(14),n=i(39),s=i(12),a=i(60).indexOf,o=i(55),l=r([].push);t.exports=function(t,e){var i,r=s(t),h=0,d=[];for(i in r)!n(o,i)&&n(r,i)&&l(d,i);for(;e.length>h;)n(r,i=e[h++])&&(~a(d,i)||l(d,i));return d}},(t,e,i)=>{var r=i(12),n=i(61),s=i(64),a=function(t){return function(e,i,a){var o,l=r(e),h=s(l),d=n(a,h);if(t&&i!=i){for(;h>d;)if((o=l[d++])!=o)return!0}else for(;h>d;d++)if((t||d in l)&&l[d]===i)return t||d||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},(t,e,i)=>{var r=i(62),n=Math.max,s=Math.min;t.exports=function(t,e){var i=r(t);return i<0?n(i+e,0):s(i,e)}},(t,e,i)=>{var r=i(63);t.exports=function(t){var e=+t;return e!=e||0===e?0:r(e)}},t=>{var e=Math.ceil,i=Math.floor;t.exports=Math.trunc||function(t){var r=+t;return(r>0?i:e)(r)}},(t,e,i)=>{var r=i(65);t.exports=function(t){return r(t.length)}},(t,e,i)=>{var r=i(62),n=Math.min;t.exports=function(t){return t>0?n(r(t),9007199254740991):0}},t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},(t,e)=>{e.f=Object.getOwnPropertySymbols},(t,e,i)=>{var r=i(7),n=i(21),s=/#|\.prototype\./,a=function(t,e){var i=l[o(t)];return i===d||i!==h&&(n(e)?r(e):!!e)},o=a.normalize=function(t){return String(t).replace(s,".").toLowerCase()},l=a.data={},h=a.NATIVE="N",d=a.POLYFILL="P";t.exports=a},(t,e,i)=>{var r=i(9),n=Function.prototype,s=n.apply,a=n.call;t.exports="object"==typeof Reflect&&Reflect.apply||(r?a.bind(s):function(){return a.apply(s,arguments)})},(t,e,i)=>{var r=i(24),n=i(39),s=i(44),a=i(25),o=i(71),l=i(56),h=i(74),d=i(75),c=i(76),u=i(80),p=i(81),f=i(6),g=i(36);
1t.exports=function(t,e,i,m){var b="stackTraceLimit",v=m?2:1,A=t.split("."),y=A[A.length-1],_=r.apply(null,A);if(_){var S=_.prototype;if(!g&&n(S,"cause")&&delete S.cause,!i)return _;var E=r("Error"),x=e(function(t,e){var i=c(m?e:t,void 0),r=m?new _(t):new _;return void 0!==i&&s(r,"message",i),p(r,x,r.stack,2),this&&a(S,this)&&d(r,this,x),arguments.length>v&&u(r,arguments[v]),r});if(x.prototype=S,"Error"!==y?o?o(x,E):l(x,E,{name:!0}):f&&b in _&&(h(x,_,b),h(x,_,"prepareStackTrace")),l(x,_),!g)try{S.name!==y&&s(S,"name",y),S.constructor=x}catch(t){}return x}}},(t,e,i)=>{var r=i(72),n=i(47),s=i(73);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,i={};try{(t=r(Object.prototype,"__proto__","set"))(i,[]),e=i instanceof Array}catch(t){}return function(i,r){return n(i),s(r),e?t(i,r):i.__proto__=r,i}}():void 0)},(t,e,i)=>{var r=i(14),n=i(31);t.exports=function(t,e,i){try{return r(n(Object.getOwnPropertyDescriptor(t,e)[i]))}catch(t){}}},(t,e,i)=>{var r=i(21),n=String,s=TypeError;t.exports=function(t){if("object"==typeof t||r(t))return t;throw s("Can't set "+n(t)+" as a prototype")}},(t,e,i)=>{var r=i(45).f;t.exports=function(t,e,i){i in t||r(t,i,{configurable:!0,get:function(){return e[i]},set:function(t){e[i]=t}})}},(t,e,i)=>{var r=i(21),n=i(20),s=i(71);t.exports=function(t,e,i){var a,o;return s&&r(a=e.constructor)&&a!==i&&n(o=a.prototype)&&o!==i.prototype&&s(t,o),t}},(t,e,i)=>{var r=i(77);t.exports=function(t,e){return void 0===t?arguments.length<2?"":e:r(t)}},(t,e,i)=>{var r=i(78),n=String;t.exports=function(t){if("Symbol"===r(t))throw TypeError("Cannot convert a Symbol value to a string");return n(t)}},(t,e,i)=>{var r=i(79),n=i(21),s=i(15),a=i(34)("toStringTag"),o=Object,l="Arguments"===s(function(){return arguments}()),h=function(t,e){try{return t[e]}catch(t){}};t.exports=r?s:function(t){var e,i,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(i=h(e=o(t),a))?i:l?s(e):"Object"===(r=s(e))&&n(e.callee)?"Arguments":r}},(t,e,i)=>{var r=i(34)("toStringTag"),n={};n[r]="z",t.exports="[object z]"===String(n)},(t,e,i)=>{var r=i(20),n=i(44);t.exports=function(t,e){r(e)&&"cause"in e&&n(t,"cause",e.cause)}},(t,e,i)=>{var r=i(44),n=i(82),s=i(83),a=Error.captureStackTrace;t.exports=function(t,e,i,o){s&&(a?a(t,e):r(t,"stack",n(i,o)))}},(t,e,i)=>{var r=i(14),n=Error,s=r("".replace),a=function(t){return String(n(t).stack)}("zxcasd"),o=/\n\s*at [^:]*:[^\n]*/,l=o.test(a);t.exports=function(t,e){if(l&&"string"==typeof t&&!n.prepareStackTrace)for(;e--;)t=s(t,o,"");return t}},(t,e,i)=>{var r=i(7),n=i(11);t.exports=!r(function(){var t=Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",n(1,7)),7!==t.stack)})},(t,e,i)=>{var r=i(48),n=i(14),s=i(77),a=i(85),o=URLSearchParams,l=o.prototype,h=n(l.append),d=n(l.delete),c=n(l.forEach),u=n([].push),p=new o("a=1&a=2&b=3");p.delete("a",1),p.delete("b",void 0),p+""!="a=2"&&r(l,"delete",function(t){var e,i=arguments.length,r=i<2?void 0:arguments[1];if(i&&void 0===r)return d(this,t);var n=[];c(this,function(t,e){u(n,{key:e,value:t})}),a(i,1);for(var o=s(t),l=s(r),p=0,f=0,g=!1,m=n.length;p<m;)e=n[p++],g||e.key===o?(g=!0,d(this,e.key)):f++;for(;f<m;)(e=n[f++]).key===o&&e.value===l||h(this,e.key,e.value)},{enumerable:!0,unsafe:!0})},t=>{var e=TypeError;t.exports=function(t,i){if(t<i)throw e("Not enough arguments");return t}},(t,e,i)=>{var r=i(48),n=i(14),s=i(77),a=i(85),o=URLSearchParams,l=o.prototype,h=n(l.getAll),d=n(l.has),c=new o("a=1");(c.has("a",2)||!c.has("a",void 0))&&r(l,"has",function(t){var e=arguments.length,i=e<2?void 0:arguments[1];if(e&&void 0===i)return d(this,t);var r=h(this,t);a(e,1);for(var n=s(i),o=0;o<r.length;)if(r[o++]===n)return!0;return!1},{enumerable:!0,unsafe:!0})},(t,e,i)=>{var r=i(6),n=i(14),s=i(88),a=URLSearchParams.prototype,o=n(a.forEach);!r||"size"in a||s(a,"size",{get:function(){var t=0;return o(this,function(){t++}),t},configurable:!0,enumerable:!0})},(t,e,i)=>{var r=i(49),n=i(45);t.exports=function(t,e,i){return i.get&&r(i.get,e,{getter:!0}),i.set&&r(i.set,e,{setter:!0}),n.f(t,e,i)}},(t,e,i)=>{var r=i(3),n=i(40),s=i(64),a=i(90),o=i(92),l=i(7)(function(){return 4294967297!==[].push.call({length:4294967296},1)}),h=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(t){return t instanceof TypeError}};r({target:"Array",proto:!0,arity:1,forced:l||!h()},{push:function(t){var e=n(this),i=s(e),r=arguments.length;o(i+r);for(var l=0;l<r;l++)e[i]=arguments[l],i++;return a(e,i),i}})},(t,e,i)=>{var r=i(6),n=i(91),s=TypeError,a=Object.getOwnPropertyDescriptor,o=r&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();t.exports=o?function(t,e){if(n(t)&&!a(t,"length").writable)throw s("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e}},(t,e,i)=>{var r=i(15);t.exports=Array.isArray||function(t){return"Array"===r(t)}},t=>{var e=TypeError,i=9007199254740991;t.exports=function(t){if(t>i)throw e("Maximum allowed index exceeded");return t}},(t,e,i)=>{var r=i(94),n=i(98).findLast,s=r.aTypedArray;(0,r.exportTypedArrayMethod)("findLast",function(t){return n(s(this),t,arguments.length>1?arguments[1]:void 0)})},(t,e,i)=>
1{var r,n,s,a=i(95),o=i(6),l=i(4),h=i(21),d=i(20),c=i(39),u=i(78),p=i(32),f=i(44),g=i(48),m=i(88),b=i(25),v=i(96),A=i(71),y=i(34),_=i(41),S=i(52),E=S.enforce,x=S.get,w=l.Int8Array,C=w&&w.prototype,T=l.Uint8ClampedArray,P=T&&T.prototype,M=w&&v(w),k=C&&v(C),R=Object.prototype,F=l.TypeError,I=y("toStringTag"),D=_("TYPED_ARRAY_TAG"),O="TypedArrayConstructor",L=a&&!!A&&"Opera"!==u(l.opera),N=!1,B={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},U={BigInt64Array:8,BigUint64Array:8},j=function(t){if(!d(t))return!1;var e=u(t);return"DataView"===e||c(B,e)||c(U,e)},z=function(t){var e=v(t);if(d(e)){var i=x(e);return i&&c(i,O)?i[O]:z(e)}},H=function(t){if(!d(t))return!1;var e=u(t);return c(B,e)||c(U,e)},G=function(t){if(H(t))return t;throw F("Target is not a typed array")},W=function(t){if(h(t)&&(!A||b(M,t)))return t;throw F(p(t)+" is not a typed array constructor")},V=function(t,e,i,r){if(o){if(i)for(var n in B){var s=l[n];if(s&&c(s.prototype,t))try{delete s.prototype[t]}catch(i){try{s.prototype[t]=e}catch(t){}}}(!k[t]||i)&&g(k,t,i?e:L&&C[t]||e,r)}},$=function(t,e,i){var r,n;if(o){if(A){if(i){for(r in B)if((n=l[r])&&c(n,t))try{delete n[t]}catch(t){}}if(M[t]&&!i)return;try{return g(M,t,i?e:L&&M[t]||e)}catch(t){}}for(r in B)(n=l[r])&&(!n[t]||i)&&g(n,t,e)}};for(r in B)(s=(n=l[r])&&n.prototype)?E(s)[O]=n:L=!1;for(r in U)(s=(n=l[r])&&n.prototype)&&(E(s)[O]=n);if((!L||!h(M)||M===Function.prototype)&&(M=function(){throw F("Incorrect invocation")},L))for(r in B)l[r]&&A(l[r],M);if((!L||!k||k===R)&&(k=M.prototype,L))for(r in B)l[r]&&A(l[r].prototype,k);if(L&&v(P)!==k&&A(P,k),o&&!c(k,I))for(r in N=!0,m(k,I,{configurable:!0,get:function(){return d(this)?this[D]:void 0}}),B)l[r]&&f(l[r],D,r);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:L,TYPED_ARRAY_TAG:N&&D,aTypedArray:G,aTypedArrayConstructor:W,exportTypedArrayMethod:V,exportTypedArrayStaticMethod:$,getTypedArrayConstructor:z,isView:j,isTypedArray:H,TypedArray:M,TypedArrayPrototype:k}},t=>{t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},(t,e,i)=>{var r=i(39),n=i(21),s=i(40),a=i(54),o=i(97),l=a("IE_PROTO"),h=Object,d=h.prototype;t.exports=o?h.getPrototypeOf:function(t){var e=s(t);if(r(e,l))return e[l];var i=e.constructor;return n(i)&&e instanceof i?i.prototype:e instanceof h?d:null}},(t,e,i)=>{var r=i(7);t.exports=!r(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})},(t,e,i)=>{var r=i(99),n=i(13),s=i(40),a=i(64),o=function(t){var e=1===t;return function(i,o,l){for(var h,d=s(i),c=n(d),u=r(o,l),p=a(c);p-- >0;)if(u(h=c[p],p,d))switch(t){case 0:return h;case 1:return p}return e?-1:void 0}};t.exports={findLast:o(0),findLastIndex:o(1)}},(t,e,i)=>{var r=i(100),n=i(31),s=i(9),a=r(r.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,i)=>{var r=i(15),n=i(14);t.exports=function(t){if("Function"===r(t))return n(t)}},(t,e,i)=>{var r=i(94),n=i(98).findLastIndex,s=r.aTypedArray;(0,r.exportTypedArrayMethod)("findLastIndex",function(t){return n(s(this),t,arguments.length>1?arguments[1]:void 0)})},(t,e,i)=>{var r=i(4),n=i(8),s=i(94),a=i(64),o=i(103),l=i(40),h=i(7),d=r.RangeError,c=r.Int8Array,u=c&&c.prototype,p=u&&u.set,f=s.aTypedArray,g=s.exportTypedArrayMethod,m=!h(function(){var t=new Uint8ClampedArray(2);return n(p,t,{length:1,0:3},1),3!==t[1]}),b=m&&s.NATIVE_ARRAY_BUFFER_VIEWS&&h(function(){var t=new c(2);return t.set(1),t.set("2",1),0!==t[0]||2!==t[1]});g("set",function(t){f(this);var e=o(arguments.length>1?arguments[1]:void 0,1),i=l(t);if(m)return n(p,this,i,e);var r=this.length,s=a(i),h=0;if(s+e>r)throw d("Wrong length");for(;h<s;)this[e+h]=i[h++]},!m||b)},(t,e,i)=>{var r=i(104),n=RangeError;t.exports=function(t,e){var i=r(t);if(i%e)throw n("Wrong offset");return i}},(t,e,i)=>{var r=i(62),n=RangeError;t.exports=function(t){var e=r(t);if(e<0)throw n("The argument can't be less than 0");return e}},(t,e,i)=>{var r=i(106),n=i(94),s=n.aTypedArray,a=n.exportTypedArrayMethod,o=n.getTypedArrayConstructor;a("toReversed",function(){return r(s(this),o(this))})},(t,e,i)=>{var r=i(64);t.exports=function(t,e){for(var i=r(t),n=new e(i),s=0;s<i;s++)n[s]=t[i-s-1];return n}},(t,e,i)=>{var r=i(94),n=i(14),s=i(31),a=i(108),o=r.aTypedArray,l=r.getTypedArrayConstructor,h=r.exportTypedArrayMethod,d=n(r.TypedArrayPrototype.sort);h("toSorted",function(t){void 0!==t&&s(t);var e=o(this);return d(a(l(e),e),t)})},(t,e,i)=>{var r=i(64);t.exports=function(t,e){for(var i=0,n=r(e),s=new t(n);n>i;)s[i]=e[i++];return s}},(t,e,i)=>{var r=i(110),n=i(94),s=i(111),a=i(62),o=i(112),l=n.aTypedArray,h=n.getTypedArrayConstructor;(0,n.exportTypedArrayMethod)("with",{with:function(t,e){var i=l(this),n=a(t),d=s(i)?o(e):+e;return r(i,h(i),n,d)}}
1.with,!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(t){return 8===t}}())},(t,e,i)=>{var r=i(64),n=i(62),s=RangeError;t.exports=function(t,e,i,a){var o=r(t),l=n(i),h=l<0?o+l:l;if(h>=o||h<0)throw s("Incorrect index");for(var d=new e(o),c=0;c<o;c++)d[c]=c===h?a:t[c];return d}},(t,e,i)=>{var r=i(78);t.exports=function(t){var e=r(t);return"BigInt64Array"===e||"BigUint64Array"===e}},(t,e,i)=>{var r=i(19),n=TypeError;t.exports=function(t){var e=r(t,"number");if("number"==typeof e)throw n("Can't convert number to bigint");return BigInt(e)}},(t,e,i)=>{var r=i(6),n=i(88),s=i(114),a=ArrayBuffer.prototype;!r||"detached"in a||n(a,"detached",{configurable:!0,get:function(){return s(this)}})},(t,e,i)=>{var r=i(14),n=i(115),s=r(ArrayBuffer.prototype.slice);t.exports=function(t){if(0!==n(t))return!1;try{return s(t,0,0),!1}catch(t){return!0}}},(t,e,i)=>{var r=i(72),n=i(15),s=TypeError;t.exports=r(ArrayBuffer.prototype,"byteLength","get")||function(t){if("ArrayBuffer"!==n(t))throw s("ArrayBuffer expected");return t.byteLength}},(t,e,i)=>{var r=i(3),n=i(117);n&&r({target:"ArrayBuffer",proto:!0},{transfer:function(){return n(this,arguments.length?arguments[0]:void 0,!0)}})},(t,e,i)=>{var r=i(4),n=i(14),s=i(72),a=i(118),o=i(114),l=i(115),h=i(119),d=r.TypeError,c=r.structuredClone,u=r.ArrayBuffer,p=r.DataView,f=Math.min,g=u.prototype,m=p.prototype,b=n(g.slice),v=s(g,"resizable","get"),A=s(g,"maxByteLength","get"),y=n(m.getInt8),_=n(m.setInt8);t.exports=h&&function(t,e,i){var r=l(t),n=void 0===e?r:a(e),s=!v||!v(t);if(o(t))throw d("ArrayBuffer is detached");var h=c(t,{transfer:[t]});if(r===n&&(i||s))return h;if(r>=n&&(!i||s))return b(h,0,n);for(var g=new u(n,i&&!s&&A?{maxByteLength:A(h)}:void 0),m=new p(h),S=new p(g),E=f(n,r),x=0;x<E;x++)_(S,x,y(m,x));return g}},(t,e,i)=>{var r=i(62),n=i(65),s=RangeError;t.exports=function(t){if(void 0===t)return 0;var e=r(t),i=n(e);if(e!==i)throw s("Wrong length or index");return i}},(t,e,i)=>{var r=i(4),n=i(7),s=i(28),a=i(120),o=i(121),l=i(122),h=r.structuredClone;t.exports=!!h&&!n(function(){if(o&&s>92||l&&s>94||a&&s>97)return!1;var t=new ArrayBuffer(8),e=h(t,{transfer:[t]});return 0!==t.byteLength||8!==e.byteLength})},(t,e,i)=>{var r=i(121),n=i(122);t.exports=!r&&!n&&"object"==typeof window&&"object"==typeof document},t=>{t.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},(t,e,i)=>{var r=i(4),n=i(15);t.exports="process"===n(r.process)},(t,e,i)=>{var r=i(3),n=i(117);n&&r({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return n(this,arguments.length?arguments[0]:void 0,!1)}})},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{Object.defineProperty(exports,"__esModule",{value:!0}),exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultFilterFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0,Object.defineProperty(exports,"SVGGraphics",{enumerable:!0,get:function(){return _displaySvg.SVGGraphics}}),exports.build=void 0,exports.getDocument=getDocument,exports.version=void 0,__w_pdfjs_require__(84),__w_pdfjs_require__(86),__w_pdfjs_require__(87),__w_pdfjs_require__(2),__w_pdfjs_require__(93),__w_pdfjs_require__(101),__w_pdfjs_require__(102),__w_pdfjs_require__(105),__w_pdfjs_require__(107),__w_pdfjs_require__(109),__w_pdfjs_require__(113),__w_pdfjs_require__(116),__w_pdfjs_require__(123),__w_pdfjs_require__(89),__w_pdfjs_require__(125),__w_pdfjs_require__(136),__w_pdfjs_require__(138),__w_pdfjs_require__(141),__w_pdfjs_require__(143),__w_pdfjs_require__(145),__w_pdfjs_require__(147),__w_pdfjs_require__(149),__w_pdfjs_require__(152);var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(163),_display_utils=__w_pdfjs_require__(168),_font_loader=__w_pdfjs_require__(171),_displayNode_utils=__w_pdfjs_require__(172),_canvas=__w_pdfjs_require__(173),_worker_options=__w_pdfjs_require__(176),_message_handler=__w_pdfjs_require__(177),_metadata=__w_pdfjs_require__(178),_optional_content_config=__w_pdfjs_require__(179),_transport_stream=__w_pdfjs_require__(180),_displayFetch_stream=__w_pdfjs_require__(181),_displayNetwork=__w_pdfjs_require__(184),_displayNode_stream=__w_pdfjs_require__(185),_displaySvg=__w_pdfjs_require__(186),_xfa_text=__w_pdfjs_require__(194);let DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DELAYED_CLEANUP_TIMEOUT=5e3,DefaultCanvasFactory=_util.isNodeJS?_displayNode_utils.NodeCanvasFactory:_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;let DefaultCMapReaderFactory=_util.isNodeJS?_displayNode_utils.NodeCMapReaderFactory:_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;let DefaultFilterFactory=_util.isNodeJS?_displayNode_utils.NodeFilterFactory:_display_utils.DOMFilterFactory;exports.DefaultFilterFactory=DefaultFilterFactory;let DefaultStandardFontDataFactory=_util.isNodeJS?_displayNode_utils.NodeStandardFontDataFactory:_display_utils.DOMStandardFontDataFactory;function getDocument(t){if("string"==typeof t||t instanceof URL?t={url:t}:(0,_util.isArrayBuffer)(t)&&(t={data:t}),"object"!=typeof t)throw Error("Invalid parameter in getDocument, need parameter object.");if(!t.url&&!t.data&&!t.range)throw Error("Invalid parameter object: need either .data, .range or .url");let e=new PDFDocumentLoadingTask,{docId:i}=e,r=t.url?getUrlProp(t.url):null,n=t.data?getDataProp(t.data):null,s=t.httpHeaders||null,a=!0===t.withCredentials,o=t.password??null,l=t.range instanceof PDFDataRangeTransport?t.range:null,h=Number.isInteger(t.rangeChunkSize)&&t.rangeChunkSize>0?t.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE,d=t.worker instanceof PDFWorker?t.worker:null,c=t.verbosity,u="string"!=typeof t.docBaseUrl||(0,_display_utils.isDataScheme)(t.docBaseUrl)?null:t.docBaseUrl,p="string"==typeof t.cMapUrl?t.cMapUrl:null,f=!1!==t.cMapPacked,g=t.CMapReaderFactory||DefaultCMapReaderFactory,m="string"==typeof t.standardFontDataUrl?t.standardFontDataUrl:null,b=t.StandardFontDataFactory||DefaultStandardFontDataFactory,v=!0!==t.stopAtErrors,A=Number.isInteger(t.maxImageSize)&&t.maxImageSize>-1?t.maxImageSize:-1,y=!1!==t.isEvalSupported,_="boolean"==typeof t.isOffscreenCanvasSupported?t.isOffscreenCanvasSupported:!_util.isNodeJS,S=Number.isInteger(t.canvasMaxAreaInBytes)?t.canvasMaxAreaInBytes:-1,E="boolean"==typeof t.disableFontFace?t.disableFontFace:_util.isNodeJS,x=!0===t.fontE
1xtraProperties,w=!0===t.enableXfa,C=t.ownerDocument||globalThis.document,T=!0===t.disableRange,P=!0===t.disableStream,M=!0===t.disableAutoFetch,k=!0===t.pdfBug,R=l?l.length:t.length??NaN,F="boolean"==typeof t.useSystemFonts?t.useSystemFonts:!_util.isNodeJS&&!E,I="boolean"==typeof t.useWorkerFetch?t.useWorkerFetch:g===_display_utils.DOMCMapReaderFactory&&b===_display_utils.DOMStandardFontDataFactory&&p&&m&&(0,_display_utils.isValidFetchUrl)(p,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(m,document.baseURI),D=t.canvasFactory||new DefaultCanvasFactory({ownerDocument:C}),O=t.filterFactory||new DefaultFilterFactory({docId:i,ownerDocument:C}),L=null;(0,_util.setVerbosityLevel)(c);let N={canvasFactory:D,filterFactory:O};if(I||(N.cMapReaderFactory=new g({baseUrl:p,isCompressed:f}),N.standardFontDataFactory=new b({baseUrl:m})),!d){let t={verbosity:c,port:_worker_options.GlobalWorkerOptions.workerPort};d=t.port?PDFWorker.fromPort(t):new PDFWorker(t),e._worker=d}let B={docId:i,apiVersion:"3.11.174",data:n,password:o,disableAutoFetch:M,rangeChunkSize:h,length:R,docBaseUrl:u,enableXfa:w,evaluatorOptions:{maxImageSize:A,disableFontFace:E,ignoreErrors:v,isEvalSupported:y,isOffscreenCanvasSupported:_,canvasMaxAreaInBytes:S,fontExtraProperties:x,useSystemFonts:F,cMapUrl:I?p:null,standardFontDataUrl:I?m:null}},U={ignoreErrors:v,isEvalSupported:y,disableFontFace:E,fontExtraProperties:x,enableXfa:w,ownerDocument:C,disableAutoFetch:M,pdfBug:k,styleElement:L};return d.promise.then(function(){if(e.destroyed)throw Error("Loading aborted");return Promise.all([_fetchDocument(d,B),new Promise(function(t){let e,i;l?e=new _transport_stream.PDFDataTransportStream({length:R,initialData:l.initialData,progressiveDone:l.progressiveDone,contentDispositionFilename:l.contentDispositionFilename,disableRange:T,disableStream:P},l):n||(i={url:r,length:R,httpHeaders:s,withCredentials:a,rangeChunkSize:h,disableRange:T,disableStream:P},e=_util.isNodeJS?new _displayNode_stream.PDFNodeStream(i):(0,_display_utils.isValidFetchUrl)(i.url)?new _displayFetch_stream.PDFFetchStream(i):new _displayNetwork.PDFNetworkStream(i)),t(e)})]).then(function(t){let[r,n]=t;if(e.destroyed)throw Error("Loading aborted");let s=new _message_handler.MessageHandler(i,r,d.port),a=new WorkerTransport(s,e,n,U,N);e._transport=a,s.send("Ready",null)})}).catch(e._capability.reject),e}async function _fetchDocument(t,e){if(t.destroyed)throw Error("Worker was destroyed");let i=await t.messageHandler.sendWithPromise("GetDocRequest",e,e.data?[e.data.buffer]:null);if(t.destroyed)throw Error("Worker was destroyed");return i}function getUrlProp(t){if(t instanceof URL)return t.href;try{return new URL(t,window.location).href}catch{if(_util.isNodeJS&&"string"==typeof t)return t}throw Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp(t){if(_util.isNodeJS&&void 0!==Buffer&&t instanceof Buffer)throw Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength)return t;if("string"==typeof t)return(0,_util.stringToBytes)(t);if("object"==typeof t&&!isNaN(t?.length)||(0,_util.isArrayBuffer)(t))return new Uint8Array(t);throw Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory;class PDFDocumentLoadingTask{static #e=0;constructor(){this._capability=new _util.PromiseCapability,this._transport=null,this._worker=null,this.docId=`d${PDFDocumentLoadingTask.#e++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{this._worker?.port&&(this._worker._pendingDestroy=!0),await this._transport?.destroy()}catch(t){throw this._worker?.port&&delete this._worker._pendingDestroy,t}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}}exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this.length=t,this.initialData=e,this.progressiveDone=i,this.contentDispositionFilename=r,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=new _util.PromiseCapability}addRangeListener(t){this._rangeListeners.push(t)}addProgressListener(t){this._progressListeners.push(t)}addProgressiveReadListener(t){this._progressiveReadListeners.push(t)}addProgressiveDoneListener(t){this._progressiveDoneListeners.push(t)}onDataRange(t,e){for(let i of this._rangeListeners)i(t,e)}onDataProgress(t,e){this._readyCapability.promise.then(()=>{for(let i of this._progressListeners)i(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,"getJavaScript",{value:()=>((0,_display_utils.deprecated)("`PDFDocumentProxy.getJavaScript`, please use `PDFDocumentProxy.getJSActions` instead."),this.getJSActions().then(t=>{if(!t)return t;let e=[];
1for(let i in t)e.push(...t[i]);return e}))})}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(t){return this._transport.getPage(t)}getPageIndex(t){return this._transport.getPageIndex(t)}getDestinations(){return this._transport.getDestinations()}getDestination(t){return this._transport.getDestination(t)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._transport.startCleanup(t||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{#i=null;#r=!1;constructor(t,e,i){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this._pageIndex=t,this._pageInfo=e,this._transport=i,this._stats=r?new _display_utils.StatTimer:null,this._pdfBug=r,this.commonObjs=i.commonObjs,this.objs=new PDFObjects,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport(){let{scale:t,rotation:e=this.rotate,offsetX:i=0,offsetY:r=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:i,offsetY:r,dontFlip:n})}getAnnotations(){let{intent:t="display"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,e.renderingIntent)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render(t){let{canvasContext:e,viewport:i,intent:r="display",annotationMode:n=_util.AnnotationMode.ENABLE,transform:s=null,background:a=null,optionalContentConfigPromise:o=null,annotationCanvasMap:l=null,pageColors:h=null,printAnnotationStorage:d=null}=t;this._stats?.time("Overall");let c=this._transport.getRenderingIntent(r,n,d);this.#r=!1,this.#n(),o||(o=this._transport.getOptionalContentConfig());let u=this._intentStates.get(c.cacheKey);u||(u=Object.create(null),this._intentStates.set(c.cacheKey,u)),u.streamReaderCancelTimeout&&(clearTimeout(u.streamReaderCancelTimeout),u.streamReaderCancelTimeout=null);let p=!!(c.renderingIntent&_util.RenderingIntentFlag.PRINT);u.displayReadyCapability||(u.displayReadyCapability=new _util.PromiseCapability,u.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(c));let f=t=>{u.renderTasks.delete(g),(this._maybeCleanupAfterRender||p)&&(this.#r=!0),this.#s(!p),t?(g.capability.reject(t),this._abortOperatorList({intentState:u,reason:t instanceof Error?t:Error(t)})):g.capability.resolve(),this._stats?.timeEnd("Rendering"),this._stats?.timeEnd("Overall")},g=new InternalRenderTask({callback:f,params:{canvasContext:e,viewport:i,transform:s,background:a},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:l,operatorList:u.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!p,pdfBug:this._pdfBug,page
1Colors:h});(u.renderTasks||=new Set).add(g);let m=g.task;return Promise.all([u.displayReadyCapability.promise,o]).then(t=>{let[e,i]=t;if(this.destroyed){f();return}this._stats?.time("Rendering"),g.initializeGraphics({transparency:e,optionalContentConfig:i}),g.operatorListChanged()}).catch(f),m}getOperatorList(){let t,{intent:e="display",annotationMode:i=_util.AnnotationMode.ENABLE,printAnnotationStorage:r=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,i,r,!0),a=this._intentStates.get(s.cacheKey);return a||(a=Object.create(null),this._intentStates.set(s.cacheKey,a)),a.opListReadCapability||((t=Object.create(null)).operatorListChanged=n,a.opListReadCapability=new _util.PromiseCapability,(a.renderTasks||=new Set).add(t),a.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(s)),a.opListReadCapability.promise}streamTextContent(){let{includeMarkedContent:t=!1,disableNormalization:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=100;return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:!0===t,disableNormalization:!0===e},{highWaterMark:i,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,i){function r(){n.read().then(function(e){let{value:i,done:n}=e;if(n){t(s);return}Object.assign(s.styles,i.styles),s.items.push(...i.items),r()},i)}let n=e.getReader(),s={items:[],styles:Object.create(null)};r()})}getStructTree(){return 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 i of e.renderTasks)t.push(i.completed),i.cancel();return this.objs.clear(),this.#r=!1,this.#n(),Promise.all(t)}cleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.#r=!0;let e=this.#s(!1);return t&&e&&(this._stats&&=new _display_utils.StatTimer),e}#s(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.#n(),!this.#r||this.destroyed)return!1;if(t)return this.#i=setTimeout(()=>{this.#i=null,this.#s(!1)},DELAYED_CLEANUP_TIMEOUT),!1;for(let{renderTasks:t,operatorList:e}of this._intentStates.values())if(t.size>0||!e.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#r=!1,!0}#n(){this.#i&&(clearTimeout(this.#i),this.#i=null)}_startRenderPage(t,e){let i=this._intentStates.get(e);i&&(this._stats?.timeEnd("Page Request"),i.displayReadyCapability?.resolve(t))}_renderPageChunk(t,e){for(let i=0,r=t.length;i<r;i++)e.operatorList.fnArray.push(t.fnArray[i]),e.operatorList.argsArray.push(t.argsArray[i]);for(let i of(e.operatorList.lastChunk=t.lastChunk,e.operatorList.separateAnnots=t.separateAnnots,e.renderTasks))i.operatorListChanged();t.lastChunk&&this.#s(!0)}_pumpOperatorList(t){let{renderingIntent:e,cacheKey:i,annotationStorageSerializable:r}=t,{map:n,transfers:s}=r,a=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:e,cacheKey:i,annotationStorage:n},s).getReader(),o=this._intentStates.get(i);o.streamReader=a;let l=()=>{a.read().then(t=>{let{value:e,done:i}=t;if(i){o.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(e,o),l())},t=>{if(o.streamReader=null,!this._transport.destroyed){if(o.operatorList){for(let t of(o.operatorList.lastChunk=!0,o.renderTasks))t.operatorListChanged();this.#s(!0)}if(o.displayReadyCapability)o.displayReadyCapability.reject(t);else if(o.opListReadCapability)o.opListReadCapability.reject(t);else throw t}})};l()}_abortOperatorList(t){let{intentState:e,reason:i,force:r=!1}=t;if(e.streamReader){if(e.streamReaderCancelTimeout&&(clearTimeout(e.streamReaderCancelTimeout),e.streamReaderCancelTimeout=null),!r){if(e.renderTasks.size>0)return;if(i instanceof _display_utils.RenderingCancelledException){let t=RENDERING_CANCELLED_TIMEOUT;i.extraDelay>0&&i.extraDelay<1e3&&(t+=i.extraDelay),e.streamReaderCancelTimeout=setTimeout(()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:i,force:!0})},t);return}}if(e.streamReader.cancel(new _util.AbortException(i.message)).catch(()=>{}),e.streamReader=null,!this._transport.destroyed){for(let[t,i]of this._intentStates)if(i===e){this._intentStates.delete(t);break}this.cleanup()}}}get stats(){return this._stats}}exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{#a=new Set;#o=Promise.resolve();postMessage(t,e){let i={data:structuredClone(t,null)};this.#o.then(()=>{for(let t of this.#a)t.call(this,i)})}addEventListener(t,e){this.#a.add(e)}removeEventListener(t,e){this.#a.delete(e)}terminate(){this.#a.clear()}}exports.LoopbackPort=LoopbackPort;let PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};if(exports.PDFWorkerUtil=PDFWorkerUtil,_util.isNodeJS)PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if("object"==typeof document){let pdfjsFilePath=document?.currentScript?.src;pdfjsFilePath&&(PDFWorkerUtil.fallbackWorkerSrc=pdfjsFilePath.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(t,e){let i;try{if(!(i=new URL(t)).origin||"null"===i.origin)return!1}catch{return!1}let r=new URL(e,i);return i.origin===r.origin},PDFWorkerUtil.createCDNWrapper=function(t){let e=`importScripts("${t}");`;return URL.createObjectURL(new Blob([e]))};class PDFWorker{static #l;constructor(){let{name:t=null,port:e=null,verbosity:i=(0,_util.getVerbosityLevel)()}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.name=t,this.destroyed=!1,this.verbosity=i,this._readyCapability=new _util.PromiseCapability,this._port=null,this._webWorker=null,this._messageHandler=null,e){if(PDFWorker.#l?.has(e))throw Error("Cannot use more than one PDFWorker per port.");(PDFWorker.#l||=new WeakMap).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(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:t}=PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,t)||(t=PDFWorkerUtil.createCDNWrapper(new URL(t,window.location).href));let e=new Worker(t),i=new _message_handler.MessageHandler("main","worker",e),r=()=>{e.removeEventListener("error",n),i.destroy(),e.terminate(),this.destroyed?this._readyCapability.reject(Error("Worker was destroyed")):this._setupFakeWorker()},n=()=>{this._webWorker||r()};e.addEventListener("error",n),i.on("test",t=>{if(e.removeEventListener("error",n),this.destroyed){r();return}t?(this._messageHandler=i,this._port=e,this._webWorker=e,this._readyCapability.resolve(),i.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),i.destroy(),e.terminate())}),i.on("ready",t=>{if(e.removeEventListener("error",n),this.destroyed){r();return}try{s()}catch{this._setupFakeWorker()}});let s=()=>{let t=new Uint8Array;i.send("test",t,[t.buffer])};s();return}catch{(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){PDFWorkerUtil.isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),PDFWorkerUtil.isWorkerDisabled=!0),PDFWorker._setupFakeWorkerGlobal.then(t=>{if(this.destroyed){this._readyCapability.reject(Error("Worker was destroyed"));return}let e=new LoopbackPort;this._port=e;let i=`fake${PDFWorkerUtil.fakeWorkerId++}`,r=new _message_handler.MessageHandler(i+"_worker",i,e);t.setup(r,e);let n=new _message_handler.MessageHandler(i,i+"_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),PDFWorker.#l?.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(t){if(!t?.port)throw Error("PDFWorker.fromPort - invalid method signature.");let e=this.#l?.get(t.port);
1if(e){if(e._pendingDestroy)throw Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return e}return new PDFWorker(t)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(null!==PDFWorkerUtil.fallbackWorkerSrc)return _util.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){let loader=async()=>{let mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_util.isNodeJS){let worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}return await (0,_display_utils.loadScript)(this.workerSrc),window.pdfjsWorker.WorkerMessageHandler};return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}}exports.PDFWorker=PDFWorker;class WorkerTransport{#h=new Map;#d=new Map;#c=new Map;#u=null;constructor(t,e,i,r,n){this.messageHandler=t,this.loadingTask=e,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({ownerDocument:r.ownerDocument,styleElement:r.styleElement}),this._params=r,this.canvasFactory=n.canvasFactory,this.filterFactory=n.filterFactory,this.cMapReaderFactory=n.cMapReaderFactory,this.standardFontDataFactory=n.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=i,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=new _util.PromiseCapability,this.setupMessageHandler()}#p(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=this.#h.get(t);if(i)return i;let r=this.messageHandler.sendWithPromise(t,e);return this.#h.set(t,r),r}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}getRenderingIntent(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_util.AnnotationMode.ENABLE,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=_util.RenderingIntentFlag.DISPLAY,s=_annotation_storage.SerializableEmpty;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&&i instanceof _annotation_storage.PrintAnnotationStorage?i:this.annotationStorage).serializable;break;default:(0,_util.warn)(`getRenderingIntent - invalid annotationMode: ${e}`)}return r&&(n+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:n,cacheKey:`${n}_${s.hash}`,annotationStorageSerializable:s}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=new _util.PromiseCapability,this.#u?.reject(Error("Worker was destroyed during onPassword callback"));let t=[];for(let e of this.#d.values())t.push(e._destroy());this.#d.clear(),this.#c.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(),this.#h.clear(),this.filterFactory.destroy(),this._networkStream?.cancelAllRequests(new _util.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),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:i,done:r}=t;if(r){e.close();return}(0,_util.assert)(i instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),e.enqueue(new Uint8Array(i),1,[i])}).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 i=new _util.PromiseCapability,r=this._fullReader;return r.headersReady.then(()=>{r.isStreamingSupported&&r.isRangeSupported||(this._lastProgress&&e.onProgress?.(this._lastProgress),r.onProgress=t=>{e.onProgress?.({loaded:t.loaded,total:t.total})}),i.resolve({isStreamingSupported:r.isStreamingSupported,isRangeSupported:r.isRangeSupported,contentLength:r.contentLength})},i.reject),i.promise}),t.on("GetRangeReader",(t,e)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");let i=this._networkStream.getRangeReader(t.begin,t.end);if(!i){e.close();return}e.onPull=()=>{i.read().then(function(t){let{value:i,done:r}=t;if(r){e.close();return}(0,_util.assert)(i instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),e.enqueue(new Uint8Array(i),1,[i])}).catch(t=>{e.error(t)})},e.onCancel=t=>{i.cancel(t),e.ready.catch(t=>{if(!this.destroyed)throw t})}}),t.on("GetDoc",t=>{let{pdfInfo:i}=t;this._numPages=i.numPages,this._htmlForXfa=i.htmlForXfa,delete i.htmlForXfa,e._capability.resolve(new PDFDocumentProxy(i,this))}),t.on("DocException",function(t){let i;switch(t.name){case"PasswordException":i=new _util.PasswordException(t.message,t.code);break;case"InvalidPDFException":i=new _util.InvalidPDFException(t.message);break;case"MissingPDFException":i=new _util.MissingPDFException(t.message);break;case"UnexpectedResponseException":i=new _util.UnexpectedResponseException(t.message,t.status);break;case"UnknownErrorException":i=new _util.UnknownErrorException(t.message,t.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}e._capability.reject(i)}
1),t.on("PasswordRequest",t=>{if(this.#u=new _util.PromiseCapability,e.onPassword){let i=t=>{t instanceof Error?this.#u.reject(t):this.#u.resolve({password:t})};try{e.onPassword(i,t.code)}catch(t){this.#u.reject(t)}}else this.#u.reject(new _util.PasswordException(t.message,t.code));return this.#u.promise}),t.on("DataLoaded",t=>{e.onProgress?.({loaded:t.length,total:t.length}),this.downloadInfoCapability.resolve(t)}),t.on("StartRenderPage",t=>{this.destroyed||this.#d.get(t.pageIndex)._startRenderPage(t.transparency,t.cacheKey)}),t.on("commonobj",e=>{let[i,r,n]=e;if(!(this.destroyed||this.commonObjs.has(i)))switch(r){case"Font":let s=this._params;if("error"in n){let t=n.error;(0,_util.warn)(`Error during font loading: ${t}`),this.commonObjs.resolve(i,t);break}let a=s.pdfBug&&globalThis.FontInspector?.enabled?(t,e)=>globalThis.FontInspector.fontAdded(t,e):null,o=new _font_loader.FontFaceObject(n,{isEvalSupported:s.isEvalSupported,disableFontFace:s.disableFontFace,ignoreErrors:s.ignoreErrors,inspectFont:a});this.fontLoader.bind(o).catch(e=>t.sendWithPromise("FontFallback",{id:i})).finally(()=>{!s.fontExtraProperties&&o.data&&(o.data=null),this.commonObjs.resolve(i,o)});break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(i,n);break;default:throw Error(`Got unknown common object type ${r}`)}}),t.on("obj",t=>{let[e,i,r,n]=t;if(this.destroyed)return;let s=this.#d.get(i);if(!s.objs.has(e))switch(r){case"Image":if(s.objs.resolve(e,n),n){let t;if(n.bitmap){let{width:e,height:i}=n;t=e*i*4}else t=n.data?.length||0;t>_util.MAX_IMAGE_SIZE_TO_CACHE&&(s._maybeCleanupAfterRender=!0)}break;case"Pattern":s.objs.resolve(e,n);break;default:throw Error(`Got unknown object type ${r}`)}}),t.on("DocProgress",t=>{this.destroyed||e.onProgress?.({loaded:t.loaded,total:t.total})}),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.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");let{map:t,transfers:e}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:t,filename:this._fullReader?.filename??null},e).finally(()=>{this.annotationStorage.resetModified()})}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(Error("Invalid page request."));let e=t-1,i=this.#c.get(e);if(i)return i;let r=this.messageHandler.sendWithPromise("GetPage",{pageIndex:e}).then(t=>{if(this.destroyed)throw Error("Transport destroyed");let i=new PDFPageProxy(e,t,this,this._params.pdfBug);return this.#d.set(e,i),i});return this.#c.set(e,r),r}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})}getFieldObjects(){return this.#p("GetFieldObjects")}hasJSActions(){return this.#p("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return"string"!=typeof t?Promise.reject(Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}
1getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return this.#p("GetDocJSActions")}getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:t})}getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:t})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then(t=>new _optional_content_config.OptionalContentConfig(t))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){let t="GetMetadata",e=this.#h.get(t);if(e)return e;let i=this.messageHandler.sendWithPromise(t,null).then(t=>({info:t[0],metadata:t[1]?new _metadata.Metadata(t[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null}));return this.#h.set(t,i),i}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.destroyed){for(let t of(await this.messageHandler.sendWithPromise("Cleanup",null),this.#d.values()))if(!t.cleanup())throw Error(`startCleanup: Page ${t.pageNumber} is currently rendering.`);this.commonObjs.clear(),t||this.fontLoader.clear(),this.#h.clear(),this.filterFactory.destroy(!0)}}get loadingParams(){let{disableAutoFetch:t,enableXfa:e}=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:t,enableXfa:e})}}class PDFObjects{#f=Object.create(null);#g(t){return this.#f[t]||={capability:new _util.PromiseCapability,data:null}}get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e){let i=this.#g(t);return i.capability.promise.then(()=>e(i.data)),null}let i=this.#f[t];if(!i?.capability.settled)throw Error(`Requesting object that isn't resolved yet ${t}.`);return i.data}has(t){let e=this.#f[t];return e?.capability.settled||!1}resolve(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=this.#g(t);i.data=e,i.capability.resolve()}clear(){for(let t in this.#f){let{data:e}=this.#f[t];e?.bitmap?.close()}this.#f=Object.create(null)}}class RenderTask{#m=null;constructor(t){this.#m=t,this.onContinue=null}get promise(){return this.#m.capability.promise}cancel(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.#m.cancel(null,t)}get separateAnnots(){let{separateAnnots:t}=this.#m.operatorList;if(!t)return!1;let{annotationCanvasMap:e}=this.#m;return t.form||t.canvas&&e?.size>0}}exports.RenderTask=RenderTask;class InternalRenderTask{static #b=new WeakSet;constructor(t){let{callback:e,params:i,objs:r,commonObjs:n,annotationCanvasMap:s,operatorList:a,pageIndex:o,canvasFactory:l,filterFactory:h,useRequestAnimationFrame:d=!1,pdfBug:c=!1,pageColors:u=null}=t;this.callback=e,this.params=i,this.objs=r,this.commonObjs=n,this.annotationCanvasMap=s,this.operatorListIdx=null,this.operatorList=a,this._pageIndex=o,this.canvasFactory=l,this.filterFactory=h,this._pdfBug=c,this.pageColors=u,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===d&&"undefined"!=typeof window,this.cancelled=!1,this.capability=new _util.PromiseCapability,this.task=new RenderTask(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=i.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics(t){let{transparency:e=!1,optionalContentConfig:i}=t;if(this.cancelled)return;if(this._canvas){if(InternalRenderTask.#b.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.");InternalRenderTask.#b.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());let{canvasContext:r,viewport:n,transform:s,background:a}=this.params;this.gfx=new _canvas.CanvasGraphics(r,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:i},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:s,viewport:n,transparency:e,background:a}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),InternalRenderTask.#b.delete(this._canvas),this.callback(t||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,e))}operatorListChanged(){if(!this.graphicsReady){this.graphicsReadyCallback||=this._continueBound;return}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)}
1):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){!this.cancelled&&(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),InternalRenderTask.#b.delete(this._canvas),this.callback())))}}let version="3.11.174";exports.version=version;let build="ce8716743";exports.build=build},(t,e,i)=>{var r=i(3),n=i(126);r({target:"Set",proto:!0,real:!0,forced:!i(135)("difference")},{difference:n})},(t,e,i)=>{var r=i(127),n=i(128),s=i(129),a=i(132),o=i(133),l=i(130),h=i(131),d=n.has,c=n.remove;t.exports=function(t){var e=r(this),i=o(t),n=s(e);return a(e)<=i.size?l(e,function(t){i.includes(t)&&c(n,t)}):h(i.getIterator(),function(t){d(e,t)&&c(n,t)}),n}},(t,e,i)=>{var r=i(128).has;t.exports=function(t){return r(t),t}},(t,e,i)=>{var r=i(14),n=Set.prototype;t.exports={Set:Set,add:r(n.add),has:r(n.has),remove:r(n.delete),proto:n}},(t,e,i)=>{var r=i(128),n=i(130),s=r.Set,a=r.add;t.exports=function(t){var e=new s;return n(t,function(t){a(e,t)}),e}},(t,e,i)=>{var r=i(14),n=i(131),s=i(128),a=s.Set,o=s.proto,l=r(o.forEach),h=r(o.keys),d=h(new a).next;t.exports=function(t,e,i){return i?n({iterator:h(t),next:d},e):l(t,e)}},(t,e,i)=>{var r=i(8);t.exports=function(t,e,i){for(var n,s,a=i?t:t.iterator,o=t.next;!(n=r(o,a)).done;)if(void 0!==(s=e(n.value)))return s}},(t,e,i)=>{var r=i(72),n=i(128);t.exports=r(n.proto,"size","get")||function(t){return t.size}},(t,e,i)=>{var r=i(31),n=i(47),s=i(8),a=i(62),o=i(134),l="Invalid size",h=RangeError,d=TypeError,c=Math.max,u=function(t,e,i,r){this.set=t,this.size=e,this.has=i,this.keys=r};u.prototype={getIterator:function(){return o(n(s(this.keys,this.set)))},includes:function(t){return s(this.has,this.set,t)}},t.exports=function(t){n(t);var e=+t.size;if(e!=e)throw d(l);var i=a(e);if(i<0)throw h(l);return new u(t,c(i,0),r(t.has),r(t.keys))}},t=>{t.exports=function(t){return{iterator:t,next:t.next,done:!1}}},(t,e,i)=>{var r=i(24),n=function(t){return{size:t,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}};t.exports=function(t){var e=r("Set");try{new e()[t](n(0));try{return new e()[t](n(-1)),!1}catch(t){return!0}}catch(t){return!1}}},(t,e,i)=>{var r=i(3),n=i(7),s=i(137);r({target:"Set",proto:!0,real:!0,forced:!i(135)("intersection")||n(function(){return"3,2"!==Array.from(new Set([1,2,3]).intersection(new Set([3,2])))})},{intersection:s})},(t,e,i)=>{var r=i(127),n=i(128),s=i(132),a=i(133),o=i(130),l=i(131),h=n.Set,d=n.add,c=n.has;t.exports=function(t){var e=r(this),i=a(t),n=new h;return s(e)>i.size?l(i.getIterator(),function(t){c(e,t)&&d(n,t)}):o(e,function(t){i.includes(t)&&d(n,t)}),n}},(t,e,i)=>{var r=i(3),n=i(139);r({target:"Set",proto:!0,real:!0,forced:!i(135)("isDisjointFrom")},{isDisjointFrom:n})},(t,e,i)=>{var r=i(127),n=i(128).has,s=i(132),a=i(133),o=i(130),l=i(131),h=i(140);t.exports=function(t){var e=r(this),i=a(t);if(s(e)<=i.size)return!1!==o(e,function(t){if(i.includes(t))return!1},!0);var d=i.getIterator();return!1!==l(d,function(t){if(n(e,t))return h(d,"normal",!1)})}},(t,e,i)=>{var r=i(8),n=i(47),s=i(30);t.exports=function(t,e,i){var a,o;n(t);try{if(!(a=s(t,"return"))){if("throw"===e)throw i;return i}a=r(a,t)}catch(t){o=!0,a=t}if("throw"===e)throw i;if(o)throw a;return n(a),i}},(t,e,i)=>{var r=i(3),n=i(142);r({target:"Set",proto:!0,real:!0,forced:!i(135)("isSubsetOf")},{isSubsetOf:n})},(t,e,i)=>{var r=i(127),n=i(132),s=i(130),a=i(133);t.exports=function(t){var e=r(this),i=a(t);return!(n(e)>i.size)&&!1!==s(e,function(t){if(!i.includes(t))return!1},!0)}},(t,e,i)=>{var r=i(3),n=i(144);r({target:"Set",proto:!0,real:!0,forced:!i(135)("isSupersetOf")},{isSupersetOf:n})},(t,e,i)=>{var r=i(127),n=i(128).has,s=i(132),a=i(133),o=i(131),l=i(140);t.exports=function(t){var e=r(this),i=a(t);if(s(e)<i.size)return!1;var h=i.getIterator();return!1!==o(h,function(t){if(!n(e,t))return l(h,"normal",!1)})}},(t,e,i)=>{var r=i(3),n=i(146);r({target:"Set",proto:!0,real:!0,forced:!i(135)("symmetricDifference")},{symmetricDifference:n})},(t,e,i)=>{var r=i(127),n=i(128),s=i(129),a=i(133),o=i(131),l=n.add,h=n.has,d=n.remove;t.exports=function(t){var e=r(this),i=a(t).getIterator(),n=s(e);return o(i,function(t){h(e,t)?d(n,t):l(n,t)}),n}},(t,e,i)=>{var r=i(3),n=i(148);r({target:"Set",proto:!0,real:!0,forced:!i(135)("union")},{union:n})},(t,e,i)=>{var r=i(127),n=i(128).add,s=i(129),a=i(133),o=i(131);t.exports=function(t){var e=r(this),i=a(t).getIterator(),l=s(e);return o(i,function(t){n(l,t)}),l}},(t,e,i)=>{var r=i(3),n=i(4),s=i(24),a=i(11),o=i(45).f,l=i(39),h=i(150),d=i(75),c=i(76),u=i(151),p=i(82),f=i(6),g=i(36),m="DOMException",b=s("Error"),v=s(m),A=function(){h(this,y);var t=arguments.length,e=c(t<1?void 0:arguments[0]),i=c(t<2?void 0:arguments[1],"Error"),r=new v(e,i),n=b(e);
1return n.name=m,o(r,"stack",a(1,p(n.stack,1))),d(r,this,A),r},y=A.prototype=v.prototype,_="stack"in b(m),S="stack"in new v(1,2),E=v&&f&&Object.getOwnPropertyDescriptor(n,m),x=!!E&&!(E.writable&&E.configurable),w=_&&!x&&!S;r({global:!0,constructor:!0,forced:g||w},{DOMException:w?A:v});var C=s(m),T=C.prototype;if(T.constructor!==C){for(var P in g||o(T,"constructor",a(1,C)),u)if(l(u,P)){var M=u[P],k=M.s;l(C,k)||o(C,k,a(6,M.c))}}},(t,e,i)=>{var r=i(25),n=TypeError;t.exports=function(t,e){if(r(e,t))return t;throw n("Incorrect invocation")}},t=>{t.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1}
1,InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},(t,e,i)=>{var r=i(36),n=i(3),s=i(4),a=i(24),o=i(14),l=i(7),h=i(41),d=i(21),c=i(153),u=i(17),p=i(20),f=i(23),g=i(154),m=i(47),b=i(78),v=i(39),A=i(159),y=i(44),_=i(64),S=i(85),E=i(160),x=i(162),w=i(128),C=i(83),T=i(119),P=s.Object,M=s.Array,k=s.Date,R=s.Error,F=s.EvalError,I=s.RangeError,D=s.ReferenceError,O=s.SyntaxError,L=s.TypeError,N=s.URIError,B=s.PerformanceMark,U=s.WebAssembly,j=U&&U.CompileError||R,z=U&&U.LinkError||R,H=U&&U.RuntimeError||R,G=a("DOMException"),W=x.Map,V=x.has,$=x.get,q=x.set,X=w.Set,K=w.add,Y=a("Object","keys"),J=o([].push),Q=o((!0).valueOf),Z=o(1..valueOf),tt=o("".valueOf),te=o(k.prototype.getTime),ti=h("structuredClone"),tr="DataCloneError",tn="Transferring",ts=function(t){return!l(function(){var e=new s.Set([7]),i=t(e),r=t(P(7));return i===e||!i.has(7)||"object"!=typeof r||7!=+r})&&t},ta=function(t,e){return!l(function(){var i=new e,r=t({a:i,b:i});return!(r&&r.a===r.b&&r.a instanceof e&&r.a.stack===i.stack)})},to=function(t){return!l(function(){var e=t(new s.AggregateError([1],ti,{cause:3}));return"AggregateError"!==e.name||1!==e.errors[0]||e.message!==ti||3!==e.cause})},tl=s.structuredClone,th=r||!ta(tl,R)||!ta(tl,G)||!to(tl),td=!tl&&ts(function(t){return new B(ti,{detail:t}).detail}),tc=ts(tl)||td,tu=function(t){throw new G("Uncloneable type: "+t,tr)},tp=function(t,e){throw new G((e||"Cloning")+" of "+t+" cannot be properly polyfilled in this engine",tr)},tf=function(t,e){return tc||tp(e),tc(t)},tg=function(){var t;try{t=new s.DataTransfer}catch(e){try{t=new s.ClipboardEvent("").clipboardData}catch(t){}}return t&&t.items&&t.files?t:null},tm=function(t,e,i){if(V(e,t))return $(e,t);if("SharedArrayBuffer"===(i||b(t)))r=tc?tc(t):t;else{var r,n,a,o,l,h,d=s.DataView;d||"function"==typeof t.slice||tp("ArrayBuffer");try{if("function"!=typeof t.slice||t.resizable)for(h=0,n=t.byteLength,a=("maxByteLength"in t)?{maxByteLength:t.maxByteLength}:void 0,r=new ArrayBuffer(n,a),o=new d(t),l=new d(r);h<n;h++)l.setUint8(h,o.getUint8(h));else r=t.slice(0)}catch(t){throw new G("ArrayBuffer is detached",tr)}}return q(e,t,r),r},tb=function(t,e,i,r,n){var a=s[e];return p(a)||tp(e),new a(tm(t.buffer,n),i,r)},tv=function(t,e,i){this.object=t,this.type=e,this.metadata=i},tA=function(t,e,i){if(f(t)&&tu("Symbol"),!p(t))return t;if(e){if(V(e,t))return $(e,t)}else e=new W;var r,n,o,l,h,c,u,g,m=b(t);switch(m){case"Array":o=M(_(t));break;case"Object":o={};break;case"Map":o=new W;break;case"Set":o=new X;break;case"RegExp":o=new RegExp(t.source,E(t));break;case"Error":switch(n=t.name){case"AggregateError":o=a("AggregateError")([]);break;case"EvalError":o=F();break;case"RangeError":o=I();break;case"ReferenceError":o=D();break;case"SyntaxError":o=O();break;case"TypeError":o=L();break;case"URIError":o=N();break;case"CompileError":o=j();break;case"LinkError":o=z();break;case"RuntimeError":o=H();break;default:o=R()}break;case"DOMException":o=new G(t.message,t.name);break;case"ArrayBuffer":case"SharedArrayBuffer":o=i?new tv(t,m):tm(t,e,m);break;case"DataView":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float16Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":c="DataView"===m?t.byteLength:t.length,o=i?new tv(t,m,{offset:t.byteOffset,length:c}):tb(t,m,t.byteOffset,c,e);break;case"DOMQuad":try{o=new DOMQuad(tA(t.p1,e,i),tA(t.p2,e,i),tA(t.p3,e,i),tA(t.p4,e,i))}catch(e){o=tf(t,m)}break;case"File":if(tc)try{o=tc(t),b(o)!==m&&(o=void 0)}catch(t){}if(!o)try{o=new File([t],t.name,t)}catch(t){}o||tp(m);break;case"FileList":if(l=tg()){for(h=0,c=_(t);h<c;h++)l.items.add(tA(t[h],e,i));o=l.files}else o=tf(t,m);break;case"ImageData":try{o=new ImageData(tA(t.data,e,i),t.width,t.height,{colorSpace:t.colorSpace})}catch(e){o=tf(t,m)}break;default:if(tc)o=tc(t);else switch(m){case"BigInt":o=P(t.valueOf());break;case"Boolean":o=P(Q(t));break;case"Number":o=P(Z(t));break;case"String":o=P(tt(t));break;case"Date":o=new k(te(t));break;case"Blob":try{o=t.slice(0,t.size,t.type)}catch(t){tp(m)}break;case"DOMPoint":case"DOMPointReadOnly":r=s[m];try{o=r.fromPoint?r.fromPoint(t):new r(t.x,t.y,t.z,t.w)}catch(t){tp(m)}break;case"DOMRect":case"DOMRectReadOnly":r=s[m];try{o=r.fromRect?r.fromRect(t):new r(t.x,t.y,t.width,t.height)}catch(t){tp(m)}break;case"DOMMatrix":case"DOMMatrixReadOnly":r=s[m];try{o=r.fromMatrix?r.fromMatrix(t):new r(t)}catch(t){tp(m)}break;case"AudioData":case"VideoFrame":d(t.clone)||tp(m);try{o=t.clone()}catch(t){tu(m)}break;case"CropTarget":case"CryptoKey":case"FileSystemDirectoryHandle":case"FileSystemFileHandle":case"FileSystemHandle":case"GPUCompilationInfo":case"GPUCompilationMessage":case"ImageBitmap":case"RTCCertificate":case"WebAssembly.Module":tp(m);default:tu(m)}}switch(q(e,t,o),m){case"Array":case"Object":for(h=0,c=_(u=Y(t));h<c;h++)g=u[h],A(o,g,tA(t[g],e,i));break;case"Map":t.forEach(function(t,r){q(o,tA(r,e,i),tA(t,e,i))});break;case"Set":t.forEach(function(t){K(o,tA(t,e,i))});break;case"Error":y(o,"message",tA(t.message,e,i)),v(t,"cause")&&y(o,"cause",tA(t.cause,e,i)),"AggregateError"===n&&(o.errors=tA(t.errors,e,i));case"DOMException":C&&y(o,"stack",tA(t.stack,e,i))}return o},ty=function(t,e){var i,r,n,s,a,o,l,h;if(!p(t))return t;if(V(e,t))return $(e,t);if(t instanceof tv)switch(i=t.type,r=t.object,i){case"ArrayBuffer":case"SharedArrayBuffer":h=tm(r,e,i);break;case"DataView":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float16Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":h=tb(r,i,(n=t.metadata).offset,n.length,e)}else switch(b(t)){case"Array":case"Object":for(s=0,a=_(o=Y(t));s<a;s++)t[l=o[s]]=ty(t[l],e);break;case"Map":h=new W,t.forEach(function(t,i){q(h,ty(i,e),ty(t,e))});break;case"Set":h=new X,t.forEach(function(t){K(h,ty(t,e))});break;case"Error":t.message=ty(t.message,e),v(t,"cause")&&(t.cause=ty(t.cause,e)),"AggregateError"===t.name&&(t.errors=ty(t.errors,e));case"DOMException":C&&(t.stack=ty(t.stack,e))}return q(e,t,h||t),h||t},t_=function(t,e){if(!p(t))throw L("Transfer option cannot be converted to a sequence");var i,r,n,a,o,l=[];g(t,function(t){J(l,m(t))});for(var h=0,u=_(l),f=[];h<u;){if("ArrayBuffer"===(r=b(i=l[h++]))){J(f,i);continue}if(V(e,i))throw new G("Duplicate transferable",tr);if(T)a=tl(i,{transfer:[i]});else switch(r){case"ImageBitmap":c(n=s.OffscreenCanvas)||tp(r,tn);try{(o=new n(i.width,i.height)).getContext("bitmaprenderer").transferFromImageBitmap(i),a=o.transferToImageBitmap()}catch(t){}break;case"AudioData":case"VideoFrame":d(i.clone)&&d(i.close)||tp(r,tn);try{a=i.clone(),i.close()}catch(t){}break;case"MediaSourceHandle":case"MessagePort":case"OffscreenCanvas":case"ReadableStream":case"TransformStream":case"WritableStream":tp(r,tn)}if(void 0===a)throw new G("This object cannot be transferred: "+r,tr);q(e,i,a)}return f},tS=function(t,e){for(var i,r,n=0,s=_(t);n<s;){if(V(e,i=t[n++]))throw new G("Duplicate transferable",tr);T?r=tl(i,{transfer:[i]}
1):(d(i.transfer)||tp("ArrayBuffer",tn),r=i.transfer()),q(e,i,r)}};n({global:!0,enumerable:!0,sham:!T,forced:th},{structuredClone:function(t){var e,i=S(arguments.length,1)>1&&!u(arguments[1])?m(arguments[1]):void 0,r=i?i.transfer:void 0,n=!1;void 0!==r&&(n=!!_(t_(r,e=new W)));var s=tA(t,e,n);return n&&(tS(r,e=new W),s=ty(s,e)),s}})},(t,e,i)=>{var r=i(14),n=i(7),s=i(21),a=i(78),o=i(24),l=i(51),h=function(){},d=[],c=o("Reflect","construct"),u=/^\s*(?:class|function)\b/,p=r(u.exec),f=!u.exec(h),g=function(t){if(!s(t))return!1;try{return c(h,d,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}};m.sham=!0,t.exports=!c||n(function(){var t;return g(g.call)||!g(Object)||!g(function(){t=!0})||t})?m:g},(t,e,i)=>{var r=i(99),n=i(8),s=i(47),a=i(32),o=i(155),l=i(64),h=i(25),d=i(157),c=i(158),u=i(140),p=TypeError,f=function(t,e){this.stopped=t,this.result=e},g=f.prototype;t.exports=function(t,e,i){var m,b,v,A,y,_,S,E=i&&i.that,x=!!(i&&i.AS_ENTRIES),w=!!(i&&i.IS_RECORD),C=!!(i&&i.IS_ITERATOR),T=!!(i&&i.INTERRUPTED),P=r(e,E),M=function(t){return m&&u(m,"normal",t),new f(!0,t)},k=function(t){return x?(s(t),T?P(t[0],t[1],M):P(t[0],t[1])):T?P(t,M):P(t)};if(w)m=t.iterator;else if(C)m=t;else{if(!(b=c(t)))throw p(a(t)+" is not iterable");if(o(b)){for(v=0,A=l(t);A>v;v++)if((y=k(t[v]))&&h(g,y))return y;return new f(!1)}m=d(t,b)}for(_=w?t.next:m.next;!(S=n(_,m)).done;){try{y=k(S.value)}catch(t){u(m,"throw",t)}if("object"==typeof y&&y&&h(g,y))return y}return new f(!1)}},(t,e,i)=>{var r=i(34),n=i(156),s=r("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(n.Array===t||a[s]===t)}},t=>{t.exports={}},(t,e,i)=>{var r=i(8),n=i(31),s=i(47),a=i(32),o=i(158),l=TypeError;t.exports=function(t,e){var i=arguments.length<2?o(t):e;if(n(i))return s(r(i,t));throw l(a(t)+" is not iterable")}},(t,e,i)=>{var r=i(78),n=i(30),s=i(17),a=i(156),o=i(34)("iterator");t.exports=function(t){if(!s(t))return n(t,o)||n(t,"@@iterator")||a[r(t)]}},(t,e,i)=>{var r=i(18),n=i(45),s=i(11);t.exports=function(t,e,i){var a=r(e);a in t?n.f(t,a,s(0,i)):t[a]=i}},(t,e,i)=>{var r=i(8),n=i(39),s=i(25),a=i(161),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:r(a,t)}},(t,e,i)=>{var r=i(47);t.exports=function(){var t=r(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,i)=>{var r=i(14),n=Map.prototype;t.exports={Map:Map,set:r(n.set),get:r(n.get),has:r(n.has),remove:r(n.delete),proto:n}},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SerializableEmpty=e.PrintAnnotationStorage=e.AnnotationStorage=void 0,i(89),i(149),i(152);var r=i(1),n=i(164),s=i(170);let a=Object.freeze({map:null,hash:"",transfers:void 0});e.SerializableEmpty=a;class o{#v=!1;#A=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,e){let i=this.#A.get(t);return void 0===i?e:Object.assign(e,i)}getRawValue(t){return this.#A.get(t)}remove(t){if(this.#A.delete(t),0===this.#A.size&&this.resetModified(),"function"==typeof this.onAnnotationEditor){for(let t of this.#A.values())if(t instanceof n.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(t,e){let i=this.#A.get(t),r=!1;if(void 0!==i)for(let[t,n]of Object.entries(e))i[t]!==n&&(r=!0,i[t]=n);else r=!0,this.#A.set(t,e);r&&this.#y(),e instanceof n.AnnotationEditor&&"function"==typeof this.onAnnotationEditor&&this.onAnnotationEditor(e.constructor._type)}has(t){return this.#A.has(t)}getAll(){return this.#A.size>0?(0,r.objectFromMap)(this.#A):null}setAll(t){for(let[e,i]of Object.entries(t))this.setValue(e,i)}get size(){return this.#A.size}#y(){this.#v||(this.#v=!0,"function"==typeof this.onSetModified&&this.onSetModified())}resetModified(){this.#v&&(this.#v=!1,"function"==typeof this.onResetModified&&this.onResetModified())}get print(){return new l(this)}get serializable(){if(0===this.#A.size)return a;let t=new Map,e=new s.MurmurHash3_64,i=[],r=Object.create(null),o=!1;for(let[i,s]of this.#A){let a=s instanceof n.AnnotationEditor?s.serialize(!1,r):s;a&&(t.set(i,a),e.update(`${i}:${JSON.stringify(a)}`),o||=!!a.bitmap)}if(o)for(let e of t.values())e.bitmap&&i.push(e.bitmap);return t.size>0?{map:t,hash:e.hexdigest(),transfers:i}:a}}e.AnnotationStorage=o;class l extends o{#_;constructor(t){super();let{map:e,hash:i,transfers:r}=t.serializable,n=structuredClone(e,null);this.#_={map:n,hash:i,transfers:r}}get print(){(0,r.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#_}}e.PrintAnnotationStorage=l},(t,e,i)=>
1{Object.defineProperty(e,"__esModule",{value:!0}),e.AnnotationEditor=void 0,i(89),i(2);var r=i(165),n=i(1),s=i(168);class a{#S="";#E=!1;#x=null;#w=null;#C=null;#T=!1;#P=null;#M=this.focusin.bind(this);#k=this.focusout.bind(this);#R=!1;#F=!1;#I=!1;_initialOptions=Object.create(null);_uiManager=null;_focusEventsAllowed=!0;_l10nPromise=null;#D=!1;#O=a._zIndex++;static _borderLineWidth=-1;static _colorManager=new r.ColorManager;static _zIndex=1;static SMALL_EDITOR_SIZE=0;constructor(t){this.constructor===a&&(0,n.unreachable)("Cannot initialize AnnotationEditor."),this.parent=t.parent,this.id=t.id,this.width=this.height=null,this.pageIndex=t.parent.pageIndex,this.name=t.name,this.div=null,this._uiManager=t.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=t.isCentered,this._structTreeParentId=null;let{rotation:e,rawDims:{pageWidth:i,pageHeight:r,pageX:s,pageY:o}}=this.parent.viewport;this.rotation=e,this.pageRotation=(360+e-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[i,r],this.pageTranslation=[s,o];let[l,h]=this.parentDimensions;this.x=t.x/l,this.y=t.y/h,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return(0,n.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){let e=new o({id:t.parent.getNextId(),parent:t.parent,uiManager:t._uiManager});e.annotationElementId=t.annotationElementId,e.deleted=!0,e._uiManager.addToAnnotationStorage(e)}static initialize(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(a._l10nPromise||=new Map(["editor_alt_text_button_label","editor_alt_text_edit_button_label","editor_alt_text_decorative_tooltip"].map(e=>[e,t.get(e)])),e?.strings)for(let i of e.strings)a._l10nPromise.set(i,t.get(i));if(-1!==a._borderLineWidth)return;let i=getComputedStyle(document.documentElement);a._borderLineWidth=parseFloat(i.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,e){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,e){(0,n.unreachable)("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#D}set _isDraggable(t){this.#D=t,this.div?.classList.toggle("draggable",t)}center(){let[t,e]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*e/(2*t),this.y+=this.width*t/(2*e);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*e/(2*t),this.y-=this.width*t/(2*e);break;default:this.x-=this.width/2,this.y-=this.height/2}this.fixAndSetPosition()}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#O}setParent(t){null!==t&&(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions),this.parent=t}focusin(t){this._focusEventsAllowed&&(this.#R?this.#R=!1:this.parent.setSelected(this))}focusout(t){if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;let e=t.relatedTarget;!e?.closest(`#${this.id}`)&&(t.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(t,e,i,r){let[n,s]=this.parentDimensions;[i,r]=this.screenToPageTranslation(i,r),this.x=(t+i)/n,this.y=(e+r)/s,this.fixAndSetPosition()}#L(t,e,i){let[r,n]=t;[e,i]=this.screenToPageTranslation(e,i),this.x+=e/r,this.y+=i/n,this.fixAndSetPosition()}translate(t,e){this.#L(this.parentDimensions,t,e)}translateInPage(t,e){this.#L(this.pageDimensions,t,e),this.div.scrollIntoView({block:"nearest"})}drag(t,e){let[i,r]=this.parentDimensions;if(this.x+=t/i,this.y+=e/r,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){let{x:t,y:e}=this.div.getBoundingClientRect();this.parent.findNewParent(this,t,e)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:n,y:s}=this,[a,o]=this.#N();n+=a,s+=o,this.div.style.left=`${(100*n).toFixed(2)}%`,this.div.style.top=`${(100*s).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}#N(){let[t,e]=this.parentDimensions,{_borderLineWidth:i}=a,r=i/t,n=i/e;switch(this.rotation){case 90:return[-r,n];case 180:return[r,n];case 270:return[r,-n];default:return[-r,-n]}}fixAndSetPosition(){let[t,e]=this.pageDimensions,{x:i,y:r,width:n,height:s}=this;switch(n*=t,s*=e,i*=t,r*=e,this.rotation){case 0:i=Math.max(0,Math.min(t-n,i)),r=Math.max(0,Math.min(e-s,r));break;case 90:i=Math.max(0,Math.min(t-s,i)),r=Math.min(e,Math.max(n,r));break;case 180:i=Math.min(t,Math.max(n,i)),r=Math.min(e,Math.max(s,r));break;case 270:i=Math.min(t,Math.max(s,i)),r=Math.max(0,Math.min(e-n,r))}this.x=i/=t,this.y=r/=e;let[a,o]=this.#N();i+=a,r+=o;let{style:l}=this.div;l.left=`${(100*i).toFixed(2)}%`,l.top=`${(100*r).toFixed(2)}%`,this.moveInDOM()}static #B(t,e,i){switch(i){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}}screenToPageTranslation(t,e){return a.#B(t,e,this.parentRotation)}pageTranslationToScreen(t,e){return a.#B(t,e,360-this.parentRotation)}#U(t){switch(t){case 90:{let[t,e]=this.pageDimensions;return[0,-t/e,e/t,0]}case 180:return[-1,0,0,-1];case 270:{let[t,e]=this.pageDimensions;return[0,t/e,-e/t,0]}default:return[1,0,0,1]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){let{parentScale:t,pageDimensions:[e,i]}=this,r=e*t,s=i*t;return n.FeatureTest.isCSSRoundSupported?[Math.round(r),Math.round(s)]:[r,s]}setDims(t,e){let[i,r]=this.parentDimensions;this.div.style.width=`${(100*t/i).toFixed(2)}%`,this.#T||(this.div.style.height=`${(100*e/r).toFixed(2)}%`),this.#x?.classList.toggle("small",t<a.SMALL_EDITOR_SIZE||e<a.SMALL_EDITOR_SIZE)}fixDims(){let{style:t}=this.div,{height:e,width:i}=t,r=i.endsWith("%"),n=!this.#T&&e.endsWith("%");if(r&&n)return;let[s,a]=this.parentDimensions;r||(t.width=`${(100*parseFloat(i)/s).toFixed(2)}%`),this.#T||n||(t.height=`${(100*parseFloat(e)/a).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}#j(){if(this.#P)return;this.#P=document.createElement("div"),this.#P.classList.add("resizers");let t=["topLeft","topRight","bottomRight","bottomLeft"];
1for(let e of(this._willKeepAspectRatio||t.push("topMiddle","middleRight","bottomMiddle","middleLeft"),t)){let t=document.createElement("div");this.#P.append(t),t.classList.add("resizer",e),t.addEventListener("pointerdown",this.#z.bind(this,e)),t.addEventListener("contextmenu",s.noContextMenu)}this.div.prepend(this.#P)}#z(t,e){e.preventDefault();let{isMac:i}=n.FeatureTest.platform;if(0!==e.button||e.ctrlKey&&i)return;let r=this.#H.bind(this,t),s=this._isDraggable;this._isDraggable=!1;let a={passive:!0,capture:!0};window.addEventListener("pointermove",r,a);let o=this.x,l=this.y,h=this.width,d=this.height,c=this.parent.div.style.cursor,u=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(e.target).cursor;let p=()=>{this._isDraggable=s,window.removeEventListener("pointerup",p),window.removeEventListener("blur",p),window.removeEventListener("pointermove",r,a),this.parent.div.style.cursor=c,this.div.style.cursor=u;let t=this.x,e=this.y,i=this.width,n=this.height;(t!==o||e!==l||i!==h||n!==d)&&this.addCommands({cmd:()=>{this.width=i,this.height=n,this.x=t,this.y=e;let[r,s]=this.parentDimensions;this.setDims(r*i,s*n),this.fixAndSetPosition()},undo:()=>{this.width=h,this.height=d,this.x=o,this.y=l;let[t,e]=this.parentDimensions;this.setDims(t*h,e*d),this.fixAndSetPosition()},mustExec:!0})};window.addEventListener("pointerup",p),window.addEventListener("blur",p)}#H(t,e){let i,r;let[n,s]=this.parentDimensions,o=this.x,l=this.y,h=this.width,d=this.height,c=a.MIN_SIZE/n,u=a.MIN_SIZE/s,p=t=>Math.round(1e4*t)/1e4,f=this.#U(this.rotation),g=(t,e)=>[f[0]*t+f[2]*e,f[1]*t+f[3]*e],m=this.#U(360-this.rotation),b=(t,e)=>[m[0]*t+m[2]*e,m[1]*t+m[3]*e],v=!1,A=!1;switch(t){case"topLeft":v=!0,i=(t,e)=>[0,0],r=(t,e)=>[t,e];break;case"topMiddle":i=(t,e)=>[t/2,0],r=(t,e)=>[t/2,e];break;case"topRight":v=!0,i=(t,e)=>[t,0],r=(t,e)=>[0,e];break;case"middleRight":A=!0,i=(t,e)=>[t,e/2],r=(t,e)=>
1[0,e/2];break;case"bottomRight":v=!0,i=(t,e)=>[t,e],r=(t,e)=>[0,0];break;case"bottomMiddle":i=(t,e)=>[t/2,e],r=(t,e)=>[t/2,0];break;case"bottomLeft":v=!0,i=(t,e)=>[0,e],r=(t,e)=>[t,0];break;case"middleLeft":A=!0,i=(t,e)=>[0,e/2],r=(t,e)=>[t,e/2]}let y=i(h,d),_=r(h,d),S=g(..._),E=p(o+S[0]),x=p(l+S[1]),w=1,C=1,[T,P]=this.screenToPageTranslation(e.movementX,e.movementY);if([T,P]=b(T/n,P/s),v){let t=Math.hypot(h,d);w=C=Math.max(Math.min(Math.hypot(_[0]-y[0]-T,_[1]-y[1]-P)/t,1/h,1/d),c/h,u/d)}else A?w=Math.max(c,Math.min(1,Math.abs(_[0]-y[0]-T)))/h:C=Math.max(u,Math.min(1,Math.abs(_[1]-y[1]-P)))/d;let M=p(h*w),k=p(d*C),R=E-(S=g(...r(M,k)))[0],F=x-S[1];this.width=M,this.height=k,this.x=R,this.y=F,this.setDims(n*M,s*k),this.fixAndSetPosition()}async addAltTextButton(){if(this.#x)return;let t=this.#x=document.createElement("button");t.className="altText";let e=await a._l10nPromise.get("editor_alt_text_button_label");if(t.textContent=e,t.setAttribute("aria-label",e),t.tabIndex="0",t.addEventListener("contextmenu",s.noContextMenu),t.addEventListener("pointerdown",t=>t.stopPropagation()),t.addEventListener("click",t=>{t.preventDefault(),this._uiManager.editAltText(this)},{capture:!0}),t.addEventListener("keydown",e=>{e.target===t&&"Enter"===e.key&&(e.preventDefault(),this._uiManager.editAltText(this))}),this.#G(),this.div.append(t),!a.SMALL_EDITOR_SIZE){let e=40;a.SMALL_EDITOR_SIZE=Math.min(128,Math.round(t.getBoundingClientRect().width*(1+e/100)))}}async #G(){let t=this.#x;if(!t)return;if(!this.#S&&!this.#E){t.classList.remove("done"),this.#w?.remove();return}a._l10nPromise.get("editor_alt_text_edit_button_label").then(e=>{t.setAttribute("aria-label",e)});let e=this.#w;if(!e){this.#w=e=document.createElement("span"),e.className="tooltip",e.setAttribute("role","tooltip");let i=e.id=`alt-text-tooltip-${this.id}`;t.setAttribute("aria-describedby",i);let r=100;t.addEventListener("mouseenter",()=>{this.#C=setTimeout(()=>{this.#C=null,this.#w.classList.add("show"),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"alt_text_tooltip"}}})},r)}),t.addEventListener("mouseleave",()=>{clearTimeout(this.#C),this.#C=null,this.#w?.classList.remove("show")})}t.classList.add("done"),e.innerText=this.#E?await a._l10nPromise.get("editor_alt_text_decorative_tooltip"):this.#S,e.parentNode||t.append(e)}getClientDimensions(){return this.div.getBoundingClientRect()}get altTextData(){return{altText:this.#S,decorative:this.#E}}set altTextData(t){let{altText:e,decorative:i}=t;(this.#S!==e||this.#E!==i)&&(this.#S=e,this.#E=i,this.#G())}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.setAttribute("tabIndex",0),this.setInForeground(),this.div.addEventListener("focusin",this.#M),this.div.addEventListener("focusout",this.#k);let[t,e]=this.parentDimensions;this.parentRotation%180!=0&&(this.div.style.maxWidth=`${(100*e/t).toFixed(2)}%`,this.div.style.maxHeight=`${(100*t/e).toFixed(2)}%`);let[i,n]=this.getInitialTranslation();return this.translate(i,n),(0,r.bindEvents)(this,this.div,["pointerdown"]),this.div}pointerdown(t){let{isMac:e}=n.FeatureTest.platform;if(0!==t.button||t.ctrlKey&&e){t.preventDefault();return}this.#R=!0,this.#W(t)}#W(t){let e,i;if(!this._isDraggable)return;let r=this._uiManager.isSelected(this);this._uiManager.setUpDragSession(),r&&(e={passive:!0,capture:!0},i=t=>{let[e,i]=this.screenToPageTranslation(t.movementX,t.movementY);this._uiManager.dragSelectedEditors(e,i)},window.addEventListener("pointermove",i,e));let s=()=>{if(window.removeEventListener("pointerup",s),window.removeEventListener("blur",s),r&&window.removeEventListener("pointermove",i,e),this.#R=!1,!this._uiManager.endDragSession()){let{isMac:e}=n.FeatureTest.platform;t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this)}};window.addEventListener("pointerup",s),window.addEventListener("blur",s)}moveInDOM(){this.parent?.moveEditorInDOM(this)}
1_setParentAndPosition(t,e,i){t.changeParent(this),this.x=e,this.y=i,this.fixAndSetPosition()}getRect(t,e){let i=this.parentScale,[r,n]=this.pageDimensions,[s,a]=this.pageTranslation,o=t/i,l=e/i,h=this.x*r,d=this.y*n,c=this.width*r,u=this.height*n;switch(this.rotation){case 0:return[h+o+s,n-d-l-u+a,h+o+c+s,n-d-l+a];case 90:return[h+l+s,n-d+o+a,h+l+u+s,n-d+o+c+a];case 180:return[h-o-c+s,n-d+l+a,h-o+s,n-d+l+u+a];case 270:return[h-l-u+s,n-d-o-c+a,h-l+s,n-d-o+a];default:throw Error("Invalid rotation")}}getRectInCurrentCoords(t,e){let[i,r,n,s]=t,a=n-i,o=s-r;switch(this.rotation){case 0:return[i,e-s,a,o];case 90:return[i,e-r,o,a];case 180:return[n,e-r,a,o];case 270:return[n,e-s,o,a];default:throw Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){this.#I=!0}disableEditMode(){this.#I=!1}isInEditMode(){return this.#I}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){this.div?.addEventListener("focusin",this.#M),this.div?.addEventListener("focusout",this.#k)}serialize(){arguments.length>0&&void 0!==arguments[0]&&arguments[0],arguments.length>1&&void 0!==arguments[1]&&arguments[1],(0,n.unreachable)("An editor must be serializable")}static deserialize(t,e,i){let r=new this.prototype.constructor({parent:e,id:e.getNextId(),uiManager:i});r.rotation=t.rotation;let[n,s]=r.pageDimensions,[a,o,l,h]=r.getRectInCurrentCoords(t.rect,s);return r.x=a/n,r.y=o/s,r.width=l/n,r.height=h/s,r}remove(){this.div.removeEventListener("focusin",this.#M),this.div.removeEventListener("focusout",this.#k),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.#x?.remove(),this.#x=null,this.#w=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#j(),this.#P.classList.remove("hidden"))}select(){this.makeResizable(),this.div?.classList.add("selectedEditor")}unselect(){this.#P?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus()}updateParams(t,e){}disableEditing(){this.#x&&(this.#x.hidden=!0)}enableEditing(){this.#x&&(this.#x.hidden=!1)}enterInEditMode(){}get contentDiv(){return this.div}get isEditing(){return this.#F}set isEditing(t){this.#F=t,this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(t,e){this.#T=!0;let i=t/e,{style:r}=this.div;r.aspectRatio=i,r.height="auto"}static get MIN_SIZE(){return 16}}e.AnnotationEditor=a;class o extends a{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.KeyboardManager=e.CommandManager=e.ColorManager=e.AnnotationEditorUIManager=void 0,e.bindEvents=s,e.opacityToHex=a,i(93),i(101),i(102),i(105),i(107),i(109),i(113),i(116),i(123),i(2),i(89),i(125),i(136),i(138),i(141),i(143),i(145),i(147),i(166);var r=i(1),n=i(168);function s(t,e,i){for(let r of i)e.addEventListener(r,t[r].bind(t))}function a(t){return Math.round(Math.min(255,Math.max(1,255*t))).toString(16).padStart(2,"0")}class o{#V=0;getId(){return`${r.AnnotationEditorPrefix}${this.#V++}`}}class l{#$=(0,r.getUuid)();#V=0;#q=null;static get _isSVGFittingCanvas(){let t='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>',e=new OffscreenCanvas(1,3).getContext("2d"),i=new Image;i.src=t;let n=i.decode().then(()=>(e.drawImage(i,0,0,1,1,0,0,1,3),0===new Uint32Array(e.getImageData(0,0,1,1).data.buffer)[0]));return(0,r.shadow)(this,"_isSVGFittingCanvas",n)}async #X(t,e){this.#q||=new Map;let i=this.#q.get(t);if(null===i)return null;if(i?.bitmap)return i.refCounter+=1,i;try{let t;if(i||={bitmap:null,id:`image_${this.#$}_${this.#V++}`,refCounter:0,isSvg:!1},"string"==typeof e){i.url=e;let r=await fetch(e);if(!r.ok)throw Error(r.statusText);t=await r.blob()}else t=i.file=e;if("image/svg+xml"===t.type){let e=l._isSVGFittingCanvas,r=new FileReader,n=new Image,s=new Promise((t,s)=>{n.onload=()=>
1{i.bitmap=n,i.isSvg=!0,t()},r.onload=async()=>{let t=i.svgUrl=r.result;n.src=await e?`${t}#svgView(preserveAspectRatio(none))`:t},n.onerror=r.onerror=s});r.readAsDataURL(t),await s}else i.bitmap=await createImageBitmap(t);i.refCounter=1}catch(t){console.error(t),i=null}return this.#q.set(t,i),i&&this.#q.set(i.id,i),i}async getFromFile(t){let{lastModified:e,name:i,size:r,type:n}=t;return this.#X(`${e}_${i}_${r}_${n}`,t)}async getFromUrl(t){return this.#X(t,t)}async getFromId(t){this.#q||=new Map;let e=this.#q.get(t);return e?e.bitmap?(e.refCounter+=1,e):e.file?this.getFromFile(e.file):this.getFromUrl(e.url):null}getSvgUrl(t){let e=this.#q.get(t);return e?.isSvg?e.svgUrl:null}deleteId(t){this.#q||=new Map;let e=this.#q.get(t);e&&(e.refCounter-=1,0===e.refCounter&&(e.bitmap=null))}isValidId(t){return t.startsWith(`image_${this.#$}_`)}}class h{#K=[];#Y=!1;#J;#Q=-1;constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:128;this.#J=t}add(t){let{cmd:e,undo:i,mustExec:r,type:n=NaN,overwriteIfSameType:s=!1,keepUndo:a=!1}=t;if(r&&e(),this.#Y)return;let o={cmd:e,undo:i,type:n};if(-1===this.#Q){this.#K.length>0&&(this.#K.length=0),this.#Q=0,this.#K.push(o);return}if(s&&this.#K[this.#Q].type===n){a&&(o.undo=this.#K[this.#Q].undo),this.#K[this.#Q]=o;return}let l=this.#Q+1;l===this.#J?this.#K.splice(0,1):(this.#Q=l,l<this.#K.length&&this.#K.splice(l)),this.#K.push(o)}undo(){-1!==this.#Q&&(this.#Y=!0,this.#K[this.#Q].undo(),this.#Y=!1,this.#Q-=1)}redo(){this.#Q<this.#K.length-1&&(this.#Q+=1,this.#Y=!0,this.#K[this.#Q].cmd(),this.#Y=!1)}hasSomethingToUndo(){return -1!==this.#Q}hasSomethingToRedo(){return this.#Q<this.#K.length-1}destroy(){this.#K=null}}e.CommandManager=h;class d{constructor(t){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;let{isMac:e}=r.FeatureTest.platform;for(let[i,r,n={}]of t)for(let t of i){let i=t.startsWith("mac+");e&&i?(this.callbacks.set(t.slice(4),{callback:r,options:n}),this.allKeys.add(t.split("+").at(-1))):e||i||(this.callbacks.set(t,{callback:r,options:n}),this.allKeys.add(t.split("+").at(-1)))}}#Z(t){t.altKey&&this.buffer.push("alt"),t.ctrlKey&&this.buffer.push("ctrl"),t.metaKey&&this.buffer.push("meta"),t.shiftKey&&this.buffer.push("shift"),this.buffer.push(t.key);let e=this.buffer.join("+");return this.buffer.length=0,e}exec(t,e){if(!this.allKeys.has(e.key))return;let i=this.callbacks.get(this.#Z(e));if(!i)return;let{callback:r,options:{bubbles:n=!1,args:s=[],checker:a=null}}=i;(!a||a(t,e))&&(r.bind(t,...s)(),n||(e.stopPropagation(),e.preventDefault()))}}e.KeyboardManager=d;class c{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){let t=new Map([["CanvasText",null],["Canvas",null]]);return(0,n.getColorValues)(t),(0,r.shadow)(this,"_colors",t)}convert(t){let e=(0,n.getRGB)(t);if(!window.matchMedia("(forced-colors: active)").matches)return e;for(let[t,i]of this._colors)if(i.every((t,i)=>t===e[i]))return c._colorsMapping.get(t);return e}getHexCode(t){let e=this._colors.get(t);return e?r.Util.makeHexColor(...e):t}}e.ColorManager=c;class u{#tt=null;#te=new Map;#ti=new Map;#tr=null;#tn=null;#ts=new h;#ta=0;#to=new Set;#tl=null;#th=null;#td=new Set;#tc=null;#tu=new o;#tp=!1;#tf=!1;#tg=null;#tm=r.AnnotationEditorType.NONE;#tb=new Set;#tv=null;#tA=this.blur.bind(this);#ty=this.focus.bind(this);#t_=this.copy.bind(this);#tS=this.cut.bind(this);#tE=this.paste.bind(this);#tx=this.keydown.bind(this);#tw=this.onEditingAction.bind(this);#tC=this.onPageChanging.bind(this);#tT=this.onScaleChanging.bind(this);#tP=this.onRotationChanging.bind(this);#tM={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1};#tk=[0,0];#tR=null;#tF=null;#tI=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){let t=u.prototype,e=t=>{let{activeElement:e}=document;return e&&t.#tF.contains(e)&&t.hasSomethingToControl()},i=this.TRANSLATE_SMALL,n=this.TRANSLATE_BIG;return(0,r.shadow)(this,"_keyboardManager",new d([[["ctrl+a","mac+meta+a"],t.selectAll],[["ctrl+z","mac+meta+z"],t.undo],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],t.delete],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-i,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-n,0],checker:e}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[i,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[n,0],checker:e}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-i],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-n],checker:e}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,i],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,n],checker:e}]]))}constructor(t,e,i,r,s,a){this.#tF=t,this.#tI=e,this.#tr=i,this._eventBus=r,this._eventBus._on("editingaction",this.#t
1w),this._eventBus._on("pagechanging",this.#tC),this._eventBus._on("scalechanging",this.#tT),this._eventBus._on("rotationchanging",this.#tP),this.#tn=s.annotationStorage,this.#tc=s.filterFactory,this.#tv=a,this.viewParameters={realScale:n.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}destroy(){for(let t of(this.#tD(),this.#tO(),this._eventBus._off("editingaction",this.#tw),this._eventBus._off("pagechanging",this.#tC),this._eventBus._off("scalechanging",this.#tT),this._eventBus._off("rotationchanging",this.#tP),this.#ti.values()))t.destroy();this.#ti.clear(),this.#te.clear(),this.#td.clear(),this.#tt=null,this.#tb.clear(),this.#ts.destroy(),this.#tr.destroy()}get hcmFilter(){return(0,r.shadow)(this,"hcmFilter",this.#tv?this.#tc.addHCMFilter(this.#tv.foreground,this.#tv.background):"none")}get direction(){return(0,r.shadow)(this,"direction",getComputedStyle(this.#tF).direction)}editAltText(t){this.#tr?.editAltText(this,t)}onPageChanging(t){let{pageNumber:e}=t;this.#ta=e-1}focusMainContainer(){this.#tF.focus()}findParent(t,e){for(let i of this.#ti.values()){let{x:r,y:n,width:s,height:a}=i.div.getBoundingClientRect();if(t>=r&&t<=r+s&&e>=n&&e<=n+a)return i}return null}disableUserSelect(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.#tI.classList.toggle("noUserSelect",t)}addShouldRescale(t){this.#td.add(t)}removeShouldRescale(t){this.#td.delete(t)}onScaleChanging(t){let{scale:e}=t;for(let t of(this.commitOrRemove(),this.viewParameters.realScale=e*n.PixelsPerInch.PDF_TO_CSS_UNITS,this.#td))t.onScaleChanging()}onRotationChanging(t){let{pagesRotation:e}=t;this.commitOrRemove(),this.viewParameters.rotation=e}addToAnnotationStorage(t){t.isEmpty()||!this.#tn||this.#tn.has(t.id)||this.#tn.setValue(t.id,t)}#tL(){window.addEventListener("focus",this.#ty),window.addEventListener("blur",this.#tA)}#tO(){window.removeEventListener("focus",this.#ty),window.removeEventListener("blur",this.#tA)}blur(){if(!this.hasSelection)return;let{activeElement:t}=document;for(let e of this.#tb)if(e.div.contains(t)){this.#tg=[e,t],e._focusEventsAllowed=!1;break}}focus(){if(!this.#tg)return;let[t,e]=this.#tg;this.#tg=null,e.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0}),e.focus()}#tN(){window.addEventListener("keydown",this.#tx,{capture:!0})}#tD(){window.removeEventListener("keydown",this.#tx,{capture:!0})}#tB(){document.addEventListener("copy",this.#t_),document.addEventListener("cut",this.#tS),document.addEventListener("paste",this.#tE)}#tU(){document.removeEventListener("copy",this.#t_),document.removeEventListener("cut",this.#tS),document.removeEventListener("paste",this.#tE)}addEditListeners(){this.#tN(),this.#tB()}removeEditListeners(){this.#tD(),this.#tU()}copy(t){if(t.preventDefault(),this.#tt?.commitOrRemove(),!this.hasSelection)return;let e=[];for(let t of this.#tb){let i=t.serialize(!0);i&&e.push(i)}0!==e.length&&t.clipboardData.setData("application/pdfjs",JSON.stringify(e))}cut(t){this.copy(t),this.delete()}paste(t){t.preventDefault();let{clipboardData:e}=t;for(let t of e.items)for(let e of this.#th)if(e.isHandlingMimeForPasting(t.type)){e.paste(t,this.currentLayer);return}let i=e.getData("application/pdfjs");if(!i)return;try{i=JSON.parse(i)}catch(t){(0,r.warn)(`paste: "${t.message}".`);return}if(!Array.isArray(i))return;this.unselectAll();let n=this.currentLayer;try{let t=[];for(let e of i){let i=n.deserialize(e);if(!i)return;t.push(i)}let e=()=>{for(let e of t)this.#tj(e);this.#tz(t)},r=()=>{for(let e of t)e.remove()};this.addCommands({cmd:e,undo:r,mustExec:!0})}catch(t){(0,r.warn)(`paste: "${t.message}".`)}}keydown(t){this.getActive()?.shouldGetKeyboardEvents()||u._keyboardManager.exec(this,t)}onEditingAction(t){["undo","redo","delete","selectAll"].includes(t.name)&&this[t.name]()}#tH(t){Object.entries(t).some(t=>{let[e,i]=t;return this.#tM[e]!==i})&&this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#tM,t)})}#tG(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})}setEditingState(t){t?(this.#tL(),this.#tN(),this.#tB(),this.#tH({isEditing:this.#tm!==r.AnnotationEditorType.NONE,isEmpty:this.#tW(),hasSomethingToUndo:this.#ts.hasSomethingToUndo(),hasSomethingToRedo:this.#ts.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#tO(),this.#tD(),this.#tU(),this.#tH({isEditing:!1}),this.disableUserSelect(!1))}
1registerEditorTypes(t){if(!this.#th)for(let e of(this.#th=t,this.#th))this.#tG(e.defaultPropertiesToUpdate)}getId(){return this.#tu.getId()}get currentLayer(){return this.#ti.get(this.#ta)}getLayer(t){return this.#ti.get(t)}get currentPageIndex(){return this.#ta}addLayer(t){this.#ti.set(t.pageIndex,t),this.#tp?t.enable():t.disable()}removeLayer(t){this.#ti.delete(t.pageIndex)}updateMode(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.#tm!==t){if(this.#tm=t,t===r.AnnotationEditorType.NONE){this.setEditingState(!1),this.#tV();return}for(let e of(this.setEditingState(!0),this.#t$(),this.unselectAll(),this.#ti.values()))e.updateMode(t);if(e){for(let t of this.#te.values())if(t.annotationElementId===e){this.setSelected(t),t.enterInEditMode();break}}}}updateToolbar(t){t!==this.#tm&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:t})}updateParams(t,e){if(this.#th){if(t===r.AnnotationEditorParamsType.CREATE){this.currentLayer.addNewEditor(t);return}for(let i of this.#tb)i.updateParams(t,e);for(let i of this.#th)i.updateDefaultParams(t,e)}}enableWaiting(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.#tf!==t)for(let e of(this.#tf=t,this.#ti.values()))t?e.disableClick():e.enableClick(),e.div.classList.toggle("waiting",t)}#t$(){if(!this.#tp)for(let t of(this.#tp=!0,this.#ti.values()))t.enable()}#tV(){if(this.unselectAll(),this.#tp)for(let t of(this.#tp=!1,this.#ti.values()))t.disable()}getEditors(t){let e=[];for(let i of this.#te.values())i.pageIndex===t&&e.push(i);return e}getEditor(t){return this.#te.get(t)}addEditor(t){this.#te.set(t.id,t)}removeEditor(t){this.#te.delete(t.id),this.unselect(t),t.annotationElementId&&this.#to.has(t.annotationElementId)||this.#tn?.remove(t.id)}addDeletedAnnotationElement(t){this.#to.add(t.annotationElementId),t.deleted=!0}isDeletedAnnotationElement(t){return this.#to.has(t)}removeDeletedAnnotationElement(t){this.#to.delete(t.annotationElementId),t.deleted=!1}#tj(t){let e=this.#ti.get(t.pageIndex);e?e.addOrRebuild(t):this.addEditor(t)}setActiveEditor(t){this.#tt!==t&&(this.#tt=t,t&&this.#tG(t.propertiesToUpdate))}toggleSelected(t){if(this.#tb.has(t)){this.#tb.delete(t),t.unselect(),this.#tH({hasSelectedEditor:this.hasSelection});return}this.#tb.add(t),t.select(),this.#tG(t.propertiesToUpdate),this.#tH({hasSelectedEditor:!0})}setSelected(t){for(let e of this.#tb)e!==t&&e.unselect();this.#tb.clear(),this.#tb.add(t),t.select(),this.#tG(t.propertiesToUpdate),this.#tH({hasSelectedEditor:!0})}isSelected(t){return this.#tb.has(t)}unselect(t){t.unselect(),this.#tb.delete(t),this.#tH({hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==this.#tb.size}undo(){this.#ts.undo(),this.#tH({hasSomethingToUndo:this.#ts.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#tW()})}redo(){this.#ts.redo(),this.#tH({hasSomethingToUndo:!0,hasSomethingToRedo:this.#ts.hasSomethingToRedo(),isEmpty:this.#tW()})}addCommands(t){this.#ts.add(t),this.#tH({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#tW()})}#tW(){if(0===this.#te.size)return!0;if(1===this.#te.size)for(let t of this.#te.values())return t.isEmpty();return!1}delete(){if(this.commitOrRemove(),!this.hasSelection)return;let t=[...this.#tb],e=()=>{for(let e of t)e.remove()},i=()=>{for(let e of t)this.#tj(e)};this.addCommands({cmd:e,undo:i,mustExec:!0})}commitOrRemove(){this.#tt?.commitOrRemove()}hasSomethingToControl(){return this.#tt||this.hasSelection}#tz(t){for(let e of(this.#tb.clear(),t))e.isEmpty()||(this.#tb.add(e),e.select());this.#tH({hasSelectedEditor:!0})}selectAll(){for(let t of this.#tb)t.commit();this.#tz(this.#te.values())}unselectAll(){if(this.#tt){this.#tt.commitOrRemove();return}if(this.hasSelection){for(let t of this.#tb)t.unselect();this.#tb.clear(),this.#tH({hasSelectedEditor:!1})}}translateSelectedEditors(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(i||this.commitOrRemove(),!this.hasSelection)return;this.#tk[0]+=t,this.#tk[1]+=e;let[r,n]=this.#tk,s=[...this.#tb],a=1e3;for(let i of(this.#tR&&clearTimeout(this.#tR),this.#tR=setTimeout(()=>{this.#tR=null,this.#tk[0]=this.#tk[1]=0,this.addCommands({cmd:()=>{for(let t of s)this.#te.has(t.id)&&t.translateInPage(r,n)},undo:()=>{for(let t of s)this.#te.has(t.id)&&t.translateInPage(-r,-n)},mustExec:!1})},a),s))i.translateInPage(t,e)}setUpDragSession(){if(this.hasSelection)for(let t of(this.disableUserSelect(!0),this.#tl=new Map,this.#tb))this.#tl.set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}endDragSession(){if(!this.#tl)return!1;this.disableUserSelect(!1);let t=this.#tl;this.#tl=null;let e=!1;for(let[{x:i,y:r,pageIndex:n},s]of t)s.newX=i,s.newY=r,s.newPageIndex=n,e||=i!==s.savedX||r!==s.savedY||n!==s.savedPageIndex;if(!e)return!1;let i=(t,e,i,r)=>{if(this.#te.has(t.id)){let n=this.#ti.get(r);n?t._setParentAndPosition(n,e,i):(t.pageIndex=r,t.x=e,t.y=i)}};return this.addCommands({cmd:()=>{for(let[e,{newX:r,newY:n,newPageIndex:s}]of t)i(e,r,n,s)},undo:()=>{for(let[e,{savedX:r,savedY:n,savedPageIndex:s}]of t)i(e,r,n,s)},mustExec:!0}),!0}dragSelectedEditors(t,e){if(this.#tl)for(let i of this.#tl.keys())i.drag(t,e)}rebuild(t){if(null===t.parent){let e=this.getLayer(t.pageIndex);e?(e.changeParent(t),e.addOrRebuild(t)):(this.addEditor(t),this.addToAnnotationStorage(t),t.rebuild())}else t.parent.addOrRebuild(t)}isActive(t){return this.#tt===t}getActive(){return this.#tt}getMode(){return this.#tm}get imageManager(){return(0,r.shadow)(this,"imageManager",new l)}}e.AnnotationEditorUIManager=u},(t,e,i)=>
1{var r=i(3),n=i(6),s=i(4),a=i(24),o=i(14),l=i(8),h=i(21),d=i(20),c=i(91),u=i(39),p=i(77),f=i(64),g=i(159),m=i(7),b=i(167),v=i(27),A=s.JSON,y=s.Number,_=s.SyntaxError,S=A&&A.parse,E=a("Object","keys"),x=Object.getOwnPropertyDescriptor,w=o("".charAt),C=o("".slice),T=o(/./.exec),P=o([].push),M=/^\d$/,k=/^[1-9]$/,R=/^(?:-|\d)$/,F=/^[\t\n\r ]$/,I=0,D=1,O=function(t,e){var i=new U(t=p(t),0,""),r=i.parse(),n=r.value,s=i.skip(F,r.end);if(s<t.length)throw _('Unexpected extra character: "'+w(t,s)+'" after the parsed data at: '+s);return h(e)?L({"":n},"",e,r):n},L=function(t,e,i,r){var n,s,a,o,h,p=t[e],g=r&&p===r.value,m=g&&"string"==typeof r.source?{source:r.source}:{};if(d(p)){var b=c(p),v=g?r.nodes:b?[]:{};if(b)for(o=0,n=v.length,a=f(p);o<a;o++)N(p,o,L(p,""+o,i,o<n?v[o]:void 0));else for(o=0,a=f(s=E(p));o<a;o++)N(p,h=s[o],L(p,h,i,u(v,h)?v[h]:void 0))}return l(i,t,e,p,m)},N=function(t,e,i){if(n){var r=x(t,e);if(r&&!r.configurable)return}void 0===i?delete t[e]:g(t,e,i)},B=function(t,e,i,r){this.value=t,this.end=e,this.source=i,this.nodes=r},U=function(t,e){this.source=t,this.index=e};U.prototype={fork:function(t){return new U(this.source,t)},parse:function(){var t=this.source,e=this.skip(F,this.index),i=this.fork(e),r=w(t,e);if(T(R,r))return i.number();switch(r){case"{":return i.object();case"[":return i.array();case'"':return i.string();case"t":return i.keyword(!0);case"f":return i.keyword(!1);case"n":return i.keyword(null)}throw _('Unexpected character: "'+r+'" at: '+e)},node:function(t,e,i,r,n){return new B(e,r,t?null:C(this.source,i,r),n)},object:function(){for(var t=this.source,e=this.index+1,i=!1,r={},n={};e<t.length;){if("}"===w(t,e=this.until(['"',"}"],e))&&!i){e++;break}var s=this.fork(e).string(),a=s.value;e=s.end,e=this.until([":"],e)+1,e=this.skip(F,e),g(n,a,s=this.fork(e).parse()),g(r,a,s.value);var o=w(t,e=this.until([",","}"],s.end));if(","===o)i=!0,e++;else if("}"===o){e++;break}}return this.node(D,r,this.index,e,n)},array:function(){for(var t=this.source,e=this.index+1,i=!1,r=[],n=[];e<t.length;){if("]"===w(t,e=this.skip(F,e))&&!i){e++;break}var s=this.fork(e).parse();if(P(n,s),P(r,s.value),","===w(t,e=this.until([",","]"],s.end)))i=!0,e++;else if("]"===w(t,e)){e++;break}}return this.node(D,r,this.index,e,n)},string:function(){var t=this.index,e=b(this.source,this.index+1);return this.node(I,e.value,t,e.end)},number:function(){var t=this.source,e=this.index,i=e;if("-"===w(t,i)&&i++,"0"===w(t,i))i++;else if(T(k,w(t,i)))i=this.skip(M,++i);else throw _("Failed to parse number at: "+i);if("."===w(t,i)&&(i=this.skip(M,++i)),("e"===w(t,i)||"E"===w(t,i))&&(("+"===w(t,++i)||"-"===w(t,i))&&i++,i===(i=this.skip(M,i))))throw _("Failed to parse number's exponent value at: "+i);return this.node(I,y(C(t,e,i)),e,i)},keyword:function(t){var e=""+t,i=this.index,r=i+e.length;if(C(this.source,i,r)!==e)throw _("Failed to parse value at: "+i);return this.node(I,t,i,r)},skip:function(t,e){for(var i=this.source;e<i.length&&T(t,w(i,e));e++);return e},until:function(t,e){e=this.skip(F,e);for(var i=w(this.source,e),r=0;r<t.length;r++)if(t[r]===i)return e;throw _('Unexpected character: "'+i+'" at: '+e)}};var j=m(function(){var t,e="9007199254740993";return S(e,function(e,i,r){t=r.source}),t!==e}),z=v&&!m(function(){return 1/S("-0 	")!=-1/0});r({target:"JSON",stat:!0,forced:j},{parse:function(t,e){return z&&!h(e)?S(t):O(t,e)}})},(t,e,i)=>{var r=i(14),n=i(39),s=SyntaxError,a=parseInt,o=String.fromCharCode,l=r("".charAt),h=r("".slice),d=r(/./.exec),c={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":"\n","\\r":"\r","\\t":"	"},u=/^[\da-f]{4}$/i,p=/^[\u0000-\u001F]$/;t.exports=function(t,e){for(var i=!0,r="";e<t.length;){var f=l(t,e);if("\\"===f){var g=h(t,e,e+2);if(n(c,g))r+=c[g],e+=2;else if("\\u"===g){var m=h(t,e+=2,e+4);if(!d(u,m))throw s("Bad Unicode escape at: "+e);r+=o(a(m,16)),e+=4}else throw s('Unknown escape sequence: "'+g+'"')}else if('"'===f){i=!1,e++;break}else{if(d(p,f))throw s("Bad control character in string literal at: "+e);r+=f,e++}}if(i)throw s("Unterminated string at: "+e);return{value:r,end:e}}},(t,e,i)=>{let r;
1Object.defineProperty(e,"__esModule",{value:!0}),e.StatTimer=e.RenderingCancelledException=e.PixelsPerInch=e.PageViewport=e.PDFDateString=e.DOMStandardFontDataFactory=e.DOMSVGFactory=e.DOMFilterFactory=e.DOMCanvasFactory=e.DOMCMapReaderFactory=void 0,e.deprecated=x,e.getColorValues=P,e.getCurrentTransform=M,e.getCurrentTransformInverse=k,e.getFilenameFromUrl=v,e.getPdfFilenameFromUrl=A,e.getRGB=T,e.getXfaPageViewport=C,e.isDataScheme=m,e.isPdfFile=b,e.isValidFetchUrl=_,e.loadScript=E,e.noContextMenu=S,e.setLayerDimensions=R,i(2),i(93),i(101),i(102),i(105),i(107),i(109),i(113),i(116),i(123),i(89),i(84),i(86),i(87);var n=i(169),s=i(1);let a="http://www.w3.org/2000/svg";class o{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}e.PixelsPerInch=o;class l extends n.BaseFilterFactory{#tq;#tX;#e;#tK;#tY;#tJ;#tQ;#tZ;#t0;#t1;#V=0;constructor(){let{docId:t,ownerDocument:e=globalThis.document}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),this.#e=t,this.#tK=e}get #q(){return this.#tq||=new Map}get #t2(){if(!this.#tX){let t=this.#tK.createElement("div"),{style:e}=t;e.visibility="hidden",e.contain="strict",e.width=e.height=0,e.position="absolute",e.top=e.left=0,e.zIndex=-1;let i=this.#tK.createElementNS(a,"svg");i.setAttribute("width",0),i.setAttribute("height",0),this.#tX=this.#tK.createElementNS(a,"defs"),t.append(i),i.append(this.#tX),this.#tK.body.append(t)}return this.#tX}addFilter(t){let e,i,r,n;if(!t)return"none";let s=this.#q.get(t);if(s)return s;if(1===t.length){let s=t[0],a=Array(256);for(let t=0;t<256;t++)a[t]=s[t]/255;n=e=i=r=a.join(",")}else{let[s,a,o]=t,l=Array(256),h=Array(256),d=Array(256);for(let t=0;t<256;t++)l[t]=s[t]/255,h[t]=a[t]/255,d[t]=o[t]/255;e=l.join(","),i=h.join(","),r=d.join(","),n=`${e}${i}${r}`}if(s=this.#q.get(n))return this.#q.set(t,s),s;let a=`g_${this.#e}_transfer_map_${this.#V++}`,o=`url(#${a})`;this.#q.set(t,o),this.#q.set(n,o);let l=this.#t3(a);return this.#t4(e,i,r,l),o}addHCMFilter(t,e){let i=`${t}-${e}`;if(this.#tJ===i||(this.#tJ=i,this.#tQ="none",this.#tY?.remove(),!t||!e))return this.#tQ;let r=this.#t5(t);t=s.Util.makeHexColor(...r);let n=this.#t5(e);if(e=s.Util.makeHexColor(...n),this.#t2.style.color="","#000000"===t&&"#ffffff"===e||t===e)return this.#tQ;let a=Array(256);for(let t=0;t<=255;t++){let e=t/255;a[t]=e<=.03928?e/12.92:((e+.055)/1.055)**2.4}let o=a.join(","),l=`g_${this.#e}_hcm_filter`,h=this.#tZ=this.#t3(l);this.#t4(o,o,o,h),this.#t8(h);let d=(t,e)=>{let i=r[t]/255,s=n[t]/255,a=Array(e+1);for(let t=0;t<=e;t++)a[t]=i+t/e*(s-i);return a.join(",")};return this.#t4(d(0,5),d(1,5),d(2,5),h),this.#tQ=`url(#${l})`,this.#tQ}addHighlightHCMFilter(t,e,i,r){let n=`${t}-${e}-${i}-${r}`;if(this.#t0===n||(this.#t0=n,this.#t1="none",this.#tZ?.remove(),!t||!e))return this.#t1;let[s,a]=[t,e].map(this.#t5.bind(this)),o=Math.round(.2126*s[0]+.7152*s[1]+.0722*s[2]),l=Math.round(.2126*a[0]+.7152*a[1]+.0722*a[2]),[h,d]=[i,r].map(this.#t5.bind(this));l<o&&([o,l,h,d]=[l,o,d,h]),this.#t2.style.color="";let c=(t,e,i)=>{let r=Array(256),n=(l-o)/i,s=t/255,a=(e-t)/(255*i),h=0;for(let t=0;t<=i;t++){let e=Math.round(o+t*n),i=s+t*a;for(let t=h;t<=e;t++)r[t]=i;h=e+1}for(let t=h;t<256;t++)r[t]=r[h-1];return r.join(",")},u=`g_${this.#e}_hcm_highlight_filter`,p=this.#tZ=this.#t3(u);return this.#t8(p),this.#t4(c(h[0],d[0],5),c(h[1],d[1],5),c(h[2],d[2],5),p),this.#t1=`url(#${u})`,this.#t1}destroy(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];t&&(this.#tQ||this.#t1)||(this.#tX&&(this.#tX.parentNode.parentNode.remove(),this.#tX=null),this.#tq&&(this.#tq.clear(),this.#tq=null),this.#V=0)}#t8(t){let e=this.#tK.createElementNS(a,"feColorMatrix");e.setAttribute("type","matrix"),e.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),t.append(e)}#t3(t){let e=this.#tK.createElementNS(a,"filter");return e.setAttribute("color-interpolation-filters","sRGB"),e.setAttribute("id",t),this.#t2.append(e),e}#t6(t,e,i){let r=this.#tK.createElementNS(a,e);r.setAttribute("type","discrete"),r.setAttribute("tableValues",i),t.append(r)}#t4(t,e,i,r){let n=this.#tK.createElementNS(a,"feComponentTransfer");r.append(n),this.#t6(n,"feFuncR",t),this.#t6(n,"feFuncG",e),this.#t6(n,"feFuncB",i)}#t5(t){return this.#t2.style.color=t,T(getComputedStyle(this.#t2).getPropertyValue("color"))}}e.DOMFilterFactory=l;class h 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 i=this._document.createElement("canvas");return i.width=t,i.height=e,i}}async function d(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(_(t,document.baseURI)){let i=await fetch(t);if(!i.ok)throw Error(i.statusText);return e?new Uint8Array(await i.arrayBuffer()):(0,s.stringToBytes)(await i.text())}return new Promise((i,r)=>{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){i(t);return}}r(Error(n.statusText))}},n.send(null)})}e.DOMCanvasFactory=h;class c extends n.BaseCMapReaderFactory{_fetchData(t,e){return d(t,this.isCompressed).then(t=>({cMapData:t,compressionType:e}))}}e.DOMCMapReaderFactory=c;class u extends n.BaseStandardFontDataFactory{_fetchData(t){return d(t,!0)}}e.DOMStandardFontDataFactory=u;class p extends n.BaseSVGFactory{_createSVG(t){return document.createElementNS(a,t)}}e.DOMSVGFactory=p;
1class f{constructor(t){let e,i,r,n,s,a,o,l,{viewBox:h,scale:d,rotation:c,offsetX:u=0,offsetY:p=0,dontFlip:f=!1}=t;this.viewBox=h,this.scale=d,this.rotation=c,this.offsetX=u,this.offsetY=p;let g=(h[2]+h[0])/2,m=(h[3]+h[1])/2;switch((c%=360)<0&&(c+=360),c){case 180:e=-1,i=0,r=0,n=1;break;case 90:e=0,i=1,r=1,n=0;break;case 270:e=0,i=-1,r=-1,n=0;break;case 0:e=1,i=0,r=0,n=-1;break;default:throw Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}f&&(r=-r,n=-n),0===e?(s=Math.abs(m-h[1])*d+u,a=Math.abs(g-h[0])*d+p,o=(h[3]-h[1])*d,l=(h[2]-h[0])*d):(s=Math.abs(g-h[0])*d+u,a=Math.abs(m-h[1])*d+p,o=(h[2]-h[0])*d,l=(h[3]-h[1])*d),this.transform=[e*d,i*d,r*d,n*d,s-e*d*g-r*d*m,a-i*d*g-n*d*m],this.width=o,this.height=l}get rawDims(){let{viewBox:t}=this;return(0,s.shadow)(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone(){let{scale:t=this.scale,rotation:e=this.rotation,offsetX:i=this.offsetX,offsetY:r=this.offsetY,dontFlip:n=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new f({viewBox:this.viewBox.slice(),scale:t,rotation:e,offsetX:i,offsetY:r,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),i=s.Util.applyTransform([t[2],t[3]],this.transform);return[e[0],e[1],i[0],i[1]]}convertToPdfPoint(t,e){return s.Util.applyInverseTransform([t,e],this.transform)}}e.PageViewport=f;class g extends s.BaseException{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;super(t,"RenderingCancelledException"),this.extraDelay=e}}function m(t){let e=t.length,i=0;for(;i<e&&""===t[i].trim();)i++;return"data:"===t.substring(i,i+5).toLowerCase()}function b(t){return"string"==typeof t&&/\.pdf$/i.test(t)}function v(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e||([t]=t.split(/[#?]/,1)),t.substring(t.lastIndexOf("/")+1)}function A(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"document.pdf";if("string"!=typeof t)return e;if(m(t))return(0,s.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;let i=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,r=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(t),n=i.exec(r[1])||i.exec(r[2])||i.exec(r[3]);if(n&&(n=n[0]).includes("%"))try{n=i.exec(decodeURIComponent(n))[0]}catch{}return n||e}e.RenderingCancelledException=g;class y{started=Object.create(null);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{name:t}of this.times)e=Math.max(t.length,e);for(let{name:i,start:r,end:n}of this.times)t.push(`${i.padEnd(e)} ${n-r}ms
2`);return t.join("")}}function _(t,e){try{let{protocol:i}=e?new URL(t,e):new URL(t);return"http:"===i||"https:"===i}catch{return!1}}function S(t){t.preventDefault()}function E(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return new Promise((i,r)=>{let n=document.createElement("script");n.src=t,n.onload=function(t){e&&n.remove(),i(t)},n.onerror=function(){r(Error(`Cannot load script at: ${n.src}`))},(document.head||document.documentElement).append(n)})}function x(t){console.log("Deprecated API usage: "+t)}e.StatTimer=y;class w{static toDateObject(t){if(!t||"string"!=typeof t)return null;let e=(r||=RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?")).exec(t);if(!e)return null;let i=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",d=parseInt(e[8],10);d=d>=0&&d<=23?d:0;let c=parseInt(e[9],10)||0;return c=c>=0&&c<=59?c:0,"-"===h?(a+=d,o+=c):"+"===h&&(a-=d,o-=c),new Date(Date.UTC(i,n,s,a,o,l))}}function C(t,e){let{scale:i=1,rotation:r=0}=e,{width:n,height:s}=t.attributes.style;return new f({viewBox:[0,0,parseInt(n),parseInt(s)],scale:i,rotation:r})}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 P(t){let e=document.createElement("span");for(let i of(e.style.visibility="hidden",document.body.append(e),t.keys())){e.style.color=i;let r=window.getComputedStyle(e).color;t.set(i,T(r))}e.remove()}function M(t){let{a:e,b:i,c:r,d:n,e:s,f:a}=t.getTransform();return[e,i,r,n,s,a]}function k(t){let{a:e,b:i,c:r,d:n,e:s,f:a}=t.getTransform().invertSelf();return[e,i,r,n,s,a]}function R(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=!(arguments.length>3)||void 0===arguments[3]||arguments[3];if(e instanceof f){let{pageWidth:r,pageHeight:n}=e.rawDims,{style:a}=t,o=s.FeatureTest.isCSSRoundSupported,l=`var(--scale-factor) * ${r}px`,h=`var(--scale-factor) * ${n}px`,d=o?`round(${l}, 1px)`:`calc(${l})`,c=o?`round(${h}, 1px)`:`calc(${h})`;i&&e.rotation%180!=0?(a.width=c,a.height=d):(a.width=d,a.height=c)}r&&t.setAttribute("data-main-rotation",e.rotation)}e.PDFDateString=w},(t,e,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.BaseStandardFontDataFactory=e.BaseSVGFactory=e.BaseFilterFactory=e.BaseCanvasFactory=e.BaseCMapReaderFactory=void 0,i(2);var r=i(1);class n{constructor(){this.constructor===n&&(0,r.unreachable)("Cannot initialize BaseFilterFactory.")}addFilter(t){return"none"}addHCMFilter(t,e){return"none"}addHighlightHCMFilter(t,e,i,r){return"none"}destroy(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]}}e.BaseFilterFactory=n;class s{constructor(){this.constructor===s&&(0,r.unreachable)("Cannot initialize BaseCanvasFactory.")}create(t,e){if(t<=0||e<=0)throw Error("Invalid canvas size");let i=this._createCanvas(t,e);return{canvas:i,context:i.getContext("2d")}}reset(t,e,i){if(!t.canvas)throw Error("Canvas is not specified");if(e<=0||i<=0)throw Error("Invalid canvas size");t.canvas.width=e,t.canvas.height=i}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,r.unreachable)("Abstract method `_createCanvas` called.")}}e.BaseCanvasFactory=s;class a{constructor(t){let{baseUrl:e=null,isCompressed:i=!0}=t;this.constructor===a&&(0,r.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=e,this.isCompressed=i}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 i=this.baseUrl+e+(this.isCompressed?".bcmap":""),n=this.isCompressed?r.CMapCompressionType.BINARY:r.CMapCompressionType.NONE;return this._fetchData(i,n).catch(t=>{throw Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${i}`)})}_fetchData(t,e){(0,r.unreachable)("Abstract method `_fetchData` called.")}}e.BaseCMapReaderFactory=a;class o{constructor(t){let{baseUrl:e=null}=t;this.constructor===o&&(0,r.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 i=`${this.baseUrl}${e}`;return this._fetchData(i).catch(t=>{throw Error(`Unable to load font data at: ${i}`)})}_fetchData(t){(0,r.unreachable)("Abstract method `_fetchData` called.")}}e.BaseStandardFontDataFactory=o;class l{constructor(){this.constructor===l&&(0,r.unreachable)("Cannot initialize BaseSVGFactory.")}create(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t<=0||e<=0)throw Error("Invalid SVG dimensions");let r=this._createSVG("svg:svg");return r.setAttribute("version","1.1"),i||(r.setAttribute("width",`${t}px`),r.setAttribute("height",`${e}px`)),r.setAttribute("preserveAspectRatio","none"),r.setAttribute("viewBox",`0 0 ${t} ${e}`),r}createElement(t){if("string"!=typeof t)throw Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){(0,r.unreachable)("Abstract method `_createSVG` called.")}}e.BaseSVGFactory=l},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MurmurHash3_64=void 0,i(93),i(101),i(102),i(105),i(107),i(109),i(113),i(116),i(123),i(2);var r=i(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,i;if("string"==typeof t){e=new Uint8Array(2*t.length),i=0;for(let r=0,n=t.length;r<n;r++){let n=t.charCodeAt(r);n<=255?e[i++]=n:(e[i++]=n>>>8,e[i++]=255&n)}}else if((0,r.isArrayBuffer)(t))i=(e=t.slice()).byteLength;else throw Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");let n=i>>2,o=i-4*n,l=new Uint32Array(e.buffer,0,n),h=0,d=0,c=this.h1,u=this.h2,p=3432918353,f=461845907,g=3432918353&a,m=461845907&a;for(let t=0;t<n;t++)1&t?(c^=h=(h=(h=(h=l[t])*p&s|h*g&a)<<15|h>>>17)*f&s|h*m&a,c=5*(c=c<<13|c>>>19)+3864292196):(u^=d=(d=(d=(d=l[t])*p&s|d*g&a)<<15|d>>>17)*f&s|d*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?c^=h:u^=h}this.h1=c,this.h2=u}hexdigest(){let t=this.h1,e=this.h2;return 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,((t^=e>>>1)>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}}e.MurmurHash3_64=o},(t,e,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.FontLoader=e.FontFaceObject=void 0,i(125),i(136),i(138),i(141),i(143),i(145),i(147),i(89),i(149);var r=i(1);class n{#t7=new Set;constructor(t){let{ownerDocument:e=globalThis.document,styleElement:i=null}=t;this._document=e,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(t){this.nativeFontFaces.add(t),this._document.fonts.add(t)}removeNativeFontFace(t){this.nativeFontFaces.delete(t),this._document.fonts.delete(t)}insertRule(t){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));let e=this.styleElement.sheet;e.insertRule(t,e.cssRules.length)}clear(){for(let t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.clear(),this.#t7.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont(t){if(!(!t||this.#t7.has(t.loadedName))){if((0,r.assert)(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){let{loadedName:e,src:i,style:n}=t,s=new FontFace(e,i,n);this.addNativeFontFace(s);try{await s.load(),this.#t7.add(e)}catch{(0,r.warn)(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(s)}return}(0,r.unreachable)("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(t){if(t.attached||t.missingFile&&!t.systemFontInfo)return;if(t.attached=!0,t.systemFontInfo){await this.loadSystemFont(t.systemFontInfo);return}if(this.isFontLoadingAPISupported){let e=t.createNativeFontFace();if(e){this.addNativeFontFace(e);try{await e.loaded}catch(i){throw(0,r.warn)(`Failed to load font '${e.family}': '${i}'.`),t.disableFontFace=!0,i}}return}let e=t.createFontFaceRule();if(e){if(this.insertRule(e),this.isSyncFontLoadingSupported)return;await new Promise(e=>{let i=this._queueLoadingCallback(e);this._prepareFontLoadEvent(t,i)})}}get isFontLoadingAPISupported(){let t=!!this._document?.fonts;return(0,r.shadow)(this,"isFontLoadingAPISupported",t)}get isSyncFontLoadingSupported(){let t=!1;return r.isNodeJS?t=!0:"undefined"!=typeof navigator&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent)&&(t=!0),(0,r.shadow)(this,"isSyncFontLoadingSupported",t)}_queueLoadingCallback(t){let{loadingRequests:e}=this,i={done:!1,complete:function(){for((0,r.assert)(!i.done,"completeRequest() cannot be called twice."),i.done=!0;e.length>0&&e[0].done;)setTimeout(e.shift().callback,0)},callback:t};return e.push(i),i}get _loadTestFont(){let t=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,r.shadow)(this,"_loadTestFont",t)}_prepareFontLoadEvent(t,e){let i,n;function s(t,e){return t.charCodeAt(e)<<24|t.charCodeAt(e+1)<<16|t.charCodeAt(e+2)<<8|255&t.charCodeAt(e+3)}function a(t,e,i,r){return t.substring(0,e)+r+t.substring(e+i)}let o=this._document.createElement("canvas");o.width=1,o.height=1;let l=o.getContext("2d"),h=0;function d(t,e){if(++h>30){(0,r.warn)("Load test font never loaded."),e();return}if(l.font="30px "+t,l.fillText(".",0,20),l.getImageData(0,0,1,1).data[3]>0){e();return}setTimeout(d.bind(null,t,e))}let c=`lt${Date.now()}${this.loadTestFontId++}`,u=this._loadTestFont;
2u=a(u,976,c.length,c);let p=16,f=1482184792,g=s(u,16);for(i=0,n=c.length-3;i<n;i+=4)g=g-f+s(c,i)|0;i<c.length&&(g=g-f+s(c+"XXX",i)|0),u=a(u,p,4,(0,r.string32)(g));let m=`url(data:font/opentype;base64,${btoa(u)});`,b=`@font-face {font-family:"${c}";src:${m}}`;this.insertRule(b);let v=this._document.createElement("div");for(let e of(v.style.visibility="hidden",v.style.width=v.style.height="10px",v.style.position="absolute",v.style.top=v.style.left="0px",[t.loadedName,c])){let t=this._document.createElement("span");t.textContent="Hi",t.style.fontFamily=e,v.append(t)}this._document.body.append(v),d(c,()=>{v.remove(),e.complete()})}}e.FontLoader=n;class s{constructor(t,e){let{isEvalSupported:i=!0,disableFontFace:r=!1,ignoreErrors:n=!1,inspectFont:s=null}=e;for(let e in this.compiledGlyphs=Object.create(null),t)this[e]=t[e];this.isEvalSupported=!1!==i,this.disableFontFace=!0===r,this.ignoreErrors=!0===n,this._inspectFont=s}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._inspectFont?.(this),t}createFontFaceRule(){let t;if(!this.data||this.disableFontFace)return null;let e=(0,r.bytesToString)(this.data),i=`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:${i}}`}else t=`@font-face {font-family:"${this.loadedName}";src:${i}}`;return this._inspectFont?.(this,i),t}getPathGenerator(t,e){let i;if(void 0!==this.compiledGlyphs[e])return this.compiledGlyphs[e];try{i=t.get(this.loadedName+"_path_"+e)}catch(t){if(!this.ignoreErrors)throw t;return(0,r.warn)(`getPathGenerator - ignoring character: "${t}".`),this.compiledGlyphs[e]=function(t,e){}}if(this.isEvalSupported&&r.FeatureTest.isEvalSupported){let t=[];for(let e of i){let i=void 0!==e.args?e.args.join(","):"";t.push("c.",e.cmd,"(",i,");\n")}return this.compiledGlyphs[e]=Function("c","size",t.join(""))}return this.compiledGlyphs[e]=function(t,e){for(let r of i)"scale"===r.cmd&&(r.args=[e,-e]),t[r.cmd].apply(t,r.args)}}}e.FontFaceObject=s},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.NodeStandardFontDataFactory=e.NodeFilterFactory=e.NodeCanvasFactory=e.NodeCMapReaderFactory=void 0,i(2),i(93),i(101),i(102),i(105),i(107),i(109),i(113),i(116),i(123);var r=i(169),n=i(1);!function(){if(!globalThis.DOMMatrix&&n.isNodeJS)try{globalThis.DOMMatrix=__webpack_require__(13355).DOMMatrix}catch(t){(0,n.warn)(`Cannot polyfill \`DOMMatrix\`, rendering may be broken: "${t}".`)}}(),function(){if(!globalThis.Path2D&&n.isNodeJS)try{let{CanvasRenderingContext2D:t}=__webpack_require__(13355),{polyfillPath2D:e}=__webpack_require__(42561);globalThis.CanvasRenderingContext2D=t,e(globalThis)}catch(t){(0,n.warn)(`Cannot polyfill \`Path2D\`, rendering may be broken: "${t}".`)}}();let s=function(t){return new Promise((e,i)=>{__webpack_require__(59462).readFile(t,(t,r)=>{if(t||!r){i(Error(t));return}e(new Uint8Array(r))})})};class a extends r.BaseFilterFactory{}e.NodeFilterFactory=a;class o extends r.BaseCanvasFactory{_createCanvas(t,e){return __webpack_require__(13355).createCanvas(t,e)}}e.NodeCanvasFactory=o;class l extends r.BaseCMapReaderFactory{_fetchData(t,e){return s(t).then(t=>({cMapData:t,compressionType:e}))}}e.NodeCMapReaderFactory=l;class h extends r.BaseStandardFontDataFactory{_fetchData(t){return s(t)}}e.NodeStandardFontDataFactory=h},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CanvasGraphics=void 0,i(2),i(93),i(101),i(102),i(105),i(107),i(109),i(113),i(116),i(123),i(89);var r=i(1),n=i(168),s=i(174),a=i(175);let o=16,l=100,h=4096,d=15,c=10,u=1e3,p=16;function f(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()}
2,t.restore=function(){e.restore(),this.__originalRestore()},t.translate=function(t,i){e.translate(t,i),this.__originalTranslate(t,i)},t.scale=function(t,i){e.scale(t,i),this.__originalScale(t,i)},t.transform=function(t,i,r,n,s,a){e.transform(t,i,r,n,s,a),this.__originalTransform(t,i,r,n,s,a)},t.setTransform=function(t,i,r,n,s,a){e.setTransform(t,i,r,n,s,a),this.__originalSetTransform(t,i,r,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,i){e.moveTo(t,i),this.__originalMoveTo(t,i)},t.lineTo=function(t,i){e.lineTo(t,i),this.__originalLineTo(t,i)},t.bezierCurveTo=function(t,i,r,n,s,a){e.bezierCurveTo(t,i,r,n,s,a),this.__originalBezierCurveTo(t,i,r,n,s,a)},t.rect=function(t,i,r,n){e.rect(t,i,r,n),this.__originalRect(t,i,r,n)},t.closePath=function(){e.closePath(),this.__originalClosePath()},t.beginPath=function(){e.beginPath(),this.__originalBeginPath()}}class g{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,e,i){let r;return void 0!==this.cache[t]?(r=this.cache[t],this.canvasFactory.reset(r,e,i)):(r=this.canvasFactory.create(e,i),this.cache[t]=r),r}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 m(t,e,i,r,s,a,o,l,h,d){let[c,u,p,f,g,m]=(0,n.getCurrentTransform)(t);if(0===u&&0===p){let n=Math.round(o*c+g),b=Math.round(l*f+m),v=Math.abs(Math.round((o+h)*c+g)-n)||1,A=Math.abs(Math.round((l+d)*f+m)-b)||1;return t.setTransform(Math.sign(c),0,0,Math.sign(f),n,b),t.drawImage(e,i,r,s,a,0,0,v,A),t.setTransform(c,u,p,f,g,m),[v,A]}if(0===c&&0===f){let n=Math.round(l*p+g),b=Math.round(o*u+m),v=Math.abs(Math.round((l+d)*p+g)-n)||1,A=Math.abs(Math.round((o+h)*u+m)-b)||1;return t.setTransform(0,Math.sign(u),Math.sign(p),0,n,b),t.drawImage(e,i,r,s,a,0,0,A,v),t.setTransform(c,u,p,f,g,m),[A,v]}return t.drawImage(e,i,r,s,a,o,l,h,d),[Math.hypot(c,u)*h,Math.hypot(p,f)*d]}function b(t){let e,i,r;let{width:n,height:s}=t;if(n>u||s>u)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)),d=n+7&-8,c=new Uint8Array(d*s),p=0;for(let e of t.data){let t=128;for(;t>0;)c[p++]=e&t?0:255,t>>=1}let f=0;for(0!==c[p=0]&&(h[0]=1,++f),i=1;i<n;i++)c[p]!==c[p+1]&&(h[i]=c[p]?2:1,++f),p++;for(0!==c[p]&&(h[i]=2,++f),e=1;e<s;e++){p=e*d,r=e*l,c[p-d]!==c[p]&&(h[r]=c[p]?1:8,++f);let t=(c[p]?4:0)+(c[p-d]?8:0);for(i=1;i<n;i++)o[t=(t>>2)+(c[p+1]?4:0)+(c[p-d+1]?8:0)]&&(h[r+i]=o[t],++f),p++;if(c[p-d]!==c[p]&&(h[r+i]=c[p]?2:4,++f),f>a)return null}for(p=d*(s-1),r=e*l,0!==c[p]&&(h[r]=8,++f),i=1;i<n;i++)c[p]!==c[p+1]&&(h[r+i]=c[p]?4:8,++f),p++;if(0!==c[p]&&(h[r+i]=4,++f),f>a)return null;let g=new Int32Array([0,l,-1,0,-l,0,0,0,1]),m=new Path2D;for(e=0;f&&e<=s;e++){let t=e*l,i=t+n;for(;t<i&&!h[t];)t++;if(t===i)continue;m.moveTo(t%l,e);let r=t,s=h[t];do{let e=g[s];do t+=e;while(!h[t]);let i=h[t];5!==i&&10!==i?(s=i,h[t]=0):(s=i&51*s>>4,h[t]&=s>>2|s<<2),m.lineTo(t%l,t/l|0),!h[t]&&--f}while(r!==t);--e}return c=null,h=null,function(t){t.save(),t.scale(1/n,-1/s),t.translate(0,-s),t.fill(m),t.beginPath(),t.restore()}}class v{constructor(t,e){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=r.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=r.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=r.TextRenderingMode.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,t,e])}clone(){let t=Object.create(this);return t.clipBox=this.clipBox.slice(),t}setCurrentPoint(t,e){this.x=t,this.y=e}updatePathMinMax(t,e,i){[e,i]=r.Util.applyTransform([e,i],t),this.minX=Math.min(this.minX,e),this.minY=Math.min(this.minY,i),this.maxX=Math.max(this.maxX,e),this.maxY=Math.max(this.maxY,i)}updateRectMinMax(t,e){let i=r.Util.applyTransform(e,t),n=r.Util.applyTransform(e.slice(2),t);this.minX=Math.min(this.minX,i[0],n[0]),this.minY=Math.min(this.minY,i[1],n[1]),this.maxX=Math.max(this.maxX,i[0],n[0]),this.maxY=Math.max(this.maxY,i[1],n[1])}updateScalingPathMinMax(t,e){r.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,i,n,s,a,o,l,h,d){let c=r.Util.bezierBoundingBox(e,i,n,s,a,o,l,h);if(d){d[0]=Math.min(d[0],c[0],c[2]),d[1]=Math.max(d[1],c[0],c[2]),d[2]=Math.min(d[2],c[1],c[3]),d[3]=Math.max(d[3],c[1],c[3]);return}this.updateRectMinMax(t,c)}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,i=[this.minX,this.minY,this.maxX,this.maxY];if(t===s.PathType.STROKE){e||(0,r.unreachable)("Stroke bounding box must include transform.");let t=r.Util.singularValueDecompose2dScale(e),n=t[0]*this.lineWidth/2,s=t[1]*this.lineWidth/2;i[0]-=n,i[1]-=s,i[2]+=n,i[3]+=s}return i}updateClipFromPath(){let t=r.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 r.Util.intersect(this.clipBox,this.getPathBoundingBox(t,e))}}function A(t,e){let i,n,s,a;if("undefined"!=typeof ImageData&&e instanceof ImageData){t.putImageData(e,0,0);return}let o=e.height,l=e.width,h=o%p,d=(o-h)/p,c=0===h?d:d+1,u=t.createImageData(l,p),f=0,g,m=e.data,b=u.data;if(e.kind===r.ImageKind.GRAYSCALE_1BPP){let e=m.byteLength,a=new Uint32Array(b.buffer,0,b.byteLength>>2),o=a.length,v=l+7>>3,A=4294967295,y=r.FeatureTest.isLittleEndian?4278190080:255;for(i=0;i<c;i++){for(n=0,s=i<d?p:h,g=0;n<s;
2n++){let t=e-f,i=0,r=t>v?l:8*t-7,n=-8&r,s=0,o=0;for(;i<n;i+=8)o=m[f++],a[g++]=128&o?A:y,a[g++]=64&o?A:y,a[g++]=32&o?A:y,a[g++]=16&o?A:y,a[g++]=8&o?A:y,a[g++]=4&o?A:y,a[g++]=2&o?A:y,a[g++]=1&o?A:y;for(;i<r;i++)0===s&&(o=m[f++],s=128),a[g++]=o&s?A:y,s>>=1}for(;g<o;)a[g++]=0;t.putImageData(u,0,i*p)}}else if(e.kind===r.ImageKind.RGBA_32BPP){for(i=0,n=0,a=l*p*4;i<d;i++)b.set(m.subarray(f,f+a)),f+=a,t.putImageData(u,0,n),n+=p;i<c&&(a=l*h*4,b.set(m.subarray(f,f+a)),t.putImageData(u,0,n))}else if(e.kind===r.ImageKind.RGB_24BPP)for(i=0,a=l*(s=p);i<c;i++){for(i>=d&&(a=l*(s=h)),g=0,n=a;n--;)b[g++]=m[f++],b[g++]=m[f++],b[g++]=m[f++],b[g++]=255;t.putImageData(u,0,i*p)}else throw Error(`bad image kind: ${e.kind}`)}function y(t,e){if(e.bitmap){t.drawImage(e.bitmap,0,0);return}let i=e.height,r=e.width,n=i%p,s=(i-n)/p,o=0===n?s:s+1,l=t.createImageData(r,p),h=0,d=e.data,c=l.data;for(let e=0;e<o;e++){let i=e<s?p:n;({srcPos:h}=(0,a.convertBlackAndWhiteToRGBA)({src:d,srcPos:h,dest:c,width:r,height:i,nonBlackColor:0})),t.putImageData(l,0,e*p)}}function _(t,e){for(let i of["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"])void 0!==t[i]&&(e[i]=t[i]);void 0!==t.setLineDash&&(e.setLineDash(t.getLineDash()),e.lineDashOffset=t.lineDashOffset)}function S(t){if(t.strokeStyle=t.fillStyle="#000000",t.fillRule="nonzero",t.globalAlpha=1,t.lineWidth=1,t.lineCap="butt",t.lineJoin="miter",t.miterLimit=10,t.globalCompositeOperation="source-over",t.font="10px sans-serif",void 0!==t.setLineDash&&(t.setLineDash([]),t.lineDashOffset=0),!r.isNodeJS){let{filter:e}=t;"none"!==e&&""!==e&&(t.filter="none")}}function E(t,e,i,r){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]=i,t[s-1]=r;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+i*a>>8,t[s-1]=t[s-1]*n+r*a>>8}}}function x(t,e,i){let r=t.length,n=1/255;for(let s=3;s<r;s+=4){let r=i?i[t[s]]:t[s];e[s]=e[s]*r*n|0}}function w(t,e,i){let r=t.length;for(let n=3;n<r;n+=4){let r=77*t[n-3]+152*t[n-2]+28*t[n-1];e[n]=i?e[n]*i[r>>8]>>8:e[n]*r>>16}}function C(t,e,i,r,n,s,a,o,l,h,d){let c=!!s,u=c?s[0]:0,p=c?s[1]:0,f=c?s[2]:0,g="Luminosity"===n?w:x,m=Math.min(r,Math.ceil(1048576/i));for(let n=0;n<r;n+=m){let s=Math.min(m,r-n),b=t.getImageData(o-h,n+(l-d),i,s),v=e.getImageData(o,n+l,i,s);c&&E(b.data,u,p,f),g(b.data,v.data,a),e.putImageData(v,o,n+l)}}function T(t,e,i,r){let n=r[0],s=r[1],a=r[2]-n,o=r[3]-s;0!==a&&0!==o&&(C(e.context,i,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(i.canvas,0,0),t.restore())}function P(t,e){let i=r.Util.singularValueDecompose2dScale(t);i[0]=Math.fround(i[0]),i[1]=Math.fround(i[1]);let s=Math.fround((globalThis.devicePixelRatio||1)*n.PixelsPerInch.PDF_TO_CSS_UNITS);return void 0!==e?e:i[0]<=s||i[1]<=s}let M=["butt","round","square"],k=["miter","round","bevel"],R={},F={};class I{constructor(t,e,i,r,n,s,a,o){let{optionalContentConfig:l,markedContentStack:h=null}=s;this.ctx=t,this.current=new v(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=i,this.canvasFactory=r,this.filterFactory=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=h||[],this.optionalContentConfig=l,this.cachedCanvases=new g(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=a,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=o,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(t){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:i,transparency:r=!1,background:s=null}=t,a=this.ctx.canvas.width,o=this.ctx.canvas.height,l=this.ctx.fillStyle;if(this.ctx.fillStyle=s||"#ffffff",this.ctx.fillRect(0,0,a,o),this.ctx.fillStyle=l,r){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,n.getCurrentTransform)(this.compositeCtx))}this.ctx.save(),S(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[0]),this.ctx.transform(...i.transform),this.viewportScale=i.scale,this.baseTransform=(0,n.getCurrentTransform)(this.ctx)}executeOperatorList(t,e,i,n){let s;let a=t.argsArray,o=t.fnArray,l=e||0,h=a.length;if(h===l)return l;let u=h-l>c&&"function"==typeof i,p=u?Date.now()+d:0,f=0,g=this.commonObjs,m=this.objs;for(;;){if(void 0!==n&&l===n.nextBreakPoint)return n.breakIt(l,i),l;if((s=o[l])!==r.OPS.dependency)this[s].apply(this,a[l]);else for(let t of a[l]){let e=t.startsWith("g_")?g:m;if(!e.has(t))return e.get(t,i),l}if(++l===h)return l;if(u&&++f>c){if(Date.now()>p)return i(),l;f=0}}}#t9(){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)}endDrawing(){for(let t of(this.#t9(),this.cachedCanvases.clear(),this.cachedPatterns.clear(),this._cachedBitmapsMap.values())){for(let e of t.values())"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement&&(e.width=e.height=0);t.clear()}this._cachedBitmapsMap.clear(),this.#et()}#et(){if(this.pageColors){let t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if("none"!==t){let e=this.ctx.filter;this.ctx.filter=t,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=e}}}_scaleImage(t,e){let i,r;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,d="prescale1";for(;a>2&&l>1||o>2&&h>1;){let e=l,n=h;a>2&&l>1&&(e=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l/2),a/=l/e),o>2&&h>1&&(n=h>=16384?Math.floor(h/2)-1||1:Math.ceil(h)/2,o/=h/n),(r=(i=this.cachedCanvases.getCanvas(d,e,n)).context).clearRect(0,0,e,n),r.drawImage(t,0,0,l,h,0,0,e,n),t=i.canvas,l=e,h=n,d="prescale1"===d?"prescale2":"prescale1"}return{img:t,paintWidth:l,paintHeight:h}}_createMaskCanvas(t){let e,i,a,o;let l=this.ctx,{width:h,height:d}=t,c=this.current.fillColor,u=this.current.patternFill,p=(0,n.getCurrentTransform)(l);if((t.bitmap||t.data)&&t.count>1){let r=t.bitmap||t.data.buffer;i=JSON.stringify(u?p:[p.slice(0,4),c]),(e=this._cachedBitmapsMap.get(r))||(e=new Map,this._cachedBitmapsMap.set(r,e));let n=e.get(i);if(n&&!u)return{canvas:n,offsetX:Math.round(Math.min(p[0],p[2])+p[4]),offsetY:Math.round(Math.min(p[1],p[3])+p[5])};a=n}a||y((o=this.cachedCanvases.getCanvas("maskCanvas",h,d)).context,t);let f=r.Util.transform(p,[1/h,0,0,-1/d,0,0]);f=r.Util.transform(f,[1,0,0,1,0,-d]);let g=r.Util.applyTransform([0,0],f),b=r.Util.applyTransform([h,d],f),v=r.Util.normalizeRect([g[0],g[1],b[0],b[1]]),A=Math.round(v[2]-v[0])||1,_=Math.round(v[3]-v[1])||1,S=this.cachedCanvases.getCanvas("fillCanvas",A,_),E=S.context,x=Math.min(g[0],b[0]),w=Math.min(g[1],b[1]);E.translate(-x,-w),E.transform(...f),!a&&(a=(a=this._scaleImage(o.canvas,(0,n.getCurrentTransformInverse)(E))).img,e&&u&&e.set(i,a)),E.imageSmoothingEnabled=P((0,n.getCurrentTransform)(E),t.interpolate),m(E,a,0,0,a.width,a.height,0,0,h,d),E.globalCompositeOperation="source-in";let C=r.Util.transform((0,n.getCurrentTransformInverse)(E),[1,0,0,1,-x,-w]);return E.fillStyle=u?c.getPattern(l,this,C,s.PathType.FILL):c,E.fillRect(0,0,h,d),e&&!u&&(this.cachedCanvases.delete("fillCanvas"),e.set(i,S.canvas)),{canvas:S.canvas,offsetX:Math.round(x),offsetY:Math.round(w)}}setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(t){this.ctx.lineCap=M[t]}setLineJoin(t){this.ctx.lineJoin=k[t]}setMiterLimit(t){this.ctx.miterLimit=t}setDash(t,e){let i=this.ctx;void 0!==i.setLineDash&&(i.setLineDash(t),i.lineDashOffset=e)}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(let[e,i]of t)switch(e){case"LW":this.setLineWidth(i);break;case"LC":this.setLineCap(i);break;case"LJ":this.setLineJoin(i);break;case"ML":this.setMiterLimit(i);break;case"D":this.setDash(i[0],i[1]);break;case"RI":this.setRenderingIntent(i);break;case"FL":this.setFlatness(i);break;case"Font":this.setFont(i[0],i[1]);break;case"CA":this.current.strokeAlpha=i;break;case"ca":this.current.fillAlpha=i,this.ctx.globalAlpha=i;break;case"BM":this.ctx.globalCompositeOperation=i;break;case"SMask":this.current.activeSMask=i?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(i)}}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,i="smaskGroupAt"+this.groupLevel,r=this.cachedCanvases.getCanvas(i,t,e);this.suspendedCtx=this.ctx,this.ctx=r.context;let s=this.ctx;s.setTransform(...(0,n.getCurrentTransform)(this.suspendedCtx)),_(this.suspendedCtx,s),f(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(),_(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;T(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?(_(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(),_(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(t,e,i,r,n,s){this.ctx.transform(t,e,i,r,n,s),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,e,i){let s,a;let o=this.ctx,l=this.current,h=l.x,d=l.y,c=(0,n.getCurrentTransform)(o),u=0===c[0]&&0===c[3]||0===c[1]&&0===c[2],p=u?i.slice(0):null;for(let i=0,n=0,f=t.length;i<f;i++)switch(0|t[i]){case r.OPS.rectangle:h=e[n++],d=e[n++];let f=e[n++],g=e[n++],m=h+f,b=d+g;o.moveTo(h,d),0===f||0===g?o.lineTo(m,b):(o.lineTo(m,d),o.lineTo(m,b),o.lineTo(h,b)),u||l.updateRectMinMax(c,[h,d,m,b]),o.closePath();break;case r.OPS.moveTo:h=e[n++],d=e[n++],o.moveTo(h,d),u||l.updatePathMinMax(c,h,d);break;case r.OPS.lineTo:h=e[n++],d=e[n++],o.lineTo(h,d),u||l.updatePathMinMax(c,h,d);break;case r.OPS.curveTo:s=h,a=d,h=e[n+4],d=e[n+5],o.bezierCurveTo(e[n],e[n+1],e[n+2],e[n+3],h,d),l.updateCurvePathMinMax(c,s,a,e[n],e[n+1],e[n+2],e[n+3],h,d,p),n+=6;break;case r.OPS.curveTo2:s=h,a=d,o.bezierCurveTo(h,d,e[n],e[n+1],e[n+2],e[n+3]),l.updateCurvePathMinMax(c,s,a,h,d,e[n],e[n+1],e[n+2],e[n+3],p),h=e[n+2],d=e[n+3],n+=4;break;case r.OPS.curveTo3:s=h,a=d,h=e[n+2],d=e[n+3],o.bezierCurveTo(e[n],e[n+1],h,d,h,d),l.updateCurvePathMinMax(c,s,a,e[n],e[n+1],h,d,h,d,p),n+=4;break;case r.OPS.closePath:o.closePath()}u&&l.updateScalingPathMinMax(c,p),l.setCurrentPoint(h,d)}closePath(){this.ctx.closePath()}stroke(){let t=!(arguments.length>0)||void 0===arguments[0]||arguments[0],e=this.ctx,i=this.current.strokeColor;e.globalAlpha=this.current.strokeAlpha,this.contentVisible&&("object"==typeof i&&i?.getPattern?(e.save(),e.strokeStyle=i.getPattern(e,this,(0,n.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(){let t=!(arguments.length>0)||void 0===arguments[0]||arguments[0],e=this.ctx,i=this.current.fillColor,r=this.current.patternFill,a=!1;r&&(e.save(),e.fillStyle=i.getPattern(e,this,(0,n.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=R}eoClip(){this.pendingClip=F}beginText(){this.current.textMatrix=r.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 i of(e.save(),e.beginPath(),t))e.setTransform(...i.transform),e.translate(i.x,i.y),i.addToPath(e,i.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 i=this.commonObjs.get(t),n=this.current;if(!i)throw Error(`Can't find font for ${t}`);if(n.fontMatrix=i.fontMatrix||r.FONT_IDENTITY_MATRIX,(0===n.fontMatrix[0]||0===n.fontMatrix[3])&&(0,r.warn)("Invalid font matrix for font "+t),e<0?(e=-e,n.fontDirection=-1):n.fontDirection=1,this.current.font=i,this.current.fontSize=e,i.isType3Font)return;let s=i.loadedName||"sans-serif",a=i.systemFontInfo?.css||`"${s}", ${i.fallbackName}`,h="normal";i.black?h="900":i.bold&&(h="bold");let d=i.italic?"italic":"normal",c=e;e<o?c=o:e>l&&(c=l),this.current.fontSizeScale=e/c,this.ctx.font=`${d} ${h} ${c}px ${a}`}setTextRenderingMode(t){this.current.textRenderingMode=t}setTextRise(t){this.current.textRise=t}moveText(t,e){this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=e}setLeadingMoveText(t,e){this.setLeading(-e),this.moveText(t,e)}setTextMatrix(t,e,i,r,n,s){this.current.textMatrix=[t,e,i,r,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,i,s){let a;let o=this.ctx,l=this.current,h=l.font,d=l.textRenderingMode,c=l.fontSize/l.fontSizeScale,u=d&r.TextRenderingMode.FILL_STROKE_MASK,p=!!(d&r.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,i),o.beginPath(),a(o,c),s&&o.setTransform(...s),(u===r.TextRenderingMode.FILL||u===r.TextRenderingMode.FILL_STROKE)&&o.fill(),(u===r.TextRenderingMode.STROKE||u===r.TextRenderingMode.FILL_STROKE)&&o.stroke(),o.restore(
2)):((u===r.TextRenderingMode.FILL||u===r.TextRenderingMode.FILL_STROKE)&&o.fillText(t,e,i),(u===r.TextRenderingMode.STROKE||u===r.TextRenderingMode.FILL_STROKE)&&o.strokeText(t,e,i)),p&&(this.pendingTextPaths||=[]).push({transform:(0,n.getCurrentTransform)(o),x:e,y:i,fontSize:c,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,i=!1;for(let t=3;t<e.length;t+=4)if(e[t]>0&&e[t]<255){i=!0;break}return(0,r.shadow)(this,"isFontSubpixelAAEnabled",i)}showText(t){let e;let i=this.current,a=i.font;if(a.isType3Font)return this.showType3Text(t);let o=i.fontSize;if(0===o)return;let l=this.ctx,h=i.fontSizeScale,d=i.charSpacing,c=i.wordSpacing,u=i.fontDirection,p=i.textHScale*u,f=t.length,g=a.vertical,m=g?1:-1,b=a.defaultVMetrics,v=o*i.fontMatrix[0],A=i.textRenderingMode===r.TextRenderingMode.FILL&&!a.disableFontFace&&!i.patternFill;if(l.save(),l.transform(...i.textMatrix),l.translate(i.x,i.y+i.textRise),u>0?l.scale(p,-1):l.scale(p,1),i.patternFill){l.save();let t=i.fillColor.getPattern(l,this,(0,n.getCurrentTransformInverse)(l),s.PathType.FILL);e=(0,n.getCurrentTransform)(l),l.restore(),l.fillStyle=t}let y=i.lineWidth,_=i.textMatrixScale;if(0===_||0===y){let t=i.textRenderingMode&r.TextRenderingMode.FILL_STROKE_MASK;(t===r.TextRenderingMode.STROKE||t===r.TextRenderingMode.FILL_STROKE)&&(y=this.getSinglePixelWidth())}else y/=_;if(1!==h&&(l.scale(h,h),y/=h),l.lineWidth=y,a.isInvalidPDFjsFont){let e=[],r=0;for(let i of t)e.push(i.unicode),r+=i.width;l.fillText(e.join(""),0,0),i.x+=r*v*p,l.restore(),this.compose();return}let S=0,E;for(E=0;E<f;++E){let i,r;let n=t[E];if("number"==typeof n){S+=m*n*o/1e3;continue}let s=!1,p=(n.isSpace?c:0)+d,f=n.fontChar,y=n.accent,_=n.width;if(g){let t=n.vmetric||b,e=-(n.vmetric?t[1]:.5*_)*v,s=t[2]*v;_=t?-t[0]:_,i=e/h,r=(S+s)/h}else i=S/h,r=0;if(a.remeasure&&_>0){let t=1e3*l.measureText(f).width/o*h;if(_<t&&this.isFontSubpixelAAEnabled){let e=_/t;s=!0,l.save(),l.scale(e,1),i/=e}else _!==t&&(i+=(_-t)/2e3*o/h)}if(this.contentVisible&&(n.isInFont||a.missingFile)){if(A&&!y)l.fillText(f,i,r);else if(this.paintChar(f,i,r,e),y){let t=i+o*y.offset.x/h,n=r-o*y.offset.y/h;this.paintChar(y.fontChar,t,n,e)}}S+=g?_*v-p*u:_*v+p*u,s&&l.restore()}g?i.y-=S:i.x+=S*p,l.restore(),this.compose()}showType3Text(t){let e,i,n,s;let a=this.ctx,o=this.current,l=o.font,h=o.fontSize,d=o.fontDirection,c=l.vertical?1:-1,u=o.charSpacing,p=o.wordSpacing,f=o.textHScale*d,g=o.fontMatrix||r.FONT_IDENTITY_MATRIX,m=t.length;if(o.textRenderingMode!==r.TextRenderingMode.INVISIBLE&&0!==h){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,a.save(),a.transform(...o.textMatrix),a.translate(o.x,o.y),a.scale(f,d),e=0;e<m;++e){if("number"==typeof(i=t[e])){s=c*i*h/1e3,this.ctx.translate(s,0),o.x+=s*f;continue}let d=(i.isSpace?p:0)+u,m=l.charProcOperatorList[i.operatorListId];if(!m){(0,r.warn)(`Type3 character "${i.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=i,this.save(),a.scale(h,h),a.transform(...g),this.executeOperatorList(m),this.restore()),n=r.Util.applyTransform([i.width,0],g)[0]*h+d,a.translate(n,0),o.x+=n*f}a.restore(),this.processingType3=null}}setCharWidth(t,e){}
2setCharWidthAndBounds(t,e,i,r,n,s){this.ctx.rect(i,r,n-i,s-r),this.ctx.clip(),this.endPath()}getColorN_Pattern(t){let e;if("TilingPattern"===t[0]){let i=t[1],r=this.baseTransform||(0,n.getCurrentTransform)(this.ctx),a={createCanvasGraphics:t=>new I(t,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};e=new s.TilingPattern(t,i,this.ctx,a,r)}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,i){let n=r.Util.makeHexColor(t,e,i);this.ctx.strokeStyle=n,this.current.strokeColor=n}setFillRGBColor(t,e,i){let n=r.Util.makeHexColor(t,e,i);this.ctx.fillStyle=n,this.current.fillColor=n,this.current.patternFill=!1}_getPattern(t){let e,i=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.getObject(t)),this.cachedPatterns.set(t,e)),i&&(e.matrix=i),e}shadingFill(t){if(!this.contentVisible)return;let e=this.ctx;this.save();let i=this._getPattern(t);e.fillStyle=i.getPattern(e,this,(0,n.getCurrentTransformInverse)(e),s.PathType.SHADING);let a=(0,n.getCurrentTransformInverse)(e);if(a){let{width:t,height:i}=e.canvas,[n,s,o,l]=r.Util.getAxialAlignedBoundingBox([0,0,t,i],a);this.ctx.fillRect(n,s,o-n,l-s)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){(0,r.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,r.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,n.getCurrentTransform)(this.ctx),e)){let t=e[2]-e[0],i=e[3]-e[1];this.ctx.rect(e[0],e[1],t,i),this.current.updateRectMinMax((0,n.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,r.info)("TODO: Support non-isolated groups."),t.knockout&&(0,r.warn)("Knockout groups not supported.");let i=(0,n.getCurrentTransform)(e);if(t.matrix&&e.transform(...t.matrix),!t.bbox)throw Error("Bounding box is required.");let s=r.Util.getAxialAlignedBoundingBox(t.bbox,(0,n.getCurrentTransform)(e)),a=[0,0,e.canvas.width,e.canvas.height],o=Math.floor((s=r.Util.intersect(s,a)||[0,0,0,0])[0]),l=Math.floor(s[1]),d=Math.max(Math.ceil(s[2])-o,1),c=Math.max(Math.ceil(s[3])-l,1),u=1,p=1;d>h&&(u=d/h,d=h),c>h&&(p=c/h,c=h),this.current.startNewPathAndClipBox([0,0,d,c]);let f="groupAt"+this.groupLevel;t.smask&&(f+="_smask_"+this.smaskCounter++%2);let g=this.cachedCanvases.getCanvas(f,d,c),m=g.context;m.scale(1/u,1/p),m.translate(-o,-l),m.transform(...i),t.smask?this.smaskStack.push({canvas:g.canvas,context:m,offsetX:o,offsetY:l,scaleX:u,scaleY:p,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(u,p),e.save()),_(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,i=this.groupStack.pop();if(this.ctx=i,this.ctx.imageSmoothingEnabled=!1,t.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();let t=(0,n.getCurrentTransform)(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...t);let i=r.Util.getAxialAlignedBoundingBox([0,0,e.canvas.width,e.canvas.height],t);this.ctx.drawImage(e.canvas,0,0),this.ctx.restore(),this.compose(i)}}beginAnnotation(t,e,i,s,a){if(this.#t9(),S(this.ctx),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){i=i.slice(),i[4]-=e[0],i[5]-=e[1],(e=e.slice())[0]=e[1]=0,e[2]=s,e[3]=o;let[a,l]=r.Util.singularValueDecompose2dScale((0,n.getCurrentTransform)(this.ctx)),{viewportScale:h}=this,d=Math.ceil(s*this.outputScaleX*h),c=Math.ceil(o*this.outputScaleY*h);this.annotationCanvas=this.canvasFactory.create(d,c);let{canvas:u,context:p}=this.annotationCanvas;this.annotationCanvasMap.set(t,u),this.annotationCanvas.savedCtx=this.ctx,this.ctx=p,this.ctx.save(),this.ctx.setTransform(a,0,0,-l,0,o*l),S(this.ctx)}else S(this.ctx),this.ctx.rect(e[0],e[1],s,o),this.ctx.clip(),this.endPath()}
2this.current=new v(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...i),this.transform(...s)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),this.#et(),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 i=this.ctx,r=this.processingType3;if(r&&(void 0===r.compiled&&(r.compiled=b(t)),r.compiled)){r.compiled(i);return}let n=this._createMaskCanvas(t),s=n.canvas;i.save(),i.setTransform(1,0,0,1,0,0),i.drawImage(s,n.offsetX,n.offsetY),i.restore(),this.compose()}paintImageMaskXObjectRepeat(t,e){let i=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,n.getCurrentTransform)(l);l.transform(e,i,s,a,0,0);let d=this._createMaskCanvas(t);l.setTransform(1,0,0,1,d.offsetX-h[4],d.offsetY-h[5]);for(let t=0,n=o.length;t<n;t+=2){let n=r.Util.transform(h,[e,i,s,a,o[t],o[t+1]]),[c,u]=r.Util.applyTransform([0,0],n);l.drawImage(d.canvas,c,u)}l.restore(),this.compose()}paintImageMaskXObjectGroup(t){if(!this.contentVisible)return;let e=this.ctx,i=this.current.fillColor,r=this.current.patternFill;for(let a of t){let{data:t,width:o,height:l,transform:h}=a,d=this.cachedCanvases.getCanvas("maskCanvas",o,l),c=d.context;c.save(),y(c,this.getObject(t,a)),c.globalCompositeOperation="source-in",c.fillStyle=r?i.getPattern(c,this,(0,n.getCurrentTransformInverse)(e),s.PathType.FILL):i,c.fillRect(0,0,o,l),c.restore(),e.save(),e.transform(...h),e.scale(1,-1),m(e,d.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,r.warn)("Dependent image isn't ready yet");return}this.paintInlineImageXObject(e)}paintImageXObjectRepeat(t,e,i,n){if(!this.contentVisible)return;let s=this.getObject(t);if(!s){(0,r.warn)("Dependent image isn't ready yet");return}let a=s.width,o=s.height,l=[];for(let t=0,r=n.length;t<r;t+=2)l.push({transform:[e,0,0,i,n[t],n[t+1]],x:0,y:0,w:a,h:o});this.paintInlineImageXObjectGroup(s,l)}applyTransferMapsToCanvas(t){return"none"!==this.current.transferMaps&&(t.filter=this.current.transferMaps,t.drawImage(t.canvas,0,0),t.filter="none"),t.canvas}applyTransferMapsToBitmap(t){if("none"===this.current.transferMaps)return t.bitmap;let{bitmap:e,width:i,height:r}=t,n=this.cachedCanvases.getCanvas("inlineImage",i,r),s=n.context;return s.filter=this.current.transferMaps,s.drawImage(e,0,0),s.filter="none",n.canvas}paintInlineImageXObject(t){let e;if(!this.contentVisible)return;let i=t.width,s=t.height,a=this.ctx;if(this.save(),!r.isNodeJS){let{filter:t}=a;"none"!==t&&""!==t&&(a.filter="none")}if(a.scale(1/i,-1/s),t.bitmap)e=this.applyTransferMapsToBitmap(t);else if("function"==typeof HTMLElement&&t instanceof HTMLElement||!t.data)e=t;else{let r=this.cachedCanvases.getCanvas("inlineImage",i,s).context;A(r,t),e=this.applyTransferMapsToCanvas(r)}let o=this._scaleImage(e,(0,n.getCurrentTransformInverse)(a));a.imageSmoothingEnabled=P((0,n.getCurrentTransform)(a),t.interpolate),m(a,o.img,0,0,o.paintWidth,o.paintHeight,0,-s,i,s),this.compose(),this.restore()}paintInlineImageXObjectGroup(t,e){let i;if(!this.contentVisible)return;let r=this.ctx;if(t.bitmap)i=t.bitmap;else{let e=t.width,r=t.height,n=this.cachedCanvases.getCanvas("inlineImage",e,r).context;A(n,t),i=this.applyTransferMapsToCanvas(n)}for(let t of e)r.save(),r.transform(...t.transform),r.scale(1,-1),m(r,i,t.x,t.y,t.w,t.h,0,-1,1,1),r.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t){}markPointProps(t,e){}beginMarkedContent(t){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,e){"OC"===t?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(e)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(t){let e=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(t);let i=this.ctx;this.pendingClip&&(e||(this.pendingClip===F?i.clip("evenodd"):i.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),i.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){let t=(0,n.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]),i=Math.hypot(t[0],t[2]),r=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(i,r)/e}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(-1===this._cachedScaleForStroking[0]){let t,e;let{lineWidth:i}=this.current,{a:r,b:n,c:s,d:a}=this.ctx.getTransform();if(0===n&&0===s){let n=Math.abs(r),s=Math.abs(a);if(n===s){if(0===i)t=e=1/n;else{let r=n*i;t=e=r<1?1/r:1}}else if(0===i)t=1/n,e=1/s;else{let r=n*i,a=s*i;t=r<1?1/r:1,e=a<1?1/a:1}}else{let o=Math.abs(r*a-n*s),l=Math.hypot(r,n),h=Math.hypot(s,a);if(0===i)t=h/o,e=l/o;else{let r=i*o;t=h>r?h/r:1,e=l>r?l/r:1}}this._cachedScaleForStroking[0]=t,this._cachedScaleForStroking[1]=e}return this._cachedScaleForStroking}rescaleAndStroke(t){let{ctx:e}=this,{lineWidth:i}=this.current,[r,n]=this.getScaleForStroking();if(e.lineWidth=i||1,1===r&&1===n){e.stroke();return}let s=e.getLineDash();if(t&&e.save(),e.scale(r,n),s.length>0){let t=Math.max(r,n);e.setLineDash(s.map(e=>e/t)),e.lineDashOffset/=t}
2e.stroke(),t&&e.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}for(let t in e.CanvasGraphics=I,r.OPS)void 0!==I.prototype[t]&&(I.prototype[r.OPS[t]]=I.prototype[t])},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TilingPattern=e.PathType=void 0,e.getShadingPattern=p,i(2);var r=i(1),n=i(168);let s={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function a(t,e){if(!e)return;let i=e[2]-e[0],r=e[3]-e[1],n=new Path2D;n.rect(e[0],e[1],i,r),t.clip(n)}e.PathType=s;class o{constructor(){this.constructor===o&&(0,r.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,r.unreachable)("Abstract method `getPattern` called.")}}class l extends o{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 i 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(i[0],i[1]);return e}getPattern(t,e,i,o){let l;if(o===s.STROKE||o===s.FILL){let s=e.current.getClippedPathBoundingBox(o,(0,n.getCurrentTransform)(t))||[0,0,0,0],h=Math.ceil(s[2]-s[0])||1,d=Math.ceil(s[3]-s[1])||1,c=e.cachedCanvases.getCanvas("pattern",h,d,!0),u=c.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(-s[0],-s[1]),i=r.Util.transform(i,[1,0,0,1,s[0],s[1]]),u.transform(...e.baseTransform),this.matrix&&u.transform(...this.matrix),a(u,this._bbox),u.fillStyle=this._createGradient(u),u.fill(),l=t.createPattern(c.canvas,"no-repeat");let p=new DOMMatrix(i);l.setTransform(p)}else a(t,this._bbox),l=this._createGradient(t);return l}}function h(t,e,i,r,n,s,a,o){let l,h,d,c,u,p,f,g,m;let b=e.coords,v=e.colors,A=t.data,y=4*t.width;b[i+1]>b[r+1]&&(l=i,i=r,r=l,l=s,s=a,a=l),b[r+1]>b[n+1]&&(l=r,r=n,n=l,l=a,a=o,o=l),b[i+1]>b[r+1]&&(l=i,i=r,r=l,l=s,s=a,a=l);let _=(b[i]+e.offsetX)*e.scaleX,S=(b[i+1]+e.offsetY)*e.scaleY,E=(b[r]+e.offsetX)*e.scaleX,x=(b[r+1]+e.offsetY)*e.scaleY,w=(b[n]+e.offsetX)*e.scaleX,C=(b[n+1]+e.offsetY)*e.scaleY;if(S>=C)return;let T=v[s],P=v[s+1],M=v[s+2],k=v[a],R=v[a+1],F=v[a+2],I=v[o],D=v[o+1],O=v[o+2],L=Math.round(S),N=Math.round(C);for(let t=L;t<=N;t++){let e;if(t<x){let e=t<S?0:(S-t)/(S-x);h=_-(_-E)*e,d=T-(T-k)*e,c=P-(P-R)*e,u=M-(M-F)*e}else{let e;h=E-(E-w)*(e=t>C?1:x===C?0:(x-t)/(x-C)),d=k-(k-I)*e,c=R-(R-D)*e,u=F-(F-O)*e}p=_-(_-w)*(e=t<S?0:t>C?1:(S-t)/(S-C)),f=T-(T-I)*e,g=P-(P-D)*e,m=M-(M-O)*e;let i=Math.round(Math.min(h,p)),r=Math.round(Math.max(h,p)),n=y*t+4*i;for(let t=i;t<=r;t++)(e=(h-t)/(h-p))<0?e=0:e>1&&(e=1),A[n++]=d-(d-f)*e|0,A[n++]=c-(c-g)*e|0,A[n++]=u-(u-m)*e|0,A[n++]=255}}function d(t,e,i){let r,n;let s=e.coords,a=e.colors;switch(e.type){case"lattice":let o=e.verticesPerRow,l=Math.floor(s.length/o)-1,d=o-1;for(r=0;r<l;r++){let e=r*o;for(let r=0;r<d;r++,e++)h(t,i,s[e],s[e+1],s[e+o],a[e],a[e+1],a[e+o]),h(t,i,s[e+o+1],s[e+1],s[e+o],a[e+o+1],a[e+1],a[e+o])}break;case"triangles":for(r=0,n=s.length;r<n;r+=3)h(t,i,s[r],s[r+1],s[r+2],a[r],a[r+1],a[r+2]);break;default:throw Error("illegal figure")}}class c extends o{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,i){let r=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]*r)),n),u=Math.min(Math.ceil(Math.abs(h*t[1]*r)),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,b=u+2*s,v=i.getCanvas("mesh",m,b,!1),A=v.context,y=A.createImageData(c,u);if(e){let t=y.data;for(let i=0,r=t.length;i<r;i+=4)t[i]=e[0],t[i+1]=e[1],t[i+2]=e[2],t[i+3]=255}for(let t of this._figures)d(y,t,g);return A.putImageData(y,s,s),{canvas:v.canvas,offsetX:a-s*p,offsetY:o-s*f,scaleX:p,scaleY:f}}getPattern(t,e,i,o){let l;if(a(t,this._bbox),o===s.SHADING)l=r.Util.singularValueDecompose2dScale((0,n.getCurrentTransform)(t));else if(l=r.Util.singularValueDecompose2dScale(e.baseTransform),this.matrix
2){let t=r.Util.singularValueDecompose2dScale(this.matrix);l=[l[0]*t[0],l[1]*t[1]]}let h=this._createMeshCanvas(l,o===s.SHADING?null:this._background,e.cachedCanvases);return o!==s.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 u extends o{getPattern(){return"hotpink"}}function p(t){switch(t[0]){case"RadialAxial":return new l(t);case"Mesh":return new c(t);case"Dummy":return new u}throw Error(`Unknown IR type: ${t[0]}`)}let f={COLORED:1,UNCOLORED:2};class g{static MAX_PATTERN_SIZE=3e3;constructor(t,e,i,r,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=i,this.canvasGraphicsFactory=r,this.baseTransform=n}createPatternCanvas(t){let e=this.operatorList,i=this.bbox,s=this.xstep,a=this.ystep,o=this.paintType,l=this.tilingType,h=this.color,d=this.canvasGraphicsFactory;(0,r.info)("TilingType: "+l);let c=i[0],u=i[1],p=i[2],f=i[3],g=r.Util.singularValueDecompose2dScale(this.matrix),m=r.Util.singularValueDecompose2dScale(this.baseTransform),b=[g[0]*m[0],g[1]*m[1]],v=this.getSizeAndScale(s,this.ctx.canvas.width,b[0]),A=this.getSizeAndScale(a,this.ctx.canvas.height,b[1]),y=t.cachedCanvases.getCanvas("pattern",v.size,A.size,!0),_=y.context,S=d.createCanvasGraphics(_);S.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(S,o,h);let E=c,x=u,w=p,C=f;return c<0&&(E=0,w+=Math.abs(c)),u<0&&(x=0,C+=Math.abs(u)),_.translate(-(v.scale*E),-(A.scale*x)),S.transform(v.scale,0,0,A.scale,0,0),_.save(),this.clipBbox(S,E,x,w,C),S.baseTransform=(0,n.getCurrentTransform)(S.ctx),S.executeOperatorList(e),S.endDrawing(),{canvas:y.canvas,scaleX:v.scale,scaleY:A.scale,offsetX:E,offsetY:x}}getSizeAndScale(t,e,i){t=Math.abs(t);let r=Math.max(g.MAX_PATTERN_SIZE,e),n=Math.ceil(t*i);return n>=r?n=r:i=n/t,{scale:i,size:n}}clipBbox(t,e,i,r,s){let a=r-e,o=s-i;t.ctx.rect(e,i,a,o),t.current.updateRectMinMax((0,n.getCurrentTransform)(t.ctx),[e,i,r,s]),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,e,i){let n=t.ctx,s=t.current;switch(e){case f.COLORED:let a=this.ctx;n.fillStyle=a.fillStyle,n.strokeStyle=a.strokeStyle,s.fillColor=a.fillStyle,s.strokeColor=a.strokeStyle;break;case f.UNCOLORED:let o=r.Util.makeHexColor(i[0],i[1],i[2]);n.fillStyle=o,n.strokeStyle=o,s.fillColor=o,s.strokeColor=o;break;default:throw new r.FormatError(`Unsupported paint type: ${e}`)}}getPattern(t,e,i,n){let a=i;n!==s.SHADING&&(a=r.Util.transform(a,e.baseTransform),this.matrix&&(a=r.Util.transform(a,this.matrix)));let o=this.createPatternCanvas(e),l=new DOMMatrix(a);l=(l=l.translate(o.offsetX,o.offsetY)).scale(1/o.scaleX,1/o.scaleY);let h=t.createPattern(o.canvas,"repeat");return h.setTransform(l),h}}e.TilingPattern=g},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.convertBlackAndWhiteToRGBA=s,e.convertToRGBA=n,e.grayToRGBA=o,i(93),i(101),i(102),i(105),i(107),i(109),i(113),i(116),i(123);var r=i(1);function n(t){switch(t.kind){case r.ImageKind.GRAYSCALE_1BPP:return s(t);case r.ImageKind.RGB_24BPP:return a(t)}return null}function s(t){let{src:e,srcPos:i=0,dest:n,width:s,height:a,nonBlackColor:o=4294967295,inverseDecode:l=!1}=t,h=r.FeatureTest.isLittleEndian?4278190080:255,[d,c]=l?[o,h]:[h,o],u=s>>3,p=7&s,f=e.length;n=new Uint32Array(n.buffer);let g=0;for(let t=0;t<a;t++){for(let t=i+u;i<t;i++){let t=i<f?e[i]:255;n[g++]=128&t?c:d,n[g++]=64&t?c:d,n[g++]=32&t?c:d,n[g++]=16&t?c:d,n[g++]=8&t?c:d,n[g++]=4&t?c:d,n[g++]=2&t?c:d,n[g++]=1&t?c:d}if(0===p)continue;let t=i<f?e[i++]:255;for(let e=0;e<p;e++)n[g++]=t&1<<7-e?c:d}return{srcPos:i,destPos:g}}function a(t){let{src:e,srcPos:i=0,dest:n,destPos:s=0,width:a,height:o}=t,l=0,h=e.length>>2,d=new Uint32Array(e.buffer,i,h);if(r.FeatureTest.isLittleEndian){for(;l<h-2;l+=3,s+=4){let t=d[l],e=d[l+1],i=d[l+2];n[s]=4278190080|t,n[s+1]=t>>>24|e<<8|4278190080,n[s+2]=e>>>16|i<<16|4278190080,n[s+3]=i>>>8|4278190080}for(let t=4*l,i=e.length;t<i;t+=3)n[s++]=e[t]|e[t+1]<<8|e[t+2]<<16|4278190080}else{for(;
2l<h-2;l+=3,s+=4){let t=d[l],e=d[l+1],i=d[l+2];n[s]=255|t,n[s+1]=t<<24|e>>>8|255,n[s+2]=e<<16|i>>>16|255,n[s+3]=i<<8|255}for(let t=4*l,i=e.length;t<i;t+=3)n[s++]=e[t]<<24|e[t+1]<<16|e[t+2]<<8|255}return{srcPos:i,destPos:s}}function o(t,e){if(r.FeatureTest.isLittleEndian)for(let i=0,r=t.length;i<r;i++)e[i]=65793*t[i]|4278190080;else for(let i=0,r=t.length;i<r;i++)e[i]=16843008*t[i]|255}},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GlobalWorkerOptions=void 0;let i=Object.create(null);e.GlobalWorkerOptions=i,i.workerPort=null,i.workerSrc=""},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MessageHandler=void 0,i(2);var r=i(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,r.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new r.AbortException(t.message);case"MissingPDFException":return new r.MissingPDFException(t.message);case"PasswordException":return new r.PasswordException(t.message,t.code);case"UnexpectedResponseException":return new r.UnexpectedResponseException(t.message,t.status);case"UnknownErrorException":return new r.UnknownErrorException(t.message,t.details);default:return new r.UnknownErrorException(t.message,t.toString())}}class o{constructor(t,e,i){this.sourceName=t,this.targetName=e,this.comObj=i,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.#ee(e);return}if(e.callback){let t=e.callbackId,i=this.callbackCapabilities[t];if(!i)throw Error(`Cannot resolve callback ${t}`);if(delete this.callbackCapabilities[t],e.callback===n.DATA)i.resolve(e.data);else if(e.callback===n.ERROR)i.reject(a(e.reason));else throw Error("Unexpected callback case");return}let r=this.actionHandler[e.action];if(!r)throw Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){let t=this.sourceName,s=e.sourceName;new Promise(function(t){t(r(e.data))}).then(function(r){i.postMessage({sourceName:t,targetName:s,callback:n.DATA,callbackId:e.callbackId,data:r})},function(r){i.postMessage({sourceName:t,targetName:s,callback:n.ERROR,callbackId:e.callbackId,reason:a(r)})});return}if(e.streamId){this.#ei(e);return}r(e.data)},i.addEventListener("message",this._onComObjOnMessage)}on(t,e){let i=this.actionHandler;if(i[t])throw Error(`There is already an actionName called "${t}"`);i[t]=e}send(t,e,i){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:e},i)}sendWithPromise(t,e,i){let n=this.callbackId++,s=new r.PromiseCapability;this.callbackCapabilities[n]=s;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:n,data:e},i)}catch(t){s.reject(t)}return s.promise}sendWithStream(t,e,i,n){let o=this.streamId++,l=this.sourceName,h=this.targetName,d=this.comObj;return new ReadableStream({start:i=>{let s=new r.PromiseCapability;return this.streamControllers[o]={controller:i,startCall:s,pullCall:null,cancelCall:null,isClosed:!1},d.postMessage({sourceName:l,targetName:h,action:t,streamId:o,data:e,desiredSize:i.desiredSize},n),s.promise},pull:t=>{let e=new r.PromiseCapability;return this.streamControllers[o].pullCall=e,d.postMessage({sourceName:l,targetName:h,stream:s.PULL,streamId:o,desiredSize:t.desiredSize}),e.promise},cancel:t=>{(0,r.assert)(t instanceof Error,"cancel must have a valid reason");let e=new r.PromiseCapability;return this.streamControllers[o].cancelCall=e,this.streamControllers[o].isClosed=!0,d.postMessage({sourceName:l,targetName:h,stream:s.CANCEL,streamId:o,reason:a(t)}),e.promise}},i)}#ei(t){let e=t.streamId,i=this.sourceName,n=t.sourceName,o=this.comObj,l=this,h=this.actionHandler[t.action],d={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=new r.PromiseCapability,this.ready=this.sinkCapability.promise),o.postMessage({sourceName:i,targetName:n,stream:s.ENQUEUE,streamId:e,chunk:t},l)},close(){this.isCancelled||(this.isCancelled=!0,o.postMessage({sourceName:i,targetName:n,stream:s.CLOSE,streamId:e}),delete l.streamSinks[e])},error(t){(0,r.assert)(t instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,o.postMessage({sourceName:i,targetName:n,stream:s.ERROR,streamId:e,reason:a(t)}))},sinkCapability:new r.PromiseCapability,onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};d.sinkCapability.resolve(),d.ready=d.sinkCapability.promise,this.streamSinks[e]=d,new Promise(function(e){e(h(t.data,d))}).then(function(){o.postMessage({sourceName:i,targetName:n,stream:s.START_COMPLETE,streamId:e,success:!0})},function(t){o.postMessage({sourceName:i,targetName:n,stream:s.START_COMPLETE,streamId:e,reason:a(t)})})}#ee(t){let e=t.streamId,i=this.sourceName,n=t.sourceName,o=this.comObj,l=this.streamControllers[e],h=this.streamSinks[e];
2switch(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:i,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?.())}).then(function(){o.postMessage({sourceName:i,targetName:n,stream:s.PULL_COMPLETE,streamId:e,success:!0})},function(t){o.postMessage({sourceName:i,targetName:n,stream:s.PULL_COMPLETE,streamId:e,reason:a(t)})});break;case s.ENQUEUE:if((0,r.assert)(l,"enqueue should have stream controller"),l.isClosed)break;l.controller.enqueue(t.chunk);break;case s.CLOSE:if((0,r.assert)(l,"close should have stream controller"),l.isClosed)break;l.isClosed=!0,l.controller.close(),this.#er(l,e);break;case s.ERROR:(0,r.assert)(l,"error should have stream controller"),l.controller.error(a(t.reason)),this.#er(l,e);break;case s.CANCEL_COMPLETE:t.success?l.cancelCall.resolve():l.cancelCall.reject(a(t.reason)),this.#er(l,e);break;case s.CANCEL:if(!h)break;new Promise(function(e){e(h.onCancel?.(a(t.reason)))}).then(function(){o.postMessage({sourceName:i,targetName:n,stream:s.CANCEL_COMPLETE,streamId:e,success:!0})},function(t){o.postMessage({sourceName:i,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 #er(t,e){await Promise.allSettled([t.startCall?.promise,t.pullCall?.promise,t.cancelCall?.promise]),delete this.streamControllers[e]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}e.MessageHandler=o},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Metadata=void 0;var r=i(1);class n{#en;#es;constructor(t){let{parsedData:e,rawData:i}=t;this.#en=e,this.#es=i}getRaw(){return this.#es}get(t){return this.#en.get(t)??null}getAll(){return(0,r.objectFromMap)(this.#en)}has(t){return this.#en.has(t)}}e.Metadata=n},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OptionalContentConfig=void 0;var r=i(1),n=i(170);let s=Symbol("INTERNAL");class a{#ea=!0;constructor(t,e){this.name=t,this.intent=e}get visible(){return this.#ea}_setVisible(t,e){t!==s&&(0,r.unreachable)("Internal method `_setVisible` called."),this.#ea=e}}class o{#eo=null;#el=new Map;#eh=null;#ed=null;constructor(t){if(this.name=null,this.creator=null,null===t)return;for(let e of(this.name=t.name,this.creator=t.creator,this.#ed=t.order,t.groups))this.#el.set(e.id,new a(e.name,e.intent));if("OFF"===t.baseState)for(let t of this.#el.values())t._setVisible(s,!1);for(let e of t.on)this.#el.get(e)._setVisible(s,!0);for(let e of t.off)this.#el.get(e)._setVisible(s,!1);this.#eh=this.getHash()}#ec(t){let e=t.length;if(e<2)return!0;let i=t[0];for(let n=1;n<e;n++){let e;let s=t[n];if(Array.isArray(s))e=this.#ec(s);else{if(!this.#el.has(s))return(0,r.warn)(`Optional content group not found: ${s}`),!0;e=this.#el.get(s).visible}switch(i){case"And":if(!e)return!1;break;case"Or":if(e)return!0;break;case"Not":return!e;default:return!0}}return"And"===i}isVisible(t){if(0===this.#el.size)return!0;if(!t)return(0,r.warn)("Optional content group not defined."),!0;if("OCG"===t.type)return this.#el.has(t.id)?this.#el.get(t.id).visible:((0,r.warn)(`Optional content group not found: ${t.id}`),!0);if("OCMD"===t.type){if(t.expression)return this.#ec(t.expression);if(t.policy&&"AnyOn"!==t.policy){if("AllOn"===t.policy){for(let e of t.ids){if(!this.#el.has(e)){(0,r.warn)(`Optional content group not found: ${e}`);break}if(!this.#el.get(e).visible)return!1}return!0}if("AnyOff"===t.policy){for(let e of t.ids){if(!this.#el.has(e))return(0,r.warn)(`Optional content group not found: ${e}`),!0;if(!this.#el.get(e).visible)return!0}return!1}if("AllOff"===t.policy){for(let e of t.ids){if(!this.#el.has(e)){(0,r.warn)(`Optional content group not found: ${e}`);break}if(this.#el.get(e).visible)return!1}return!0}}
2else{for(let e of t.ids){if(!this.#el.has(e))return(0,r.warn)(`Optional content group not found: ${e}`),!0;if(this.#el.get(e).visible)return!0}return!1}return(0,r.warn)(`Unknown optional content policy ${t.policy}.`),!0}return(0,r.warn)(`Unknown group type ${t.type}.`),!0}setVisibility(t){let e=!(arguments.length>1)||void 0===arguments[1]||arguments[1];if(!this.#el.has(t)){(0,r.warn)(`Optional content group not found: ${t}`);return}this.#el.get(t)._setVisible(s,!!e),this.#eo=null}get hasInitialVisibility(){return null===this.#eh||this.getHash()===this.#eh}getOrder(){return this.#el.size?this.#ed?this.#ed.slice():[...this.#el.keys()]:null}getGroups(){return this.#el.size>0?(0,r.objectFromMap)(this.#el):null}getGroup(t){return this.#el.get(t)||null}getHash(){if(null!==this.#eo)return this.#eo;let t=new n.MurmurHash3_64;for(let[e,i]of this.#el)t.update(`${e}:${i.visible}`);return this.#eo=t.hexdigest()}}e.OptionalContentConfig=o},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PDFDataTransportStream=void 0,i(93),i(101),i(102),i(105),i(107),i(109),i(113),i(116),i(123),i(89);var r=i(1),n=i(168);class s{constructor(t,e){let{length:i,initialData:n,progressiveDone:s=!1,contentDispositionFilename:a=null,disableRange:o=!1,disableStream:l=!1}=t;if((0,r.assert)(e,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=s,this._contentDispositionFilename=a,n?.length>0){let t=n instanceof Uint8Array&&n.byteLength===n.buffer.byteLength?n.buffer:new Uint8Array(n).buffer;this._queuedChunks.push(t)}this._pdfDataRangeTransport=e,this._isStreamingSupported=!l,this._isRangeSupported=!o,this._contentLength=i,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener((t,e)=>{this._onReceiveData({begin:t,chunk:e})}),this._pdfDataRangeTransport.addProgressListener((t,e)=>{this._onProgress({loaded:t,total:e})}),this._pdfDataRangeTransport.addProgressiveReadListener(t=>{this._onReceiveData({chunk:t})}),this._pdfDataRangeTransport.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),this._pdfDataRangeTransport.transportReady()}_onReceiveData(t){let{begin:e,chunk:i}=t,n=i instanceof Uint8Array&&i.byteLength===i.buffer.byteLength?i.buffer:new Uint8Array(i).buffer;if(void 0===e)this._fullRequestReader?this._fullRequestReader._enqueue(n):this._queuedChunks.push(n);else{let t=this._rangeReaders.some(function(t){return t._begin===e&&(t._enqueue(n),!0)});(0,r.assert)(t,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(t){void 0===t.total?this._rangeReaders[0]?.onProgress?.({loaded:t.loaded}):this._fullRequestReader?.onProgress?.({loaded:t.loaded,total:t.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){let e=this._rangeReaders.indexOf(t);e>=0&&this._rangeReaders.splice(e,1)}getFullReader(){(0,r.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 i=new o(this,t,e);return this._pdfDataRangeTransport.requestDataRange(t,e),this._rangeReaders.push(i),i}cancelAllRequests(t){for(let e of(this._fullRequestReader?.cancel(t),this._rangeReaders.slice(0)))e.cancel(t);this._pdfDataRangeTransport.abort()}}e.PDFDataTransportStream=s;class a{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;for(let s of(this._stream=t,this._done=i||!1,this._filename=(0,n.isPdfFile)(r)?r: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=new r.PromiseCapability;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,i){this._stream=t,this._begin=e,this._end=i,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=new r.PromiseCapability;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,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.PDFFetchStream=void 0,i(93),i(101),i(102),i(105),i(107),i(109),i(113),i(116),i(123),i(89);var r=i(1),n=i(182);function s(t,e,i){return{method:"GET",headers:t,signal:i.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function a(t){let e=new Headers;for(let i in t){let r=t[i];void 0!==r&&e.append(i,r)}return e}function o(t){return t instanceof Uint8Array?t.buffer:t instanceof ArrayBuffer?t:((0,r.warn)(`getArrayBuffer - unexpected data format: ${t}`),new Uint8Array(t).buffer)}class l{constructor(t){this.source=t,this.isHttp=/^https?:/i.test(t.url),this.httpHeaders=this.isHttp&&t.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return(0,r.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new h(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;let i=new d(this,t,e);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){for(let e of(this._fullRequestReader?.cancel(t),this._rangeRequestReaders.slice(0)))e.cancel(t)}}e.PDFFetchStream=l;class h{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=new r.PromiseCapability,this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange,this._headers=a(this._stream.httpHeaders);let i=e.url;fetch(i,s(this._headers,this._withCredentials,this._abortController)).then(t=>{if(!(0,n.validateResponseStatus)(t.status))throw(0,n.createResponseStatusError)(t.status,i);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 r.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?.({loaded:this._loaded,total:this._contentLength}),{value:o(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}class d{constructor(t,e,i){this._stream=t,this._reader=null,this._loaded=0;let o=t.source;this._withCredentials=o.withCredentials||!1,this._readCapability=new r.PromiseCapability,this._isStreamingSupported=!o.disableStream,this._abortController=new AbortController,this._headers=a(this._stream.httpHeaders),this._headers.append("Range",`bytes=${e}-${i-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?.({loaded:this._loaded}),{value:o(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}},(t,e,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.createResponseStatusError=l,e.extractFilenameFromHeader=o,e.validateRangeRequestCapabilities=a,e.validateResponseStatus=h;var r=i(1),n=i(183),s=i(168);function a(t){let{getResponseHeader:e,isHttp:i,rangeChunkSize:r,disableRange:n}=t,s={allowRangeRequests:!1,suggestedLength:void 0},a=parseInt(e("Content-Length"),10);return Number.isInteger(a)&&(s.suggestedLength=a,a<=2*r||n||!i||"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{}if((0,s.isPdfFile)(t))return t}return null}function l(t,e){return 404===t||0===t&&e.startsWith("file:")?new r.MissingPDFException('Missing PDF "'+e+'".'):new r.UnexpectedResponseException(`Unexpected server response (${t}) while retrieving PDF "${e}".`,t)}function h(t){return 200===t||206===t}},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getFilenameFromContentDispositionHeader=n,i(89),i(149);var r=i(1);function n(t){let e=!0,i=n("filename\\*","i").exec(t);if(i){let t=l(i=i[1]);return a(t=d(t=h(t=unescape(t))))}if(i=o(t))return a(d(i));if(i=n("filename","i").exec(t)){let t=l(i=i[1]);return a(t=d(t))}function n(t,e){return RegExp("(?:^|;)\\s*"+t+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',e)}function s(t,i){if(t){if(!/^[\x00-\xFF]+$/.test(i))return i;try{let n=new TextDecoder(t,{fatal:!0}),s=(0,r.stringToBytes)(i);i=n.decode(s),e=!1}catch{}}return i}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 i=[],r=n("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(e=r.exec(t));){let[,t,r,n]=e;if((t=parseInt(t,10))in i){if(0===t)break;continue}i[t]=[r,n]}let s=[];for(let t=0;t<i.length&&(t in i);++t){let[e,r]=i[t];r=l(r),e&&(r=unescape(r),0===t&&(r=h(r))),s.push(r)}return s.join("")}function l(t){if(t.startsWith('"')){let e=t.slice(1).split('\\"');for(let t=0;t<e.length;++t){let i=e[t].indexOf('"');-1!==i&&(e[t]=e[t].slice(0,i),e.length=t+1),e[t]=e[t].replaceAll(/\\(.)/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 d(t){return!t.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(t)?t:t.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(t,e,i,r){if("q"===i||"Q"===i)return s(e,r=(r=r.replaceAll("_"," ")).replaceAll(/=([0-9a-fA-F]{2})/g,function(t,e){return String.fromCharCode(parseInt(e,16))}));try{r=atob(r)}catch{}return s(e,r)})}return""}},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PDFNetworkStream=void 0,i(89);var r=i(1),n=i(182);let s=200,a=206;function o(t){let e=t.response;return"string"!=typeof e?e:(0,r.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.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(t,e,i){let r={begin:t,end:e};for(let t in i)r[t]=i[t];return this.request(r)}requestFull(t){return this.request(t)}request(t){let e=new XMLHttpRequest,i=this.currXhrId++,r=this.pendingRequests[i]={xhr:e};for(let t in e.open("GET",this.url),e.withCredentials=this.withCredentials,this.httpHeaders){let i=this.httpHeaders[t];void 0!==i&&e.setRequestHeader(t,i)}return this.isHttp&&"begin"in t&&"end"in t?(e.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`),r.expectedStatus=a):r.expectedStatus=s,e.responseType="arraybuffer",t.onError&&(e.onerror=function(i){t.onError(e.status)}),e.onreadystatechange=this.onStateChange.bind(this,i),e.onprogress=this.onProgress.bind(this,i),r.onHeadersReceived=t.onHeadersReceived,r.onDone=t.onDone,r.onError=t.onError,r.onProgress=t.onProgress,e.send(null),i}onProgress(t,e){let i=this.pendingRequests[t];i&&i.onProgress?.(e)}onStateChange(t,e){let i=this.pendingRequests[t];if(!i)return;let r=i.xhr;if(r.readyState>
2=2&&i.onHeadersReceived&&(i.onHeadersReceived(),delete i.onHeadersReceived),4!==r.readyState||!(t in this.pendingRequests))return;if(delete this.pendingRequests[t],0===r.status&&this.isHttp){i.onError?.(r.status);return}let n=r.status||s;if(!(n===s&&i.expectedStatus===a)&&n!==i.expectedStatus){i.onError?.(r.status);return}let l=o(r);if(n===a){let t=r.getResponseHeader("Content-Range"),e=/bytes (\d+)-(\d+)\/(\d+)/.exec(t);i.onDone({begin:parseInt(e[1],10),chunk:l})}else l?i.onDone({begin:0,chunk:l}):i.onError?.(r.status)}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(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,r.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new d(this._manager,this._source),this._fullRequestReader}getRangeReader(t,e){let i=new c(this._manager,t,e);return i.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(i),i}cancelAllRequests(t){for(let e of(this._fullRequestReader?.cancel(t),this._rangeRequestReaders.slice(0)))e.cancel(t)}}e.PDFNetworkStream=h;class d{constructor(t,e){this._manager=t;let i={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(i),this._headersReceivedCapability=new r.PromiseCapability,this._disableRange=e.disableRange||!1,this._contentLength=e.length,this._rangeChunkSize=e.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){let t=this._fullRequestId,e=this._manager.getRequestXhr(t),i=t=>e.getResponseHeader(t),{allowRangeRequests:r,suggestedLength:s}=(0,n.validateRangeRequestCapabilities)({getResponseHeader:i,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});r&&(this._isRangeSupported=!0),this._contentLength=s||this._contentLength,this._filename=(0,n.extractFilenameFromHeader)(i),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){this.onProgress?.({loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};let t=new r.PromiseCapability;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
2(this._fullRequestId),this._fullRequestReader=null}}class c{constructor(t,e,i){this._manager=t;let r={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url,this._requestId=t.requestRange(e,i,r),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){this.onClosed?.(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){this.isStreamingSupported||this.onProgress?.({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=new r.PromiseCapability;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(this._requestId),this._close()}}},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PDFNodeStream=void 0,i(89),i(93),i(101),i(102),i(105),i(107),i(109),i(113),i(116),i(123);var r=i(1),n=i(182);let s=/^file:\/\/\/[a-zA-Z]:\//;function a(t){let e=__webpack_require__(15099),i=e.parse(t);return"file:"===i.protocol||i.host?i:/^[a-z]:[/\\]/i.test(t)?e.parse(`file:///${t}`):(i.host||(i.protocol="file:"),i)}class o{constructor(t){this.source=t,this.url=a(t.url),this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol,this.isFsUrl="file:"===this.url.protocol,this.httpHeaders=this.isHttp&&t.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return(0,r.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new p(this):new c(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;let i=this.isFsUrl?new f(this,t,e):new u(this,t,e);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){for(let e of(this._fullRequestReader?.cancel(t),this._rangeRequestReaders.slice(0)))e.cancel(t)}}e.PDFNodeStream=o;class l{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=new r.PromiseCapability,this._headersCapability=new r.PromiseCapability}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;let t=this._readableStream.read();return null===t?(this._readCapability=new r.PromiseCapability,this.read()):(this._loaded+=t.length,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 r.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class h{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=new r.PromiseCapability;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=new r.PromiseCapability,this.read()):(this._loaded+=t.length,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 d(t,e){return{protocol:t.protocol,auth:t.auth,host:t.hostname,port:t.port,path:t.path,method:"GET",headers:e}}class c extends l{constructor(t){super(t);let e=e=>{if(404===e.statusCode){let t=new r.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=t,this._headersCapability.reject(t);return}this._headersCapability.resolve(),this._setReadableStream(e);let i=t=>this._readableStream.headers[t.toLowerCase()],{allowRangeRequests:s,suggestedLength:a}=(0,n.validateRangeRequestCapabilities)({getResponseHeader:i,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=s,this._contentLength=a||this._contentLength,this._filename=(0,n.extractFilenameFromHeader)(i)};if(this._request=null,"http:"===this._url.protocol){let i=__webpack_require__(60268);this._request=i.request(d(this._url,t.httpHeaders),e)}else{let i=__webpack_require__(75655);this._request=i.request(d(this._url,t.httpHeaders),e)}this._request.on("error",t=>{this._storedError=t,this._headersCapability.reject(t)}),this._request.end()}}class u extends h{constructor(t,e,i){for(let e in super(t),this._httpHeaders={},t.httpHeaders){let i=t.httpHeaders[e];void 0!==i&&(this._httpHeaders[e]=i)}this._httpHeaders.Range=`bytes=${e}-${i-1}`;let n=t=>{if(404===t.statusCode){let t=new r.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=t;return}this._setReadableStream(t)};if(this._request=null,"http:"===this._url.protocol){let t=__webpack_require__(60268);this._request=t.request(d(this._url,this._httpHeaders),n)}else{let t=__webpack_require__(75655);this._request=t.request(d(this._url,this._httpHeaders),n)}this._request.on("error",t=>{this._storedError=t}),this._request.end()}}class p extends l{constructor(t){super(t);let e=decodeURIComponent(this._url.path);s.test(this._url.href)&&(e=e.replace(/^\//,""));let i=__webpack_require__(59462);i.lstat(e,(t,n)=>{if(t){"ENOENT"===t.code&&(t=new r.MissingPDFException(`Missing PDF "${e}".`)),this._storedError=t,this._headersCapability.reject(t);return}this._contentLength=n.size,this._setReadableStream(i.createReadStream(e)),this._headersCapability.resolve()})}}class f extends h{constructor(t,e,i){super(t);let r=decodeURIComponent(this._url.path);s.test(this._url.href)&&(r=r.replace(/^\//,""));let n=__webpack_require__(59462);this._setReadableStream(n.createReadStream(r,{start:e,end:i-1}))}}},(t,e,i)=>
2{Object.defineProperty(e,"__esModule",{value:!0}),e.SVGGraphics=void 0,i(84),i(86),i(87),i(93),i(101),i(102),i(105),i(107),i(109),i(113),i(116),i(123),i(2),i(89),i(187);var r=i(168),n=i(1);let s={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},a="http://www.w3.org/XML/1998/namespace",o="http://www.w3.org/1999/xlink",l=["butt","round","square"],h=["miter","round","bevel"],d=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(URL.createObjectURL&&"undefined"!=typeof Blob&&!i)return URL.createObjectURL(new Blob([t],{type:e}));let r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n=`data:${e};base64,`;for(let e=0,i=t.length;e<i;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,d=e+1<i?(15&a)<<2|o>>6:64,c=e+2<i?63&o:64;n+=r[l]+r[h]+r[d]+r[c]}return n},c=function(){let t=new Uint8Array([137,80,78,71,13,10,26,10]),e=12,i=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;i[t]=e}function r(t,e,r){let n=-1;for(let s=e;s<r;s++){let e=i[(n^t[s])&255];n=n>>>8^e}return -1^n}function s(t,e,i,n){let s=n,a=e.length;i[s]=a>>24&255,i[s+1]=a>>16&255,i[s+2]=a>>8&255,i[s+3]=255&a,i[s+=4]=255&t.charCodeAt(0),i[s+1]=255&t.charCodeAt(1),i[s+2]=255&t.charCodeAt(2),i[s+3]=255&t.charCodeAt(3),s+=4,i.set(e,s);let o=r(i,n+4,s+=e.length);i[s]=o>>24&255,i[s+1]=o>>16&255,i[s+2]=o>>8&255,i[s+3]=255&o}function a(t,e,i){let r=1,n=0;for(let s=e;s<i;++s)n=(n+(r=(r+(255&t[s]))%65521))%65521;return n<<16|r}function o(t){if(!n.isNodeJS)return l(t);try{let e=parseInt(process.versions.node)>=8?t:Buffer.from(t),i=__webpack_require__(24499).deflateSync(e,{level:9});return i instanceof Uint8Array?i:new Uint8Array(i)}catch(t){(0,n.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+t)}return l(t)}function l(t){let e=t.length,i=65535,r=Math.ceil(e/65535),n=new Uint8Array(2+e+5*r+4),s=0;n[s++]=120,n[s++]=156;let o=0;for(;e>i;)n[s++]=0,n[s++]=255,n[s++]=255,n[s++]=0,n[s++]=0,n.set(t.subarray(o,o+i),s),s+=i,o+=i,e-=i;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(o),s),s+=t.length-o;let l=a(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 h(i,r,a,l){let h,c,u;let p=i.width,f=i.height,g=i.data;switch(r){case n.ImageKind.GRAYSCALE_1BPP:c=0,h=1,u=p+7>>3;break;case n.ImageKind.RGB_24BPP:c=2,h=8,u=3*p;break;case n.ImageKind.RGBA_32BPP:c=6,h=8,u=4*p;break;default:throw Error("invalid format")}let m=new Uint8Array((1+u)*f),b=0,v=0;for(let t=0;t<f;++t)m[b++]=0,m.set(g.subarray(v,v+u),b),v+=u,b+=u;if(r===n.ImageKind.GRAYSCALE_1BPP&&l){b=0;for(let t=0;t<f;t++){b++;for(let t=0;t<u;t++)m[b++]^=255}}let A=new Uint8Array([p>>24&255,p>>16&255,p>>8&255,255&p,f>>24&255,f>>16&255,f>>8&255,255&f,h,c,0,0,0]),y=o(m),_=new Uint8Array(t.length+3*e+A.length+y.length),S=0;return _.set(t,S),s("IHDR",A,_,S+=t.length),s("IDATA",y,_,S+=e+A.length),S+=e+y.length,s("IEND",new Uint8Array(0),_,S),d(_,"image/png",a)}return function(t,e,i){let r=void 0===t.kind?n.ImageKind.GRAYSCALE_1BPP:t.kind;return h(t,r,e,i)}}();class u{constructor(){this.fontSizeScale=1,this.fontWeight=s.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=s.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 p(t){let e=[],i=[];for(let r of t){if("save"===r.fn){e.push({fnId:92,fn:"group",items:[]}),i.push(e),e=e.at(-1).items;continue}"restore"===r.fn?e=i.pop():e.push(r)}return e}function f(t){if(Number.isInteger(t))return t.toString();let e=t.toFixed(10),i=e.length-1;if("0"!==e[i])return e;do i--;while("0"===e[i]);return e.substring(0,"."===e[i]?i:i+1)}function g(t){if(0===t[4]&&0===t[5]){if(0===t[1]&&0===t[2])return 1===t[0]&&1===t[3]?""
2:`scale(${f(t[0])} ${f(t[3])})`;if(t[0]===t[3]&&t[1]===-t[2]){let e=180*Math.acos(t[0])/Math.PI;return`rotate(${f(e)})`}}else if(1===t[0]&&0===t[1]&&0===t[2]&&1===t[3])return`translate(${f(t[4])} ${f(t[5])})`;return`matrix(${f(t[0])} ${f(t[1])} ${f(t[2])} ${f(t[3])} ${f(t[4])} ${f(t[5])})`}let m=0,b=0,v=0;class A{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];for(let s in(0,r.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future."),this.svgFactory=new r.DOMSVGFactory,this.current=new u,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=!!i,this._operatorIdMapping=[],n.OPS)this._operatorIdMapping[n.OPS[s]]=s}getObject(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return"string"==typeof t?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):e}save(){this.transformStack.push(this.transformMatrix);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,i=t.argsArray;for(let t=0,r=e.length;t<r;t++)if(e[t]===n.OPS.dependency)for(let e of i[t]){let t=e.startsWith("g_")?this.commonObjs:this.objs,i=new Promise(i=>{t.get(e,i)});this.current.dependencies.push(i)}return Promise.all(this.current.dependencies)}transform(t,e,i,r,s,a){let o=[t,e,i,r,s,a];this.transformMatrix=n.Util.transform(this.transformMatrix,o),this.tgrp=null}getSVG(t,e){this.viewport=e;let i=this._initialize(e);return this.loadDependencies(t).then(()=>(this.transformMatrix=n.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(t)),i))}convertOpList(t){let e=this._operatorIdMapping,i=t.argsArray,r=t.fnArray,n=[];for(let t=0,s=r.length;t<s;t++){let s=r[t];n.push({fnId:s,fn:e[s],args:i[t]})}return p(n)}executeOpTree(t){for(let e of t){let t=e.fn,i=e.fnId,r=e.args;switch(0|i){case n.OPS.beginText:this.beginText();break;case n.OPS.dependency:break;case n.OPS.setLeading:this.setLeading(r);break;case n.OPS.setLeadingMoveText:this.setLeadingMoveText(r[0],r[1]);break;case n.OPS.setFont:this.setFont(r);break;case n.OPS.showText:case n.OPS.showSpacedText:this.showText(r[0]);break;case n.OPS.endText:this.endText();break;case n.OPS.moveText:this.moveText(r[0],r[1]);break;case n.OPS.setCharSpacing:this.setCharSpacing(r[0]);break;case n.OPS.setWordSpacing:this.setWordSpacing(r[0]);break;case n.OPS.setHScale:this.setHScale(r[0]);break;case n.OPS.setTextMatrix:this.setTextMatrix(r[0],r[1],r[2],r[3],r[4],r[5]);break;case n.OPS.setTextRise:this.setTextRise(r[0]);break;case n.OPS.setTextRenderingMode:this.setTextRenderingMode(r[0]);break;case n.OPS.setLineWidth:this.setLineWidth(r[0]);break;case n.OPS.setLineJoin:this.setLineJoin(r[0]);break;case n.OPS.setLineCap:this.setLineCap(r[0]);break;case n.OPS.setMiterLimit:this.setMiterLimit(r[0]);break;case n.OPS.setFillRGBColor:this.setFillRGBColor(r[0],r[1],r[2]);break;case n.OPS.setStrokeRGBColor:this.setStrokeRGBColor(r[0],r[1],r[2]);break;case n.OPS.setStrokeColorN:this.setStrokeColorN(r);break;case n.OPS.setFillColorN:this.setFillColorN(r);break;case n.OPS.shadingFill:this.shadingFill(r[0]);break;case n.OPS.setDash:this.setDash(r[0],r[1]);break;case n.OPS.setRenderingIntent:this.setRenderingIntent(r[0]);break;case n.OPS.setFlatness:this.setFlatness(r[0]);break;case n.OPS.setGState:this.setGState(r[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(r[0]);break;case n.OPS.paintInlineImageXObject:this.paintInlineImageXObject(r[0]);break;case n.OPS.paintImageMaskXObject:this.paintImageMaskXObject(r[0]);break;case n.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(r[0],r[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(r[0],r[1],r[2],r[3],r[4],r[5]);break;case n.OPS.constructPath:this.constructPath(r[0],r[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,i,r,n,s){let a=this.current;a.textMatrix=a.lineMatrix=[t,e,i,r,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",`${f(a.fontSize)}px`),a.tspan.setAttributeNS(null,"y",f(-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 i=this.current;i.x=i.lineX+=t,i.y=i.lineY+=e,i.xcoords=[],i.ycoords=[],i.tspan=this.svgFactory.createElement("svg:tspan"),i.tspan.setAttributeNS(null,"font-family",
2i.fontFamily),i.tspan.setAttributeNS(null,"font-size",`${f(i.fontSize)}px`),i.tspan.setAttributeNS(null,"y",f(-i.y))}showText(t){let e=this.current,i=e.font,r=e.fontSize;if(0===r)return;let o=e.fontSizeScale,l=e.charSpacing,h=e.wordSpacing,d=e.fontDirection,c=e.textHScale*d,u=i.vertical,p=u?1:-1,m=i.defaultVMetrics,b=r*e.fontMatrix[0],v=0;for(let n of t){let t,s;if(null===n){v+=d*h;continue}if("number"==typeof n){v+=p*n*r/1e3;continue}let a=(n.isSpace?h:0)+l,c=n.fontChar,f=n.width;if(u){let e;let i=n.vmetric||m;e=-(e=n.vmetric?i[1]:.5*f)*b;let r=i[2]*b;f=i?-i[0]:f,t=e/o,s=(v+r)/o}else t=v/o,s=0;(n.isInFont||i.missingFile)&&(e.xcoords.push(e.x+t),u&&e.ycoords.push(-e.y+s),e.tspan.textContent+=c),v+=u?f*b-a*d:f*b+a*d}e.tspan.setAttributeNS(null,"x",e.xcoords.map(f).join(" ")),u?e.tspan.setAttributeNS(null,"y",e.ycoords.map(f).join(" ")):e.tspan.setAttributeNS(null,"y",f(-e.y)),u?e.y-=v:e.x+=v*c,e.tspan.setAttributeNS(null,"font-family",e.fontFamily),e.tspan.setAttributeNS(null,"font-size",`${f(e.fontSize)}px`),e.fontStyle!==s.fontStyle&&e.tspan.setAttributeNS(null,"font-style",e.fontStyle),e.fontWeight!==s.fontWeight&&e.tspan.setAttributeNS(null,"font-weight",e.fontWeight);let A=e.textRenderingMode&n.TextRenderingMode.FILL_STROKE_MASK;if(A===n.TextRenderingMode.FILL||A===n.TextRenderingMode.FILL_STROKE?(e.fillColor!==s.fillColor&&e.tspan.setAttributeNS(null,"fill",e.fillColor),e.fillAlpha<1&&e.tspan.setAttributeNS(null,"fill-opacity",e.fillAlpha)):e.textRenderingMode===n.TextRenderingMode.ADD_TO_PATH?e.tspan.setAttributeNS(null,"fill","transparent"):e.tspan.setAttributeNS(null,"fill","none"),A===n.TextRenderingMode.STROKE||A===n.TextRenderingMode.FILL_STROKE){let t=1/(e.textMatrixScale||1);this._setStrokeAttributes(e.tspan,t)}let y=e.textMatrix;0!==e.textRise&&(y=y.slice(),y[5]+=e.textRise),e.txtElement.setAttributeNS(null,"transform",`${g(y)} scale(${f(c)}, -1)`),e.txtElement.setAttributeNS(a,"xml:space","preserve"),e.txtElement.append(e.tspan),e.txtgrp.append(e.txtElement),this._ensureTransformGroup().append(e.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=d(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,i=this.commonObjs.get(t[0]),r=t[1];e.font=i,!this.embedFonts||i.missingFile||this.embeddedFonts[i.loadedName]||(this.addFontStyle(i),this.embeddedFonts[i.loadedName]=i),e.fontMatrix=i.fontMatrix||n.FONT_IDENTITY_MATRIX;let s="normal";i.black?s="900":i.bold&&(s="bold");let a=i.italic?"italic":"normal";r<0?(r=-r,e.fontDirection=-1):e.fontDirection=1,e.fontSize=r,e.fontFamily=i.loadedName,e.fontWeight=s,e.fontStyle=a,e.tspan=this.svgFactory.createElement("svg:tspan"),e.tspan.setAttributeNS(null,"y",f(-e.y)),e.xcoords=[],e.ycoords=[]}endText(){let t=this.current;t.textRenderingMode&n.TextRenderingMode.ADD_TO_PATH_FLAG&&t.txtElement?.hasChildNodes()&&(t.element=t.txtElement,this.clip("nonzero"),this.endPath())}setLineWidth(t){t>0&&(this.current.lineWidth=t)}setLineCap(t){this.current.lineCap=l[t]}setLineJoin(t){this.current.lineJoin=h[t]}setMiterLimit(t){this.current.miterLimit=t}setStrokeAlpha(t){this.current.strokeAlpha=t}setStrokeRGBColor(t,e,i){this.current.strokeColor=n.Util.makeHexColor(t,e,i)}setFillAlpha(t){this.current.fillAlpha=t}setFillRGBColor(t,e,i){this.current.fillColor=n.Util.makeHexColor(t,e,i),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{width:e,height:i}=this.viewport,r=n.Util.inverseTransform(this.transformMatrix),[s,a,o,l]=n.Util.getAxialAlignedBoundingBox([0,0,e,i],r),h=this.svgFactory.createElement("svg:rect");h.setAttributeNS(null,"x",s),h.setAttributeNS(null,"y",a),h.setAttributeNS(null,"width",o-s),h.setAttributeNS(null,"height",l-a),h.setAttributeNS(null,"fill",this._makeShadingPattern(t)),this.current.fillAlpha<1&&h.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(h)}_makeColorN_Pattern(t){return"TilingPattern"===t[0]?this._makeTilingPattern(t):this._makeShadingPattern(t)}_makeTilingPattern(t){let e=t[1],i=t[2],r=t[3]||n.IDENTITY_MATRIX,[s,a,o,l]=t[4],h=t[5],d=t[6],c=t[7],u=`shading${v++}`,[p,f,g,m]=n.Util.normalizeRect([...n.Util.applyTransform([s,a],r),...n.Util.applyTransform([o,l],r)]),[b,A]=n.Util.singularValueDecompose2dScale(r),y=h*b,_=d*A,S=this.svgFactory.createElement("svg:pattern");S.setAttributeNS(null,"id",u),S.setAttributeNS(null,"patternUnits","userSpaceOnUse"),S.setAttributeNS(null,"width",y),S.setAttributeNS(null,"height",_),S.setAttributeNS(null,"x",`${p}`),S.setAttributeNS(null,"y",`${f}`);let E=this.svg,x=this.transformMatrix,w=this.current.fillColor,C=this.current.strokeColor,T=this.svgFactory.create(g-p,m-f);if(this.svg=T,this.transformMatrix=r,2===c){let t=n.Util.makeHexColor(...e);this.current.fillColor=t,this.current.strokeColor=t}return this.executeOpTree(this.convertOpList(i)),this.svg=E,this.transformMatrix=x,this.current.fillColor=w,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 i=`shading${v++}`,r=t[3];switch(t[1]){case"axial":let s=t[4],a=t[5];(e=this.svgFactory.createElement("svg:linearGradient")).setAttributeNS(null,"id",i),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],d=t[7];(e=this.svgFactory.createElement("svg:radialGradient")).setAttributeNS(null,"id",i),e.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),e.setAttributeNS(null,"cx",l[0]),e.setAttributeNS(null,"cy",l[1]),e.setAttributeNS(null,"r",d),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 r){let i=this.svgFactory.createElement("svg:stop");
3i.setAttributeNS(null,"offset",t[0]),i.setAttributeNS(null,"stop-color",t[1]),e.append(i)}return this.defs.append(e),`url(#${i})`;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 i=this.current,r=i.x,s=i.y,a=[],o=0;for(let i of t)switch(0|i){case n.OPS.rectangle:r=e[o++],s=e[o++];let t=e[o++],l=e[o++],h=r+t,d=s+l;a.push("M",f(r),f(s),"L",f(h),f(s),"L",f(h),f(d),"L",f(r),f(d),"Z");break;case n.OPS.moveTo:r=e[o++],s=e[o++],a.push("M",f(r),f(s));break;case n.OPS.lineTo:r=e[o++],s=e[o++],a.push("L",f(r),f(s));break;case n.OPS.curveTo:r=e[o+4],s=e[o+5],a.push("C",f(e[o]),f(e[o+1]),f(e[o+2]),f(e[o+3]),f(r),f(s)),o+=6;break;case n.OPS.curveTo2:a.push("C",f(r),f(s),f(e[o]),f(e[o+1]),f(e[o+2]),f(e[o+3])),r=e[o+2],s=e[o+3],o+=4;break;case n.OPS.curveTo3:r=e[o+2],s=e[o+3],a.push("C",f(e[o]),f(e[o+1]),f(r),f(s),f(r),f(s)),o+=4;break;case n.OPS.closePath:a.push("Z")}a=a.join(" "),i.path&&t.length>0&&t[0]!==n.OPS.rectangle&&t[0]!==n.OPS.moveTo?a=i.path.getAttributeNS(null,"d")+a:(i.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().append(i.path)),i.path.setAttributeNS(null,"d",a),i.path.setAttributeNS(null,"fill","none"),i.element=i.path,i.setCurrentPoint(r,s)}endPath(){let t=this.current;if(t.path=null,!this.pendingClip)return;if(!t.element){this.pendingClip=null;return}let e=`clippath${m++}`,i=this.svgFactory.createElement("svg:clipPath");i.setAttributeNS(null,"id",e),i.setAttributeNS(null,"transform",g(this.transformMatrix));let r=t.element.cloneNode(!0);if("evenodd"===this.pendingClip?r.setAttributeNS(null,"clip-rule","evenodd"):r.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,i.append(r),this.defs.append(i),t.activeClipUrl){for(let e of(t.clipGroup=null,this.extraStack))e.clipGroup=null;i.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,i]of t)switch(e){case"LW":this.setLineWidth(i);break;case"LC":this.setLineCap(i);break;case"LJ":this.setLineJoin(i);break;case"ML":this.setMiterLimit(i);break;case"D":this.setDash(i[0],i[1]);break;case"RI":this.setRenderingIntent(i);break;case"FL":this.setFlatness(i);break;case"Font":this.setFont(i);break;case"CA":this.setStrokeAlpha(i);break;case"ca":this.setFillAlpha(i);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,i=this.current,r=i.dashArray;1!==e&&r.length>0&&(r=r.map(function(t){return e*t})),t.setAttributeNS(null,"stroke",i.strokeColor),t.setAttributeNS(null,"stroke-opacity",i.strokeAlpha),t.setAttributeNS(null,"stroke-miterlimit",f(i.miterLimit)),t.setAttributeNS(null,"stroke-linecap",i.lineCap),t.setAttributeNS(null,"stroke-linejoin",i.lineJoin),t.setAttributeNS(null,"stroke-width",f(e*i.lineWidth)+"px"),t.setAttributeNS(null,"stroke-dasharray",r.map(f).join(" ")),t.setAttributeNS(null,"stroke-dashoffset",f(e*i.dashPhase)+"px")}eoFill(){this.current.element?.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){this.current.element?.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}closeStroke(){this.closePath(),this.stroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.closePath(),this.eoFillStroke()}paintSolidColorImageMask(){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=this.getObject(t);if(!e){(0,n.warn)(`Dependent image with object ID ${t} is not ready yet`);return}this.paintInlineImageXObject(e)}paintInlineImageXObject(t,e){let i=t.width,r=t.height,n=c(t,this.forceDataSchema,!!e),s=this.svgFactory.createElement("svg:rect");s.setAttributeNS(null,"x","0"),s.setAttributeNS(null,"y","0"),s.setAttributeNS(null,"width",f(i)),s.setAttributeNS(null,"height",f(r)),this.current.element=s,this.clip("nonzero");let a=this.svgFactory.createElement("svg:image");a.setAttributeNS(o,"xlink:href",n),a.setAttributeNS(null,"x","0"),a.setAttributeNS(null,"y",f(-r)),a.setAttributeNS(null,"width",f(i)+"px"),a.setAttributeNS(null,"height",f(r)+"px"),a.setAttributeNS(null,"transform",`scale(${f(1/i)} ${f(-1/r)})`),e?e.append(a):this._ensureTransformGroup().append(a)}paintImageMaskXObject(t){let e=this.getObject(t.data,t);if(e.bitmap){(0,n.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled.");return}
3let i=this.current,r=e.width,s=e.height,a=i.fillColor;i.maskId=`mask${b++}`;let o=this.svgFactory.createElement("svg:mask");o.setAttributeNS(null,"id",i.maskId);let l=this.svgFactory.createElement("svg:rect");l.setAttributeNS(null,"x","0"),l.setAttributeNS(null,"y","0"),l.setAttributeNS(null,"width",f(r)),l.setAttributeNS(null,"height",f(s)),l.setAttributeNS(null,"fill",a),l.setAttributeNS(null,"mask",`url(#${i.maskId})`),this.defs.append(o),this._ensureTransformGroup().append(l),this.paintInlineImageXObject(e,o)}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],i=e[3]-e[1],r=this.svgFactory.createElement("svg:rect");r.setAttributeNS(null,"x",e[0]),r.setAttributeNS(null,"y",e[1]),r.setAttributeNS(null,"width",f(t)),r.setAttributeNS(null,"height",f(i)),this.current.element=r,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(t){let e=this.svgFactory.create(t.width,t.height),i=this.svgFactory.createElement("svg:defs");e.append(i),this.defs=i;let r=this.svgFactory.createElement("svg:g");return r.setAttributeNS(null,"transform",g(t.transform)),e.append(r),this.svg=r,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",g(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().append(this.tgrp):this.svg.append(this.tgrp)),this.tgrp}}e.SVGGraphics=A},(t,e,i)=>{var r=i(3),n=i(188),s=i(193);r({target:"Array",proto:!0},{group:function(t){var e=arguments.length>1?arguments[1]:void 0;return n(this,t,e)}}),s("group")},(t,e,i)=>{var r=i(99),n=i(14),s=i(13),a=i(40),o=i(18),l=i(64),h=i(189),d=i(108),c=Array,u=n([].push);t.exports=function(t,e,i,n){for(var p,f,g,m=a(t),b=s(m),v=r(e,i),A=h(null),y=l(b),_=0;y>_;_++)(f=o(v(g=b[_],_,m)))in A?u(A[f],g):A[f]=[g];if(n&&(p=n(m))!==c)for(f in A)A[f]=d(p,A[f]);return A}},(t,e,i)=>{var r,n=i(47),s=i(190),a=i(66),o=i(55),l=i(192),h=i(43),d=i(54),c=">",u="<",p="prototype",f="script",g=d("IE_PROTO"),m=function(){},b=function(t){return u+f+c+t+u+"/"+f+c},v=function(t){t.write(b("")),t.close();var e=t.parentWindow.Object;return t=null,e},A=function(){var t,e=h("iframe"),i="java"+f+":";return e.style.display="none",l.appendChild(e),e.src=String(i),(t=e.contentWindow.document).open(),t.write(b("document.F=Object")),t.close(),t.F},y=function(){try{r=new ActiveXObject("htmlfile")}catch(t){}y="undefined"!=typeof document?document.domain&&r?v(r):A():v(r);for(var t=a.length;t--;)delete y[p][a[t]];return y()};o[g]=!0,t.exports=Object.create||function(t,e){var i;return null!==t?(m[p]=n(t),i=new m,m[p]=null,i[g]=t):i=y(),void 0===e?i:s.f(i,e)}},(t,e,i)=>{var r=i(6),n=i(46),s=i(45),a=i(47),o=i(12),l=i(191);e.f=r&&!n?Object.defineProperties:function(t,e){a(t);for(var i,r=o(e),n=l(e),h=n.length,d=0;h>d;)s.f(t,i=n[d++],r[i]);return t}},(t,e,i)=>{var r=i(59),n=i(66);t.exports=Object.keys||function(t){return r(t,n)}},(t,e,i)=>{var r=i(24);t.exports=r("document","documentElement")},(t,e,i)=>{var r=i(34),n=i(189),s=i(45).f,a=r("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,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.XfaText=void 0,i(89);class r{static textContent(t){let e=[],i={items:e,styles:Object.create(null)};function n(t){if(!t)return;let i=null,s=t.name;if("#text"===s)i=t.value;else{if(!r.shouldBuildText(s))return;t?.attributes?.textContent?i=t.attributes.textContent:t.value&&(i=t.value)}if(null!==i&&e.push({str:i}),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,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TextLayerRenderTask=void 0,e.renderTextLayer=g,e.updateTextLayer=m,i(89),i(2);var r=i(1),n=i(168);let s=1e5,a=30,o=.8,l=new Map;function h(t,e){let i;if(e&&r.FeatureTest.isOffscreenCanvasSupported)i=new OffscreenCanvas(t,t).getContext("2d",{alpha:!1});else{let e=document.createElement("canvas");e.width=e.height=t,i=e.getContext("2d",{alpha:!1})}return i}function d(t,e){let i=l.get(t);if(i)return i;let r=h(a,e);r.font=`${a}px ${t}`;let n=r.measureText(""),s=n.fontBoundingBoxAscent,d=Math.abs(n.fontBoundingBoxDescent);if(s){let e=s/(s+d);return l.set(t,e),r.canvas.width=r.canvas.height=0,e}r.strokeStyle="red",r.clearRect(0,0,a,a),r.strokeText("g",0,0);let c=r.getImageData(0,0,a,a).data;d=0;for(let t=c.length-1-3;t>=0;t-=4)if(c[t]>0){d=Math.ceil(t/4/a);break}r.clearRect(0,0,a,a),r.strokeText("A",0,a),c=r.getImageData(0,0,a,a).data,s=0;for(let t=0,e=c.length;t<e;t+=4)if(c[t]>0){s=a-Math.floor(t/4/a);break}if(r.canvas.width=r.canvas.height=0,s){let e=s/(s+d);return l.set(t,e),e}return l.set(t,o),o}function c(t,e,i){let n,s;let a=document.createElement("span"),o={angle:0,canvasWidth:0,hasText:""!==e.str,hasEOL:e.hasEOL,fontSize:0};t._textDivs.push(a);let l=r.Util.transform(t._transform,e.transform),h=Math.atan2(l[1],l[0]),c=i[e.fontName];c.vertical&&(h+=Math.PI/2);let u=Math.hypot(l[2],l[3]),p=u*d(c.fontFamily,t._isOffscreenCanvasSupported);0===h?(n=l[4],s=l[5]-p):(n=l[4]+p*Math.sin(h),s=l[5]-p*Math.cos(h));let f="calc(var(--scale-factor)*",g=a.style;t._container===t._rootContainer?(g.left=`${(100*n/t._pageWidth).toFixed(2)}%`,g.top=`${(100*s/t._pageHeight).toFixed(2)}%`):(g.left=`${f}${n.toFixed(2)}px)`,g.top=`${f}${s.toFixed(2)}px)`),g.fontSize=`${f}${u.toFixed(2)}px)`,g.fontFamily=c.fontFamily,o.fontSize=u,a.setAttribute("role","presentation"),a.textContent=e.str,a.dir=e.dir,t._fontInspectorEnabled&&(a.dataset.fontName=e.fontName),0!==h&&(o.angle=180/Math.PI*h);let m=!1;if(e.str.length>1)m=!0;else if(" "!==e.str&&e.transform[0]!==e.transform[3]){let t=Math.abs(e.transform[0]),i=Math.abs(e.transform[3]);t!==i&&Math.max(t,i)/Math.min(t,i)>1.5&&(m=!0)}m&&(o.canvasWidth=c.vertical?e.height:e.width),t._textDivProperties.set(a,o),t._isReadableStream&&t._layoutText(a)}function u(t){let{div:e,scale:i,properties:r,ctx:n,prevFontSize:s,prevFontFamily:a}=t,{style:o}=e,l="";if(0!==r.canvasWidth&&r.hasText){let{fontFamily:h}=o,{canvasWidth:d,fontSize:c}=r;(s!==c||a!==h)&&(n.font=`${c*i}px ${h}`,t.prevFontSize=c,t.prevFontFamily=h);let{width:u}=n.measureText(e.textContent);u>0&&(l=`scaleX(${d*i/u})`)}0!==r.angle&&(l=`rotate(${r.angle}deg) ${l}`),l.length>0&&(o.transform=l)}function p(t){if(t._canceled)return;let e=t._textDivs,i=t._capability;if(e.length>s){i.resolve();return}if(!t._isReadableStream)for(let i of e)t._layoutText(i);i.resolve()}class f{constructor(t){let{textContentSource:e,container:i,viewport:s,textDivs:a,textDivProperties:o,textContentItemsStr:l,isOffscreenCanvasSupported:d}=t;this._textContentSource=e,this._isReadableStream=e instanceof ReadableStream,this._container=this._rootContainer=i,this._textDivs=a||[],this._textContentItemsStr=l||[],this._isOffscreenCanvasSupported=d,this._fontInspectorEnabled=!!globalThis.FontInspector?.enabled,this._reader=null,this._textDivProperties=o||new WeakMap,this._canceled=!1,this._capability=new r.PromiseCapability,this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:s.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:h(0,d)};let{pageWidth:c,pageHeight:u,pageX:p,pageY:f}=s.rawDims;this._transform=[1,0,0,-1,-p,f+u],this._pageWidth=c,this._pageHeight=u,(0,n.setLayerDimensions)(i,s),this._capability.promise.finally(()=>{this._layoutTextParams=null}).catch(()=>{})}get promise(){return this._capability.promise}cancel(){this._canceled=!0,this._reader&&(this._reader.cancel(new r.AbortException("TextLayer task cancelled.")).catch(()=>{}),this._reader=null),this._capability.reject(new r.AbortException("TextLayer task cancelled."))}_processItems(t,e){for(let i of t){if(void 0===i.str){if("beginMarkedContentProps"===i.t
3ype||"beginMarkedContent"===i.type){let t=this._container;this._container=document.createElement("span"),this._container.classList.add("markedContent"),null!==i.id&&this._container.setAttribute("id",`${i.id}`),t.append(this._container)}else"endMarkedContent"===i.type&&(this._container=this._container.parentNode);continue}this._textContentItemsStr.push(i.str),c(this,i,e)}}_layoutText(t){let e=this._layoutTextParams.properties=this._textDivProperties.get(t);if(this._layoutTextParams.div=t,u(this._layoutTextParams),e.hasText&&this._container.append(t),e.hasEOL){let t=document.createElement("br");t.setAttribute("role","presentation"),this._container.append(t)}}_render(){let t=new r.PromiseCapability,e=Object.create(null);if(this._isReadableStream){let i=()=>{this._reader.read().then(r=>{let{value:n,done:s}=r;if(s){t.resolve();return}Object.assign(e,n.styles),this._processItems(n.items,e),i()},t.reject)};this._reader=this._textContentSource.getReader(),i()}else if(this._textContentSource){let{items:e,styles:i}=this._textContentSource;this._processItems(e,i),t.resolve()}else throw Error('No "textContentSource" parameter specified.');t.promise.then(()=>{e=null,p(this)},this._capability.reject)}}function g(t){!t.textContentSource&&(t.textContent||t.textContentStream)&&((0,n.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters will be removed in the future, please use `textContentSource` instead."),t.textContentSource=t.textContent||t.textContentStream);let{container:e,viewport:i}=t,r=getComputedStyle(e),s=r.getPropertyValue("visibility"),a=parseFloat(r.getPropertyValue("--scale-factor"));"visible"===s&&(!a||Math.abs(a-i.scale)>1e-5)&&console.error("The `--scale-factor` CSS-variable must be set, to the same value as `viewport.scale`, either on the `container`-element itself or higher up in the DOM.");let o=new f(t);return o._render(),o}function m(t){let{container:e,viewport:i,textDivs:r,textDivProperties:s,isOffscreenCanvasSupported:a,mustRotate:o=!0,mustRescale:l=!0}=t;if(o&&(0,n.setLayerDimensions)(e,{rotation:i.rotation}),l){let t=h(0,a),e={prevFontSize:null,prevFontFamily:null,div:null,scale:i.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:t};for(let t of r)e.properties=s.get(t),e.div=t,u(e)}}e.TextLayerRenderTask=f},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AnnotationEditorLayer=void 0,i(125),i(136),i(138),i(141),i(143),i(145),i(147);var r=i(1),n=i(164),s=i(197),a=i(202),o=i(168),l=i(203);class h{#eu;#ep=!1;#ef=null;#eg=this.pointerup.bind(this);#em=this.pointerdown.bind(this);#eb=new Map;#ev=!1;#eA=!1;#ey=!1;#e_;static _initialized=!1;constructor(t){let{uiManager:e,pageIndex:i,div:r,accessibilityManager:n,annotationLayer:o,viewport:d,l10n:c}=t,u=[s.FreeTextEditor,a.InkEditor,l.StampEditor];if(!h._initialized)for(let t of(h._initialized=!0,u))t.initialize(c);e.registerEditorTypes(u),this.#e_=e,this.pageIndex=i,this.div=r,this.#eu=n,this.#ef=o,this.viewport=d,this.#e_.addLayer(this)}get isEmpty(){return 0===this.#eb.size}updateToolbar(t){this.#e_.updateToolbar(t)}updateMode(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.#e_.getMode();this.#eS(),t===r.AnnotationEditorType.INK?(this.addInkEditorIfNeeded(!1),this.disableClick()):this.enableClick(),t!==r.AnnotationEditorType.NONE&&(this.div.classList.toggle("freeTextEditing",t===r.AnnotationEditorType.FREETEXT),this.div.classList.toggle("inkEditing",t===r.AnnotationEditorType.INK),this.div.classList.toggle("stampEditing",t===r.AnnotationEditorType.STAMP),this.div.hidden=!1)}addInkEditorIfNeeded(t){if(t||this.#e_.getMode()===r.AnnotationEditorType.INK){if(!t){for(let t of this.#eb.values())if(t.isEmpty()){t.setInBackground();return}}this.#eE({offsetX:0,offsetY:0},!1).setInBackground()}}setEditingState(t){this.#e_.setEditingState(t)}addCommands(t){this.#e_.addCommands(t)}enable(){this.div.style.pointerEvents="auto";let t=new Set;for(let e of this.#eb.values())e.enableEditing(),e.annotationElementId&&t.add(e.annotationElementId);if(this.#ef)for(let e of this.#ef.getEditableAnnotations()){if(e.hide(),this.#e_.isDeletedAnnotationElement(e.data.id)||t.has(e.data.id))continue;let i=this.deserialize(e);
3i&&(this.addOrRebuild(i),i.enableEditing())}}disable(){this.#ey=!0,this.div.style.pointerEvents="none";let t=new Set;for(let e of this.#eb.values()){if(e.disableEditing(),!e.annotationElementId||null!==e.serialize()){t.add(e.annotationElementId);continue}this.getEditableAnnotation(e.annotationElementId)?.show(),e.remove()}if(this.#ef)for(let e of this.#ef.getEditableAnnotations()){let{id:i}=e.data;t.has(i)||this.#e_.isDeletedAnnotationElement(i)||e.show()}this.#eS(),this.isEmpty&&(this.div.hidden=!0),this.#ey=!1}getEditableAnnotation(t){return this.#ef?.getEditableAnnotation(t)||null}setActiveEditor(t){this.#e_.getActive()!==t&&this.#e_.setActiveEditor(t)}enableClick(){this.div.addEventListener("pointerdown",this.#em),this.div.addEventListener("pointerup",this.#eg)}disableClick(){this.div.removeEventListener("pointerdown",this.#em),this.div.removeEventListener("pointerup",this.#eg)}attach(t){this.#eb.set(t.id,t);let{annotationElementId:e}=t;e&&this.#e_.isDeletedAnnotationElement(e)&&this.#e_.removeDeletedAnnotationElement(t)}detach(t){this.#eb.delete(t.id),this.#eu?.removePointerInTextLayer(t.contentDiv),!this.#ey&&t.annotationElementId&&this.#e_.addDeletedAnnotationElement(t)}remove(t){this.detach(t),this.#e_.removeEditor(t),t.div.contains(document.activeElement)&&setTimeout(()=>{this.#e_.focusMainContainer()},0),t.div.remove(),t.isAttachedToDOM=!1,this.#eA||this.addInkEditorIfNeeded(!1)}changeParent(t){t.parent!==this&&(t.annotationElementId&&(this.#e_.addDeletedAnnotationElement(t.annotationElementId),n.AnnotationEditor.deleteAnnotationElement(t),t.annotationElementId=null),this.attach(t),t.parent?.detach(t),t.setParent(this),t.div&&t.isAttachedToDOM&&(t.div.remove(),this.div.append(t.div)))}add(t){if(this.changeParent(t),this.#e_.addEditor(t),this.attach(t),!t.isAttachedToDOM){let e=t.render();this.div.append(e),t.isAttachedToDOM=!0}t.fixAndSetPosition(),t.onceAdded(),this.#e_.addToAnnotationStorage(t)}moveEditorInDOM(t){if(!t.isAttachedToDOM)return;let{activeElement:e}=document;t.div.contains(e)&&(t._focusEventsAllowed=!1,setTimeout(()=>{t.div.contains(document.activeElement)?t._focusEventsAllowed=!0:(t.div.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0}),e.focus())},0)),t._structTreeParentId=this.#eu?.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}addOrRebuild(t){t.needsToBeRebuilt()?t.rebuild():this.add(t)}addUndoableEditor(t){let e=()=>t._uiManager.rebuild(t),i=()=>{t.remove()};this.addCommands({cmd:e,undo:i,mustExec:!1})}getNextId(){return this.#e_.getId()}#ex(t){switch(this.#e_.getMode()){case r.AnnotationEditorType.FREETEXT:return new s.FreeTextEditor(t);case r.AnnotationEditorType.INK:return new a.InkEditor(t);case r.AnnotationEditorType.STAMP:return new l.StampEditor(t)}return null}pasteEditor(t,e){this.#e_.updateToolbar(t),this.#e_.updateMode(t);let{offsetX:i,offsetY:r}=this.#ew(),n=this.getNextId(),s=this.#ex({parent:this,id:n,x:i,y:r,uiManager:this.#e_,isCentered:!0,...e});s&&this.add(s)}deserialize(t){switch(t.annotationType??t.annotationEditorType){case r.AnnotationEditorType.FREETEXT:return s.FreeTextEditor.deserialize(t,this,this.#e_);case r.AnnotationEditorType.INK:return a.InkEditor.deserialize(t,this,this.#e_);case r.AnnotationEditorType.STAMP:return l.StampEditor.deserialize(t,this,this.#e_)}return null}#eE(t,e){let i=this.getNextId(),r=this.#ex({parent:this,id:i,x:t.offsetX,y:t.offsetY,uiManager:this.#e_,isCentered:e});return r&&this.add(r),r}#ew(){let{x:t,y:e,width:i,height:r}=this.div.getBoundingClientRect(),n=Math.max(0,t),s=Math.max(0,e),a=Math.min(window.innerWidth,t+i),o=Math.min(window.innerHeight,e+r),l=(n+a)/2-t,h=(s+o)/2-e,[d,c]=this.viewport.rotation%180==0?[l,h]:[h,l];return{offsetX:d,offsetY:c}}addNewEditor(){this.#eE(this.#ew(),!0)}setSelected(t){this.#e_.setSelected(t)}toggleSelected(t){this.#e_.toggleSelected(t)}isSelected(t){return this.#e_.isSelected(t)}unselect(t){this.#e_.unselect(t)}pointerup(t){let{isMac:e}=r.FeatureTest.platform;if(0===t.button&&(!t.ctrlKey||!e)&&t.target===this.div&&this.#ev){if(this.#ev=!1,!this.#ep){this.#ep=!0;return}if(this.#e_.getMode()===r.AnnotationEditorType.STAMP){this.#e_.unselectAll();return}this.#eE(t,!1)}}pointerdown(t){if(this.#ev){this.#ev=!1;return}let{isMac:e}=r.FeatureTest.platform;if(0!==t.button||t.ctrlKey&&e||t.target!==this.div)return;this.#ev=!0;let i=this.#e_.getActive();this.#ep=!i||i.isEmpty()}findNewParent(t,e,i){let r=this.#e_.findParent(e,i);return null!==r&&r!==this&&(r.changeParent(t),!0)}destroy(){for(let t of(this.#e_.getActive()?.parent===this&&(this.#e_.commitOrRemove(),this.#e_.setActiveEditor(null)),this.#eb.values())
3)this.#eu?.removePointerInTextLayer(t.contentDiv),t.setParent(null),t.isAttachedToDOM=!1,t.div.remove();this.div=null,this.#eb.clear(),this.#e_.removeLayer(this)}#eS(){for(let t of(this.#eA=!0,this.#eb.values()))t.isEmpty()&&t.remove();this.#eA=!1}render(t){let{viewport:e}=t;for(let t of(this.viewport=e,(0,o.setLayerDimensions)(this.div,e),this.#e_.getEditors(this.pageIndex)))this.add(t);this.updateMode()}update(t){let{viewport:e}=t;this.#e_.commitOrRemove(),this.viewport=e,(0,o.setLayerDimensions)(this.div,{rotation:e.rotation}),this.updateMode()}get pageDimensions(){let{pageWidth:t,pageHeight:e}=this.viewport.rawDims;return[t,e]}}e.AnnotationEditorLayer=h},(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FreeTextEditor=void 0,i(89);var r=i(1),n=i(165),s=i(164),a=i(198);class o extends s.AnnotationEditor{#eC=this.editorDivBlur.bind(this);#eT=this.editorDivFocus.bind(this);#eP=this.editorDivInput.bind(this);#eM=this.editorDivKeydown.bind(this);#ek;#eR="";#eF=`${this.id}-editor`;#eI;#eD=null;static _freeTextDefaultContent="";static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){let t=o.prototype,e=t=>t.isEmpty(),i=n.AnnotationEditorUIManager.TRANSLATE_SMALL,s=n.AnnotationEditorUIManager.TRANSLATE_BIG;return(0,r.shadow)(this,"_keyboardManager",new n.KeyboardManager([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],t.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],t.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],t._translateEmpty,{args:[-i,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t._translateEmpty,{args:[-s,0],checker:e}],[["ArrowRight","mac+ArrowRight"],t._translateEmpty,{args:[i,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t._translateEmpty,{args:[s,0],checker:e}],[["ArrowUp","mac+ArrowUp"],t._translateEmpty,{args:[0,-i],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t._translateEmpty,{args:[0,-s],checker:e}],[["ArrowDown","mac+ArrowDown"],t._translateEmpty,{args:[0,i],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t._translateEmpty,{args:[0,s],checker:e}]]))}static _type="freetext";constructor(t){super({...t,name:"freeTextEditor"}),this.#ek=t.color||o._defaultColor||s.AnnotationEditor._defaultLineColor,this.#eI=t.fontSize||o._defaultFontSize}static initialize(t){s.AnnotationEditor.initialize(t,{strings:["free_text2_default_content","editor_free_text2_aria_label"]});let e=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(e.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,e){switch(t){case r.AnnotationEditorParamsType.FREETEXT_SIZE:o._defaultFontSize=e;break;case r.AnnotationEditorParamsType.FREETEXT_COLOR:o._defaultColor=e}}updateParams(t,e){switch(t){case r.AnnotationEditorParamsType.FREETEXT_SIZE:this.#eO(e);break;case r.AnnotationEditorParamsType.FREETEXT_COLOR:this.#eL(e)}}static get defaultPropertiesToUpdate(){return[[r.AnnotationEditorParamsType.FREETEXT_SIZE,o._defaultFontSize],[r.AnnotationEditorParamsType.FREETEXT_COLOR,o._defaultColor||s.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[r.AnnotationEditorParamsType.FREETEXT_SIZE,this.#eI],[r.AnnotationEditorParamsType.FREETEXT_COLOR,this.#ek]]}#eO(t){let e=t=>{this.editorDiv.style.fontSize=`calc(${t}px * var(--scale-factor))`,this.translate(0,-(t-this.#eI)*this.parentScale),this.#eI=t,this.#eN()},i=this.#eI;this.addCommands({cmd:()=>{e(t)},undo:()=>{e(i)},mustExec:!0,type:r.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}#eL(t){let e=this.#ek;this.addCommands({cmd:()=>{this.#ek=this.editorDiv.style.color=t},undo:()=>{this.#ek=this.editorDiv.style.color=e},mustExec:!0,type:r.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(t,e){this._uiManager.translateSelectedEditors(t,e,!0)}getInitialTranslation(){let t=this.parentScale;return[-o._internalPadding*t,-(o._internalPadding+this.#eI)*t]}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(r.AnnotationEditorType.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),this.editorDiv.addEventListener("keydown",this.#eM),this.editorDiv.addEventListener("focus",this.#eT),this.editorDiv.addEventListener("blur",this.#eC),this.editorDiv.addEventListener("input",this.#eP))}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",this.#eF),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",this.#eM),this.editorDiv.removeEventListener("focus",this.#eT),this.editorDiv.removeEventListener("blur",this.#eC),this.editorDiv.removeEventListener("input",this.#eP),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freeTextEditing"))}focusin(t){this._focusEventsAllowed&&(super.focusin(t),t.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(){if(this.width){this.#eB();return}this.enableEditMode(),this.editorDiv.focus(),this._initialOptions?.isCentered&&this.center(),this._initialOptions=null}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freeTextEditing")),super.remove()}#eU(){let t=this.editorDiv.getElementsByTagName("div");if(0===t.length)return this.editorDiv.innerText;let e=[];for(let i of t)e.push(i.innerText.replace(/\r\n?|\n/,""));return e.join("\n")}#eN(){let t;let[e,i]=this.parentDimensions;
3if(this.isAttachedToDOM)t=this.div.getBoundingClientRect();else{let{currentLayer:e,div:i}=this,r=i.style.display;i.style.display="hidden",e.div.append(this.div),t=i.getBoundingClientRect(),i.remove(),i.style.display=r}this.rotation%180==this.parentRotation%180?(this.width=t.width/e,this.height=t.height/i):(this.width=t.height/e,this.height=t.width/i),this.fixAndSetPosition()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();let t=this.#eR,e=this.#eR=this.#eU().trimEnd();if(t===e)return;let i=t=>{if(this.#eR=t,!t){this.remove();return}this.#ej(),this._uiManager.rebuild(this),this.#eN()};this.addCommands({cmd:()=>{i(e)},undo:()=>{i(t)},mustExec:!1}),this.#eN()}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(t){this.enterInEditMode()}keydown(t){t.target===this.div&&"Enter"===t.key&&(this.enterInEditMode(),t.preventDefault())}editorDivKeydown(t){o._keyboardManager.exec(this,t)}editorDivFocus(t){this.isEditing=!0}editorDivBlur(t){this.isEditing=!1}editorDivInput(t){this.parent.div.classList.toggle("freeTextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){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.#eF),this.enableEditing(),s.AnnotationEditor._l10nPromise.get("editor_free_text2_aria_label").then(t=>this.editorDiv?.setAttribute("aria-label",t)),s.AnnotationEditor._l10nPromise.get("free_text2_default_content").then(t=>this.editorDiv?.setAttribute("default-content",t)),this.editorDiv.contentEditable=!0;let{style:i}=this.editorDiv;if(i.fontSize=`calc(${this.#eI}px * var(--scale-factor))`,i.color=this.#ek,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[i,r]=this.parentDimensions;if(this.annotationElementId){let n,s;let{position:a}=this.#eD,[o,l]=this.getInitialTranslation();[o,l]=this.pageTranslationToScreen(o,l);let[h,d]=this.pageDimensions,[c,u]=this.pageTranslation;switch(this.rotation){case 0:n=t+(a[0]-c)/h,s=e+this.height-(a[1]-u)/d;break;case 90:n=t+(a[0]-c)/h,s=e-(a[1]-u)/d,[o,l]=[l,-o];break;case 180:n=t-this.width+(a[0]-c)/h,s=e-(a[1]-u)/d,[o,l]=[-o,-l];break;case 270:n=t+(a[0]-c-this.height*d)/h,s=e+(a[1]-u-this.width*h)/d,[o,l]=[-l,o]}this.setAt(n*i,s*r,o,l)}else this.setAt(t*i,e*r,this.width*i,this.height*r);this.#ej(),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}#ej(){if(this.editorDiv.replaceChildren(),this.#eR)for(let t of this.#eR.split("\n")){let e=document.createElement("div");e.append(t?document.createTextNode(t):document.createElement("br")),this.editorDiv.append(e)}}get contentDiv(){return this.editorDiv}static deserialize(t,e,i){let n=null;if(t instanceof a.FreeTextAnnotationElement){let{data:{defaultAppearanceData:{fontSize:e,fontColor:i},rect:s,rotation:a,id:o},textContent:l,textPosition:h,parent:{page:{pageNumber:d}}}=t;if(!l||0===l.length)return null;n=t={annotationType:r.AnnotationEditorType.FREETEXT,color:Array.from(i),fontSize:e,value:l.join("\n"),position:h,pageIndex:d-1,rect:s,rotation:a,id:o,deleted:!1}}let s=super.deserialize(t,e,i);return s.#eI=t.fontSize,s.#ek=r.Util.makeHexColor(...t.color),s.#eR=t.value,s.annotationElementId=t.id||null,s.#eD=n,s}serialize(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return null;if(this.deleted)return{pageIndex:this.pageIndex,id:this.annotationElementId,deleted:!0};let e=o._internalPadding*this.parentScale,i=this.getRect(e,e),n=s.AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.#ek),a={annotationType:r.AnnotationEditorType.FREETEXT,color:n,fontSize:this.#eI,value:this.#eR,pageIndex:this.pageIndex,rect:i,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return t?a:this.annotationElementId&&!this.#ez(a)?null:(a.id=this.annotationElementId,a)}#ez(t){let{value:e,fontSize:i,color:r,rect:n,pageIndex:s}=this.#eD;return t.value!==e||t.fontSize!==i||t.rect.some((t,e)=>Math.abs(t-n[e])>=1)||t.color.some((t,e)=>t!==r[e])||t.pageIndex!==s}#eB(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.annotationElementId)return;if(this.#eN(),!t&&(0===this.width||0===this.height)){setTimeout(()=>this.#eB(!0),0);return}let e=o._internalPadding*this.parentScale;this.#eD.rect=this.getRect(e,e)}}e.FreeTextEditor=o},(t,e,i)=>
3{Object.defineProperty(e,"__esModule",{value:!0}),e.StampAnnotationElement=e.InkAnnotationElement=e.FreeTextAnnotationElement=e.AnnotationLayer=void 0,i(89),i(125),i(136),i(138),i(141),i(143),i(145),i(147);var r=i(1),n=i(168),s=i(163),a=i(199),o=i(200),l=i(201);let h=1e3,d=9,c=new WeakSet;function u(t){return{width:t[2]-t[0],height:t[3]-t[1]}}class p{static create(t){switch(t.data.annotationType){case r.AnnotationType.LINK:return new g(t);case r.AnnotationType.TEXT:return new m(t);case r.AnnotationType.WIDGET:switch(t.data.fieldType){case"Tx":return new v(t);case"Btn":if(t.data.radioButton)return new _(t);if(t.data.checkBox)return new y(t);return new S(t);case"Ch":return new E(t);case"Sig":return new A(t)}return new b(t);case r.AnnotationType.POPUP:return new x(t);case r.AnnotationType.FREETEXT:return new C(t);case r.AnnotationType.LINE:return new T(t);case r.AnnotationType.SQUARE:return new P(t);case r.AnnotationType.CIRCLE:return new M(t);case r.AnnotationType.POLYLINE:return new k(t);case r.AnnotationType.CARET:return new F(t);case r.AnnotationType.INK:return new I(t);case r.AnnotationType.POLYGON:return new R(t);case r.AnnotationType.HIGHLIGHT:return new D(t);case r.AnnotationType.UNDERLINE:return new O(t);case r.AnnotationType.SQUIGGLY:return new L(t);case r.AnnotationType.STRIKEOUT:return new N(t);case r.AnnotationType.STAMP:return new B(t);case r.AnnotationType.FILEATTACHMENT:return new U(t);default:return new f(t)}}}class f{#eH=!1;constructor(t){let{isRenderable:e=!1,ignoreBorder:i=!1,createQuadrilaterals:r=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.isRenderable=e,this.data=t.data,this.layer=t.layer,this.linkService=t.linkService,this.downloadManager=t.downloadManager,this.imageResourcesPath=t.imageResourcesPath,this.renderForms=t.renderForms,this.svgFactory=t.svgFactory,this.annotationStorage=t.annotationStorage,this.enableScripting=t.enableScripting,this.hasJSActions=t.hasJSActions,this._fieldObjects=t.fieldObjects,this.parent=t.parent,e&&(this.container=this._createContainer(i)),r&&this._createQuadrilaterals()}static _hasPopupData(t){let{titleObj:e,contentsObj:i,richText:r}=t;return!!(e?.str||i?.str||r?.str)}get hasPopupData(){return f._hasPopupData(this.data)}_createContainer(t){let{data:e,parent:{page:i,viewport:n}}=this,s=document.createElement("section");s.setAttribute("data-annotation-id",e.id),this instanceof b||(s.tabIndex=h),s.style.zIndex=this.parent.zIndex++,this.data.popupRef&&s.setAttribute("aria-haspopup","dialog"),e.noRotate&&s.classList.add("norotate");let{pageWidth:a,pageHeight:o,pageX:l,pageY:d}=n.rawDims;if(!e.rect||this instanceof x){let{rotation:t}=e;return e.hasOwnCanvas||0===t||this.setRotation(t,s),s}let{width:c,height:p}=u(e.rect),f=r.Util.normalizeRect([e.rect[0],i.view[3]-e.rect[1]+i.view[1],e.rect[2],i.view[3]-e.rect[3]+i.view[1]]);if(!t&&e.borderStyle.width>0){s.style.borderWidth=`${e.borderStyle.width}px`;let t=e.borderStyle.horizontalCornerRadius,i=e.borderStyle.verticalCornerRadius;if(t>0||i>0){let e=`calc(${t}px * var(--scale-factor)) / calc(${i}px * var(--scale-factor))`;s.style.borderRadius=e}else if(this instanceof _){let t=`calc(${c}px * var(--scale-factor)) / calc(${p}px * var(--scale-factor))`;s.style.borderRadius=t}switch(e.borderStyle.style){case r.AnnotationBorderStyleType.SOLID:s.style.borderStyle="solid";break;case r.AnnotationBorderStyleType.DASHED:s.style.borderStyle="dashed";break;case r.AnnotationBorderStyleType.BEVELED:(0,r.warn)("Unimplemented border style: beveled");break;case r.AnnotationBorderStyleType.INSET:(0,r.warn)("Unimplemented border style: inset");break;case r.AnnotationBorderStyleType.UNDERLINE:s.style.borderBottomStyle="solid"}let n=e.borderColor||null;n?(this.#eH=!0,s.style.borderColor=r.Util.makeHexColor(0|n[0],0|n[1],0|n[2])):s.style.borderWidth=0}s.style.left=`${100*(f[0]-l)/a}%`,s.style.top=`${100*(f[1]-d)/o}%`;let{rotation:g}=e;return e.hasOwnCanvas||0===g?(s.style.width=`${100*c/a}%`,s.style.height=`${100*p/o}%`):this.setRotation(g,s),s}setRotation(t){let e,i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.container;if(!this.data.rect)return;let{pageWidth:n,pageHeight:s}=this.parent.viewport.rawDims,{width:a,height:o}=u(this.data.rect);t%180==0?(e=100*a/n,i=100*o/s):(e=100*o/n,i=100*a/s),r.style.width=`${e}%`,r.style.height=`${i}%`,r.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){let t=(t,e,i)=>{let r=i.detail[t],n=r[0],s=r.slice(1);i.target.style[e]=a.ColorConverters[`${n}_HTML`](s),this.annotationStorage.setValue(this.data.id,{[e]:a.ColorConverters[`${n}_rgb`](s)})};return(0,r.shadow)(this,"_commonActions",{display:t=>{let{display:e}=t.detail,i=e%2==1;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:i,noPrint:1===e||2===e})},print:t=>{this.annotationStorage.setValue(this.data.id,{noPrint:!t.detail.print})},hidden:t=>{let{hidden:e}=t.detail;this.container.style.visibility=e?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:e,noView:e})},focus:t=>{setTimeout(()=>
3t.target.focus({preventScroll:!1}),0)},userName:t=>{t.target.title=t.detail.userName},readonly:t=>{t.target.disabled=t.detail.readonly},required:t=>{this._setRequired(t.target,t.detail.required)},bgColor: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 i=this._commonActions;for(let r of Object.keys(e.detail)){let n=t[r]||i[r];n?.(e)}}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;let e=this.annotationStorage.getRawValue(this.data.id);if(!e)return;let i=this._commonActions;for(let[r,n]of Object.entries(e)){let s=i[r];s&&(s({detail:{[r]:n},target:t}),delete e[r])}}_createQuadrilaterals(){let t;if(!this.container)return;let{quadPoints:e}=this.data;if(!e)return;let[i,r,n,s]=this.data.rect;if(1===e.length){let[,{x:t,y:a},{x:o,y:l}]=e[0];if(n===t&&s===a&&i===o&&r===l)return}let{style:a}=this.container;if(this.#eH){let{borderColor:e,borderWidth:i}=a;a.borderWidth=0,t=["url('data:image/svg+xml;utf8,",'<svg xmlns="http://www.w3.org/2000/svg"',' preserveAspectRatio="none" viewBox="0 0 1 1">',`<g fill="transparent" stroke="${e}" stroke-width="${i}">`],this.container.classList.add("hasBorder")}let o=n-i,l=s-r,{svgFactory:h}=this,d=h.createElement("svg");d.classList.add("quadrilateralsContainer"),d.setAttribute("width",0),d.setAttribute("height",0);let c=h.createElement("defs");d.append(c);let u=h.createElement("clipPath"),p=`clippath_${this.data.id}`;for(let[,{x:r,y:n},{x:a,y:d}]of(u.setAttribute("id",p),u.setAttribute("clipPathUnits","objectBoundingBox"),c.append(u),e)){let e=h.createElement("rect"),c=(a-i)/o,p=(s-n)/l,f=(r-a)/o,g=(n-d)/l;e.setAttribute("x",c),e.setAttribute("y",p),e.setAttribute("width",f),e.setAttribute("height",g),u.append(e),t?.push(`<rect vector-effect="non-scaling-stroke" x="${c}" y="${p}" width="${f}" height="${g}"/>`)}this.#eH&&(t.push("</g></svg>')"),a.backgroundImage=t.join("")),this.container.append(d),this.container.style.clipPath=`url(#${p})`}_createPopup(){let{container:t,data:e}=this;t.setAttribute("aria-haspopup","dialog");let i=new x({data:{color:e.color,titleObj:e.titleObj,modificationDate:e.modificationDate,contentsObj:e.contentsObj,richText:e.richText,parentRect:e.rect,borderStyle:0,id:`popup_${e.id}`,rotation:e.rotation},parent:this.parent,elements:[this]});this.parent.div.append(i.render())}render(){(0,r.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=[];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&&!c.has(o)){(0,r.warn)(`_getElementsByName - element not allowed: ${s}`);continue}i.push({id:s,exportValue:n,domElement:o})}return i}for(let r of document.getElementsByName(t)){let{exportValue:t}=r,n=r.getAttribute("data-element-id");n!==e&&c.has(r)&&i.push({id:n,exportValue:t,domElement:r})}return i}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){let t=this.getElementsToTriggerPopup();if(Array.isArray(t))for(let e of t)e.classList.add("highlightArea");else t.classList.add("highlightArea")}_editOnDoubleClick(){let{annotationEditorType:t,data:{id:e}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:t,editId:e})})}}class g extends f{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;super(t,{isRenderable:!0,ignoreBorder:!!e?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=t.data.isTooltipOnly}render(){let{data:t,linkService:e}=this,i=document.createElement("a");i.setAttribute("data-element-id",t.id);let r=!1;return t.url?(e.addLinkAttributes(i,t.url,t.newWindow),r=!0):t.action?(this._bindNamedAction(i,t.action),r=!0):t.attachment?(this._bindAttachment(i,t.attachment),r=!0):t.setOCGState?(this.#eG(i,t.setOCGState),r=!0):t.dest?(this._bindLink(i,t.dest),r=!0):(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(i,t),r=!0),t.resetForm?(this._bindResetFormAction(i,t.resetForm),r=!0):this.isTooltipOnly&&!r&&(this._bindLink(i,""),r=!0)),this.container.classList.add("linkA
3nnotation"),r&&this.container.append(i),this.container}#eW(){this.container.setAttribute("data-internal-link","")}_bindLink(t,e){t.href=this.linkService.getDestinationHash(e),t.onclick=()=>(e&&this.linkService.goToDestination(e),!1),(e||""===e)&&this.#eW()}_bindNamedAction(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(e),!1),this.#eW()}_bindAttachment(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.downloadManager?.openOrDownloadData(this.container,e.content,e.filename),!1),this.#eW()}#eG(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(e),!1),this.#eW()}_bindJSAction(t,e){t.href=this.linkService.getAnchorUrl("");let i=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(let r of Object.keys(e.actions)){let n=i.get(r);n&&(t[n]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e.id,name:r}}),!1))}t.onclick||(t.onclick=()=>!1),this.#eW()}_bindResetFormAction(t,e){let i=t.onclick;if(i||(t.href=this.linkService.getAnchorUrl("")),this.#eW(),!this._fieldObjects){(0,r.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),i||(t.onclick=()=>!1);return}t.onclick=()=>{i?.();let{fields:t,refs:n,include:s}=e,a=[];if(0!==t.length||0!==n.length){let e=new Set(n);for(let i of t)for(let{id:t}of this._fieldObjects[i]||[])e.add(t);for(let t of Object.values(this._fieldObjects))for(let i of t)e.has(i.id)===s&&a.push(i)}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 i=t.defaultValue||"";o.setValue(e,{value:i});break}case"checkbox":case"radiobutton":{let i=t.defaultValue===t.exportValues;o.setValue(e,{value:i});break}case"combobox":case"listbox":{let i=t.defaultValue||"";o.setValue(e,{value:i});break}default:continue}let i=document.querySelector(`[data-element-id="${e}"]`);if(i){if(!c.has(i)){(0,r.warn)(`_bindResetFormAction - element not allowed: ${e}`);continue}i.dispatchEvent(new Event("resetform"))}}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:l,name:"ResetForm"}}),!1}}}class m extends f{constructor(t){super(t,{isRenderable:!0})}render(){this.container.classList.add("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.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(t),this.container}}class b extends f{render(){return this.data.alternativeText&&(this.container.title=this.data.alternativeText),this.container}showElementAndHideCanvas(t){this.data.hasOwnCanvas&&(t.previousSibling?.nodeName==="CANVAS"&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){let{isWin:e,isMac:i}=r.FeatureTest.platform;return e&&t.ctrlKey||i&&t.metaKey}_setEventListener(t,e,i,r,n){i.includes("mouse")?t.addEventListener(i,t=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:r,value:n(t),shift:t.shiftKey,modifier:this._getKeyModifier(t)}})}):t.addEventListener(i,t=>{if("blur"===i){if(!e.focused||!t.relatedTarget)return;e.focused=!1}else if("focus"===i){if(e.focused)return;e.focused=!0}n&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:r,value:n(t)}})})}_setEventListeners(t,e,i,r){for(let[n,s]of i)("Action"===s||this.data.actions?.[s])&&(("Focus"===s||"Blur"===s)&&(e||={focused:!1}),this._setEventListener(t,e,n,s,r),"Focus"!==s||this.data.actions?.Blur?"Blur"!==s||this.data.actions?.Focus||this._setEventListener(t,e,"focus","Focus",null):this._setEventListener(t,e,"blur","Blur",null))}_setBackgroundColor(t){let e=this.data.backgroundColor||null;t.style.backgroundColor=null===e?"transparent":r.Util.makeHexColor(e[0],e[1],e[2])}_setTextStyle(t){let e;let i=["left","center","right"],{fontColor:n}=this.data.defaultAppearanceData,s=this.data.defaultAppearanceData.fontSize||d,a=t.style,o=2,l=t=>Math.round(10*t)/10;if(this.data.multiLine){let t=Math.abs(this.data.rect[3]-this.data.rect[1]-o),i=Math.round(t/(r.LINE_FACTOR*s))||1;e=Math.min(s,l(t/i/r.LINE_FACTOR))}else e=Math.min(s,l(Math.abs(this.data.rect[3]-this.data.rect[1]-o)/r.LINE_FACTOR));a.fontSize=`calc(${e}
3px * var(--scale-factor))`,a.color=r.Util.makeHexColor(n[0],n[1],n[2]),null!==this.data.textAlignment&&(a.textAlign=i[this.data.textAlignment])}_setRequired(t,e){e?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",e)}}class v extends b{constructor(t){super(t,{isRenderable:t.renderForms||!t.data.hasAppearance&&!!t.data.fieldValue})}setPropertyOnSiblings(t,e,i,r){let n=this.annotationStorage;for(let s of this._getElementsByName(t.name,t.id))s.domElement&&(s.domElement[e]=i),n.setValue(s.id,{[r]:i})}render(){let t=this.annotationStorage,e=this.data.id;this.container.classList.add("textWidgetAnnotation");let i=null;if(this.renderForms){let r=t.getValue(e,{value:this.data.fieldValue}),n=r.value||"",s=t.getValue(e,{charLimit:this.data.maxLen}).charLimit;s&&n.length>s&&(n=n.slice(0,s));let a=r.formattedValue||this.data.textContent?.join("\n")||null;a&&this.data.comb&&(a=a.replaceAll(/\s+/g,""));let o={userValue:n,formattedValue:a,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?((i=document.createElement("textarea")).textContent=a??n,this.data.doNotScroll&&(i.style.overflowY="hidden")):((i=document.createElement("input")).type="text",i.setAttribute("value",a??n),this.data.doNotScroll&&(i.style.overflowX="hidden")),this.data.hasOwnCanvas&&(i.hidden=!0),c.add(i),i.setAttribute("data-element-id",e),i.disabled=this.data.readOnly,i.name=this.data.fieldName,i.tabIndex=h,this._setRequired(i,this.data.required),s&&(i.maxLength=s),i.addEventListener("input",r=>{t.setValue(e,{value:r.target.value}),this.setPropertyOnSiblings(i,"value",r.target.value,"value"),o.formattedValue=null}),i.addEventListener("resetform",t=>{let e=this.data.defaultFieldValue??"";i.value=o.userValue=e,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){i.addEventListener("focus",t=>{if(o.focused)return;let{target:e}=t;o.userValue&&(e.value=o.userValue),o.lastCommittedValue=e.value,o.commitKey=1,o.focused=!0}),i.addEventListener("updatefromsandbox",i=>{this.showElementAndHideCanvas(i.target);let r={value(i){o.userValue=i.detail.value??"",t.setValue(e,{value:o.userValue.toString()}),i.target.value=o.userValue},formattedValue(i){let{formattedValue:r}=i.detail;o.formattedValue=r,null!=r&&i.target!==document.activeElement&&(i.target.value=r),t.setValue(e,{formattedValue:r})},selRange(t){t.target.setSelectionRange(...t.detail.selRange)},charLimit:i=>{let{charLimit:r}=i.detail,{target:n}=i;if(0===r){n.removeAttribute("maxLength");return}n.setAttribute("maxLength",r);let s=o.userValue;s&&!(s.length<=r)&&(s=s.slice(0,r),n.value=o.userValue=s,t.setValue(e,{value:s}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:s,willCommit:!0,commitKey:1,selStart:n.selectionStart,selEnd:n.selectionEnd}}))}};this._dispatchEventFromSandbox(r,i)}),i.addEventListener("keydown",t=>{o.commitKey=1;let i=-1;if("Escape"===t.key?i=0:"Enter"!==t.key||this.data.multiLine?"Tab"===t.key&&(o.commitKey=3):i=2,-1===i)return;let{value:r}=t.target;o.lastCommittedValue!==r&&(o.lastCommittedValue=r,o.userValue=r,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:r,willCommit:!0,commitKey:i,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}))});let r=l;l=null,i.addEventListener("blur",t=>{if(!o.focused||!t.relatedTarget)return;o.focused=!1;let{value:i}=t.target;o.userValue=i,o.lastCommittedValue!==i&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:i,willCommit:!0,commitKey:o.commitKey,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}),r(t)}),this.data.actions?.Keystroke&&i.addEventListener("beforeinput",t=>{o.lastCommittedValue=null;let{data:i,target:r}=t,{value:n,selectionStart:s,selectionEnd:a}=r,l=s,h=a;switch(t.inputType){case"deleteWordBackward":{let t=n.substring(0,s).match(/\w*[^\w]*$/);t&&(l-=t[0].length);break}
3case"deleteWordForward":{let t=n.substring(s).match(/^[^\w]*\w*/);t&&(h+=t[0].length);break}case"deleteContentBackward":s===a&&(l-=1);break;case"deleteContentForward":s===a&&(h+=1)}t.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:n,change:i||"",willCommit:!1,selStart:l,selEnd:h}})}),this._setEventListeners(i,o,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],t=>t.target.value)}if(l&&i.addEventListener("blur",l),this.data.comb){let t=(this.data.rect[2]-this.data.rect[0])/s;i.classList.add("comb"),i.style.letterSpacing=`calc(${t}px * var(--scale-factor) - 1ch)`}}else(i=document.createElement("div")).textContent=this.data.fieldValue,i.style.verticalAlign="middle",i.style.display="table-cell";return this._setTextStyle(i),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class A extends b{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class y extends b{constructor(t){super(t,{isRenderable:t.renderForms})}render(){let t=this.annotationStorage,e=this.data,i=e.id,r=t.getValue(i,{value:e.exportValue===e.fieldValue}).value;"string"==typeof r&&(r="Off"!==r,t.setValue(i,{value:r})),this.container.classList.add("buttonWidgetAnnotation","checkBox");let n=document.createElement("input");return c.add(n),n.setAttribute("data-element-id",i),n.disabled=e.readOnly,this._setRequired(n,this.data.required),n.type="checkbox",n.name=e.fieldName,r&&n.setAttribute("checked",!0),n.setAttribute("exportValue",e.exportValue),n.tabIndex=h,n.addEventListener("change",r=>{let{name:n,checked:s}=r.target;for(let r of this._getElementsByName(n,i)){let i=s&&r.exportValue===e.exportValue;r.domElement&&(r.domElement.checked=i),t.setValue(r.id,{value:i})}t.setValue(i,{value:s})}),n.addEventListener("resetform",t=>{let i=e.defaultFieldValue||"Off";t.target.checked=i===e.exportValue}),this.enableScripting&&this.hasJSActions&&(n.addEventListener("updatefromsandbox",e=>{let r={value(e){e.target.checked="Off"!==e.detail.value,t.setValue(i,{value:e.target.checked})}};this._dispatchEventFromSandbox(r,e)}),this._setEventListeners(n,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],t=>t.target.checked)),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class _ extends b{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");let t=this.annotationStorage,e=this.data,i=e.id,r=t.getValue(i,{value:e.fieldValue===e.buttonValue}).value;"string"==typeof r&&(r=r!==e.buttonValue,t.setValue(i,{value:r}));let n=document.createElement("input");if(c.add(n),n.setAttribute("data-element-id",i),n.disabled=e.readOnly,this._setRequired(n,this.data.required),n.type="radio",n.name=e.fieldName,r&&n.setAttribute("checked",!0),n.tabIndex=h,n.addEventListener("change",e=>{let{name:r,checked:n}=e.target;for(let e of this._getElementsByName(r,i))t.setValue(e.id,{value:!1});t.setValue(i,{value:n})}),n.addEventListener("resetform",t=>{let i=e.defaultFieldValue;t.target.checked=null!=i&&i===e.buttonValue}),this.enableScripting&&this.hasJSActions){let r=e.buttonValue;n.addEventListener("updatefromsandbox",e=>{let n={value:e=>{let n=r===e.detail.value;for(let r of this._getElementsByName(e.target.name)){let e=n&&r.id===i;r.domElement&&(r.domElement.checked=e),t.setValue(r.id,{value:e})}}};this._dispatchEventFromSandbox(n,e)}),this._setEventListeners(n,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],t=>t.target.checked)}return this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class S extends g{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){let t=super.render();t.classList.add("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 E extends b{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");let t=this.annotationStorage,e=this.data.id,i=t.getValue(e,{value:this.data.fieldValue}),r=document.createElement("select");c.add(r),r.setAttribute("data-element-id",e),r.disabled=this.data.readOnly,this._setRequired(r,this.data.required),r.name=this.data.fieldName,r.tabIndex=h;let n=this.data.combo&&this.data.options.length>0;for(let t of(!this.data.combo&&(r.size=this.data.options.length,this.data.multiSelect&&(r.multiple=!0)),r.addEventListener("resetform",t=>{let e=this.data.defaultFieldValue;for(let t of r.options)t.selected=t.value===e}),this.data.options)){let e=document.createElement("option");e.textContent=t.displayValue,e.value=t.exportValue,i.value.includes(t.exportValue)&&(e.setAttribute("selected",!0),n=!1),r.append(e)}let s=null;if(n){let t=document.createElement("option");t.value=" ",t.setAttribute("hidden",!0),t.setAttribute("selected",!0),r.prepend(t),s=()=>{t.remove(),r.removeEventListener("input",s),s=null},r.addEventListener("input",s)}let a=t=>{let e=t?"value":"textContent",{options:i,multiple:n}=r;return n?Array.prototype.filter.call(i,t=>t.selected).map(t=>t[e]):-1===i.selectedIndex?null:i[i.selectedIndex][e]},o=a(!1),l=t=>{let e=t.target.options;return Array.prototype.map.call(e,t=>({displayValue:t.textContent,exportValue:t.value}))};return this.enableScripting&&this.hasJSActions?(r.addEventListener("updatefromsandbox",i=>{let n={value(i){s?.();let n=i.detail.value,l=new Set(Array.isArray(n)?n:[n]);for(let t of r.options)t.selected=l.has(t.value);t.setValue(e,{value:a(!0)}),o=a(!1)},multipleSelection(t){r.multiple=!0},remove(i){let n=r.options,s=i.detail.remove;n[s].selected=!1,r.remove(s),n.length>0&&-1===Array.prototype.findIndex.call(n,t=>t.selected)&&(n[0].selected=!0),t.setValue(e,{value:a(!0),items:l(i)}),o=a(!1)},clear(i){for(;0!==r.length;)r.remove(0);t.setValue(e,{value:null,items:[]}),o=a(!1)},insert(i){let{index:n,displayValue:s,exportValue:h}=i.detail.insert,d=r.children[n],c=document.createElement("option");c.textContent=s,c.value=h,d?d.before(c):r.append(c),t.setValue(e,{value:a(!0),items:l(i)}),o=a(!1)},items(i){let{items:n}=i.detail;for(;0!==r.length;)r.remove(0);for(let t of n){let{displayValue:e,exportValue:i}=t,n=document.createElement("option");n.textContent=e,n.value=i,r.append(n)}r.options.length>0&&(r.options[0].selected=!0),t.setValue(e,{value:a(!0),items:l(i)}),o=a(!1)},indices(i){let r=new Set(i.detail.indices);for(let t of i.target.options)t.selected=r.has(t.index);t.setValue(e,{value:a(!0)}),o=a(!1)},editable(t){t.target.disabled=!t.detail.editable}};this._dispatchEventFromSandbox(n,i)}),r.addEventListener("input",i=>{let r=a(!0);t.setValue(e,{value:r}),i.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:o,changeEx:r,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(r,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],t=>t.target.value)):r.addEventListener("input",function(i){t.setValue(e,{value:a(!0)})}
3),this.data.combo&&this._setTextStyle(r),this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}class x extends f{constructor(t){let{data:e,elements:i}=t;super(t,{isRenderable:f._hasPopupData(e)}),this.elements=i}render(){this.container.classList.add("popupAnnotation");let t=new w({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open}),e=[];for(let i of this.elements)i.popup=t,e.push(i.data.id),i.addHighlightArea();return this.container.setAttribute("aria-controls",e.map(t=>`${r.AnnotationPrefix}${t}`).join(",")),this.container}}class w{#eV=null;#e$=this.#eq.bind(this);#eX=this.#eK.bind(this);#eY=this.#eJ.bind(this);#eQ=this.#eZ.bind(this);#ek=null;#tF=null;#e0=null;#e1=null;#e2=null;#e3=null;#e4=!1;#e5=null;#e8=null;#e6=null;#e7=null;#e9=!1;constructor(t){let{container:e,color:i,elements:r,titleObj:s,modificationDate:a,contentsObj:o,richText:l,parent:h,rect:d,parentRect:c,open:u}=t;this.#tF=e,this.#e7=s,this.#e0=o,this.#e6=l,this.#e2=h,this.#ek=i,this.#e8=d,this.#e3=c,this.#e1=r;let p=n.PDFDateString.toDateObject(a);for(let t of(p&&(this.#eV=h.l10n.get("annotation_date_string",{date:p.toLocaleDateString(),time:p.toLocaleTimeString()})),this.trigger=r.flatMap(t=>t.getElementsToTriggerPopup()),this.trigger))t.addEventListener("click",this.#eQ),t.addEventListener("mouseenter",this.#eY),t.addEventListener("mouseleave",this.#eX),t.classList.add("popupTriggerArea");for(let t of r)t.container?.addEventListener("keydown",this.#e$);this.#tF.hidden=!0,u&&this.#eZ()}render(){if(this.#e5)return;let{page:{view:t},viewport:{rawDims:{pageWidth:e,pageHeight:i,pageX:n,pageY:s}}}=this.#e2,a=this.#e5=document.createElement("div");if(a.className="popup",this.#ek){let t=a.style.outlineColor=r.Util.makeHexColor(...this.#ek);if(CSS.supports("background-color","color-mix(in srgb, red 30%, white)"))a.style.backgroundColor=`color-mix(in srgb, ${t} 30%, white)`;else{let t=.7;a.style.backgroundColor=r.Util.makeHexColor(...this.#ek.map(e=>Math.floor(t*(255-e)+e)))}}let o=document.createElement("span");o.className="header";let h=document.createElement("h1");if(o.append(h),{dir:h.dir,str:h.textContent}=this.#e7,a.append(o),this.#eV){let t=document.createElement("span");t.classList.add("popupDate"),this.#eV.then(e=>{t.textContent=e}),o.append(t)}let d=this.#e0,c=this.#e6;if(c?.str&&(!d?.str||d.str===c.str))l.XfaLayer.render({xfaHtml:c.html,intent:"richText",div:a}),a.lastChild.classList.add("richText","popupContent");else{let t=this._formatContents(d);a.append(t)}let u=!!this.#e3,p=u?this.#e3:this.#e8;for(let t of this.#e1)if(!p||null!==r.Util.intersect(t.data.rect,p)){p=t.data.rect,u=!0;break}let f=r.Util.normalizeRect([p[0],t[3]-p[1]+t[1],p[2],t[3]-p[3]+t[1]]),g=5,m=u?p[2]-p[0]+g:0,b=f[0]+m,v=f[1],{style:A}=this.#tF;A.left=`${100*(b-n)/e}%`,A.top=`${100*(v-s)/i}%`,this.#tF.append(a)}_formatContents(t){let{str:e,dir:i}=t,r=document.createElement("p");r.classList.add("popupContent"),r.dir=i;let n=e.split(/(?:\r\n?|\n)/);for(let t=0,e=n.length;t<e;++t){let i=n[t];r.append(document.createTextNode(i)),t<e-1&&r.append(document.createElement("br"))}return r}#eq(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||"Enter"!==t.key&&("Escape"!==t.key||!this.#e4)||this.#eZ()}#eZ(){this.#e4=!this.#e4,this.#e4?(this.#eJ(),this.#tF.addEventListener("click",this.#eQ),this.#tF.addEventListener("keydown",this.#e$)):(this.#eK(),this.#tF.removeEventListener("click",this.#eQ),this.#tF.removeEventListener("keydown",this.#e$))}#eJ(){this.#e5||this.render(),this.isVisible?this.#e4&&this.#tF.classList.add("focused"):(this.#tF.hidden=!1,this.#tF.style.zIndex=parseInt(this.#tF.style.zIndex)+1e3)}#eK(){this.#tF.classList.remove("focused"),!this.#e4&&this.isVisible&&(this.#tF.hidden=!0,this.#tF.style.zIndex=parseInt(this.#tF.style.zIndex)-1e3)}forceHide(){this.#e9=this.isVisible,this.#e9&&(this.#tF.hidden=!0)}maybeShow(){this.#e9&&(this.#e9=!1,this.#tF.hidden=!1)}get isVisible(){return!1===this.#tF.hidden}}class C extends f{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.textContent=t.data.textContent,this.textPosition=t.data.textPosition,this.annotationEditorType=r.AnnotationEditorType.FREETEXT}
3render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){let t=document.createElement("div");for(let e of(t.classList.add("annotationTextContent"),t.setAttribute("role","comment"),this.textContent)){let i=document.createElement("span");i.textContent=e,t.append(i)}this.container.append(t)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}e.FreeTextAnnotationElement=C;class T extends f{#it=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");let t=this.data,{width:e,height:i}=u(t.rect),r=this.svgFactory.create(e,i,!0),n=this.#it=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"),r.append(n),this.container.append(r),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#it}addHighlightArea(){this.container.classList.add("highlightArea")}}class P extends f{#ie=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");let t=this.data,{width:e,height:i}=u(t.rect),r=this.svgFactory.create(e,i,!0),n=t.borderStyle.width,s=this.#ie=this.svgFactory.createElement("svg:rect");return s.setAttribute("x",n/2),s.setAttribute("y",n/2),s.setAttribute("width",e-n),s.setAttribute("height",i-n),s.setAttribute("stroke-width",n||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),r.append(s),this.container.append(r),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#ie}addHighlightArea(){this.container.classList.add("highlightArea")}}class M extends f{#ii=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");let t=this.data,{width:e,height:i}=u(t.rect),r=this.svgFactory.create(e,i,!0),n=t.borderStyle.width,s=this.#ii=this.svgFactory.createElement("svg:ellipse");return s.setAttribute("cx",e/2),s.setAttribute("cy",i/2),s.setAttribute("rx",e/2-n/2),s.setAttribute("ry",i/2-n/2),s.setAttribute("stroke-width",n||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),r.append(s),this.container.append(r),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#ii}addHighlightArea(){this.container.classList.add("highlightArea")}}class k extends f{#ir=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);let t=this.data,{width:e,height:i}=u(t.rect),r=this.svgFactory.create(e,i,!0),n=[];for(let e of t.vertices){let i=e.x-t.rect[0],r=t.rect[3]-e.y;n.push(i+","+r)}n=n.join(" ");let s=this.#ir=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"),r.append(s),this.container.append(r),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#ir}addHighlightArea(){this.container.classList.add("highlightArea")}}class R extends k{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class F extends f{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}class I extends f{#is=[];constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=r.AnnotationEditorType.INK}render(){this.container.classList.add(this.containerClassName);let t=this.data,{width:e,height:i}=u(t.rect),r=this.svgFactory.create(e,i,!0);for(let e of t.inkLists){let i=[];for(let r of e){let e=r.x-t.rect[0],n=t.rect[3]-r.y;i.push(`${e},${n}`)}i=i.join(" ");let n=this.svgFactory.createElement(this.svgElementName);this.#is.push(n),n.setAttribute("points",i),n.setAttribute("stroke-width",t.borderStyle.width||1),n.setAttribute("stroke","transparent"),n.setAttribute("fill","transparent"),!t.popupRef&&this.hasPopupData&&this._createPopup(),r.append(n)}return this.container.append(r),this.container}getElementsToTriggerPopup(){return this.#is}addHighlightArea(){this.container.classList.add("highlightArea")}}e.InkAnnotationElement=I;class D extends f{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this.container}}
3class O extends f{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),this.container}}class L extends f{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),this.container}}class N extends f{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),this.container}}class B extends f{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("stampAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}e.StampAnnotationElement=B;class U extends f{#ia=null;constructor(t){super(t,{isRenderable:!0});let{filename:e,content:i}=this.data.file;this.filename=(0,n.getFilenameFromUrl)(e,!0),this.content=i,this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,filename:e,content:i})}render(){let t;this.container.classList.add("fileAttachmentAnnotation");let{container:e,data:i}=this;i.hasAppearance||0===i.fillAlpha?t=document.createElement("div"):((t=document.createElement("img")).src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(i.name)?"paperclip":"pushpin"}.svg`,i.fillAlpha&&i.fillAlpha<1&&(t.style=`filter: opacity(${Math.round(100*i.fillAlpha)}%);`)),t.addEventListener("dblclick",this.#io.bind(this)),this.#ia=t;let{isMac:n}=r.FeatureTest.platform;return e.addEventListener("keydown",t=>{"Enter"===t.key&&(n?t.metaKey:t.ctrlKey)&&this.#io()}),!i.popupRef&&this.hasPopupData?this._createPopup():t.classList.add("popupTriggerArea"),e.append(t),e}getElementsToTriggerPopup(){return this.#ia}addHighlightArea(){this.container.classList.add("highlightArea")}#io(){this.downloadManager?.openOrDownloadData(this.container,this.content,this.filename)}}class j{#eu=null;#il=null;#ih=new Map;constructor(t){let{div:e,accessibilityManager:i,annotationCanvasMap:r,l10n:n,page:s,viewport:a}=t;this.div=e,this.#eu=i,this.#il=r,this.l10n=n,this.page=s,this.viewport=a,this.zIndex=0,this.l10n||=o.NullL10n}#id(t,e){let i=t.firstChild||t;i.id=`${r.AnnotationPrefix}${e}`,this.div.append(t),this.#eu?.moveElementInDOM(this.div,t,i,!1)}async render(t){let{annotations:e}=t,i=this.div;(0,n.setLayerDimensions)(i,this.viewport);let a=new Map,o={data:null,layer:i,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:!1!==t.renderForms,svgFactory:new n.DOMSVGFactory,annotationStorage:t.annotationStorage||new s.AnnotationStorage,enableScripting:!0===t.enableScripting,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(let t of e){if(t.noHTML)continue;let e=t.annotationType===r.AnnotationType.POPUP;if(e){let e=a.get(t.id);if(!e)continue;o.elements=e}else{let{width:e,height:i}=u(t.rect);if(e<=0||i<=0)continue}o.data=t;let i=p.create(o);if(!i.isRenderable)continue;if(!e&&t.popupRef){let e=a.get(t.popupRef);e?e.push(i):a.set(t.popupRef,[i])}i.annotationEditorType>0&&this.#ih.set(i.data.id,i);let n=i.render();t.hidden&&(n.style.visibility="hidden"),this.#id(n,t.id)}this.#ic(),await this.l10n.translate(i)}update(t){let{viewport:e}=t,i=this.div;this.viewport=e,(0,n.setLayerDimensions)(i,{rotation:e.rotation}),this.#ic(),i.hidden=!1}#ic(){if(!this.#il)return;let t=this.div;for(let[e,i]of this.#il){let r=t.querySelector(`[data-annotation-id="${e}"]`);if(!r)continue;let{firstChild:n}=r;n?"CANVAS"===n.nodeName?n.replaceWith(i):n.before(i):r.append(i)}this.#il.clear()}getEditableAnnotations(){return Array.from(this.#ih.values())}getEditableAnnotation(t){return this.#ih.get(t)}}e.AnnotationLayer=j},(t,e)=>{function i(t){return Math.floor(255*Math.max(0,Math.min(1,t))).toString(16).padStart(2,"0")}function r(t){return Math.max(0,Math.min(255,255*t))}
3Object.defineProperty(e,"__esModule",{value:!0}),e.ColorConverters=void 0;class n{static CMYK_G(t){let[e,i,r,n]=t;return["G",1-Math.min(1,.3*e+.59*r+.11*i+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_rgb(t){let[e]=t;return[e=r(e),e,e]}static G_HTML(t){let[e]=t,r=i(e);return`#${r}${r}${r}`}static RGB_G(t){let[e,i,r]=t;return["G",.3*e+.59*i+.11*r]}static RGB_rgb(t){return t.map(r)}static RGB_HTML(t){return`#${t.map(i).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB(t){let[e,i,r,n]=t;return["RGB",1-Math.min(1,e+n),1-Math.min(1,r+n),1-Math.min(1,i+n)]}static CMYK_rgb(t){let[e,i,n,s]=t;return[r(1-Math.min(1,e+s)),r(1-Math.min(1,n+s)),r(1-Math.min(1,i+s))]}static CMYK_HTML(t){let e=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(e)}static RGB_CMYK(t){let[e,i,r]=t,n=1-e,s=1-i,a=1-r,o=Math.min(n,s,a);return["CMYK",n,s,a,o]}}e.ColorConverters=n},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.NullL10n=void 0,e.getL10nFallback=r;let i={of_pages:"of {{pagesCount}}",page_of_pages:"({{pageNumber}} of {{pagesCount}})",document_properties_kb:"{{size_kb}} KB ({{size_b}} bytes)",document_properties_mb:"{{size_mb}} MB ({{size_b}} bytes)",document_properties_date_string:"{{date}}, {{time}}",document_properties_page_size_unit_inches:"in",document_properties_page_size_unit_millimeters:"mm",document_properties_page_size_orientation_portrait:"portrait",document_properties_page_size_orientation_landscape:"landscape",document_properties_page_size_name_a3:"A3",document_properties_page_size_name_a4:"A4",document_properties_page_size_name_letter:"Letter",document_properties_page_size_name_legal:"Legal",document_properties_page_size_dimension_string:"{{width}} \xd7 {{height}} {{unit}} ({{orientation}})",document_properties_page_size_dimension_name_string:"{{width}} \xd7 {{height}} {{unit}} ({{name}}, {{orientation}})",document_properties_linearized_yes:"Yes",document_properties_linearized_no:"No",additional_layers:"Additional Layers",page_landmark:"Page {{page}}",thumb_page_title:"Page {{page}}",thumb_page_canvas:"Thumbnail of Page {{page}}",find_reached_top:"Reached top of document, continued from bottom",find_reached_bottom:"Reached end of document, continued from top","find_match_count[one]":"{{current}} of {{total}} match","find_match_count[other]":"{{current}} of {{total}} matches","find_match_count_limit[one]":"More than {{limit}} match","find_match_count_limit[other]":"More than {{limit}} matches",find_not_found:"Phrase not found",page_scale_width:"Page Width",page_scale_fit:"Page Fit",page_scale_auto:"Automatic Zoom",page_scale_actual:"Actual Size",page_scale_percent:"{{scale}}%",loading_error:"An error occurred while loading the PDF.",invalid_file_error:"Invalid or corrupted PDF file.",missing_file_error:"Missing PDF file.",unexpected_response_error:"Unexpected server response.",rendering_error:"An error occurred while rendering the page.",annotation_date_string:"{{date}}, {{time}}",printing_not_supported:"Warning: Printing is not fully supported by this browser.",printing_not_ready:"Warning: The PDF is not fully loaded for printing.",web_fonts_disabled:"Web fonts are disabled: unable to use embedded PDF fonts.",free_text2_default_content:"Start typing…",editor_free_text2_aria_label:"Text Editor",editor_ink2_aria_label:"Draw Editor",editor_ink_canvas_aria_label:"User-created image",editor_alt_text_button_label:"Alt text",editor_alt_text_edit_button_label:"Edit alt text",editor_alt_text_decorative_tooltip:"Marked as decorative"};function r(t,e){switch(t){case"find_match_count":t=`find_match_count[${1===e.total?"one":"other"}]`;break;case"find_match_count_limit":t=`find_match_count_limit[${1===e.limit?"one":"other"}]`}return i[t]||""}function n(t,e){return e?t.replaceAll(/\{\{\s*(\w+)\s*\}\}/g,(t,i)=>i in e?e[i]:"{{"+i+"}}"):t}i.print_progress_percent="{{progress}}%";let s={getLanguage:async()=>"en-us",getDirection:async()=>"ltr",async get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r(t,e);return n(i,e)},async translate(t){}};e.NullL10n=s},(t,e,i)=>
3{Object.defineProperty(e,"__esModule",{value:!0}),e.XfaLayer=void 0,i(89);var r=i(194);class n{static setupStorage(t,e,i,r,n){let s=r.getValue(e,{value:null});switch(i.name){case"textarea":if(null!==s.value&&(t.textContent=s.value),"print"===n)break;t.addEventListener("input",t=>{r.setValue(e,{value:t.target.value})});break;case"input":if("radio"===i.attributes.type||"checkbox"===i.attributes.type){if(s.value===i.attributes.xfaOn?t.setAttribute("checked",!0):s.value===i.attributes.xfaOff&&t.removeAttribute("checked"),"print"===n)break;t.addEventListener("change",t=>{r.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=>{r.setValue(e,{value:t.target.value})})}break;case"select":if(null!==s.value)for(let e of(t.setAttribute("value",s.value),i.children))e.attributes.value===s.value?e.attributes.selected=!0:e.attributes.hasOwnProperty("selected")&&delete e.attributes.selected;t.addEventListener("input",t=>{let i=t.target.options,n=-1===i.selectedIndex?"":i[i.selectedIndex].value;r.setValue(e,{value:n})})}}static setAttributes(t){let{html:e,element:i,storage:r=null,intent:n,linkService:s}=t,{attributes:a}=i,o=e instanceof HTMLAnchorElement;for(let[t,i]of("radio"===a.type&&(a.name=`${a.name}-${n}`),Object.entries(a)))if(null!=i)switch(t){case"class":i.length&&e.setAttribute(t,i.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",i);break;case"style":Object.assign(e.style,i);break;case"textContent":e.textContent=i;break;default:o&&("href"===t||"newWindow"===t)||e.setAttribute(t,i)}o&&s.addLinkAttributes(e,a.href,a.newWindow),r&&a.dataId&&this.setupStorage(e,a.dataId,i,r)}static render(t){let e=t.annotationStorage,i=t.linkService,n=t.xfaHtml,s=t.intent||"display",a=document.createElement(n.name);n.attributes&&this.setAttributes({html:a,element:n,intent:s,linkService:i});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;){let[t,n,a]=o.at(-1);if(n+1===t.children.length){o.pop();continue}let l=t.children[++o.at(-1)[1]];if(null===l)continue;let{name:d}=l;if("#text"===d){let t=document.createTextNode(l.value);h.push(t),a.append(t);continue}let c=l?.attributes?.xmlns?document.createElementNS(l.attributes.xmlns,d):document.createElement(d);if(a.append(c),l.attributes&&this.setAttributes({html:c,element:l,storage:e,intent:s,linkService:i}),l.children&&l.children.length>0)o.push([l,-1,c]);else if(l.value){let t=document.createTextNode(l.value);r.XfaText.shouldBuildText(d)&&h.push(t),c.append(t)}}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,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InkEditor=void 0,i(89),i(2);var r=i(1),n=i(164),s=i(198),a=i(168),o=i(165);class l extends n.AnnotationEditor{#iu=0;#ip=0;#ig=this.canvasPointermove.bind(this);#im=this.canvasPointerleave.bind(this);#ib=this.canvasPointerup.bind(this);#iv=this.canvasPointerdown.bind(this);#iA=new Path2D;#iy=!1;#i_=!1;#iS=!1;#iE=null;#ix=0;#iw=0;#iC=null;static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=1;static _type="ink";constructor(t){super({...t,name:"inkEditor"}),this.color=t.color||null,this.thickness=t.thickness||null,this.opacity=t.opacity||null,this.paths=[],this.bezierPath2D=[],this.allRawPaths=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0,this._willKeepAspectRatio=!0}static initialize(t){n.AnnotationEditor.initialize(t,{strings:["editor_ink_canvas_aria_label","editor_ink2_aria_label"]})}static updateDefaultParams(t,e){switch(t){case r.AnnotationEditorParamsType.INK_THICKNESS:l._defaultThickness=e;break;case r.AnnotationEditorParamsType.INK_COLOR:l._defaultColor=e;break;case r.AnnotationEditorParamsType.INK_OPACITY:l._defaultOpacity=e/100}}updateParams(t,e){switch(t){case r.AnnotationEditorParamsType.INK_THICKNESS:this.#iT(e);break;case r.AnnotationEditorParamsType.INK_COLOR:this.#eL(e);break;case r.AnnotationEditorParamsType.INK_OPACITY:this.#iP(e)}}static get defaultPropertiesToUpdate(){return[[r.AnnotationEditorParamsType.INK_THICKNESS,l._defaultThickness],[r.AnnotationEditorParamsType.INK_COLOR,l._defaultColor||n.AnnotationEditor._defaultLineColor],[r.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*l._defaultOpacity)]]}get propertiesToUpdate(){return[[r.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||l._defaultThickness],[r.AnnotationEditorParamsType.INK_COLOR,this.color||l._defaultColor||n.AnnotationEditor._defaultLineColor],[r.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(this.opacity??l._defaultOpacity))]]}#iT(t){let e=this.thickness;this.addCommands({cmd:()=>{this.thickness=t,this.#iM()},undo:()=>{this.thickness=e,this.#iM()},mustExec:!0,type:r.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}#eL(t){let e=this.color;this.addCommands({cmd:()=>{this.color=t,this.#ik()},undo:()=>{this.color=e,this.#ik()},mustExec:!0,type:r.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}#iP(t){t/=100;let e=this.opacity;this.addCommands({cmd:()=>{this.opacity=t,this.#ik()},undo:()=>{this.opacity=e,this.#ik()},mustExec:!0,type:r.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.canvas||(this.#iR(),this.#iF()),this.isAttachedToDOM||(this.parent.add(this),this.#iI()),this.#iM()))}remove(){null!==this.canvas&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,this.#iE.disconnect(),this.#iE=null,super.remove())}setParent(t){!this.parent&&t?this._uiManager.removeShouldRescale(this):this.parent&&null===t&&this._uiManager.addShouldRescale(this),super.setParent(t)}onScaleChanging(){let[t,e]=this.parentDimensions,i=this.width*t,r=this.height*e;this.setDimensions(i,r)}
3enableEditMode(){this.#iy||null===this.canvas||(super.enableEditMode(),this._isDraggable=!1,this.canvas.addEventListener("pointerdown",this.#iv))}disableEditMode(){this.isInEditMode()&&null!==this.canvas&&(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",this.#iv))}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}#iD(){let{parentRotation:t,parentDimensions:[e,i]}=this;switch(t){case 90:return[0,i,i,e];case 180:return[e,i,e,i];case 270:return[e,0,i,e];default:return[0,0,e,i]}}#iO(){let{ctx:t,color:e,opacity:i,thickness:r,parentScale:n,scaleFactor:s}=this;t.lineWidth=r*n/s,t.lineCap="round",t.lineJoin="round",t.miterLimit=10,t.strokeStyle=`${e}${(0,o.opacityToHex)(i)}`}#iL(t,e){this.canvas.addEventListener("contextmenu",a.noContextMenu),this.canvas.addEventListener("pointerleave",this.#im),this.canvas.addEventListener("pointermove",this.#ig),this.canvas.addEventListener("pointerup",this.#ib),this.canvas.removeEventListener("pointerdown",this.#iv),this.isEditing=!0,this.#iS||(this.#iS=!0,this.#iI(),this.thickness||=l._defaultThickness,this.color||=l._defaultColor||n.AnnotationEditor._defaultLineColor,this.opacity??=l._defaultOpacity),this.currentPath.push([t,e]),this.#i_=!1,this.#iO(),this.#iC=()=>{this.#iN(),this.#iC&&window.requestAnimationFrame(this.#iC)},window.requestAnimationFrame(this.#iC)}#iB(t,e){let[i,r]=this.currentPath.at(-1);if(this.currentPath.length>1&&t===i&&e===r)return;let n=this.currentPath,s=this.#iA;if(n.push([t,e]),this.#i_=!0,n.length<=2){s.moveTo(...n[0]),s.lineTo(t,e);return}3===n.length&&(this.#iA=s=new Path2D,s.moveTo(...n[0])),this.#iU(s,...n.at(-3),...n.at(-2),t,e)}#ij(){if(0===this.currentPath.length)return;let t=this.currentPath.at(-1);this.#iA.lineTo(...t)}#iz(t,e){let i;if(this.#iC=null,t=Math.min(Math.max(t,0),this.canvas.width),e=Math.min(Math.max(e,0),this.canvas.height),this.#iB(t,e),this.#ij(),1!==this.currentPath.length)i=this.#iH();else{let r=[t,e];i=[[r,r.slice(),r.slice(),r]]}let r=this.#iA,n=this.currentPath;this.currentPath=[],this.#iA=new Path2D;let s=()=>{this.allRawPaths.push(n),this.paths.push(i),this.bezierPath2D.push(r),this.rebuild()},a=()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),0===this.paths.length?this.remove():(this.canvas||(this.#iR(),this.#iF()),this.#iM())};this.addCommands({cmd:s,undo:a,mustExec:!0})}#iN(){if(!this.#i_)return;this.#i_=!1,this.thickness,this.parentScale;let t=this.currentPath.slice(-3),{ctx:e}=(t.map(t=>t[0]),t.map(t=>t[1]),this);for(let t of(e.save(),e.clearRect(0,0,this.canvas.width,this.canvas.height),this.bezierPath2D))e.stroke(t);e.stroke(this.#iA),e.restore()}#iU(t,e,i,r,n,s,a){let o=(e+r)/2,l=(i+n)/2,h=(r+s)/2,d=(n+a)/2;t.bezierCurveTo(o+2*(r-o)/3,l+2*(n-l)/3,h+2*(r-h)/3,d+2*(n-d)/3,h,d)}#iH(){let t;let e=this.currentPath;if(e.length<=2)return[[e[0],e[0],e.at(-1),e.at(-1)]];let i=[],[r,n]=e[0];for(t=1;t<e.length-2;t++){let[s,a]=e[t],[o,l]=e[t+1],h=(s+o)/2,d=(a+l)/2,c=[r+2*(s-r)/3,n+2*(a-n)/3],u=[h+2*(s-h)/3,d+2*(a-d)/3];i.push([[r,n],c,u,[h,d]]),[r,n]=[h,d]}let[s,a]=e[t],[o,l]=e[t+1],h=[r+2*(s-r)/3,n+2*(a-n)/3],d=[o+2*(s-o)/3,l+2*(a-l)/3];return i.push([[r,n],h,d,[o,l]]),i}#ik(){if(this.isEmpty()){this.#iG();return}this.#iO();let{canvas:t,ctx:e}=this;for(let i of(e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,t.width,t.height),this.#iG(),this.bezierPath2D))e.stroke(i)}commit(){this.#iy||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),this.#iy=!0,this.div.classList.add("disabled"),this.#iM(!0),this.makeResizable(),this.parent.addInkEditorIfNeeded(!0),this.moveInDOM(),this.div.focus({preventScroll:!0}))}focusin(t){this._focusEventsAllowed&&(super.focusin(t),this.enableEditMode())}canvasPointerdown(t){0===t.button&&this.isInEditMode()&&!this.#iy&&(this.setInForeground(),t.preventDefault(),"mouse"!==t.type&&this.div.focus(),this.#iL(t.offsetX,t.offsetY))}canvasPointermove(t){t.preventDefault(),this.#iB(t.offsetX,t.offsetY)}canvasPointerup(t){t.preventDefault(),this.#iW(t)}canvasPointerleave(t){this.#iW(t)}#iW(t){this.canvas.removeEventListener("pointerleave",this.#im),this.canvas.removeEventListener("pointermove",this.#ig),this.canvas.removeEventListener("pointerup",this.#ib),this.canvas.addEventListener("pointerdown",this.#iv),setTimeout(()=>{this.canvas.removeEventListener("contextmenu",a.noContextMenu)},10),this.#iz(t.offsetX,t.offsetY),this.addToAnnotationStorage(),this.setInBackgroun
3d()}#iR(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",n.AnnotationEditor._l10nPromise.get("editor_ink_canvas_aria_label").then(t=>this.canvas?.setAttribute("aria-label",t)),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")}#iF(){this.#iE=new ResizeObserver(t=>{let e=t[0].contentRect;e.width&&e.height&&this.setDimensions(e.width,e.height)}),this.#iE.observe(this.div)}get isResizable(){return!this.isEmpty()&&this.#iy}render(){let t,e;if(this.div)return this.div;this.width&&(t=this.x,e=this.y),super.render(),n.AnnotationEditor._l10nPromise.get("editor_ink2_aria_label").then(t=>this.div?.setAttribute("aria-label",t));let[i,r,s,a]=this.#iD();if(this.setAt(i,r,0,0),this.setDims(s,a),this.#iR(),this.width){let[i,r]=this.parentDimensions;this.setAspectRatio(this.width*i,this.height*r),this.setAt(t*i,e*r,this.width*i,this.height*r),this.#iS=!0,this.#iI(),this.setDims(this.width*i,this.height*r),this.#ik(),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return this.#iF(),this.div}#iI(){if(!this.#iS)return;let[t,e]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*t),this.canvas.height=Math.ceil(this.height*e),this.#iG()}setDimensions(t,e){let i=Math.round(t),r=Math.round(e);if(this.#ix===i&&this.#iw===r)return;this.#ix=i,this.#iw=r,this.canvas.style.visibility="hidden";let[n,s]=this.parentDimensions;this.width=t/n,this.height=e/s,this.fixAndSetPosition(),this.#iy&&this.#iV(t,e),this.#iI(),this.#ik(),this.canvas.style.visibility="visible",this.fixDims()}#iV(t,e){let i=this.#i$(),r=(t-i)/this.#ip,n=(e-i)/this.#iu;this.scaleFactor=Math.min(r,n)}#iG(){let t=this.#i$()/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+t,this.translationY*this.scaleFactor+t)}static #iq(t){let e=new Path2D;for(let i=0,r=t.length;i<r;i++){let[r,n,s,a]=t[i];0===i&&e.moveTo(...r),e.bezierCurveTo(n[0],n[1],s[0],s[1],a[0],a[1])}return e}static #iX(t,e,i){let[r,n,s,a]=e;switch(i){case 0:for(let e=0,i=t.length;e<i;e+=2)t[e]+=r,t[e+1]=a-t[e+1];break;case 90:for(let e=0,i=t.length;e<i;e+=2){let i=t[e];t[e]=t[e+1]+r,t[e+1]=i+n}break;case 180:for(let e=0,i=t.length;e<i;e+=2)t[e]=s-t[e],t[e+1]+=n;break;case 270:for(let e=0,i=t.length;e<i;e+=2){let i=t[e];t[e]=s-t[e+1],t[e+1]=a-i}break;default:throw Error("Invalid rotation")}return t}static #iK(t,e,i){let[r,n,s,a]=e;switch(i){case 0:for(let e=0,i=t.length;e<i;e+=2)t[e]-=r,t[e+1]=a-t[e+1];break;case 90:for(let e=0,i=t.length;e<i;e+=2){let i=t[e];t[e]=t[e+1]-n,t[e+1]=i-r}break;case 180:for(let e=0,i=t.length;e<i;e+=2)t[e]=s-t[e],t[e+1]-=n;break;case 270:for(let e=0,i=t.length;e<i;e+=2){let i=t[e];t[e]=a-t[e+1],t[e+1]=s-i}break;default:throw Error("Invalid rotation")}return t}#iY(t,e,i,r){let n=[],s=this.thickness/2,a=t*e+s,o=t*i+s;for(let e of this.paths){let i=[],s=[];for(let r=0,n=e.length;r<n;r++){let[l,h,d,c]=e[r],u=t*l[0]+a,p=t*l[1]+o,f=t*h[0]+a,g=t*h[1]+o,m=t*d[0]+a,b=t*d[1]+o,v=t*c[0]+a,A=t*c[1]+o;0===r&&(i.push(u,p),s.push(u,p)),i.push(f,g,m,b,v,A),s.push(f,g),r===n-1&&s.push(v,A)}n.push({bezier:l.#iX(i,r,this.rotation),points:l.#iX(s,r,this.rotation)})}return n}#iJ(){let t=1/0,e=-1/0,i=1/0,n=-1/0;for(let s of this.paths)for(let[a,o,l,h]of s){let s=r.Util.bezierBoundingBox(...a,...o,...l,...h);t=Math.min(t,s[0]),i=Math.min(i,s[1]),e=Math.max(e,s[2]),n=Math.max(n,s[3])}return[t,i,e,n]}#i$(){return this.#iy?Math.ceil(this.thickness*this.parentScale):0}#iM(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return;if(!this.#iy){this.#ik();return}let e=this.#iJ(),i=this.#i$();this.#ip=Math.max(n.AnnotationEditor.MIN_SIZE,e[2]-e[0]),this.#iu=Math.max(n.AnnotationEditor.MIN_SIZE,e[3]-e[1]);let r=Math.ceil(i+this.#ip*this.scaleFactor),s=Math.ceil(i+this.#iu*this.scaleFactor),[a,o]=this.parentDimensions;this.width=r/a,this.height=s/o,this.setAspectRatio(r,s);let l=this.translationX,h=this.translationY;this.translationX=-e[0],this.translationY=-e[1],this.#iI(),this.#ik(),this.#ix=r,this.#iw=s,this.setDims(r,s);let d=t?i/this.scaleFactor/2:0;this.translate(l-this.translationX-d,h-this.translationY-d)}static deserialize(t,e,i){if(t instanceof s.InkAnnotationElement)return null;let a=super.deserialize(t,e,i);a.thickness=t.thickness,a.color=r.Util.makeHexColor(...t.color),a.opacity=t.opacity;let[o,h]=a.pageDimensions,d=a.width*o,c=a.height*h,u=a.parentScale,p=t.thickness/2;a.#iy=!0,a.#ix=Math.round(d),a.#iw=Math.round(c);let{paths:f,rect:g,rotation:m}=t;for(let{bezier:t}of f){t=l.#iK(t,g,m);let e=[];a.paths.push(e);let i=u*(t[0]-p),r=u*(t[1]-p);for(let n=2,s=t.length;n<s;n+=6){let s=u*(t[n]-p),a=u*(t[n+1]-p),o=u*(t[n+2]-p),l=u*(t[n+3]-p),h=u*(t[n+4]-p),d=u*(t[n+5]-p);e.push([[i,r],[s,a],[o,l],[h,d]]),i=h,r=d}let n=this.#iq(e);a.bezierPath2D.push(n)}let b=a.#iJ();return a.#ip=Math.max(n.AnnotationEditor.MIN_SIZE,b[2]-b[0]),a.#iu=Math.max(n.AnnotationEditor.MIN_SIZE,b[3]-b[1]),a.#iV(d,c),a}serialize(){if(this.isEmpty())return null;let t=this.getRect(0,0),e=n.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);return{annotationType:r.AnnotationEditorType.INK,color:e,thickness:this.thickness,opacity:this.opacity,paths:this.#iY(this.scaleFactor/this.parentScale,this.translationX,this.translationY,t),pageIndex:this.pageIndex,rect:t,rotation:this.rotation,structTreeParentId:this._structTreeParentId}}}e.InkEditor=l},(t,e,i)=>
3{Object.defineProperty(e,"__esModule",{value:!0}),e.StampEditor=void 0,i(149),i(152);var r=i(1),n=i(164),s=i(168),a=i(198);class o extends n.AnnotationEditor{#iQ=null;#iZ=null;#i0=null;#i1=null;#i2=null;#i3=null;#iE=null;#i4=null;#i5=!1;#i8=!1;static _type="stamp";constructor(t){super({...t,name:"stampEditor"}),this.#i1=t.bitmapUrl,this.#i2=t.bitmapFile}static initialize(t){n.AnnotationEditor.initialize(t)}static get supportedTypes(){let t=["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"];return(0,r.shadow)(this,"supportedTypes",t.map(t=>`image/${t}`))}static get supportedTypesStr(){return(0,r.shadow)(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(t){return this.supportedTypes.includes(t)}static paste(t,e){e.pasteEditor(r.AnnotationEditorType.STAMP,{bitmapFile:t.getAsFile()})}#i6(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t){this.remove();return}this.#iQ=t.bitmap,e||(this.#iZ=t.id,this.#i5=t.isSvg),this.#iR()}#i7(){this.#i0=null,this._uiManager.enableWaiting(!1),this.#i3&&this.div.focus()}#i9(){if(this.#iZ){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(this.#iZ).then(t=>this.#i6(t,!0)).finally(()=>this.#i7());return}if(this.#i1){let t=this.#i1;this.#i1=null,this._uiManager.enableWaiting(!0),this.#i0=this._uiManager.imageManager.getFromUrl(t).then(t=>this.#i6(t)).finally(()=>this.#i7());return}if(this.#i2){let t=this.#i2;this.#i2=null,this._uiManager.enableWaiting(!0),this.#i0=this._uiManager.imageManager.getFromFile(t).then(t=>this.#i6(t)).finally(()=>this.#i7());return}let t=document.createElement("input");t.type="file",t.accept=o.supportedTypesStr,this.#i0=new Promise(e=>{t.addEventListener("change",async()=>{if(t.files&&0!==t.files.length){this._uiManager.enableWaiting(!0);let e=await this._uiManager.imageManager.getFromFile(t.files[0]);this.#i6(e)}else this.remove();e()}),t.addEventListener("cancel",()=>{this.remove(),e()})}).finally(()=>this.#i7()),t.click()}remove(){this.#iZ&&(this.#iQ=null,this._uiManager.imageManager.deleteId(this.#iZ),this.#i3?.remove(),this.#i3=null,this.#iE?.disconnect(),this.#iE=null),super.remove()}rebuild(){if(!this.parent){this.#iZ&&this.#i9();return}super.rebuild(),null!==this.div&&(this.#iZ&&this.#i9(),this.isAttachedToDOM||this.parent.add(this))}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(this.#i0||this.#iQ||this.#i1||this.#i2)}get isResizable(){return!0}render(){let t,e;if(this.div)return this.div;if(this.width&&(t=this.x,e=this.y),super.render(),this.div.hidden=!0,this.#iQ?this.#iR():this.#i9(),this.width){let[i,r]=this.parentDimensions;this.setAt(t*i,e*r,this.width*i,this.height*r)}return this.div}#iR(){let{div:t}=this,{width:e,height:i}=this.#iQ,[r,n]=this.pageDimensions,s=.75;if(this.width)e=this.width*r,i=this.height*n;else if(e>s*r||i>s*n){let t=Math.min(s*r/e,s*n/i);e*=t,i*=t}let[a,o]=this.parentDimensions;this.setDims(e*a/r,i*o/n),this._uiManager.enableWaiting(!1);let l=this.#i3=document.createElement("canvas");t.append(l),t.hidden=!1,this.#rt(e,i),this.#iF(),this.#i8||(this.parent.addUndoableEditor(this),this.#i8=!0),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"inserted_image"}}}),this.addAltTextButton()}#re(t,e){let[i,r]=this.parentDimensions;this.width=t/i,this.height=e/r,this.setDims(t,e),this._initialOptions?.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,null!==this.#i4&&clearTimeout(this.#i4);let n=200;this.#i4=setTimeout(()=>{this.#i4=null,this.#rt(t,e)},n)}#ri(t,e){let{width:i,height:r}=this.#iQ,n=i,s=r,a=this.#iQ;for(;n>2*t||s>2*e;){let i=n,r=s;n>2*t&&(n=n>=16384?Math.floor(n/2)-1:Math.ceil(n/2)),s>2*e&&(s=s>=16384?Math.floor(s/2)-1:Math.ceil(s/2));let o=new OffscreenCanvas(n,s);o.getContext("2d").drawImage(a,0,0,i,r,0,0,n,s),a=o.transferToImageBitmap()}return a}#rt(t,e){t=Math.ceil(t),e=Math.ceil(e);let i=this.#i3;if(!i||i.width===t&&i.height===e)return;i.width=t,i.height=e;let r=this.#i5?this.#iQ:this.#ri(t,e),n=i.getContext("2d");n.filter=this._uiManager.hcmFilter,n.drawImage(r,0,0,r.width,r.height,0,0,t,e)}
3#rr(t){if(t){if(this.#i5){let t=this._uiManager.imageManager.getSvgUrl(this.#iZ);if(t)return t}let t=document.createElement("canvas");return{width:t.width,height:t.height}=this.#iQ,t.getContext("2d").drawImage(this.#iQ,0,0),t.toDataURL()}if(this.#i5){let[t,e]=this.pageDimensions,i=Math.round(this.width*t*s.PixelsPerInch.PDF_TO_CSS_UNITS),r=Math.round(this.height*e*s.PixelsPerInch.PDF_TO_CSS_UNITS),n=new OffscreenCanvas(i,r);return n.getContext("2d").drawImage(this.#iQ,0,0,this.#iQ.width,this.#iQ.height,0,0,i,r),n.transferToImageBitmap()}return structuredClone(this.#iQ)}#iF(){this.#iE=new ResizeObserver(t=>{let e=t[0].contentRect;e.width&&e.height&&this.#re(e.width,e.height)}),this.#iE.observe(this.div)}static deserialize(t,e,i){if(t instanceof a.StampAnnotationElement)return null;let r=super.deserialize(t,e,i),{rect:n,bitmapUrl:s,bitmapId:o,isSvg:l,accessibilityData:h}=t;o&&i.imageManager.isValidId(o)?r.#iZ=o:r.#i1=s,r.#i5=l;let[d,c]=r.pageDimensions;return r.width=(n[2]-n[0])/d,r.height=(n[3]-n[1])/c,h&&(r.altTextData=h),r}serialize(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.isEmpty())return null;let i={annotationType:r.AnnotationEditorType.STAMP,bitmapId:this.#iZ,pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:this.#i5,structTreeParentId:this._structTreeParentId};if(t)return i.bitmapUrl=this.#rr(!0),i.accessibilityData=this.altTextData,i;let{decorative:n,altText:s}=this.altTextData;if(!n&&s&&(i.accessibilityData={type:"Figure",alt:s}),null===e)return i;e.stamps||=new Map;let a=this.#i5?(i.rect[2]-i.rect[0])*(i.rect[3]-i.rect[1]):null;if(e.stamps.has(this.#iZ)){if(this.#i5){let t=e.stamps.get(this.#iZ);a>t.area&&(t.area=a,t.serialized.bitmap.close(),t.serialized.bitmap=this.#rr(!1))}}else e.stamps.set(this.#iZ,{area:a,serialized:i}),i.bitmap=this.#rr(!1);return i}}e.StampEditor=o}],__webpack_module_cache__={};function __w_pdfjs_require__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var i=__webpack_module_cache__[t]={exports:{}};return __webpack_modules__[t].call(i.exports,i,i.exports,__w_pdfjs_require__),i.exports}var __nested_webpack_exports__={};return(()=>{var t=__nested_webpack_exports__;Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"AbortException",{enumerable:!0,get:function(){return e.AbortException}}),Object.defineProperty(t,"AnnotationEditorLayer",{enumerable:!0,get:function(){return s.AnnotationEditorLayer}}),Object.defineProperty(t,"AnnotationEditorParamsType",{enumerable:!0,get:function(){return e.AnnotationEditorParamsType}}),Object.defineProperty(t,"AnnotationEditorType",{enumerable:!0,get:function(){return e.AnnotationEditorType}}),Object.defineProperty(t,"AnnotationEditorUIManager",{enumerable:!0,get:function(){return a.AnnotationEditorUIManager}}),Object.defineProperty(t,"AnnotationLayer",{enumerable:!0,get:function(){return o.AnnotationLayer}}),Object.defineProperty(t,"AnnotationMode",{enumerable:!0,get:function(){return e.AnnotationMode}}),Object.defineProperty(t,"CMapCompressionType",{enumerable:!0,get:function(){return e.CMapCompressionType}}),Object.defineProperty(t,"DOMSVGFactory",{enumerable:!0,get:function(){return r.DOMSVGFactory}}),Object.defineProperty(t,"FeatureTest",{enumerable:!0,get:function(){return e.FeatureTest}}),Object.defineProperty(t,"GlobalWorkerOptions",{enumerable:!0,get:function(){return l.GlobalWorkerOptions}}),Object.defineProperty(t,"ImageKind",{enumerable:!0,get:function(){return e.ImageKind}}),Object.defineProperty(t,"InvalidPDFException",{enumerable:!0,get:function(){return e.InvalidPDFException}}),Object.defineProperty(t,"MissingPDFException",{enumerable:!0,get:function(){return e.MissingPDFException}}),Object.defineProperty(t,"OPS",{enumerable:!0,get:function(){return e.OPS}}),Object.defineProperty(t,"PDFDataRangeTransport",{enumerable:!0,get:function(){return i.PDFDataRangeTransport}}),Object.defineProperty(t,"PDFDateString",{enumerable:!0,get:function(){return r.PDFDateString}}),Object.defineProperty(t,"PDFWorker",{enumerable:!0,get:function(){return i.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 r.PixelsPerInch}}),Object.defineProperty(t,"PromiseCapability",{enumerable:!0,get:function(){return e.PromiseCapability}}),Object.defineProperty(t,"RenderingCancelledException",{enumerable:!0,get:function(){return r.RenderingCancelledException}}),Object.defineProperty(t,"SVGGraphics",{enumerable:!0,get:function(){return i.SVGGraphics}}),Object.defineProperty(t,"UnexpectedResponseException",{enumerable:!0,get:function(){return e.UnexpectedResponseException}}),Object.defineProperty(t,"Util",{enumerable:!0,get:function(){return e.Util}}),Object.defineProperty(t,"VerbosityLevel",{enumerable:!0,get:function(){return e.VerbosityLevel}}
3),Object.defineProperty(t,"XfaLayer",{enumerable:!0,get:function(){return h.XfaLayer}}),Object.defineProperty(t,"build",{enumerable:!0,get:function(){return i.build}}),Object.defineProperty(t,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return e.createValidAbsoluteUrl}}),Object.defineProperty(t,"getDocument",{enumerable:!0,get:function(){return i.getDocument}}),Object.defineProperty(t,"getFilenameFromUrl",{enumerable:!0,get:function(){return r.getFilenameFromUrl}}),Object.defineProperty(t,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return r.getPdfFilenameFromUrl}}),Object.defineProperty(t,"getXfaPageViewport",{enumerable:!0,get:function(){return r.getXfaPageViewport}}),Object.defineProperty(t,"isDataScheme",{enumerable:!0,get:function(){return r.isDataScheme}}),Object.defineProperty(t,"isPdfFile",{enumerable:!0,get:function(){return r.isPdfFile}}),Object.defineProperty(t,"loadScript",{enumerable:!0,get:function(){return r.loadScript}}),Object.defineProperty(t,"noContextMenu",{enumerable:!0,get:function(){return r.noContextMenu}}),Object.defineProperty(t,"normalizeUnicode",{enumerable:!0,get:function(){return e.normalizeUnicode}}),Object.defineProperty(t,"renderTextLayer",{enumerable:!0,get:function(){return n.renderTextLayer}}),Object.defineProperty(t,"setLayerDimensions",{enumerable:!0,get:function(){return r.setLayerDimensions}}),Object.defineProperty(t,"shadow",{enumerable:!0,get:function(){return e.shadow}}),Object.defineProperty(t,"updateTextLayer",{enumerable:!0,get:function(){return n.updateTextLayer}}),Object.defineProperty(t,"version",{enumerable:!0,get:function(){return i.version}});var e=__w_pdfjs_require__(1),i=__w_pdfjs_require__(124),r=__w_pdfjs_require__(168),n=__w_pdfjs_require__(195),s=__w_pdfjs_require__(196),a=__w_pdfjs_require__(165),o=__w_pdfjs_require__(198),l=__w_pdfjs_require__(176),h=__w_pdfjs_require__(201)})(),__nested_webpack_exports__})())}}]);
4//# sourceMappingURL=e991514e.a390fbf7f08f4154.js.map

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.