Files
anonymous_github/public/script/pdf.min.js
T

2 lines
349 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=t.pdfjsLib=e():"function"==typeof define&&define.amd?define("pdfjs-dist/build/pdf",[],()=>t.pdfjsLib=e()):"object"==typeof exports?exports["pdfjs-dist/build/pdf"]=t.pdfjsLib=e():t["pdfjs-dist/build/pdf"]=t.pdfjsLib=e()}(globalThis,()=>(()=>{"use strict";var __webpack_modules__=[,(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.VerbosityLevel=e.Util=e.UnknownErrorException=e.UnexpectedResponseException=e.TextRenderingMode=e.RenderingIntentFlag=e.PromiseCapability=e.PermissionFlag=e.PasswordResponses=e.PasswordException=e.PageActionEventType=e.OPS=e.MissingPDFException=e.MAX_IMAGE_SIZE_TO_CACHE=e.LINE_FACTOR=e.LINE_DESCENT_FACTOR=e.InvalidPDFException=e.ImageKind=e.IDENTITY_MATRIX=e.FormatError=e.FeatureTest=e.FONT_IDENTITY_MATRIX=e.DocumentActionEventType=e.CMapCompressionType=e.BaseException=e.BASELINE_FACTOR=e.AnnotationType=e.AnnotationReplyType=e.AnnotationPrefix=e.AnnotationMode=e.AnnotationFlag=e.AnnotationFieldFlag=e.AnnotationEditorType=e.AnnotationEditorPrefix=e.AnnotationEditorParamsType=e.AnnotationBorderStyleType=e.AnnotationActionEventType=e.AbortException=void 0,e.assert=function(t,e){t||n(e)},e.bytesToString=h,e.createValidAbsoluteUrl=function(t){let e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(t)try{if(r&&"string"==typeof t){if(r.addDefaultProtocol&&t.startsWith("www.")){const e=t.match(/\./g);2<=e?.length&&(t="http://"+t)}if(r.tryConvertEncoding)try{t=p(t)}catch{}}var i=e?new URL(t,e):new URL(t);if(function(t){switch(t?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return 1;default:return}}(i))return i}catch{}return null},e.getModificationDate=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new Date;return[t.getUTCFullYear().toString(),(t.getUTCMonth()+1).toString().padStart(2,"0"),t.getUTCDate().toString().padStart(2,"0"),t.getUTCHours().toString().padStart(2,"0"),t.getUTCMinutes().toString().padStart(2,"0"),t.getUTCSeconds().toString().padStart(2,"0")].join("")},e.getUuid=function(){if("undefined"!=typeof crypto&&"function"==typeof crypto?.randomUUID)return crypto.randomUUID();var e=new Uint8Array(32);if("undefined"!=typeof crypto&&"function"==typeof crypto?.getRandomValues)crypto.getRandomValues(e);else for(let t=0;t<32;t++)e[t]=Math.floor(255*Math.random());return h(e)},e.getVerbosityLevel=function(){return s},e.info=function(t){s>=i.INFOS&&console.log("Info: "+t)},e.isArrayBuffer=function(t){return"object"==typeof t&&void 0!==t?.byteLength},e.isArrayEqual=function(r,i){if(r.length!==i.length)return!1;for(let t=0,e=r.length;t<e;t++)if(r[t]!==i[t])return!1;return!0},e.isNodeJS=void 0,e.normalizeUnicode=function(t){return f||(f=/([\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,g=new Map([["ſt","ſt"]])),t.replaceAll(f,(t,e,r)=>e?e.normalize("NFKC"):g.get(r))},e.objectFromMap=function(t){var e,r,i=Object.create(null);for([e,r]of t)i[e]=r;return i},e.objectSize=function(t){return Object.keys(t).length},e.setVerbosityLevel=function(t){Number.isInteger(t)&&(s=t)},e.shadow=o,e.string32=function(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,255&t)},e.stringToBytes=c,e.stringToPDFString=function(r){if("ï"<=r[0]){let t;if("þ"===r[0]&&"ÿ"===r[1]?t="utf-16be":"ÿ"===r[0]&&"þ"===r[1]?t="utf-16le":"ï"===r[0]&&"»"===r[1]&&"¿"===r[2]&&(t="utf-8"),t)try{var e=new TextDecoder(t,{fatal:!0}),i=c(r);return e.decode(i)}catch(r){a(`stringToPDFString: "${r}".`)}}var s=[];for(let t=0,e=r.length;t<e;t++){var n=u[r.charCodeAt(t)];s.push(n?String.fromCharCode(n):r.charAt(t))}return s.join("")},e.stringToUTF8String=p,e.unreachable=n,e.utf8StringToString=function(t){return unescape(encodeURIComponent(t))},e.warn=a,r(2),r(84),r(86),r(87),r(89),r(93),r(101),r(102),r(105),r(107),r(109),r(113),r(116),r(123);r=!("object"!=typeof process||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type);e.isNodeJS=r,e.IDENTITY_MATRIX=[1,0,0,1,0,0],e.FONT_IDENTITY_MATRIX=[.001,0,0,.001,0,0],e.MAX_IMAGE_SIZE_TO_CACHE=1e7,e.LINE_FACTOR=1.35,e.LINE_DESCENT_FACTOR=.35,e.BASELINE_FACTOR=.25925925925925924,e.RenderingIntentFlag={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256},e.AnnotationMode={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},e.AnnotationEditorPrefix="pdfjs_internal_editor_",e.AnnotationEditorType={DISABLE:-1,NONE:0,FREETEXT:3,STAMP:13,INK:15},e.AnnotationEditorParamsType={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23},e.PermissionFlag={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},e.TextRenderingMode={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},e.ImageKind={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},e.AnnotationType={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26},e.AnnotationReplyType={GROUP:"Group",REPLY:"R"},e.AnnotationFlag={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512},e.AnnotationFieldFlag={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864},e.AnnotationBorderStyleType={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},e.AnnotationActionEventType={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"},e.DocumentActionEventType={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"},e.PageActionEventType={O:"PageOpen",C:"PageClose"};const i={ERRORS:0,WARNINGS:1,INFOS:5};e.VerbosityLevel=i,e.CMapCompressionType={NONE:0,BINARY:1},e.OPS={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91},e.PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let s=i.WARNINGS;function a(t){s>=i.WARNINGS&&console.log("Warning: "+t)}function n(t){throw new Error(t)}function o(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!(3<arguments.length&&void 0!==arguments[3]&&arguments[3]),configurable:!0,writable:!1}),r}l.prototype=new Error;r=l.constructor=l;function l(t,e){this.constructor===l&&n("Cannot initialize BaseException."),this.message=t,this.name=e}function h(e){"object"==typeof e&&void 0!==e?.length||n("Invalid argument for bytesToString");var r=e.length;if(r<8192)return String.fromCharCode.apply(null,e);var i=[];for(let t=0;t<r;t+=8192){var s=Math.min(t+8192,r),s=e.subarray(t,s);i.push(String.fromCharCode.apply(null,s))}return i.join("")}function c(e){"string"!=typeof e&&n("Invalid argument for stringToBytes");var r=e.length,i=new Uint8Array(r);for(let t=0;t<r;++t)i[t]=255&e.charCodeAt(t);return i}e.BaseException=r,e.PasswordException=class extends r{constructor(t,e){super(t,"PasswordException"),this.code=e}},e.UnknownErrorException=class extends r{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}},e.InvalidPDFException=class extends r{constructor(t){super(t,"InvalidPDFException")}},e.MissingPDFException=class extends r{constructor(t){super(t,"MissingPDFException")}},e.UnexpectedResponseException=class extends r{constructor(t,e){super(t,"UnexpectedResponseException"),this.status=e}},e.FormatError=class extends r{constructor(t){super(t,"FormatError")}},e.AbortException=class extends r{constructor(t){super(t,"AbortException")}},e.FeatureTest=class{static get isLittleEndian(){return o(this,"isLittleEndian",((t=new Uint8Array(4))[0]=1)===new Uint32Array(t.buffer,0,1)[0]);var t}static get isEvalSupported(){return o(this,"isEvalSupported",function(){try{return new Function(""),!0}catch{return!1}}())}static get isOffscreenCanvasSupported(){return o(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}static get platform(){return"undefined"==typeof navigator?o(this,"platform",{isWin:!1,isMac:!1}):o(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}static get isCSSRoundSupported(){return o(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}};const d=[...Array(256).keys()].map(t=>t.toString(16).padStart(2,"0")),u=(e.Util=class{static makeHexColor(t,e,r){return"#"+d[t]+d[e]+d[r]}static scaleMinMax(t,e){let r;t[0]?(t[0]<0&&(r=e[0],e[0]=e[1],e[1]=r),e[0]*=t[0],e[1]*=t[0],t[3]<0&&(r=e[2],e[2]=e[3],e[3]=r),e[2]*=t[3],e[3]*=t[3]):(r=e[0],e[0]=e[2],e[2]=r,r=e[1],e[1]=e[3],e[3]=r,t[1]<0&&(r=e[2],e[2]=e[3],e[3]=r),e[2]*=t[1],e[3]*=t[1],t[2]<0&&(r=e[0],e[0]=e[1],e[1]=r),e[0]*=t[2],e[1]*=t[2]),e[0]+=t[4],e[1]+=t[4],e[2]+=t[5],e[3]+=t[5]}static transform(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}static applyTransform(t,e){return[t[0]*e[0]+t[1]*e[2]+e[4],t[0]*e[1]+t[1]*e[3]+e[5]]}static applyInverseTransform(t,e){var r=e[0]*e[3]-e[1]*e[2];return[(t[0]*e[3]-t[1]*e[2]+e[2]*e[5]-e[4]*e[3])/r,(-t[0]*e[1]+t[1]*e[0]+e[4]*e[1]-e[5]*e[0])/r]}static getAxialAlignedBoundingBox(t,e){var r=this.applyTransform(t,e),i=this.applyTransform(t.slice(2,4),e),s=this.applyTransform([t[0],t[3]],e),t=this.applyTransform([t[2],t[1]],e);return[Math.min(r[0],i[0],s[0],t[0]),Math.min(r[1],i[1],s[1],t[1]),Math.max(r[0],i[0],s[0],t[0]),Math.max(r[1],i[1],s[1],t[1])]}static inverseTransform(t){var e=t[0]*t[3]-t[1]*t[2];return[t[3]/e,-t[1]/e,-t[2]/e,t[0]/e,(t[2]*t[5]-t[4]*t[3])/e,(t[4]*t[1]-t[5]*t[0])/e]}static singularValueDecompose2dScale(t){var e=[t[0],t[2],t[1],t[3]],r=t[0]*e[0]+t[1]*e[2],i=t[0]*e[1]+t[1]*e[3],s=t[2]*e[0]+t[3]*e[2],t=t[2]*e[1]+t[3]*e[3],e=(r+t)/2,r=Math.sqrt((r+t)**2-4*(r*t-s*i))/2,t=e-r||1;return[Math.sqrt(e+r||1),Math.sqrt(t)]}static normalizeRect(t){var e=t.slice(0);return t[0]>t[2]&&(e[0]=t[2],e[2]=t[0]),t[1]>t[3]&&(e[1]=t[3],e[3]=t[1]),e}static intersect(t,e){var r,i=Math.max(Math.min(t[0],t[2]),Math.min(e[0],e[2])),s=Math.min(Math.max(t[0],t[2]),Math.max(e[0],e[2]));return s<i||(r=Math.max(Math.min(t[1],t[3]),Math.min(e[1],e[3])),(t=Math.min(Math.max(t[1],t[3]),Math.max(e[1],e[3])))<r)?null:[i,r,s,t]}static bezierBoundingBox(e,r,i,s,n,a,o,l){var h=[],t=[[],[]];let c,d,u,p,f,g,m,v;for(let t=0;t<2;++t)u=0===t?(d=6*e-12*i+6*n,c=-3*e+9*i-9*n+3*o,3*i-3*e):(d=6*r-12*s+6*a,c=-3*r+9*s-9*a+3*l,3*s-3*r),Math.abs(c)<1e-12?Math.abs(d)<1e-12||0<(p=-u/d)&&p<1&&h.push(p):(m=d*d-4*u*c,v=Math.sqrt(m),m<0||(0<(f=(-d+v)/(2*c))&&f<1&&h.push(f),0<(g=(-d-v)/(2*c))&&g<1&&h.push(g)));let _,b=h.length;for(var y=b;b--;)_=1-(p=h[b]),t[0][b]=_*_*_*e+3*_*_*p*i+3*_*p*p*n+p*p*p*o,t[1][b]=_*_*_*r+3*_*_*p*s+3*_*p*p*a+p*p*p*l;return t[0][y]=e,t[1][y]=r,t[0][y+1]=o,t[1][y+1]=l,t[0].length=t[1].length=y+2,[Math.min(...t[0]),Math.min(...t[1]),Math.max(...t[0]),Math.max(...t[1])]}},[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 p(t){return decodeURIComponent(escape(t))}e.PromiseCapability=class{#t=!1;constructor(){this.promise=new Promise((e,r)=>{this.resolve=t=>{this.#t=!0,e(t)},this.reject=t=>{this.#t=!0,r(t)}})}get settled(){return this.#t}};let f=null,g=null;e.AnnotationPrefix="pdfjs_internal_id_"},(t,e,r)=>{function i(t,e){var r={};r[t]=l(t,e,d),n({global:!0,constructor:!0,arity:1,forced:d},r)}function s(t,e){var r;c&&c[t]&&((r={})[t]=l(h+"."+t,e,d),n({target:h,stat:!0,constructor:!0,arity:1,forced:d},r))}var n=r(3),a=r(4),o=r(69),l=r(70),h="WebAssembly",c=a[h],d=7!==Error("e",{cause:7}).cause;i("Error",function(e){return function(t){return o(e,this,arguments)}}),i("EvalError",function(e){return function(t){return o(e,this,arguments)}}),i("RangeError",function(e){return function(t){return o(e,this,arguments)}}),i("ReferenceError",function(e){return function(t){return o(e,this,arguments)}}),i("SyntaxError",function(e){return function(t){return o(e,this,arguments)}}),i("TypeError",function(e){return function(t){return o(e,this,arguments)}}),i("URIError",function(e){return function(t){return o(e,this,arguments)}}),s("CompileError",function(e){return function(t){return o(e,this,arguments)}}),s("LinkError",function(e){return function(t){return o(e,this,arguments)}}),s("RuntimeError",function(e){return function(t){return o(e,this,arguments)}})},(t,e,r)=>{var h=r(4),c=r(5).f,d=r(44),u=r(48),p=r(38),f=r(56),g=r(68);t.exports=function(t,e){var r,i,s,n,a=t.target,o=t.global,l=t.stat;if(r=o?h:l?h[a]||p(a,{}):(h[a]||{}).prototype)for(i in e){if(s=e[i],n=t.dontCallGetSet?(n=c(r,i))&&n.value:r[i],!g(o?i:a+(l?".":"#")+i,t.forced)&&void 0!==n){if(typeof s==typeof n)continue;f(s,n)}(t.sham||n&&n.sham)&&d(s,"sham",!0),u(r,i,s,t)}}},function(t){function e(t){return t&&t.Math===Math&&t}t.exports=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof global&&global)||function(){return this}()||this||Function("return this")()},(t,e,r)=>{var i=r(6),s=r(8),n=r(10),a=r(11),o=r(12),l=r(18),h=r(39),c=r(42),d=Object.getOwnPropertyDescriptor;e.f=i?d:function(t,e){if(t=o(t),e=l(e),c)try{return d(t,e)}catch(t){}if(h(t,e))return a(!s(n.f,t,e),t[e])}},(t,e,r)=>{r=r(7);t.exports=!r(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})},t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},(t,e,r)=>{var r=r(9),i=Function.prototype.call;t.exports=r?i.bind(i):function(){return i.apply(i,arguments)}},(t,e,r)=>{r=r(7);t.exports=!r(function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})},(t,e)=>{var r={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,s=i&&!r.call({1:2},1);e.f=s?function(t){t=i(this,t);return!!t&&t.enumerable}:r},t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},(t,e,r)=>{var i=r(13),s=r(16);t.exports=function(t){return i(s(t))}},(t,e,r)=>{var i=r(14),s=r(7),n=r(15),a=Object,o=i("".split);t.exports=s(function(){return!a("z").propertyIsEnumerable(0)})?function(t){return"String"===n(t)?o(t,""):a(t)}:a},(t,e,r)=>{var r=r(9),i=Function.prototype,s=i.call,i=r&&i.bind.bind(s,s);t.exports=r?i:function(t){return function(){return s.apply(t,arguments)}}},(t,e,r)=>{var r=r(14),i=r({}.toString),s=r("".slice);t.exports=function(t){return s(i(t),8,-1)}},(t,e,r)=>{var i=r(17),s=TypeError;t.exports=function(t){if(i(t))throw s("Can't call method on "+t);return t}},t=>{t.exports=function(t){return null==t}},(t,e,r)=>{var i=r(19),s=r(23);t.exports=function(t){t=i(t,"string");return s(t)?t:t+""}},(t,e,r)=>{var i=r(8),s=r(20),n=r(23),a=r(30),o=r(33),r=r(34),l=TypeError,h=r("toPrimitive");t.exports=function(t,e){if(!s(t)||n(t))return t;var r=a(t,h);if(r){if(r=i(r,t,e=void 0===e?"default":e),!s(r)||n(r))return r;throw l("Can't convert object to primitive value")}return o(t,e=void 0===e?"number":e)}},(t,e,r)=>{var i=r(21),r=r(22),s=r.all;t.exports=r.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:i(t)||t===s}:function(t){return"object"==typeof t?null!==t:i(t)}},(t,e,r)=>{var r=r(22),i=r.all;t.exports=r.IS_HTMLDDA?function(t){return"function"==typeof t||t===i}:function(t){return"function"==typeof t}},t=>{var e="object"==typeof document&&document.all;t.exports={all:e,IS_HTMLDDA:void 0===e&&void 0!==e}},(t,e,r)=>{var i=r(24),s=r(21),n=r(25),r=r(26),a=Object;t.exports=r?function(t){return"symbol"==typeof t}:function(t){var e=i("Symbol");return s(e)&&n(e.prototype,a(t))}},(t,e,r)=>{var i=r(4),s=r(21);t.exports=function(t,e){return arguments.length<2?(r=i[t],s(r)?r:void 0):i[t]&&i[t][e];var r}},(t,e,r)=>{r=r(14);t.exports=r({}.isPrototypeOf)},(t,e,r)=>{r=r(27);t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},(t,e,r)=>{var i=r(28),s=r(7),n=r(4).String;t.exports=!!Object.getOwnPropertySymbols&&!s(function(){var t=Symbol("symbol detection");return!n(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&i&&i<41})},(t,e,r)=>{var i,s,n=r(4),r=r(29),a=n.process,n=n.Deno,a=a&&a.versions||n&&n.version,n=a&&a.v8;!(s=n?0<(i=n.split("."))[0]&&i[0]<4?1:+(i[0]+i[1]):s)&&r&&(!(i=r.match(/Edge\/(\d+)/))||74<=i[1])&&(i=r.match(/Chrome\/(\d+)/))&&(s=+i[1]),t.exports=s},t=>{t.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},(t,e,r)=>{var i=r(31),s=r(17);t.exports=function(t,e){t=t[e];return s(t)?void 0:i(t)}},(t,e,r)=>{var i=r(21),s=r(32),n=TypeError;t.exports=function(t){if(i(t))return t;throw n(s(t)+" is not a function")}},t=>{var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},(t,e,r)=>{var s=r(8),n=r(21),a=r(20),o=TypeError;t.exports=function(t,e){var r,i;if("string"===e&&n(r=t.toString)&&!a(i=s(r,t)))return i;if(n(r=t.valueOf)&&!a(i=s(r,t)))return i;if("string"!==e&&n(r=t.toString)&&!a(i=s(r,t)))return i;throw o("Can't convert object to primitive value")}},(t,e,r)=>{var i=r(4),s=r(35),n=r(39),a=r(41),o=r(27),r=r(26),l=i.Symbol,h=s("wks"),c=r?l.for||l:l&&l.withoutSetter||a;t.exports=function(t){return n(h,t)||(h[t]=o&&n(l,t)?l[t]:c("Symbol."+t)),h[t]}},(t,e,r)=>{var i=r(36),s=r(37);(t.exports=function(t,e){return s[t]||(s[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.32.2",mode:i?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.32.2/LICENSE",source:"https://github.com/zloirock/core-js"})},t=>{t.exports=!1},(t,e,r)=>{var i=r(4),r=r(38),s="__core-js_shared__",i=i[s]||r(s,{});t.exports=i},(t,e,r)=>{var i=r(4),s=Object.defineProperty;t.exports=function(e,r){try{s(i,e,{value:r,configurable:!0,writable:!0})}catch(t){i[e]=r}return r}},(t,e,r)=>{var i=r(14),s=r(40),n=i({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return n(s(t),e)}},(t,e,r)=>{var i=r(16),s=Object;t.exports=function(t){return s(i(t))}},(t,e,r)=>{var r=r(14),i=0,s=Math.random(),n=r(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+n(++i+s,36)}},(t,e,r)=>{var i=r(6),s=r(7),n=r(43);t.exports=!i&&!s(function(){return 7!==Object.defineProperty(n("div"),"a",{get:function(){return 7}}).a})},(t,e,r)=>{var i=r(4),r=r(20),s=i.document,n=r(s)&&r(s.createElement);t.exports=function(t){return n?s.createElement(t):{}}},(t,e,r)=>{var i=r(6),s=r(45),n=r(11);t.exports=i?function(t,e,r){return s.f(t,e,n(1,r))}:function(t,e,r){return t[e]=r,t}},(t,e,r)=>{var i=r(6),s=r(42),n=r(46),a=r(47),o=r(18),l=TypeError,h=Object.defineProperty,c=Object.getOwnPropertyDescriptor,d="enumerable",u="configurable",p="writable";e.f=i?n?function(t,e,r){var i;return a(t),e=o(e),a(r),"function"==typeof t&&"prototype"===e&&"value"in r&&p in r&&!r[p]&&(i=c(t,e))&&i[p]&&(t[e]=r.value,r={configurable:(u in r?r:i)[u],enumerable:(d in r?r:i)[d],writable:!1}),h(t,e,r)}:h:function(t,e,r){if(a(t),e=o(e),a(r),s)try{return h(t,e,r)}catch(t){}if("get"in r||"set"in r)throw l("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},(t,e,r)=>{var i=r(6),r=r(7);t.exports=i&&r(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})},(t,e,r)=>{var i=r(20),s=String,n=TypeError;t.exports=function(t){if(i(t))return t;throw n(s(t)+" is not an object")}},(t,e,r)=>{var a=r(21),o=r(45),l=r(49),h=r(38);t.exports=function(t,e,r,i){var s=(i=i||{}).enumerable,n=void 0!==i.name?i.name:e;if(a(r)&&l(r,n,i),i.global)s?t[e]=r:h(e,r);else{try{i.unsafe?t[e]&&(s=!0):delete t[e]}catch(t){}s?t[e]=r:o.f(t,e,{value:r,enumerable:!1,configurable:!i.nonConfigurable,writable:!i.nonWritable})}return t}},(t,e,r)=>{var i=r(14),s=r(7),n=r(21),a=r(39),o=r(6),l=r(50).CONFIGURABLE,h=r(51),r=r(52),c=r.enforce,d=r.get,u=String,p=Object.defineProperty,f=i("".slice),g=i("".replace),m=i([].join),v=o&&!s(function(){return 8!==p(function(){},"length",{value:8}).length}),_=String(String).split("String"),r=t.exports=function(t,e,r){"Symbol("===f(u(e),0,7)&&(e="["+g(u(e),/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!a(t,"name")||l&&t.name!==e)&&(o?p(t,"name",{value:e,configurable:!0}):t.name=e),v&&r&&a(r,"arity")&&t.length!==r.arity&&p(t,"length",{value:r.arity});try{r&&a(r,"constructor")&&r.constructor?o&&p(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}r=c(t);return a(r,"source")||(r.source=m(_,"string"==typeof e?e:"")),t};Function.prototype.toString=r(function(){return n(this)&&d(this).source||h(this)},"toString")},(t,e,r)=>{var i=r(6),r=r(39),s=Function.prototype,n=i&&Object.getOwnPropertyDescriptor,r=r(s,"name"),a=r&&"something"===function(){}.name,i=r&&(!i||n(s,"name").configurable);t.exports={EXISTS:r,PROPER:a,CONFIGURABLE:i}},(t,e,r)=>{var i=r(14),s=r(21),r=r(37),n=i(Function.toString);s(r.inspectSource)||(r.inspectSource=function(t){return n(t)}),t.exports=r.inspectSource},(t,e,r)=>{var i,s,n,a,o=r(53),l=r(4),h=r(20),c=r(44),d=r(39),u=r(37),p=r(54),r=r(55),f="Object already initialized",g=l.TypeError,l=l.WeakMap,m=o||u.state?((n=u.state||(u.state=new l)).get=n.get,n.has=n.has,n.set=n.set,i=function(t,e){if(n.has(t))throw g(f);return e.facade=t,n.set(t,e),e},s=function(t){return n.get(t)||{}},function(t){return n.has(t)}):(r[a=p("state")]=!0,i=function(t,e){if(d(t,a))throw g(f);return e.facade=t,c(t,a,e),e},s=function(t){return d(t,a)?t[a]:{}},function(t){return d(t,a)});t.exports={set:i,get:s,has:m,enforce:function(t){return m(t)?s(t):i(t,{})},getterFor:function(e){return function(t){if(h(t)&&(t=s(t)).type===e)return t;throw g("Incompatible receiver, "+e+" required")}}}},(t,e,r)=>{var i=r(4),r=r(21),i=i.WeakMap;t.exports=r(i)&&/native code/.test(String(i))},(t,e,r)=>{var i=r(35),s=r(41),n=i("keys");t.exports=function(t){return n[t]||(n[t]=s(t))}},t=>{t.exports={}},(t,e,r)=>{var l=r(39),h=r(57),c=r(5),d=r(45);t.exports=function(t,e,r){for(var i=h(e),s=d.f,n=c.f,a=0;a<i.length;a++){var o=i[a];l(t,o)||r&&l(r,o)||s(t,o,n(e,o))}}},(t,e,r)=>{var i=r(24),s=r(14),n=r(58),a=r(67),o=r(47),l=s([].concat);t.exports=i("Reflect","ownKeys")||function(t){var e=n.f(o(t)),r=a.f;return r?l(e,r(t)):e}},(t,e,r)=>{var i=r(59),s=r(66).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return i(t,s)}},(t,e,r)=>{var i=r(14),a=r(39),o=r(12),l=r(60).indexOf,h=r(55),c=i([].push);t.exports=function(t,e){var r,i=o(t),s=0,n=[];for(r in i)!a(h,r)&&a(i,r)&&c(n,r);for(;e.length>s;)!a(i,r=e[s++])||~l(n,r)||c(n,r);return n}},(t,e,r)=>{function i(o){return function(t,e,r){var i,s=l(t),n=c(s),a=h(r,n);if(o&&e!=e){for(;a<n;)if((i=s[a++])!=i)return!0}else for(;a<n;a++)if((o||a in s)&&s[a]===e)return o||a||0;return!o&&-1}}var l=r(12),h=r(61),c=r(64);t.exports={includes:i(!0),indexOf:i(!1)}},(t,e,r)=>{var i=r(62),s=Math.max,n=Math.min;t.exports=function(t,e){t=i(t);return t<0?s(t+e,0):n(t,e)}},(t,e,r)=>{var i=r(63);t.exports=function(t){t=+t;return t!=t||0==t?0:i(t)}},t=>{var e=Math.ceil,r=Math.floor;t.exports=Math.trunc||function(t){t=+t;return(0<t?r:e)(t)}},(t,e,r)=>{var i=r(65);t.exports=function(t){return i(t.length)}},(t,e,r)=>{var i=r(62),s=Math.min;t.exports=function(t){return 0<t?s(i(t),9007199254740991):0}},t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},(t,e)=>{e.f=Object.getOwnPropertySymbols},(t,e,r)=>{function i(t,e){return(t=l[o(t)])===c||t!==h&&(n(e)?s(e):!!e)}var s=r(7),n=r(21),a=/#|\.prototype\./,o=i.normalize=function(t){return String(t).replace(a,".").toLowerCase()},l=i.data={},h=i.NATIVE="N",c=i.POLYFILL="P";t.exports=i},(t,e,r)=>{var r=r(9),i=Function.prototype,s=i.apply,n=i.call;t.exports="object"==typeof Reflect&&Reflect.apply||(r?n.bind(s):function(){return n.apply(s,arguments)})},(t,e,r)=>{var d=r(24),u=r(39),p=r(44),f=r(25),g=r(71),m=r(56),v=r(74),_=r(75),b=r(76),y=r(80),A=r(81),S=r(6),x=r(36);t.exports=function(t,e,r,i){var s="stackTraceLimit",n=i?2:1,a=t.split("."),o=a[a.length-1],l=d.apply(null,a);if(l){var h=l.prototype;if(!x&&u(h,"cause")&&delete h.cause,!r)return l;var a=d("Error"),c=e(function(t,e){e=b(i?e:t,void 0),t=i?new l(t):new l;return void 0!==e&&p(t,"message",e),A(t,c,t.stack,2),this&&f(h,this)&&_(t,this,c),n<arguments.length&&y(t,arguments[n]),t});if(c.prototype=h,"Error"!==o?g?g(c,a):m(c,a,{name:!0}):S&&s in l&&(v(c,l,s),v(c,l,"prepareStackTrace")),m(c,l),!x)try{h.name!==o&&p(h,"name",o),h.constructor=c}catch(t){}return c}}},(t,e,r)=>{var s=r(72),n=r(47),a=r(73);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var r,i=!1,t={};try{(r=s(Object.prototype,"__proto__","set"))(t,[]),i=t instanceof Array}catch(r){}return function(t,e){return n(t),a(e),i?r(t,e):t.__proto__=e,t}}():void 0)},(t,e,r)=>{var i=r(14),s=r(31);t.exports=function(t,e,r){try{return i(s(Object.getOwnPropertyDescriptor(t,e)[r]))}catch(t){}}},(t,e,r)=>{var i=r(21),s=String,n=TypeError;t.exports=function(t){if("object"==typeof t||i(t))return t;throw n("Can't set "+s(t)+" as a prototype")}},(t,e,r)=>{var i=r(45).f;t.exports=function(t,e,r){r in t||i(t,r,{configurable:!0,get:function(){return e[r]},set:function(t){e[r]=t}})}},(t,e,r)=>{var i=r(21),s=r(20),n=r(71);t.exports=function(t,e,r){return n&&i(e=e.constructor)&&e!==r&&s(e=e.prototype)&&e!==r.prototype&&n(t,e),t}},(t,e,r)=>{var i=r(77);t.exports=function(t,e){return void 0===t?arguments.length<2?"":e:i(t)}},(t,e,r)=>{var i=r(78),s=String;t.exports=function(t){if("Symbol"===i(t))throw TypeError("Cannot convert a Symbol value to a string");return s(t)}},(t,e,r)=>{var i=r(79),s=r(21),n=r(15),a=r(34)("toStringTag"),o=Object,l="Arguments"===n(function(){return arguments}());t.exports=i?n:function(t){var e;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(e=function(t,e){try{return t[e]}catch(t){}}(t=o(t),a))?e:l?n(t):"Object"===(e=n(t))&&s(t.callee)?"Arguments":e}},(t,e,r)=>{var i={};i[r(34)("toStringTag")]="z",t.exports="[object z]"===String(i)},(t,e,r)=>{var i=r(20),s=r(44);t.exports=function(t,e){i(e)&&"cause"in e&&s(t,"cause",e.cause)}},(t,e,r)=>{var s=r(44),n=r(82),a=r(83),o=Error.captureStackTrace;t.exports=function(t,e,r,i){a&&(o?o(t,e):s(t,"stack",n(r,i)))}},(t,e,r)=>{var r=r(14),i=Error,s=r("".replace),r=String(i("zxcasd").stack),n=/\n\s*at [^:]*:[^\n]*/,a=n.test(r);t.exports=function(t,e){if(a&&"string"==typeof t&&!i.prepareStackTrace)for(;e--;)t=s(t,n,"");return t}},(t,e,r)=>{var i=r(7),s=r(11);t.exports=!i(function(){var t=Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",s(1,7)),7!==t.stack)})},(t,e,r)=>{var i=r(48),s=r(14),d=r(77),u=r(85),r=URLSearchParams,n=r.prototype,p=s(n.append),f=s(n.delete),g=s(n.forEach),m=s([].push),s=new r("a=1&a=2&b=3");s.delete("a",1),s.delete("b",void 0),s+""!="a=2"&&i(n,"delete",function(t){var e=arguments.length,r=e<2?void 0:arguments[1];if(e&&void 0===r)return f(this,t);var i=[];g(this,function(t,e){m(i,{key:e,value:t})}),u(e,1);for(var s,n=d(t),a=d(r),o=0,l=0,h=!1,c=i.length;o<c;)s=i[o++],h||s.key===n?(h=!0,f(this,s.key)):l++;for(;l<c;)(s=i[l++]).key===n&&s.value===a||p(this,s.key,s.value)},{enumerable:!0,unsafe:!0})},t=>{var r=TypeError;t.exports=function(t,e){if(t<e)throw r("Not enough arguments");return t}},(t,e,r)=>{var i=r(48),s=r(14),a=r(77),o=r(85),r=URLSearchParams,n=r.prototype,l=s(n.getAll),h=s(n.has),s=new r("a=1");!s.has("a",2)&&s.has("a",void 0)||i(n,"has",function(t){var e=arguments.length,r=e<2?void 0:arguments[1];if(e&&void 0===r)return h(this,t);var i=l(this,t);o(e,1);for(var s=a(r),n=0;n<i.length;)if(i[n++]===s)return!0;return!1},{enumerable:!0,unsafe:!0})},(t,e,r)=>{var i=r(6),s=r(14),r=r(88),n=URLSearchParams.prototype,a=s(n.forEach);!i||"size"in n||r(n,"size",{get:function(){var t=0;return a(this,function(){t++}),t},configurable:!0,enumerable:!0})},(t,e,r)=>{var i=r(49),s=r(45);t.exports=function(t,e,r){return r.get&&i(r.get,e,{getter:!0}),r.set&&i(r.set,e,{setter:!0}),s.f(t,e,r)}},(t,e,r)=>{var i=r(3),n=r(40),a=r(64),o=r(90),l=r(92);i({target:"Array",proto:!0,arity:1,forced:r(7)(function(){return 4294967297!==[].push.call({length:4294967296},1)})||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(t){return t instanceof TypeError}}()},{push:function(t){var e=n(this),r=a(e),i=arguments.length;l(r+i);for(var s=0;s<i;s++)e[r]=arguments[s],r++;return o(e,r),r}})},(t,e,r)=>{var i=r(6),s=r(91),n=TypeError,a=Object.getOwnPropertyDescriptor,r=i&&!function(){if(void 0!==this)return 1;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();t.exports=r?function(t,e){if(s(t)&&!a(t,"length").writable)throw n("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e}},(t,e,r)=>{var i=r(15);t.exports=Array.isArray||function(t){return"Array"===i(t)}},t=>{var e=TypeError;t.exports=function(t){if(9007199254740991<t)throw e("Maximum allowed index exceeded");return t}},(t,e,r)=>{var i=r(94),s=r(98).findLast,n=i.aTypedArray;(0,i.exportTypedArrayMethod)("findLast",function(t){return s(n(this),t,1<arguments.length?arguments[1]:void 0)})},(t,e,r)=>{function i(t){var e,t=y(t);if(u(t))return(e=E(t))&&p(e,F)?e[F]:i(t)}function s(t){return!!u(t)&&(t=f(t),p(I,t)||p(O,t))}var n,a,o,l=r(95),h=r(6),c=r(4),d=r(21),u=r(20),p=r(39),f=r(78),g=r(32),m=r(44),v=r(48),_=r(88),b=r(25),y=r(96),A=r(71),S=r(34),x=r(41),r=r(52),w=r.enforce,E=r.get,r=c.Int8Array,T=r&&r.prototype,C=c.Uint8ClampedArray,C=C&&C.prototype,P=r&&y(r),k=T&&y(T),r=Object.prototype,M=c.TypeError,S=S("toStringTag"),R=x("TYPED_ARRAY_TAG"),F="TypedArrayConstructor",D=l&&!!A&&"Opera"!==f(c.opera),x=!1,I={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},O={BigInt64Array:8,BigUint64Array:8};for(n in I)(o=(a=c[n])&&a.prototype)?w(o)[F]=a:D=!1;for(n in O)(o=(a=c[n])&&a.prototype)&&(w(o)[F]=a);if((!D||!d(P)||P===Function.prototype)&&(P=function(){throw M("Incorrect invocation")},D))for(n in I)c[n]&&A(c[n],P);if((!D||!k||k===r)&&(k=P.prototype,D))for(n in I)c[n]&&A(c[n].prototype,k);if(D&&y(C)!==k&&A(C,k),h&&!p(k,S))for(n in _(k,S,{configurable:x=!0,get:function(){return u(this)?this[R]:void 0}}),I)c[n]&&m(c[n],R,n);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:D,TYPED_ARRAY_TAG:x&&R,aTypedArray:function(t){if(s(t))return t;throw M("Target is not a typed array")},aTypedArrayConstructor:function(t){if(!d(t)||A&&!b(P,t))throw M(g(t)+" is not a typed array constructor");return t},exportTypedArrayMethod:function(t,e,r,i){if(h){if(r)for(var s in I){s=c[s];if(s&&p(s.prototype,t))try{delete s.prototype[t]}catch(r){try{s.prototype[t]=e}catch(t){}}}k[t]&&!r||v(k,t,!r&&D&&T[t]||e,i)}},exportTypedArrayStaticMethod:function(t,e,r){var i,s;if(h){if(A){if(r)for(i in I)if((s=c[i])&&p(s,t))try{delete s[t]}catch(t){}if(P[t]&&!r)return;try{return v(P,t,!r&&D&&P[t]||e)}catch(t){}}for(i in I)!(s=c[i])||s[t]&&!r||v(s,t,e)}},getTypedArrayConstructor:i,isView:function(t){return!!u(t)&&("DataView"===(t=f(t))||p(I,t)||p(O,t))},isTypedArray:s,TypedArray:P,TypedArrayPrototype:k}},t=>{t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},(t,e,r)=>{var i=r(39),s=r(21),n=r(40),a=r(54),r=r(97),o=a("IE_PROTO"),l=Object,h=l.prototype;t.exports=r?l.getPrototypeOf:function(t){var e,t=n(t);return i(t,o)?t[o]:(e=t.constructor,s(e)&&t instanceof e?e.prototype:t instanceof l?h:null)}},(t,e,r)=>{r=r(7);t.exports=!r(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})},(t,e,r)=>{function i(l){var h=1===l;return function(t,e,r){for(var i,s=u(t),n=d(s),a=c(e,r),o=p(n);0<o--;)if(a(i=n[o],o,s))switch(l){case 0:return i;case 1:return o}return h?-1:void 0}}var c=r(99),d=r(13),u=r(40),p=r(64);t.exports={findLast:i(0),findLastIndex:i(1)}},(t,e,r)=>{var i=r(100),s=r(31),n=r(9),a=i(i.bind);t.exports=function(t,e){return s(t),void 0===e?t:n?a(t,e):function(){return t.apply(e,arguments)}}},(t,e,r)=>{var i=r(15),s=r(14);t.exports=function(t){if("Function"===i(t))return s(t)}},(t,e,r)=>{var i=r(94),s=r(98).findLastIndex,n=i.aTypedArray;(0,i.exportTypedArrayMethod)("findLastIndex",function(t){return s(n(this),t,1<arguments.length?arguments[1]:void 0)})},(t,e,r)=>{var i=r(4),n=r(8),s=r(94),a=r(64),o=r(103),l=r(40),r=r(7),h=i.RangeError,c=i.Int8Array,i=c&&c.prototype,d=i&&i.set,u=s.aTypedArray,i=s.exportTypedArrayMethod,p=!r(function(){var t=new Uint8ClampedArray(2);return n(d,t,{length:1,0:3},1),3!==t[1]}),s=p&&s.NATIVE_ARRAY_BUFFER_VIEWS&&r(function(){var t=new c(2);return t.set(1),t.set("2",1),0!==t[0]||2!==t[1]});i("set",function(t){u(this);var e=o(1<arguments.length?arguments[1]:void 0,1),r=l(t);if(p)return n(d,this,r,e);var t=this.length,i=a(r),s=0;if(t<i+e)throw h("Wrong length");for(;s<i;)this[e+s]=r[s++]},!p||s)},(t,e,r)=>{var i=r(104),s=RangeError;t.exports=function(t,e){t=i(t);if(t%e)throw s("Wrong offset");return t}},(t,e,r)=>{var i=r(62),s=RangeError;t.exports=function(t){t=i(t);if(t<0)throw s("The argument can't be less than 0");return t}},(t,e,r)=>{var i=r(106),r=r(94),s=r.aTypedArray,n=r.exportTypedArrayMethod,a=r.getTypedArrayConstructor;n("toReversed",function(){return i(s(this),a(this))})},(t,e,r)=>{var n=r(64);t.exports=function(t,e){for(var r=n(t),i=new e(r),s=0;s<r;s++)i[s]=t[r-s-1];return i}},(t,e,r)=>{var i=r(94),s=r(14),n=r(31),a=r(108),o=i.aTypedArray,l=i.getTypedArrayConstructor,r=i.exportTypedArrayMethod,h=s(i.TypedArrayPrototype.sort);r("toSorted",function(t){void 0!==t&&n(t);var e=o(this),e=a(l(e),e);return h(e,t)})},(t,e,r)=>{var n=r(64);t.exports=function(t,e){for(var r=0,i=n(e),s=new t(i);r<i;)s[r]=e[r++];return s}},(t,e,r)=>{var i=r(110),s=r(94),n=r(111),a=r(62),o=r(112),l=s.aTypedArray,h=s.getTypedArrayConstructor;(0,s.exportTypedArrayMethod)("with",function(t,e){var r=l(this),t=a(t),e=n(r)?o(e):+e;return i(r,h(r),t,e)},!!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(t){return 8===t}}())},(t,e,r)=>{var l=r(64),h=r(62),c=RangeError;t.exports=function(t,e,r,i){var s=l(t),r=h(r),n=r<0?s+r:r;if(s<=n||n<0)throw c("Incorrect index");for(var a=new e(s),o=0;o<s;o++)a[o]=o===n?i:t[o];return a}},(t,e,r)=>{var i=r(78);t.exports=function(t){t=i(t);return"BigInt64Array"===t||"BigUint64Array"===t}},(t,e,r)=>{var i=r(19),s=TypeError;t.exports=function(t){t=i(t,"number");if("number"==typeof t)throw s("Can't convert number to bigint");return BigInt(t)}},(t,e,r)=>{var i=r(6),s=r(88),n=r(114),r=ArrayBuffer.prototype;!i||"detached"in r||s(r,"detached",{configurable:!0,get:function(){return n(this)}})},(t,e,r)=>{var i=r(14),s=r(115),n=i(ArrayBuffer.prototype.slice);t.exports=function(t){if(0!==s(t))return!1;try{return n(t,0,0),!1}catch(t){return!0}}},(t,e,r)=>{var i=r(72),s=r(15),n=TypeError;t.exports=i(ArrayBuffer.prototype,"byteLength","get")||function(t){if("ArrayBuffer"!==s(t))throw n("ArrayBuffer expected");return t.byteLength}},(t,e,r)=>{var i=r(3),s=r(117);s&&i({target:"ArrayBuffer",proto:!0},{transfer:function(){return s(this,arguments.length?arguments[0]:void 0,!0)}})},(t,e,r)=>{var i=r(4),s=r(14),n=r(72),h=r(118),c=r(114),d=r(115),r=r(119),u=i.TypeError,p=i.structuredClone,f=i.ArrayBuffer,g=i.DataView,m=Math.min,i=f.prototype,a=g.prototype,v=s(i.slice),_=n(i,"resizable","get"),b=n(i,"maxByteLength","get"),y=s(a.getInt8),A=s(a.setInt8);t.exports=r&&function(t,e,r){var i=d(t),e=void 0===e?i:h(e),s=!_||!_(t);if(c(t))throw u("ArrayBuffer is detached");t=p(t,{transfer:[t]});if(i===e&&(r||s))return t;if(e<=i&&(!r||s))return v(t,0,e);for(var r=r&&!s&&b?{maxByteLength:b(t)}:void 0,s=new f(e,r),n=new g(t),a=new g(s),o=m(e,i),l=0;l<o;l++)A(a,l,y(n,l));return s}},(t,e,r)=>{var i=r(62),s=r(65),n=RangeError;t.exports=function(t){if(void 0===t)return 0;var t=i(t),e=s(t);if(t!==e)throw n("Wrong length or index");return e}},(t,e,r)=>{var i=r(4),s=r(7),n=r(28),a=r(120),o=r(121),l=r(122),h=i.structuredClone;t.exports=!!h&&!s(function(){var t,e;return!(o&&92<n||l&&94<n||a&&97<n)&&(t=new ArrayBuffer(8),e=h(t,{transfer:[t]}),0!==t.byteLength||8!==e.byteLength)})},(t,e,r)=>{var i=r(121),r=r(122);t.exports=!i&&!r&&"object"==typeof window&&"object"==typeof document},t=>{t.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},(t,e,r)=>{var i=r(4),r=r(15);t.exports="process"===r(i.process)},(t,e,r)=>{var i=r(3),s=r(117);s&&i({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return s(this,arguments.length?arguments[0]:void 0,!1)}})},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{Object.defineProperty(exports,"__esModule",{value:!0}),exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultFilterFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0,Object.defineProperty(exports,"SVGGraphics",{enumerable:!0,get:function(){return _displaySvg.SVGGraphics}}),exports.build=void 0,exports.getDocument=getDocument,exports.version=void 0,__w_pdfjs_require__(84),__w_pdfjs_require__(86),__w_pdfjs_require__(87),__w_pdfjs_require__(2),__w_pdfjs_require__(93),__w_pdfjs_require__(101),__w_pdfjs_require__(102),__w_pdfjs_require__(105),__w_pdfjs_require__(107),__w_pdfjs_require__(109),__w_pdfjs_require__(113),__w_pdfjs_require__(116),__w_pdfjs_require__(123),__w_pdfjs_require__(89),__w_pdfjs_require__(125),__w_pdfjs_require__(136),__w_pdfjs_require__(138),__w_pdfjs_require__(141),__w_pdfjs_require__(143),__w_pdfjs_require__(145),__w_pdfjs_require__(147),__w_pdfjs_require__(149),__w_pdfjs_require__(152);var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(163),_display_utils=__w_pdfjs_require__(168),_font_loader=__w_pdfjs_require__(171),_displayNode_utils=__w_pdfjs_require__(172),_canvas=__w_pdfjs_require__(173),_worker_options=__w_pdfjs_require__(176),_message_handler=__w_pdfjs_require__(177),_metadata=__w_pdfjs_require__(178),_optional_content_config=__w_pdfjs_require__(179),_transport_stream=__w_pdfjs_require__(180),_displayFetch_stream=__w_pdfjs_require__(181),_displayNetwork=__w_pdfjs_require__(184),_displayNode_stream=__w_pdfjs_require__(185),_displaySvg=__w_pdfjs_require__(186),_xfa_text=__w_pdfjs_require__(194);const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DELAYED_CLEANUP_TIMEOUT=5e3,DefaultCanvasFactory=_util.isNodeJS?_displayNode_utils.NodeCanvasFactory:_display_utils.DOMCanvasFactory,DefaultCMapReaderFactory=(exports.DefaultCanvasFactory=DefaultCanvasFactory,_util.isNodeJS?_displayNode_utils.NodeCMapReaderFactory:_display_utils.DOMCMapReaderFactory),DefaultFilterFactory=(exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory,_util.isNodeJS?_displayNode_utils.NodeFilterFactory:_display_utils.DOMFilterFactory),DefaultStandardFontDataFactory=(exports.DefaultFilterFactory=DefaultFilterFactory,_util.isNodeJS?_displayNode_utils.NodeStandardFontDataFactory:_display_utils.DOMStandardFontDataFactory);function getDocument(t){if("string"==typeof t||t instanceof URL?t={url:t}:(0,_util.isArrayBuffer)(t)&&(t={data:t}),"object"!=typeof t)throw new Error("Invalid parameter in getDocument, need parameter object.");if(!t.url&&!t.data&&!t.range)throw new Error("Invalid parameter object: need either .data, .range or .url");const r=new PDFDocumentLoadingTask,i=r["docId"],s=t.url?getUrlProp(t.url):null,n=t.data?getDataProp(t.data):null,a=t.httpHeaders||null,o=!0===t.withCredentials,e=t.password??null,l=t.range instanceof PDFDataRangeTransport?t.range:null,h=Number.isInteger(t.rangeChunkSize)&&0<t.rangeChunkSize?t.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE;let c=t.worker instanceof PDFWorker?t.worker:null;const d=t.verbosity,u="string"!=typeof t.docBaseUrl||(0,_display_utils.isDataScheme)(t.docBaseUrl)?null:t.docBaseUrl,p="string"==typeof t.cMapUrl?t.cMapUrl:null,f=!1!==t.cMapPacked,g=t.CMapReaderFactory||DefaultCMapReaderFactory,m="string"==typeof t.standardFontDataUrl?t.standardFontDataUrl:null,v=t.StandardFontDataFactory||DefaultStandardFontDataFactory,_=!0!==t.stopAtErrors,b=Number.isInteger(t.maxImageSize)&&-1<t.maxImageSize?t.maxImageSize:-1,y=!1!==t.isEvalSupported,A="boolean"==typeof t.isOffscreenCanvasSupported?t.isOffscreenCanvasSupported:!_util.isNodeJS,S=Number.isInteger(t.canvasMaxAreaInBytes)?t.canvasMaxAreaInBytes:-1,x="boolean"==typeof t.disableFontFace?t.disableFontFace:_util.isNodeJS,w=!0===t.fontExtraProperties,E=!0===t.enableXfa,T=t.ownerDocument||globalThis.document,C=!0===t.disableRange,P=!0===t.disableStream,k=!0===t.disableAutoFetch,M=!0===t.pdfBug,R=l?l.length:t.length??NaN,F="boolean"==typeof t.useSystemFonts?t.useSystemFonts:!_util.isNodeJS&&!x,D="boolean"==typeof t.useWorkerFetch?t.useWorkerFetch:g===_display_utils.DOMCMapReaderFactory&&v===_display_utils.DOMStandardFontDataFactory&&p&&m&&(0,_display_utils.isValidFetchUrl)(p,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(m,document.baseURI),I=t.canvasFactory||new DefaultCanvasFactory({ownerDocument:T}),L=t.filterFactory||new DefaultFilterFactory({docId:i,ownerDocument:T}),O=((0,_util.setVerbosityLevel)(d),{canvasFactory:I,filterFactory:L});if(D||(O.cMapReaderFactory=new g({baseUrl:p,isCompressed:f}),O.standardFontDataFactory=new v({baseUrl:m})),!c){const t={verbosity:d,port:_worker_options.GlobalWorkerOptions.workerPort};c=t.port?PDFWorker.fromPort(t):new PDFWorker(t),r._worker=c}const N={docId:i,apiVersion:"3.11.174",data:n,password:e,disableAutoFetch:k,rangeChunkSize:h,length:R,docBaseUrl:u,enableXfa:E,evaluatorOptions:{maxImageSize:b,disableFontFace:x,ignoreErrors:_,isEvalSupported:y,isOffscreenCanvasSupported:A,canvasMaxAreaInBytes:S,fontExtraProperties:w,useSystemFonts:F,cMapUrl:D?p:null,standardFontDataUrl:D?m:null}},j={ignoreErrors:_,isEvalSupported:y,disableFontFace:x,fontExtraProperties:w,enableXfa:E,ownerDocument:T,disableAutoFetch:k,pdfBug:M,styleElement:null};return c.promise.then(function(){if(r.destroyed)throw new Error("Loading aborted");var t=_fetchDocument(c,N),e=new Promise(function(t){let e;var r;l?e=new _transport_stream.PDFDataTransportStream({length:R,initialData:l.initialData,progressiveDone:l.progressiveDone,contentDispositionFilename:l.contentDispositionFilename,disableRange:C,disableStream:P},l):n||(e=(r={url:s,length:R,httpHeaders:a,withCredentials:o,rangeChunkSize:h,disableRange:C,disableStream:P},new(_util.isNodeJS?_displayNode_stream.PDFNodeStream:(0,_display_utils.isValidFetchUrl)(r.url)?_displayFetch_stream.PDFFetchStream:_displayNetwork.PDFNetworkStream)(r))),t(e)});return Promise.all([t,e]).then(function(t){var[t,e]=t;if(r.destroyed)throw new Error("Loading aborted");t=new _message_handler.MessageHandler(i,t,c.port),e=new WorkerTransport(t,r,e,j,O);r._transport=e,t.send("Ready",null)})}).catch(r._capability.reject),r}async function _fetchDocument(t,e){if(t.destroyed)throw new Error("Worker was destroyed");e=await t.messageHandler.sendWithPromise("GetDocRequest",e,e.data?[e.data.buffer]:null);if(t.destroyed)throw new Error("Worker was destroyed");return e}function getUrlProp(t){if(t instanceof URL)return t.href;try{return new URL(t,window.location).href}catch{if(_util.isNodeJS&&"string"==typeof t)return t}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp(t){if(_util.isNodeJS&&"undefined"!=typeof Buffer&&t instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength)return t;if("string"==typeof t)return(0,_util.stringToBytes)(t);if("object"==typeof t&&!isNaN(t?.length)||(0,_util.isArrayBuffer)(t))return new Uint8Array(t);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}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){var r=2<arguments.length&&void 0!==arguments[2]&&arguments[2],i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;this.length=t,this.initialData=e,this.progressiveDone=r,this.contentDispositionFilename=i,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=new _util.PromiseCapability}addRangeListener(t){this._rangeListeners.push(t)}addProgressListener(t){this._progressListeners.push(t)}addProgressiveReadListener(t){this._progressiveReadListeners.push(t)}addProgressiveDoneListener(t){this._progressiveDoneListeners.push(t)}onDataRange(t,e){for(const r of this._rangeListeners)r(t,e)}onDataProgress(e,r){this._readyCapability.promise.then(()=>{for(const t of this._progressListeners)t(e,r)})}onDataProgressiveRead(e){this._readyCapability.promise.then(()=>{for(const t of this._progressiveReadListeners)t(e)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const t of this._progressiveDoneListeners)t()})}transportReady(){this._readyCapability.resolve()}requestDataRange(t,e){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(t,e){this._pdfInfo=t,this._transport=e,Object.defineProperty(this,"getJavaScript",{value:()=>((0,_display_utils.deprecated)("`PDFDocumentProxy.getJavaScript`, please use `PDFDocumentProxy.getJSActions` instead."),this.getJSActions().then(t=>{if(!t)return t;var e=[];for(const r in t)e.push(...t[r]);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(){return this._transport.startCleanup(0<arguments.length&&void 0!==arguments[0]&&arguments[0]||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{#n=null;#i=!1;constructor(t,e,r){var i=3<arguments.length&&void 0!==arguments[3]&&arguments[3];this._pageIndex=t,this._pageInfo=e,this._transport=r,this._stats=i?new _display_utils.StatTimer:null,this._pdfBug=i,this.commonObjs=r.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(){var{scale:t,rotation:e=this.rotate,offsetX:r=0,offsetY:i=0,dontFlip:s=!1}=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new _display_utils.PageViewport({viewBox:this.view,scale:t,rotation:e,offsetX:r,offsetY:i,dontFlip:s})}getAnnotations(){var{intent:t="display"}=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,t.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:r,intent:i="display",annotationMode:s=_util.AnnotationMode.ENABLE,transform:n=null,background:a=null,optionalContentConfigPromise:o=null,annotationCanvasMap:l=null,pageColors:h=null,printAnnotationStorage:c=null}=t;this._stats?.time("Overall");t=this._transport.getRenderingIntent(i,s,c);this.#i=!1,this.#r(),o=o||this._transport.getOptionalContentConfig();let d=this._intentStates.get(t.cacheKey);d||(d=Object.create(null),this._intentStates.set(t.cacheKey,d)),d.streamReaderCancelTimeout&&(clearTimeout(d.streamReaderCancelTimeout),d.streamReaderCancelTimeout=null);const u=!!(t.renderingIntent&_util.RenderingIntentFlag.PRINT),p=(d.displayReadyCapability||(d.displayReadyCapability=new _util.PromiseCapability,d.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(t)),t=>{d.renderTasks.delete(f),(this._maybeCleanupAfterRender||u)&&(this.#i=!0),this.#s(!u),t?(f.capability.reject(t),this._abortOperatorList({intentState:d,reason:t instanceof Error?t:new Error(t)})):f.capability.resolve(),this._stats?.timeEnd("Rendering"),this._stats?.timeEnd("Overall")}),f=new InternalRenderTask({callback:p,params:{canvasContext:e,viewport:r,transform:n,background:a},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:l,operatorList:d.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!u,pdfBug:this._pdfBug,pageColors:h});(d.renderTasks||=new Set).add(f);t=f.task;return Promise.all([d.displayReadyCapability.promise,o]).then(t=>{var[t,e]=t;this.destroyed?p():(this._stats?.time("Rendering"),f.initializeGraphics({transparency:t,optionalContentConfig:e}),f.operatorListChanged())}).catch(p),t}getOperatorList(){var{intent:t="display",annotationMode:e=_util.AnnotationMode.ENABLE,printAnnotationStorage:r=null}=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=this._transport.getRenderingIntent(t,e,r,!0);let i,s=this._intentStates.get(t.cacheKey);return s||(s=Object.create(null),this._intentStates.set(t.cacheKey,s)),s.opListReadCapability||((i=Object.create(null)).operatorListChanged=function(){s.operatorList.lastChunk&&(s.opListReadCapability.resolve(s.operatorList),s.renderTasks.delete(i))},s.opListReadCapability=new _util.PromiseCapability,(s.renderTasks||=new Set).add(i),s.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(t)),s.opListReadCapability.promise}streamTextContent(){var{includeMarkedContent:t=!1,disableNormalization:e=!1}=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:!0===t,disableNormalization:!0===e},{highWaterMark:100,size:t=>t.items.length})}getTextContent(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(this._transport._htmlForXfa)return this.getXfa().then(t=>_xfa_text.XfaText.textContent(t));const r=this.streamTextContent(t);return new Promise(function(i,t){const e=r.getReader(),s={items:[],styles:Object.create(null)};!function r(){e.read().then(function(t){var{value:t,done:e}=t;e?i(s):(Object.assign(s.styles,t.styles),s.items.push(...t.items),r())},t)}()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;var t=[];for(const e of this._intentStates.values())if(this._abortOperatorList({intentState:e,reason:new Error("Page was destroyed."),force:!0}),!e.opListReadCapability)for(const r of e.renderTasks)t.push(r.completed),r.cancel();return this.objs.clear(),this.#i=!1,this.#r(),Promise.all(t)}cleanup(){var t=0<arguments.length&&void 0!==arguments[0]&&arguments[0],e=(this.#i=!0,this.#s(!1));return t&&e&&(this._stats&&=new _display_utils.StatTimer),e}#s(){let t=0<arguments.length&&void 0!==arguments[0]&&arguments[0];if(this.#r(),!this.#i||this.destroyed)return!1;if(t)return this.#n=setTimeout(()=>{this.#n=null,this.#s(!1)},DELAYED_CLEANUP_TIMEOUT),!1;for(const{renderTasks:t,operatorList:e}of this._intentStates.values())if(0<t.size||!e.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),!(this.#i=!1)}#r(){this.#n&&(clearTimeout(this.#n),this.#n=null)}_startRenderPage(t,e){e=this._intentStates.get(e);e&&(this._stats?.timeEnd("Page Request"),e.displayReadyCapability?.resolve(t))}_renderPageChunk(r,i){for(let t=0,e=r.length;t<e;t++)i.operatorList.fnArray.push(r.fnArray[t]),i.operatorList.argsArray.push(r.argsArray[t]);i.operatorList.lastChunk=r.lastChunk,i.operatorList.separateAnnots=r.separateAnnots;for(const r of i.renderTasks)r.operatorListChanged();r.lastChunk&&this.#s(!0)}_pumpOperatorList(t){var{renderingIntent:t,cacheKey:e,annotationStorageSerializable:r}=t;const{map:i,transfers:s}=r,n=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:t,cacheKey:e,annotationStorage:i},s).getReader(),a=this._intentStates.get(e),o=(a.streamReader=n,()=>{n.read().then(t=>{var{value:t,done:e}=t;e?a.streamReader=null:this._transport.destroyed||(this._renderPageChunk(t,a),o())},t=>{if(a.streamReader=null,!this._transport.destroyed){if(a.operatorList){a.operatorList.lastChunk=!0;for(const t of a.renderTasks)t.operatorListChanged();this.#s(!0)}if(a.displayReadyCapability)a.displayReadyCapability.reject(t);else{if(!a.opListReadCapability)throw t;a.opListReadCapability.reject(t)}}})});o()}_abortOperatorList(t){let{intentState:e,reason:r,force:i=!1}=t;if(e.streamReader){if(e.streamReaderCancelTimeout&&(clearTimeout(e.streamReaderCancelTimeout),e.streamReaderCancelTimeout=null),!i){if(0<e.renderTasks.size)return;if(r instanceof _display_utils.RenderingCancelledException){let t=RENDERING_CANCELLED_TIMEOUT;return 0<r.extraDelay&&r.extraDelay<1e3&&(t+=r.extraDelay),void(e.streamReaderCancelTimeout=setTimeout(()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:r,force:!0})},t))}}if(e.streamReader.cancel(new _util.AbortException(r.message)).catch(()=>{}),e.streamReader=null,!this._transport.destroyed){for(const[t,r]of this._intentStates)if(r===e){this._intentStates.delete(t);break}this.cleanup()}}}get stats(){return this._stats}}exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{#a=new Set;#o=Promise.resolve();postMessage(t,e){const r={data:structuredClone(t,null)};this.#o.then(()=>{for(const t of this.#a)t.call(this,r)})}addEventListener(t,e){this.#a.add(e)}removeEventListener(t,e){this.#a.delete(e)}terminate(){this.#a.clear()}}exports.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};if(exports.PDFWorkerUtil=PDFWorkerUtil,_util.isNodeJS&&"function"==typeof require)PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if("object"==typeof document){const t=document?.currentScript?.src;t&&(PDFWorkerUtil.fallbackWorkerSrc=t.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(t,e){let r;try{if(!(r=new URL(t)).origin||"null"===r.origin)return!1}catch{return!1}t=new URL(e,r);return r.origin===t.origin},PDFWorkerUtil.createCDNWrapper=function(t){return URL.createObjectURL(new Blob([`importScripts("${t}");`]))};class PDFWorker{static#l;constructor(){var{name:t=null,port:e=null,verbosity:r=(0,_util.getVerbosityLevel)()}=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(this.name=t,this.destroyed=!1,this.verbosity=r,this._readyCapability=new _util.PromiseCapability,this._port=null,this._webWorker=null,this._messageHandler=null,e){if(PDFWorker.#l?.has(e))throw new Error("Cannot use more than one PDFWorker per port.");(PDFWorker.#l||=new WeakMap).set(e,this),this._initializeFromPort(e)}else this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(t){this._port=t,this._messageHandler=new _message_handler.MessageHandler("main","worker",t),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!PDFWorker._mainThreadWorkerMessageHandler){let t=PDFWorker["workerSrc"];try{PDFWorkerUtil.isSameOrigin(window.location.href,t)||(t=PDFWorkerUtil.createCDNWrapper(new URL(t,window.location).href));const e=new Worker(t),r=new _message_handler.MessageHandler("main","worker",e),i=()=>{e.removeEventListener("error",s),r.destroy(),e.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},s=()=>{this._webWorker||i()},n=(e.addEventListener("error",s),r.on("test",t=>{e.removeEventListener("error",s),this.destroyed?i():t?(this._messageHandler=r,this._port=e,this._webWorker=e,this._readyCapability.resolve(),r.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),r.destroy(),e.terminate())}),r.on("ready",t=>{if(e.removeEventListener("error",s),this.destroyed)i();else try{n()}catch{this._setupFakeWorker()}}),()=>{var t=new Uint8Array;r.send("test",t,[t.buffer])});return void n()}catch{(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){PDFWorkerUtil.isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),PDFWorkerUtil.isWorkerDisabled=!0),PDFWorker._setupFakeWorkerGlobal.then(t=>{var e,r,i;this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):(e=new LoopbackPort,this._port=e,r="fake"+PDFWorkerUtil.fakeWorkerId++,i=new _message_handler.MessageHandler(r+"_worker",r,e),t.setup(i,e),t=new _message_handler.MessageHandler(r,r+"_worker",e),this._messageHandler=t,this._readyCapability.resolve(),t.send("configure",{verbosity:this.verbosity}))}).catch(t=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${t.message}".`))})}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),PDFWorker.#l?.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(t){if(!t?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");var e=this.#l?.get(t.port);if(e){if(e._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return e}return new PDFWorker(t)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(null!==PDFWorkerUtil.fallbackWorkerSrc)return _util.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_util.isNodeJS&&"function"==typeof require){const worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}return await(0,_display_utils.loadScript)(this.workerSrc),window.pdfjsWorker.WorkerMessageHandler};return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}}exports.PDFWorker=PDFWorker;class WorkerTransport{#c=new Map;#h=new Map;#d=new Map;#u=null;constructor(t,e,r,i,s){this.messageHandler=t,this.loadingTask=e,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({ownerDocument:i.ownerDocument,styleElement:i.styleElement}),this._params=i,this.canvasFactory=s.canvasFactory,this.filterFactory=s.filterFactory,this.cMapReaderFactory=s.cMapReaderFactory,this.standardFontDataFactory=s.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=r,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=new _util.PromiseCapability,this.setupMessageHandler()}#p(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,r=this.#c.get(t);return r||(r=this.messageHandler.sendWithPromise(t,e),this.#c.set(t,r),r)}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}getRenderingIntent(t){let e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:_util.AnnotationMode.ENABLE,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,i=3<arguments.length&&void 0!==arguments[3]&&arguments[3],s=_util.RenderingIntentFlag.DISPLAY,n=_annotation_storage.SerializableEmpty;switch(t){case"any":s=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":s=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)("getRenderingIntent - invalid intent: "+t)}switch(e){case _util.AnnotationMode.DISABLE:s+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:s+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:s+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE,n=(s&_util.RenderingIntentFlag.PRINT&&r instanceof _annotation_storage.PrintAnnotationStorage?r:this.annotationStorage).serializable;break;default:(0,_util.warn)("getRenderingIntent - invalid annotationMode: "+e)}return i&&(s+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:s,cacheKey:s+"_"+n.hash,annotationStorageSerializable:n}}destroy(){if(!this.destroyCapability){this.destroyed=!0,this.destroyCapability=new _util.PromiseCapability,this.#u?.reject(new Error("Worker was destroyed during onPassword callback"));var t=[];for(const e of this.#h.values())t.push(e._destroy());this.#h.clear(),this.#d.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const e=this.messageHandler.sendWithPromise("Terminate",null);t.push(e),Promise.all(t).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#c.clear(),this.filterFactory.destroy(),this._networkStream?.cancelAllRequests(new _util.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject)}return this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:a,loadingTask:i}=this;a.on("GetReader",(t,r)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=t=>{this._lastProgress={loaded:t.loaded,total:t.total}},r.onPull=()=>{this._fullReader.read().then(function(t){var{value:t,done:e}=t;e?r.close():((0,_util.assert)(t instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),r.enqueue(new Uint8Array(t),1,[t]))}).catch(t=>{r.error(t)})},r.onCancel=t=>{this._fullReader.cancel(t),r.ready.catch(t=>{if(!this.destroyed)throw t})}}),a.on("ReaderHeadersReady",t=>{const e=new _util.PromiseCapability,r=this._fullReader;return r.headersReady.then(()=>{r.isStreamingSupported&&r.isRangeSupported||(this._lastProgress&&i.onProgress?.(this._lastProgress),r.onProgress=t=>{i.onProgress?.({loaded:t.loaded,total:t.total})}),e.resolve({isStreamingSupported:r.isStreamingSupported,isRangeSupported:r.isRangeSupported,contentLength:r.contentLength})},e.reject),e.promise}),a.on("GetRangeReader",(t,r)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const e=this._networkStream.getRangeReader(t.begin,t.end);e?(r.onPull=()=>{e.read().then(function(t){var{value:t,done:e}=t;e?r.close():((0,_util.assert)(t instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),r.enqueue(new Uint8Array(t),1,[t]))}).catch(t=>{r.error(t)})},r.onCancel=t=>{e.cancel(t),r.ready.catch(t=>{if(!this.destroyed)throw t})}):r.close()}),a.on("GetDoc",t=>{t=t.pdfInfo;this._numPages=t.numPages,this._htmlForXfa=t.htmlForXfa,delete t.htmlForXfa,i._capability.resolve(new PDFDocumentProxy(t,this))}),a.on("DocException",function(t){let e;switch(t.name){case"PasswordException":e=new _util.PasswordException(t.message,t.code);break;case"InvalidPDFException":e=new _util.InvalidPDFException(t.message);break;case"MissingPDFException":e=new _util.MissingPDFException(t.message);break;case"UnexpectedResponseException":e=new _util.UnexpectedResponseException(t.message,t.status);break;case"UnknownErrorException":e=new _util.UnknownErrorException(t.message,t.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}i._capability.reject(e)}),a.on("PasswordRequest",t=>{if(this.#u=new _util.PromiseCapability,i.onPassword){var e=t=>{t instanceof Error?this.#u.reject(t):this.#u.resolve({password:t})};try{i.onPassword(e,t.code)}catch(t){this.#u.reject(t)}}else this.#u.reject(new _util.PasswordException(t.message,t.code));return this.#u.promise}),a.on("DataLoaded",t=>{i.onProgress?.({loaded:t.length,total:t.length}),this.downloadInfoCapability.resolve(t)}),a.on("StartRenderPage",t=>{this.destroyed||this.#h.get(t.pageIndex)._startRenderPage(t.transparency,t.cacheKey)}),a.on("commonobj",t=>{let[e,r,i]=t;if(!this.destroyed&&!this.commonObjs.has(e))switch(r){case"Font":const t=this._params;if("error"in i){const a=i.error;(0,_util.warn)("Error during font loading: "+a),this.commonObjs.resolve(e,a)}else{const s=t.pdfBug&&globalThis.FontInspector?.enabled?(t,e)=>globalThis.FontInspector.fontAdded(t,e):null,n=new _font_loader.FontFaceObject(i,{isEvalSupported:t.isEvalSupported,disableFontFace:t.disableFontFace,ignoreErrors:t.ignoreErrors,inspectFont:s});this.fontLoader.bind(n).catch(t=>a.sendWithPromise("FontFallback",{id:e})).finally(()=>{!t.fontExtraProperties&&n.data&&(n.data=null),this.commonObjs.resolve(e,n)})}break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(e,i);break;default:throw new Error("Got unknown common object type "+r)}}),a.on("obj",t=>{let[e,r,i,s]=t;if(!this.destroyed){var n=this.#h.get(r);if(!n.objs.has(e))switch(i){case"Image":if(n.objs.resolve(e,s),s){let t;if(s.bitmap){const{width:e,height:r}=s;t=e*r*4}else t=s.data?.length||0;t>_util.MAX_IMAGE_SIZE_TO_CACHE&&(n._maybeCleanupAfterRender=!0)}break;case"Pattern":n.objs.resolve(e,s);break;default:throw new Error("Got unknown object type "+i)}}}),a.on("DocProgress",t=>{this.destroyed||i.onProgress?.({loaded:t.loaded,total:t.total})}),a.on("FetchBuiltInCMap",t=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(t):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),a.on("FetchStandardFontData",t=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(t):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");var{map:t,transfers:e}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:t,filename:this._fullReader?.filename??null},e).finally(()=>{this.annotationStorage.resetModified()})}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));const e=t-1,r=this.#d.get(e);return r||(t=this.messageHandler.sendWithPromise("GetPage",{pageIndex:e}).then(t=>{if(this.destroyed)throw new Error("Transport destroyed");t=new PDFPageProxy(e,t,this,this._params.pdfBug);return this.#h.set(e,t),t}),this.#d.set(e,t),t)}getPageIndex(t){return"object"!=typeof t||null===t||!Number.isInteger(t.num)||t.num<0||!Number.isInteger(t.gen)||t.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen})}getAnnotations(t,e){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:e})}getFieldObjects(){return this.#p("GetFieldObjects")}hasJSActions(){return this.#p("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return"string"!=typeof t?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return this.#p("GetDocJSActions")}getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:t})}getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:t})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then(t=>new _optional_content_config.OptionalContentConfig(t))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){var t="GetMetadata",e=this.#c.get(t);return e||(e=this.messageHandler.sendWithPromise(t,null).then(t=>({info:t[0],metadata:t[1]?new _metadata.Metadata(t[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null})),this.#c.set(t,e),e)}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(){let t=0<arguments.length&&void 0!==arguments[0]&&arguments[0];if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const t of this.#h.values())if(!t.cleanup())throw new Error(`startCleanup: Page ${t.pageNumber} is currently rendering.`);this.commonObjs.clear(),t||this.fontLoader.clear(),this.#c.clear(),this.filterFactory.destroy(!0)}}get loadingParams(){var{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=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;if(e){const r=this.#g(t);return r.capability.promise.then(()=>e(r.data)),null}const r=this.#f[t];if(r?.capability.settled)return r.data;throw new Error(`Requesting object that isn't resolved yet ${t}.`)}has(t){return this.#f[t]?.capability.settled||!1}resolve(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,t=this.#g(t);t.data=e,t.capability.resolve()}clear(){for(const e in this.#f){var t=this.#f[e]["data"];t?.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(){this.#m.cancel(null,0<arguments.length&&void 0!==arguments[0]?arguments[0]:0)}get separateAnnots(){var t,e=this.#m.operatorList["separateAnnots"];return!!e&&(t=this.#m["annotationCanvasMap"],e.form||e.canvas&&0<t?.size)}}exports.RenderTask=RenderTask;class InternalRenderTask{static#b=new WeakSet;constructor(t){var{callback:t,params:e,objs:r,commonObjs:i,annotationCanvasMap:s,operatorList:n,pageIndex:a,canvasFactory:o,filterFactory:l,useRequestAnimationFrame:h=!1,pdfBug:c=!1,pageColors:d=null}=t;this.callback=t,this.params=e,this.objs=r,this.commonObjs=i,this.annotationCanvasMap=s,this.operatorListIdx=null,this.operatorList=n,this._pageIndex=a,this.canvasFactory=o,this.filterFactory=l,this._pdfBug=c,this.pageColors=d,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===h&&"undefined"!=typeof window,this.cancelled=!1,this.capability=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=e.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics(t){var{transparency:t=!1,optionalContentConfig:e}=t;if(!this.cancelled){if(this._canvas){if(InternalRenderTask.#b.has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");InternalRenderTask.#b.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());var{canvasContext:r,viewport:i,transform:s,background:n}=this.params;this.gfx=new _canvas.CanvasGraphics(r,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:e},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:s,viewport:i,transparency:t,background:n}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}}cancel(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,e=1<arguments.length&&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(){this.graphicsReady?(this.stepper?.updateOperatorList(this.operatorList),this.running||this._continue()):this.graphicsReadyCallback||=this._continueBound}_continue(){this.running=!0,this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame(()=>{this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk)&&(this.gfx.endDrawing(),InternalRenderTask.#b.delete(this._canvas),this.callback()))}}const version="3.11.174",build=(exports.version=version,"ce8716743");exports.build=build},(t,e,r)=>{var i=r(3),s=r(126);i({target:"Set",proto:!0,real:!0,forced:!r(135)("difference")},{difference:s})},(t,e,r)=>{var s=r(127),i=r(128),n=r(129),a=r(132),o=r(133),l=r(130),h=r(131),c=i.has,d=i.remove;t.exports=function(t){var e=s(this),r=o(t),i=n(e);return a(e)<=r.size?l(e,function(t){r.includes(t)&&d(i,t)}):h(r.getIterator(),function(t){c(e,t)&&d(i,t)}),i}},(t,e,r)=>{var i=r(128).has;t.exports=function(t){return i(t),t}},(t,e,r)=>{var r=r(14),i=Set.prototype;t.exports={Set:Set,add:r(i.add),has:r(i.has),remove:r(i.delete),proto:i}},(t,e,r)=>{var i=r(128),s=r(130),n=i.Set,a=i.add;t.exports=function(t){var e=new n;return s(t,function(t){a(e,t)}),e}},(t,e,r)=>{var i=r(14),s=r(131),r=r(128),n=r.Set,r=r.proto,a=i(r.forEach),o=i(r.keys),l=o(new n).next;t.exports=function(t,e,r){return r?s({iterator:o(t),next:l},e):a(t,e)}},(t,e,r)=>{var a=r(8);t.exports=function(t,e,r){for(var i,s=r?t:t.iterator,n=t.next;!(i=a(n,s)).done;)if(void 0!==(i=e(i.value)))return i}},(t,e,r)=>{var i=r(72),r=r(128);t.exports=i(r.proto,"size","get")||function(t){return t.size}},(t,e,r)=>{function i(t,e,r,i){this.set=t,this.size=e,this.has=r,this.keys=i}var s=r(31),n=r(47),a=r(8),o=r(62),l=r(134),h="Invalid size",c=RangeError,d=TypeError,u=Math.max;i.prototype={getIterator:function(){return l(n(a(this.keys,this.set)))},includes:function(t){return a(this.has,this.set,t)}},t.exports=function(t){n(t);var e=+t.size;if(e!=e)throw d(h);e=o(e);if(e<0)throw c(h);return new i(t,u(e,0),s(t.has),s(t.keys))}},t=>{t.exports=function(t){return{iterator:t,next:t.next,done:!1}}},(t,e,r)=>{function i(t){return{size:t,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}}var s=r(24);t.exports=function(t){var e=s("Set");try{(new e)[t](i(0));try{return(new e)[t](i(-1)),!1}catch(t){return!0}}catch(t){return!1}}},(t,e,r)=>{var i=r(3),s=r(7),n=r(137);i({target:"Set",proto:!0,real:!0,forced:!r(135)("intersection")||s(function(){return"3,2"!==Array.from(new Set([1,2,3]).intersection(new Set([3,2])))})},{intersection:n})},(t,e,r)=>{var s=r(127),i=r(128),n=r(132),a=r(133),o=r(130),l=r(131),h=i.Set,c=i.add,d=i.has;t.exports=function(t){var e=s(this),r=a(t),i=new h;return n(e)>r.size?l(r.getIterator(),function(t){d(e,t)&&c(i,t)}):o(e,function(t){r.includes(t)&&c(i,t)}),i}},(t,e,r)=>{var i=r(3),s=r(139);i({target:"Set",proto:!0,real:!0,forced:!r(135)("isDisjointFrom")},{isDisjointFrom:s})},(t,e,r)=>{var s=r(127),n=r(128).has,a=r(132),o=r(133),l=r(130),h=r(131),c=r(140);t.exports=function(t){var e,r=s(this),i=o(t);return a(r)<=i.size?!1!==l(r,function(t){if(i.includes(t))return!1},!0):(e=i.getIterator(),!1!==h(e,function(t){if(n(r,t))return c(e,"normal",!1)}))}},(t,e,r)=>{var n=r(8),a=r(47),o=r(30);t.exports=function(t,e,r){var i,s;a(t);try{if(!(i=o(t,"return"))){if("throw"===e)throw r;return r}i=n(i,t)}catch(t){s=!0,i=t}if("throw"===e)throw r;if(s)throw i;return a(i),r}},(t,e,r)=>{var i=r(3),s=r(142);i({target:"Set",proto:!0,real:!0,forced:!r(135)("isSubsetOf")},{isSubsetOf:s})},(t,e,r)=>{var i=r(127),s=r(132),n=r(130),a=r(133);t.exports=function(t){var e=i(this),r=a(t);return!(s(e)>r.size)&&!1!==n(e,function(t){if(!r.includes(t))return!1},!0)}},(t,e,r)=>{var i=r(3),s=r(144);i({target:"Set",proto:!0,real:!0,forced:!r(135)("isSupersetOf")},{isSupersetOf:s})},(t,e,r)=>{var i=r(127),s=r(128).has,n=r(132),a=r(133),o=r(131),l=r(140);t.exports=function(t){var e,r=i(this),t=a(t);return!(n(r)<t.size)&&(e=t.getIterator(),!1!==o(e,function(t){if(!s(r,t))return l(e,"normal",!1)}))}},(t,e,r)=>{var i=r(3),s=r(146);i({target:"Set",proto:!0,real:!0,forced:!r(135)("symmetricDifference")},{symmetricDifference:s})},(t,e,r)=>{var i=r(127),s=r(128),n=r(129),a=r(133),o=r(131),l=s.add,h=s.has,c=s.remove;t.exports=function(t){var e=i(this),t=a(t).getIterator(),r=n(e);return o(t,function(t){(h(e,t)?c:l)(r,t)}),r}},(t,e,r)=>{var i=r(3),s=r(148);i({target:"Set",proto:!0,real:!0,forced:!r(135)("union")},{union:s})},(t,e,r)=>{var i=r(127),s=r(128).add,n=r(129),a=r(133),o=r(131);t.exports=function(t){var e=i(this),t=a(t).getIterator(),r=n(e);return o(t,function(t){s(r,t)}),r}},(t,e,r)=>{function i(){d(this,y);var t=p((e=arguments.length)<1?void 0:arguments[0]),e=p(e<2?void 0:arguments[1],"Error"),e=new b(t,e);return(t=_(t)).name=v,h(e,"stack",l(1,g(t.stack,1))),u(e,this,i),e}var s,n=r(3),a=r(4),o=r(24),l=r(11),h=r(45).f,c=r(39),d=r(150),u=r(75),p=r(76),f=r(151),g=r(82),m=r(6),r=r(36),v="DOMException",_=o("Error"),b=o(v),y=i.prototype=b.prototype,A="stack"in _(v),S="stack"in new b(1,2),m=b&&m&&Object.getOwnPropertyDescriptor(a,v),a=!(!m||m.writable&&m.configurable),m=A&&!a&&!S,x=(n({global:!0,constructor:!0,forced:r||m},{DOMException:m?i:b}),o(v)),A=x.prototype;if(A.constructor!==x)for(var w in r||h(A,"constructor",l(1,x)),f)!c(f,w)||c(x,s=(w=f[w]).s)||h(x,s,l(6,w.c))},(t,e,r)=>{var i=r(25),s=TypeError;t.exports=function(t,e){if(i(e,t))return t;throw s("Incorrect invocation")}},t=>{t.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},(l,h,t)=>{function e(i){return!n(function(){var t=new v.Set([7]),e=i(t),r=i(T(7));return e===t||!e.has(7)||"object"!=typeof r||7!=+r})&&i}function r(r,i){return!n(function(){var t=new i,e=r({a:t,b:t});return!(e&&e.a===e.b&&e.a instanceof i&&e.a.stack===t.stack)})}function u(t){throw new P("Uncloneable type: "+t,D)}function p(t,e){return L||N(e),L(t)}function f(t,e,r,i,s){var n=v[e];return y(n)||N(e),new n(j(t.buffer,s),r,i)}function g(t,e,r){this.object=t,this.type=e,this.metadata=r}function m(t,r,i){if(q(t)&&u("Symbol"),!y(t))return t;if(r){if(M(r,t))return R(r,t)}else r=new k;var e,s,n,a,o,l,h,c,d=S(t);switch(d){case"Array":n=J(w(t));break;case"Object":n={};break;case"Map":n=new k;break;case"Set":n=new ht;break;case"RegExp":n=new RegExp(t.source,K(t));break;case"Error":switch(s=t.name){case"AggregateError":n=_("AggregateError")([]);break;case"EvalError":n=Z();break;case"RangeError":n=tt();break;case"ReferenceError":n=et();break;case"SyntaxError":n=rt();break;case"TypeError":n=it();break;case"URIError":n=st();break;case"CompileError":n=at();break;case"LinkError":n=ot();break;case"RuntimeError":n=lt();break;default:n=C()}break;case"DOMException":n=new P(t.message,t.name);break;case"ArrayBuffer":case"SharedArrayBuffer":n=i?new g(t,d):j(t,r,d);break;case"DataView":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float16Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":l="DataView"===d?t.byteLength:t.length,n=i?new g(t,d,{offset:t.byteOffset,length:l}):f(t,d,t.byteOffset,l,r);break;case"DOMQuad":try{n=new DOMQuad(m(t.p1,r,i),m(t.p2,r,i),m(t.p3,r,i),m(t.p4,r,i))}catch(r){n=p(t,d)}break;case"File":if(L)try{n=L(t),S(n)!==d&&(n=void 0)}catch(t){}if(!n)try{n=new File([t],t.name,t)}catch(t){}n||N(d);break;case"FileList":if(a=function(){var e;try{e=new v.DataTransfer}catch(t){try{e=new v.ClipboardEvent("").clipboardData}catch(e){}}return e&&e.items&&e.files?e:null}()){for(o=0,l=w(t);o<l;o++)a.items.add(m(t[o],r,i));n=a.files}else n=p(t,d);break;case"ImageData":try{n=new ImageData(m(t.data,r,i),t.width,t.height,{colorSpace:t.colorSpace})}catch(r){n=p(t,d)}break;default:if(L)n=L(t);else switch(d){case"BigInt":n=T(t.valueOf());break;case"Boolean":n=T(pt(t));break;case"Number":n=T(ft(t));break;case"String":n=T(gt(t));break;case"Date":n=new Q(mt(t));break;case"Blob":try{n=t.slice(0,t.size,t.type)}catch(t){N(d)}break;case"DOMPoint":case"DOMPointReadOnly":e=v[d];try{n=e.fromPoint?e.fromPoint(t):new e(t.x,t.y,t.z,t.w)}catch(t){N(d)}break;case"DOMRect":case"DOMRectReadOnly":e=v[d];try{n=e.fromRect?e.fromRect(t):new e(t.x,t.y,t.width,t.height)}catch(t){N(d)}break;case"DOMMatrix":case"DOMMatrixReadOnly":e=v[d];try{n=e.fromMatrix?e.fromMatrix(t):new e(t)}catch(t){N(d)}break;case"AudioData":case"VideoFrame":b(t.clone)||N(d);try{n=t.clone()}catch(t){u(d)}break;case"CropTarget":case"CryptoKey":case"FileSystemDirectoryHandle":case"FileSystemFileHandle":case"FileSystemHandle":case"GPUCompilationInfo":case"GPUCompilationMessage":case"ImageBitmap":case"RTCCertificate":case"WebAssembly.Module":N(d);default:u(d)}}switch(F(r,t,n),d){case"Array":case"Object":for(h=dt(t),o=0,l=w(h);o<l;o++)c=h[o],V(n,c,m(t[c],r,i));break;case"Map":t.forEach(function(t,e){F(n,m(e,r,i),m(t,r,i))});break;case"Set":t.forEach(function(t){ct(n,m(t,r,i))});break;case"Error":x(n,"message",m(t.message,r,i)),G(t,"cause")&&x(n,"cause",m(t.cause,r,i)),"AggregateError"===s&&(n.errors=m(t.errors,r,i));case"DOMException":$&&x(n,"stack",m(t.stack,r,i))}return n}function d(t,r){if(!y(t))return t;if(M(r,t))return R(r,t);var e,i,s,n,a,o,l,h;if(t instanceof g)switch(e=t.type,i=t.object,e){case"ArrayBuffer":case"SharedArrayBuffer":h=j(i,r,e);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":s=t.metadata,h=f(i,e,s.offset,s.length,r)}else switch(S(t)){case"Array":case"Object":for(o=dt(t),n=0,a=w(o);n<a;n++)t[l=o[n]]=d(t[l],r);break;case"Map":h=new k,t.forEach(function(t,e){F(h,d(e,r),d(t,r))});break;case"Set":h=new ht,t.forEach(function(t){ct(h,d(t,r))});break;case"Error":t.message=d(t.message,r),G(t,"cause")&&(t.cause=d(t.cause,r)),"AggregateError"===t.name&&(t.errors=d(t.errors,r));case"DOMException":$&&(t.stack=d(t.stack,r))}return F(r,t,h||t),h||t}var i,c=t(36),B=t(3),v=t(4),_=t(24),s=t(14),n=t(7),U=t(41),b=t(21),z=t(153),W=t(17),y=t(20),q=t(23),H=t(154),A=t(47),S=t(78),G=t(39),V=t(159),x=t(44),w=t(64),X=t(85),K=t(160),a=t(162),Y=t(128),$=t(83),E=t(119),T=v.Object,J=v.Array,Q=v.Date,C=v.Error,Z=v.EvalError,tt=v.RangeError,et=v.ReferenceError,rt=v.SyntaxError,it=v.TypeError,st=v.URIError,nt=v.PerformanceMark,t=v.WebAssembly,at=t&&t.CompileError||C,ot=t&&t.LinkError||C,lt=t&&t.RuntimeError||C,P=_("DOMException"),k=a.Map,M=a.has,R=a.get,F=a.set,ht=Y.Set,ct=Y.add,dt=_("Object","keys"),ut=s([].push),pt=s((!0).valueOf),ft=s(1..valueOf),gt=s("".valueOf),mt=s(Q.prototype.getTime),o=U("structuredClone"),D="DataCloneError",I="Transferring",O=v.structuredClone,t=c||!r(O,C)||!r(O,P)||(i=O,!!n(function(){var t=i(new v.AggregateError([1],o,{cause:3}));return"AggregateError"!==t.name||1!==t.errors[0]||t.message!==o||3!==t.cause})),a=!O&&e(function(t){return new nt(o,{detail:t}).detail}),L=e(O)||a,N=function(t,e){throw new P((e||"Cloning")+" of "+t+" cannot be properly polyfilled in this engine",D)},j=function(t,e,r){if(M(e,t))return R(e,t);var i,s,n,a,o,l;if("SharedArrayBuffer"===(r||S(t)))i=L?L(t):t;else{r=v.DataView;r||"function"==typeof t.slice||N("ArrayBuffer");try{if("function"!=typeof t.slice||t.resizable){s=t.byteLength,n="maxByteLength"in t?{maxByteLength:t.maxByteLength}:void 0,i=new ArrayBuffer(s,n),a=new r(t),o=new r(i);for(l=0;l<s;l++)o.setUint8(l,a.getUint8(l))}else i=t.slice(0)}catch(t){throw new P("ArrayBuffer is detached",D)}}return F(e,t,i),i};B({global:!0,enumerable:!0,sham:!E,forced:t},{structuredClone:function(t){var e,r=1<X(arguments.length,1)&&!W(arguments[1])?A(arguments[1]):void 0,r=r?r.transfer:void 0,i=!1,s=(void 0!==r&&(s=function(t,e){if(!y(t))throw it("Transfer option cannot be converted to a sequence");var r=[];H(t,function(t){ut(r,A(t))});for(var i,s,n,a,o,l=0,h=w(r),c=[];l<h;)if(i=r[l++],"ArrayBuffer"!==(s=S(i))){if(M(e,i))throw new P("Duplicate transferable",D);if(E)a=O(i,{transfer:[i]});else switch(s){case"ImageBitmap":n=v.OffscreenCanvas,z(n)||N(s,I);try{(o=new n(i.width,i.height)).getContext("bitmaprenderer").transferFromImageBitmap(i),a=o.transferToImageBitmap()}catch(t){}break;case"AudioData":case"VideoFrame":b(i.clone)&&b(i.close)||N(s,I);try{a=i.clone(),i.close()}catch(t){}break;case"MediaSourceHandle":case"MessagePort":case"OffscreenCanvas":case"ReadableStream":case"TransformStream":case"WritableStream":N(s,I)}if(void 0===a)throw new P("This object cannot be transferred: "+s,D);F(e,i,a)}else ut(c,i);return c}(r,e=new k),i=!!w(s)),m(t,e,i));if(i){for(var n,a,o=r,l=e=new k,h=0,c=w(o);h<c;){if(n=o[h++],M(l,n))throw new P("Duplicate transferable",D);a=E?O(n,{transfer:[n]}):(b(n.transfer)||N("ArrayBuffer",I),n.transfer()),F(l,n,a)}s=d(s,e)}return s}})},(t,e,r)=>{function i(){}function s(t){if(!l(t))return!1;try{return p(i,u,t),!0}catch(t){return!1}}function n(t){if(!l(t))return!1;switch(h(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return m||!!g(f,d(t))}catch(t){return!0}}var a=r(14),o=r(7),l=r(21),h=r(78),c=r(24),d=r(51),u=[],p=c("Reflect","construct"),f=/^\s*(?:class|function)\b/,g=a(f.exec),m=!f.exec(i);n.sham=!0,t.exports=!p||o(function(){var t;return s(s.call)||!s(Object)||!s(function(){t=!0})||t})?n:s},(t,e,r)=>{function v(t,e){this.stopped=t,this.result=e}var _=r(99),b=r(8),y=r(47),A=r(32),S=r(155),x=r(64),w=r(25),E=r(157),T=r(158),C=r(140),P=TypeError,k=v.prototype;t.exports=function(t,e,r){function i(t){return n&&C(n,"normal",t),new v(!0,t)}function s(t){return u?(y(t),g?m(t[0],t[1],i):m(t[0],t[1])):g?m(t,i):m(t)}var n,a,o,l,h,c,d=r&&r.that,u=!(!r||!r.AS_ENTRIES),p=!(!r||!r.IS_RECORD),f=!(!r||!r.IS_ITERATOR),g=!(!r||!r.INTERRUPTED),m=_(e,d);if(p)n=t.iterator;else if(f)n=t;else{if(!(r=T(t)))throw P(A(t)+" is not iterable");if(S(r)){for(a=0,o=x(t);a<o;a++)if((l=s(t[a]))&&w(k,l))return l;return new v(!1)}n=E(t,r)}for(h=(p?t:n).next;!(c=b(h,n)).done;){try{l=s(c.value)}catch(t){C(n,"throw",t)}if("object"==typeof l&&l&&w(k,l))return l}return new v(!1)}},(t,e,r)=>{var i=r(34),s=r(156),n=i("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(s.Array===t||a[n]===t)}},t=>{t.exports={}},(t,e,r)=>{var i=r(8),s=r(31),n=r(47),a=r(32),o=r(158),l=TypeError;t.exports=function(t,e){e=arguments.length<2?o(t):e;if(s(e))return n(i(e,t));throw l(a(t)+" is not iterable")}},(t,e,r)=>{var i=r(78),s=r(30),n=r(17),a=r(156),o=r(34)("iterator");t.exports=function(t){if(!n(t))return s(t,o)||s(t,"@@iterator")||a[i(t)]}},(t,e,r)=>{var i=r(18),s=r(45),n=r(11);t.exports=function(t,e,r){e=i(e);e in t?s.f(t,e,n(0,r)):t[e]=r}},(t,e,r)=>{var i=r(8),s=r(39),n=r(25),a=r(161),o=RegExp.prototype;t.exports=function(t){var e=t.flags;return void 0!==e||"flags"in o||s(t,"flags")||!n(o,t)?e:i(a,t)}},(t,e,r)=>{var i=r(47);t.exports=function(){var t=i(this),e="";return t.hasIndices&&(e+="d"),t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.unicodeSets&&(e+="v"),t.sticky&&(e+="y"),e}},(t,e,r)=>{var r=r(14),i=Map.prototype;t.exports={Map:Map,set:r(i.set),get:r(i.get),has:r(i.has),remove:r(i.delete),proto:i}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SerializableEmpty=e.PrintAnnotationStorage=e.AnnotationStorage=void 0,r(89),r(149),r(152);var i=r(1),n=r(164),a=r(170);const o=Object.freeze({map:null,hash:"",transfers:void 0});e.SerializableEmpty=o;class s{#v=!1;#y=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,e){t=this.#y.get(t);return void 0===t?e:Object.assign(e,t)}getRawValue(t){return this.#y.get(t)}remove(t){if(this.#y.delete(t),0===this.#y.size&&this.resetModified(),"function"==typeof this.onAnnotationEditor){for(const t of this.#y.values())if(t instanceof n.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(t,e){var r=this.#y.get(t);let i=!1;if(void 0!==r)for(const[t,n]of Object.entries(e))r[t]!==n&&(i=!0,r[t]=n);else i=!0,this.#y.set(t,e);i&&this.#_(),e instanceof n.AnnotationEditor&&"function"==typeof this.onAnnotationEditor&&this.onAnnotationEditor(e.constructor._type)}has(t){return this.#y.has(t)}getAll(){return 0<this.#y.size?(0,i.objectFromMap)(this.#y):null}setAll(t){for(var[e,r]of Object.entries(t))this.setValue(e,r)}get size(){return this.#y.size}#_(){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.#y.size)return o;const t=new Map,e=new a.MurmurHash3_64,r=[],i=Object.create(null);let s=!1;for(const[r,a]of this.#y){const o=a instanceof n.AnnotationEditor?a.serialize(!1,i):a;o&&(t.set(r,o),e.update(r+":"+JSON.stringify(o)),s||=!!o.bitmap)}if(s)for(const e of t.values())e.bitmap&&r.push(e.bitmap);return 0<t.size?{map:t,hash:e.hexdigest(),transfers:r}:o}}class l extends(e.AnnotationStorage=s){#A;constructor(t){super();var{map:t,hash:e,transfers:r}=t.serializable,t=structuredClone(t,null);this.#A={map:t,hash:e,transfers:r}}get print(){(0,i.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#A}}e.PrintAnnotationStorage=l},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AnnotationEditor=void 0,r(89),r(2);var i=r(165),m=r(1),s=r(168);class C{#S="";#E=!1;#x=null;#w=null;#C=null;#T=!1;#P=null;#k=this.focusin.bind(this);#M=this.focusout.bind(this);#F=!1;#R=!1;#D=!1;_initialOptions=Object.create(null);_uiManager=null;_focusEventsAllowed=!0;_l10nPromise=null;#I=!1;#O=C._zIndex++;static _borderLineWidth=-1;static _colorManager=new i.ColorManager;static _zIndex=1;static SMALL_EDITOR_SIZE=0;constructor(t){this.constructor===C&&(0,m.unreachable)("Cannot initialize AnnotationEditor."),this.parent=t.parent,this.id=t.id,this.width=this.height=null,this.pageIndex=t.parent.pageIndex,this.name=t.name,this.div=null,this._uiManager=t.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=t.isCentered,this._structTreeParentId=null;var{rotation:e,rawDims:{pageWidth:r,pageHeight:i,pageX:s,pageY:n}}=this.parent.viewport,[e,r]=(this.rotation=e,this.pageRotation=(360+e-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[r,i],this.pageTranslation=[s,n],this.parentDimensions);this.x=t.x/e,this.y=t.y/r,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return(0,m.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){var e=new n({id:t.parent.getNextId(),parent:t.parent,uiManager:t._uiManager});e.annotationElementId=t.annotationElementId,e.deleted=!0,e._uiManager.addToAnnotationStorage(e)}static initialize(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;if(C._l10nPromise||=new Map(["editor_alt_text_button_label","editor_alt_text_edit_button_label","editor_alt_text_decorative_tooltip"].map(t=>[t,e.get(t)])),t?.strings)for(const r of t.strings)C._l10nPromise.set(r,e.get(r));if(-1===C._borderLineWidth){const r=getComputedStyle(document.documentElement);C._borderLineWidth=parseFloat(r.getPropertyValue("--outline-width"))||0}}static updateDefaultParams(t,e){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,e){(0,m.unreachable)("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#I}set _isDraggable(t){this.#I=t,this.div?.classList.toggle("draggable",t)}center(){var[t,e]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*e/(2*t),this.y+=this.width*t/(2*e);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*e/(2*t),this.y-=this.width*t/(2*e);break;default:this.x-=this.width/2,this.y-=this.height/2}this.fixAndSetPosition()}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#O}setParent(t){null!==t&&(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions),this.parent=t}focusin(t){this._focusEventsAllowed&&(this.#F?this.#F=!1:this.parent.setSelected(this))}focusout(t){this._focusEventsAllowed&&this.isAttachedToDOM&&!t.relatedTarget?.closest("#"+this.id)&&(t.preventDefault(),!this.parent?.isMultipleSelection)&&this.commitOrRemove()}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(t,e,r,i){var[s,n]=this.parentDimensions;[r,i]=this.screenToPageTranslation(r,i),this.x=(t+r)/s,this.y=(e+i)/n,this.fixAndSetPosition()}#L(t,e,r){var[t,i]=t;[e,r]=this.screenToPageTranslation(e,r),this.x+=e/t,this.y+=r/i,this.fixAndSetPosition()}translate(t,e){this.#L(this.parentDimensions,t,e)}translateInPage(t,e){this.#L(this.pageDimensions,t,e),this.div.scrollIntoView({block:"nearest"})}drag(t,e){var[r,i]=this.parentDimensions;if(this.x+=t/r,this.y+=e/i,this.parent&&(this.x<0||1<this.x||this.y<0||1<this.y)){const{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))}var{x:t,y:r}=this,[e,i]=this.#N();r+=i,this.div.style.left=(100*(t+=e)).toFixed(2)+"%",this.div.style.top=(100*r).toFixed(2)+"%",this.div.scrollIntoView({block:"nearest"})}#N(){var[t,e]=this.parentDimensions,r=C["_borderLineWidth"],i=r/t,s=r/e;switch(this.rotation){case 90:return[-i,s];case 180:return[i,s];case 270:return[i,-s];default:return[-i,-s]}}fixAndSetPosition(){var[t,e]=this.pageDimensions;let{x:r,y:i,width:s,height:n}=this;switch(s*=t,n*=e,r*=t,i*=e,this.rotation){case 0:r=Math.max(0,Math.min(t-s,r)),i=Math.max(0,Math.min(e-n,i));break;case 90:r=Math.max(0,Math.min(t-n,r)),i=Math.min(e,Math.max(s,i));break;case 180:r=Math.min(t,Math.max(s,r)),i=Math.min(e,Math.max(n,i));break;case 270:r=Math.min(t,Math.max(n,r)),i=Math.max(0,Math.min(e-s,i))}this.x=r/=t,this.y=i/=e;var[a,o]=this.#N(),a=(r+=a,i+=o,this.div)["style"];a.left=(100*r).toFixed(2)+"%",a.top=(100*i).toFixed(2)+"%",this.moveInDOM()}static#B(t,e,r){switch(r){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}}screenToPageTranslation(t,e){return C.#B(t,e,this.parentRotation)}pageTranslationToScreen(t,e){return C.#B(t,e,360-this.parentRotation)}#j(t){switch(t){case 90:{const[t,e]=this.pageDimensions;return[0,-t/e,e/t,0]}case 180:return[-1,0,0,-1];case 270:{const[t,r]=this.pageDimensions;return[0,t/r,-r/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(){var{parentScale:t,pageDimensions:[e,r]}=this,e=e*t,r=r*t;return m.FeatureTest.isCSSRoundSupported?[Math.round(e),Math.round(r)]:[e,r]}setDims(t,e){var[r,i]=this.parentDimensions;this.div.style.width=(100*t/r).toFixed(2)+"%",this.#T||(this.div.style.height=(100*e/i).toFixed(2)+"%"),this.#x?.classList.toggle("small",t<C.SMALL_EDITOR_SIZE||e<C.SMALL_EDITOR_SIZE)}fixDims(){var t,e,r=this.div["style"],{height:i,width:s}=r,n=s.endsWith("%"),a=!this.#T&&i.endsWith("%");n&&a||([t,e]=this.parentDimensions,n||(r.width=(100*parseFloat(s)/t).toFixed(2)+"%"),this.#T)||a||(r.height=(100*parseFloat(i)/e).toFixed(2)+"%")}getInitialTranslation(){return[0,0]}#U(){if(!this.#P){this.#P=document.createElement("div"),this.#P.classList.add("resizers");const t=["topLeft","topRight","bottomRight","bottomLeft"];this._willKeepAspectRatio||t.push("topMiddle","middleRight","bottomMiddle","middleLeft");for(const e of t){const 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();var r=m.FeatureTest.platform["isMac"];if(!(0!==e.button||e.ctrlKey&&r)){const a=this.#W.bind(this,t),o=this._isDraggable,l={passive:!(this._isDraggable=!1),capture:!0},h=(window.addEventListener("pointermove",a,l),this.x),c=this.y,d=this.width,u=this.height,p=this.parent.div.style.cursor,f=this.div.style.cursor,g=(this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(e.target).cursor,()=>{this._isDraggable=o,window.removeEventListener("pointerup",g),window.removeEventListener("blur",g),window.removeEventListener("pointermove",a,l),this.parent.div.style.cursor=p,this.div.style.cursor=f;const r=this.x,i=this.y,s=this.width,n=this.height;r===h&&i===c&&s===d&&n===u||this.addCommands({cmd:()=>{this.width=s,this.height=n,this.x=r,this.y=i;var[t,e]=this.parentDimensions;this.setDims(t*s,e*n),this.fixAndSetPosition()},undo:()=>{this.width=d,this.height=u,this.x=h,this.y=c;var[t,e]=this.parentDimensions;this.setDims(t*d,e*u),this.fixAndSetPosition()},mustExec:!0})});window.addEventListener("pointerup",g),window.addEventListener("blur",g)}}#W(t,e){const[r,i]=this.parentDimensions,s=this.x,n=this.y,a=this.width,o=this.height,l=C.MIN_SIZE/r,h=C.MIN_SIZE/i,c=t=>Math.round(1e4*t)/1e4,d=this.#j(this.rotation),u=(t,e)=>[d[0]*t+d[2]*e,d[1]*t+d[3]*e],p=this.#j(360-this.rotation);let f,g,m=!1,v=!1;switch(t){case"topLeft":m=!0,f=(t,e)=>[0,0],g=(t,e)=>[t,e];break;case"topMiddle":f=(t,e)=>[t/2,0],g=(t,e)=>[t/2,e];break;case"topRight":m=!0,f=(t,e)=>[t,0],g=(t,e)=>[0,e];break;case"middleRight":v=!0,f=(t,e)=>[t,e/2],g=(t,e)=>[0,e/2];break;case"bottomRight":m=!0,f=(t,e)=>[t,e],g=(t,e)=>[0,0];break;case"bottomMiddle":f=(t,e)=>[t/2,e],g=(t,e)=>[t/2,0];break;case"bottomLeft":m=!0,f=(t,e)=>[0,e],g=(t,e)=>[t,0];break;case"middleLeft":v=!0,f=(t,e)=>[0,e/2],g=(t,e)=>[t,e/2]}var _=f(a,o),b=g(a,o),t=u(...b),y=c(s+t[0]),A=c(n+t[1]);let S=1,x=1,[w,E]=this.screenToPageTranslation(e.movementX,e.movementY);if([w,E]=[p[0]*(e=w/r)+p[2]*(T=E/i),p[1]*e+p[3]*T],m){const t=Math.hypot(a,o);S=x=Math.max(Math.min(Math.hypot(b[0]-_[0]-w,b[1]-_[1]-E)/t,1/a,1/o),l/a,h/o)}else v?S=Math.max(l,Math.min(1,Math.abs(b[0]-_[0]-w)))/a:x=Math.max(h,Math.min(1,Math.abs(b[1]-_[1]-E)))/o;var e=c(a*S),T=c(o*x),b=y-(t=u(...g(e,T)))[0],_=A-t[1];this.width=e,this.height=T,this.x=b,this.y=_,this.setDims(r*e,i*T),this.fixAndSetPosition()}async addAltTextButton(){if(!this.#x){const e=this.#x=document.createElement("button"),t=(e.className="altText",await C._l10nPromise.get("editor_alt_text_button_label"));if(e.textContent=t,e.setAttribute("aria-label",t),e.tabIndex="0",e.addEventListener("contextmenu",s.noContextMenu),e.addEventListener("pointerdown",t=>t.stopPropagation()),e.addEventListener("click",t=>{t.preventDefault(),this._uiManager.editAltText(this)},{capture:!0}),e.addEventListener("keydown",t=>{t.target===e&&"Enter"===t.key&&(t.preventDefault(),this._uiManager.editAltText(this))}),this.#H(),this.div.append(e),!C.SMALL_EDITOR_SIZE){const t=40;C.SMALL_EDITOR_SIZE=Math.min(128,Math.round(1.4*e.getBoundingClientRect().width))}}}async#H(){const e=this.#x;if(e)if(this.#S||this.#E){C._l10nPromise.get("editor_alt_text_edit_button_label").then(t=>{e.setAttribute("aria-label",t)});let t=this.#w;if(!t){this.#w=t=document.createElement("span"),t.className="tooltip",t.setAttribute("role","tooltip");var r=t.id="alt-text-tooltip-"+this.id;e.setAttribute("aria-describedby",r);e.addEventListener("mouseenter",()=>{this.#C=setTimeout(()=>{this.#C=null,this.#w.classList.add("show"),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"alt_text_tooltip"}}})},100)}),e.addEventListener("mouseleave",()=>{clearTimeout(this.#C),this.#C=null,this.#w?.classList.remove("show")})}e.classList.add("done"),t.innerText=this.#E?await C._l10nPromise.get("editor_alt_text_decorative_tooltip"):this.#S,t.parentNode||e.append(t)}else e.classList.remove("done"),this.#w?.remove()}getClientDimensions(){return this.div.getBoundingClientRect()}get altTextData(){return{altText:this.#S,decorative:this.#E}}set altTextData(t){var{altText:t,decorative:e}=t;this.#S===t&&this.#E===e||(this.#S=t,this.#E=e,this.#H())}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.setAttribute("tabIndex",0),this.setInForeground(),this.div.addEventListener("focusin",this.#k),this.div.addEventListener("focusout",this.#M);var[t,e]=this.parentDimensions,[t,e]=(this.parentRotation%180!=0&&(this.div.style.maxWidth=(100*e/t).toFixed(2)+"%",this.div.style.maxHeight=(100*t/e).toFixed(2)+"%"),this.getInitialTranslation());return this.translate(t,e),(0,i.bindEvents)(this,this.div,["pointerdown"]),this.div}pointerdown(t){var e=m.FeatureTest.platform["isMac"];0!==t.button||t.ctrlKey&&e?t.preventDefault():(this.#F=!0,this.#q(t))}#q(r){if(this._isDraggable){const i=this._uiManager.isSelected(this);this._uiManager.setUpDragSession();let t,e;i&&(t={passive:!0,capture:!0},e=t=>{var[t,e]=this.screenToPageTranslation(t.movementX,t.movementY);this._uiManager.dragSelectedEditors(t,e)},window.addEventListener("pointermove",e,t));const s=()=>{if(window.removeEventListener("pointerup",s),window.removeEventListener("blur",s),i&&window.removeEventListener("pointermove",e,t),this.#F=!1,!this._uiManager.endDragSession()){const i=m.FeatureTest.platform["isMac"];r.ctrlKey&&!i||r.shiftKey||r.metaKey&&i?this.parent.toggleSelected(this):this.parent.setSelected(this)}};window.addEventListener("pointerup",s),window.addEventListener("blur",s)}}moveInDOM(){this.parent?.moveEditorInDOM(this)}_setParentAndPosition(t,e,r){t.changeParent(this),this.x=e,this.y=r,this.fixAndSetPosition()}getRect(t,e){var r=this.parentScale,[i,s]=this.pageDimensions,[n,a]=this.pageTranslation,o=t/r,l=e/r,h=this.x*i,c=this.y*s,d=this.width*i,u=this.height*s;switch(this.rotation){case 0:return[h+o+n,s-c-l-u+a,h+o+d+n,s-c-l+a];case 90:return[h+l+n,s-c+o+a,h+l+u+n,s-c+o+d+a];case 180:return[h-o-d+n,s-c+l+a,h-o+n,s-c+l+u+a];case 270:return[h-l-u+n,s-c-o-d+a,h-l+n,s-c-o+a];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,e){var[r,i,s,n]=t,a=s-r,o=n-i;switch(this.rotation){case 0:return[r,e-n,a,o];case 90:return[r,e-i,o,a];case 180:return[s,e-i,a,o];case 270:return[s,e-n,o,a];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){this.#D=!0}disableEditMode(){this.#D=!1}isInEditMode(){return this.#D}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){this.div?.addEventListener("focusin",this.#k),this.div?.addEventListener("focusout",this.#M)}serialize(){(0,m.unreachable)("An editor must be serializable")}static deserialize(t,e,r){var e=new this.prototype.constructor({parent:e,id:e.getNextId(),uiManager:r}),[r,i]=(e.rotation=t.rotation,e.pageDimensions),[t,s,n,a]=e.getRectInCurrentCoords(t.rect,i);return e.x=t/r,e.y=s/i,e.width=n/r,e.height=a/i,e}remove(){this.div.removeEventListener("focusin",this.#k),this.div.removeEventListener("focusout",this.#M),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.#x?.remove(),this.#x=null,this.#w=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#U(),this.#P.classList.remove("hidden"))}select(){this.makeResizable(),this.div?.classList.add("selectedEditor")}unselect(){this.#P?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus()}updateParams(t,e){}disableEditing(){this.#x&&(this.#x.hidden=!0)}enableEditing(){this.#x&&(this.#x.hidden=!1)}enterInEditMode(){}get contentDiv(){return this.div}get isEditing(){return this.#R}set isEditing(t){this.#R=t,this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(t,e){this.#T=!0;var r=this.div["style"];r.aspectRatio=t/e,r.height="auto"}static get MIN_SIZE(){return 16}}class n extends(e.AnnotationEditor=C){constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.KeyboardManager=e.CommandManager=e.ColorManager=e.AnnotationEditorUIManager=void 0,e.bindEvents=function(t,e,r){for(const i of r)e.addEventListener(i,t[i].bind(t))},e.opacityToHex=function(t){return Math.round(Math.min(255,Math.max(1,255*t))).toString(16).padStart(2,"0")},r(93),r(101),r(102),r(105),r(107),r(109),r(113),r(116),r(123),r(2),r(89),r(125),r(136),r(138),r(141),r(143),r(145),r(147),r(166);var n=r(1),a=r(168);class i{#G=0;getId(){return""+n.AnnotationEditorPrefix+this.#G++}}class o{#V=(0,n.getUuid)();#G=0;#$=null;static get _isSVGFittingCanvas(){const t=new OffscreenCanvas(1,3).getContext("2d"),e=new Image;e.src='data:image/svg+xml;charset=UTF-8,<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>';var r=e.decode().then(()=>(t.drawImage(e,0,0,1,1,0,0,1,3),0===new Uint32Array(t.getImageData(0,0,1,1).data.buffer)[0]));return(0,n.shadow)(this,"_isSVGFittingCanvas",r)}async#X(t,r){this.#$||=new Map;let i=this.#$.get(t);if(null===i)return null;if(i?.bitmap)i.refCounter+=1;else{try{i||={bitmap:null,id:`image_${this.#V}_`+this.#G++,refCounter:0,isSvg:!1};let t;if("string"==typeof r){i.url=r;var e=await fetch(r);if(!e.ok)throw new Error(e.statusText);t=await e.blob()}else t=i.file=r;if("image/svg+xml"===t.type){const r=o._isSVGFittingCanvas,s=new FileReader,n=new Image,a=new Promise((t,e)=>{n.onload=()=>{i.bitmap=n,i.isSvg=!0,t()},s.onload=async()=>{var t=i.svgUrl=s.result;n.src=await r?t+"#svgView(preserveAspectRatio(none))":t},n.onerror=s.onerror=e});s.readAsDataURL(t),await a}else i.bitmap=await createImageBitmap(t);i.refCounter=1}catch(t){console.error(t),i=null}this.#$.set(t,i),i&&this.#$.set(i.id,i)}return i}async getFromFile(t){var{lastModified:e,name:r,size:i,type:s}=t;return this.#X(e+`_${r}_${i}_`+s,t)}async getFromUrl(t){return this.#X(t,t)}async getFromId(t){this.#$||=new Map;t=this.#$.get(t);return t?t.bitmap?(t.refCounter+=1,t):t.file?this.getFromFile(t.file):this.getFromUrl(t.url):null}getSvgUrl(t){t=this.#$.get(t);return t?.isSvg?t.svgUrl:null}deleteId(t){this.#$||=new Map;t=this.#$.get(t);t&&(--t.refCounter,0===t.refCounter)&&(t.bitmap=null)}isValidId(t){return t.startsWith(`image_${this.#V}_`)}}class s{#K=[];#Y=!1;#J;#Q=-1;constructor(){this.#J=0<arguments.length&&void 0!==arguments[0]?arguments[0]:128}add(t){var{cmd:t,undo:e,mustExec:r,type:i=NaN,overwriteIfSameType:s=!1,keepUndo:n=!1}=t;r&&t(),this.#Y||(r={cmd:t,undo:e,type:i},-1===this.#Q?(0<this.#K.length&&(this.#K.length=0),this.#Q=0,this.#K.push(r)):s&&this.#K[this.#Q].type===i?(n&&(r.undo=this.#K[this.#Q].undo),this.#K[this.#Q]=r):((t=this.#Q+1)===this.#J?this.#K.splice(0,1):(this.#Q=t)<this.#K.length&&this.#K.splice(t),this.#K.push(r)))}undo(){-1!==this.#Q&&(this.#Y=!0,this.#K[this.#Q].undo(),this.#Y=!1,--this.#Q)}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=s;class l{constructor(t){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;var e=n.FeatureTest.platform["isMac"];for(const[i,n,s={}]of t)for(const t of i){var r=t.startsWith("mac+");e&&r?(this.callbacks.set(t.slice(4),{callback:n,options:s}),this.allKeys.add(t.split("+").at(-1))):e||r||(this.callbacks.set(t,{callback:n,options:s}),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);t=this.buffer.join("+");return this.buffer.length=0,t}exec(t,e){var r,i,s,n;this.allKeys.has(e.key)&&(r=this.callbacks.get(this.#Z(e)))&&({callback:r,options:{bubbles:i=!1,args:s=[],checker:n=null}}=r,n&&!n(t,e)||(r.bind(t,...s)(),i)||(e.stopPropagation(),e.preventDefault()))}}e.KeyboardManager=l;class h{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){var t=new Map([["CanvasText",null],["Canvas",null]]);return(0,a.getColorValues)(t),(0,n.shadow)(this,"_colors",t)}convert(t){const r=(0,a.getRGB)(t);if(window.matchMedia("(forced-colors: active)").matches)for(const[t,e]of this._colors)if(e.every((t,e)=>t===r[e]))return h._colorsMapping.get(t);return r}getHexCode(t){var e=this._colors.get(t);return e?n.Util.makeHexColor(...e):t}}e.ColorManager=h;class c{#tt=null;#et=new Map;#nt=new Map;#it=null;#rt=null;#st=new s;#at=0;#ot=new Set;#lt=null;#ct=null;#ht=new Set;#dt=null;#ut=new i;#pt=!1;#ft=!1;#gt=null;#mt=n.AnnotationEditorType.NONE;#bt=new Set;#vt=null;#yt=this.blur.bind(this);#_t=this.focus.bind(this);#At=this.copy.bind(this);#St=this.cut.bind(this);#Et=this.paste.bind(this);#xt=this.keydown.bind(this);#wt=this.onEditingAction.bind(this);#Ct=this.onPageChanging.bind(this);#Tt=this.onScaleChanging.bind(this);#Pt=this.onRotationChanging.bind(this);#kt={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1};#Mt=[0,0];#Ft=null;#Rt=null;#Dt=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){var t=c.prototype,e=t=>{var e=document["activeElement"];return e&&t.#Rt.contains(e)&&t.hasSomethingToControl()},r=this.TRANSLATE_SMALL,i=this.TRANSLATE_BIG;return(0,n.shadow)(this,"_keyboardManager",new l([[["ctrl+a","mac+meta+a"],t.selectAll],[["ctrl+z","mac+meta+z"],t.undo],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],t.delete],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-r,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-i,0],checker:e}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[r,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[i,0],checker:e}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-r],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-i],checker:e}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,r],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,i],checker:e}]]))}constructor(t,e,r,i,s,n){this.#Rt=t,this.#Dt=e,this.#it=r,this._eventBus=i,this._eventBus._on("editingaction",this.#wt),this._eventBus._on("pagechanging",this.#Ct),this._eventBus._on("scalechanging",this.#Tt),this._eventBus._on("rotationchanging",this.#Pt),this.#rt=s.annotationStorage,this.#dt=s.filterFactory,this.#vt=n,this.viewParameters={realScale:a.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}destroy(){this.#It(),this.#Ot(),this._eventBus._off("editingaction",this.#wt),this._eventBus._off("pagechanging",this.#Ct),this._eventBus._off("scalechanging",this.#Tt),this._eventBus._off("rotationchanging",this.#Pt);for(const t of this.#nt.values())t.destroy();this.#nt.clear(),this.#et.clear(),this.#ht.clear(),this.#tt=null,this.#bt.clear(),this.#st.destroy(),this.#it.destroy()}get hcmFilter(){return(0,n.shadow)(this,"hcmFilter",this.#vt?this.#dt.addHCMFilter(this.#vt.foreground,this.#vt.background):"none")}get direction(){return(0,n.shadow)(this,"direction",getComputedStyle(this.#Rt).direction)}editAltText(t){this.#it?.editAltText(this,t)}onPageChanging(t){t=t.pageNumber;this.#at=t-1}focusMainContainer(){this.#Rt.focus()}findParent(t,e){for(const a of this.#nt.values()){var{x:r,y:i,width:s,height:n}=a.div.getBoundingClientRect();if(r<=t&&t<=r+s&&i<=e&&e<=i+n)return a}return null}disableUserSelect(){this.#Dt.classList.toggle("noUserSelect",0<arguments.length&&void 0!==arguments[0]&&arguments[0])}addShouldRescale(t){this.#ht.add(t)}removeShouldRescale(t){this.#ht.delete(t)}onScaleChanging(t){t=t.scale;this.commitOrRemove(),this.viewParameters.realScale=t*a.PixelsPerInch.PDF_TO_CSS_UNITS;for(const t of this.#ht)t.onScaleChanging()}onRotationChanging(t){t=t.pagesRotation;this.commitOrRemove(),this.viewParameters.rotation=t}addToAnnotationStorage(t){t.isEmpty()||!this.#rt||this.#rt.has(t.id)||this.#rt.setValue(t.id,t)}#Lt(){window.addEventListener("focus",this.#_t),window.addEventListener("blur",this.#yt)}#Ot(){window.removeEventListener("focus",this.#_t),window.removeEventListener("blur",this.#yt)}blur(){if(this.hasSelection){var t=document["activeElement"];for(const e of this.#bt)if(e.div.contains(t)){this.#gt=[e,t],e._focusEventsAllowed=!1;break}}}focus(){if(this.#gt){const[t,e]=this.#gt;this.#gt=null,e.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0}),e.focus()}}#Nt(){window.addEventListener("keydown",this.#xt,{capture:!0})}#It(){window.removeEventListener("keydown",this.#xt,{capture:!0})}#Bt(){document.addEventListener("copy",this.#At),document.addEventListener("cut",this.#St),document.addEventListener("paste",this.#Et)}#jt(){document.removeEventListener("copy",this.#At),document.removeEventListener("cut",this.#St),document.removeEventListener("paste",this.#Et)}addEditListeners(){this.#Nt(),this.#Bt()}removeEditListeners(){this.#It(),this.#jt()}copy(t){if(t.preventDefault(),this.#tt?.commitOrRemove(),this.hasSelection){var e=[];for(const t of this.#bt){var r=t.serialize(!0);r&&e.push(r)}0!==e.length&&t.clipboardData.setData("application/pdfjs",JSON.stringify(e))}}cut(t){this.copy(t),this.delete()}paste(e){e.preventDefault();const t=e["clipboardData"];for(const e of t.items)for(const t of this.#ct)if(t.isHandlingMimeForPasting(e.type))return void t.paste(e,this.currentLayer);let r=t.getData("application/pdfjs");if(r){try{r=JSON.parse(r)}catch(e){return void(0,n.warn)(`paste: "${e.message}".`)}if(Array.isArray(r)){this.unselectAll();var i=this.currentLayer;try{const e=[];for(const t of r){const r=i.deserialize(t);if(!r)return;e.push(r)}this.addCommands({cmd:()=>{for(const t of e)this.#Ut(t);this.#zt(e)},undo:()=>{for(const t of e)t.remove()},mustExec:!0})}catch(e){(0,n.warn)(`paste: "${e.message}".`)}}}}keydown(t){this.getActive()?.shouldGetKeyboardEvents()||c._keyboardManager.exec(this,t)}onEditingAction(t){["undo","redo","delete","selectAll"].includes(t.name)&&this[t.name]()}#Wt(t){Object.entries(t).some(t=>{var[t,e]=t;return this.#kt[t]!==e})&&this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#kt,t)})}#Ht(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})}setEditingState(t){t?(this.#Lt(),this.#Nt(),this.#Bt(),this.#Wt({isEditing:this.#mt!==n.AnnotationEditorType.NONE,isEmpty:this.#qt(),hasSomethingToUndo:this.#st.hasSomethingToUndo(),hasSomethingToRedo:this.#st.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#Ot(),this.#It(),this.#jt(),this.#Wt({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!this.#ct){this.#ct=t;for(const t of this.#ct)this.#Ht(t.defaultPropertiesToUpdate)}}getId(){return this.#ut.getId()}get currentLayer(){return this.#nt.get(this.#at)}getLayer(t){return this.#nt.get(t)}get currentPageIndex(){return this.#at}addLayer(t){this.#nt.set(t.pageIndex,t),this.#pt?t.enable():t.disable()}removeLayer(t){this.#nt.delete(t.pageIndex)}updateMode(t){let e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;if(this.#mt!==t)if((this.#mt=t)!==n.AnnotationEditorType.NONE){this.setEditingState(!0),this.#Gt(),this.unselectAll();for(const e of this.#nt.values())e.updateMode(t);if(e)for(const t of this.#et.values())if(t.annotationElementId===e){this.setSelected(t),t.enterInEditMode();break}}else this.setEditingState(!1),this.#Vt()}updateToolbar(t){t!==this.#mt&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:t})}updateParams(t,e){if(this.#ct)if(t!==n.AnnotationEditorParamsType.CREATE){for(const r of this.#bt)r.updateParams(t,e);for(const i of this.#ct)i.updateDefaultParams(t,e)}else this.currentLayer.addNewEditor(t)}enableWaiting(){var t=0<arguments.length&&void 0!==arguments[0]&&arguments[0];if(this.#ft!==t){this.#ft=t;for(const e of this.#nt.values())t?e.disableClick():e.enableClick(),e.div.classList.toggle("waiting",t)}}#Gt(){if(!this.#pt){this.#pt=!0;for(const t of this.#nt.values())t.enable()}}#Vt(){if(this.unselectAll(),this.#pt){this.#pt=!1;for(const t of this.#nt.values())t.disable()}}getEditors(t){var e=[];for(const r of this.#et.values())r.pageIndex===t&&e.push(r);return e}getEditor(t){return this.#et.get(t)}addEditor(t){this.#et.set(t.id,t)}removeEditor(t){this.#et.delete(t.id),this.unselect(t),t.annotationElementId&&this.#ot.has(t.annotationElementId)||this.#rt?.remove(t.id)}addDeletedAnnotationElement(t){this.#ot.add(t.annotationElementId),t.deleted=!0}isDeletedAnnotationElement(t){return this.#ot.has(t)}removeDeletedAnnotationElement(t){this.#ot.delete(t.annotationElementId),t.deleted=!1}#Ut(t){var e=this.#nt.get(t.pageIndex);e?e.addOrRebuild(t):this.addEditor(t)}setActiveEditor(t){this.#tt!==t&&(this.#tt=t)&&this.#Ht(t.propertiesToUpdate)}toggleSelected(t){this.#bt.has(t)?(this.#bt.delete(t),t.unselect(),this.#Wt({hasSelectedEditor:this.hasSelection})):(this.#bt.add(t),t.select(),this.#Ht(t.propertiesToUpdate),this.#Wt({hasSelectedEditor:!0}))}setSelected(t){for(const e of this.#bt)e!==t&&e.unselect();this.#bt.clear(),this.#bt.add(t),t.select(),this.#Ht(t.propertiesToUpdate),this.#Wt({hasSelectedEditor:!0})}isSelected(t){return this.#bt.has(t)}unselect(t){t.unselect(),this.#bt.delete(t),this.#Wt({hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==this.#bt.size}undo(){this.#st.undo(),this.#Wt({hasSomethingToUndo:this.#st.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#qt()})}redo(){this.#st.redo(),this.#Wt({hasSomethingToUndo:!0,hasSomethingToRedo:this.#st.hasSomethingToRedo(),isEmpty:this.#qt()})}addCommands(t){this.#st.add(t),this.#Wt({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#qt()})}#qt(){if(0===this.#et.size)return!0;if(1===this.#et.size)for(const t of this.#et.values())return t.isEmpty();return!1}delete(){if(this.commitOrRemove(),this.hasSelection){const e=[...this.#bt];this.addCommands({cmd:()=>{for(const t of e)t.remove()},undo:()=>{for(const t of e)this.#Ut(t)},mustExec:!0})}}commitOrRemove(){this.#tt?.commitOrRemove()}hasSomethingToControl(){return this.#tt||this.hasSelection}#zt(t){this.#bt.clear();for(const e of t)e.isEmpty()||(this.#bt.add(e),e.select());this.#Wt({hasSelectedEditor:!0})}selectAll(){for(const t of this.#bt)t.commit();this.#zt(this.#et.values())}unselectAll(){if(this.#tt)this.#tt.commitOrRemove();else if(this.hasSelection){for(const t of this.#bt)t.unselect();this.#bt.clear(),this.#Wt({hasSelectedEditor:!1})}}translateSelectedEditors(t,e){if(2<arguments.length&&void 0!==arguments[2]&&arguments[2]||this.commitOrRemove(),this.hasSelection){this.#Mt[0]+=t,this.#Mt[1]+=e;const[r,i]=this.#Mt,s=[...this.#bt];this.#Ft&&clearTimeout(this.#Ft),this.#Ft=setTimeout(()=>{this.#Ft=null,this.#Mt[0]=this.#Mt[1]=0,this.addCommands({cmd:()=>{for(const t of s)this.#et.has(t.id)&&t.translateInPage(r,i)},undo:()=>{for(const t of s)this.#et.has(t.id)&&t.translateInPage(-r,-i)},mustExec:!1})},1e3);for(const r of s)r.translateInPage(t,e)}}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#lt=new Map;for(const t of this.#bt)this.#lt.set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#lt)return!1;this.disableUserSelect(!1);const s=this.#lt;this.#lt=null;let t=!1;for(var[{x:e,y:r,pageIndex:i},n]of s)n.newX=e,n.newY=r,n.newPageIndex=i,t||=e!==n.savedX||r!==n.savedY||i!==n.savedPageIndex;if(!t)return!1;const a=(t,e,r,i)=>{var s;this.#et.has(t.id)&&((s=this.#nt.get(i))?t._setParentAndPosition(s,e,r):(t.pageIndex=i,t.x=e,t.y=r))};return this.addCommands({cmd:()=>{for(var[t,{newX:e,newY:r,newPageIndex:i}]of s)a(t,e,r,i)},undo:()=>{for(var[t,{savedX:e,savedY:r,savedPageIndex:i}]of s)a(t,e,r,i)},mustExec:!0}),!0}dragSelectedEditors(t,e){if(this.#lt)for(const r of this.#lt.keys())r.drag(t,e)}rebuild(t){var e;null===t.parent?(e=this.getLayer(t.pageIndex))?(e.changeParent(t),e.addOrRebuild(t)):(this.addEditor(t),this.addToAnnotationStorage(t),t.rebuild()):t.parent.addOrRebuild(t)}isActive(t){return this.#tt===t}getActive(){return this.#tt}getMode(){return this.#mt}get imageManager(){return(0,n.shadow)(this,"imageManager",new o)}}e.AnnotationEditorUIManager=c},(t,L,e)=>{function f(t,e,r,i){var s,n,a,o,l,h=t[e],c=i&&h===i.value,d=c&&"string"==typeof i.source?{source:i.source}:{};if(v(h)){var u=_(h),p=c?i.nodes:u?[]:{};if(u)for(s=p.length,a=y(h),o=0;o<a;o++)g(h,o,f(h,""+o,r,o<s?p[o]:void 0));else for(n=E(h),a=y(n),o=0;o<a;o++)l=n[o],g(h,l,f(h,l,r,b(p,l)?p[l]:void 0))}return m(r,t,e,h,d)}function g(t,e,r){if(s){var i=T(t,e);if(i&&!i.configurable)return}void 0===r?delete t[e]:d(t,e,r)}function n(t,e,r,i){this.value=t,this.end=e,this.source=r,this.nodes=i}function a(t,e){this.source=t,this.index=e}var r=e(3),s=e(6),i=e(4),o=e(24),l=e(14),m=e(8),h=e(21),v=e(20),_=e(91),b=e(39),c=e(77),y=e(64),d=e(159),u=e(7),p=e(167),e=e(27),A=i.JSON,S=i.Number,x=i.SyntaxError,w=A&&A.parse,E=o("Object","keys"),T=Object.getOwnPropertyDescriptor,C=l("".charAt),P=l("".slice),k=l(/./.exec),M=l([].push),R=/^\d$/,F=/^[1-9]$/,D=/^(?:-|\d)$/,I=/^[\t\n\r ]$/,i=(a.prototype={fork:function(t){return new a(this.source,t)},parse:function(){var t=this.source,e=this.skip(I,this.index),r=this.fork(e),t=C(t,e);if(k(D,t))return r.number();switch(t){case"{":return r.object();case"[":return r.array();case'"':return r.string();case"t":return r.keyword(!0);case"f":return r.keyword(!1);case"n":return r.keyword(null)}throw x('Unexpected character: "'+t+'" at: '+e)},node:function(t,e,r,i,s){return new n(e,i,t?null:P(this.source,r,i),s)},object:function(){for(var t=this.source,e=this.index+1,r=!1,i={},s={};e<t.length;){if(e=this.until(['"',"}"],e),"}"===C(t,e)&&!r){e++;break}var n=this.fork(e).string(),a=n.value,e=n.end,a=(e=this.until([":"],e)+1,e=this.skip(I,e),n=this.fork(e).parse(),d(s,a,n),d(i,a,n.value),e=this.until([",","}"],n.end),C(t,e));if(","===a)r=!0,e++;else if("}"===a){e++;break}}return this.node(1,i,this.index,e,s)},array:function(){for(var t=this.source,e=this.index+1,r=!1,i=[],s=[];e<t.length;){if(e=this.skip(I,e),"]"===C(t,e)&&!r){e++;break}var n=this.fork(e).parse();if(M(s,n),M(i,n.value),e=this.until([",","]"],n.end),","===C(t,e))r=!0,e++;else if("]"===C(t,e)){e++;break}}return this.node(1,i,this.index,e,s)},string:function(){var t=this.index,e=p(this.source,this.index+1);return this.node(0,e.value,t,e.end)},number:function(){var t=this.source,e=this.index,r=e;if("-"===C(t,r)&&r++,"0"===C(t,r))r++;else{if(!k(F,C(t,r)))throw x("Failed to parse number at: "+r);r=this.skip(R,++r)}if("."===C(t,r)&&(r=this.skip(R,++r)),"e"!==C(t,r)&&"E"!==C(t,r)||("+"!==C(t,++r)&&"-"!==C(t,r)||r++,r!==(r=this.skip(R,r))))return this.node(0,S(P(t,e,r)),e,r);throw x("Failed to parse number's exponent value at: "+r)},keyword:function(t){var e=""+t,r=this.index,i=r+e.length;if(P(this.source,r,i)!==e)throw x("Failed to parse value at: "+r);return this.node(0,t,r,i)},skip:function(t,e){for(var r=this.source;e<r.length&&k(t,C(r,e));e++);return e},until:function(t,e){e=this.skip(I,e);for(var r=C(this.source,e),i=0;i<t.length;i++)if(t[i]===r)return e;throw x('Unexpected character: "'+r+'" at: '+e)}},u(function(){var i,t="9007199254740993";return w(t,function(t,e,r){i=r.source}),i!==t})),O=e&&!u(function(){return 1/w("-0 \t")!=-1/0});r({target:"JSON",stat:!0,forced:i},{parse:function(t,e){if(O&&!h(e))return w(t);var r=0,t=(r=c(t),new a(r,0)),i=t.parse(),s=i.value;if((t=t.skip(I,i.end))<r.length)throw x('Unexpected extra character: "'+C(r,t)+'" after the parsed data at: '+t);return h(e)?f({"":s},"",e,i):s}})},(t,e,r)=>{var i=r(14),a=r(39),o=SyntaxError,l=parseInt,h=String.fromCharCode,c=i("".charAt),d=i("".slice),u=i(/./.exec),p={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":"\n","\\r":"\r","\\t":"\t"},f=/^[\da-f]{4}$/i,g=/^[\u0000-\u001F]$/;t.exports=function(t,e){for(var r=!0,i="";e<t.length;){var s=c(t,e);if("\\"===s){var n=d(t,e,e+2);if(a(p,n))i+=p[n],e+=2;else{if("\\u"!==n)throw o('Unknown escape sequence: "'+n+'"');n=d(t,e+=2,e+4);if(!u(f,n))throw o("Bad Unicode escape at: "+e);i+=h(l(n,16)),e+=4}}else{if('"'===s){r=!1,e++;break}if(u(g,s))throw o("Bad control character in string literal at: "+e);i+=s,e++}}if(r)throw o("Unterminated string at: "+e);return{value:i,end:e}}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.StatTimer=e.RenderingCancelledException=e.PixelsPerInch=e.PageViewport=e.PDFDateString=e.DOMStandardFontDataFactory=e.DOMSVGFactory=e.DOMFilterFactory=e.DOMCanvasFactory=e.DOMCMapReaderFactory=void 0,e.deprecated=function(t){console.log("Deprecated API usage: "+t)},e.getColorValues=function(t){var e=document.createElement("span");e.style.visibility="hidden",document.body.append(e);for(const i of t.keys()){e.style.color=i;var r=window.getComputedStyle(e).color;t.set(i,_(r))}e.remove()},e.getCurrentTransform=function(t){var{a:t,b:e,c:r,d:i,e:s,f:n}=t.getTransform();return[t,e,r,i,s,n]},e.getCurrentTransformInverse=function(t){var{a:t,b:e,c:r,d:i,e:s,f:n}=t.getTransform().invertSelf();return[t,e,r,i,s,n]},e.getFilenameFromUrl=function(t){return 1<arguments.length&&void 0!==arguments[1]&&arguments[1]||([t]=t.split(/[#?]/,1)),t.substring(t.lastIndexOf("/")+1)},e.getPdfFilenameFromUrl=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"document.pdf";if("string"!=typeof t)return e;if(g(t))return(0,d.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;var r=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,t=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(t);let i=r.exec(t[1])||r.exec(t[2])||r.exec(t[3]);if(i&&(i=i[0]).includes("%"))try{i=r.exec(decodeURIComponent(i))[0]}catch{}return i||e},e.getRGB=_,e.getXfaPageViewport=function(t,e){var{scale:e=1,rotation:r=0}=e,{width:t,height:i}=t.attributes.style,t=[0,0,parseInt(t),parseInt(i)];return new p({viewBox:t,scale:e,rotation:r})},e.isDataScheme=g,e.isPdfFile=function(t){return"string"==typeof t&&/\.pdf$/i.test(t)},e.isValidFetchUrl=m,e.loadScript=function(i){let s=1<arguments.length&&void 0!==arguments[1]&&arguments[1];return new Promise((e,t)=>{const r=document.createElement("script");r.src=i,r.onload=function(t){s&&r.remove(),e(t)},r.onerror=function(){t(new Error("Cannot load script at: "+r.src))},(document.head||document.documentElement).append(r)})},e.noContextMenu=function(t){t.preventDefault()},e.setLayerDimensions=function(t,e){let r=2<arguments.length&&void 0!==arguments[2]&&arguments[2],i=!(3<arguments.length&&void 0!==arguments[3])||arguments[3];if(e instanceof p){const{pageWidth:i,pageHeight:s}=e.rawDims,n=t["style"],a=d.FeatureTest.isCSSRoundSupported,o=`var(--scale-factor) * ${i}px`,l=`var(--scale-factor) * ${s}px`,h=a?`round(${o}, 1px)`:`calc(${o})`,c=a?`round(${l}, 1px)`:`calc(${l})`;r&&e.rotation%180!=0?(n.width=c,n.height=h):(n.width=h,n.height=c)}i&&t.setAttribute("data-main-rotation",e.rotation)},r(2),r(93),r(101),r(102),r(105),r(107),r(109),r(113),r(116),r(123),r(89),r(84),r(86),r(87);var i=r(169),d=r(1);const n="http://www.w3.org/2000/svg";class s{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}e.PixelsPerInch=s;class a extends i.BaseFilterFactory{#$t;#Xt;#e;#Kt;#Yt;#Jt;#Qt;#Zt;#te;#ee;#G=0;constructor(){var{docId:t,ownerDocument:e=globalThis.document}=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};super(),this.#e=t,this.#Kt=e}get#$(){return this.#$t||=new Map}get#ne(){var t,e;return this.#Xt||(e=(t=this.#Kt.createElement("div"))["style"],e.visibility="hidden",e.contain="strict",e.width=e.height=0,e.position="absolute",e.top=e.left=0,e.zIndex=-1,(e=this.#Kt.createElementNS(n,"svg")).setAttribute("width",0),e.setAttribute("height",0),this.#Xt=this.#Kt.createElementNS(n,"defs"),t.append(e),e.append(this.#Xt),this.#Kt.body.append(t)),this.#Xt}addFilter(t){if(!t)return"none";let e,r,i,s,n=this.#$.get(t);if(n)return n;if(1===t.length){const n=t[0],a=new Array(256);for(let t=0;t<256;t++)a[t]=n[t]/255;s=e=r=i=a.join(",")}else{const[n,a,o]=t,l=new Array(256),h=new Array(256),c=new Array(256);for(let t=0;t<256;t++)l[t]=n[t]/255,h[t]=a[t]/255,c[t]=o[t]/255;e=l.join(","),r=h.join(","),i=c.join(","),s=""+e+r+i}if(n=this.#$.get(s))return this.#$.set(t,n),n;const a=`g_${this.#e}_transfer_map_`+this.#G++,o=`url(#${a})`,l=(this.#$.set(t,o),this.#$.set(s,o),this.#ie(a));return this.#re(e,r,i,l),o}addHCMFilter(t,e){var r=t+"-"+e;if(this.#Jt!==r&&(this.#Jt=r,this.#Qt="none",this.#Yt?.remove(),t)&&e){const n=this.#se(t),a=(t=d.Util.makeHexColor(...n),this.#se(e));if(e=d.Util.makeHexColor(...a),this.#ne.style.color="",("#000000"!==t||"#ffffff"!==e)&&t!==e){var i=new Array(256);for(let t=0;t<=255;t++){const e=t/255;i[t]=e<=.03928?e/12.92:((.055+e)/1.055)**2.4}r=i.join(","),t=`g_${this.#e}_hcm_filter`,e=this.#Zt=this.#ie(t),r=(this.#re(r,r,r,e),this.#ae(e),(t,e)=>{var r=n[t]/255,i=a[t]/255,s=new Array(e+1);for(let t=0;t<=e;t++)s[t]=r+t/e*(i-r);return s.join(",")});this.#re(r(0,5),r(1,5),r(2,5),e),this.#Qt=`url(#${t})`}}return this.#Qt}addHighlightHCMFilter(r,i,s,n){var a=r+`-${i}-${s}-`+n;if(this.#te!==a&&(this.#te=a,this.#ee="none",this.#Zt?.remove(),r)&&i){var[a,r]=[r,i].map(this.#se.bind(this));let l=Math.round(.2126*a[0]+.7152*a[1]+.0722*a[2]),h=Math.round(.2126*r[0]+.7152*r[1]+.0722*r[2]),[t,e]=[s,n].map(this.#se.bind(this));h<l&&([l,h,t,e]=[h,l,e,t]),this.#ne.style.color="";i=(t,e,r)=>{var i=new Array(256),s=(h-l)/r,n=t/255,a=(e-t)/(255*r);let o=0;for(let t=0;t<=r;t++){const e=Math.round(l+t*s),r=n+t*a;for(let t=o;t<=e;t++)i[t]=r;o=e+1}for(let t=o;t<256;t++)i[t]=i[o-1];return i.join(",")},a=`g_${this.#e}_hcm_highlight_filter`,r=this.#Zt=this.#ie(a);this.#ae(r),this.#re(i(t[0],e[0],5),i(t[1],e[1],5),i(t[2],e[2],5),r),this.#ee=`url(#${a})`}return this.#ee}destroy(){0<arguments.length&&void 0!==arguments[0]&&arguments[0]&&(this.#Qt||this.#ee)||(this.#Xt&&(this.#Xt.parentNode.parentNode.remove(),this.#Xt=null),this.#$t&&(this.#$t.clear(),this.#$t=null),this.#G=0)}#ae(t){var e=this.#Kt.createElementNS(n,"feColorMatrix");e.setAttribute("type","matrix"),e.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),t.append(e)}#ie(t){var e=this.#Kt.createElementNS(n,"filter");return e.setAttribute("color-interpolation-filters","sRGB"),e.setAttribute("id",t),this.#ne.append(e),e}#oe(t,e,r){e=this.#Kt.createElementNS(n,e);e.setAttribute("type","discrete"),e.setAttribute("tableValues",r),t.append(e)}#re(t,e,r,i){var s=this.#Kt.createElementNS(n,"feComponentTransfer");i.append(s),this.#oe(s,"feFuncR",t),this.#oe(s,"feFuncG",e),this.#oe(s,"feFuncB",r)}#se(t){return this.#ne.style.color=t,_(getComputedStyle(this.#ne).getPropertyValue("color"))}}e.DOMFilterFactory=a;class o extends i.BaseCanvasFactory{constructor(){var{ownerDocument:t=globalThis.document}=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};super(),this._document=t}_createCanvas(t,e){var r=this._document.createElement("canvas");return r.width=t,r.height=e,r}}async function l(i,t){let s=1<arguments.length&&void 0!==t&&t;if(m(i,document.baseURI)){t=await fetch(i);if(t.ok)return s?new Uint8Array(await t.arrayBuffer()):(0,d.stringToBytes)(await t.text());throw new Error(t.statusText)}return new Promise((e,t)=>{const r=new XMLHttpRequest;r.open("GET",i,!0),s&&(r.responseType="arraybuffer"),r.onreadystatechange=()=>{if(r.readyState===XMLHttpRequest.DONE){if(200===r.status||0===r.status){let t;if(s&&r.response?t=new Uint8Array(r.response):!s&&r.responseText&&(t=(0,d.stringToBytes)(r.responseText)),t)return void e(t)}t(new Error(r.statusText))}},r.send(null)})}e.DOMCanvasFactory=o;class h extends i.BaseCMapReaderFactory{_fetchData(t,e){return l(t,this.isCompressed).then(t=>({cMapData:t,compressionType:e}))}}e.DOMCMapReaderFactory=h;class c extends i.BaseStandardFontDataFactory{_fetchData(t){return l(t,!0)}}e.DOMStandardFontDataFactory=c;class u extends i.BaseSVGFactory{_createSVG(t){return document.createElementNS(n,t)}}e.DOMSVGFactory=u;class p{constructor(t){let{viewBox:e,scale:r,rotation:i,offsetX:s=0,offsetY:n=0,dontFlip:a=!1}=t;this.viewBox=e,this.scale=r,this.rotation=i,this.offsetX=s,this.offsetY=n;var t=(e[2]+e[0])/2,o=(e[3]+e[1])/2;let l,h,c,d,u,p,f,g;switch((i%=360)<0&&(i+=360),i){case 180:l=-1,h=0,c=0,d=1;break;case 90:l=0,h=1,c=1,d=0;break;case 270:l=0,h=-1,c=-1,d=0;break;case 0:l=1,h=0,c=0,d=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}a&&(c=-c,d=-d),g=0===l?(u=Math.abs(o-e[1])*r+s,p=Math.abs(t-e[0])*r+n,f=(e[3]-e[1])*r,(e[2]-e[0])*r):(u=Math.abs(t-e[0])*r+s,p=Math.abs(o-e[1])*r+n,f=(e[2]-e[0])*r,(e[3]-e[1])*r),this.transform=[l*r,h*r,c*r,d*r,u-l*r*t-c*r*o,p-h*r*t-d*r*o],this.width=f,this.height=g}get rawDims(){var t=this["viewBox"];return(0,d.shadow)(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone(){var{scale:t=this.scale,rotation:e=this.rotation,offsetX:r=this.offsetX,offsetY:i=this.offsetY,dontFlip:s=!1}=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new p({viewBox:this.viewBox.slice(),scale:t,rotation:e,offsetX:r,offsetY:i,dontFlip:s})}convertToViewportPoint(t,e){return d.Util.applyTransform([t,e],this.transform)}convertToViewportRectangle(t){var e=d.Util.applyTransform([t[0],t[1]],this.transform),t=d.Util.applyTransform([t[2],t[3]],this.transform);return[e[0],e[1],t[0],t[1]]}convertToPdfPoint(t,e){return d.Util.applyInverseTransform([t,e],this.transform)}}e.PageViewport=p;class f extends d.BaseException{constructor(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0;super(t,"RenderingCancelledException"),this.extraDelay=e}}function g(t){var e=t.length;let r=0;for(;r<e&&""===t[r].trim();)r++;return"data:"===t.substring(r,r+5).toLowerCase()}function m(t,e){try{var r=(e?new URL(t,e):new URL(t))["protocol"];return"http:"===r||"https:"===r}catch{return!1}}e.RenderingCancelledException=f,e.StatTimer=class{started=Object.create(null);times=[];time(t){t in this.started&&(0,d.warn)("Timer is already running for "+t),this.started[t]=Date.now()}timeEnd(t){t in this.started||(0,d.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(){const t=[];let e=0;for(const{name:t}of this.times)e=Math.max(t.length,e);for(var{name:r,start:i,end:s}of this.times)t.push(`${r.padEnd(e)} ${s-i}ms\n`);return t.join("")}};let v;function _(t){var e;return t.startsWith("#")?[(16711680&(e=parseInt(t.slice(1),16)))>>16,(65280&e)>>8,255&e]:t.startsWith("rgb(")?t.slice(4,-1).split(",").map(t=>parseInt(t)):t.startsWith("rgba(")?t.slice(5,-1).split(",").map(t=>parseInt(t)).slice(0,3):((0,d.warn)(`Not a valid color format: "${t}"`),[0,0,0])}e.PDFDateString=class{static toDateObject(t){if(!t||"string"!=typeof t)return null;t=(v||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?")).exec(t);if(!t)return null;var e=parseInt(t[1],10),r=1<=(r=parseInt(t[2],10))&&r<=12?r-1:0,i=1<=(i=parseInt(t[3],10))&&i<=31?i:1;let s=parseInt(t[4],10),n=(s=0<=s&&s<=23?s:0,parseInt(t[5],10));n=0<=n&&n<=59?n:0;var a=0<=(a=parseInt(t[6],10))&&a<=59?a:0,o=t[7]||"Z",l=0<=(l=parseInt(t[8],10))&&l<=23?l:0,t=0<=(t=parseInt(t[9],10)||0)&&t<=59?t:0;return"-"===o?(s+=l,n+=t):"+"===o&&(s-=l,n-=t),new Date(Date.UTC(e,r,i,s,n,a))}}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BaseStandardFontDataFactory=e.BaseSVGFactory=e.BaseFilterFactory=e.BaseCanvasFactory=e.BaseCMapReaderFactory=void 0,r(2);var i=r(1);e.BaseFilterFactory=class s{constructor(){this.constructor===s&&(0,i.unreachable)("Cannot initialize BaseFilterFactory.")}addFilter(t){return"none"}addHCMFilter(t,e){return"none"}addHighlightHCMFilter(t,e,r,i){return"none"}destroy(){}};e.BaseCanvasFactory=class n{constructor(){this.constructor===n&&(0,i.unreachable)("Cannot initialize BaseCanvasFactory.")}create(t,e){if(t<=0||e<=0)throw new Error("Invalid canvas size");return{canvas:t=this._createCanvas(t,e),context:t.getContext("2d")}}reset(t,e,r){if(!t.canvas)throw new Error("Canvas is not specified");if(e<=0||r<=0)throw new Error("Invalid canvas size");t.canvas.width=e,t.canvas.height=r}destroy(t){if(!t.canvas)throw new Error("Canvas is not specified");t.canvas.width=0,t.canvas.height=0,t.canvas=null,t.context=null}_createCanvas(t,e){(0,i.unreachable)("Abstract method `_createCanvas` called.")}};e.BaseCMapReaderFactory=class a{constructor(t){var{baseUrl:t=null,isCompressed:e=!0}=t;this.constructor===a&&(0,i.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=t,this.isCompressed=e}async fetch(t){if(t=t.name,!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!t)throw new Error("CMap name must be specified.");const e=this.baseUrl+t+(this.isCompressed?".bcmap":""),r=this.isCompressed?i.CMapCompressionType.BINARY:i.CMapCompressionType.NONE;return this._fetchData(e,r).catch(t=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: `+e)})}_fetchData(t,e){(0,i.unreachable)("Abstract method `_fetchData` called.")}};e.BaseStandardFontDataFactory=class o{constructor(t){var{baseUrl:t=null}=t;this.constructor===o&&(0,i.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=t}async fetch(t){if(t=t.filename,!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!t)throw new Error("Font filename must be specified.");const e=""+this.baseUrl+t;return this._fetchData(e).catch(t=>{throw new Error("Unable to load font data at: "+e)})}_fetchData(t){(0,i.unreachable)("Abstract method `_fetchData` called.")}};e.BaseSVGFactory=class l{constructor(){this.constructor===l&&(0,i.unreachable)("Cannot initialize BaseSVGFactory.")}create(t,e){var r=2<arguments.length&&void 0!==arguments[2]&&arguments[2];if(t<=0||e<=0)throw new Error("Invalid SVG dimensions");var i=this._createSVG("svg:svg");return i.setAttribute("version","1.1"),r||(i.setAttribute("width",t+"px"),i.setAttribute("height",e+"px")),i.setAttribute("preserveAspectRatio","none"),i.setAttribute("viewBox",`0 0 ${t} `+e),i}createElement(t){if("string"!=typeof t)throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){(0,i.unreachable)("Abstract method `_createSVG` called.")}}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MurmurHash3_64=void 0,r(93),r(101),r(102),r(105),r(107),r(109),r(113),r(116),r(123),r(2);var u=r(1);const i=3285377520,p=4294901760,f=65535;e.MurmurHash3_64=class{constructor(t){this.h1=t?4294967295&t:i,this.h2=t?4294967295&t:i}update(r){let i,s;if("string"==typeof r){i=new Uint8Array(2*r.length);for(let t=s=0,e=r.length;t<e;t++){const n=r.charCodeAt(t);n<=255?i[s++]=n:(i[s++]=n>>>8,i[s++]=255&n)}}else{if(!(0,u.isArrayBuffer)(r))throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");i=r.slice(),s=i.byteLength}const n=s>>2,t=s-4*n,e=new Uint32Array(i.buffer,0,n);let a=0,o,l=this.h1,h=this.h2;var c=3432918353,d=461845907;for(let t=0;t<n;t++)1&t?(a=(a=(a=(a=e[t])*c&p|11601*a&f)<<15|a>>>17)*d&p|13715*a&f,l=5*(l=(l^=a)<<13|l>>>19)+3864292196):(o=(o=(o=(o=e[t])*c&p|11601*o&f)<<15|o>>>17)*d&p|13715*o&f,h=5*(h=(h^=o)<<13|h>>>19)+3864292196);switch(a=0,t){case 3:a^=i[4*n+2]<<16;case 2:a^=i[4*n+1]<<8;case 1:a=(a=(a=(a^=i[4*n])*c&p|11601*a&f)<<15|a>>>17)*d&p|13715*a&f,1&n?l^=a:h^=a}this.h1=l,this.h2=h}hexdigest(){var t=this.h1,e=this.h2,t=3981806797*(t^=e>>>1)&p|36045*t&f;return t=444984403*(t^=(e=4283543511*e&p|(2950163797*(e<<16|t>>>16)&p)>>>16)>>>1)&p|60499*t&f,((t^=(e=3301882366*e&p|(3120437893*(e<<16|t>>>16)&p)>>>16)>>>1)>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FontLoader=e.FontFaceObject=void 0,r(125),r(136),r(138),r(141),r(143),r(145),r(147),r(89),r(149);var p=r(1);e.FontLoader=class{#le=new Set;constructor(t){var{ownerDocument:t=globalThis.document}=t;this._document=t,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(t){this.nativeFontFaces.add(t),this._document.fonts.add(t)}removeNativeFontFace(t){this.nativeFontFaces.delete(t),this._document.fonts.delete(t)}insertRule(t){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));var e=this.styleElement.sheet;e.insertRule(t,e.cssRules.length)}clear(){for(const t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.clear(),this.#le.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont(t){if(t&&!this.#le.has(t.loadedName))if((0,p.assert)(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){var{loadedName:e,src:r,style:i}=t,r=new FontFace(e,r,i);this.addNativeFontFace(r);try{await r.load(),this.#le.add(e)}catch{(0,p.warn)(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(r)}}else(0,p.unreachable)("Not implemented: loadSystemFont without the Font Loading API.")}async bind(e){if(!(e.attached||e.missingFile&&!e.systemFontInfo))if(e.attached=!0,e.systemFontInfo)await this.loadSystemFont(e.systemFontInfo);else if(this.isFontLoadingAPISupported){const r=e.createNativeFontFace();if(r){this.addNativeFontFace(r);try{await r.loaded}catch(t){throw(0,p.warn)(`Failed to load font '${r.family}': '${t}'.`),e.disableFontFace=!0,t}}}else{const r=e.createFontFaceRule();r&&(this.insertRule(r),this.isSyncFontLoadingSupported||await new Promise(t=>{t=this._queueLoadingCallback(t);this._prepareFontLoadEvent(e,t)}))}}get isFontLoadingAPISupported(){var t=!!this._document?.fonts;return(0,p.shadow)(this,"isFontLoadingAPISupported",t)}get isSyncFontLoadingSupported(){let t=!1;return(p.isNodeJS||"undefined"!=typeof navigator&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(t=!0),(0,p.shadow)(this,"isSyncFontLoadingSupported",t)}_queueLoadingCallback(t){const e=this["loadingRequests"],r={done:!1,complete:function(){for((0,p.assert)(!r.done,"completeRequest() cannot be called twice."),r.done=!0;0<e.length&&e[0].done;){var t=e.shift();setTimeout(t.callback,0)}},callback:t};return e.push(r),r}get _loadTestFont(){var t=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,p.shadow)(this,"_loadTestFont",t)}_prepareFontLoadEvent(t,e){function r(t,e){return t.charCodeAt(e)<<24|t.charCodeAt(e+1)<<16|t.charCodeAt(e+2)<<8|255&t.charCodeAt(e+3)}function i(t,e,r,i){return t.substring(0,e)+i+t.substring(e+r)}let s,n;var a=this._document.createElement("canvas");a.width=1,a.height=1;const o=a.getContext("2d");let l=0;var h="lt"+Date.now()+this.loadTestFontId++,c=1482184792;let d=r(a=i(this._loadTestFont,976,h.length,h),16);for(s=0,n=h.length-3;s<n;s+=4)d=d-c+r(h,s)|0;s<h.length&&(d=d-c+r(h+"XXX",s)|0),a=i(a,16,4,(0,p.string32)(d));a=`@font-face {font-family:"${h}";src:${`url(data:font/opentype;base64,${btoa(a)});`}}`;this.insertRule(a);const u=this._document.createElement("div");u.style.visibility="hidden",u.style.width=u.style.height="10px",u.style.position="absolute",u.style.top=u.style.left="0px";for(const e of[t.loadedName,h]){const t=this._document.createElement("span");t.textContent="Hi",t.style.fontFamily=e,u.append(t)}this._document.body.append(u),function t(e,r){30<++l?((0,p.warn)("Load test font never loaded."),r()):(o.font="30px "+e,o.fillText(".",0,20),0<o.getImageData(0,0,1,1).data[3]?r():setTimeout(t.bind(null,e,r)))}(h,()=>{u.remove(),e.complete()})}},e.FontFaceObject=class{constructor(t,e){var{isEvalSupported:e=!0,disableFontFace:r=!1,ignoreErrors:i=!1,inspectFont:s=null}=e;this.compiledGlyphs=Object.create(null);for(const e in t)this[e]=t[e];this.isEvalSupported=!1!==e,this.disableFontFace=!0===r,this.ignoreErrors=!0===i,this._inspectFont=s}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let t;var e;return t=this.cssFontInfo?(e={weight:this.cssFontInfo.fontWeight},this.cssFontInfo.italicAngle&&(e.style=`oblique ${this.cssFontInfo.italicAngle}deg`),new FontFace(this.cssFontInfo.fontFamily,this.data,e)):new FontFace(this.loadedName,this.data,{}),this._inspectFont?.(this),t}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;var e=(0,p.bytesToString)(this.data),e=`url(data:${this.mimetype};base64,${btoa(e)});`;let r;if(this.cssFontInfo){let t=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(t+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),r=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${t}src:${e}}`}else r=`@font-face {font-family:"${this.loadedName}";src:${e}}`;return this._inspectFont?.(this,e),r}getPathGenerator(t,e){if(void 0!==this.compiledGlyphs[e])return this.compiledGlyphs[e];let i;try{i=t.get(this.loadedName+"_path_"+e)}catch(t){if(this.ignoreErrors)return(0,p.warn)(`getPathGenerator - ignoring character: "${t}".`),this.compiledGlyphs[e]=function(t,e){};throw t}if(this.isEvalSupported&&p.FeatureTest.isEvalSupported){const t=[];for(const e of i){const i=void 0!==e.args?e.args.join(","):"";t.push("c.",e.cmd,"(",i,");\n")}return this.compiledGlyphs[e]=new Function("c","size",t.join(""))}return this.compiledGlyphs[e]=function(t,e){for(const r of i)"scale"===r.cmd&&(r.args=[e,-e]),t[r.cmd].apply(t,r.args)}}}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.NodeStandardFontDataFactory=e.NodeFilterFactory=e.NodeCanvasFactory=e.NodeCMapReaderFactory=void 0,r(2),r(93),r(101),r(102),r(105),r(107),r(109),r(113),r(116),r(123);var i=r(169),r=r(1);if(!globalThis.DOMMatrix&&r.isNodeJS)try{globalThis.DOMMatrix=require("canvas").DOMMatrix}catch(t){(0,r.warn)(`Cannot polyfill \`DOMMatrix\`, rendering may be broken: "${t}".`)}if(!globalThis.Path2D&&r.isNodeJS)try{var s=require("canvas")["CanvasRenderingContext2D"],n=require("path2d-polyfill")["polyfillPath2D"];globalThis.CanvasRenderingContext2D=s,n(globalThis)}catch(t){(0,r.warn)(`Cannot polyfill \`Path2D\`, rendering may be broken: "${t}".`)}function a(t){return new Promise((r,i)=>{require("fs").readFile(t,(t,e)=>{!t&&e?r(new Uint8Array(e)):i(new Error(t))})})}class o extends i.BaseFilterFactory{}e.NodeFilterFactory=o;class l extends i.BaseCanvasFactory{_createCanvas(t,e){return require("canvas").createCanvas(t,e)}}e.NodeCanvasFactory=l;class h extends i.BaseCMapReaderFactory{_fetchData(t,e){return a(t).then(t=>({cMapData:t,compressionType:e}))}}e.NodeCMapReaderFactory=h;class c extends i.BaseStandardFontDataFactory{_fetchData(t){return a(t)}}e.NodeStandardFontDataFactory=c},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CanvasGraphics=void 0,r(2),r(93),r(101),r(102),r(105),r(107),r(109),r(113),r(116),r(123),r(89);var y=r(1),M=r(168),A=r(174),d=r(175);const u=4096;class h{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,e,r){let i;return void 0!==this.cache[t]?(i=this.cache[t],this.canvasFactory.reset(i,e,r)):(i=this.canvasFactory.create(e,r),this.cache[t]=i),i}delete(t){delete this.cache[t]}clear(){for(const e in this.cache){var t=this.cache[e];this.canvasFactory.destroy(t),delete this.cache[e]}}}function v(t,e,r,i,s,n,a,o,l,h){var[c,d,u,p,f,g]=(0,M.getCurrentTransform)(t);if(0===d&&0===u){const M=a*c+f,m=Math.round(M),v=o*p+g,_=Math.round(v),b=(a+l)*c+f,y=Math.abs(Math.round(b)-m)||1,A=(o+h)*p+g,S=Math.abs(Math.round(A)-_)||1;t.setTransform(Math.sign(c),0,0,Math.sign(p),m,_),t.drawImage(e,r,i,s,n,0,0,y,S),void t.setTransform(c,d,u,p,f,g)}else if(0===c&&0===p){const M=o*u+f,x=Math.round(M),w=a*d+g,E=Math.round(w),T=(o+h)*u+f,C=Math.abs(Math.round(T)-x)||1,P=(a+l)*d+g,k=Math.abs(Math.round(P)-E)||1;t.setTransform(0,Math.sign(d),Math.sign(u),0,x,E),t.drawImage(e,r,i,s,n,0,0,k,C),void t.setTransform(c,d,u,p,f,g)}else t.drawImage(e,r,i,s,n,a,o,l,h),Math.hypot(c,d),Math.hypot(u,p)}class p{constructor(t,e){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=y.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=y.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=y.TextRenderingMode.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,t,e])}clone(){var t=Object.create(this);return t.clipBox=this.clipBox.slice(),t}setCurrentPoint(t,e){this.x=t,this.y=e}updatePathMinMax(t,e,r){[e,r]=y.Util.applyTransform([e,r],t),this.minX=Math.min(this.minX,e),this.minY=Math.min(this.minY,r),this.maxX=Math.max(this.maxX,e),this.maxY=Math.max(this.maxY,r)}updateRectMinMax(t,e){var r=y.Util.applyTransform(e,t),e=y.Util.applyTransform(e.slice(2),t);this.minX=Math.min(this.minX,r[0],e[0]),this.minY=Math.min(this.minY,r[1],e[1]),this.maxX=Math.max(this.maxX,r[0],e[0]),this.maxY=Math.max(this.maxY,r[1],e[1])}updateScalingPathMinMax(t,e){y.Util.scaleMinMax(t,e),this.minX=Math.min(this.minX,e[0]),this.maxX=Math.max(this.maxX,e[1]),this.minY=Math.min(this.minY,e[2]),this.maxY=Math.max(this.maxY,e[3])}updateCurvePathMinMax(t,e,r,i,s,n,a,o,l,h){e=y.Util.bezierBoundingBox(e,r,i,s,n,a,o,l);h?(h[0]=Math.min(h[0],e[0],e[2]),h[1]=Math.max(h[1],e[0],e[2]),h[2]=Math.min(h[2],e[1],e[3]),h[3]=Math.max(h[3],e[1],e[3])):this.updateRectMinMax(t,e)}getPathBoundingBox(){let t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:A.PathType.FILL,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;var r=[this.minX,this.minY,this.maxX,this.maxY];if(t===A.PathType.STROKE){e||(0,y.unreachable)("Stroke bounding box must include transform.");const t=y.Util.singularValueDecompose2dScale(e),i=t[0]*this.lineWidth/2,A=t[1]*this.lineWidth/2;r[0]-=i,r[1]-=A,r[2]+=i,r[3]+=A}return r}updateClipFromPath(){var t=y.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(t){this.clipBox=t,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:A.PathType.FILL;return y.Util.intersect(this.clipBox,this.getPathBoundingBox(t,1<arguments.length&&void 0!==arguments[1]?arguments[1]:null))}}function a(a,o){if("undefined"!=typeof ImageData&&o instanceof ImageData)a.putImageData(o,0,0);else{const c=o.height,d=o.width,u=c%16,p=(c-u)/16,f=0===u?p:p+1,g=a.createImageData(d,16);let i,s=0;var l=o.data,h=g.data;let e,r,n,t;if(o.kind===y.ImageKind.GRAYSCALE_1BPP){const o=l.byteLength,c=new Uint32Array(h.buffer,0,h.byteLength>>2),t=c.length,m=d+7>>3,v=4294967295,_=y.FeatureTest.isLittleEndian?4278190080:255;for(e=0;e<f;e++){for(n=e<p?16:u,i=0,r=0;r<n;r++){const a=o-s;let t=0;const u=a>m?d:8*a-7,p=-8&u;let e=0,r=0;for(;t<p;t+=8)r=l[s++],c[i++]=128&r?v:_,c[i++]=64&r?v:_,c[i++]=32&r?v:_,c[i++]=16&r?v:_,c[i++]=8&r?v:_,c[i++]=4&r?v:_,c[i++]=2&r?v:_,c[i++]=1&r?v:_;for(;t<u;t++)0===e&&(r=l[s++],e=128),c[i++]=r&e?v:_,e>>=1}for(;i<t;)c[i++]=0;a.putImageData(g,0,16*e)}}else if(o.kind===y.ImageKind.RGBA_32BPP){for(r=0,t=16*d*4,e=0;e<p;e++)h.set(l.subarray(s,s+t)),s+=t,a.putImageData(g,0,r),r+=16;e<f&&(t=d*u*4,h.set(l.subarray(s,s+t)),a.putImageData(g,0,r))}else{if(o.kind!==y.ImageKind.RGB_24BPP)throw new Error("bad image kind: "+o.kind);for(n=16,t=d*n,e=0;e<f;e++){for(e>=p&&(n=u,t=d*n),i=0,r=t;r--;)h[i++]=l[s++],h[i++]=l[s++],h[i++]=l[s++],h[i++]=255;a.putImageData(g,0,16*e)}}}}function _(r,t){if(t.bitmap)r.drawImage(t.bitmap,0,0);else{const n=t.height,a=t.width,o=n%16,l=(n-o)/16,h=0==o?l:1+l,c=r.createImageData(a,16);let e=0;var i=t.data,s=c.data;for(let t=0;t<h;t++){const n=t<l?16:o;({srcPos:e}=(0,d.convertBlackAndWhiteToRGBA)({src:i,srcPos:e,dest:s,width:a,height:n,nonBlackColor:0})),r.putImageData(c,0,16*t)}}}function f(t,e){for(const r of["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"])void 0!==t[r]&&(e[r]=t[r]);void 0!==t.setLineDash&&(e.setLineDash(t.getLineDash()),e.lineDashOffset=t.lineDashOffset)}function g(t){var e;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),y.isNodeJS||(e=t["filter"],"none"!==e&&""!==e&&(t.filter="none"))}function R(e,r,i){const s=e.length;for(let t=3;t<s;t+=4){const s=i?i[e[t]]:e[t];r[t]=r[t]*s*.00392156862745098|0}}function F(e,r,i){const s=e.length;for(let t=3;t<s;t+=4){const s=77*e[t-3]+152*e[t-2]+28*e[t-1];r[t]=i?r[t]*i[s>>8]>>8:r[t]*s>>16}}function b(t,e){var t=y.Util.singularValueDecompose2dScale(t),r=(t[0]=Math.fround(t[0]),t[1]=Math.fround(t[1]),Math.fround((globalThis.devicePixelRatio||1)*M.PixelsPerInch.PDF_TO_CSS_UNITS));return void 0!==e?e:t[0]<=r||t[1]<=r}const i=["butt","round","square"],s=["miter","round","bevel"],n={},o={};class l{constructor(t,e,r,i,s,n,a,o){var{optionalContentConfig:n,markedContentStack:l=null}=n;this.ctx=t,this.current=new p(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=e,this.objs=r,this.canvasFactory=i,this.filterFactory=s,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=l||[],this.optionalContentConfig=n,this.cachedCanvases=new h(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){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;return"string"==typeof t?(t.startsWith("g_")?this.commonObjs:this.objs).get(t):e}beginDrawing(t){var{transform:t,viewport:e,transparency:r=!1,background:i=null}=t,s=this.ctx.canvas.width,n=this.ctx.canvas.height,a=this.ctx.fillStyle;if(this.ctx.fillStyle=i||"#ffffff",this.ctx.fillRect(0,0,s,n),this.ctx.fillStyle=a,r){const t=this.cachedCanvases.getCanvas("transparent",s,n);this.compositeCtx=this.ctx,this.transparentCanvas=t.canvas,this.ctx=t.context,this.ctx.save(),this.ctx.transform(...(0,M.getCurrentTransform)(this.compositeCtx))}this.ctx.save(),g(this.ctx),t&&(this.ctx.transform(...t),this.outputScaleX=t[0],this.outputScaleY=t[0]),this.ctx.transform(...e.transform),this.viewportScale=e.scale,this.baseTransform=(0,M.getCurrentTransform)(this.ctx)}executeOperatorList(t,e,r,i){var s=t.argsArray,n=t.fnArray;let a=e||0;var o=s.length;if(o===a)return a;var l=10<o-a&&"function"==typeof r,h=l?Date.now()+15:0;let c=0;for(var d,u=this.commonObjs,p=this.objs;;){if(void 0!==i&&a===i.nextBreakPoint)return i.breakIt(a,r),a;if((d=n[a])!==y.OPS.dependency)this[d].apply(this,s[a]);else for(const t of s[a]){const e=t.startsWith("g_")?u:p;if(!e.has(t))return e.get(t,r),a}if(++a===o)return a;if(l&&10<++c){if(Date.now()>h)return r(),a;c=0}}}#ce(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)}endDrawing(){this.#ce(),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const t of this._cachedBitmapsMap.values()){for(const e of t.values())"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement&&(e.width=e.height=0);t.clear()}this._cachedBitmapsMap.clear(),this.#he()}#he(){var t,e;this.pageColors&&"none"!==(t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background))&&(e=this.ctx.filter,this.ctx.filter=t,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=e)}_scaleImage(r,t){var e=r.width,i=r.height;let s,n,a=Math.max(Math.hypot(t[0],t[1]),1),o=Math.max(Math.hypot(t[2],t[3]),1),l=e,h=i,c="prescale1";for(;2<a&&1<l||2<o&&1<h;){let t=l,e=h;2<a&&1<l&&(t=16384<=l?Math.floor(l/2)-1||1:Math.ceil(l/2),a/=l/t),2<o&&1<h&&(e=16384<=h?Math.floor(h/2)-1||1:Math.ceil(h)/2,o/=h/e),s=this.cachedCanvases.getCanvas(c,t,e),(n=s.context).clearRect(0,0,t,e),n.drawImage(r,0,0,l,h,0,0,t,e),r=s.canvas,l=t,h=e,c="prescale1"===c?"prescale2":"prescale1"}return{img:r,paintWidth:l,paintHeight:h}}_createMaskCanvas(t){const e=this.ctx,{width:r,height:i}=t,s=this.current.fillColor,n=this.current.patternFill,a=(0,M.getCurrentTransform)(e);let o,l,h,c;if((t.bitmap||t.data)&&1<t.count){const e=t.bitmap||t.data.buffer,r=(l=JSON.stringify(n?a:[a.slice(0,4),s]),(o=this._cachedBitmapsMap.get(e))||(o=new Map,this._cachedBitmapsMap.set(e,o)),o.get(l));if(r&&!n)return{canvas:r,offsetX:Math.round(Math.min(a[0],a[2])+a[4]),offsetY:Math.round(Math.min(a[1],a[3])+a[5])};h=r}h||_((c=this.cachedCanvases.getCanvas("maskCanvas",r,i)).context,t);var d=y.Util.transform(a,[1/r,0,0,-1/i,0,0]),d=y.Util.transform(d,[1,0,0,1,0,-i]),u=y.Util.applyTransform([0,0],d),p=y.Util.applyTransform([r,i],d),f=y.Util.normalizeRect([u[0],u[1],p[0],p[1]]),g=Math.round(f[2]-f[0])||1,f=Math.round(f[3]-f[1])||1,g=this.cachedCanvases.getCanvas("fillCanvas",g,f),f=g.context,m=Math.min(u[0],p[0]),u=Math.min(u[1],p[1]),p=(f.translate(-m,-u),f.transform(...d),h||(h=(h=this._scaleImage(c.canvas,(0,M.getCurrentTransformInverse)(f))).img,o&&n&&o.set(l,h)),f.imageSmoothingEnabled=b((0,M.getCurrentTransform)(f),t.interpolate),v(f,h,0,0,h.width,h.height,0,0,r,i),f.globalCompositeOperation="source-in",y.Util.transform((0,M.getCurrentTransformInverse)(f),[1,0,0,1,-m,-u]));return f.fillStyle=n?s.getPattern(e,this,p,A.PathType.FILL):s,f.fillRect(0,0,r,i),o&&!n&&(this.cachedCanvases.delete("fillCanvas"),o.set(l,g.canvas)),{canvas:g.canvas,offsetX:Math.round(m),offsetY:Math.round(u)}}setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(t){this.ctx.lineCap=i[t]}setLineJoin(t){this.ctx.lineJoin=s[t]}setMiterLimit(t){this.ctx.miterLimit=t}setDash(t,e){var r=this.ctx;void 0!==r.setLineDash&&(r.setLineDash(t),r.lineDashOffset=e)}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(var[e,r]of t)switch(e){case"LW":this.setLineWidth(r);break;case"LC":this.setLineCap(r);break;case"LJ":this.setLineJoin(r);break;case"ML":this.setMiterLimit(r);break;case"D":this.setDash(r[0],r[1]);break;case"RI":this.setRenderingIntent(r);break;case"FL":this.setFlatness(r);break;case"Font":this.setFont(r[0],r[1]);break;case"CA":this.current.strokeAlpha=r;break;case"ca":this.current.fillAlpha=r,this.ctx.globalAlpha=r;break;case"BM":this.ctx.globalCompositeOperation=r;break;case"SMask":this.current.activeSMask=r?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(r)}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){var t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");var t=this.ctx.canvas.width,e=this.ctx.canvas.height,r="smaskGroupAt"+this.groupLevel,r=this.cachedCanvases.getCanvas(r,t,e),t=(this.suspendedCtx=this.ctx,this.ctx=r.context,this.ctx),i=(t.setTransform(...(0,M.getCurrentTransform)(this.suspendedCtx)),f(this.suspendedCtx,t),t),a=this.suspendedCtx;if(i._removeMirroring)throw new Error("Context is already forwarding operations.");i.__originalSave=i.save,i.__originalRestore=i.restore,i.__originalRotate=i.rotate,i.__originalScale=i.scale,i.__originalTranslate=i.translate,i.__originalTransform=i.transform,i.__originalSetTransform=i.setTransform,i.__originalResetTransform=i.resetTransform,i.__originalClip=i.clip,i.__originalMoveTo=i.moveTo,i.__originalLineTo=i.lineTo,i.__originalBezierCurveTo=i.bezierCurveTo,i.__originalRect=i.rect,i.__originalClosePath=i.closePath,i.__originalBeginPath=i.beginPath,i._removeMirroring=()=>{i.save=i.__originalSave,i.restore=i.__originalRestore,i.rotate=i.__originalRotate,i.scale=i.__originalScale,i.translate=i.__originalTranslate,i.transform=i.__originalTransform,i.setTransform=i.__originalSetTransform,i.resetTransform=i.__originalResetTransform,i.clip=i.__originalClip,i.moveTo=i.__originalMoveTo,i.lineTo=i.__originalLineTo,i.bezierCurveTo=i.__originalBezierCurveTo,i.rect=i.__originalRect,i.closePath=i.__originalClosePath,i.beginPath=i.__originalBeginPath,delete i._removeMirroring},i.save=function(){a.save(),this.__originalSave()},i.restore=function(){a.restore(),this.__originalRestore()},i.translate=function(t,e){a.translate(t,e),this.__originalTranslate(t,e)},i.scale=function(t,e){a.scale(t,e),this.__originalScale(t,e)},i.transform=function(t,e,r,i,s,n){a.transform(t,e,r,i,s,n),this.__originalTransform(t,e,r,i,s,n)},i.setTransform=function(t,e,r,i,s,n){a.setTransform(t,e,r,i,s,n),this.__originalSetTransform(t,e,r,i,s,n)},i.resetTransform=function(){a.resetTransform(),this.__originalResetTransform()},i.rotate=function(t){a.rotate(t),this.__originalRotate(t)},i.clip=function(t){a.clip(t),this.__originalClip(t)},i.moveTo=function(t,e){a.moveTo(t,e),this.__originalMoveTo(t,e)},i.lineTo=function(t,e){a.lineTo(t,e),this.__originalLineTo(t,e)},i.bezierCurveTo=function(t,e,r,i,s,n){a.bezierCurveTo(t,e,r,i,s,n),this.__originalBezierCurveTo(t,e,r,i,s,n)},i.rect=function(t,e,r,i){a.rect(t,e,r,i),this.__originalRect(t,e,r,i)},i.closePath=function(){a.closePath(),this.__originalClosePath()},i.beginPath=function(){a.beginPath(),this.__originalBeginPath()},this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),f(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(t){if(this.current.activeSMask){t?(t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.ceil(t[2]),t[3]=Math.ceil(t[3])):t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];var e=this.current.activeSMask,r=this.suspendedCtx,i=this.ctx,s=(t=t)[0],n=t[1],a=t[2]-s,t=t[3]-n;if(0!=a&&0!=t){var o,l=e.context,h=i,c=a,d=t,a=e.subtype,u=e.backdrop,p=e.transferMap,f=s,g=n,m=e.offsetX,v=e.offsetY,_=!!u,b=_?u[0]:0,y=_?u[1]:0,A=_?u[2]:0,S="Luminosity"===a?F:R,x=Math.min(d,Math.ceil(1048576/c));for(let t=0;t<d;t+=x){const u=Math.min(x,d-t),P=l.getImageData(f-m,t+(g-v),c,u),k=h.getImageData(f,t+g,c,u);if(_){w=void 0;E=void 0;T=void 0;C=void 0;o=void 0;var w=P.data;var E=b;var T=y;var C=A;const M=w.length;for(let t=3;t<M;t+=4){const M=w[t];0===M?(w[t-3]=E,w[t-2]=T,w[t-1]=C):M<255&&(o=255-M,w[t-3]=w[t-3]*M+E*o>>8,w[t-2]=w[t-2]*M+T*o>>8,w[t-1]=w[t-1]*M+C*o>>8)}}S(P.data,k.data,p),h.putImageData(k,f,t+g)}r.save(),r.globalAlpha=1,r.globalCompositeOperation="source-over",r.setTransform(1,0,0,1,0,0),r.drawImage(i.canvas,0,0),r.restore()}this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}}save(){(this.inSMaskMode?(f(this.ctx,this.suspendedCtx),this.suspendedCtx):this.ctx).save();var t=this.current;this.stateStack.push(t),this.current=t.clone()}restore(){0===this.stateStack.length&&this.inSMaskMode&&this.endSMaskMode(),0!==this.stateStack.length&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),f(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(t,e,r,i,s,n){this.ctx.transform(t,e,r,i,s,n),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(i,s,n){var a=this.ctx,o=this.current;let l,h,c=o.x,d=o.y;var u=(0,M.getCurrentTransform)(a),p=0===u[0]&&0===u[3]||0===u[1]&&0===u[2],f=p?n.slice(0):null;for(let t=0,e=0,r=i.length;t<r;t++)switch(0|i[n]){case y.OPS.rectangle:c=s[e++],d=s[e++];const i=s[e++],n=s[e++],g=c+i,m=d+n;a.moveTo(c,d),0===i||0===n?a.lineTo(g,m):(a.lineTo(g,d),a.lineTo(g,m),a.lineTo(c,m)),p||o.updateRectMinMax(u,[c,d,g,m]),a.closePath();break;case y.OPS.moveTo:c=s[e++],d=s[e++],a.moveTo(c,d),p||o.updatePathMinMax(u,c,d);break;case y.OPS.lineTo:c=s[e++],d=s[e++],a.lineTo(c,d),p||o.updatePathMinMax(u,c,d);break;case y.OPS.curveTo:l=c,h=d,c=s[e+4],d=s[e+5],a.bezierCurveTo(s[e],s[e+1],s[e+2],s[e+3],c,d),o.updateCurvePathMinMax(u,l,h,s[e],s[e+1],s[e+2],s[e+3],c,d,f),e+=6;break;case y.OPS.curveTo2:l=c,h=d,a.bezierCurveTo(c,d,s[e],s[e+1],s[e+2],s[e+3]),o.updateCurvePathMinMax(u,l,h,c,d,s[e],s[e+1],s[e+2],s[e+3],f),c=s[e+2],d=s[e+3],e+=4;break;case y.OPS.curveTo3:l=c,h=d,c=s[e+2],d=s[e+3],a.bezierCurveTo(s[e],s[e+1],c,d,c,d),o.updateCurvePathMinMax(u,l,h,s[e],s[e+1],c,d,c,d,f),e+=4;break;case y.OPS.closePath:a.closePath()}p&&o.updateScalingPathMinMax(u,f),o.setCurrentPoint(c,d)}closePath(){this.ctx.closePath()}stroke(){var t=!(0<arguments.length&&void 0!==arguments[0])||arguments[0],e=this.ctx,r=this.current.strokeColor;e.globalAlpha=this.current.strokeAlpha,this.contentVisible&&("object"==typeof r&&r?.getPattern?(e.save(),e.strokeStyle=r.getPattern(e,this,(0,M.getCurrentTransformInverse)(e),A.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(){var t=!(0<arguments.length&&void 0!==arguments[0])||arguments[0],e=this.ctx,r=this.current.fillColor;let i=!1;this.current.patternFill&&(e.save(),e.fillStyle=r.getPattern(e,this,(0,M.getCurrentTransformInverse)(e),A.PathType.FILL),i=!0);r=this.current.getClippedPathBoundingBox();this.contentVisible&&null!==r&&(this.pendingEOFill?(e.fill("evenodd"),this.pendingEOFill=!1):e.fill()),i&&e.restore(),t&&this.consumePath(r)}eoFill(){this.pendingEOFill=!0,this.fill()}fillStroke(){this.fill(!1),this.stroke(!1),this.consumePath()}eoFillStroke(){this.pendingEOFill=!0,this.fillStroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=n}eoClip(){this.pendingClip=o}beginText(){this.current.textMatrix=y.IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){var t=this.pendingTextPaths,e=this.ctx;if(void 0!==t){e.save(),e.beginPath();for(const r of t)e.setTransform(...r.transform),e.translate(r.x,r.y),r.addToPath(e,r.fontSize);e.restore(),e.clip(),e.beginPath(),delete this.pendingTextPaths}else e.beginPath()}setCharSpacing(t){this.current.charSpacing=t}setWordSpacing(t){this.current.wordSpacing=t}setHScale(t){this.current.textHScale=t/100}setLeading(t){this.current.leading=-t}setFont(r,i){var s=this.commonObjs.get(r),n=this.current;if(!s)throw new Error("Can't find font for "+r);if(n.fontMatrix=s.fontMatrix||y.FONT_IDENTITY_MATRIX,0!==n.fontMatrix[0]&&0!==n.fontMatrix[3]||(0,y.warn)("Invalid font matrix for font "+r),i<0?(i=-i,n.fontDirection=-1):n.fontDirection=1,this.current.font=s,this.current.fontSize=i,!s.isType3Font){r=s.loadedName||"sans-serif",n=s.systemFontInfo?.css||`"${r}", `+s.fallbackName;let t="normal";s.black?t="900":s.bold&&(t="bold");r=s.italic?"italic":"normal";let e=i;i<16?e=16:100<i&&(e=100),this.current.fontSizeScale=i/e,this.ctx.font=r+` ${t} ${e}px `+n}}setTextRenderingMode(t){this.current.textRenderingMode=t}setTextRise(t){this.current.textRise=t}moveText(t,e){this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=e}setLeadingMoveText(t,e){this.setLeading(-e),this.moveText(t,e)}setTextMatrix(t,e,r,i,s,n){this.current.textMatrix=[t,e,r,i,s,n],this.current.textMatrixScale=Math.hypot(t,e),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(t,e,r,i){var s=this.ctx,n=this.current,a=n.font,o=n.textRenderingMode,l=n.fontSize/n.fontSizeScale,h=o&y.TextRenderingMode.FILL_STROKE_MASK,o=!!(o&y.TextRenderingMode.ADD_TO_PATH_FLAG),n=n.patternFill&&!a.missingFile;let c;(a.disableFontFace||o||n)&&(c=a.getPathGenerator(this.commonObjs,t)),a.disableFontFace||n?(s.save(),s.translate(e,r),s.beginPath(),c(s,l),i&&s.setTransform(...i),h!==y.TextRenderingMode.FILL&&h!==y.TextRenderingMode.FILL_STROKE||s.fill(),h!==y.TextRenderingMode.STROKE&&h!==y.TextRenderingMode.FILL_STROKE||s.stroke(),s.restore()):(h!==y.TextRenderingMode.FILL&&h!==y.TextRenderingMode.FILL_STROKE||s.fillText(t,e,r),h!==y.TextRenderingMode.STROKE&&h!==y.TextRenderingMode.FILL_STROKE||s.strokeText(t,e,r)),o&&(this.pendingTextPaths||=[]).push({transform:(0,M.getCurrentTransform)(s),x:e,y:r,fontSize:l,addToPath:c})}get isFontSubpixelAAEnabled(){var t=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10)["context"],e=(t.scale(1.5,1),t.fillText("I",0,10),t.getImageData(0,0,10,10).data);let r=!1;for(let t=3;t<e.length;t+=4)if(0<e[t]&&e[t]<255){r=!0;break}return(0,y.shadow)(this,"isFontSubpixelAAEnabled",r)}showText(a){const o=this.current,l=o.font;if(l.isType3Font)return this.showType3Text(a);var h=o.fontSize;if(0!==h){const c=this.ctx,d=o.fontSizeScale,u=o.charSpacing,p=o.wordSpacing,f=o.fontDirection,g=o.textHScale*f,r=a.length,m=l.vertical,i=m?1:-1,v=l.defaultVMetrics,_=h*o.fontMatrix[0],b=o.textRenderingMode===y.TextRenderingMode.FILL&&!l.disableFontFace&&!o.patternFill;c.save(),c.transform(...o.textMatrix),c.translate(o.x,o.y+o.textRise),0<f?c.scale(g,-1):c.scale(g,1);let n;if(o.patternFill){c.save();const a=o.fillColor.getPattern(c,this,(0,M.getCurrentTransformInverse)(c),A.PathType.FILL);n=(0,M.getCurrentTransform)(c),c.restore(),c.fillStyle=a}let t=o.lineWidth;var e=o.textMatrixScale;if(0===e||0===t){const a=o.textRenderingMode&y.TextRenderingMode.FILL_STROKE_MASK;a!==y.TextRenderingMode.STROKE&&a!==y.TextRenderingMode.FILL_STROKE||(t=this.getSinglePixelWidth())}else t/=e;if(1!==d&&(c.scale(d,d),t/=d),c.lineWidth=t,l.isInvalidPDFjsFont){const l=[];let t=0;for(const o of a)l.push(o.unicode),t+=o.width;c.fillText(l.join(""),0,0),o.x+=t*_*g,c.restore(),void this.compose()}else{let t,s=0;for(t=0;t<r;++t){const o=a[t];if("number"==typeof o)s+=i*o*h/1e3;else{let t=!1;const M=(o.isSpace?p:0)+u,A=o.fontChar,g=o.accent;let e,r,i=o.width;if(m){const a=o.vmetric||v,l=-(o.vmetric?a[1]:.5*i)*_,y=a[2]*_;i=a?-a[0]:i,e=l/d,r=(s+y)/d}else e=s/d,r=0;if(l.remeasure&&0<i){const a=1e3*c.measureText(A).width/h*d;if(i<a&&this.isFontSubpixelAAEnabled){const o=i/a;t=!0,c.save(),c.scale(o,1),e/=o}else i!==a&&(e+=(i-a)/2e3*h/d)}if(this.contentVisible&&(o.isInFont||l.missingFile))if(b&&!g)c.fillText(A,e,r);else if(this.paintChar(A,e,r,n),g){const a=e+h*g.offset.x/d,o=r-h*g.offset.y/d;this.paintChar(g.fontChar,a,o,n)}s+=m?i*_-M*f:i*_+M*f,t&&c.restore()}}m?o.y-=s:o.x+=s*g,c.restore(),this.compose()}}}showType3Text(t){const e=this.ctx,r=this.current,i=r.font,s=r.fontSize,n=r.fontDirection,a=i.vertical?1:-1,o=r.charSpacing,l=r.wordSpacing,h=r.textHScale*n,c=r.fontMatrix||y.FONT_IDENTITY_MATRIX,d=t.length;let u,p,f,g;if(r.textRenderingMode!==y.TextRenderingMode.INVISIBLE&&0!==s){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,e.save(),e.transform(...r.textMatrix),e.translate(r.x,r.y),e.scale(h,n),u=0;u<d;++u)if("number"==typeof(p=t[u]))this.ctx.translate(g=a*p*s/1e3,0),r.x+=g*h;else{const n=(p.isSpace?l:0)+o,d=i.charProcOperatorList[p.operatorListId];d?(this.contentVisible&&(this.processingType3=p,this.save(),e.scale(s,s),e.transform(...c),this.executeOperatorList(d),this.restore()),f=y.Util.applyTransform([p.width,0],c)[0]*s+n,e.translate(f,0),r.x+=f*h):(0,y.warn)(`Type3 character "${p.operatorListId}" is not available.`)}e.restore(),this.processingType3=null}}setCharWidth(t,e){}setCharWidthAndBounds(t,e,r,i,s,n){this.ctx.rect(r,i,s-r,n-i),this.ctx.clip(),this.endPath()}getColorN_Pattern(t){let e;var r,i;return e="TilingPattern"===t[0]?(r=t[1],i=this.baseTransform||(0,M.getCurrentTransform)(this.ctx),new A.TilingPattern(t,r,this.ctx,{createCanvasGraphics:t=>new l(t,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})},i)):this._getPattern(t[1],t[2])}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(t,e,r){t=y.Util.makeHexColor(t,e,r);this.ctx.strokeStyle=t,this.current.strokeColor=t}setFillRGBColor(t,e,r){t=y.Util.makeHexColor(t,e,r);this.ctx.fillStyle=t,this.current.fillColor=t,this.current.patternFill=!1}_getPattern(t){let e,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;return this.cachedPatterns.has(t)?e=this.cachedPatterns.get(t):(e=(0,A.getShadingPattern)(this.getObject(t)),this.cachedPatterns.set(t,e)),r&&(e.matrix=r),e}shadingFill(t){if(this.contentVisible){var e=this.ctx;this.save();const i=this._getPattern(t);e.fillStyle=i.getPattern(e,this,(0,M.getCurrentTransformInverse)(e),A.PathType.SHADING);var r=(0,M.getCurrentTransformInverse)(e);if(r){const{width:t,height:i}=e.canvas,[M,A,s,n]=y.Util.getAxialAlignedBoundingBox([0,0,t,i],r);this.ctx.fillRect(M,A,s-M,n-A)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}}beginInlineImage(){(0,y.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,y.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,M.getCurrentTransform)(this.ctx),e)){const t=e[2]-e[0],r=e[3]-e[1];this.ctx.rect(e[0],e[1],t,r),this.current.updateRectMinMax((0,M.getCurrentTransform)(this.ctx),e),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(n){if(this.contentVisible){this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);var a=this.ctx,o=(n.isolated||(0,y.info)("TODO: Support non-isolated groups."),n.knockout&&(0,y.warn)("Knockout groups not supported."),(0,M.getCurrentTransform)(a));if(n.matrix&&a.transform(...n.matrix),!n.bbox)throw new Error("Bounding box is required.");var l=y.Util.getAxialAlignedBoundingBox(n.bbox,(0,M.getCurrentTransform)(a)),h=[0,0,a.canvas.width,a.canvas.height],l=y.Util.intersect(l,h)||[0,0,0,0],h=Math.floor(l[0]),c=Math.floor(l[1]);let t=Math.max(Math.ceil(l[2])-h,1),e=Math.max(Math.ceil(l[3])-c,1),r=1,i=1,s=(t>u&&(r=t/u,t=u),e>u&&(i=e/u,e=u),this.current.startNewPathAndClipBox([0,0,t,e]),"groupAt"+this.groupLevel);n.smask&&(s+="_smask_"+this.smaskCounter++%2);var l=this.cachedCanvases.getCanvas(s,t,e),d=l.context;d.scale(1/r,1/i),d.translate(-h,-c),d.transform(...o),n.smask?this.smaskStack.push({canvas:l.canvas,context:d,offsetX:h,offsetY:c,scaleX:r,scaleY:i,subtype:n.smask.subtype,backdrop:n.smask.backdrop,transferMap:n.smask.transferMap||null,startTransformInverse:null}):(a.setTransform(1,0,0,1,0,0),a.translate(h,c),a.scale(r,i),a.save()),f(a,d),this.ctx=d,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(a),this.groupLevel++}}endGroup(t){if(this.contentVisible){this.groupLevel--;const e=this.ctx,r=this.groupStack.pop();if(this.ctx=r,this.ctx.imageSmoothingEnabled=!1,t.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const t=(0,M.getCurrentTransform)(this.ctx),r=(this.restore(),this.ctx.save(),this.ctx.setTransform(...t),y.Util.getAxialAlignedBoundingBox([0,0,e.canvas.width,e.canvas.height],t));this.ctx.drawImage(e.canvas,0,0),this.ctx.restore(),this.compose(r)}}}beginAnnotation(t,e,r,i,s){if(this.#ce(),g(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),Array.isArray(e)&&4===e.length){const i=e[2]-e[0],o=e[3]-e[1];if(s&&this.annotationCanvasMap){(r=r.slice())[4]-=e[0],r[5]-=e[1],(e=e.slice())[0]=e[1]=0,e[2]=i,e[3]=o;const[s,l]=y.Util.singularValueDecompose2dScale((0,M.getCurrentTransform)(this.ctx)),h=this["viewportScale"],c=Math.ceil(i*this.outputScaleX*h),d=Math.ceil(o*this.outputScaleY*h);this.annotationCanvas=this.canvasFactory.create(c,d);var{canvas:n,context:a}=this.annotationCanvas;this.annotationCanvasMap.set(t,n),this.annotationCanvas.savedCtx=this.ctx,this.ctx=a,this.ctx.save(),this.ctx.setTransform(s,0,0,-l,0,o*l),g(this.ctx)}else g(this.ctx),this.ctx.rect(e[0],e[1],i,o),this.ctx.clip(),this.endPath()}this.current=new p(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...r),this.transform(...i)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),this.#he(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(t){var e,r;this.contentVisible&&(e=t.count,(t=this.getObject(t.data,t)).count=e,e=this.ctx,(r=this.processingType3)&&(void 0===r.compiled&&(r.compiled=function(t){const{width:r,height:i}=t;if(1e3<r||1e3<i)return null;const s=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),n=r+1;let a,e,o,l=new Uint8Array(n*(i+1));var h=r+7&-8;let c=new Uint8Array(h*i),d=0;for(const r of t.data){let t=128;for(;0<t;)c[d++]=r&t?0:255,t>>=1}let u=0;for((d=0)!==c[d]&&(l[0]=1,++u),e=1;e<r;e++)c[d]!==c[d+1]&&(l[e]=c[d]?2:1,++u),d++;for(0!==c[d]&&(l[e]=2,++u),a=1;a<i;a++){d=a*h,o=a*n,c[d-h]!==c[d]&&(l[o]=c[d]?1:8,++u);let t=(c[d]?4:0)+(c[d-h]?8:0);for(e=1;e<r;e++)t=(t>>2)+(c[d+1]?4:0)+(c[d-h+1]?8:0),s[t]&&(l[o+e]=s[t],++u),d++;if(c[d-h]!==c[d]&&(l[o+e]=c[d]?2:4,++u),1e3<u)return null}for(d=h*(i-1),o=a*n,0!==c[d]&&(l[o]=8,++u),e=1;e<r;e++)c[d]!==c[d+1]&&(l[o+e]=c[d]?4:8,++u),d++;if(0!==c[d]&&(l[o+e]=4,++u),1e3<u)return null;const p=new Int32Array([0,n,-1,0,-n,0,0,0,1]),f=new Path2D;for(a=0;u&&a<=i;a++){let e=a*n;const i=e+r;for(;e<i&&!l[e];)e++;if(e!==i){f.moveTo(e%n,a);const s=e;let t=l[e];do{const r=p[t];for(;e+=r,!l[e];);const i=l[e];5!==i&&10!==i?(t=i,l[e]=0):(t=i&51*t>>4,l[e]&=t>>2|t<<2),f.lineTo(e%n,e/n|0),l[e]||--u}while(s!==e);--a}}return c=null,l=null,function(t){t.save(),t.scale(1/r,-1/i),t.translate(0,-i),t.fill(f),t.beginPath(),t.restore()}}(t)),r.compiled)?r.compiled(e):(t=(r=this._createMaskCanvas(t)).canvas,e.save(),e.setTransform(1,0,0,1,0,0),e.drawImage(t,r.offsetX,r.offsetY),e.restore(),this.compose()))}paintImageMaskXObjectRepeat(t,r){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0,s=3<arguments.length&&void 0!==arguments[3]?arguments[3]:0,n=4<arguments.length?arguments[4]:void 0,a=5<arguments.length?arguments[5]:void 0;if(this.contentVisible){t=this.getObject(t.data,t);var o=this.ctx,l=(o.save(),(0,M.getCurrentTransform)(o)),h=(o.transform(r,i,s,n,0,0),this._createMaskCanvas(t));o.setTransform(1,0,0,1,h.offsetX-l[4],h.offsetY-l[5]);for(let t=0,e=a.length;t<e;t+=2){const M=y.Util.transform(l,[r,i,s,n,a[t],a[t+1]]),[c,d]=y.Util.applyTransform([0,0],M);o.drawImage(h.canvas,c,d)}o.restore(),this.compose()}}paintImageMaskXObjectGroup(t){if(this.contentVisible){var e=this.ctx,r=this.current.fillColor,i=this.current.patternFill;for(const s of t){const{data:t,width:n,height:a,transform:o}=s,l=this.cachedCanvases.getCanvas("maskCanvas",n,a),h=l.context;h.save(),_(h,this.getObject(t,s)),h.globalCompositeOperation="source-in",h.fillStyle=i?r.getPattern(h,this,(0,M.getCurrentTransformInverse)(e),A.PathType.FILL):r,h.fillRect(0,0,n,a),h.restore(),e.save(),e.transform(...o),e.scale(1,-1),v(e,l.canvas,0,0,n,a,0,-1,1,1),e.restore()}this.compose()}}paintImageXObject(t){this.contentVisible&&((t=this.getObject(t))?this.paintInlineImageXObject(t):(0,y.warn)("Dependent image isn't ready yet"))}paintImageXObjectRepeat(t,r,i,s){if(this.contentVisible){t=this.getObject(t);if(t){var n=t.width,a=t.height,o=[];for(let t=0,e=s.length;t<e;t+=2)o.push({transform:[r,0,0,i,s[t],s[t+1]],x:0,y:0,w:n,h:a});this.paintInlineImageXObjectGroup(t,o)}else(0,y.warn)("Dependent image isn't ready yet")}}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){var e,r;return"none"===this.current.transferMaps?t.bitmap:({bitmap:t,width:e,height:r}=t,(r=(e=this.cachedCanvases.getCanvas("inlineImage",e,r)).context).filter=this.current.transferMaps,r.drawImage(t,0,0),r.filter="none",e.canvas)}paintInlineImageXObject(e){if(this.contentVisible){var r=e.width,i=e.height,s=this.ctx;if(this.save(),!y.isNodeJS){const e=s["filter"];"none"!==e&&""!==e&&(s.filter="none")}s.scale(1/r,-1/i);let t;if(e.bitmap)t=this.applyTransferMapsToBitmap(e);else if("function"==typeof HTMLElement&&e instanceof HTMLElement||!e.data)t=e;else{const y=this.cachedCanvases.getCanvas("inlineImage",r,i).context;a(y,e),t=this.applyTransferMapsToCanvas(y)}var n=this._scaleImage(t,(0,M.getCurrentTransformInverse)(s));s.imageSmoothingEnabled=b((0,M.getCurrentTransform)(s),e.interpolate),v(s,n.img,0,0,n.paintWidth,n.paintHeight,0,-i,r,i),this.compose(),this.restore()}}paintInlineImageXObjectGroup(e,r){if(this.contentVisible){const i=this.ctx;let t;if(e.bitmap)t=e.bitmap;else{const r=e.width,i=e.height,s=this.cachedCanvases.getCanvas("inlineImage",r,i).context;a(s,e),t=this.applyTransferMapsToCanvas(s)}for(const e of r)i.save(),i.transform(...e.transform),i.scale(1,-1),v(i,t,e.x,e.y,e.w,e.h,0,-1,1,1),i.restore();this.compose()}}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t){}markPointProps(t,e){}beginMarkedContent(t){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,e){"OC"===t?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(e)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(t){var e=this.current.isEmptyClip(),t=(this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(t),this.ctx);this.pendingClip&&(e||(this.pendingClip===o?t.clip("evenodd"):t.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),t.beginPath()}getSinglePixelWidth(){var t,e,r;return this._cachedGetSinglePixelWidth||(0===(r=(0,M.getCurrentTransform)(this.ctx))[1]&&0===r[2]?this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(r[0]),Math.abs(r[3])):(t=Math.abs(r[0]*r[3]-r[2]*r[1]),e=Math.hypot(r[0],r[2]),r=Math.hypot(r[1],r[3]),this._cachedGetSinglePixelWidth=Math.max(e,r)/t)),this._cachedGetSinglePixelWidth}getScaleForStroking(){if(-1===this._cachedScaleForStroking[0]){var r,i,s,n=this.current["lineWidth"],{a,b:o,c:l,d:h}=this.ctx.getTransform();let t,e;0===o&&0===l?(s=Math.abs(a))===(r=Math.abs(h))?t=e=0===n?1/s:(i=s*n)<1?1/i:1:e=0===n?(t=1/s,1/r):(i=s*n,s=r*n,t=i<1?1/i:1,s<1?1/s:1):(r=Math.abs(a*h-o*l),i=Math.hypot(a,o),s=Math.hypot(l,h),e=0===n?(t=s/r,i/r):(a=n*r,t=a<s?s/a:1,a<i?i/a:1)),this._cachedScaleForStroking[0]=t,this._cachedScaleForStroking[1]=e}return this._cachedScaleForStroking}rescaleAndStroke(e){var t=this["ctx"],r=this.current["lineWidth"],[i,s]=this.getScaleForStroking();if(t.lineWidth=r||1,1===i&&1===s)t.stroke();else{r=t.getLineDash();if(e&&t.save(),t.scale(i,s),0<r.length){const e=Math.max(i,s);t.setLineDash(r.map(t=>t/e)),t.lineDashOffset/=e}t.stroke(),e&&t.restore()}}isContentVisible(){for(let t=this.markedContentStack.length-1;0<=t;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}e.CanvasGraphics=l;for(const t in y.OPS)void 0!==l.prototype[t]&&(l.prototype[y.OPS[t]]=l.prototype[t])},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TilingPattern=e.PathType=void 0,e.getShadingPattern=function(t){switch(t[0]){case"RadialAxial":return new s(t);case"Mesh":return new n(t);case"Dummy":return new a}throw new Error("Unknown IR type: "+t[0])},r(2);var v=r(1),_=r(168);const h={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function c(t,e){var r,i,s;e&&(r=e[2]-e[0],i=e[3]-e[1],(s=new Path2D).rect(e[0],e[1],r,i),t.clip(s))}e.PathType=h;class i{constructor(){this.constructor===i&&(0,v.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,v.unreachable)("Abstract method `getPattern` called.")}}class s extends i{constructor(t){super(),this._type=t[1],this._bbox=t[2],this._colorStops=t[3],this._p0=t[4],this._p1=t[5],this._r0=t[6],this._r1=t[7],this.matrix=null}_createGradient(t){let e;"axial"===this._type?e=t.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(e=t.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const t of this._colorStops)e.addColorStop(t[0],t[1]);return e}getPattern(t,e,r,i){let s;if(i===h.STROKE||i===h.FILL){const h=e.current.getClippedPathBoundingBox(i,(0,_.getCurrentTransform)(t))||[0,0,0,0],n=Math.ceil(h[2]-h[0])||1,a=Math.ceil(h[3]-h[1])||1,o=e.cachedCanvases.getCanvas("pattern",n,a,!0),l=o.context;l.clearRect(0,0,l.canvas.width,l.canvas.height),l.beginPath(),l.rect(0,0,l.canvas.width,l.canvas.height),l.translate(-h[0],-h[1]),r=v.Util.transform(r,[1,0,0,1,h[0],h[1]]),l.transform(...e.baseTransform),this.matrix&&l.transform(...this.matrix),c(l,this._bbox),l.fillStyle=this._createGradient(l),l.fill(),s=t.createPattern(o.canvas,"no-repeat");i=new DOMMatrix(r);s.setTransform(i)}else c(t,this._bbox),s=this._createGradient(t);return s}}function b(e,d,u,p,t,r,f,g){var i=d.coords,m=d.colors,v=e.data,_=4*e.width;let s;i[u+1]>i[p+1]&&(s=u,u=p,p=s,s=r,r=f,f=s),i[p+1]>i[t+1]&&(s=p,p=t,t=s,s=f,f=g,g=s),i[u+1]>i[p+1]&&(s=u,u=p,p=s,s=r,r=f,f=s);var b=(i[u]+d.offsetX)*d.scaleX,y=(i[u+1]+d.offsetY)*d.scaleY,A=(i[p]+d.offsetX)*d.scaleX,S=(i[p+1]+d.offsetY)*d.scaleY,x=(i[t]+d.offsetX)*d.scaleX,w=(i[t+1]+d.offsetY)*d.scaleY;if(!(w<=y)){var E=m[r],T=m[r+1],C=m[r+2],P=m[f],k=m[f+1],M=m[f+2],R=m[g],F=m[g+1],D=m[g+2],e=Math.round(y),I=Math.round(w);let i,s,n,a,o,l,h,c;for(let t=e;t<=I;t++){if(t<S){const d=t<y?0:(y-t)/(y-S);i=b-(b-A)*d,s=E-(E-P)*d,n=T-(T-k)*d,a=C-(C-M)*d}else{var O=t>w?1:S==w?0:(S-t)/(S-w);i=A-(A-x)*O,s=P-(P-R)*O,n=k-(k-F)*O,a=M-(M-D)*O}let e;o=b-(b-x)*(e=t<y?0:t>w?1:(y-t)/(y-w)),l=E-(E-R)*e,h=T-(T-F)*e,c=C-(C-D)*e;const u=Math.round(Math.min(i,o)),p=Math.round(Math.max(i,o));let r=_*t+4*u;for(let t=u;t<=p;t++)(e=(i-t)/(i-o))<0?e=0:1<e&&(e=1),v[r++]=s-(s-l)*e|0,v[r++]=n-(n-h)*e|0,v[r++]=a-(a-c)*e|0,v[r++]=255}}}class n extends i{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(r,i,t){var e=Math.floor(this._bounds[0]),s=Math.floor(this._bounds[1]),n=Math.ceil(this._bounds[2])-e,a=Math.ceil(this._bounds[3])-s,o=Math.min(Math.ceil(Math.abs(n*r[0]*1.1)),3e3),r=Math.min(Math.ceil(Math.abs(a*r[1]*1.1)),3e3),n=n/o,a=a/r,l={coords:this._coords,colors:this._colors,offsetX:-e,offsetY:-s,scaleX:1/n,scaleY:1/a},t=t.getCanvas("mesh",o+4,r+4,!1),h=t.context,c=h.createImageData(o,r);if(i){const r=c.data;for(let t=0,e=r.length;t<e;t+=4)r[t]=i[0],r[t+1]=i[1],r[t+2]=i[2],r[t+3]=255}for(const r of this._figures){d=void 0;u=void 0;p=void 0;f=void 0;g=void 0;m=void 0;v=void 0;_=void 0;var d=c;var u=r;var p=l;var f=u.coords,g=u.colors;let t,e;switch(u.type){case"lattice":var m=u.verticesPerRow,v=Math.floor(f.length/m)-1,_=m-1;for(t=0;t<v;t++){let e=t*m;for(let t=0;t<_;t++,e++)b(d,p,f[e],f[e+1],f[e+m],g[e],g[e+1],g[e+m]),b(d,p,f[e+m+1],f[e+1],f[e+m],g[e+m+1],g[e+1],g[e+m])}break;case"triangles":for(t=0,e=f.length;t<e;t+=3)b(d,p,f[t],f[t+1],f[t+2],g[t],g[t+1],g[t+2]);break;default:throw new Error("illegal figure")}}return h.putImageData(c,2,2),{canvas:t.canvas,offsetX:e-2*n,offsetY:s-2*a,scaleX:n,scaleY:a}}getPattern(t,e,r,i){c(t,this._bbox);let s;if(i===h.SHADING)s=v.Util.singularValueDecompose2dScale((0,_.getCurrentTransform)(t));else if(s=v.Util.singularValueDecompose2dScale(e.baseTransform),this.matrix){const t=v.Util.singularValueDecompose2dScale(this.matrix);s=[s[0]*t[0],s[1]*t[1]]}var n=this._createMeshCanvas(s,i===h.SHADING?null:this._background,e.cachedCanvases);return i!==h.SHADING&&(t.setTransform(...e.baseTransform),this.matrix)&&t.transform(...this.matrix),t.translate(n.offsetX,n.offsetY),t.scale(n.scaleX,n.scaleY),t.createPattern(n.canvas,"no-repeat")}}class a extends i{getPattern(){return"hotpink"}}e.TilingPattern=class o{static MAX_PATTERN_SIZE=3e3;constructor(t,e,r,i,s){this.operatorList=t[2],this.matrix=t[3]||[1,0,0,1,0,0],this.bbox=t[4],this.xstep=t[5],this.ystep=t[6],this.paintType=t[7],this.tilingType=t[8],this.color=e,this.ctx=r,this.canvasGraphicsFactory=i,this.baseTransform=s}createPatternCanvas(t){var e=this.operatorList,r=this.bbox,i=this.xstep,s=this.ystep,n=this.paintType,a=this.tilingType,o=this.color,l=this.canvasGraphicsFactory,a=((0,v.info)("TilingType: "+a),r[0]),h=r[1],c=r[2],r=r[3],d=v.Util.singularValueDecompose2dScale(this.matrix),u=v.Util.singularValueDecompose2dScale(this.baseTransform),d=[d[0]*u[0],d[1]*u[1]],u=this.getSizeAndScale(i,this.ctx.canvas.width,d[0]),i=this.getSizeAndScale(s,this.ctx.canvas.height,d[1]),d=(s=t.cachedCanvases.getCanvas("pattern",u.size,i.size,!0)).context;(l=l.createCanvasGraphics(d)).groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(l,n,o);let p=a,f=h,g=c,m=r;return a<0&&(p=0,g+=Math.abs(a)),h<0&&(f=0,m+=Math.abs(h)),d.translate(-u.scale*p,-i.scale*f),l.transform(u.scale,0,0,i.scale,0,0),d.save(),this.clipBbox(l,p,f,g,m),l.baseTransform=(0,_.getCurrentTransform)(l.ctx),l.executeOperatorList(e),l.endDrawing(),{canvas:s.canvas,scaleX:u.scale,scaleY:i.scale,offsetX:p,offsetY:f}}getSizeAndScale(t,e,r){t=Math.abs(t),e=Math.max(o.MAX_PATTERN_SIZE,e);let i=Math.ceil(t*r);return i>=e?i=e:r=i/t,{scale:r,size:i}}clipBbox(t,e,r,i,s){t.ctx.rect(e,r,i-e,s-r),t.current.updateRectMinMax((0,_.getCurrentTransform)(t.ctx),[e,r,i,s]),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,e,r){var i=t.ctx,s=t.current;switch(e){case 1:const t=this.ctx;i.fillStyle=t.fillStyle,i.strokeStyle=t.strokeStyle,s.fillColor=t.fillStyle,s.strokeColor=t.strokeStyle;break;case 2:var n=v.Util.makeHexColor(r[0],r[1],r[2]);i.fillStyle=n,i.strokeStyle=n,s.fillColor=n,s.strokeColor=n;break;default:throw new v.FormatError("Unsupported paint type: "+e)}}getPattern(t,e,r,i){let s=r,n=(i!==h.SHADING&&(s=v.Util.transform(s,e.baseTransform),this.matrix)&&(s=v.Util.transform(s,this.matrix)),r=this.createPatternCanvas(e),new DOMMatrix(s));return n=(n=n.translate(r.offsetX,r.offsetY)).scale(1/r.scaleX,1/r.scaleY),(i=t.createPattern(r.canvas,"repeat")).setTransform(n),i}}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.convertBlackAndWhiteToRGBA=i,e.convertToRGBA=function(e){switch(e.kind){case f.ImageKind.GRAYSCALE_1BPP:return i(e);case f.ImageKind.RGB_24BPP:{var a=e;let{src:r,srcPos:t=0,dest:i,destPos:s=0}=a,n=0;var o=r.length>>2,l=new Uint32Array(r.buffer,t,o);if(f.FeatureTest.isLittleEndian){for(;n<o-2;n+=3,s+=4){const a=l[n],t=l[n+1],e=l[n+2];i[s]=4278190080|a,i[s+1]=a>>>24|t<<8|4278190080,i[s+2]=t>>>16|e<<16|4278190080,i[s+3]=e>>>8|4278190080}for(let t=4*n,e=r.length;t<e;t+=3)i[s++]=r[t]|r[t+1]<<8|r[t+2]<<16|4278190080}else{for(;n<o-2;n+=3,s+=4){const a=l[n],t=l[n+1],e=l[n+2];i[s]=255|a,i[s+1]=a<<24|t>>>8|255,i[s+2]=t<<16|e>>>16|255,i[s+3]=e<<8|255}for(let t=4*n,e=r.length;t<e;t+=3)i[s++]=r[t]<<24|r[t+1]<<16|r[t+2]<<8|255}return{srcPos:t,destPos:s};return}}return null},e.grayToRGBA=function(r,i){if(f.FeatureTest.isLittleEndian)for(let t=0,e=r.length;t<e;t++)i[t]=65793*r[t]|4278190080;else for(let t=0,e=r.length;t<e;t++)i[t]=16843008*r[t]|255},r(93),r(101),r(102),r(105),r(107),r(109),r(113),r(116),r(123);var f=r(1);function i(e){let{src:r,srcPos:i=0,dest:s,width:t,height:n,nonBlackColor:a=4294967295,inverseDecode:o=!1}=e;var e=f.FeatureTest.isLittleEndian?4278190080:255,[l,h]=o?[a,e]:[e,a],c=t>>3,d=7&t,u=r.length;s=new Uint32Array(s.buffer);let p=0;for(let t=0;t<n;t++){for(const e=i+c;i<e;i++){const e=i<u?r[i]:255;s[p++]=128&e?h:l,s[p++]=64&e?h:l,s[p++]=32&e?h:l,s[p++]=16&e?h:l,s[p++]=8&e?h:l,s[p++]=4&e?h:l,s[p++]=2&e?h:l,s[p++]=1&e?h:l}if(0!=d){const e=i<u?r[i++]:255;for(let t=0;t<d;t++)s[p++]=e&1<<7-t?h:l}}return{srcPos:i,destPos:p}}},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GlobalWorkerOptions=void 0;var r=Object.create(null);(e.GlobalWorkerOptions=r).workerPort=null,r.workerSrc=""},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MessageHandler=void 0,r(2);var h=r(1);function c(t){switch(t instanceof Error||"object"==typeof t&&null!==t||(0,h.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new h.AbortException(t.message);case"MissingPDFException":return new h.MissingPDFException(t.message);case"PasswordException":return new h.PasswordException(t.message,t.code);case"UnexpectedResponseException":return new h.UnexpectedResponseException(t.message,t.status);case"UnknownErrorException":return new h.UnknownErrorException(t.message,t.details);default:return new h.UnknownErrorException(t.message,t.toString())}}e.MessageHandler=class{constructor(t,e,n){this.sourceName=t,this.targetName=e,this.comObj=n,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=e=>{const r=e.data;if(r.targetName===this.sourceName)if(r.stream)this.#de(r);else if(r.callback){const e=r.callbackId,n=this.callbackCapabilities[e];if(!n)throw new Error("Cannot resolve callback "+e);if(delete this.callbackCapabilities[e],1===r.callback)n.resolve(r.data);else{if(2!==r.callback)throw new Error("Unexpected callback case");n.reject(c(r.reason))}}else{const i=this.actionHandler[r.action];if(!i)throw new Error("Unknown action from worker: "+r.action);if(r.callbackId){const e=this.sourceName,s=r.sourceName;new Promise(function(t){t(i(r.data))}).then(function(t){n.postMessage({sourceName:e,targetName:s,callback:1,callbackId:r.callbackId,data:t})},function(t){n.postMessage({sourceName:e,targetName:s,callback:2,callbackId:r.callbackId,reason:c(t)})})}else r.streamId?this.#ue(r):i(r.data)}},n.addEventListener("message",this._onComObjOnMessage)}on(t,e){var r=this.actionHandler;if(r[t])throw new Error(`There is already an actionName called "${t}"`);r[t]=e}send(t,e,r){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:e},r)}sendWithPromise(t,e,r){var i=this.callbackId++,s=new h.PromiseCapability;this.callbackCapabilities[i]=s;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:i,data:e},r)}catch(t){s.reject(t)}return s.promise}sendWithStream(r,i,t,s){const n=this.streamId++,a=this.sourceName,o=this.targetName,l=this.comObj;return new ReadableStream({start:t=>{var e=new h.PromiseCapability;return this.streamControllers[n]={controller:t,startCall:e,pullCall:null,cancelCall:null,isClosed:!1},l.postMessage({sourceName:a,targetName:o,action:r,streamId:n,data:i,desiredSize:t.desiredSize},s),e.promise},pull:t=>{var e=new h.PromiseCapability;return this.streamControllers[n].pullCall=e,l.postMessage({sourceName:a,targetName:o,stream:6,streamId:n,desiredSize:t.desiredSize}),e.promise},cancel:t=>{(0,h.assert)(t instanceof Error,"cancel must have a valid reason");var e=new h.PromiseCapability;return this.streamControllers[n].cancelCall=e,this.streamControllers[n].isClosed=!0,l.postMessage({sourceName:a,targetName:o,stream:1,streamId:n,reason:c(t)}),e.promise}},t)}#ue(e){const s=e.streamId,n=this.sourceName,a=e.sourceName,o=this.comObj,t=this,r=this.actionHandler[e.action],i={enqueue(t){var e,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1,i=2<arguments.length?arguments[2]:void 0;this.isCancelled||(e=this.desiredSize,this.desiredSize-=r,0<e&&this.desiredSize<=0&&(this.sinkCapability=new h.PromiseCapability,this.ready=this.sinkCapability.promise),o.postMessage({sourceName:n,targetName:a,stream:4,streamId:s,chunk:t},i))},close(){this.isCancelled||(this.isCancelled=!0,o.postMessage({sourceName:n,targetName:a,stream:3,streamId:s}),delete t.streamSinks[s])},error(t){(0,h.assert)(t instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,o.postMessage({sourceName:n,targetName:a,stream:5,streamId:s,reason:c(t)}))},sinkCapability:new h.PromiseCapability,onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};i.sinkCapability.resolve(),i.ready=i.sinkCapability.promise,this.streamSinks[s]=i,new Promise(function(t){t(r(e.data,i))}).then(function(){o.postMessage({sourceName:n,targetName:a,stream:8,streamId:s,success:!0})},function(t){o.postMessage({sourceName:n,targetName:a,stream:8,streamId:s,reason:c(t)})})}#de(e){const r=e.streamId,i=this.sourceName,s=e.sourceName,n=this.comObj,t=this.streamControllers[r],a=this.streamSinks[r];switch(e.stream){case 8:e.success?t.startCall.resolve():t.startCall.reject(c(e.reason));break;case 7:e.success?t.pullCall.resolve():t.pullCall.reject(c(e.reason));break;case 6:a?(a.desiredSize<=0&&0<e.desiredSize&&a.sinkCapability.resolve(),a.desiredSize=e.desiredSize,new Promise(function(t){t(a.onPull?.())}).then(function(){n.postMessage({sourceName:i,targetName:s,stream:7,streamId:r,success:!0})},function(t){n.postMessage({sourceName:i,targetName:s,stream:7,streamId:r,reason:c(t)})})):n.postMessage({sourceName:i,targetName:s,stream:7,streamId:r,success:!0});break;case 4:(0,h.assert)(t,"enqueue should have stream controller"),t.isClosed||t.controller.enqueue(e.chunk);break;case 3:(0,h.assert)(t,"close should have stream controller"),t.isClosed||(t.isClosed=!0,t.controller.close(),this.#pe(t,r));break;case 5:(0,h.assert)(t,"error should have stream controller"),t.controller.error(c(e.reason)),this.#pe(t,r);break;case 2:e.success?t.cancelCall.resolve():t.cancelCall.reject(c(e.reason)),this.#pe(t,r);break;case 1:a&&(new Promise(function(t){t(a.onCancel?.(c(e.reason)))}).then(function(){n.postMessage({sourceName:i,targetName:s,stream:2,streamId:r,success:!0})},function(t){n.postMessage({sourceName:i,targetName:s,stream:2,streamId:r,reason:c(t)})}),a.sinkCapability.reject(c(e.reason)),a.isCancelled=!0,delete this.streamSinks[r]);break;default:throw new Error("Unexpected stream case")}}async#pe(t,e){await Promise.allSettled([t.startCall?.promise,t.pullCall?.promise,t.cancelCall?.promise]),delete this.streamControllers[e]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Metadata=void 0;var i=r(1);e.Metadata=class{#fe;#ge;constructor(t){var{parsedData:t,rawData:e}=t;this.#fe=t,this.#ge=e}getRaw(){return this.#ge}get(t){return this.#fe.get(t)??null}getAll(){return(0,i.objectFromMap)(this.#fe)}has(t){return this.#fe.has(t)}}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.OptionalContentConfig=void 0;var n=r(1),i=r(170);const s=Symbol("INTERNAL");class a{#me=!0;constructor(t,e){this.name=t,this.intent=e}get visible(){return this.#me}_setVisible(t,e){t!==s&&(0,n.unreachable)("Internal method `_setVisible` called."),this.#me=e}}e.OptionalContentConfig=class{#be=null;#ve=new Map;#ye=null;#_e=null;constructor(t){if(this.name=null,(this.creator=null)!==t){this.name=t.name,this.creator=t.creator,this.#_e=t.order;for(const e of t.groups)this.#ve.set(e.id,new a(e.name,e.intent));if("OFF"===t.baseState)for(const t of this.#ve.values())t._setVisible(s,!1);for(const r of t.on)this.#ve.get(r)._setVisible(s,!0);for(const i of t.off)this.#ve.get(i)._setVisible(s,!1);this.#ye=this.getHash()}}#Ae(r){const i=r.length;if(i<2)return!0;var s=r[0];for(let e=1;e<i;e++){const i=r[e];let t;if(Array.isArray(i))t=this.#Ae(i);else{if(!this.#ve.has(i))return(0,n.warn)("Optional content group not found: "+i),!0;t=this.#ve.get(i).visible}switch(s){case"And":if(t)break;return!1;case"Or":if(t)return!0;break;case"Not":return!t;default:return!0}}return"And"===s}isVisible(t){if(0!==this.#ve.size)if(t){if("OCG"===t.type)return this.#ve.has(t.id)?this.#ve.get(t.id).visible:((0,n.warn)("Optional content group not found: "+t.id),!0);if("OCMD"===t.type){if(t.expression)return this.#Ae(t.expression);if(!t.policy||"AnyOn"===t.policy){for(const e of t.ids){if(!this.#ve.has(e))return(0,n.warn)("Optional content group not found: "+e),!0;if(this.#ve.get(e).visible)return!0}return!1}if("AllOn"===t.policy)for(const r of t.ids){if(!this.#ve.has(r))return(0,n.warn)("Optional content group not found: "+r),!0;if(!this.#ve.get(r).visible)return!1}else{if("AnyOff"===t.policy){for(const i of t.ids){if(!this.#ve.has(i))return(0,n.warn)("Optional content group not found: "+i),!0;if(!this.#ve.get(i).visible)return!0}return!1}if("AllOff"===t.policy)for(const s of t.ids){if(!this.#ve.has(s))return(0,n.warn)("Optional content group not found: "+s),!0;if(this.#ve.get(s).visible)return!1}else(0,n.warn)(`Unknown optional content policy ${t.policy}.`)}}else(0,n.warn)(`Unknown group type ${t.type}.`)}else(0,n.warn)("Optional content group not defined.");return!0}setVisibility(t){var e=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];this.#ve.has(t)?(this.#ve.get(t)._setVisible(s,!!e),this.#be=null):(0,n.warn)("Optional content group not found: "+t)}get hasInitialVisibility(){return null===this.#ye||this.getHash()===this.#ye}getOrder(){return this.#ve.size?this.#_e?this.#_e.slice():[...this.#ve.keys()]:null}getGroups(){return 0<this.#ve.size?(0,n.objectFromMap)(this.#ve):null}getGroup(t){return this.#ve.get(t)||null}getHash(){if(null!==this.#be)return this.#be;var t,e,r=new i.MurmurHash3_64;for([t,e]of this.#ve)r.update(t+":"+e.visible);return this.#be=r.hexdigest()}}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PDFDataTransportStream=void 0,r(93),r(101),r(102),r(105),r(107),r(109),r(113),r(116),r(123),r(89);var o=r(1),s=r(168);e.PDFDataTransportStream=class{constructor(t,e){var{length:t,initialData:r,progressiveDone:i=!1,contentDispositionFilename:s=null,disableRange:n=!1,disableStream:a=!1}=t;if((0,o.assert)(e,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'),this._queuedChunks=[],this._progressiveDone=i,this._contentDispositionFilename=s,0<r?.length){const t=(r instanceof Uint8Array&&r.byteLength===r.buffer.byteLength?r:new Uint8Array(r)).buffer;this._queuedChunks.push(t)}this._pdfDataRangeTransport=e,this._isStreamingSupported=!a,this._isRangeSupported=!n,this._contentLength=t,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:r}=t;const i=(r instanceof Uint8Array&&r.byteLength===r.buffer.byteLength?r:new Uint8Array(r)).buffer;if(void 0===e)this._fullRequestReader?this._fullRequestReader._enqueue(i):this._queuedChunks.push(i);else{const t=this._rangeReaders.some(function(t){return t._begin===e&&(t._enqueue(i),!0)});(0,o.assert)(t,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(t){void 0===t.total?this._rangeReaders[0]?.onProgress?.({loaded:t.loaded}):this._fullRequestReader?.onProgress?.({loaded:t.loaded,total:t.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){t=this._rangeReaders.indexOf(t);0<=t&&this._rangeReaders.splice(t,1)}getFullReader(){(0,o.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");var t=this._queuedChunks;return this._queuedChunks=null,new i(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,e){var r;return e<=this._progressiveDataLength?null:(r=new n(this,t,e),this._pdfDataRangeTransport.requestDataRange(t,e),this._rangeReaders.push(r),r)}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeReaders.slice(0))e.cancel(t);this._pdfDataRangeTransport.abort()}};class i{constructor(t,e){var r=2<arguments.length&&void 0!==arguments[2]&&arguments[2],i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;this._stream=t,this._done=r||!1,this._filename=(0,s.isPdfFile)(i)?i:null,this._queuedChunks=e||[],this._loaded=0;for(const t of this._queuedChunks)this._loaded+=t.byteLength;this._requests=[],this._headersReady=Promise.resolve(),(t._fullRequestReader=this).onProgress=null}_enqueue(t){this._done||(0<this._requests.length?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunks.push(t),this._loaded+=t.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){var t;return 0<this._queuedChunks.length?{value:this._queuedChunks.shift(),done:!1}:this._done?{value:void 0,done:!0}:(t=new o.PromiseCapability,this._requests.push(t),t.promise)}cancel(t){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class n{constructor(t,e,r){this._stream=t,this._begin=e,this._end=r,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(t){if(!this._done){if(0===this._requests.length)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,done:!1});for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=new o.PromiseCapability;return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PDFFetchStream=void 0,r(93),r(101),r(102),r(105),r(107),r(109),r(113),r(116),r(123),r(89);var n=r(1),a=r(182);function o(t,e,r){return{method:"GET",headers:t,signal:r.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function l(t){var e=new Headers;for(const i in t){var r=t[i];void 0!==r&&e.append(i,r)}return e}function i(t){return t instanceof Uint8Array?t.buffer:t instanceof ArrayBuffer?t:((0,n.warn)("getArrayBuffer - unexpected data format: "+t),new Uint8Array(t).buffer)}e.PDFFetchStream=class{constructor(t){this.source=t,this.isHttp=/^https?:/i.test(t.url),this.httpHeaders=this.isHttp&&t.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return(0,n.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new s(this),this._fullRequestReader}getRangeReader(t,e){return e<=this._progressiveDataLength?null:(t=new h(this,t,e),this._rangeRequestReaders.push(t),t)}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}};class s{constructor(t){this._stream=t,this._reader=null,this._loaded=0,this._filename=null;t=t.source;this._withCredentials=t.withCredentials||!1,this._contentLength=t.length,this._headersCapability=new n.PromiseCapability,this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._headers=l(this._stream.httpHeaders);const s=t.url;fetch(s,o(this._headers,this._withCredentials,this._abortController)).then(e=>{if(!(0,a.validateResponseStatus)(e.status))throw(0,a.createResponseStatusError)(e.status,s);this._reader=e.body.getReader(),this._headersCapability.resolve();var t=t=>e.headers.get(t),{allowRangeRequests:r,suggestedLength:i}=(0,a.validateRangeRequestCapabilities)({getResponseHeader:t,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=r,this._contentLength=i||this._contentLength,this._filename=(0,a.extractFilenameFromHeader)(t),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new n.AbortException("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._headersCapability.promise;var{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:i(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}class h{constructor(t,e,r){this._stream=t,this._reader=null,this._loaded=0;t=t.source;this._withCredentials=t.withCredentials||!1,this._readCapability=new n.PromiseCapability,this._isStreamingSupported=!t.disableStream,this._abortController=new AbortController,this._headers=l(this._stream.httpHeaders),this._headers.append("Range",`bytes=${e}-`+(r-1));const i=t.url;fetch(i,o(this._headers,this._withCredentials,this._abortController)).then(t=>{if(!(0,a.validateResponseStatus)(t.status))throw(0,a.createResponseStatusError)(t.status,i);this._readCapability.resolve(),this._reader=t.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;var{value:t,done:e}=await this._reader.read();return e?{value:t,done:e}:(this._loaded+=t.byteLength,this.onProgress?.({loaded:this._loaded}),{value:i(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createResponseStatusError=function(t,e){return 404===t||0===t&&e.startsWith("file:")?new i.MissingPDFException('Missing PDF "'+e+'".'):new i.UnexpectedResponseException(`Unexpected server response (${t}) while retrieving PDF "${e}".`,t)},e.extractFilenameFromHeader=function(e){e=e("Content-Disposition");if(e){let t=(0,s.getFilenameFromContentDispositionHeader)(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch{}if((0,n.isPdfFile)(t))return t}return null},e.validateRangeRequestCapabilities=function(t){var{getResponseHeader:t,isHttp:e,rangeChunkSize:r,disableRange:i}=t,s={allowRangeRequests:!1,suggestedLength:void 0},n=parseInt(t("Content-Length"),10);return!Number.isInteger(n)||(s.suggestedLength=n)<=2*r||!i&&e&&"bytes"===t("Accept-Ranges")&&"identity"===(t("Content-Encoding")||"identity")&&(s.allowRangeRequests=!0),s},e.validateResponseStatus=function(t){return 200===t||206===t};var i=r(1),s=r(183),n=r(168)},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getFilenameFromContentDispositionHeader=function(t){let s=!0,e=o("filename\\*","i").exec(t);var r;return e?(r=l(e=e[1]),i(r=a(r=h(r=unescape(r))))):(e=function(t){for(var i=[],e=o("filename\\*((?!0\\d)\\d+)(\\*?)","ig");null!==(r=e.exec(t));){var[,r,s,n]=r;if((r=parseInt(r,10))in i){if(0===r)break}else i[r]=[s,n]}var a=[];for(let r=0;r<i.length&&r in i;++r){let[t,e]=i[r];e=l(e),t&&(e=unescape(e),0===r)&&(e=h(e)),a.push(e)}return a.join("")}(t))?i(a(e)):(e=o("filename","i").exec(t))?i(a(l(e=e[1]))):"";function o(t,e){return new RegExp("(?:^|;)\\s*"+t+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',e)}function n(t,e){if(t){if(!/^[\x00-\xFF]+$/.test(e))return e;try{var r=new TextDecoder(t,{fatal:!0}),i=(0,c.stringToBytes)(e);e=r.decode(i),s=!1}catch{}}return e}function i(t){return t=s&&/[\x80-\xff]/.test(t)&&(t=n("utf-8",t),s)?n("iso-8859-1",t):t}function l(t){if(t.startsWith('"')){var e=t.slice(1).split('\\"');for(let t=0;t<e.length;++t){var r=e[t].indexOf('"');-1!==r&&(e[t]=e[t].slice(0,r),e.length=t+1),e[t]=e[t].replaceAll(/\\(.)/g,"$1")}t=e.join('"')}return t}function h(t){var e=t.indexOf("'");return-1===e?t:n(t.slice(0,e),t.slice(e+1).replace(/^[^']*'/,""))}function a(t){return!t.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(t)?t:t.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(t,e,r,i){if("q"===r||"Q"===r)return n(e,i=(i=i.replaceAll("_"," ")).replaceAll(/=([0-9a-fA-F]{2})/g,function(t,e){return String.fromCharCode(parseInt(e,16))}));try{i=atob(i)}catch{}return n(e,i)})}},r(89),r(149);var c=r(1)},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PDFNetworkStream=void 0,r(89);var n=r(1),a=r(182);class i{constructor(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};this.url=t,this.isHttp=/^https?:/i.test(t),this.httpHeaders=this.isHttp&&e.httpHeaders||Object.create(null),this.withCredentials=e.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(t,e,r){var i={begin:t,end:e};for(const t in r)i[t]=r[t];return this.request(i)}requestFull(t){return this.request(t)}request(e){const r=new XMLHttpRequest,t=this.currXhrId++,i=this.pendingRequests[t]={xhr:r};r.open("GET",this.url),r.withCredentials=this.withCredentials;for(const e in this.httpHeaders){const t=this.httpHeaders[e];void 0!==t&&r.setRequestHeader(e,t)}return this.isHttp&&"begin"in e&&"end"in e?(r.setRequestHeader("Range",`bytes=${e.begin}-`+(e.end-1)),i.expectedStatus=206):i.expectedStatus=200,r.responseType="arraybuffer",e.onError&&(r.onerror=function(t){e.onError(r.status)}),r.onreadystatechange=this.onStateChange.bind(this,t),r.onprogress=this.onProgress.bind(this,t),i.onHeadersReceived=e.onHeadersReceived,i.onDone=e.onDone,i.onError=e.onError,i.onProgress=e.onProgress,r.send(null),t}onProgress(t,e){t=this.pendingRequests[t];t&&t.onProgress?.(e)}onStateChange(t,e){var r=this.pendingRequests[t];if(r){var i=r.xhr;if(2<=i.readyState&&r.onHeadersReceived&&(r.onHeadersReceived(),delete r.onHeadersReceived),4===i.readyState&&t in this.pendingRequests)if(delete this.pendingRequests[t],0===i.status&&this.isHttp)r.onError?.(i.status);else{t=i.status||200;if(200===t&&206===r.expectedStatus||t===r.expectedStatus){var s=function(t){t=t.response;return"string"!=typeof t?t:(0,n.stringToBytes)(t).buffer}(i);if(206===t){const t=i.getResponseHeader("Content-Range"),e=/bytes (\d+)-(\d+)\/(\d+)/.exec(t);r.onDone({begin:parseInt(e[1],10),chunk:s})}else s?r.onDone({begin:0,chunk:s}):r.onError?.(i.status)}else r.onError?.(i.status)}}}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){var e=this.pendingRequests[t].xhr;delete this.pendingRequests[t],e.abort()}}e.PDFNetworkStream=class{constructor(t){this._source=t,this._manager=new i(t.url,{httpHeaders:t.httpHeaders,withCredentials:t.withCredentials}),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){t=this._rangeRequestReaders.indexOf(t);0<=t&&this._rangeRequestReaders.splice(t,1)}getFullReader(){return(0,n.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new s(this._manager,this._source),this._fullRequestReader}getRangeReader(t,e){t=new o(this._manager,t,e);return t.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(t),t}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}};class s{constructor(t,e){this._manager=t;var r={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=e.url,this._fullRequestId=t.requestFull(r),this._headersReceivedCapability=new n.PromiseCapability,this._disableRange=e.disableRange||!1,this._contentLength=e.length,this._rangeChunkSize=e.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const t=this._fullRequestId,e=this._manager.getRequestXhr(t),r=t=>e.getResponseHeader(t),{allowRangeRequests:i,suggestedLength:s}=(0,a.validateRangeRequestCapabilities)({getResponseHeader:r,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});i&&(this._isRangeSupported=!0),this._contentLength=s||this._contentLength,this._filename=(0,a.extractFilenameFromHeader)(r),this._isRangeSupported&&this._manager.abortRequest(t),this._headersReceivedCapability.resolve()}_onDone(t){if(t&&(0<this._requests.length?this._requests.shift().resolve({value:t.chunk,done:!1}):this._cachedChunks.push(t.chunk)),this._done=!0,!(0<this._cachedChunks.length)){for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(t){this._storedError=(0,a.createResponseStatusError)(t,this._url),this._headersReceivedCapability.reject(this._storedError);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(t){this.onProgress?.({loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;var t;return 0<this._cachedChunks.length?{value:this._cachedChunks.shift(),done:!1}:this._done?{value:void 0,done:!0}:(t=new n.PromiseCapability,this._requests.push(t),t.promise)}cancel(t){this._done=!0,this._headersReceivedCapability.reject(t);for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class o{constructor(t,e,r){this._manager=t;var i={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url,this._requestId=t.requestRange(e,r,i),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){this.onClosed?.(this)}_onDone(t){t=t.chunk;0<this._requests.length?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunk=t,this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(t){this._storedError=(0,a.createResponseStatusError)(t,this._url);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){this.isStreamingSupported||this.onProgress?.({loaded:t.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(null!==this._queuedChunk){const t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=new n.PromiseCapability;return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PDFNodeStream=void 0,r(89),r(93),r(101),r(102),r(105),r(107),r(109),r(113),r(116),r(123);var s=r(1),n=r(182);const a=/^file:\/\/\/[a-zA-Z]:\//;e.PDFNodeStream=class{constructor(t){this.source=t,this.url=function(t){var e=require("url"),r=e.parse(t);if("file:"!==r.protocol&&!r.host){if(/^[a-z]:[/\\]/i.test(t))return e.parse("file:///"+t);r.host||(r.protocol="file:")}return r}(t.url),this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol,this.isFsUrl="file:"===this.url.protocol,this.httpHeaders=this.isHttp&&t.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return(0,s.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=new(this.isFsUrl?d:h)(this),this._fullRequestReader}getRangeReader(t,e){return e<=this._progressiveDataLength?null:(t=new(this.isFsUrl?u:c)(this,t,e),this._rangeRequestReaders.push(t),t)}cancelAllRequests(t){this._fullRequestReader?.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}};class i{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null;t=t.source;this._contentLength=t.length,this._loaded=0,this._filename=null,this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._readableStream=null,this._readCapability=new s.PromiseCapability,this._headersCapability=new s.PromiseCapability}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;var t=this._readableStream.read();return null===t?(this._readCapability=new s.PromiseCapability,this.read()):(this._loaded+=t.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){(this._readableStream=t).on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",t=>{this._error(t)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new s.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class o{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=new s.PromiseCapability;t=t.source;this._isStreamingSupported=!t.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;var t=this._readableStream.read();return null===t?(this._readCapability=new s.PromiseCapability,this.read()):(this._loaded+=t.length,this.onProgress?.({loaded:this._loaded}),{value:new Uint8Array(t).buffer,done:!1})}cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){(this._readableStream=t).on("readable",()=>{this._readCapability.resolve()}),t.on("end",()=>{t.destroy(),this._done=!0,this._readCapability.resolve()}),t.on("error",t=>{this._error(t)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function l(t,e){return{protocol:t.protocol,auth:t.auth,host:t.hostname,port:t.port,path:t.path,method:"GET",headers:e}}class h extends i{constructor(i){super(i);var t,e=t=>{if(404===t.statusCode){const i=new s.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=i,void this._headersCapability.reject(i)}else{this._headersCapability.resolve(),this._setReadableStream(t);var t=t=>this._readableStream.headers[t.toLowerCase()],{allowRangeRequests:e,suggestedLength:r}=(0,n.validateRangeRequestCapabilities)({getResponseHeader:t,isHttp:i.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=e,this._contentLength=r||this._contentLength,this._filename=(0,n.extractFilenameFromHeader)(t)}};this._request=null,"http:"===this._url.protocol?(t=require("http"),this._request=t.request(l(this._url,i.httpHeaders),e)):(t=require("https"),this._request=t.request(l(this._url,i.httpHeaders),e)),this._request.on("error",t=>{this._storedError=t,this._headersCapability.reject(t)}),this._request.end()}}class c extends o{constructor(t,e,r){super(t),this._httpHeaders={};for(const e in t.httpHeaders){const r=t.httpHeaders[e];void 0!==r&&(this._httpHeaders[e]=r)}this._httpHeaders.Range=`bytes=${e}-`+(r-1);e=t=>{if(404!==t.statusCode)this._setReadableStream(t);else{const t=new s.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=t}};if(this._request=null,"http:"===this._url.protocol){const t=require("http");this._request=t.request(l(this._url,this._httpHeaders),e)}else{const t=require("https");this._request=t.request(l(this._url,this._httpHeaders),e)}this._request.on("error",t=>{this._storedError=t}),this._request.end()}}class d extends i{constructor(t){super(t);let r=decodeURIComponent(this._url.path);a.test(this._url.href)&&(r=r.replace(/^\//,""));const i=require("fs");i.lstat(r,(t,e)=>{t?("ENOENT"===t.code&&(t=new s.MissingPDFException(`Missing PDF "${r}".`)),this._storedError=t,this._headersCapability.reject(t)):(this._contentLength=e.size,this._setReadableStream(i.createReadStream(r)),this._headersCapability.resolve())})}}class u extends o{constructor(t,e,r){super(t);let i=decodeURIComponent(this._url.path);a.test(this._url.href)&&(i=i.replace(/^\//,""));t=require("fs");this._setReadableStream(t.createReadStream(i,{start:e,end:r-1}))}}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SVGGraphics=void 0,r(84),r(86),r(87),r(93),r(101),r(102),r(105),r(107),r(109),r(113),r(116),r(123),r(2),r(89),r(187);var i=r(168),v=r(1);function _(r){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"";if(URL.createObjectURL&&"undefined"!=typeof Blob&&!(2<arguments.length&&void 0!==arguments[2]&&arguments[2]))return URL.createObjectURL(new Blob([r],{type:t}));var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let s=`data:${t};base64,`;for(let t=0,e=r.length;t<e;t+=3){var n=255&r[t],a=255&r[t+1],o=255&r[t+2];s+=i[n>>2]+i[(3&n)<<4|a>>4]+i[t+1<e?(15&a)<<2|o>>6:64]+i[t+2<e?63&o:64]}return s}const s=["butt","round","square"],n=["miter","round","bevel"],a=function(){const f=new Uint8Array([137,80,78,71,13,10,26,10]),a=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;a[t]=e}function g(t,e,r,i){var s=i,n=e.length,n=(r[s]=n>>24&255,r[s+1]=n>>16&255,r[s+2]=n>>8&255,r[s+3]=255&n,r[s+=4]=255&t.charCodeAt(0),r[s+1]=255&t.charCodeAt(1),r[s+2]=255&t.charCodeAt(2),r[s+3]=255&t.charCodeAt(3),r.set(e,s+=4),function(e,r,i){let s=-1;for(let t=r;t<i;t++){const r=255&(s^e[t]);s=s>>>8^a[r]}return-1^s}(r,i+4,s+=e.length));r[s]=n>>24&255,r[s+1]=n>>16&255,r[s+2]=n>>8&255,r[s+3]=255&n}function m(t){let e=t.length;var r=65535,i=Math.ceil(e/r),s=new Uint8Array(2+e+5*i+4);let n=0,a=(s[n++]=120,s[n++]=156,0);for(;e>r;)s[n++]=0,s[n++]=255,s[n++]=255,s[n++]=0,s[n++]=0,s.set(t.subarray(a,a+r),n),n+=r,a+=r,e-=r;s[n++]=1,s[n++]=255&e,s[n++]=e>>8&255,s[n++]=255&~e,s[n++]=(65535&~e)>>8&255,s.set(t.subarray(a),n),n+=t.length-a;i=function(e,r,i){let s=1,n=0;for(let t=r;t<i;++t)s=(s+(255&e[t]))%65521,n=(n+s)%65521;return n<<16|s}(t,0,t.length);return s[n++]=i>>24&255,s[n++]=i>>16&255,s[n++]=i>>8&255,s[n++]=255&i,s}return function(n,a,o){{var l=n,h=(n=void 0===n.kind?v.ImageKind.GRAYSCALE_1BPP:n.kind,l.width),c=l.height;let t,e,r;var d=l.data;switch(n){case v.ImageKind.GRAYSCALE_1BPP:e=0,t=1,r=h+7>>3;break;case v.ImageKind.RGB_24BPP:e=2,t=8,r=3*h;break;case v.ImageKind.RGBA_32BPP:e=6,t=8,r=4*h;break;default:throw new Error("invalid format")}var u=new Uint8Array((1+r)*c);let i=0,s=0;for(let t=0;t<c;++t)u[i++]=0,u.set(d.subarray(s,s+r),i),s+=r,i+=r;if(n===v.ImageKind.GRAYSCALE_1BPP&&o)for(let t=i=0;t<c;t++){i++;for(let t=0;t<r;t++)u[i++]^=255}var l=new Uint8Array([h>>24&255,h>>16&255,h>>8&255,255&h,c>>24&255,c>>16&255,c>>8&255,255&c,t,e,0,0,0]),n=function(t){if(v.isNodeJS)try{var e=8<=parseInt(process.versions.node)?t:Buffer.from(t),r=require("zlib").deflateSync(e,{level:9});return r instanceof Uint8Array?r:new Uint8Array(r)}catch(t){(0,v.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+t)}return m(t)}(u),o=f.length+36+l.length+n.length,o=new Uint8Array(o),p=0;return o.set(f,0),g("IHDR",l,o,p+=f.length),g("IDATA",n,o,p+=12+l.length),p+=12+n.length,g("IEND",new Uint8Array(0),o,p),_(o,"image/png",a)}}}();class o{constructor(){this.fontSizeScale=1,this.fontWeight="normal",this.fontSize=0,this.textMatrix=v.IDENTITY_MATRIX,this.fontMatrix=v.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=v.TextRenderingMode.FILL,this.textMatrixScale=1,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.lineJoin="",this.lineCap="",this.miterLimit=0,this.dashArray=[],this.dashPhase=0,this.dependencies=[],this.activeClipUrl=null,this.clipGroup=null,this.maskId=""}clone(){return Object.create(this)}setCurrentPoint(t,e){this.x=t,this.y=e}}function b(t){if(Number.isInteger(t))return t.toString();var e=t.toFixed(10);let r=e.length-1;if("0"!==e[r])return e;for(;"0"===e[--r];);return e.substring(0,"."===e[r]?r:r+1)}function y(t){if(0===t[4]&&0===t[5]){if(0===t[1]&&0===t[2])return 1===t[0]&&1===t[3]?"":`scale(${b(t[0])} ${b(t[3])})`;if(t[0]===t[3]&&t[1]===-t[2])return`rotate(${b(180*Math.acos(t[0])/Math.PI)})`}else if(1===t[0]&&0===t[1]&&0===t[2]&&1===t[3])return`translate(${b(t[4])} ${b(t[5])})`;return`matrix(${b(t[0])} ${b(t[1])} ${b(t[2])} ${b(t[3])} ${b(t[4])} ${b(t[5])})`}let l=0,h=0,f=0;e.SVGGraphics=class{constructor(t,e){var r=2<arguments.length&&void 0!==arguments[2]&&arguments[2];(0,i.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future."),this.svgFactory=new i.DOMSVGFactory,this.current=new o,this.transformMatrix=v.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=t,this.objs=e,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!r,this._operatorIdMapping=[];for(const t in v.OPS)this._operatorIdMapping[v.OPS[t]]=t}getObject(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;return"string"==typeof t?(t.startsWith("g_")?this.commonObjs:this.objs).get(t):e}save(){this.transformStack.push(this.transformMatrix);var t=this.current;this.extraStack.push(t),this.current=t.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}group(t){this.save(),this.executeOpTree(t),this.restore()}loadDependencies(r){const i=r.fnArray,s=r.argsArray;for(let t=0,e=i.length;t<e;t++)if(i[t]===v.OPS.dependency)for(const i of s[t]){const r=i.startsWith("g_")?this.commonObjs:this.objs,s=new Promise(t=>{r.get(i,t)});this.current.dependencies.push(s)}return Promise.all(this.current.dependencies)}transform(t,e,r,i,s,n){this.transformMatrix=v.Util.transform(this.transformMatrix,[t,e,r,i,s,n]),this.tgrp=null}getSVG(t,e){this.viewport=e;const r=this._initialize(e);return this.loadDependencies(t).then(()=>(this.transformMatrix=v.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(t)),r))}convertOpList(e){var r=this._operatorIdMapping,i=e.argsArray,s=e.fnArray,n=[];for(let t=0,e=s.length;t<e;t++){var a=s[t];n.push({fnId:a,fn:r[a],args:i[t]})}{let t=[];var o=[];for(const l of e=n)"save"!==l.fn?"restore"===l.fn?t=o.pop():t.push(l):(t.push({fnId:92,fn:"group",items:[]}),o.push(t),t=t.at(-1).items);return t}}executeOpTree(t){for(const e of t){const t=e.fn,r=e.fnId,i=e.args;switch(0|r){case v.OPS.beginText:this.beginText();break;case v.OPS.dependency:break;case v.OPS.setLeading:this.setLeading(i);break;case v.OPS.setLeadingMoveText:this.setLeadingMoveText(i[0],i[1]);break;case v.OPS.setFont:this.setFont(i);break;case v.OPS.showText:case v.OPS.showSpacedText:this.showText(i[0]);break;case v.OPS.endText:this.endText();break;case v.OPS.moveText:this.moveText(i[0],i[1]);break;case v.OPS.setCharSpacing:this.setCharSpacing(i[0]);break;case v.OPS.setWordSpacing:this.setWordSpacing(i[0]);break;case v.OPS.setHScale:this.setHScale(i[0]);break;case v.OPS.setTextMatrix:this.setTextMatrix(i[0],i[1],i[2],i[3],i[4],i[5]);break;case v.OPS.setTextRise:this.setTextRise(i[0]);break;case v.OPS.setTextRenderingMode:this.setTextRenderingMode(i[0]);break;case v.OPS.setLineWidth:this.setLineWidth(i[0]);break;case v.OPS.setLineJoin:this.setLineJoin(i[0]);break;case v.OPS.setLineCap:this.setLineCap(i[0]);break;case v.OPS.setMiterLimit:this.setMiterLimit(i[0]);break;case v.OPS.setFillRGBColor:this.setFillRGBColor(i[0],i[1],i[2]);break;case v.OPS.setStrokeRGBColor:this.setStrokeRGBColor(i[0],i[1],i[2]);break;case v.OPS.setStrokeColorN:this.setStrokeColorN(i);break;case v.OPS.setFillColorN:this.setFillColorN(i);break;case v.OPS.shadingFill:this.shadingFill(i[0]);break;case v.OPS.setDash:this.setDash(i[0],i[1]);break;case v.OPS.setRenderingIntent:this.setRenderingIntent(i[0]);break;case v.OPS.setFlatness:this.setFlatness(i[0]);break;case v.OPS.setGState:this.setGState(i[0]);break;case v.OPS.fill:this.fill();break;case v.OPS.eoFill:this.eoFill();break;case v.OPS.stroke:this.stroke();break;case v.OPS.fillStroke:this.fillStroke();break;case v.OPS.eoFillStroke:this.eoFillStroke();break;case v.OPS.clip:this.clip("nonzero");break;case v.OPS.eoClip:this.clip("evenodd");break;case v.OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case v.OPS.paintImageXObject:this.paintImageXObject(i[0]);break;case v.OPS.paintInlineImageXObject:this.paintInlineImageXObject(i[0]);break;case v.OPS.paintImageMaskXObject:this.paintImageMaskXObject(i[0]);break;case v.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(i[0],i[1]);break;case v.OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case v.OPS.closePath:this.closePath();break;case v.OPS.closeStroke:this.closeStroke();break;case v.OPS.closeFillStroke:this.closeFillStroke();break;case v.OPS.closeEOFillStroke:this.closeEOFillStroke();break;case v.OPS.nextLine:this.nextLine();break;case v.OPS.transform:this.transform(i[0],i[1],i[2],i[3],i[4],i[5]);break;case v.OPS.constructPath:this.constructPath(i[0],i[1]);break;case v.OPS.endPath:this.endPath();break;case 92:this.group(e.items);break;default:(0,v.warn)("Unimplemented operator "+t)}}}setWordSpacing(t){this.current.wordSpacing=t}setCharSpacing(t){this.current.charSpacing=t}nextLine(){this.moveText(0,this.current.leading)}setTextMatrix(t,e,r,i,s,n){var a=this.current;a.textMatrix=a.lineMatrix=[t,e,r,i,s,n],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",b(a.fontSize)+"px"),a.tspan.setAttributeNS(null,"y",b(-a.y)),a.txtElement=this.svgFactory.createElement("svg:text"),a.txtElement.append(a.tspan)}beginText(){var t=this.current;t.x=t.lineX=0,t.y=t.lineY=0,t.textMatrix=v.IDENTITY_MATRIX,t.lineMatrix=v.IDENTITY_MATRIX,t.textMatrixScale=1,t.tspan=this.svgFactory.createElement("svg:tspan"),t.txtElement=this.svgFactory.createElement("svg:text"),t.txtgrp=this.svgFactory.createElement("svg:g"),t.xcoords=[],t.ycoords=[]}moveText(t,e){var r=this.current;r.x=r.lineX+=t,r.y=r.lineY+=e,r.xcoords=[],r.ycoords=[],r.tspan=this.svgFactory.createElement("svg:tspan"),r.tspan.setAttributeNS(null,"font-family",r.fontFamily),r.tspan.setAttributeNS(null,"font-size",b(r.fontSize)+"px"),r.tspan.setAttributeNS(null,"y",b(-r.y))}showText(s){const n=this.current,a=n.font,e=n.fontSize;if(0!==e){var o,l=n.fontSizeScale,h=n.charSpacing,c=n.wordSpacing,d=n.fontDirection,r=n.textHScale*d,u=a.vertical,p=u?1:-1,f=a.defaultVMetrics,g=e*n.fontMatrix[0];let i=0;for(const v of s)if(null===v)i+=d*c;else if("number"==typeof v)i+=p*v*e/1e3;else{const s=(v.isSpace?c:0)+h,m=v.fontChar;let t,e,r=v.width;if(u){const n=v.vmetric||f,a=(o=v.vmetric?n[1]:.5*r,n[2]*g);r=n?-n[0]:r,t=-o*g/l,e=(i+a)/l}else t=i/l,e=0;(v.isInFont||a.missingFile)&&(n.xcoords.push(n.x+t),u&&n.ycoords.push(-n.y+e),n.tspan.textContent+=m),i+=u?r*g-s*d:r*g+s*d}n.tspan.setAttributeNS(null,"x",n.xcoords.map(b).join(" ")),u?n.tspan.setAttributeNS(null,"y",n.ycoords.map(b).join(" ")):n.tspan.setAttributeNS(null,"y",b(-n.y)),u?n.y-=i:n.x+=i*r,n.tspan.setAttributeNS(null,"font-family",n.fontFamily),n.tspan.setAttributeNS(null,"font-size",b(n.fontSize)+"px"),"normal"!==n.fontStyle&&n.tspan.setAttributeNS(null,"font-style",n.fontStyle),"normal"!==n.fontWeight&&n.tspan.setAttributeNS(null,"font-weight",n.fontWeight);s=n.textRenderingMode&v.TextRenderingMode.FILL_STROKE_MASK;if(s===v.TextRenderingMode.FILL||s===v.TextRenderingMode.FILL_STROKE?("#000000"!==n.fillColor&&n.tspan.setAttributeNS(null,"fill",n.fillColor),n.fillAlpha<1&&n.tspan.setAttributeNS(null,"fill-opacity",n.fillAlpha)):n.textRenderingMode===v.TextRenderingMode.ADD_TO_PATH?n.tspan.setAttributeNS(null,"fill","transparent"):n.tspan.setAttributeNS(null,"fill","none"),s===v.TextRenderingMode.STROKE||s===v.TextRenderingMode.FILL_STROKE){const s=1/(n.textMatrixScale||1);this._setStrokeAttributes(n.tspan,s)}let t=n.textMatrix;0!==n.textRise&&((t=t.slice())[5]+=n.textRise),n.txtElement.setAttributeNS(null,"transform",`${y(t)} scale(${b(r)}, -1)`),n.txtElement.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),n.txtElement.append(n.tspan),n.txtgrp.append(n.txtElement),this._ensureTransformGroup().append(n.txtElement)}}setLeadingMoveText(t,e){this.setLeading(-e),this.moveText(t,e)}addFontStyle(t){if(!t.data)throw new Error('addFontStyle: No font data available, ensure that the "fontExtraProperties" API parameter is set.');this.cssStyle||(this.cssStyle=this.svgFactory.createElement("svg:style"),this.cssStyle.setAttributeNS(null,"type","text/css"),this.defs.append(this.cssStyle));var e=_(t.data,t.mimetype,this.forceDataSchema);this.cssStyle.textContent+=`@font-face { font-family: "${t.loadedName}"; src: url(${e}); }
`}setFont(t){var e=this.current,r=this.commonObjs.get(t[0]);let i=t[1],s=(e.font=r,!this.embedFonts||r.missingFile||this.embeddedFonts[r.loadedName]||(this.addFontStyle(r),this.embeddedFonts[r.loadedName]=r),e.fontMatrix=r.fontMatrix||v.FONT_IDENTITY_MATRIX,"normal");r.black?s="900":r.bold&&(s="bold");t=r.italic?"italic":"normal";i<0?(i=-i,e.fontDirection=-1):e.fontDirection=1,e.fontSize=i,e.fontFamily=r.loadedName,e.fontWeight=s,e.fontStyle=t,e.tspan=this.svgFactory.createElement("svg:tspan"),e.tspan.setAttributeNS(null,"y",b(-e.y)),e.xcoords=[],e.ycoords=[]}endText(){var t=this.current;t.textRenderingMode&v.TextRenderingMode.ADD_TO_PATH_FLAG&&t.txtElement?.hasChildNodes()&&(t.element=t.txtElement,this.clip("nonzero"),this.endPath())}setLineWidth(t){0<t&&(this.current.lineWidth=t)}setLineCap(t){this.current.lineCap=s[t]}setLineJoin(t){this.current.lineJoin=n[t]}setMiterLimit(t){this.current.miterLimit=t}setStrokeAlpha(t){this.current.strokeAlpha=t}setStrokeRGBColor(t,e,r){this.current.strokeColor=v.Util.makeHexColor(t,e,r)}setFillAlpha(t){this.current.fillAlpha=t}setFillRGBColor(t,e,r){this.current.fillColor=v.Util.makeHexColor(t,e,r),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(t){this.current.strokeColor=this._makeColorN_Pattern(t)}setFillColorN(t){this.current.fillColor=this._makeColorN_Pattern(t)}shadingFill(t){var{width:e,height:r}=this.viewport,i=v.Util.inverseTransform(this.transformMatrix),[e,r,i,s]=v.Util.getAxialAlignedBoundingBox([0,0,e,r],i),n=this.svgFactory.createElement("svg:rect");n.setAttributeNS(null,"x",e),n.setAttributeNS(null,"y",r),n.setAttributeNS(null,"width",i-e),n.setAttributeNS(null,"height",s-r),n.setAttributeNS(null,"fill",this._makeShadingPattern(t)),this.current.fillAlpha<1&&n.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().append(n)}_makeColorN_Pattern(t){return"TilingPattern"===t[0]?this._makeTilingPattern(t):this._makeShadingPattern(t)}_makeTilingPattern(t){var e=t[1],r=t[2],i=t[3]||v.IDENTITY_MATRIX,[s,n,a,o]=t[4],l=t[5],h=t[6],t=t[7],c="shading"+f++,[s,n,a,o]=v.Util.normalizeRect([...v.Util.applyTransform([s,n],i),...v.Util.applyTransform([a,o],i)]),[d,u]=v.Util.singularValueDecompose2dScale(i),l=l*d,d=h*u,h=this.svgFactory.createElement("svg:pattern"),u=(h.setAttributeNS(null,"id",c),h.setAttributeNS(null,"patternUnits","userSpaceOnUse"),h.setAttributeNS(null,"width",l),h.setAttributeNS(null,"height",d),h.setAttributeNS(null,"x",""+s),h.setAttributeNS(null,"y",""+n),this.svg),l=this.transformMatrix,d=this.current.fillColor,p=this.current.strokeColor,a=this.svgFactory.create(a-s,o-n);if(this.svg=a,this.transformMatrix=i,2===t){const t=v.Util.makeHexColor(...e);this.current.fillColor=t,this.current.strokeColor=t}return this.executeOpTree(this.convertOpList(r)),this.svg=u,this.transformMatrix=l,this.current.fillColor=d,this.current.strokeColor=p,h.append(a.childNodes[0]),this.defs.append(h),`url(#${c})`}_makeShadingPattern(e){switch((e="string"==typeof e?this.objs.get(e):e)[0]){case"RadialAxial":var r="shading"+f++,i=e[3];let t;switch(e[1]){case"axial":const h=e[4],v=e[5];(t=this.svgFactory.createElement("svg:linearGradient")).setAttributeNS(null,"id",r),t.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),t.setAttributeNS(null,"x1",h[0]),t.setAttributeNS(null,"y1",h[1]),t.setAttributeNS(null,"x2",v[0]),t.setAttributeNS(null,"y2",v[1]);break;case"radial":var s=e[4],n=e[5],a=e[6],o=e[7];(t=this.svgFactory.createElement("svg:radialGradient")).setAttributeNS(null,"id",r),t.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),t.setAttributeNS(null,"cx",n[0]),t.setAttributeNS(null,"cy",n[1]),t.setAttributeNS(null,"r",o),t.setAttributeNS(null,"fx",s[0]),t.setAttributeNS(null,"fy",s[1]),t.setAttributeNS(null,"fr",a);break;default:throw new Error("Unknown RadialAxial type: "+e[1])}for(const e of i){var l=this.svgFactory.createElement("svg:stop");l.setAttributeNS(null,"offset",e[0]),l.setAttributeNS(null,"stop-color",e[1]),t.append(l)}return this.defs.append(t),`url(#${r})`;case"Mesh":return(0,v.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error("Unknown IR type: "+e[0])}}setDash(t,e){this.current.dashArray=t,this.current.dashPhase=e}constructPath(t,e){const r=this.current;let i=r.x,s=r.y,n=[],a=0;for(const r of t)switch(0|r){case v.OPS.rectangle:i=e[a++],s=e[a++];const t=i+e[a++],r=s+e[a++];n.push("M",b(i),b(s),"L",b(t),b(s),"L",b(t),b(r),"L",b(i),b(r),"Z");break;case v.OPS.moveTo:i=e[a++],s=e[a++],n.push("M",b(i),b(s));break;case v.OPS.lineTo:i=e[a++],s=e[a++],n.push("L",b(i),b(s));break;case v.OPS.curveTo:i=e[a+4],s=e[a+5],n.push("C",b(e[a]),b(e[a+1]),b(e[a+2]),b(e[a+3]),b(i),b(s)),a+=6;break;case v.OPS.curveTo2:n.push("C",b(i),b(s),b(e[a]),b(e[a+1]),b(e[a+2]),b(e[a+3])),i=e[a+2],s=e[a+3],a+=4;break;case v.OPS.curveTo3:i=e[a+2],s=e[a+3],n.push("C",b(e[a]),b(e[a+1]),b(i),b(s),b(i),b(s)),a+=4;break;case v.OPS.closePath:n.push("Z")}n=n.join(" "),r.path&&0<t.length&&t[0]!==v.OPS.rectangle&&t[0]!==v.OPS.moveTo?n=r.path.getAttributeNS(null,"d")+n:(r.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().append(r.path)),r.path.setAttributeNS(null,"d",n),r.path.setAttributeNS(null,"fill","none"),r.element=r.path,r.setCurrentPoint(i,s)}endPath(){const t=this.current;if(t.path=null,this.pendingClip)if(t.element){var e="clippath"+l++,r=this.svgFactory.createElement("svg:clipPath"),i=(r.setAttributeNS(null,"id",e),r.setAttributeNS(null,"transform",y(this.transformMatrix)),t.element.cloneNode(!0));if("evenodd"===this.pendingClip?i.setAttributeNS(null,"clip-rule","evenodd"):i.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,r.append(i),this.defs.append(r),t.activeClipUrl){t.clipGroup=null;for(const t of this.extraStack)t.clipGroup=null;r.setAttributeNS(null,"clip-path",t.activeClipUrl)}t.activeClipUrl=`url(#${e})`,this.tgrp=null}else this.pendingClip=null}clip(t){this.pendingClip=t}closePath(){var t,e=this.current;e.path&&(t=e.path.getAttributeNS(null,"d")+"Z",e.path.setAttributeNS(null,"d",t))}setLeading(t){this.current.leading=-t}setTextRise(t){this.current.textRise=t}setTextRenderingMode(t){this.current.textRenderingMode=t}setHScale(t){this.current.textHScale=t/100}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(var[e,r]of t)switch(e){case"LW":this.setLineWidth(r);break;case"LC":this.setLineCap(r);break;case"LJ":this.setLineJoin(r);break;case"ML":this.setMiterLimit(r);break;case"D":this.setDash(r[0],r[1]);break;case"RI":this.setRenderingIntent(r);break;case"FL":this.setFlatness(r);break;case"Font":this.setFont(r);break;case"CA":this.setStrokeAlpha(r);break;case"ca":this.setFillAlpha(r);break;default:(0,v.warn)("Unimplemented graphic state operator "+e)}}fill(){var t=this.current;t.element&&(t.element.setAttributeNS(null,"fill",t.fillColor),t.element.setAttributeNS(null,"fill-opacity",t.fillAlpha),this.endPath())}stroke(){var t=this.current;t.element&&(this._setStrokeAttributes(t.element),t.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(t){let e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1;var r=this.current;let i=r.dashArray;1!==e&&0<i.length&&(i=i.map(function(t){return e*t})),t.setAttributeNS(null,"stroke",r.strokeColor),t.setAttributeNS(null,"stroke-opacity",r.strokeAlpha),t.setAttributeNS(null,"stroke-miterlimit",b(r.miterLimit)),t.setAttributeNS(null,"stroke-linecap",r.lineCap),t.setAttributeNS(null,"stroke-linejoin",r.lineJoin),t.setAttributeNS(null,"stroke-width",b(e*r.lineWidth)+"px"),t.setAttributeNS(null,"stroke-dasharray",i.map(b).join(" ")),t.setAttributeNS(null,"stroke-dashoffset",b(e*r.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(){var t=this.svgFactory.createElement("svg:rect");t.setAttributeNS(null,"x","0"),t.setAttributeNS(null,"y","0"),t.setAttributeNS(null,"width","1px"),t.setAttributeNS(null,"height","1px"),t.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().append(t)}paintImageXObject(t){var e=this.getObject(t);e?this.paintInlineImageXObject(e):(0,v.warn)(`Dependent image with object ID ${t} is not ready yet`)}paintInlineImageXObject(t,e){var r=t.width,i=t.height,t=a(t,this.forceDataSchema,!!e),s=this.svgFactory.createElement("svg:rect"),s=(s.setAttributeNS(null,"x","0"),s.setAttributeNS(null,"y","0"),s.setAttributeNS(null,"width",b(r)),s.setAttributeNS(null,"height",b(i)),this.current.element=s,this.clip("nonzero"),this.svgFactory.createElement("svg:image"));s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t),s.setAttributeNS(null,"x","0"),s.setAttributeNS(null,"y",b(-i)),s.setAttributeNS(null,"width",b(r)+"px"),s.setAttributeNS(null,"height",b(i)+"px"),s.setAttributeNS(null,"transform",`scale(${b(1/r)} ${b(-1/i)})`),(e||this._ensureTransformGroup()).append(s)}paintImageMaskXObject(t){var e,r,i,s,n,a,t=this.getObject(t.data,t);t.bitmap?(0,v.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled."):(e=this.current,r=t.width,i=t.height,s=e.fillColor,e.maskId="mask"+h++,(n=this.svgFactory.createElement("svg:mask")).setAttributeNS(null,"id",e.maskId),(a=this.svgFactory.createElement("svg:rect")).setAttributeNS(null,"x","0"),a.setAttributeNS(null,"y","0"),a.setAttributeNS(null,"width",b(r)),a.setAttributeNS(null,"height",b(i)),a.setAttributeNS(null,"fill",s),a.setAttributeNS(null,"mask",`url(#${e.maskId})`),this.defs.append(n),this._ensureTransformGroup().append(a),this.paintInlineImageXObject(t,n))}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){const t=e[2]-e[0],r=e[3]-e[1],i=this.svgFactory.createElement("svg:rect");i.setAttributeNS(null,"x",e[0]),i.setAttributeNS(null,"y",e[1]),i.setAttributeNS(null,"width",b(t)),i.setAttributeNS(null,"height",b(r)),this.current.element=i,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(t){var e=this.svgFactory.create(t.width,t.height),r=this.svgFactory.createElement("svg:defs"),r=(e.append(r),this.defs=r,this.svgFactory.createElement("svg:g"));return r.setAttributeNS(null,"transform",y(t.transform)),e.append(r),this.svg=r,e}_ensureClipGroup(){var t;return this.current.clipGroup||((t=this.svgFactory.createElement("svg:g")).setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.append(t),this.current.clipGroup=t),this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",y(this.transformMatrix)),(this.current.activeClipUrl?this._ensureClipGroup():this.svg).append(this.tgrp)),this.tgrp}}},(t,e,r)=>{var i=r(3),s=r(188),r=r(193);i({target:"Array",proto:!0},{group:function(t){return s(this,t,1<arguments.length?arguments[1]:void 0)}}),r("group")},(t,e,r)=>{var p=r(99),i=r(14),f=r(13),g=r(40),m=r(18),v=r(64),_=r(189),b=r(108),y=Array,A=i([].push);t.exports=function(t,e,r,i){for(var s,n,a,o=g(t),l=f(o),h=p(e,r),c=_(null),d=v(l),u=0;u<d;u++)a=l[u],(n=m(h(a,u,o)))in c?A(c[n],a):c[n]=[a];if(i&&(s=i(o))!==y)for(n in c)c[n]=b(s,c[n]);return c}},(t,e,r)=>{function i(){}function s(t){t.write(g("")),t.close();var e=t.parentWindow.Object;return t=null,e}var n,a=r(47),o=r(190),l=r(66),h=r(55),c=r(192),d=r(43),r=r(54),u="prototype",p="script",f=r("IE_PROTO"),g=function(t){return"<"+p+">"+t+"</"+p+">"},m=function(){try{n=new ActiveXObject("htmlfile")}catch(r){}var t,e;m="undefined"==typeof document||document.domain&&n?s(n):(t=d("iframe"),e="java"+p+":",t.style.display="none",c.appendChild(t),t.src=String(e),(e=t.contentWindow.document).open(),e.write(g("document.F=Object")),e.close(),e.F);for(var r=l.length;r--;)delete m[u][l[r]];return m()};h[f]=!0,t.exports=Object.create||function(t,e){var r;return null!==t?(i[u]=a(t),r=new i,i[u]=null,r[f]=t):r=m(),void 0===e?r:o.f(r,e)}},(t,e,r)=>{var i=r(6),s=r(46),o=r(45),l=r(47),h=r(12),c=r(191);e.f=i&&!s?Object.defineProperties:function(t,e){l(t);for(var r,i=h(e),s=c(e),n=s.length,a=0;a<n;)o.f(t,r=s[a++],i[r]);return t}},(t,e,r)=>{var i=r(59),s=r(66);t.exports=Object.keys||function(t){return i(t,s)}},(t,e,r)=>{r=r(24);t.exports=r("document","documentElement")},(t,e,r)=>{var i=r(34),s=r(189),r=r(45).f,n=i("unscopables"),a=Array.prototype;void 0===a[n]&&r(a,n,{configurable:!0,value:s(null)}),t.exports=function(t){a[n][t]=!0}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.XfaText=void 0,r(89);class n{static textContent(t){const s=[],e={items:s,styles:Object.create(null)};return function e(r){if(r){let t=null;var i=r.name;if("#text"===i)t=r.value;else{if(!n.shouldBuildText(i))return;r?.attributes?.textContent?t=r.attributes.textContent:r.value&&(t=r.value)}if(null!==t&&s.push({str:t}),r.children)for(const s of r.children)e(s)}}(t),e}static shouldBuildText(t){return!("textarea"===t||"input"===t||"option"===t||"select"===t)}}e.XfaText=n},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TextLayerRenderTask=void 0,e.renderTextLayer=function(t){t.textContentSource||!t.textContent&&!t.textContentStream||((0,l.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters will be removed in the future, please use `textContentSource` instead."),t.textContentSource=t.textContent||t.textContentStream);var{container:e,viewport:r}=t,e=getComputedStyle(e),i=e.getPropertyValue("visibility"),e=parseFloat(e.getPropertyValue("--scale-factor")),i=("visible"===i&&(!e||1e-5<Math.abs(e-r.scale))&&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."),new s(t));return i._render(),i},e.updateTextLayer=function(t){let{container:e,viewport:r,textDivs:i,textDivProperties:s,isOffscreenCanvasSupported:n,mustRotate:a=!0,mustRescale:o=!0}=t;if(a&&(0,l.setLayerDimensions)(e,{rotation:r.rotation}),o){const t=m(0,n),e={prevFontSize:null,prevFontFamily:null,div:null,scale:r.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:t};for(const t of i)e.properties=s.get(t),e.div=t,h(e)}},r(89),r(2);var f=r(1),l=r(168);const g=new Map;function m(t,e){let r;if(e&&f.FeatureTest.isOffscreenCanvasSupported)r=new OffscreenCanvas(t,t).getContext("2d",{alpha:!1});else{const e=document.createElement("canvas");e.width=e.height=t,r=e.getContext("2d",{alpha:!1})}return r}function h(t){var e,r,i,{div:s,scale:n,properties:a,ctx:o,prevFontSize:l,prevFontFamily:h}=t,c=s["style"];let d="";0!==a.canvasWidth&&a.hasText&&(e=c["fontFamily"],{canvasWidth:r,fontSize:i}=a,l=(l===i&&h===e||(o.font=i*n+"px "+e,t.prevFontSize=i,t.prevFontFamily=e),o.measureText(s.textContent))["width"],0<l)&&(d=`scaleX(${r*n/l})`),0<(d=0!==a.angle?`rotate(${a.angle}deg) `+d:d).length&&(c.transform=d)}class s{constructor(t){var{textContentSource:t,container:e,viewport:r,textDivs:i,textDivProperties:s,textContentItemsStr:n,isOffscreenCanvasSupported:a}=t,{pageWidth:t,pageHeight:i,pageX:n,pageY:s}=(this._textContentSource=t,this._isReadableStream=t instanceof ReadableStream,this._container=this._rootContainer=e,this._textDivs=i||[],this._textContentItemsStr=n||[],this._isOffscreenCanvasSupported=a,this._fontInspectorEnabled=!!globalThis.FontInspector?.enabled,this._reader=null,this._textDivProperties=s||new WeakMap,this._canceled=!1,this._capability=new f.PromiseCapability,this._layoutTextParams={prevFontSize:null,prevFontFamily:null,div:null,scale:r.scale*(globalThis.devicePixelRatio||1),properties:null,ctx:m(0,a)},r.rawDims);this._transform=[1,0,0,-1,-n,s+i],this._pageWidth=t,this._pageHeight=i,(0,l.setLayerDimensions)(e,r),this._capability.promise.finally(()=>{this._layoutTextParams=null}).catch(()=>{})}get promise(){return this._capability.promise}cancel(){this._canceled=!0,this._reader&&(this._reader.cancel(new f.AbortException("TextLayer task cancelled.")).catch(()=>{}),this._reader=null),this._capability.reject(new f.AbortException("TextLayer task cancelled."))}_processItems(t,s){for(const p of t)if(void 0!==p.str){this._textContentItemsStr.push(p.str);{n=void 0;a=void 0;o=void 0;l=void 0;h=void 0;c=void 0;d=void 0;u=void 0;var n=this;var a=p;var o=s;var l=document.createElement("span"),h={angle:0,canvasWidth:0,hasText:""!==a.str,hasEOL:a.hasEOL,fontSize:0},c=(n._textDivs.push(l),f.Util.transform(n._transform,a.transform));let t=Math.atan2(c[1],c[0]);var o=o[a.fontName],d=(o.vertical&&(t+=Math.PI/2),Math.hypot(c[2],c[3])),u=d*function(t,e){var r=g.get(t);if(r)return r;r=m(30,e),r.font="30px "+t,e=r.measureText("");let i=e.fontBoundingBoxAscent,s=Math.abs(e.fontBoundingBoxDescent);if(i){const e=i/(i+s);return g.set(t,e),r.canvas.width=r.canvas.height=0,e}r.strokeStyle="red",r.clearRect(0,0,30,30),r.strokeText("g",0,0);let n=r.getImageData(0,0,30,30).data;s=0;for(let t=n.length-1-3;0<=t;t-=4)if(0<n[t]){s=Math.ceil(t/4/30);break}r.clearRect(0,0,30,30),r.strokeText("A",0,30),n=r.getImageData(0,0,30,30).data;for(let t=i=0,e=n.length;t<e;t+=4)if(0<n[t]){i=30-Math.floor(t/4/30);break}if(r.canvas.width=r.canvas.height=0,i){const e=i/(i+s);return g.set(t,e),e}return g.set(t,.8),.8}(o.fontFamily,n._isOffscreenCanvasSupported);let e,r,i=(r=0===t?(e=c[4],c[5]-u):(e=c[4]+u*Math.sin(t),c[5]-u*Math.cos(t)),c="calc(var(--scale-factor)*",u=l.style,n._container===n._rootContainer?(u.left=(100*e/n._pageWidth).toFixed(2)+"%",u.top=(100*r/n._pageHeight).toFixed(2)+"%"):(u.left=c+e.toFixed(2)+"px)",u.top=c+r.toFixed(2)+"px)"),u.fontSize=c+d.toFixed(2)+"px)",u.fontFamily=o.fontFamily,h.fontSize=d,l.setAttribute("role","presentation"),l.textContent=a.str,l.dir=a.dir,n._fontInspectorEnabled&&(l.dataset.fontName=a.fontName),0!==t&&(h.angle=t*(180/Math.PI)),!1);if(1<a.str.length)i=!0;else if(" "!==a.str&&a.transform[0]!==a.transform[3]){const n=Math.abs(a.transform[0]),o=Math.abs(a.transform[3]);n!==o&&1.5<Math.max(n,o)/Math.min(n,o)&&(i=!0)}i&&(h.canvasWidth=o.vertical?a.height:a.width),n._textDivProperties.set(l,h),n._isReadableStream&&n._layoutText(l)}}else if("beginMarkedContentProps"===p.type||"beginMarkedContent"===p.type){const t=this._container;this._container=document.createElement("span"),this._container.classList.add("markedContent"),null!==p.id&&this._container.setAttribute("id",""+p.id),t.append(this._container)}else"endMarkedContent"===p.type&&(this._container=this._container.parentNode)}_layoutText(t){var e=this._layoutTextParams.properties=this._textDivProperties.get(t);if(this._layoutTextParams.div=t,h(this._layoutTextParams),e.hasText&&this._container.append(t),e.hasEOL){const t=document.createElement("br");t.setAttribute("role","presentation"),this._container.append(t)}}_render(){const r=new f.PromiseCapability;let i=Object.create(null);if(this._isReadableStream){const s=()=>{this._reader.read().then(t=>{var{value:t,done:e}=t;e?r.resolve():(Object.assign(i,t.styles),this._processItems(t.items,i),s())},r.reject)};this._reader=this._textContentSource.getReader(),s()}else{if(!this._textContentSource)throw new Error('No "textContentSource" parameter specified.');{const{items:i,styles:t}=this._textContentSource;this._processItems(i,t),r.resolve()}}r.promise.then(()=>{i=null;var t=this;if(!t._canceled){const e=t._textDivs,r=t._capability;if(!(1e5<e.length||t._isReadableStream))for(const r of e)t._layoutText(r);r.resolve()}},this._capability.reject)}}e.TextLayerRenderTask=s},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AnnotationEditorLayer=void 0,r(125),r(136),r(138),r(141),r(143),r(145),r(147);var i=r(1),s=r(164),l=r(197),h=r(202),n=r(168),c=r(203);class d{#Se;#Ee=!1;#xe=null;#we=this.pointerup.bind(this);#Ce=this.pointerdown.bind(this);#Te=new Map;#Pe=!1;#ke=!1;#Me=!1;#Fe;static _initialized=!1;constructor(t){var{uiManager:t,pageIndex:e,div:r,accessibilityManager:i,annotationLayer:s,viewport:n,l10n:a}=t,o=[l.FreeTextEditor,h.InkEditor,c.StampEditor];if(!d._initialized){d._initialized=!0;for(const t of o)t.initialize(a)}t.registerEditorTypes(o),this.#Fe=t,this.pageIndex=e,this.div=r,this.#Se=i,this.#xe=s,this.viewport=n,this.#Fe.addLayer(this)}get isEmpty(){return 0===this.#Te.size}updateToolbar(t){this.#Fe.updateToolbar(t)}updateMode(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.#Fe.getMode();this.#Re(),t===i.AnnotationEditorType.INK?(this.addInkEditorIfNeeded(!1),this.disableClick()):this.enableClick(),t!==i.AnnotationEditorType.NONE&&(this.div.classList.toggle("freeTextEditing",t===i.AnnotationEditorType.FREETEXT),this.div.classList.toggle("inkEditing",t===i.AnnotationEditorType.INK),this.div.classList.toggle("stampEditing",t===i.AnnotationEditorType.STAMP),this.div.hidden=!1)}addInkEditorIfNeeded(t){if(t||this.#Fe.getMode()===i.AnnotationEditorType.INK){if(!t)for(const t of this.#Te.values())if(t.isEmpty())return void t.setInBackground();this.#De({offsetX:0,offsetY:0},!1).setInBackground()}}setEditingState(t){this.#Fe.setEditingState(t)}addCommands(t){this.#Fe.addCommands(t)}enable(){this.div.style.pointerEvents="auto";var t=new Set;for(const e of this.#Te.values())e.enableEditing(),e.annotationElementId&&t.add(e.annotationElementId);if(this.#xe){const e=this.#xe.getEditableAnnotations();for(const r of e)if(r.hide(),!this.#Fe.isDeletedAnnotationElement(r.data.id)&&!t.has(r.data.id)){const e=this.deserialize(r);e&&(this.addOrRebuild(e),e.enableEditing())}}}disable(){this.#Me=!0,this.div.style.pointerEvents="none";var t=new Set;for(const r of this.#Te.values())r.disableEditing(),r.annotationElementId&&null===r.serialize()?(this.getEditableAnnotation(r.annotationElementId)?.show(),r.remove()):t.add(r.annotationElementId);if(this.#xe)for(const i of this.#xe.getEditableAnnotations()){var e=i.data["id"];t.has(e)||this.#Fe.isDeletedAnnotationElement(e)||i.show()}this.#Re(),this.isEmpty&&(this.div.hidden=!0),this.#Me=!1}getEditableAnnotation(t){return this.#xe?.getEditableAnnotation(t)||null}setActiveEditor(t){this.#Fe.getActive()!==t&&this.#Fe.setActiveEditor(t)}enableClick(){this.div.addEventListener("pointerdown",this.#Ce),this.div.addEventListener("pointerup",this.#we)}disableClick(){this.div.removeEventListener("pointerdown",this.#Ce),this.div.removeEventListener("pointerup",this.#we)}attach(t){this.#Te.set(t.id,t);var e=t["annotationElementId"];e&&this.#Fe.isDeletedAnnotationElement(e)&&this.#Fe.removeDeletedAnnotationElement(t)}detach(t){this.#Te.delete(t.id),this.#Se?.removePointerInTextLayer(t.contentDiv),!this.#Me&&t.annotationElementId&&this.#Fe.addDeletedAnnotationElement(t)}remove(t){this.detach(t),this.#Fe.removeEditor(t),t.div.contains(document.activeElement)&&setTimeout(()=>{this.#Fe.focusMainContainer()},0),t.div.remove(),t.isAttachedToDOM=!1,this.#ke||this.addInkEditorIfNeeded(!1)}changeParent(t){t.parent!==this&&(t.annotationElementId&&(this.#Fe.addDeletedAnnotationElement(t.annotationElementId),s.AnnotationEditor.deleteAnnotationElement(t),t.annotationElementId=null),this.attach(t),t.parent?.detach(t),t.setParent(this),t.div)&&t.isAttachedToDOM&&(t.div.remove(),this.div.append(t.div))}add(t){var e;this.changeParent(t),this.#Fe.addEditor(t),this.attach(t),t.isAttachedToDOM||(e=t.render(),this.div.append(e),t.isAttachedToDOM=!0),t.fixAndSetPosition(),t.onceAdded(),this.#Fe.addToAnnotationStorage(t)}moveEditorInDOM(t){if(t.isAttachedToDOM){const e=document["activeElement"];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.#Se?.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}}addOrRebuild(t){t.needsToBeRebuilt()?t.rebuild():this.add(t)}addUndoableEditor(t){this.addCommands({cmd:()=>t._uiManager.rebuild(t),undo:()=>{t.remove()},mustExec:!1})}getNextId(){return this.#Fe.getId()}#Ie(t){switch(this.#Fe.getMode()){case i.AnnotationEditorType.FREETEXT:return new l.FreeTextEditor(t);case i.AnnotationEditorType.INK:return new h.InkEditor(t);case i.AnnotationEditorType.STAMP:return new c.StampEditor(t)}return null}pasteEditor(t,e){this.#Fe.updateToolbar(t),this.#Fe.updateMode(t);var{offsetX:t,offsetY:r}=this.#Oe(),i=this.getNextId(),i=this.#Ie({parent:this,id:i,x:t,y:r,uiManager:this.#Fe,isCentered:!0,...e});i&&this.add(i)}deserialize(t){switch(t.annotationType??t.annotationEditorType){case i.AnnotationEditorType.FREETEXT:return l.FreeTextEditor.deserialize(t,this,this.#Fe);case i.AnnotationEditorType.INK:return h.InkEditor.deserialize(t,this,this.#Fe);case i.AnnotationEditorType.STAMP:return c.StampEditor.deserialize(t,this,this.#Fe)}return null}#De(t,e){var r=this.getNextId(),r=this.#Ie({parent:this,id:r,x:t.offsetX,y:t.offsetY,uiManager:this.#Fe,isCentered:e});return r&&this.add(r),r}#Oe(){var{x:t,y:e,width:r,height:i}=this.div.getBoundingClientRect(),s=Math.max(0,t),n=Math.max(0,e),s=(s+Math.min(window.innerWidth,t+r))/2-t,r=(n+Math.min(window.innerHeight,e+i))/2-e,[t,n]=this.viewport.rotation%180==0?[s,r]:[r,s];return{offsetX:t,offsetY:n}}addNewEditor(){this.#De(this.#Oe(),!0)}setSelected(t){this.#Fe.setSelected(t)}toggleSelected(t){this.#Fe.toggleSelected(t)}isSelected(t){return this.#Fe.isSelected(t)}unselect(t){this.#Fe.unselect(t)}pointerup(t){var e=i.FeatureTest.platform["isMac"];0!==t.button||t.ctrlKey&&e||t.target!==this.div||!this.#Pe||(this.#Pe=!1,this.#Ee?this.#Fe.getMode()!==i.AnnotationEditorType.STAMP?this.#De(t,!1):this.#Fe.unselectAll():this.#Ee=!0)}pointerdown(t){var e;this.#Pe?this.#Pe=!1:(e=i.FeatureTest.platform.isMac,0!==t.button||t.ctrlKey&&e||t.target===this.div&&(this.#Pe=!0,e=this.#Fe.getActive(),this.#Ee=!e||e.isEmpty()))}findNewParent(t,e,r){e=this.#Fe.findParent(e,r);return null!==e&&e!==this&&(e.changeParent(t),!0)}destroy(){this.#Fe.getActive()?.parent===this&&(this.#Fe.commitOrRemove(),this.#Fe.setActiveEditor(null));for(const t of this.#Te.values())this.#Se?.removePointerInTextLayer(t.contentDiv),t.setParent(null),t.isAttachedToDOM=!1,t.div.remove();this.div=null,this.#Te.clear(),this.#Fe.removeLayer(this)}#Re(){this.#ke=!0;for(const t of this.#Te.values())t.isEmpty()&&t.remove();this.#ke=!1}render(t){t=t.viewport;this.viewport=t,(0,n.setLayerDimensions)(this.div,t);for(const t of this.#Fe.getEditors(this.pageIndex))this.add(t);this.updateMode()}update(t){t=t.viewport;this.#Fe.commitOrRemove(),this.viewport=t,(0,n.setLayerDimensions)(this.div,{rotation:t.rotation}),this.updateMode()}get pageDimensions(){var{pageWidth:t,pageHeight:e}=this.viewport.rawDims;return[t,e]}}e.AnnotationEditorLayer=d},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FreeTextEditor=void 0,r(89);var h=r(1),u=r(165),i=r(164),c=r(198);class s extends i.AnnotationEditor{#Le=this.editorDivBlur.bind(this);#Ne=this.editorDivFocus.bind(this);#Be=this.editorDivInput.bind(this);#je=this.editorDivKeydown.bind(this);#Ue;#ze="";#We=this.id+"-editor";#He;#qe=null;static _freeTextDefaultContent="";static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){var t=s.prototype,e=t=>t.isEmpty(),r=u.AnnotationEditorUIManager.TRANSLATE_SMALL,i=u.AnnotationEditorUIManager.TRANSLATE_BIG;return(0,h.shadow)(this,"_keyboardManager",new u.KeyboardManager([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],t.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],t.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],t._translateEmpty,{args:[-r,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t._translateEmpty,{args:[-i,0],checker:e}],[["ArrowRight","mac+ArrowRight"],t._translateEmpty,{args:[r,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t._translateEmpty,{args:[i,0],checker:e}],[["ArrowUp","mac+ArrowUp"],t._translateEmpty,{args:[0,-r],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t._translateEmpty,{args:[0,-i],checker:e}],[["ArrowDown","mac+ArrowDown"],t._translateEmpty,{args:[0,r],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t._translateEmpty,{args:[0,i],checker:e}]]))}static _type="freetext";constructor(t){super({...t,name:"freeTextEditor"}),this.#Ue=t.color||s._defaultColor||i.AnnotationEditor._defaultLineColor,this.#He=t.fontSize||s._defaultFontSize}static initialize(t){i.AnnotationEditor.initialize(t,{strings:["free_text2_default_content","editor_free_text2_aria_label"]});t=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(t.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,e){switch(t){case h.AnnotationEditorParamsType.FREETEXT_SIZE:s._defaultFontSize=e;break;case h.AnnotationEditorParamsType.FREETEXT_COLOR:s._defaultColor=e}}updateParams(t,e){switch(t){case h.AnnotationEditorParamsType.FREETEXT_SIZE:this.#Ge(e);break;case h.AnnotationEditorParamsType.FREETEXT_COLOR:this.#Ve(e)}}static get defaultPropertiesToUpdate(){return[[h.AnnotationEditorParamsType.FREETEXT_SIZE,s._defaultFontSize],[h.AnnotationEditorParamsType.FREETEXT_COLOR,s._defaultColor||i.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[h.AnnotationEditorParamsType.FREETEXT_SIZE,this.#He],[h.AnnotationEditorParamsType.FREETEXT_COLOR,this.#Ue]]}#Ge(t){const e=t=>{this.editorDiv.style.fontSize=`calc(${t}px * var(--scale-factor))`,this.translate(0,-(t-this.#He)*this.parentScale),this.#He=t,this.#$e()},r=this.#He;this.addCommands({cmd:()=>{e(t)},undo:()=>{e(r)},mustExec:!0,type:h.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}#Ve(t){const e=this.#Ue;this.addCommands({cmd:()=>{this.#Ue=this.editorDiv.style.color=t},undo:()=>{this.#Ue=this.editorDiv.style.color=e},mustExec:!0,type:h.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(t,e){this._uiManager.translateSelectedEditors(t,e,!0)}getInitialTranslation(){var t=this.parentScale;return[-s._internalPadding*t,-(s._internalPadding+this.#He)*t]}rebuild(){this.parent&&(super.rebuild(),null===this.div||this.isAttachedToDOM||this.parent.add(this))}enableEditMode(){this.isInEditMode()||(this.parent.setEditingState(!1),this.parent.updateToolbar(h.AnnotationEditorType.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),this.editorDiv.addEventListener("keydown",this.#je),this.editorDiv.addEventListener("focus",this.#Ne),this.editorDiv.addEventListener("blur",this.#Le),this.editorDiv.addEventListener("input",this.#Be))}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",this.#We),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",this.#je),this.editorDiv.removeEventListener("focus",this.#Ne),this.editorDiv.removeEventListener("blur",this.#Le),this.editorDiv.removeEventListener("input",this.#Be),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freeTextEditing"))}focusin(t){this._focusEventsAllowed&&(super.focusin(t),t.target!==this.editorDiv)&&this.editorDiv.focus()}onceAdded(){this.width?this.#Xe():(this.enableEditMode(),this.editorDiv.focus(),this._initialOptions?.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freeTextEditing")),super.remove()}#Ke(){var t=this.editorDiv.getElementsByTagName("div");if(0===t.length)return this.editorDiv.innerText;var e=[];for(const r of t)e.push(r.innerText.replace(/\r\n?|\n/,""));return e.join("\n")}#$e(){const[t,e]=this.parentDimensions;let r;if(this.isAttachedToDOM)r=this.div.getBoundingClientRect();else{const{currentLayer:t,div:e}=this,i=e.style.display;e.style.display="hidden",t.div.append(this.div),r=e.getBoundingClientRect(),e.remove(),e.style.display=i}this.rotation%180==this.parentRotation%180?(this.width=r.width/t,this.height=r.height/e):(this.width=r.height/t,this.height=r.width/e),this.fixAndSetPosition()}commit(){if(this.isInEditMode()){super.commit(),this.disableEditMode();const t=this.#ze,e=this.#ze=this.#Ke().trimEnd();if(t!==e){const r=t=>{(this.#ze=t)?(this.#Ye(),this._uiManager.rebuild(this),this.#$e()):this.remove()};this.addCommands({cmd:()=>{r(e)},undo:()=>{r(t)},mustExec:!1}),this.#$e()}}}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(t){this.enterInEditMode()}keydown(t){t.target===this.div&&"Enter"===t.key&&(this.enterInEditMode(),t.preventDefault())}editorDivKeydown(t){s._keyboardManager.exec(this,t)}editorDivFocus(t){this.isEditing=!0}editorDivBlur(t){this.isEditing=!1}editorDivInput(t){this.parent.div.classList.toggle("freeTextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(!this.div){let s,n;this.width&&(s=this.x,n=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",this.#We),this.enableEditing(),i.AnnotationEditor._l10nPromise.get("editor_free_text2_aria_label").then(t=>this.editorDiv?.setAttribute("aria-label",t)),i.AnnotationEditor._l10nPromise.get("free_text2_default_content").then(t=>this.editorDiv?.setAttribute("default-content",t)),this.editorDiv.contentEditable=!0;const c=this.editorDiv["style"];if(c.fontSize=`calc(${this.#He}px * var(--scale-factor))`,c.color=this.#Ue,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),(0,u.bindEvents)(this,this.div,["dblclick","keydown"]),this.width){const[c,d]=this.parentDimensions;if(this.annotationElementId){const u=this.#qe["position"];let[t,e]=this.getInitialTranslation();[t,e]=this.pageTranslationToScreen(t,e);var[a,o]=this.pageDimensions,[l,h]=this.pageTranslation;let r,i;switch(this.rotation){case 0:r=s+(u[0]-l)/a,i=n+this.height-(u[1]-h)/o;break;case 90:r=s+(u[0]-l)/a,i=n-(u[1]-h)/o,[t,e]=[e,-t];break;case 180:r=s-this.width+(u[0]-l)/a,i=n-(u[1]-h)/o,[t,e]=[-t,-e];break;case 270:r=s+(u[0]-l-this.height*o)/a,i=n+(u[1]-h-this.width*a)/o,[t,e]=[-e,t]}this.setAt(r*c,i*d,t,e)}else this.setAt(s*c,n*d,this.width*c,this.height*d);this.#Ye(),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0}return this.div}#Ye(){if(this.editorDiv.replaceChildren(),this.#ze)for(const e of this.#ze.split("\n")){var t=document.createElement("div");t.append(e?document.createTextNode(e):document.createElement("br")),this.editorDiv.append(t)}}get contentDiv(){return this.editorDiv}static deserialize(t,e,r){let i=null;if(t instanceof c.FreeTextAnnotationElement){const{data:{defaultAppearanceData:{fontSize:e,fontColor:r},rect:s,rotation:c,id:n},textContent:a,textPosition:o,parent:{page:{pageNumber:l}}}=t;if(!a||0===a.length)return null;i=t={annotationType:h.AnnotationEditorType.FREETEXT,color:Array.from(r),fontSize:e,value:a.join("\n"),position:o,pageIndex:l-1,rect:s,rotation:c,id:n,deleted:!1}}const s=super.deserialize(t,e,r);return s.#He=t.fontSize,s.#Ue=h.Util.makeHexColor(...t.color),s.#ze=t.value,s.annotationElementId=t.id||null,s.#qe=i,s}serialize(){var t=0<arguments.length&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return null;if(this.deleted)return{pageIndex:this.pageIndex,id:this.annotationElementId,deleted:!0};var e=s._internalPadding*this.parentScale,e=this.getRect(e,e),r=i.AnnotationEditor._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.#Ue),r={annotationType:h.AnnotationEditorType.FREETEXT,color:r,fontSize:this.#He,value:this.#ze,pageIndex:this.pageIndex,rect:e,rotation:this.rotation,structTreeParentId:this._structTreeParentId};if(!t){if(this.annotationElementId&&!this.#Je(r))return null;r.id=this.annotationElementId}return r}#Je(t){const{value:e,fontSize:r,color:i,rect:s,pageIndex:n}=this.#qe;return t.value!==e||t.fontSize!==r||t.rect.some((t,e)=>1<=Math.abs(t-s[e]))||t.color.some((t,e)=>t!==i[e])||t.pageIndex!==n}#Xe(){var t=0<arguments.length&&void 0!==arguments[0]&&arguments[0];this.annotationElementId&&(this.#$e(),t||0!==this.width&&0!==this.height?(t=s._internalPadding*this.parentScale,this.#qe.rect=this.getRect(t,t)):setTimeout(()=>this.#Xe(!0),0))}}e.FreeTextEditor=s},(L,t,e)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StampAnnotationElement=t.InkAnnotationElement=t.FreeTextAnnotationElement=t.AnnotationLayer=void 0,e(89),e(125),e(136),e(138),e(141),e(143),e(145),e(147);var u=e(1),d=e(168),n=e(163),s=e(199),a=e(200),p=e(201);const f=new WeakSet;function g(t){return{width:t[2]-t[0],height:t[3]-t[1]}}class o{static create(t){switch(t.data.annotationType){case u.AnnotationType.LINK:return new r(t);case u.AnnotationType.TEXT:return new l(t);case u.AnnotationType.WIDGET:switch(t.data.fieldType){case"Tx":return new h(t);case"Btn":return new(t.data.radioButton?_:t.data.checkBox?v:b)(t);case"Ch":return new y(t);case"Sig":return new c(t)}return new m(t);case u.AnnotationType.POPUP:return new A(t);case u.AnnotationType.FREETEXT:return new x(t);case u.AnnotationType.LINE:return new w(t);case u.AnnotationType.SQUARE:return new E(t);case u.AnnotationType.CIRCLE:return new T(t);case u.AnnotationType.POLYLINE:return new C(t);case u.AnnotationType.CARET:return new k(t);case u.AnnotationType.INK:return new M(t);case u.AnnotationType.POLYGON:return new P(t);case u.AnnotationType.HIGHLIGHT:return new R(t);case u.AnnotationType.UNDERLINE:return new F(t);case u.AnnotationType.SQUIGGLY:return new D(t);case u.AnnotationType.STRIKEOUT:return new I(t);case u.AnnotationType.STAMP:return new O(t);case u.AnnotationType.FILEATTACHMENT:return new N(t);default:return new i(t)}}}class i{#Qe=!1;constructor(t){var{isRenderable:e=!1,ignoreBorder:r=!1,createQuadrilaterals:i=!1}=1<arguments.length&&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(r)),i&&this._createQuadrilaterals()}static _hasPopupData(t){var{titleObj:t,contentsObj:e,richText:r}=t;return!!(t?.str||e?.str||r?.str)}get hasPopupData(){return i._hasPopupData(this.data)}_createContainer(t){const{data:e,parent:{page:r,viewport:i}}=this,s=document.createElement("section");s.setAttribute("data-annotation-id",e.id),this instanceof m||(s.tabIndex=1e3),s.style.zIndex=this.parent.zIndex++,this.data.popupRef&&s.setAttribute("aria-haspopup","dialog"),e.noRotate&&s.classList.add("norotate");var{pageWidth:n,pageHeight:a,pageX:o,pageY:l}=i.rawDims;if(!e.rect||this instanceof A){const t=e["rotation"];e.hasOwnCanvas||0===t||this.setRotation(t,s)}else{var{width:h,height:c}=g(e.rect),d=u.Util.normalizeRect([e.rect[0],r.view[3]-e.rect[1]+r.view[1],e.rect[2],r.view[3]-e.rect[3]+r.view[1]]);if(!t&&0<e.borderStyle.width){s.style.borderWidth=e.borderStyle.width+"px";const t=e.borderStyle.horizontalCornerRadius,r=e.borderStyle.verticalCornerRadius;if(0<t||0<r){const e=`calc(${t}px * var(--scale-factor)) / calc(${r}px * var(--scale-factor))`;s.style.borderRadius=e}else if(this instanceof _){const t=`calc(${h}px * var(--scale-factor)) / calc(${c}px * var(--scale-factor))`;s.style.borderRadius=t}switch(e.borderStyle.style){case u.AnnotationBorderStyleType.SOLID:s.style.borderStyle="solid";break;case u.AnnotationBorderStyleType.DASHED:s.style.borderStyle="dashed";break;case u.AnnotationBorderStyleType.BEVELED:(0,u.warn)("Unimplemented border style: beveled");break;case u.AnnotationBorderStyleType.INSET:(0,u.warn)("Unimplemented border style: inset");break;case u.AnnotationBorderStyleType.UNDERLINE:s.style.borderBottomStyle="solid"}const i=e.borderColor||null;i?(this.#Qe=!0,s.style.borderColor=u.Util.makeHexColor(0|i[0],0|i[1],0|i[2])):s.style.borderWidth=0}s.style.left=100*(d[0]-o)/n+"%",s.style.top=100*(d[1]-l)/a+"%";t=e["rotation"];e.hasOwnCanvas||0===t?(s.style.width=100*h/n+"%",s.style.height=100*c/a+"%"):this.setRotation(t,s)}return s}setRotation(r){var i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.container;if(this.data.rect){var{pageWidth:s,pageHeight:n}=this.parent.viewport.rawDims,{width:a,height:o}=g(this.data.rect);let t,e;e=r%180==0?(t=100*a/s,100*o/n):(t=100*o/s,100*a/n),i.style.width=t+"%",i.style.height=e+"%",i.setAttribute("data-main-rotation",(360-r)%360)}}get _commonActions(){const e=(t,e,r)=>{var t=r.detail[t],i=t[0],t=t.slice(1);r.target.style[e]=s.ColorConverters[i+"_HTML"](t),this.annotationStorage.setValue(this.data.id,{[e]:s.ColorConverters[i+"_rgb"](t)})};return(0,u.shadow)(this,"_commonActions",{display:t=>{var t=t.detail["display"],e=t%2==1;this.container.style.visibility=e?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:e,noPrint:1===t||2===t})},print:t=>{this.annotationStorage.setValue(this.data.id,{noPrint:!t.detail.print})},hidden:t=>{t=t.detail.hidden;this.container.style.visibility=t?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:t,noView:t})},focus:t=>{setTimeout(()=>t.target.focus({preventScroll:!1}),0)},userName:t=>{t.target.title=t.detail.userName},readonly:t=>{t.target.disabled=t.detail.readonly},required:t=>{this._setRequired(t.target,t.detail.required)},bgColor:t=>{e("bgColor","backgroundColor",t)},fillColor:t=>{e("fillColor","backgroundColor",t)},fgColor:t=>{e("fgColor","color",t)},textColor:t=>{e("textColor","color",t)},borderColor:t=>{e("borderColor","borderColor",t)},strokeColor:t=>{e("strokeColor","borderColor",t)},rotation:t=>{t=t.detail.rotation;this.setRotation(t),this.annotationStorage.setValue(this.data.id,{rotation:t})}})}_dispatchEventFromSandbox(t,e){var r=this._commonActions;for(const i of Object.keys(e.detail))(t[i]||r[i])?.(e)}_setDefaultPropertiesFromJS(t){if(this.enableScripting){var e=this.annotationStorage.getRawValue(this.data.id);if(e){var r,i,s=this._commonActions;for([r,i]of Object.entries(e)){var n=s[r];n&&(n({detail:{[r]:i},target:t}),delete e[r])}}}}_createQuadrilaterals(){if(this.container){const e=this.data["quadPoints"];if(e){const[r,i,s,n]=this.data.rect;if(1===e.length){const[,{x:a,y:t},{x:o,y:l}]=e[0];if(s===a&&n===t&&r===o&&i===l)return}const a=this.container["style"];let t;if(this.#Qe){const{borderColor:e,borderWidth:r}=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="${r}">`],this.container.classList.add("hasBorder")}const o=s-r,l=n-i,h=this["svgFactory"],c=h.createElement("svg"),d=(c.classList.add("quadrilateralsContainer"),c.setAttribute("width",0),c.setAttribute("height",0),h.createElement("defs")),u=(c.append(d),h.createElement("clipPath")),p="clippath_"+this.data.id;u.setAttribute("id",p),u.setAttribute("clipPathUnits","objectBoundingBox"),d.append(u);for(const[,{x:i,y:s},{x:a,y:c}]of e){const e=h.createElement("rect"),d=(a-r)/o,p=(n-s)/l,f=(i-a)/o,g=(s-c)/l;e.setAttribute("x",d),e.setAttribute("y",p),e.setAttribute("width",f),e.setAttribute("height",g),u.append(e),t?.push(`<rect vector-effect="non-scaling-stroke" x="${d}" y="${p}" width="${f}" height="${g}"/>`)}this.#Qe&&(t.push("</g></svg>')"),a.backgroundImage=t.join("")),this.container.append(c),this.container.style.clipPath=`url(#${p})`}}}_createPopup(){var{container:t,data:e}=this,t=(t.setAttribute("aria-haspopup","dialog"),new A({data:{color:e.color,titleObj:e.titleObj,modificationDate:e.modificationDate,contentsObj:e.contentsObj,richText:e.richText,parentRect:e.rect,borderStyle:0,id:"popup_"+e.id,rotation:e.rotation},parent:this.parent,elements:[this]}));this.parent.div.append(t.render())}render(){(0,u.unreachable)("Abstract method `AnnotationElement.render` called")}_getElementsByName(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,r=[];if(this._fieldObjects){var i,s,n=this._fieldObjects[t];if(n)for(const{page:t,id:a,exportValues:o}of n)-1!==t&&a!==e&&(i="string"==typeof o?o:null,!(s=document.querySelector(`[data-element-id="${a}"]`))||f.has(s)?r.push({id:a,exportValue:i,domElement:s}):(0,u.warn)("_getElementsByName - element not allowed: "+a))}else for(const u of document.getElementsByName(t)){const t=u["exportValue"],l=u.getAttribute("data-element-id");l!==e&&f.has(u)&&r.push({id:l,exportValue:t,domElement:u})}return r}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(){var t=this.getElementsToTriggerPopup();if(Array.isArray(t))for(const e of t)e.classList.add("highlightArea");else t.classList.add("highlightArea")}_editOnDoubleClick(){const{annotationEditorType:t,data:{id:e}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:t,editId:e})})}}class r extends i{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!!(1<arguments.length&&void 0!==arguments[1]?arguments[1]:null)?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=t.data.isTooltipOnly}render(){var{data:t,linkService:e}=this,r=document.createElement("a");r.setAttribute("data-element-id",t.id);let i=!1;return t.url?(e.addLinkAttributes(r,t.url,t.newWindow),i=!0):t.action?(this._bindNamedAction(r,t.action),i=!0):t.attachment?(this._bindAttachment(r,t.attachment),i=!0):t.setOCGState?(this.#Ze(r,t.setOCGState),i=!0):t.dest?(this._bindLink(r,t.dest),i=!0):(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(r,t),i=!0),t.resetForm?(this._bindResetFormAction(r,t.resetForm),i=!0):this.isTooltipOnly&&!i&&(this._bindLink(r,""),i=!0)),this.container.classList.add("linkAnnotation"),i&&this.container.append(r),this.container}#tn(){this.container.setAttribute("data-internal-link","")}_bindLink(t,e){t.href=this.linkService.getDestinationHash(e),t.onclick=()=>(e&&this.linkService.goToDestination(e),!1),!e&&""!==e||this.#tn()}_bindNamedAction(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(e),!1),this.#tn()}_bindAttachment(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.downloadManager?.openOrDownloadData(this.container,e.content,e.filename),!1),this.#tn()}#Ze(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(e),!1),this.#tn()}_bindJSAction(t,e){t.href=this.linkService.getAnchorUrl("");var r=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const s of Object.keys(e.actions)){var i=r.get(s);i&&(t[i]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e.id,name:s}}),!1))}t.onclick||(t.onclick=()=>!1),this.#tn()}_bindResetFormAction(t,a){const o=t.onclick;o||(t.href=this.linkService.getAnchorUrl("")),this.#tn(),this._fieldObjects?t.onclick=()=>{o?.();const{fields:t,refs:e,include:r}=a,i=[];if(0!==t.length||0!==e.length){const a=new Set(e);for(const o of t){const t=this._fieldObjects[o]||[];for(const{id:o}of t)a.add(o)}for(const t of Object.values(this._fieldObjects))for(const o of t)a.has(o.id)===r&&i.push(o)}else for(const t of Object.values(this._fieldObjects))i.push(...t);var s=this.annotationStorage,n=[];for(const t of i){const a=t["id"];switch(n.push(a),t.type){case"text":{const o=t.defaultValue||"";s.setValue(a,{value:o});break}case"checkbox":case"radiobutton":{const o=t.defaultValue===t.exportValues;s.setValue(a,{value:o});break}case"combobox":case"listbox":{const o=t.defaultValue||"";s.setValue(a,{value:o});break}default:continue}const o=document.querySelector(`[data-element-id="${a}"]`);o&&(f.has(o)?o.dispatchEvent(new Event("resetform")):(0,u.warn)("_bindResetFormAction - element not allowed: "+a))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:n,name:"ResetForm"}}),!1}:((0,u.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),o||(t.onclick=()=>!1))}}class l extends i{constructor(t){super(t,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");var t=document.createElement("img");return t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",t.alt="[{{type}} Annotation]",t.dataset.l10nId="text_annotation_type",t.dataset.l10nArgs=JSON.stringify({type:this.data.name}),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(t),this.container}}class m extends i{render(){return this.data.alternativeText&&(this.container.title=this.data.alternativeText),this.container}showElementAndHideCanvas(t){this.data.hasOwnCanvas&&("CANVAS"===t.previousSibling?.nodeName&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){var{isWin:e,isMac:r}=u.FeatureTest.platform;return e&&t.ctrlKey||r&&t.metaKey}_setEventListener(t,e,r,i,s){r.includes("mouse")?t.addEventListener(r,t=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:s(t),shift:t.shiftKey,modifier:this._getKeyModifier(t)}})}):t.addEventListener(r,t=>{if("blur"===r){if(!e.focused||!t.relatedTarget)return;e.focused=!1}else if("focus"===r){if(e.focused)return;e.focused=!0}s&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:s(t)}})})}_setEventListeners(t,e,r,i){for(var[s,n]of r)"Action"!==n&&!this.data.actions?.[n]||("Focus"!==n&&"Blur"!==n||(e||={focused:!1}),this._setEventListener(t,e,s,n,i),"Focus"!==n||this.data.actions?.Blur?"Blur"!==n||this.data.actions?.Focus||this._setEventListener(t,e,"focus","Focus",null):this._setEventListener(t,e,"blur","Blur",null))}_setBackgroundColor(t){var e=this.data.backgroundColor||null;t.style.backgroundColor=null===e?"transparent":u.Util.makeHexColor(e[0],e[1],e[2])}_setTextStyle(t){const e=["left","center","right"],r=this.data.defaultAppearanceData["fontColor"],i=this.data.defaultAppearanceData.fontSize||9,s=t.style;let n;var a=t=>Math.round(10*t)/10;if(this.data.multiLine){const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2),e=t/(Math.round(t/(u.LINE_FACTOR*i))||1);n=Math.min(i,a(e/u.LINE_FACTOR))}else{const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2);n=Math.min(i,a(t/u.LINE_FACTOR))}s.fontSize=`calc(${n}px * var(--scale-factor))`,s.color=u.Util.makeHexColor(r[0],r[1],r[2]),null!==this.data.textAlignment&&(s.textAlign=e[this.data.textAlignment])}_setRequired(t,e){e?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",e)}}class h extends m{constructor(t){super(t,{isRenderable:t.renderForms||!t.data.hasAppearance&&!!t.data.fieldValue})}setPropertyOnSiblings(t,e,r,i){var s=this.annotationStorage;for(const n of this._getElementsByName(t.name,t.id))n.domElement&&(n.domElement[e]=r),s.setValue(n.id,{[i]:r})}render(){const i=this.annotationStorage,l=this.data.id;this.container.classList.add("textWidgetAnnotation");let s=null;if(this.renderForms){var n=i.getValue(l,{value:this.data.fieldValue});let t=n.value||"";var a=i.getValue(l,{charLimit:this.data.maxLen}).charLimit;a&&t.length>a&&(t=t.slice(0,a));let e=n.formattedValue||this.data.textContent?.join("\n")||null;e&&this.data.comb&&(e=e.replaceAll(/\s+/g,""));const h={userValue:t,formattedValue:e,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?((s=document.createElement("textarea")).textContent=e??t,this.data.doNotScroll&&(s.style.overflowY="hidden")):((s=document.createElement("input")).type="text",s.setAttribute("value",e??t),this.data.doNotScroll&&(s.style.overflowX="hidden")),this.data.hasOwnCanvas&&(s.hidden=!0),f.add(s),s.setAttribute("data-element-id",l),s.disabled=this.data.readOnly,s.name=this.data.fieldName,s.tabIndex=1e3,this._setRequired(s,this.data.required),a&&(s.maxLength=a),s.addEventListener("input",t=>{i.setValue(l,{value:t.target.value}),this.setPropertyOnSiblings(s,"value",t.target.value,"value"),h.formattedValue=null}),s.addEventListener("resetform",t=>{var e=this.data.defaultFieldValue??"";s.value=h.userValue=e,h.formattedValue=null});let r=t=>{var e=h["formattedValue"];null!=e&&(t.target.value=e),t.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){s.addEventListener("focus",t=>{h.focused||(t=t["target"],h.userValue&&(t.value=h.userValue),h.lastCommittedValue=t.value,h.commitKey=1,h.focused=!0)}),s.addEventListener("updatefromsandbox",t=>{this.showElementAndHideCanvas(t.target),this._dispatchEventFromSandbox({value(t){h.userValue=t.detail.value??"",i.setValue(l,{value:h.userValue.toString()}),t.target.value=h.userValue},formattedValue(t){var e=t.detail["formattedValue"];null!=(h.formattedValue=e)&&t.target!==document.activeElement&&(t.target.value=e),i.setValue(l,{formattedValue:e})},selRange(t){t.target.setSelectionRange(...t.detail.selRange)},charLimit:e=>{var r=e.detail["charLimit"],e=e["target"];if(0===r)e.removeAttribute("maxLength");else{e.setAttribute("maxLength",r);let t=h.userValue;!t||t.length<=r||(t=t.slice(0,r),e.value=h.userValue=t,i.setValue(l,{value:t}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:l,name:"Keystroke",value:t,willCommit:!0,commitKey:1,selStart:e.selectionStart,selEnd:e.selectionEnd}}))}}},t)}),s.addEventListener("keydown",t=>{let e=-(h.commitKey=1);var r;"Escape"===t.key?e=0:"Enter"!==t.key||this.data.multiLine?"Tab"===t.key&&(h.commitKey=3):e=2,-1!==e&&(r=t.target.value,h.lastCommittedValue!==r)&&(h.lastCommittedValue=r,h.userValue=r,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:l,name:"Keystroke",value:r,willCommit:!0,commitKey:e,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}))});const o=r;r=null,s.addEventListener("blur",t=>{var e;h.focused&&t.relatedTarget&&(h.focused=!1,e=t.target["value"],h.userValue=e,h.lastCommittedValue!==e&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:l,name:"Keystroke",value:e,willCommit:!0,commitKey:h.commitKey,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}),o(t))}),this.data.actions?.Keystroke&&s.addEventListener("beforeinput",t=>{h.lastCommittedValue=null;var{data:e,target:r}=t,{value:i,selectionStart:s,selectionEnd:n}=r;let a=s,o=n;switch(t.inputType){case"deleteWordBackward":{const t=i.substring(0,s).match(/\w*[^\w]*$/);t&&(a-=t[0].length);break}case"deleteWordForward":{const t=i.substring(s).match(/^[^\w]*\w*/);t&&(o+=t[0].length);break}case"deleteContentBackward":s===n&&--a;break;case"deleteContentForward":s===n&&(o+=1)}t.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:l,name:"Keystroke",value:i,change:e||"",willCommit:!1,selStart:a,selEnd:o}})}),this._setEventListeners(s,h,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],t=>t.target.value)}if(r&&s.addEventListener("blur",r),this.data.comb){const i=(this.data.rect[2]-this.data.rect[0])/a;s.classList.add("comb"),s.style.letterSpacing=`calc(${i}px * var(--scale-factor) - 1ch)`}}else(s=document.createElement("div")).textContent=this.data.fieldValue,s.style.verticalAlign="middle",s.style.display="table-cell";return this._setTextStyle(s),this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class c extends m{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class v extends m{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const i=this.annotationStorage,s=this.data,n=s.id;let t=i.getValue(n,{value:s.exportValue===s.fieldValue}).value;"string"==typeof t&&(t="Off"!==t,i.setValue(n,{value:t})),this.container.classList.add("buttonWidgetAnnotation","checkBox");var e=document.createElement("input");return f.add(e),e.setAttribute("data-element-id",n),e.disabled=s.readOnly,this._setRequired(e,this.data.required),e.type="checkbox",e.name=s.fieldName,t&&e.setAttribute("checked",!0),e.setAttribute("exportValue",s.exportValue),e.tabIndex=1e3,e.addEventListener("change",t=>{var{name:e,checked:r}=t.target;for(const t of this._getElementsByName(e,n)){const n=r&&t.exportValue===s.exportValue;t.domElement&&(t.domElement.checked=n),i.setValue(t.id,{value:n})}i.setValue(n,{value:r})}),e.addEventListener("resetform",t=>{var e=s.defaultFieldValue||"Off";t.target.checked=e===s.exportValue}),this.enableScripting&&this.hasJSActions&&(e.addEventListener("updatefromsandbox",t=>{this._dispatchEventFromSandbox({value(t){t.target.checked="Off"!==t.detail.value,i.setValue(n,{value:t.target.checked})}},t)}),this._setEventListeners(e,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],t=>t.target.checked)),this._setBackgroundColor(e),this._setDefaultPropertiesFromJS(e),this.container.append(e),this.container}}class _ extends m{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const r=this.annotationStorage,i=this.data,s=i.id;let n=r.getValue(s,{value:i.fieldValue===i.buttonValue}).value;"string"==typeof n&&(n=n!==i.buttonValue,r.setValue(s,{value:n}));var t=document.createElement("input");if(f.add(t),t.setAttribute("data-element-id",s),t.disabled=i.readOnly,this._setRequired(t,this.data.required),t.type="radio",t.name=i.fieldName,n&&t.setAttribute("checked",!0),t.tabIndex=1e3,t.addEventListener("change",t=>{var{name:e,checked:t}=t.target;for(const t of this._getElementsByName(e,s))r.setValue(t.id,{value:!1});r.setValue(s,{value:t})}),t.addEventListener("resetform",t=>{var e=i.defaultFieldValue;t.target.checked=null!=e&&e===i.buttonValue}),this.enableScripting&&this.hasJSActions){const n=i.buttonValue;t.addEventListener("updatefromsandbox",t=>{this._dispatchEventFromSandbox({value:t=>{var e=n===t.detail.value;for(const n of this._getElementsByName(t.target.name)){const t=e&&n.id===s;n.domElement&&(n.domElement.checked=t),r.setValue(n.id,{value:t})}}},t)}),this._setEventListeners(t,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(t),this._setDefaultPropertiesFromJS(t),this.container.append(t),this.container}}class b extends r{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){var t=super.render(),e=(t.classList.add("buttonWidgetAnnotation","pushButton"),this.data.alternativeText&&(t.title=this.data.alternativeText),t.lastChild);return this.enableScripting&&this.hasJSActions&&e&&(this._setDefaultPropertiesFromJS(e),e.addEventListener("updatefromsandbox",t=>{this._dispatchEventFromSandbox({},t)})),t}}class y extends m{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const n=this.annotationStorage,a=this.data.id,t=n.getValue(a,{value:this.data.fieldValue}),o=document.createElement("select");f.add(o),o.setAttribute("data-element-id",a),o.disabled=this.data.readOnly,this._setRequired(o,this.data.required),o.name=this.data.fieldName,o.tabIndex=1e3;let e=this.data.combo&&0<this.data.options.length;this.data.combo||(o.size=this.data.options.length,this.data.multiSelect&&(o.multiple=!0)),o.addEventListener("resetform",t=>{var e=this.data.defaultFieldValue;for(const t of o.options)t.selected=t.value===e});for(const n of this.data.options){const a=document.createElement("option");a.textContent=n.displayValue,a.value=n.exportValue,t.value.includes(n.exportValue)&&(a.setAttribute("selected",!0),e=!1),o.append(a)}let r=null;if(e){const n=document.createElement("option");n.value=" ",n.setAttribute("hidden",!0),n.setAttribute("selected",!0),o.prepend(n),r=()=>{n.remove(),o.removeEventListener("input",r),r=null},o.addEventListener("input",r)}const l=t=>{const e=t?"value":"textContent",{options:r,multiple:i}=o;return i?Array.prototype.filter.call(r,t=>t.selected).map(t=>t[e]):-1===r.selectedIndex?null:r[r.selectedIndex][e]};let h=l(!1);const c=t=>{t=t.target.options;return Array.prototype.map.call(t,t=>({displayValue:t.textContent,exportValue:t.value}))};return this.enableScripting&&this.hasJSActions?(o.addEventListener("updatefromsandbox",t=>{this._dispatchEventFromSandbox({value(t){r?.();var t=t.detail.value,e=new Set(Array.isArray(t)?t:[t]);for(const n of o.options)n.selected=e.has(n.value);n.setValue(a,{value:l(!0)}),h=l(!1)},multipleSelection(t){o.multiple=!0},remove(t){var e=o.options,r=t.detail.remove;e[r].selected=!1,o.remove(r),0<e.length&&-1===Array.prototype.findIndex.call(e,t=>t.selected)&&(e[0].selected=!0),n.setValue(a,{value:l(!0),items:c(t)}),h=l(!1)},clear(t){for(;0!==o.length;)o.remove(0);n.setValue(a,{value:null,items:[]}),h=l(!1)},insert(t){var{index:e,displayValue:r,exportValue:i}=t.detail.insert,e=o.children[e],s=document.createElement("option");s.textContent=r,s.value=i,e?e.before(s):o.append(s),n.setValue(a,{value:l(!0),items:c(t)}),h=l(!1)},items(t){const e=t.detail["items"];for(;0!==o.length;)o.remove(0);for(const n of e){const{displayValue:a,exportValue:t}=n,e=document.createElement("option");e.textContent=a,e.value=t,o.append(e)}0<o.options.length&&(o.options[0].selected=!0),n.setValue(a,{value:l(!0),items:c(t)}),h=l(!1)},indices(t){var e=new Set(t.detail.indices);for(const n of t.target.options)n.selected=e.has(n.index);n.setValue(a,{value:l(!0)}),h=l(!1)},editable(t){t.target.disabled=!t.detail.editable}},t)}),o.addEventListener("input",t=>{var e=l(!0);n.setValue(a,{value:e}),t.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:a,name:"Keystroke",value:h,changeEx:e,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(o,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],t=>t.target.value)):o.addEventListener("input",function(t){n.setValue(a,{value:l(!0)})}),this.data.combo&&this._setTextStyle(o),this._setBackgroundColor(o),this._setDefaultPropertiesFromJS(o),this.container.append(o),this.container}}class A extends i{constructor(t){var{data:e,elements:r}=t;super(t,{isRenderable:i._hasPopupData(e)}),this.elements=r}render(){this.container.classList.add("popupAnnotation");var t=new S({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open}),e=[];for(const r of this.elements)r.popup=t,e.push(r.data.id),r.addHighlightArea();return this.container.setAttribute("aria-controls",e.map(t=>""+u.AnnotationPrefix+t).join(",")),this.container}}class S{#en=null;#nn=this.#in.bind(this);#rn=this.#sn.bind(this);#an=this.#on.bind(this);#ln=this.#cn.bind(this);#Ue=null;#Rt=null;#hn=null;#dn=null;#un=null;#pn=null;#fn=!1;#gn=null;#mn=null;#bn=null;#vn=null;#yn=!1;constructor(t){var{container:t,color:e,elements:r,titleObj:i,modificationDate:s,contentsObj:n,richText:a,parent:o,rect:l,parentRect:h,open:c}=t,t=(this.#Rt=t,this.#vn=i,this.#hn=n,this.#bn=a,this.#un=o,this.#Ue=e,this.#mn=l,this.#pn=h,this.#dn=r,d.PDFDateString.toDateObject(s));t&&(this.#en=o.l10n.get("annotation_date_string",{date:t.toLocaleDateString(),time:t.toLocaleTimeString()})),this.trigger=r.flatMap(t=>t.getElementsToTriggerPopup());for(const t of this.trigger)t.addEventListener("click",this.#ln),t.addEventListener("mouseenter",this.#an),t.addEventListener("mouseleave",this.#rn),t.classList.add("popupTriggerArea");for(const t of r)t.container?.addEventListener("keydown",this.#nn);this.#Rt.hidden=!0,c&&this.#cn()}render(){if(!this.#gn){const{page:{view:n},viewport:{rawDims:{pageWidth:a,pageHeight:o,pageX:l,pageY:h}}}=this.#un,c=this.#gn=document.createElement("div");if(c.className="popup",this.#Ue){const n=c.style.outlineColor=u.Util.makeHexColor(...this.#Ue);if(CSS.supports("background-color","color-mix(in srgb, red 30%, white)"))c.style.backgroundColor=`color-mix(in srgb, ${n} 30%, white)`;else{const n=.7;c.style.backgroundColor=u.Util.makeHexColor(...this.#Ue.map(t=>Math.floor(.7*(255-t)+t)))}}var r=document.createElement("span"),i=(r.className="header",document.createElement("h1"));if(r.append(i),{dir:i.dir,str:i.textContent}=this.#vn,c.append(r),this.#en){const n=document.createElement("span");n.classList.add("popupDate"),this.#en.then(t=>{n.textContent=t}),r.append(n)}i=this.#hn,r=this.#bn;if(!r?.str||i?.str&&i.str!==r.str){const n=this._formatContents(i);c.append(n)}else p.XfaLayer.render({xfaHtml:r.html,intent:"richText",div:c}),c.lastChild.classList.add("richText","popupContent");let t=!!this.#pn,e=t?this.#pn:this.#mn;for(const n of this.#dn)if(!e||null!==u.Util.intersect(n.data.rect,e)){e=n.data.rect,t=!0;break}var i=u.Util.normalizeRect([e[0],n[3]-e[1]+n[1],e[2],n[3]-e[3]+n[1]]),r=t?e[2]-e[0]+5:0,r=i[0]+r,i=i[1],s=this.#Rt["style"];s.left=100*(r-l)/a+"%",s.top=100*(i-h)/o+"%",this.#Rt.append(c)}}_formatContents(t){let{str:e,dir:r}=t;var i=document.createElement("p"),s=(i.classList.add("popupContent"),i.dir=r,e.split(/(?:\r\n?|\n)/));for(let t=0,e=s.length;t<e;++t){const r=s[t];i.append(document.createTextNode(r)),t<e-1&&i.append(document.createElement("br"))}return i}#in(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||("Enter"===t.key||"Escape"===t.key&&this.#fn)&&this.#cn()}#cn(){this.#fn=!this.#fn,this.#fn?(this.#on(),this.#Rt.addEventListener("click",this.#ln),this.#Rt.addEventListener("keydown",this.#nn)):(this.#sn(),this.#Rt.removeEventListener("click",this.#ln),this.#Rt.removeEventListener("keydown",this.#nn))}#on(){this.#gn||this.render(),this.isVisible?this.#fn&&this.#Rt.classList.add("focused"):(this.#Rt.hidden=!1,this.#Rt.style.zIndex=parseInt(this.#Rt.style.zIndex)+1e3)}#sn(){this.#Rt.classList.remove("focused"),!this.#fn&&this.isVisible&&(this.#Rt.hidden=!0,this.#Rt.style.zIndex=parseInt(this.#Rt.style.zIndex)-1e3)}forceHide(){this.#yn=this.isVisible,this.#yn&&(this.#Rt.hidden=!0)}maybeShow(){this.#yn&&(this.#yn=!1,this.#Rt.hidden=!1)}get isVisible(){return!1===this.#Rt.hidden}}class x extends i{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.textContent=t.data.textContent,this.textPosition=t.data.textPosition,this.annotationEditorType=u.AnnotationEditorType.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){var t=document.createElement("div");t.classList.add("annotationTextContent"),t.setAttribute("role","comment");for(const r of this.textContent){var e=document.createElement("span");e.textContent=r,t.append(e)}this.container.append(t)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}t.FreeTextAnnotationElement=x;class w extends i{#_n=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");var t=this.data,{width:e,height:r}=g(t.rect),e=this.svgFactory.create(e,r,!0),r=this.#_n=this.svgFactory.createElement("svg:line");return r.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]),r.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]),r.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]),r.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]),r.setAttribute("stroke-width",t.borderStyle.width||1),r.setAttribute("stroke","transparent"),r.setAttribute("fill","transparent"),e.append(r),this.container.append(e),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#_n}addHighlightArea(){this.container.classList.add("highlightArea")}}class E extends i{#An=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");var t=this.data,{width:e,height:r}=g(t.rect),i=this.svgFactory.create(e,r,!0),s=t.borderStyle.width,n=this.#An=this.svgFactory.createElement("svg:rect");return n.setAttribute("x",s/2),n.setAttribute("y",s/2),n.setAttribute("width",e-s),n.setAttribute("height",r-s),n.setAttribute("stroke-width",s||1),n.setAttribute("stroke","transparent"),n.setAttribute("fill","transparent"),i.append(n),this.container.append(i),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#An}addHighlightArea(){this.container.classList.add("highlightArea")}}class T extends i{#Sn=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");var t=this.data,{width:e,height:r}=g(t.rect),i=this.svgFactory.create(e,r,!0),s=t.borderStyle.width,n=this.#Sn=this.svgFactory.createElement("svg:ellipse");return n.setAttribute("cx",e/2),n.setAttribute("cy",r/2),n.setAttribute("rx",e/2-s/2),n.setAttribute("ry",r/2-s/2),n.setAttribute("stroke-width",s||1),n.setAttribute("stroke","transparent"),n.setAttribute("fill","transparent"),i.append(n),this.container.append(i),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#Sn}addHighlightArea(){this.container.classList.add("highlightArea")}}class C extends i{#En=null;constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const t=this.data,{width:e,height:r}=g(t.rect),i=this.svgFactory.create(e,r,!0);let s=[];for(const e of t.vertices){const r=e.x-t.rect[0],i=t.rect[3]-e.y;s.push(r+","+i)}s=s.join(" ");var n=this.#En=this.svgFactory.createElement(this.svgElementName);return n.setAttribute("points",s),n.setAttribute("stroke-width",t.borderStyle.width||1),n.setAttribute("stroke","transparent"),n.setAttribute("fill","transparent"),i.append(n),this.container.append(i),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#En}addHighlightArea(){this.container.classList.add("highlightArea")}}class P extends C{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class k extends i{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 M extends i{#xn=[];constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=u.AnnotationEditorType.INK}render(){this.container.classList.add(this.containerClassName);const e=this.data,{width:r,height:t}=g(e.rect),i=this.svgFactory.create(r,t,!0);for(const r of e.inkLists){let t=[];for(const i of r){const r=i.x-e.rect[0],n=e.rect[3]-i.y;t.push(r+","+n)}t=t.join(" ");var s=this.svgFactory.createElement(this.svgElementName);this.#xn.push(s),s.setAttribute("points",t),s.setAttribute("stroke-width",e.borderStyle.width||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),!e.popupRef&&this.hasPopupData&&this._createPopup(),i.append(s)}return this.container.append(i),this.container}getElementsToTriggerPopup(){return this.#xn}addHighlightArea(){this.container.classList.add("highlightArea")}}t.InkAnnotationElement=M;class R extends i{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}}class F extends i{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 D extends i{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 I extends i{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 O extends i{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("stampAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}t.StampAnnotationElement=O;class N extends i{#wn=null;constructor(t){super(t,{isRenderable:!0});var{filename:t,content:e}=this.data.file;this.filename=(0,d.getFilenameFromUrl)(t,!0),this.content=e,this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,filename:t,content:e})}render(){this.container.classList.add("fileAttachmentAnnotation");var{container:t,data:e}=this;let r;e.hasAppearance||0===e.fillAlpha?r=document.createElement("div"):((r=document.createElement("img")).src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(e.name)?"paperclip":"pushpin"}.svg`,e.fillAlpha&&e.fillAlpha<1&&(r.style=`filter: opacity(${Math.round(100*e.fillAlpha)}%);`)),r.addEventListener("dblclick",this.#Cn.bind(this)),this.#wn=r;const i=u.FeatureTest.platform["isMac"];return t.addEventListener("keydown",t=>{"Enter"===t.key&&(i?t.metaKey:t.ctrlKey)&&this.#Cn()}),!e.popupRef&&this.hasPopupData?this._createPopup():r.classList.add("popupTriggerArea"),t.append(r),t}getElementsToTriggerPopup(){return this.#wn}addHighlightArea(){this.container.classList.add("highlightArea")}#Cn(){this.downloadManager?.openOrDownloadData(this.container,this.content,this.filename)}}t.AnnotationLayer=class{#Se=null;#Tn=null;#Pn=new Map;constructor(t){var{div:t,accessibilityManager:e,annotationCanvasMap:r,l10n:i,page:s,viewport:n}=t;this.div=t,this.#Se=e,this.#Tn=r,this.l10n=i,this.page=s,this.viewport=n,this.zIndex=0,this.l10n||=a.NullL10n}#kn(t,e){var r=t.firstChild||t;r.id=""+u.AnnotationPrefix+e,this.div.append(t),this.#Se?.moveElementInDOM(this.div,t,r,!1)}async render(t){const e=t["annotations"],r=this.div;(0,d.setLayerDimensions)(r,this.viewport);var i=new Map,s={data:null,layer:r,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:!1!==t.renderForms,svgFactory:new d.DOMSVGFactory,annotationStorage:t.annotationStorage||new n.AnnotationStorage,enableScripting:!0===t.enableScripting,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(const t of e)if(!t.noHTML){const e=t.annotationType===u.AnnotationType.POPUP;if(e){const e=i.get(t.id);if(!e)continue;s.elements=e}else{const{width:e,height:r}=g(t.rect);if(e<=0||r<=0)continue}s.data=t;const r=o.create(s);if(r.isRenderable){if(!e&&t.popupRef){const e=i.get(t.popupRef);e?e.push(r):i.set(t.popupRef,[r])}0<r.annotationEditorType&&this.#Pn.set(r.data.id,r);const d=r.render();t.hidden&&(d.style.visibility="hidden"),this.#kn(d,t.id)}}this.#Mn(),await this.l10n.translate(r)}update(t){var t=t["viewport"],e=this.div;this.viewport=t,(0,d.setLayerDimensions)(e,{rotation:t.rotation}),this.#Mn(),e.hidden=!1}#Mn(){if(this.#Tn){var t,e,r=this.div;for([t,e]of this.#Tn){var i,s=r.querySelector(`[data-annotation-id="${t}"]`);s&&(i=s["firstChild"],i?"CANVAS"===i.nodeName?i.replaceWith(e):i.before(e):s.append(e))}this.#Tn.clear()}}getEditableAnnotations(){return Array.from(this.#Pn.values())}getEditableAnnotation(t){return this.#Pn.get(t)}}},(t,e)=>{function r(t){return Math.floor(255*Math.max(0,Math.min(1,t))).toString(16).padStart(2,"0")}function s(t){return Math.max(0,Math.min(255,255*t))}Object.defineProperty(e,"__esModule",{value:!0}),e.ColorConverters=void 0,e.ColorConverters=class{static CMYK_G(t){var[t,e,r,i]=t;return["G",1-Math.min(1,.3*t+.59*r+.11*e+i)]}static G_CMYK(t){var[t]=t;return["CMYK",0,0,0,1-t]}static G_RGB(t){var[t]=t;return["RGB",t,t,t]}static G_rgb(t){var[t]=t;return[t=s(t),t,t]}static G_HTML(t){var[t]=t,t=r(t);return"#"+t+t+t}static RGB_G(t){var[t,e,r]=t;return["G",.3*t+.59*e+.11*r]}static RGB_rgb(t){return t.map(s)}static RGB_HTML(t){return"#"+t.map(r).join("")}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB(t){var[t,e,r,i]=t;return["RGB",1-Math.min(1,t+i),1-Math.min(1,r+i),1-Math.min(1,e+i)]}static CMYK_rgb(t){var[t,e,r,i]=t;return[s(1-Math.min(1,t+i)),s(1-Math.min(1,r+i)),s(1-Math.min(1,e+i))]}static CMYK_HTML(t){t=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(t)}static RGB_CMYK(t){var[t,e,r]=t,t=1-t,e=1-e,r=1-r;return["CMYK",t,e,r,Math.min(t,e,r)]}}},(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.NullL10n=void 0,e.getL10nFallback=i;const r={of_pages:"of {{pagesCount}}",page_of_pages:"({{pageNumber}} of {{pagesCount}})",document_properties_kb:"{{size_kb}} KB ({{size_b}} bytes)",document_properties_mb:"{{size_mb}} MB ({{size_b}} bytes)",document_properties_date_string:"{{date}}, {{time}}",document_properties_page_size_unit_inches:"in",document_properties_page_size_unit_millimeters:"mm",document_properties_page_size_orientation_portrait:"portrait",document_properties_page_size_orientation_landscape:"landscape",document_properties_page_size_name_a3:"A3",document_properties_page_size_name_a4:"A4",document_properties_page_size_name_letter:"Letter",document_properties_page_size_name_legal:"Legal",document_properties_page_size_dimension_string:"{{width}} × {{height}} {{unit}} ({{orientation}})",document_properties_page_size_dimension_name_string:"{{width}} × {{height}} {{unit}} ({{name}}, {{orientation}})",document_properties_linearized_yes:"Yes",document_properties_linearized_no:"No",additional_layers:"Additional Layers",page_landmark:"Page {{page}}",thumb_page_title:"Page {{page}}",thumb_page_canvas:"Thumbnail of Page {{page}}",find_reached_top:"Reached top of document, continued from bottom",find_reached_bottom:"Reached end of document, continued from top","find_match_count[one]":"{{current}} of {{total}} match","find_match_count[other]":"{{current}} of {{total}} matches","find_match_count_limit[one]":"More than {{limit}} match","find_match_count_limit[other]":"More than {{limit}} matches",find_not_found:"Phrase not found",page_scale_width:"Page Width",page_scale_fit:"Page Fit",page_scale_auto:"Automatic Zoom",page_scale_actual:"Actual Size",page_scale_percent:"{{scale}}%",loading_error:"An error occurred while loading the PDF.",invalid_file_error:"Invalid or corrupted PDF file.",missing_file_error:"Missing PDF file.",unexpected_response_error:"Unexpected server response.",rendering_error:"An error occurred while rendering the page.",annotation_date_string:"{{date}}, {{time}}",printing_not_supported:"Warning: Printing is not fully supported by this browser.",printing_not_ready:"Warning: The PDF is not fully loaded for printing.",web_fonts_disabled:"Web fonts are disabled: unable to use embedded PDF fonts.",free_text2_default_content:"Start typing…",editor_free_text2_aria_label:"Text Editor",editor_ink2_aria_label:"Draw Editor",editor_ink_canvas_aria_label:"User-created image",editor_alt_text_button_label:"Alt text",editor_alt_text_edit_button_label:"Edit alt text",editor_alt_text_decorative_tooltip:"Marked as decorative",print_progress_percent:"{{progress}}%"};function i(t,e){switch(t){case"find_match_count":t=`find_match_count[${1===e.total?"one":"other"}]`;break;case"find_match_count_limit":t=`find_match_count_limit[${1===e.limit?"one":"other"}]`}return r[t]||""}e.NullL10n={getLanguage:async()=>"en-us",getDirection:async()=>"ltr",async get(t){var r,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;return t=2<arguments.length&&void 0!==arguments[2]?arguments[2]:i(t,e),(r=e)?t.replaceAll(/\{\{\s*(\w+)\s*\}\}/g,(t,e)=>e in r?r[e]:"{{"+e+"}}"):t},async translate(t){}}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.XfaLayer=void 0,r(89);var d=r(194);e.XfaLayer=class{static setupStorage(t,e,r,i,s){var n=i.getValue(e,{value:null});switch(r.name){case"textarea":null!==n.value&&(t.textContent=n.value),"print"!==s&&t.addEventListener("input",t=>{i.setValue(e,{value:t.target.value})});break;case"input":if("radio"===r.attributes.type||"checkbox"===r.attributes.type){if(n.value===r.attributes.xfaOn?t.setAttribute("checked",!0):n.value===r.attributes.xfaOff&&t.removeAttribute("checked"),"print"===s)break;t.addEventListener("change",t=>{i.setValue(e,{value:t.target.checked?t.target.getAttribute("xfaOn"):t.target.getAttribute("xfaOff")})})}else{if(null!==n.value&&t.setAttribute("value",n.value),"print"===s)break;t.addEventListener("input",t=>{i.setValue(e,{value:t.target.value})})}break;case"select":if(null!==n.value){t.setAttribute("value",n.value);for(const t of r.children)t.attributes.value===n.value?t.attributes.selected=!0:t.attributes.hasOwnProperty("selected")&&delete t.attributes.selected}t.addEventListener("input",t=>{t=t.target.options,t=-1===t.selectedIndex?"":t[t.selectedIndex].value;i.setValue(e,{value:t})})}}static setAttributes(t){let{html:e,element:r,storage:i=null,intent:s,linkService:n}=t;var a=r["attributes"],o=e instanceof HTMLAnchorElement;"radio"===a.type&&(a.name=a.name+"-"+s);for(const[t,r]of Object.entries(a))if(null!=r)switch(t){case"class":r.length&&e.setAttribute(t,r.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",r);break;case"style":Object.assign(e.style,r);break;case"textContent":e.textContent=r;break;default:o&&("href"===t||"newWindow"===t)||e.setAttribute(t,r)}o&&n.addLinkAttributes(e,a.href,a.newWindow),i&&a.dataId&&this.setupStorage(e,a.dataId,r,i)}static render(t){const e=t.annotationStorage,r=t.linkService,i=t.xfaHtml,s=t.intent||"display",n=document.createElement(i.name),a=(i.attributes&&this.setAttributes({html:n,element:i,intent:s,linkService:r}),[[i,-1,n]]),o=t.div;if(o.append(n),t.viewport){const e=`matrix(${t.viewport.transform.join(",")})`;o.style.transform=e}"richText"!==s&&o.setAttribute("class","xfaLayer xfaFont");for(var l=[];0<a.length;){const[t,i,n]=a.at(-1);if(i+1===t.children.length)a.pop();else{const o=t.children[++a.at(-1)[1]];if(null!==o){var h=o["name"];if("#text"===h){const t=document.createTextNode(o.value);l.push(t),n.append(t)}else{var c=o?.attributes?.xmlns?document.createElementNS(o.attributes.xmlns,h):document.createElement(h);if(n.append(c),o.attributes&&this.setAttributes({html:c,element:o,storage:e,intent:s,linkService:r}),o.children&&0<o.children.length)a.push([o,-1,c]);else if(o.value){const t=document.createTextNode(o.value);d.XfaText.shouldBuildText(h)&&l.push(t),c.append(t)}}}}}for(const t of o.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))t.setAttribute("readOnly",!0);return{textDivs:l}}static update(t){var e=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=e,t.div.hidden=!1}}},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InkEditor=void 0,r(89),r(2);var g=r(1),m=r(164),v=r(198),i=r(168),a=r(165);class _ extends m.AnnotationEditor{#Fn=0;#Rn=0;#Dn=this.canvasPointermove.bind(this);#In=this.canvasPointerleave.bind(this);#On=this.canvasPointerup.bind(this);#Ln=this.canvasPointerdown.bind(this);#Nn=new Path2D;#Bn=!1;#jn=!1;#Un=!1;#zn=null;#Wn=0;#Hn=0;#qn=null;static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=1;static _type="ink";constructor(t){super({...t,name:"inkEditor"}),this.color=t.color||null,this.thickness=t.thickness||null,this.opacity=t.opacity||null,this.paths=[],this.bezierPath2D=[],this.allRawPaths=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0,this._willKeepAspectRatio=!0}static initialize(t){m.AnnotationEditor.initialize(t,{strings:["editor_ink_canvas_aria_label","editor_ink2_aria_label"]})}static updateDefaultParams(t,e){switch(t){case g.AnnotationEditorParamsType.INK_THICKNESS:_._defaultThickness=e;break;case g.AnnotationEditorParamsType.INK_COLOR:_._defaultColor=e;break;case g.AnnotationEditorParamsType.INK_OPACITY:_._defaultOpacity=e/100}}updateParams(t,e){switch(t){case g.AnnotationEditorParamsType.INK_THICKNESS:this.#Gn(e);break;case g.AnnotationEditorParamsType.INK_COLOR:this.#Ve(e);break;case g.AnnotationEditorParamsType.INK_OPACITY:this.#Vn(e)}}static get defaultPropertiesToUpdate(){return[[g.AnnotationEditorParamsType.INK_THICKNESS,_._defaultThickness],[g.AnnotationEditorParamsType.INK_COLOR,_._defaultColor||m.AnnotationEditor._defaultLineColor],[g.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*_._defaultOpacity)]]}get propertiesToUpdate(){return[[g.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||_._defaultThickness],[g.AnnotationEditorParamsType.INK_COLOR,this.color||_._defaultColor||m.AnnotationEditor._defaultLineColor],[g.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(this.opacity??_._defaultOpacity))]]}#Gn(t){const e=this.thickness;this.addCommands({cmd:()=>{this.thickness=t,this.#$n()},undo:()=>{this.thickness=e,this.#$n()},mustExec:!0,type:g.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}#Ve(t){const e=this.color;this.addCommands({cmd:()=>{this.color=t,this.#Xn()},undo:()=>{this.color=e,this.#Xn()},mustExec:!0,type:g.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}#Vn(t){t/=100;const e=this.opacity;this.addCommands({cmd:()=>{this.opacity=t,this.#Xn()},undo:()=>{this.opacity=e,this.#Xn()},mustExec:!0,type:g.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}rebuild(){this.parent&&(super.rebuild(),null!==this.div)&&(this.canvas||(this.#Kn(),this.#Yn()),this.isAttachedToDOM||(this.parent.add(this),this.#Jn()),this.#$n())}remove(){null!==this.canvas&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,this.#zn.disconnect(),this.#zn=null,super.remove())}setParent(t){!this.parent&&t?this._uiManager.removeShouldRescale(this):this.parent&&null===t&&this._uiManager.addShouldRescale(this),super.setParent(t)}onScaleChanging(){var[t,e]=this.parentDimensions,t=this.width*t,e=this.height*e;this.setDimensions(t,e)}enableEditMode(){this.#Bn||null===this.canvas||(super.enableEditMode(),this._isDraggable=!1,this.canvas.addEventListener("pointerdown",this.#Ln))}disableEditMode(){this.isInEditMode()&&null!==this.canvas&&(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",this.#Ln))}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}#Qn(){var{parentRotation:t,parentDimensions:[e,r]}=this;switch(t){case 90:return[0,r,r,e];case 180:return[e,r,e,r];case 270:return[e,0,r,e];default:return[0,0,e,r]}}#Zn(){var{ctx:t,color:e,opacity:r,thickness:i,parentScale:s,scaleFactor:n}=this;t.lineWidth=i*s/n,t.lineCap="round",t.lineJoin="round",t.miterLimit=10,t.strokeStyle=""+e+(0,a.opacityToHex)(r)}#ti(t,e){this.canvas.addEventListener("contextmenu",i.noContextMenu),this.canvas.addEventListener("pointerleave",this.#In),this.canvas.addEventListener("pointermove",this.#Dn),this.canvas.addEventListener("pointerup",this.#On),this.canvas.removeEventListener("pointerdown",this.#Ln),this.isEditing=!0,this.#Un||(this.#Un=!0,this.#Jn(),this.thickness||=_._defaultThickness,this.color||=_._defaultColor||m.AnnotationEditor._defaultLineColor,this.opacity??=_._defaultOpacity),this.currentPath.push([t,e]),this.#jn=!1,this.#Zn(),this.#qn=()=>{this.#ei(),this.#qn&&window.requestAnimationFrame(this.#qn)},window.requestAnimationFrame(this.#qn)}#ni(e,r){var[i,t]=this.currentPath.at(-1);if(!(1<this.currentPath.length&&e===i&&r===t)){i=this.currentPath;let t=this.#Nn;i.push([e,r]),this.#jn=!0,i.length<=2?(t.moveTo(...i[0]),t.lineTo(e,r)):(3===i.length&&(this.#Nn=t=new Path2D,t.moveTo(...i[0])),this.#ii(t,...i.at(-3),...i.at(-2),e,r))}}#ri(){var t;0!==this.currentPath.length&&(t=this.currentPath.at(-1),this.#Nn.lineTo(...t))}#si(t,e){this.#qn=null,t=Math.min(Math.max(t,0),this.canvas.width),e=Math.min(Math.max(e,0),this.canvas.height),this.#ni(t,e),this.#ri();let r;if(1!==this.currentPath.length)r=this.#ai();else{const i=[t,e];r=[[i,i.slice(),i.slice(),i]]}const i=this.#Nn,s=this.currentPath;this.currentPath=[],this.#Nn=new Path2D,this.addCommands({cmd:()=>{this.allRawPaths.push(s),this.paths.push(r),this.bezierPath2D.push(i),this.rebuild()},undo:()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),0===this.paths.length?this.remove():(this.canvas||(this.#Kn(),this.#Yn()),this.#$n())},mustExec:!0})}#ei(){if(this.#jn){this.#jn=!1;Math.ceil(this.thickness*this.parentScale);const t=this.currentPath.slice(-3),e=t.map(t=>t[0]),r=t.map(t=>t[1]),i=(Math.min(...e),Math.max(...e),Math.min(...r),Math.max(...r),this)["ctx"];i.save(),i.clearRect(0,0,this.canvas.width,this.canvas.height);for(const s of this.bezierPath2D)i.stroke(s);i.stroke(this.#Nn),i.restore()}}#ii(t,e,r,i,s,n,a){e=(e+i)/2,r=(r+s)/2,n=(i+n)/2,a=(s+a)/2;t.bezierCurveTo(e+2*(i-e)/3,r+2*(s-r)/3,n+2*(i-n)/3,a+2*(s-a)/3,n,a)}#ai(){var t=this.currentPath;if(t.length<=2)return[[t[0],t[0],t.at(-1),t.at(-1)]];var e=[];let r,[i,s]=t[0];for(r=1;r<t.length-2;r++){const[n,a]=t[r],[o,l]=t[r+1],h=(n+o)/2,c=(a+l)/2,d=[i+2*(n-i)/3,s+2*(a-s)/3],u=[h+2*(n-h)/3,c+2*(a-c)/3];e.push([[i,s],d,u,[h,c]]),[i,s]=[h,c]}const[n,a]=t[r],[o,l]=t[r+1],h=[i+2*(n-i)/3,s+2*(a-s)/3],c=[o+2*(n-o)/3,l+2*(a-l)/3];return e.push([[i,s],h,c,[o,l]]),e}#Xn(){if(this.isEmpty())this.#oi();else{this.#Zn();const{canvas:t,ctx:e}=this;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,t.width,t.height),this.#oi();for(const t of this.bezierPath2D)e.stroke(t)}}commit(){this.#Bn||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),this.#Bn=!0,this.div.classList.add("disabled"),this.#$n(!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.#Bn&&(this.setInForeground(),t.preventDefault(),"mouse"!==t.type&&this.div.focus(),this.#ti(t.offsetX,t.offsetY))}canvasPointermove(t){t.preventDefault(),this.#ni(t.offsetX,t.offsetY)}canvasPointerup(t){t.preventDefault(),this.#li(t)}canvasPointerleave(t){this.#li(t)}#li(t){this.canvas.removeEventListener("pointerleave",this.#In),this.canvas.removeEventListener("pointermove",this.#Dn),this.canvas.removeEventListener("pointerup",this.#On),this.canvas.addEventListener("pointerdown",this.#Ln),setTimeout(()=>{this.canvas.removeEventListener("contextmenu",i.noContextMenu)},10),this.#si(t.offsetX,t.offsetY),this.addToAnnotationStorage(),this.setInBackground()}#Kn(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",m.AnnotationEditor._l10nPromise.get("editor_ink_canvas_aria_label").then(t=>this.canvas?.setAttribute("aria-label",t)),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")}#Yn(){this.#zn=new ResizeObserver(t=>{t=t[0].contentRect;t.width&&t.height&&this.setDimensions(t.width,t.height)}),this.#zn.observe(this.div)}get isResizable(){return!this.isEmpty()&&this.#Bn}render(){if(!this.div){let t,e;this.width&&(t=this.x,e=this.y),super.render(),m.AnnotationEditor._l10nPromise.get("editor_ink2_aria_label").then(t=>this.div?.setAttribute("aria-label",t));const[r,i,s,n]=this.#Qn();if(this.setAt(r,i,0,0),this.setDims(s,n),this.#Kn(),this.width){const[r,i]=this.parentDimensions;this.setAspectRatio(this.width*r,this.height*i),this.setAt(t*r,e*i,this.width*r,this.height*i),this.#Un=!0,this.#Jn(),this.setDims(this.width*r,this.height*i),this.#Xn(),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();this.#Yn()}return this.div}#Jn(){var t,e;this.#Un&&([t,e]=this.parentDimensions,this.canvas.width=Math.ceil(this.width*t),this.canvas.height=Math.ceil(this.height*e),this.#oi())}setDimensions(t,e){var r=Math.round(t),i=Math.round(e);this.#Wn===r&&this.#Hn===i||(this.#Wn=r,this.#Hn=i,this.canvas.style.visibility="hidden",[r,i]=this.parentDimensions,this.width=t/r,this.height=e/i,this.fixAndSetPosition(),this.#Bn&&this.#ci(t,e),this.#Jn(),this.#Xn(),this.canvas.style.visibility="visible",this.fixDims())}#ci(t,e){var r=this.#hi(),t=(t-r)/this.#Rn,e=(e-r)/this.#Fn;this.scaleFactor=Math.min(t,e)}#oi(){var t=this.#hi()/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+t,this.translationY*this.scaleFactor+t)}static#di(r){var i=new Path2D;for(let t=0,e=r.length;t<e;t++){var[s,n,a,o]=r[t];0===t&&i.moveTo(...s),i.bezierCurveTo(n[0],n[1],a[0],a[1],o[0],o[1])}return i}static#ui(r,t,i){var[s,n,a,o]=t;switch(i){case 0:for(let t=0,e=r.length;t<e;t+=2)r[t]+=s,r[t+1]=o-r[t+1];break;case 90:for(let t=0,e=r.length;t<e;t+=2){const i=r[t];r[t]=r[t+1]+s,r[t+1]=i+n}break;case 180:for(let t=0,e=r.length;t<e;t+=2)r[t]=a-r[t],r[t+1]+=n;break;case 270:for(let t=0,e=r.length;t<e;t+=2){const i=r[t];r[t]=a-r[t+1],r[t+1]=o-i}break;default:throw new Error("Invalid rotation")}return r}static#pi(r,t,i){var[s,n,a,o]=t;switch(i){case 0:for(let t=0,e=r.length;t<e;t+=2)r[t]-=s,r[t+1]=o-r[t+1];break;case 90:for(let t=0,e=r.length;t<e;t+=2){const i=r[t];r[t]=r[t+1]-n,r[t+1]=i-s}break;case 180:for(let t=0,e=r.length;t<e;t+=2)r[t]=a-r[t],r[t+1]-=n;break;case 270:for(let t=0,e=r.length;t<e;t+=2){const i=r[t];r[t]=o-r[t+1],r[t+1]=a-i}break;default:throw new Error("Invalid rotation")}return r}#fi(r,i,s,t){const e=[],n=this.thickness/2,a=r*i+n,o=r*s+n;for(const i of this.paths){const s=[],n=[];for(let t=0,e=i.length;t<e;t++){var[l,h,c,d]=i[t],u=r*l[0]+a,l=r*l[1]+o,p=r*h[0]+a,h=r*h[1]+o,f=r*c[0]+a,c=r*c[1]+o,g=r*d[0]+a,d=r*d[1]+o;0===t&&(s.push(u,l),n.push(u,l)),s.push(p,h,f,c,g,d),n.push(p,h),t===e-1&&n.push(g,d)}e.push({bezier:_.#ui(s,t,this.rotation),points:_.#ui(n,t,this.rotation)})}return e}#gi(){let t=1/0,e=-1/0,r=1/0,i=-1/0;for(const l of this.paths)for(var[s,n,a,o]of l){s=g.Util.bezierBoundingBox(...s,...n,...a,...o);t=Math.min(t,s[0]),r=Math.min(r,s[1]),e=Math.max(e,s[2]),i=Math.max(i,s[3])}return[t,r,e,i]}#hi(){return this.#Bn?Math.ceil(this.thickness*this.parentScale):0}#$n(){var t,e,r,i,s,n,a=0<arguments.length&&void 0!==arguments[0]&&arguments[0];this.isEmpty()||(this.#Bn?(n=this.#gi(),t=this.#hi(),this.#Rn=Math.max(m.AnnotationEditor.MIN_SIZE,n[2]-n[0]),this.#Fn=Math.max(m.AnnotationEditor.MIN_SIZE,n[3]-n[1]),e=Math.ceil(t+this.#Rn*this.scaleFactor),r=Math.ceil(t+this.#Fn*this.scaleFactor),[i,s]=this.parentDimensions,this.width=e/i,this.height=r/s,this.setAspectRatio(e,r),i=this.translationX,s=this.translationY,this.translationX=-n[0],this.translationY=-n[1],this.#Jn(),this.#Xn(),this.#Wn=e,this.#Hn=r,this.setDims(e,r),n=a?t/this.scaleFactor/2:0,this.translate(i-this.translationX-n,s-this.translationY-n)):this.#Xn())}static deserialize(t,s,e){if(t instanceof v.InkAnnotationElement)return null;const n=super.deserialize(t,s,e),[a,o]=(n.thickness=t.thickness,n.color=g.Util.makeHexColor(...t.color),n.opacity=t.opacity,n.pageDimensions),l=n.width*a,h=n.height*o,c=n.parentScale,d=t.thickness/2;n.#Bn=!0,n.#Wn=Math.round(l),n.#Hn=Math.round(h);var u,{paths:s,rect:p,rotation:f}=t;for({bezier:u}of s){u=_.#pi(u,p,f);const s=[];n.paths.push(s);let r=c*(u[0]-d),i=c*(u[1]-d);for(let t=2,e=u.length;t<e;t+=6){const v=c*(u[t]-d),n=c*(u[t+1]-d),a=c*(u[t+2]-d),o=c*(u[t+3]-d),l=c*(u[t+4]-d),h=c*(u[t+5]-d);s.push([[r,i],[v,n],[a,o],[l,h]]),r=l,i=h}const m=this.#di(s);n.bezierPath2D.push(m)}e=n.#gi();return n.#Rn=Math.max(m.AnnotationEditor.MIN_SIZE,e[2]-e[0]),n.#Fn=Math.max(m.AnnotationEditor.MIN_SIZE,e[3]-e[1]),n.#ci(l,h),n}serialize(){var t,e;return this.isEmpty()?null:(t=this.getRect(0,0),e=m.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle),{annotationType:g.AnnotationEditorType.INK,color:e,thickness:this.thickness,opacity:this.opacity,paths:this.#fi(this.scaleFactor/this.parentScale,this.translationX,this.translationY,t),pageIndex:this.pageIndex,rect:t,rotation:this.rotation,structTreeParentId:this._structTreeParentId})}}e.InkEditor=_},(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.StampEditor=void 0,r(149),r(152);var n=r(1),i=r(164),a=r(168),o=r(198);class s extends i.AnnotationEditor{#mi=null;#bi=null;#vi=null;#yi=null;#_i=null;#Ai=null;#zn=null;#Si=null;#Ei=!1;#xi=!1;static _type="stamp";constructor(t){super({...t,name:"stampEditor"}),this.#yi=t.bitmapUrl,this.#_i=t.bitmapFile}static initialize(t){i.AnnotationEditor.initialize(t)}static get supportedTypes(){return(0,n.shadow)(this,"supportedTypes",["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"].map(t=>"image/"+t))}static get supportedTypesStr(){return(0,n.shadow)(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(t){return this.supportedTypes.includes(t)}static paste(t,e){e.pasteEditor(n.AnnotationEditorType.STAMP,{bitmapFile:t.getAsFile()})}#wi(t){var e=1<arguments.length&&void 0!==arguments[1]&&arguments[1];t?(this.#mi=t.bitmap,e||(this.#bi=t.id,this.#Ei=t.isSvg),this.#Kn()):this.remove()}#Ci(){this.#vi=null,this._uiManager.enableWaiting(!1),this.#Ai&&this.div.focus()}#Ti(){if(this.#bi)this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(this.#bi).then(t=>this.#wi(t,!0)).finally(()=>this.#Ci());else if(this.#yi){const e=this.#yi;this.#yi=null,this._uiManager.enableWaiting(!0),void(this.#vi=this._uiManager.imageManager.getFromUrl(e).then(t=>this.#wi(t)).finally(()=>this.#Ci()))}else if(this.#_i){const e=this.#_i;this.#_i=null,this._uiManager.enableWaiting(!0),void(this.#vi=this._uiManager.imageManager.getFromFile(e).then(t=>this.#wi(t)).finally(()=>this.#Ci()))}else{const e=document.createElement("input");e.type="file",e.accept=s.supportedTypesStr,this.#vi=new Promise(t=>{e.addEventListener("change",async()=>{if(e.files&&0!==e.files.length){this._uiManager.enableWaiting(!0);const t=await this._uiManager.imageManager.getFromFile(e.files[0]);this.#wi(t)}else this.remove();t()}),e.addEventListener("cancel",()=>{this.remove(),t()})}).finally(()=>this.#Ci()),e.click()}}remove(){this.#bi&&(this.#mi=null,this._uiManager.imageManager.deleteId(this.#bi),this.#Ai?.remove(),this.#Ai=null,this.#zn?.disconnect(),this.#zn=null),super.remove()}rebuild(){this.parent?(super.rebuild(),null!==this.div&&(this.#bi&&this.#Ti(),this.isAttachedToDOM||this.parent.add(this))):this.#bi&&this.#Ti()}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(this.#vi||this.#mi||this.#yi||this.#_i)}get isResizable(){return!0}render(){if(!this.div){let t,e;var r,i;this.width&&(t=this.x,e=this.y),super.render(),this.div.hidden=!0,this.#mi?this.#Kn():this.#Ti(),this.width&&([r,i]=this.parentDimensions,this.setAt(t*r,e*i,this.width*r,this.height*i))}return this.div}#Kn(){const t=this["div"];let{width:e,height:r}=this.#mi;var[i,s]=this.pageDimensions;if(this.width)e=this.width*i,r=this.height*s;else if(e>.75*i||r>.75*s){const t=Math.min(.75*i/e,.75*s/r);e*=t,r*=t}var[n,a]=this.parentDimensions,n=(this.setDims(e*n/i,r*a/s),this._uiManager.enableWaiting(!1),this.#Ai=document.createElement("canvas"));t.append(n),t.hidden=!1,this.#Pi(e,r),this.#Yn(),this.#xi||(this.parent.addUndoableEditor(this),this.#xi=!0),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"inserted_image"}}}),this.addAltTextButton()}#ki(t,e){var[r,i]=this.parentDimensions;this.width=t/r,this.height=e/i,this.setDims(t,e),this._initialOptions?.isCentered?this.center():this.fixAndSetPosition(),(this._initialOptions=null)!==this.#Si&&clearTimeout(this.#Si),this.#Si=setTimeout(()=>{this.#Si=null,this.#Pi(t,e)},200)}#Mi(t,e){const{width:r,height:i}=this.#mi;let s=r,n=i,a=this.#mi;for(;s>2*t||n>2*e;){const r=s,i=n;s>2*t&&(s=16384<=s?Math.floor(s/2)-1:Math.ceil(s/2)),n>2*e&&(n=16384<=n?Math.floor(n/2)-1:Math.ceil(n/2));var o=new OffscreenCanvas(s,n);o.getContext("2d").drawImage(a,0,0,r,i,0,0,s,n),a=o.transferToImageBitmap()}return a}#Pi(t,e){t=Math.ceil(t),e=Math.ceil(e);var r,i=this.#Ai;!i||i.width===t&&i.height===e||(i.width=t,i.height=e,r=this.#Ei?this.#mi:this.#Mi(t,e),(i=i.getContext("2d")).filter=this._uiManager.hcmFilter,i.drawImage(r,0,0,r.width,r.height,0,0,t,e))}#Fi(t){if(t){if(this.#Ei){const t=this._uiManager.imageManager.getSvgUrl(this.#bi);if(t)return t}const t=document.createElement("canvas");return{width:t.width,height:t.height}=this.#mi,t.getContext("2d").drawImage(this.#mi,0,0),t.toDataURL()}if(this.#Ei){const[t,e]=this.pageDimensions,r=Math.round(this.width*t*a.PixelsPerInch.PDF_TO_CSS_UNITS),i=Math.round(this.height*e*a.PixelsPerInch.PDF_TO_CSS_UNITS),s=new OffscreenCanvas(r,i);return s.getContext("2d").drawImage(this.#mi,0,0,this.#mi.width,this.#mi.height,0,0,r,i),s.transferToImageBitmap()}return structuredClone(this.#mi)}#Yn(){this.#zn=new ResizeObserver(t=>{t=t[0].contentRect;t.width&&t.height&&this.#ki(t.width,t.height)}),this.#zn.observe(this.div)}static deserialize(t,e,r){var i,s,n,a;return t instanceof o.StampAnnotationElement?null:(e=super.deserialize(t,e,r),{rect:t,bitmapUrl:i,bitmapId:a,isSvg:s,accessibilityData:n}=t,[r,a]=(a&&r.imageManager.isValidId(a)?e.#bi=a:e.#yi=i,e.#Ei=s,e.pageDimensions),e.width=(t[2]-t[0])/r,e.height=(t[3]-t[1])/a,n&&(e.altTextData=n),e)}serialize(){let t=0<arguments.length&&void 0!==arguments[0]&&arguments[0],e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;if(this.isEmpty())return null;var r={annotationType:n.AnnotationEditorType.STAMP,bitmapId:this.#bi,pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:this.#Ei,structTreeParentId:this._structTreeParentId};if(t)r.bitmapUrl=this.#Fi(!0),r.accessibilityData=this.altTextData;else{var{decorative:i,altText:s}=this.altTextData;if(!i&&s&&(r.accessibilityData={type:"Figure",alt:s}),null!==e){e.stamps||=new Map;i=this.#Ei?(r.rect[2]-r.rect[0])*(r.rect[3]-r.rect[1]):null;if(e.stamps.has(this.#bi)){if(this.#Ei){const t=e.stamps.get(this.#bi);i>t.area&&(t.area=i,t.serialized.bitmap.close(),t.serialized.bitmap=this.#Fi(!1))}}else e.stamps.set(this.#bi,{area:i,serialized:r}),r.bitmap=this.#Fi(!1)}}return r}}e.StampEditor=s}],__webpack_module_cache__={};function __w_pdfjs_require__(t){var e=__webpack_module_cache__[t];return void 0!==e||(e=__webpack_module_cache__[t]={exports:{}},__webpack_modules__[t].call(e.exports,e,e.exports,__w_pdfjs_require__)),e.exports}var __webpack_exports__={};return(()=>{var t=__webpack_exports__,e=(Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"AbortException",{enumerable:!0,get:function(){return e.AbortException}}),Object.defineProperty(t,"AnnotationEditorLayer",{enumerable:!0,get:function(){return n.AnnotationEditorLayer}}),Object.defineProperty(t,"AnnotationEditorParamsType",{enumerable:!0,get:function(){return e.AnnotationEditorParamsType}}),Object.defineProperty(t,"AnnotationEditorType",{enumerable:!0,get:function(){return e.AnnotationEditorType}}),Object.defineProperty(t,"AnnotationEditorUIManager",{enumerable:!0,get:function(){return a.AnnotationEditorUIManager}}),Object.defineProperty(t,"AnnotationLayer",{enumerable:!0,get:function(){return o.AnnotationLayer}}),Object.defineProperty(t,"AnnotationMode",{enumerable:!0,get:function(){return e.AnnotationMode}}),Object.defineProperty(t,"CMapCompressionType",{enumerable:!0,get:function(){return e.CMapCompressionType}}),Object.defineProperty(t,"DOMSVGFactory",{enumerable:!0,get:function(){return i.DOMSVGFactory}}),Object.defineProperty(t,"FeatureTest",{enumerable:!0,get:function(){return e.FeatureTest}}),Object.defineProperty(t,"GlobalWorkerOptions",{enumerable:!0,get:function(){return l.GlobalWorkerOptions}}),Object.defineProperty(t,"ImageKind",{enumerable:!0,get:function(){return e.ImageKind}}),Object.defineProperty(t,"InvalidPDFException",{enumerable:!0,get:function(){return e.InvalidPDFException}}),Object.defineProperty(t,"MissingPDFException",{enumerable:!0,get:function(){return e.MissingPDFException}}),Object.defineProperty(t,"OPS",{enumerable:!0,get:function(){return e.OPS}}),Object.defineProperty(t,"PDFDataRangeTransport",{enumerable:!0,get:function(){return r.PDFDataRangeTransport}}),Object.defineProperty(t,"PDFDateString",{enumerable:!0,get:function(){return i.PDFDateString}}),Object.defineProperty(t,"PDFWorker",{enumerable:!0,get:function(){return r.PDFWorker}}),Object.defineProperty(t,"PasswordResponses",{enumerable:!0,get:function(){return e.PasswordResponses}}),Object.defineProperty(t,"PermissionFlag",{enumerable:!0,get:function(){return e.PermissionFlag}}),Object.defineProperty(t,"PixelsPerInch",{enumerable:!0,get:function(){return i.PixelsPerInch}}),Object.defineProperty(t,"PromiseCapability",{enumerable:!0,get:function(){return e.PromiseCapability}}),Object.defineProperty(t,"RenderingCancelledException",{enumerable:!0,get:function(){return i.RenderingCancelledException}}),Object.defineProperty(t,"SVGGraphics",{enumerable:!0,get:function(){return r.SVGGraphics}}),Object.defineProperty(t,"UnexpectedResponseException",{enumerable:!0,get:function(){return e.UnexpectedResponseException}}),Object.defineProperty(t,"Util",{enumerable:!0,get:function(){return e.Util}}),Object.defineProperty(t,"VerbosityLevel",{enumerable:!0,get:function(){return e.VerbosityLevel}}),Object.defineProperty(t,"XfaLayer",{enumerable:!0,get:function(){return h.XfaLayer}}),Object.defineProperty(t,"build",{enumerable:!0,get:function(){return r.build}}),Object.defineProperty(t,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return e.createValidAbsoluteUrl}}),Object.defineProperty(t,"getDocument",{enumerable:!0,get:function(){return r.getDocument}}),Object.defineProperty(t,"getFilenameFromUrl",{enumerable:!0,get:function(){return i.getFilenameFromUrl}}),Object.defineProperty(t,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return i.getPdfFilenameFromUrl}}),Object.defineProperty(t,"getXfaPageViewport",{enumerable:!0,get:function(){return i.getXfaPageViewport}}),Object.defineProperty(t,"isDataScheme",{enumerable:!0,get:function(){return i.isDataScheme}}),Object.defineProperty(t,"isPdfFile",{enumerable:!0,get:function(){return i.isPdfFile}}),Object.defineProperty(t,"loadScript",{enumerable:!0,get:function(){return i.loadScript}}),Object.defineProperty(t,"noContextMenu",{enumerable:!0,get:function(){return i.noContextMenu}}),Object.defineProperty(t,"normalizeUnicode",{enumerable:!0,get:function(){return e.normalizeUnicode}}),Object.defineProperty(t,"renderTextLayer",{enumerable:!0,get:function(){return s.renderTextLayer}}),Object.defineProperty(t,"setLayerDimensions",{enumerable:!0,get:function(){return i.setLayerDimensions}}),Object.defineProperty(t,"shadow",{enumerable:!0,get:function(){return e.shadow}}),Object.defineProperty(t,"updateTextLayer",{enumerable:!0,get:function(){return s.updateTextLayer}}),Object.defineProperty(t,"version",{enumerable:!0,get:function(){return r.version}}),__w_pdfjs_require__(1)),r=__w_pdfjs_require__(124),i=__w_pdfjs_require__(168),s=__w_pdfjs_require__(195),n=__w_pdfjs_require__(196),a=__w_pdfjs_require__(165),o=__w_pdfjs_require__(198),l=__w_pdfjs_require__(176),h=__w_pdfjs_require__(201)})(),__webpack_exports__})());