officeparser 5.2.2 → 6.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,152 @@
1
+ #!/usr/bin/env node
2
+
3
+ // Shim for setImmediate
4
+ if (typeof setImmediate === 'undefined') {
5
+ window.setImmediate = function(callback) {
6
+ return setTimeout(callback, 0);
7
+ };
8
+ }
9
+
10
+ "use strict";var officeParser=(()=>{var P3=Object.create;var Ap=Object.defineProperty;var M3=Object.getOwnPropertyDescriptor;var B3=Object.getOwnPropertyNames;var F3=Object.getPrototypeOf,U3=Object.prototype.hasOwnProperty;var MT=r=>{throw TypeError(r)};var j3=(r,e,t)=>e in r?Ap(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var Au=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var Jt=(r,e)=>()=>(r&&(e=r(r=0)),e);var it=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Uo=(r,e)=>{for(var t in e)Ap(r,t,{get:e[t],enumerable:!0})},BT=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of B3(e))!U3.call(r,i)&&i!==t&&Ap(r,i,{get:()=>e[i],enumerable:!(n=M3(e,i))||n.enumerable});return r};var xu=(r,e,t)=>(t=r!=null?P3(F3(r)):{},BT(e||!r||!r.__esModule?Ap(t,"default",{value:r,enumerable:!0}):t,r)),Ir=r=>BT(Ap({},"__esModule",{value:!0}),r);var Ke=(r,e,t)=>j3(r,typeof e!="symbol"?e+"":e,t),h_=(r,e,t)=>e.has(r)||MT("Cannot "+t);var l=(r,e,t)=>(h_(r,e,"read from private field"),t?t.call(r):e.get(r)),q=(r,e,t)=>e.has(r)?MT("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),L=(r,e,t,n)=>(h_(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t),ee=(r,e,t)=>(h_(r,e,"access private method"),t);var tn=(r,e,t,n)=>({set _(i){L(r,e,i,t)},get _(){return l(r,e,n)}});var Ce=Jt(()=>{});var process={};Uo(process,{_debugEnd:()=>TC,_debugProcess:()=>SC,_events:()=>zC,_eventsCount:()=>WC,_exiting:()=>oC,_fatalExceptions:()=>_C,_getActiveHandles:()=>cC,_getActiveRequests:()=>uC,_kill:()=>hC,_linkedBinding:()=>iC,_maxListeners:()=>$C,_preload_modules:()=>FC,_rawDebug:()=>rC,_startProfilerIdleNotifier:()=>CC,_stopProfilerIdleNotifier:()=>RC,_tickCallback:()=>xC,abort:()=>NC,addListener:()=>qC,allowedNodeEnvironmentFlags:()=>bC,arch:()=>zT,argv:()=>HT,argv0:()=>BC,assert:()=>wC,binding:()=>KT,browser:()=>tC,chdir:()=>QT,config:()=>aC,cpuUsage:()=>y0,cwd:()=>JT,debugPort:()=>MC,default:()=>QC,dlopen:()=>lC,domain:()=>sC,emit:()=>XC,emitWarning:()=>XT,env:()=>qT,execArgv:()=>GT,execPath:()=>PC,exit:()=>mC,features:()=>vC,hasUncaughtExceptionCaptureCallback:()=>AC,hrtime:()=>m0,kill:()=>gC,listeners:()=>JC,memoryUsage:()=>pC,moduleLoadList:()=>nC,nextTick:()=>UT,off:()=>GC,on:()=>$o,once:()=>HC,openStdin:()=>yC,pid:()=>kC,platform:()=>WT,ppid:()=>LC,prependListener:()=>KC,prependOnceListener:()=>ZC,reallyExit:()=>fC,release:()=>eC,removeAllListeners:()=>YC,removeListener:()=>VC,resourceUsage:()=>dC,setSourceMapsEnabled:()=>UC,setUncaughtExceptionCaptureCallback:()=>EC,stderr:()=>IC,stdin:()=>OC,stdout:()=>DC,title:()=>$T,umask:()=>ZT,uptime:()=>jC,version:()=>VT,versions:()=>YT});function g_(r){throw new Error("Node.js process "+r+" is not supported by JSPM core outside of Node.js")}function $3(){!Mf||!Su||(Mf=!1,Su.length?jo=Su.concat(jo):g0=-1,jo.length&&FT())}function FT(){if(!Mf){var r=setTimeout($3,0);Mf=!0;for(var e=jo.length;e;){for(Su=jo,jo=[];++g0<e;)Su&&Su[g0].run();g0=-1,e=jo.length}Su=null,Mf=!1,clearTimeout(r)}}function UT(r){var e=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];jo.push(new jT(r,e)),jo.length===1&&!Mf&&setTimeout(FT,0)}function jT(r,e){this.fun=r,this.array=e}function Nn(){}function iC(r){g_("_linkedBinding")}function lC(r){g_("dlopen")}function uC(){return[]}function cC(){return[]}function wC(r,e){if(!r)throw new Error(e||"assertion error")}function AC(){return!1}function jC(){return sl.now()/1e3}function m0(r){var e=Math.floor((Date.now()-sl.now())*.001),t=sl.now()*.001,n=Math.floor(t)+e,i=Math.floor(t%1*1e9);return r&&(n=n-r[0],i=i-r[1],i<0&&(n--,i+=p_)),[n,i]}function $o(){return QC}function JC(r){return[]}var jo,Mf,Su,g0,$T,zT,WT,qT,HT,GT,VT,YT,XT,KT,ZT,JT,QT,eC,tC,rC,nC,sC,oC,aC,fC,hC,y0,dC,pC,gC,mC,yC,bC,vC,_C,EC,xC,SC,TC,CC,RC,DC,IC,OC,NC,kC,LC,PC,MC,BC,FC,UC,sl,d_,p_,$C,zC,WC,qC,HC,GC,VC,YC,XC,KC,ZC,QC,eR=Jt(()=>{Ce();De();Re();jo=[],Mf=!1,g0=-1;jT.prototype.run=function(){this.fun.apply(null,this.array)};$T="browser",zT="x64",WT="browser",qT={PATH:"/usr/bin",LANG:typeof navigator<"u"?navigator.language+".UTF-8":void 0,PWD:"/",HOME:"/home",TMP:"/tmp"},HT=["/usr/bin/node"],GT=[],VT="v16.8.0",YT={},XT=function(r,e){console.warn((e?e+": ":"")+r)},KT=function(r){g_("binding")},ZT=function(r){return 0},JT=function(){return"/"},QT=function(r){},eC={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};tC=!0,rC=Nn,nC=[];sC={},oC=!1,aC={};fC=Nn,hC=Nn,y0=function(){return{}},dC=y0,pC=y0,gC=Nn,mC=Nn,yC=Nn,bC={};vC={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},_C=Nn,EC=Nn;xC=Nn,SC=Nn,TC=Nn,CC=Nn,RC=Nn,DC=void 0,IC=void 0,OC=void 0,NC=Nn,kC=2,LC=1,PC="/bin/usr/node",MC=9229,BC="node",FC=[],UC=Nn,sl={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};sl.now===void 0&&(d_=Date.now(),sl.timing&&sl.timing.navigationStart&&(d_=sl.timing.navigationStart),sl.now=()=>Date.now()-d_);p_=1e9;m0.bigint=function(r){var e=m0(r);return typeof BigInt>"u"?e[0]*p_+e[1]:BigInt(e[0]*p_)+BigInt(e[1])};$C=10,zC={},WC=0;qC=$o,HC=$o,GC=$o,VC=$o,YC=$o,XC=Nn,KC=$o,ZC=$o;QC={version:VT,versions:YT,arch:zT,platform:WT,browser:tC,release:eC,_rawDebug:rC,moduleLoadList:nC,binding:KT,_linkedBinding:iC,_events:zC,_eventsCount:WC,_maxListeners:$C,on:$o,addListener:qC,once:HC,off:GC,removeListener:VC,removeAllListeners:YC,emit:XC,prependListener:KC,prependOnceListener:ZC,listeners:JC,domain:sC,_exiting:oC,config:aC,dlopen:lC,uptime:jC,_getActiveRequests:uC,_getActiveHandles:cC,reallyExit:fC,_kill:hC,cpuUsage:y0,resourceUsage:dC,memoryUsage:pC,kill:gC,exit:mC,openStdin:yC,allowedNodeEnvironmentFlags:bC,assert:wC,features:vC,_fatalExceptions:_C,setUncaughtExceptionCaptureCallback:EC,hasUncaughtExceptionCaptureCallback:AC,emitWarning:XT,nextTick:UT,_tickCallback:xC,_debugProcess:SC,_debugEnd:TC,_startProfilerIdleNotifier:CC,_stopProfilerIdleNotifier:RC,stdout:DC,stdin:OC,stderr:IC,abort:NC,umask:ZT,chdir:QT,cwd:JT,env:qT,title:$T,argv:HT,execArgv:GT,pid:kC,ppid:LC,execPath:PC,debugPort:MC,hrtime:m0,argv0:BC,_preload_modules:FC,setSourceMapsEnabled:UC}});var Re=Jt(()=>{eR()});function z3(){if(tR)return xp;tR=!0,xp.byteLength=a,xp.toByteArray=c,xp.fromByteArray=p;for(var r=[],e=[],t=typeof Uint8Array<"u"?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,o=n.length;i<o;++i)r[i]=n[i],e[n.charCodeAt(i)]=i;e[45]=62,e[95]=63;function s(m){var b=m.length;if(b%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var v=m.indexOf("=");v===-1&&(v=b);var w=v===b?0:4-v%4;return[v,w]}function a(m){var b=s(m),v=b[0],w=b[1];return(v+w)*3/4-w}function u(m,b,v){return(b+v)*3/4-v}function c(m){var b,v=s(m),w=v[0],y=v[1],_=new t(u(m,w,y)),E=0,S=y>0?w-4:w,A;for(A=0;A<S;A+=4)b=e[m.charCodeAt(A)]<<18|e[m.charCodeAt(A+1)]<<12|e[m.charCodeAt(A+2)]<<6|e[m.charCodeAt(A+3)],_[E++]=b>>16&255,_[E++]=b>>8&255,_[E++]=b&255;return y===2&&(b=e[m.charCodeAt(A)]<<2|e[m.charCodeAt(A+1)]>>4,_[E++]=b&255),y===1&&(b=e[m.charCodeAt(A)]<<10|e[m.charCodeAt(A+1)]<<4|e[m.charCodeAt(A+2)]>>2,_[E++]=b>>8&255,_[E++]=b&255),_}function f(m){return r[m>>18&63]+r[m>>12&63]+r[m>>6&63]+r[m&63]}function h(m,b,v){for(var w,y=[],_=b;_<v;_+=3)w=(m[_]<<16&16711680)+(m[_+1]<<8&65280)+(m[_+2]&255),y.push(f(w));return y.join("")}function p(m){for(var b,v=m.length,w=v%3,y=[],_=16383,E=0,S=v-w;E<S;E+=_)y.push(h(m,E,E+_>S?S:E+_));return w===1?(b=m[v-1],y.push(r[b>>2]+r[b<<4&63]+"==")):w===2&&(b=(m[v-2]<<8)+m[v-1],y.push(r[b>>10]+r[b>>4&63]+r[b<<2&63]+"=")),y.join("")}return xp}function W3(){if(rR)return b0;rR=!0;return b0.read=function(r,e,t,n,i){var o,s,a=i*8-n-1,u=(1<<a)-1,c=u>>1,f=-7,h=t?i-1:0,p=t?-1:1,m=r[e+h];for(h+=p,o=m&(1<<-f)-1,m>>=-f,f+=a;f>0;o=o*256+r[e+h],h+=p,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=s*256+r[e+h],h+=p,f-=8);if(o===0)o=1-c;else{if(o===u)return s?NaN:(m?-1:1)*(1/0);s=s+Math.pow(2,n),o=o-c}return(m?-1:1)*s*Math.pow(2,o-n)},b0.write=function(r,e,t,n,i,o){var s,a,u,c=o*8-i-1,f=(1<<c)-1,h=f>>1,p=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:o-1,b=n?1:-1,v=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),s+h>=1?e+=p/u:e+=p*Math.pow(2,1-h),e*u>=2&&(s++,u/=2),s+h>=f?(a=0,s=f):s+h>=1?(a=(e*u-1)*Math.pow(2,i),s=s+h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;r[t+m]=a&255,m+=b,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;r[t+m]=s&255,m+=b,s/=256,c-=8);r[t+m-b]|=v*128},b0}function fn(){if(nR)return Tu;nR=!0;let r=z3(),e=W3(),t=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Tu.Buffer=s,Tu.SlowBuffer=y,Tu.INSPECT_MAX_BYTES=50;let n=2147483647;Tu.kMaxLength=n,s.TYPED_ARRAY_SUPPORT=i(),!s.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function i(){try{let T=new Uint8Array(1),d={foo:function(){return 42}};return Object.setPrototypeOf(d,Uint8Array.prototype),Object.setPrototypeOf(T,d),T.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function o(T){if(T>n)throw new RangeError('The value "'+T+'" is invalid for option "size"');let d=new Uint8Array(T);return Object.setPrototypeOf(d,s.prototype),d}function s(T,d,g){if(typeof T=="number"){if(typeof d=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return f(T)}return a(T,d,g)}s.poolSize=8192;function a(T,d,g){if(typeof T=="string")return h(T,d);if(ArrayBuffer.isView(T))return m(T);if(T==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T);if(ke(T,ArrayBuffer)||T&&ke(T.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ke(T,SharedArrayBuffer)||T&&ke(T.buffer,SharedArrayBuffer)))return b(T,d,g);if(typeof T=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let I=T.valueOf&&T.valueOf();if(I!=null&&I!==T)return s.from(I,d,g);let Z=v(T);if(Z)return Z;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof T[Symbol.toPrimitive]=="function")return s.from(T[Symbol.toPrimitive]("string"),d,g);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T)}s.from=function(T,d,g){return a(T,d,g)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function u(T){if(typeof T!="number")throw new TypeError('"size" argument must be of type number');if(T<0)throw new RangeError('The value "'+T+'" is invalid for option "size"')}function c(T,d,g){return u(T),T<=0?o(T):d!==void 0?typeof g=="string"?o(T).fill(d,g):o(T).fill(d):o(T)}s.alloc=function(T,d,g){return c(T,d,g)};function f(T){return u(T),o(T<0?0:w(T)|0)}s.allocUnsafe=function(T){return f(T)},s.allocUnsafeSlow=function(T){return f(T)};function h(T,d){if((typeof d!="string"||d==="")&&(d="utf8"),!s.isEncoding(d))throw new TypeError("Unknown encoding: "+d);let g=_(T,d)|0,I=o(g),Z=I.write(T,d);return Z!==g&&(I=I.slice(0,Z)),I}function p(T){let d=T.length<0?0:w(T.length)|0,g=o(d);for(let I=0;I<d;I+=1)g[I]=T[I]&255;return g}function m(T){if(ke(T,Uint8Array)){let d=new Uint8Array(T);return b(d.buffer,d.byteOffset,d.byteLength)}return p(T)}function b(T,d,g){if(d<0||T.byteLength<d)throw new RangeError('"offset" is outside of buffer bounds');if(T.byteLength<d+(g||0))throw new RangeError('"length" is outside of buffer bounds');let I;return d===void 0&&g===void 0?I=new Uint8Array(T):g===void 0?I=new Uint8Array(T,d):I=new Uint8Array(T,d,g),Object.setPrototypeOf(I,s.prototype),I}function v(T){if(s.isBuffer(T)){let d=w(T.length)|0,g=o(d);return g.length===0||T.copy(g,0,0,d),g}if(T.length!==void 0)return typeof T.length!="number"||Oe(T.length)?o(0):p(T);if(T.type==="Buffer"&&Array.isArray(T.data))return p(T.data)}function w(T){if(T>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return T|0}function y(T){return+T!=T&&(T=0),s.alloc(+T)}s.isBuffer=function(d){return d!=null&&d._isBuffer===!0&&d!==s.prototype},s.compare=function(d,g){if(ke(d,Uint8Array)&&(d=s.from(d,d.offset,d.byteLength)),ke(g,Uint8Array)&&(g=s.from(g,g.offset,g.byteLength)),!s.isBuffer(d)||!s.isBuffer(g))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(d===g)return 0;let I=d.length,Z=g.length;for(let R=0,le=Math.min(I,Z);R<le;++R)if(d[R]!==g[R]){I=d[R],Z=g[R];break}return I<Z?-1:Z<I?1:0},s.isEncoding=function(d){switch(String(d).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(d,g){if(!Array.isArray(d))throw new TypeError('"list" argument must be an Array of Buffers');if(d.length===0)return s.alloc(0);let I;if(g===void 0)for(g=0,I=0;I<d.length;++I)g+=d[I].length;let Z=s.allocUnsafe(g),R=0;for(I=0;I<d.length;++I){let le=d[I];if(ke(le,Uint8Array))R+le.length>Z.length?(s.isBuffer(le)||(le=s.from(le)),le.copy(Z,R)):Uint8Array.prototype.set.call(Z,le,R);else if(s.isBuffer(le))le.copy(Z,R);else throw new TypeError('"list" argument must be an Array of Buffers');R+=le.length}return Z};function _(T,d){if(s.isBuffer(T))return T.length;if(ArrayBuffer.isView(T)||ke(T,ArrayBuffer))return T.byteLength;if(typeof T!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof T);let g=T.length,I=arguments.length>2&&arguments[2]===!0;if(!I&&g===0)return 0;let Z=!1;for(;;)switch(d){case"ascii":case"latin1":case"binary":return g;case"utf8":case"utf-8":return Se(T).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return g*2;case"hex":return g>>>1;case"base64":return Ae(T).length;default:if(Z)return I?-1:Se(T).length;d=(""+d).toLowerCase(),Z=!0}}s.byteLength=_;function E(T,d,g){let I=!1;if((d===void 0||d<0)&&(d=0),d>this.length||((g===void 0||g>this.length)&&(g=this.length),g<=0)||(g>>>=0,d>>>=0,g<=d))return"";for(T||(T="utf8");;)switch(T){case"hex":return x(this,d,g);case"utf8":case"utf-8":return $(this,d,g);case"ascii":return re(this,d,g);case"latin1":case"binary":return N(this,d,g);case"base64":return k(this,d,g);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,d,g);default:if(I)throw new TypeError("Unknown encoding: "+T);T=(T+"").toLowerCase(),I=!0}}s.prototype._isBuffer=!0;function S(T,d,g){let I=T[d];T[d]=T[g],T[g]=I}s.prototype.swap16=function(){let d=this.length;if(d%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let g=0;g<d;g+=2)S(this,g,g+1);return this},s.prototype.swap32=function(){let d=this.length;if(d%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let g=0;g<d;g+=4)S(this,g,g+3),S(this,g+1,g+2);return this},s.prototype.swap64=function(){let d=this.length;if(d%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let g=0;g<d;g+=8)S(this,g,g+7),S(this,g+1,g+6),S(this,g+2,g+5),S(this,g+3,g+4);return this},s.prototype.toString=function(){let d=this.length;return d===0?"":arguments.length===0?$(this,0,d):E.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(d){if(!s.isBuffer(d))throw new TypeError("Argument must be a Buffer");return this===d?!0:s.compare(this,d)===0},s.prototype.inspect=function(){let d="",g=Tu.INSPECT_MAX_BYTES;return d=this.toString("hex",0,g).replace(/(.{2})/g,"$1 ").trim(),this.length>g&&(d+=" ... "),"<Buffer "+d+">"},t&&(s.prototype[t]=s.prototype.inspect),s.prototype.compare=function(d,g,I,Z,R){if(ke(d,Uint8Array)&&(d=s.from(d,d.offset,d.byteLength)),!s.isBuffer(d))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof d);if(g===void 0&&(g=0),I===void 0&&(I=d?d.length:0),Z===void 0&&(Z=0),R===void 0&&(R=this.length),g<0||I>d.length||Z<0||R>this.length)throw new RangeError("out of range index");if(Z>=R&&g>=I)return 0;if(Z>=R)return-1;if(g>=I)return 1;if(g>>>=0,I>>>=0,Z>>>=0,R>>>=0,this===d)return 0;let le=R-Z,pe=I-g,Ee=Math.min(le,pe),ve=this.slice(Z,R),Ie=d.slice(g,I);for(let V=0;V<Ee;++V)if(ve[V]!==Ie[V]){le=ve[V],pe=Ie[V];break}return le<pe?-1:pe<le?1:0};function A(T,d,g,I,Z){if(T.length===0)return-1;if(typeof g=="string"?(I=g,g=0):g>2147483647?g=2147483647:g<-2147483648&&(g=-2147483648),g=+g,Oe(g)&&(g=Z?0:T.length-1),g<0&&(g=T.length+g),g>=T.length){if(Z)return-1;g=T.length-1}else if(g<0)if(Z)g=0;else return-1;if(typeof d=="string"&&(d=s.from(d,I)),s.isBuffer(d))return d.length===0?-1:F(T,d,g,I,Z);if(typeof d=="number")return d=d&255,typeof Uint8Array.prototype.indexOf=="function"?Z?Uint8Array.prototype.indexOf.call(T,d,g):Uint8Array.prototype.lastIndexOf.call(T,d,g):F(T,[d],g,I,Z);throw new TypeError("val must be string, number or Buffer")}function F(T,d,g,I,Z){let R=1,le=T.length,pe=d.length;if(I!==void 0&&(I=String(I).toLowerCase(),I==="ucs2"||I==="ucs-2"||I==="utf16le"||I==="utf-16le")){if(T.length<2||d.length<2)return-1;R=2,le/=2,pe/=2,g/=2}function Ee(Ie,V){return R===1?Ie[V]:Ie.readUInt16BE(V*R)}let ve;if(Z){let Ie=-1;for(ve=g;ve<le;ve++)if(Ee(T,ve)===Ee(d,Ie===-1?0:ve-Ie)){if(Ie===-1&&(Ie=ve),ve-Ie+1===pe)return Ie*R}else Ie!==-1&&(ve-=ve-Ie),Ie=-1}else for(g+pe>le&&(g=le-pe),ve=g;ve>=0;ve--){let Ie=!0;for(let V=0;V<pe;V++)if(Ee(T,ve+V)!==Ee(d,V)){Ie=!1;break}if(Ie)return ve}return-1}s.prototype.includes=function(d,g,I){return this.indexOf(d,g,I)!==-1},s.prototype.indexOf=function(d,g,I){return A(this,d,g,I,!0)},s.prototype.lastIndexOf=function(d,g,I){return A(this,d,g,I,!1)};function D(T,d,g,I){g=Number(g)||0;let Z=T.length-g;I?(I=Number(I),I>Z&&(I=Z)):I=Z;let R=d.length;I>R/2&&(I=R/2);let le;for(le=0;le<I;++le){let pe=parseInt(d.substr(le*2,2),16);if(Oe(pe))return le;T[g+le]=pe}return le}function H(T,d,g,I){return je(Se(d,T.length-g),T,g,I)}function J(T,d,g,I){return je(we(d),T,g,I)}function K(T,d,g,I){return je(Ae(d),T,g,I)}function ne(T,d,g,I){return je(de(d,T.length-g),T,g,I)}s.prototype.write=function(d,g,I,Z){if(g===void 0)Z="utf8",I=this.length,g=0;else if(I===void 0&&typeof g=="string")Z=g,I=this.length,g=0;else if(isFinite(g))g=g>>>0,isFinite(I)?(I=I>>>0,Z===void 0&&(Z="utf8")):(Z=I,I=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let R=this.length-g;if((I===void 0||I>R)&&(I=R),d.length>0&&(I<0||g<0)||g>this.length)throw new RangeError("Attempt to write outside buffer bounds");Z||(Z="utf8");let le=!1;for(;;)switch(Z){case"hex":return D(this,d,g,I);case"utf8":case"utf-8":return H(this,d,g,I);case"ascii":case"latin1":case"binary":return J(this,d,g,I);case"base64":return K(this,d,g,I);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ne(this,d,g,I);default:if(le)throw new TypeError("Unknown encoding: "+Z);Z=(""+Z).toLowerCase(),le=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function k(T,d,g){return d===0&&g===T.length?r.fromByteArray(T):r.fromByteArray(T.slice(d,g))}function $(T,d,g){g=Math.min(T.length,g);let I=[],Z=d;for(;Z<g;){let R=T[Z],le=null,pe=R>239?4:R>223?3:R>191?2:1;if(Z+pe<=g){let Ee,ve,Ie,V;switch(pe){case 1:R<128&&(le=R);break;case 2:Ee=T[Z+1],(Ee&192)===128&&(V=(R&31)<<6|Ee&63,V>127&&(le=V));break;case 3:Ee=T[Z+1],ve=T[Z+2],(Ee&192)===128&&(ve&192)===128&&(V=(R&15)<<12|(Ee&63)<<6|ve&63,V>2047&&(V<55296||V>57343)&&(le=V));break;case 4:Ee=T[Z+1],ve=T[Z+2],Ie=T[Z+3],(Ee&192)===128&&(ve&192)===128&&(Ie&192)===128&&(V=(R&15)<<18|(Ee&63)<<12|(ve&63)<<6|Ie&63,V>65535&&V<1114112&&(le=V))}}le===null?(le=65533,pe=1):le>65535&&(le-=65536,I.push(le>>>10&1023|55296),le=56320|le&1023),I.push(le),Z+=pe}return ie(I)}let Y=4096;function ie(T){let d=T.length;if(d<=Y)return String.fromCharCode.apply(String,T);let g="",I=0;for(;I<d;)g+=String.fromCharCode.apply(String,T.slice(I,I+=Y));return g}function re(T,d,g){let I="";g=Math.min(T.length,g);for(let Z=d;Z<g;++Z)I+=String.fromCharCode(T[Z]&127);return I}function N(T,d,g){let I="";g=Math.min(T.length,g);for(let Z=d;Z<g;++Z)I+=String.fromCharCode(T[Z]);return I}function x(T,d,g){let I=T.length;(!d||d<0)&&(d=0),(!g||g<0||g>I)&&(g=I);let Z="";for(let R=d;R<g;++R)Z+=Ve[T[R]];return Z}function P(T,d,g){let I=T.slice(d,g),Z="";for(let R=0;R<I.length-1;R+=2)Z+=String.fromCharCode(I[R]+I[R+1]*256);return Z}s.prototype.slice=function(d,g){let I=this.length;d=~~d,g=g===void 0?I:~~g,d<0?(d+=I,d<0&&(d=0)):d>I&&(d=I),g<0?(g+=I,g<0&&(g=0)):g>I&&(g=I),g<d&&(g=d);let Z=this.subarray(d,g);return Object.setPrototypeOf(Z,s.prototype),Z};function C(T,d,g){if(T%1!==0||T<0)throw new RangeError("offset is not uint");if(T+d>g)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(d,g,I){d=d>>>0,g=g>>>0,I||C(d,g,this.length);let Z=this[d],R=1,le=0;for(;++le<g&&(R*=256);)Z+=this[d+le]*R;return Z},s.prototype.readUintBE=s.prototype.readUIntBE=function(d,g,I){d=d>>>0,g=g>>>0,I||C(d,g,this.length);let Z=this[d+--g],R=1;for(;g>0&&(R*=256);)Z+=this[d+--g]*R;return Z},s.prototype.readUint8=s.prototype.readUInt8=function(d,g){return d=d>>>0,g||C(d,1,this.length),this[d]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(d,g){return d=d>>>0,g||C(d,2,this.length),this[d]|this[d+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(d,g){return d=d>>>0,g||C(d,2,this.length),this[d]<<8|this[d+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(d,g){return d=d>>>0,g||C(d,4,this.length),(this[d]|this[d+1]<<8|this[d+2]<<16)+this[d+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(d,g){return d=d>>>0,g||C(d,4,this.length),this[d]*16777216+(this[d+1]<<16|this[d+2]<<8|this[d+3])},s.prototype.readBigUInt64LE=Je(function(d){d=d>>>0,X(d,"offset");let g=this[d],I=this[d+7];(g===void 0||I===void 0)&&M(d,this.length-8);let Z=g+this[++d]*2**8+this[++d]*2**16+this[++d]*2**24,R=this[++d]+this[++d]*2**8+this[++d]*2**16+I*2**24;return BigInt(Z)+(BigInt(R)<<BigInt(32))}),s.prototype.readBigUInt64BE=Je(function(d){d=d>>>0,X(d,"offset");let g=this[d],I=this[d+7];(g===void 0||I===void 0)&&M(d,this.length-8);let Z=g*2**24+this[++d]*2**16+this[++d]*2**8+this[++d],R=this[++d]*2**24+this[++d]*2**16+this[++d]*2**8+I;return(BigInt(Z)<<BigInt(32))+BigInt(R)}),s.prototype.readIntLE=function(d,g,I){d=d>>>0,g=g>>>0,I||C(d,g,this.length);let Z=this[d],R=1,le=0;for(;++le<g&&(R*=256);)Z+=this[d+le]*R;return R*=128,Z>=R&&(Z-=Math.pow(2,8*g)),Z},s.prototype.readIntBE=function(d,g,I){d=d>>>0,g=g>>>0,I||C(d,g,this.length);let Z=g,R=1,le=this[d+--Z];for(;Z>0&&(R*=256);)le+=this[d+--Z]*R;return R*=128,le>=R&&(le-=Math.pow(2,8*g)),le},s.prototype.readInt8=function(d,g){return d=d>>>0,g||C(d,1,this.length),this[d]&128?(255-this[d]+1)*-1:this[d]},s.prototype.readInt16LE=function(d,g){d=d>>>0,g||C(d,2,this.length);let I=this[d]|this[d+1]<<8;return I&32768?I|4294901760:I},s.prototype.readInt16BE=function(d,g){d=d>>>0,g||C(d,2,this.length);let I=this[d+1]|this[d]<<8;return I&32768?I|4294901760:I},s.prototype.readInt32LE=function(d,g){return d=d>>>0,g||C(d,4,this.length),this[d]|this[d+1]<<8|this[d+2]<<16|this[d+3]<<24},s.prototype.readInt32BE=function(d,g){return d=d>>>0,g||C(d,4,this.length),this[d]<<24|this[d+1]<<16|this[d+2]<<8|this[d+3]},s.prototype.readBigInt64LE=Je(function(d){d=d>>>0,X(d,"offset");let g=this[d],I=this[d+7];(g===void 0||I===void 0)&&M(d,this.length-8);let Z=this[d+4]+this[d+5]*2**8+this[d+6]*2**16+(I<<24);return(BigInt(Z)<<BigInt(32))+BigInt(g+this[++d]*2**8+this[++d]*2**16+this[++d]*2**24)}),s.prototype.readBigInt64BE=Je(function(d){d=d>>>0,X(d,"offset");let g=this[d],I=this[d+7];(g===void 0||I===void 0)&&M(d,this.length-8);let Z=(g<<24)+this[++d]*2**16+this[++d]*2**8+this[++d];return(BigInt(Z)<<BigInt(32))+BigInt(this[++d]*2**24+this[++d]*2**16+this[++d]*2**8+I)}),s.prototype.readFloatLE=function(d,g){return d=d>>>0,g||C(d,4,this.length),e.read(this,d,!0,23,4)},s.prototype.readFloatBE=function(d,g){return d=d>>>0,g||C(d,4,this.length),e.read(this,d,!1,23,4)},s.prototype.readDoubleLE=function(d,g){return d=d>>>0,g||C(d,8,this.length),e.read(this,d,!0,52,8)},s.prototype.readDoubleBE=function(d,g){return d=d>>>0,g||C(d,8,this.length),e.read(this,d,!1,52,8)};function j(T,d,g,I,Z,R){if(!s.isBuffer(T))throw new TypeError('"buffer" argument must be a Buffer instance');if(d>Z||d<R)throw new RangeError('"value" argument is out of bounds');if(g+I>T.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(d,g,I,Z){if(d=+d,g=g>>>0,I=I>>>0,!Z){let pe=Math.pow(2,8*I)-1;j(this,d,g,I,pe,0)}let R=1,le=0;for(this[g]=d&255;++le<I&&(R*=256);)this[g+le]=d/R&255;return g+I},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(d,g,I,Z){if(d=+d,g=g>>>0,I=I>>>0,!Z){let pe=Math.pow(2,8*I)-1;j(this,d,g,I,pe,0)}let R=I-1,le=1;for(this[g+R]=d&255;--R>=0&&(le*=256);)this[g+R]=d/le&255;return g+I},s.prototype.writeUint8=s.prototype.writeUInt8=function(d,g,I){return d=+d,g=g>>>0,I||j(this,d,g,1,255,0),this[g]=d&255,g+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(d,g,I){return d=+d,g=g>>>0,I||j(this,d,g,2,65535,0),this[g]=d&255,this[g+1]=d>>>8,g+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(d,g,I){return d=+d,g=g>>>0,I||j(this,d,g,2,65535,0),this[g]=d>>>8,this[g+1]=d&255,g+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(d,g,I){return d=+d,g=g>>>0,I||j(this,d,g,4,4294967295,0),this[g+3]=d>>>24,this[g+2]=d>>>16,this[g+1]=d>>>8,this[g]=d&255,g+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(d,g,I){return d=+d,g=g>>>0,I||j(this,d,g,4,4294967295,0),this[g]=d>>>24,this[g+1]=d>>>16,this[g+2]=d>>>8,this[g+3]=d&255,g+4};function U(T,d,g,I,Z){xe(d,I,Z,T,g,7);let R=Number(d&BigInt(4294967295));T[g++]=R,R=R>>8,T[g++]=R,R=R>>8,T[g++]=R,R=R>>8,T[g++]=R;let le=Number(d>>BigInt(32)&BigInt(4294967295));return T[g++]=le,le=le>>8,T[g++]=le,le=le>>8,T[g++]=le,le=le>>8,T[g++]=le,g}function B(T,d,g,I,Z){xe(d,I,Z,T,g,7);let R=Number(d&BigInt(4294967295));T[g+7]=R,R=R>>8,T[g+6]=R,R=R>>8,T[g+5]=R,R=R>>8,T[g+4]=R;let le=Number(d>>BigInt(32)&BigInt(4294967295));return T[g+3]=le,le=le>>8,T[g+2]=le,le=le>>8,T[g+1]=le,le=le>>8,T[g]=le,g+8}s.prototype.writeBigUInt64LE=Je(function(d,g=0){return U(this,d,g,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeBigUInt64BE=Je(function(d,g=0){return B(this,d,g,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeIntLE=function(d,g,I,Z){if(d=+d,g=g>>>0,!Z){let Ee=Math.pow(2,8*I-1);j(this,d,g,I,Ee-1,-Ee)}let R=0,le=1,pe=0;for(this[g]=d&255;++R<I&&(le*=256);)d<0&&pe===0&&this[g+R-1]!==0&&(pe=1),this[g+R]=(d/le>>0)-pe&255;return g+I},s.prototype.writeIntBE=function(d,g,I,Z){if(d=+d,g=g>>>0,!Z){let Ee=Math.pow(2,8*I-1);j(this,d,g,I,Ee-1,-Ee)}let R=I-1,le=1,pe=0;for(this[g+R]=d&255;--R>=0&&(le*=256);)d<0&&pe===0&&this[g+R+1]!==0&&(pe=1),this[g+R]=(d/le>>0)-pe&255;return g+I},s.prototype.writeInt8=function(d,g,I){return d=+d,g=g>>>0,I||j(this,d,g,1,127,-128),d<0&&(d=255+d+1),this[g]=d&255,g+1},s.prototype.writeInt16LE=function(d,g,I){return d=+d,g=g>>>0,I||j(this,d,g,2,32767,-32768),this[g]=d&255,this[g+1]=d>>>8,g+2},s.prototype.writeInt16BE=function(d,g,I){return d=+d,g=g>>>0,I||j(this,d,g,2,32767,-32768),this[g]=d>>>8,this[g+1]=d&255,g+2},s.prototype.writeInt32LE=function(d,g,I){return d=+d,g=g>>>0,I||j(this,d,g,4,2147483647,-2147483648),this[g]=d&255,this[g+1]=d>>>8,this[g+2]=d>>>16,this[g+3]=d>>>24,g+4},s.prototype.writeInt32BE=function(d,g,I){return d=+d,g=g>>>0,I||j(this,d,g,4,2147483647,-2147483648),d<0&&(d=4294967295+d+1),this[g]=d>>>24,this[g+1]=d>>>16,this[g+2]=d>>>8,this[g+3]=d&255,g+4},s.prototype.writeBigInt64LE=Je(function(d,g=0){return U(this,d,g,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeBigInt64BE=Je(function(d,g=0){return B(this,d,g,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Q(T,d,g,I,Z,R){if(g+I>T.length)throw new RangeError("Index out of range");if(g<0)throw new RangeError("Index out of range")}function fe(T,d,g,I,Z){return d=+d,g=g>>>0,Z||Q(T,d,g,4),e.write(T,d,g,I,23,4),g+4}s.prototype.writeFloatLE=function(d,g,I){return fe(this,d,g,!0,I)},s.prototype.writeFloatBE=function(d,g,I){return fe(this,d,g,!1,I)};function _e(T,d,g,I,Z){return d=+d,g=g>>>0,Z||Q(T,d,g,8),e.write(T,d,g,I,52,8),g+8}s.prototype.writeDoubleLE=function(d,g,I){return _e(this,d,g,!0,I)},s.prototype.writeDoubleBE=function(d,g,I){return _e(this,d,g,!1,I)},s.prototype.copy=function(d,g,I,Z){if(!s.isBuffer(d))throw new TypeError("argument should be a Buffer");if(I||(I=0),!Z&&Z!==0&&(Z=this.length),g>=d.length&&(g=d.length),g||(g=0),Z>0&&Z<I&&(Z=I),Z===I||d.length===0||this.length===0)return 0;if(g<0)throw new RangeError("targetStart out of bounds");if(I<0||I>=this.length)throw new RangeError("Index out of range");if(Z<0)throw new RangeError("sourceEnd out of bounds");Z>this.length&&(Z=this.length),d.length-g<Z-I&&(Z=d.length-g+I);let R=Z-I;return this===d&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(g,I,Z):Uint8Array.prototype.set.call(d,this.subarray(I,Z),g),R},s.prototype.fill=function(d,g,I,Z){if(typeof d=="string"){if(typeof g=="string"?(Z=g,g=0,I=this.length):typeof I=="string"&&(Z=I,I=this.length),Z!==void 0&&typeof Z!="string")throw new TypeError("encoding must be a string");if(typeof Z=="string"&&!s.isEncoding(Z))throw new TypeError("Unknown encoding: "+Z);if(d.length===1){let le=d.charCodeAt(0);(Z==="utf8"&&le<128||Z==="latin1")&&(d=le)}}else typeof d=="number"?d=d&255:typeof d=="boolean"&&(d=Number(d));if(g<0||this.length<g||this.length<I)throw new RangeError("Out of range index");if(I<=g)return this;g=g>>>0,I=I===void 0?this.length:I>>>0,d||(d=0);let R;if(typeof d=="number")for(R=g;R<I;++R)this[R]=d;else{let le=s.isBuffer(d)?d:s.from(d,Z),pe=le.length;if(pe===0)throw new TypeError('The value "'+d+'" is invalid for argument "value"');for(R=0;R<I-g;++R)this[R+g]=le[R%pe]}return this};let te={};function W(T,d,g){te[T]=class extends g{constructor(){super(),Object.defineProperty(this,"message",{value:d.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${T}]`,this.stack,delete this.name}get code(){return T}set code(Z){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:Z,writable:!0})}toString(){return`${this.name} [${T}]: ${this.message}`}}}W("ERR_BUFFER_OUT_OF_BOUNDS",function(T){return T?`${T} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),W("ERR_INVALID_ARG_TYPE",function(T,d){return`The "${T}" argument must be of type number. Received type ${typeof d}`},TypeError),W("ERR_OUT_OF_RANGE",function(T,d,g){let I=`The value of "${T}" is out of range.`,Z=g;return Number.isInteger(g)&&Math.abs(g)>2**32?Z=oe(String(g)):typeof g=="bigint"&&(Z=String(g),(g>BigInt(2)**BigInt(32)||g<-(BigInt(2)**BigInt(32)))&&(Z=oe(Z)),Z+="n"),I+=` It must be ${d}. Received ${Z}`,I},RangeError);function oe(T){let d="",g=T.length,I=T[0]==="-"?1:0;for(;g>=I+4;g-=3)d=`_${T.slice(g-3,g)}${d}`;return`${T.slice(0,g)}${d}`}function be(T,d,g){X(d,"offset"),(T[d]===void 0||T[d+g]===void 0)&&M(d,T.length-(g+1))}function xe(T,d,g,I,Z,R){if(T>g||T<d){let le=typeof d=="bigint"?"n":"",pe;throw d===0||d===BigInt(0)?pe=`>= 0${le} and < 2${le} ** ${(R+1)*8}${le}`:pe=`>= -(2${le} ** ${(R+1)*8-1}${le}) and < 2 ** ${(R+1)*8-1}${le}`,new te.ERR_OUT_OF_RANGE("value",pe,T)}be(I,Z,R)}function X(T,d){if(typeof T!="number")throw new te.ERR_INVALID_ARG_TYPE(d,"number",T)}function M(T,d,g){throw Math.floor(T)!==T?(X(T,g),new te.ERR_OUT_OF_RANGE("offset","an integer",T)):d<0?new te.ERR_BUFFER_OUT_OF_BOUNDS:new te.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${d}`,T)}let ae=/[^+/0-9A-Za-z-_]/g;function ge(T){if(T=T.split("=")[0],T=T.trim().replace(ae,""),T.length<2)return"";for(;T.length%4!==0;)T=T+"=";return T}function Se(T,d){d=d||1/0;let g,I=T.length,Z=null,R=[];for(let le=0;le<I;++le){if(g=T.charCodeAt(le),g>55295&&g<57344){if(!Z){if(g>56319){(d-=3)>-1&&R.push(239,191,189);continue}else if(le+1===I){(d-=3)>-1&&R.push(239,191,189);continue}Z=g;continue}if(g<56320){(d-=3)>-1&&R.push(239,191,189),Z=g;continue}g=(Z-55296<<10|g-56320)+65536}else Z&&(d-=3)>-1&&R.push(239,191,189);if(Z=null,g<128){if((d-=1)<0)break;R.push(g)}else if(g<2048){if((d-=2)<0)break;R.push(g>>6|192,g&63|128)}else if(g<65536){if((d-=3)<0)break;R.push(g>>12|224,g>>6&63|128,g&63|128)}else if(g<1114112){if((d-=4)<0)break;R.push(g>>18|240,g>>12&63|128,g>>6&63|128,g&63|128)}else throw new Error("Invalid code point")}return R}function we(T){let d=[];for(let g=0;g<T.length;++g)d.push(T.charCodeAt(g)&255);return d}function de(T,d){let g,I,Z,R=[];for(let le=0;le<T.length&&!((d-=2)<0);++le)g=T.charCodeAt(le),I=g>>8,Z=g%256,R.push(Z),R.push(I);return R}function Ae(T){return r.toByteArray(ge(T))}function je(T,d,g,I){let Z;for(Z=0;Z<I&&!(Z+g>=d.length||Z>=T.length);++Z)d[Z+g]=T[Z];return Z}function ke(T,d){return T instanceof d||T!=null&&T.constructor!=null&&T.constructor.name!=null&&T.constructor.name===d.name}function Oe(T){return T!==T}let Ve=(function(){let T="0123456789abcdef",d=new Array(256);for(let g=0;g<16;++g){let I=g*16;for(let Z=0;Z<16;++Z)d[I+Z]=T[g]+T[Z]}return d})();function Je(T){return typeof BigInt>"u"?et:T}function et(){throw new Error("BigInt not supported")}return Tu}var xp,tR,b0,rR,Tu,nR,Bf=Jt(()=>{Ce();De();Re();xp={},tR=!1;b0={},rR=!1;Tu={},nR=!1});var Ff={};Uo(Ff,{Buffer:()=>Buffer,INSPECT_MAX_BYTES:()=>q3,default:()=>ol,kMaxLength:()=>H3});var ol,Buffer,q3,H3,al=Jt(()=>{Ce();De();Re();Bf();ol=fn();ol.Buffer;ol.SlowBuffer;ol.INSPECT_MAX_BYTES;ol.kMaxLength;Buffer=ol.Buffer,q3=ol.INSPECT_MAX_BYTES,H3=ol.kMaxLength});var De=Jt(()=>{al()});function v_(){throw new Error("setTimeout has not been defined")}function __(){throw new Error("clearTimeout has not been defined")}function yR(r){if(Wo===setTimeout)return setTimeout(r,0);if((Wo===v_||!Wo)&&setTimeout)return Wo=setTimeout,setTimeout(r,0);try{return Wo(r,0)}catch{try{return Wo.call(null,r,0)}catch{return Wo.call(this||jf,r,0)}}}function G3(){Uf&&Ru&&(Uf=!1,Ru.length?Ho=Ru.concat(Ho):x0=-1,Ho.length&&bR())}function bR(){if(!Uf){var r=yR(G3);Uf=!0;for(var e=Ho.length;e;){for(Ru=Ho,Ho=[];++x0<e;)Ru&&Ru[x0].run();x0=-1,e=Ho.length}Ru=null,Uf=!1,(function(t){if(qo===clearTimeout)return clearTimeout(t);if((qo===__||!qo)&&clearTimeout)return qo=clearTimeout,clearTimeout(t);try{qo(t)}catch{try{return qo.call(null,t)}catch{return qo.call(this||jf,t)}}})(r)}}function iR(r,e){(this||jf).fun=r,(this||jf).array=e}function zo(){}function Iu(r){return r.call.bind(r)}function Rp(r,e){if(typeof r!="object")return!1;try{return e(r),!0}catch{return!1}}function oR(r){return ri&&Ei?es(r)!==void 0:xR(r)||SR(r)||TR(r)||CR(r)||RR(r)||DR(r)||IR(r)||OR(r)||NR(r)||kR(r)||LR(r)}function xR(r){return ri&&Ei?es(r)==="Uint8Array":xr(r)==="[object Uint8Array]"||r6(r)&&r.buffer!==void 0}function SR(r){return ri&&Ei?es(r)==="Uint8ClampedArray":xr(r)==="[object Uint8ClampedArray]"}function TR(r){return ri&&Ei?es(r)==="Uint16Array":xr(r)==="[object Uint16Array]"}function CR(r){return ri&&Ei?es(r)==="Uint32Array":xr(r)==="[object Uint32Array]"}function RR(r){return ri&&Ei?es(r)==="Int8Array":xr(r)==="[object Int8Array]"}function DR(r){return ri&&Ei?es(r)==="Int16Array":xr(r)==="[object Int16Array]"}function IR(r){return ri&&Ei?es(r)==="Int32Array":xr(r)==="[object Int32Array]"}function OR(r){return ri&&Ei?es(r)==="Float32Array":xr(r)==="[object Float32Array]"}function NR(r){return ri&&Ei?es(r)==="Float64Array":xr(r)==="[object Float64Array]"}function kR(r){return ri&&Ei?es(r)==="BigInt64Array":xr(r)==="[object BigInt64Array]"}function LR(r){return ri&&Ei?es(r)==="BigUint64Array":xr(r)==="[object BigUint64Array]"}function w0(r){return xr(r)==="[object Map]"}function v0(r){return xr(r)==="[object Set]"}function _0(r){return xr(r)==="[object WeakMap]"}function m_(r){return xr(r)==="[object WeakSet]"}function T0(r){return xr(r)==="[object ArrayBuffer]"}function aR(r){return typeof ArrayBuffer<"u"&&(T0.working?T0(r):r instanceof ArrayBuffer)}function C0(r){return xr(r)==="[object DataView]"}function lR(r){return typeof DataView<"u"&&(C0.working?C0(r):r instanceof DataView)}function R0(r){return xr(r)==="[object SharedArrayBuffer]"}function uR(r){return typeof SharedArrayBuffer<"u"&&(R0.working?R0(r):r instanceof SharedArrayBuffer)}function cR(r){return Rp(r,a6)}function fR(r){return Rp(r,l6)}function hR(r){return Rp(r,u6)}function dR(r){return AR&&Rp(r,c6)}function pR(r){return A_&&Rp(r,f6)}function ll(r,e){var t={seen:[],stylize:p6};return arguments.length>=3&&(t.depth=arguments[2]),arguments.length>=4&&(t.colors=arguments[3]),x_(e)?t.showHidden=e:e&&ze._extend(t,e),Du(t.showHidden)&&(t.showHidden=!1),Du(t.depth)&&(t.depth=2),Du(t.colors)&&(t.colors=!1),Du(t.customInspect)&&(t.customInspect=!0),t.colors&&(t.stylize=d6),D0(t,r,t.depth)}function d6(r,e){var t=ll.styles[e];return t?"\x1B["+ll.colors[t][0]+"m"+r+"\x1B["+ll.colors[t][1]+"m":r}function p6(r,e){return r}function D0(r,e,t){if(r.customInspect&&e&&S0(e.inspect)&&e.inspect!==ze.inspect&&(!e.constructor||e.constructor.prototype!==e)){var n=e.inspect(t,r);return I0(n)||(n=D0(r,n,t)),n}var i=(function(p,m){if(Du(m))return p.stylize("undefined","undefined");if(I0(m)){var b="'"+JSON.stringify(m).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return p.stylize(b,"string")}if(BR(m))return p.stylize(""+m,"number");if(x_(m))return p.stylize(""+m,"boolean");if(k0(m))return p.stylize("null","null")})(r,e);if(i)return i;var o=Object.keys(e),s=(function(p){var m={};return p.forEach((function(b,v){m[b]=!0})),m})(o);if(r.showHidden&&(o=Object.getOwnPropertyNames(e)),Cp(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return y_(e);if(o.length===0){if(S0(e)){var a=e.name?": "+e.name:"";return r.stylize("[Function"+a+"]","special")}if(Tp(e))return r.stylize(RegExp.prototype.toString.call(e),"regexp");if(O0(e))return r.stylize(Date.prototype.toString.call(e),"date");if(Cp(e))return y_(e)}var u,c="",f=!1,h=["{","}"];return MR(e)&&(f=!0,h=["[","]"]),S0(e)&&(c=" [Function"+(e.name?": "+e.name:"")+"]"),Tp(e)&&(c=" "+RegExp.prototype.toString.call(e)),O0(e)&&(c=" "+Date.prototype.toUTCString.call(e)),Cp(e)&&(c=" "+y_(e)),o.length!==0||f&&e.length!=0?t<0?Tp(e)?r.stylize(RegExp.prototype.toString.call(e),"regexp"):r.stylize("[Object]","special"):(r.seen.push(e),u=f?(function(p,m,b,v,w){for(var y=[],_=0,E=m.length;_<E;++_)FR(m,String(_))?y.push(b_(p,m,b,v,String(_),!0)):y.push("");return w.forEach((function(S){S.match(/^\d+$/)||y.push(b_(p,m,b,v,S,!0))})),y})(r,e,t,s,o):o.map((function(p){return b_(r,e,t,s,p,f)})),r.seen.pop(),(function(p,m,b){var v=0;return p.reduce((function(w,y){return v++,y.indexOf(`
11
+ `)>=0&&v++,w+y.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?b[0]+(m===""?"":m+`
12
+ `)+" "+p.join(`,
13
+ `)+" "+b[1]:b[0]+m+" "+p.join(", ")+" "+b[1]})(u,c,h)):h[0]+c+h[1]}function y_(r){return"["+Error.prototype.toString.call(r)+"]"}function b_(r,e,t,n,i,o){var s,a,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?a=u.set?r.stylize("[Getter/Setter]","special"):r.stylize("[Getter]","special"):u.set&&(a=r.stylize("[Setter]","special")),FR(n,i)||(s="["+i+"]"),a||(r.seen.indexOf(u.value)<0?(a=k0(t)?D0(r,u.value,null):D0(r,u.value,t-1)).indexOf(`
14
+ `)>-1&&(a=o?a.split(`
15
+ `).map((function(c){return" "+c})).join(`
16
+ `).substr(2):`
17
+ `+a.split(`
18
+ `).map((function(c){return" "+c})).join(`
19
+ `)):a=r.stylize("[Circular]","special")),Du(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=r.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=r.stylize(s,"string"))}return s+": "+a}function MR(r){return Array.isArray(r)}function x_(r){return typeof r=="boolean"}function k0(r){return r===null}function BR(r){return typeof r=="number"}function I0(r){return typeof r=="string"}function Du(r){return r===void 0}function Tp(r){return $f(r)&&S_(r)==="[object RegExp]"}function $f(r){return typeof r=="object"&&r!==null}function O0(r){return $f(r)&&S_(r)==="[object Date]"}function Cp(r){return $f(r)&&(S_(r)==="[object Error]"||r instanceof Error)}function S0(r){return typeof r=="function"}function S_(r){return Object.prototype.toString.call(r)}function w_(r){return r<10?"0"+r.toString(10):r.toString(10)}function m6(){var r=new Date,e=[w_(r.getHours()),w_(r.getMinutes()),w_(r.getSeconds())].join(":");return[r.getDate(),g6[r.getMonth()],e].join(" ")}function FR(r,e){return Object.prototype.hasOwnProperty.call(r,e)}function y6(r,e){if(!r){var t=new Error("Promise was rejected with a falsy value");t.reason=r,r=t}return e(r)}var mR,Wo,qo,jf,$r,Ru,Ho,Uf,x0,lr,V3,E_,N0,wR,Y3,X3,K3,Z3,J3,vR,_R,sR,Q3,e6,t6,ER,kt,r6,n6,i6,AR,A_,Ei,ri,s6,xr,a6,l6,u6,Sp,ze,Js,gR,h6,E0,PR,A0,g6,Cu,JV,ul=Jt(()=>{Ce();De();Re();jf=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window,$r=mR={};(function(){try{Wo=typeof setTimeout=="function"?setTimeout:v_}catch{Wo=v_}try{qo=typeof clearTimeout=="function"?clearTimeout:__}catch{qo=__}})();Ho=[],Uf=!1,x0=-1;$r.nextTick=function(r){var e=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];Ho.push(new iR(r,e)),Ho.length!==1||Uf||yR(bR)},iR.prototype.run=function(){(this||jf).fun.apply(null,(this||jf).array)},$r.title="browser",$r.browser=!0,$r.env={},$r.argv=[],$r.version="",$r.versions={},$r.on=zo,$r.addListener=zo,$r.once=zo,$r.off=zo,$r.removeListener=zo,$r.removeAllListeners=zo,$r.emit=zo,$r.prependListener=zo,$r.prependOnceListener=zo,$r.listeners=function(r){return[]},$r.binding=function(r){throw new Error("process.binding is not supported")},$r.cwd=function(){return"/"},$r.chdir=function(r){throw new Error("process.chdir is not supported")},$r.umask=function(){return 0};lr=mR;lr.addListener;lr.argv;lr.binding;lr.browser;lr.chdir;lr.cwd;lr.emit;lr.env;lr.listeners;lr.nextTick;lr.off;lr.on;lr.once;lr.prependListener;lr.prependOnceListener;lr.removeAllListeners;lr.removeListener;lr.title;lr.umask;lr.version;lr.versions;V3=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",E_=Object.prototype.toString,N0=function(r){return!(V3&&r&&typeof r=="object"&&Symbol.toStringTag in r)&&E_.call(r)==="[object Arguments]"},wR=function(r){return!!N0(r)||r!==null&&typeof r=="object"&&typeof r.length=="number"&&r.length>=0&&E_.call(r)!=="[object Array]"&&E_.call(r.callee)==="[object Function]"},Y3=(function(){return N0(arguments)})();N0.isLegacyArguments=wR;X3=Y3?N0:wR,K3=Object.prototype.toString,Z3=Function.prototype.toString,J3=/^\s*(?:function)?\*/,vR=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",_R=Object.getPrototypeOf,sR=(function(){if(!vR)return!1;try{return Function("return function*() {}")()}catch{}})(),Q3=sR?_R(sR):{},e6=function(r){return typeof r=="function"&&(!!J3.test(Z3.call(r))||(vR?_R(r)===Q3:K3.call(r)==="[object GeneratorFunction]"))},t6=typeof Object.create=="function"?function(r,e){e&&(r.super_=e,r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))}:function(r,e){if(e){r.super_=e;var t=function(){};t.prototype=e.prototype,r.prototype=new t,r.prototype.constructor=r}},ER=function(r){return r&&typeof r=="object"&&typeof r.copy=="function"&&typeof r.fill=="function"&&typeof r.readUInt8=="function"},kt={},r6=ER,n6=X3,i6=e6;AR=typeof BigInt<"u",A_=typeof Symbol<"u",Ei=A_&&Symbol.toStringTag!==void 0,ri=typeof Uint8Array<"u",s6=typeof ArrayBuffer<"u";if(ri&&Ei)var o6=Object.getPrototypeOf(Uint8Array.prototype),es=Iu(Object.getOwnPropertyDescriptor(o6,Symbol.toStringTag).get);xr=Iu(Object.prototype.toString),a6=Iu(Number.prototype.valueOf),l6=Iu(String.prototype.valueOf),u6=Iu(Boolean.prototype.valueOf);if(AR)var c6=Iu(BigInt.prototype.valueOf);if(A_)var f6=Iu(Symbol.prototype.valueOf);kt.isArgumentsObject=n6,kt.isGeneratorFunction=i6,kt.isPromise=function(r){return typeof Promise<"u"&&r instanceof Promise||r!==null&&typeof r=="object"&&typeof r.then=="function"&&typeof r.catch=="function"},kt.isArrayBufferView=function(r){return s6&&ArrayBuffer.isView?ArrayBuffer.isView(r):oR(r)||lR(r)},kt.isTypedArray=oR,kt.isUint8Array=xR,kt.isUint8ClampedArray=SR,kt.isUint16Array=TR,kt.isUint32Array=CR,kt.isInt8Array=RR,kt.isInt16Array=DR,kt.isInt32Array=IR,kt.isFloat32Array=OR,kt.isFloat64Array=NR,kt.isBigInt64Array=kR,kt.isBigUint64Array=LR,w0.working=typeof Map<"u"&&w0(new Map),kt.isMap=function(r){return typeof Map<"u"&&(w0.working?w0(r):r instanceof Map)},v0.working=typeof Set<"u"&&v0(new Set),kt.isSet=function(r){return typeof Set<"u"&&(v0.working?v0(r):r instanceof Set)},_0.working=typeof WeakMap<"u"&&_0(new WeakMap),kt.isWeakMap=function(r){return typeof WeakMap<"u"&&(_0.working?_0(r):r instanceof WeakMap)},m_.working=typeof WeakSet<"u"&&m_(new WeakSet),kt.isWeakSet=function(r){return m_(r)},T0.working=typeof ArrayBuffer<"u"&&T0(new ArrayBuffer),kt.isArrayBuffer=aR,C0.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&C0(new DataView(new ArrayBuffer(1),0,1)),kt.isDataView=lR,R0.working=typeof SharedArrayBuffer<"u"&&R0(new SharedArrayBuffer),kt.isSharedArrayBuffer=uR,kt.isAsyncFunction=function(r){return xr(r)==="[object AsyncFunction]"},kt.isMapIterator=function(r){return xr(r)==="[object Map Iterator]"},kt.isSetIterator=function(r){return xr(r)==="[object Set Iterator]"},kt.isGeneratorObject=function(r){return xr(r)==="[object Generator]"},kt.isWebAssemblyCompiledModule=function(r){return xr(r)==="[object WebAssembly.Module]"},kt.isNumberObject=cR,kt.isStringObject=fR,kt.isBooleanObject=hR,kt.isBigIntObject=dR,kt.isSymbolObject=pR,kt.isBoxedPrimitive=function(r){return cR(r)||fR(r)||hR(r)||dR(r)||pR(r)},kt.isAnyArrayBuffer=function(r){return ri&&(aR(r)||uR(r))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(r){Object.defineProperty(kt,r,{enumerable:!1,value:function(){throw new Error(r+" is not supported in userland")}})}));Sp=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window,ze={},Js=lr,gR=Object.getOwnPropertyDescriptors||function(r){for(var e=Object.keys(r),t={},n=0;n<e.length;n++)t[e[n]]=Object.getOwnPropertyDescriptor(r,e[n]);return t},h6=/%[sdj%]/g;ze.format=function(r){if(!I0(r)){for(var e=[],t=0;t<arguments.length;t++)e.push(ll(arguments[t]));return e.join(" ")}t=1;for(var n=arguments,i=n.length,o=String(r).replace(h6,(function(a){if(a==="%%")return"%";if(t>=i)return a;switch(a){case"%s":return String(n[t++]);case"%d":return Number(n[t++]);case"%j":try{return JSON.stringify(n[t++])}catch{return"[Circular]"}default:return a}})),s=n[t];t<i;s=n[++t])k0(s)||!$f(s)?o+=" "+s:o+=" "+ll(s);return o},ze.deprecate=function(r,e){if(Js!==void 0&&Js.noDeprecation===!0)return r;if(Js===void 0)return function(){return ze.deprecate(r,e).apply(this||Sp,arguments)};var t=!1;return function(){if(!t){if(Js.throwDeprecation)throw new Error(e);Js.traceDeprecation?console.trace(e):console.error(e),t=!0}return r.apply(this||Sp,arguments)}};E0={},PR=/^$/;Js.env.NODE_DEBUG&&(A0=Js.env.NODE_DEBUG,A0=A0.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),PR=new RegExp("^"+A0+"$","i"));ze.debuglog=function(r){if(r=r.toUpperCase(),!E0[r])if(PR.test(r)){var e=Js.pid;E0[r]=function(){var t=ze.format.apply(ze,arguments);console.error("%s %d: %s",r,e,t)}}else E0[r]=function(){};return E0[r]},ze.inspect=ll,ll.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},ll.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},ze.types=kt,ze.isArray=MR,ze.isBoolean=x_,ze.isNull=k0,ze.isNullOrUndefined=function(r){return r==null},ze.isNumber=BR,ze.isString=I0,ze.isSymbol=function(r){return typeof r=="symbol"},ze.isUndefined=Du,ze.isRegExp=Tp,ze.types.isRegExp=Tp,ze.isObject=$f,ze.isDate=O0,ze.types.isDate=O0,ze.isError=Cp,ze.types.isNativeError=Cp,ze.isFunction=S0,ze.isPrimitive=function(r){return r===null||typeof r=="boolean"||typeof r=="number"||typeof r=="string"||typeof r=="symbol"||r===void 0},ze.isBuffer=ER;g6=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];ze.log=function(){console.log("%s - %s",m6(),ze.format.apply(ze,arguments))},ze.inherits=t6,ze._extend=function(r,e){if(!e||!$f(e))return r;for(var t=Object.keys(e),n=t.length;n--;)r[t[n]]=e[t[n]];return r};Cu=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;ze.promisify=function(r){if(typeof r!="function")throw new TypeError('The "original" argument must be of type Function');if(Cu&&r[Cu]){var e;if(typeof(e=r[Cu])!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,Cu,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var t,n,i=new Promise((function(a,u){t=a,n=u})),o=[],s=0;s<arguments.length;s++)o.push(arguments[s]);o.push((function(a,u){a?n(a):t(u)}));try{r.apply(this||Sp,o)}catch(a){n(a)}return i}return Object.setPrototypeOf(e,Object.getPrototypeOf(r)),Cu&&Object.defineProperty(e,Cu,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,gR(r))},ze.promisify.custom=Cu,ze.callbackify=function(r){if(typeof r!="function")throw new TypeError('The "original" argument must be of type Function');function e(){for(var t=[],n=0;n<arguments.length;n++)t.push(arguments[n]);var i=t.pop();if(typeof i!="function")throw new TypeError("The last argument must be of type Function");var o=this||Sp,s=function(){return i.apply(o,arguments)};r.apply(this||Sp,t).then((function(a){Js.nextTick(s.bind(null,null,a))}),(function(a){Js.nextTick(y6.bind(null,a,s))}))}return Object.setPrototypeOf(e,Object.getPrototypeOf(r)),Object.defineProperties(e,gR(r)),e};ze._extend;ze.callbackify;ze.debuglog;ze.deprecate;ze.format;ze.inherits;ze.inspect;ze.isArray;ze.isBoolean;ze.isBuffer;ze.isDate;ze.isError;ze.isFunction;ze.isNull;ze.isNullOrUndefined;ze.isNumber;ze.isObject;ze.isPrimitive;ze.isRegExp;ze.isString;ze.isSymbol;ze.isUndefined;ze.log;ze.promisify;ze._extend;ze.callbackify;ze.debuglog;ze.deprecate;ze.format;ze.inherits;ze.inspect;ze.isArray;ze.isBoolean;ze.isBuffer;ze.isDate;ze.isError;ze.isFunction;ze.isNull;ze.isNullOrUndefined;ze.isNumber;ze.isObject;ze.isPrimitive;ze.isRegExp;ze.isString;ze.isSymbol;ze.isUndefined;ze.log;JV=ze.promisify;ze.types});function UR(r,e){if(r==null)throw new TypeError("Cannot convert first argument to object");for(var t=Object(r),n=1;n<arguments.length;n++){var i=arguments[n];if(i!=null)for(var o=Object.keys(Object(i)),s=0,a=o.length;s<a;s++){var u=o[s],c=Object.getOwnPropertyDescriptor(i,u);c!==void 0&&c.enumerable&&(t[u]=i[u])}}return t}function DD(){if(JR)return N_;function r(c){return(r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(f){return typeof f}:function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f})(c)}function e(c,f){return!f||r(f)!=="object"&&typeof f!="function"?(function(h){if(h===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h})(c):f}function t(c){return(t=Object.setPrototypeOf?Object.getPrototypeOf:function(f){return f.__proto__||Object.getPrototypeOf(f)})(c)}function n(c,f){return(n=Object.setPrototypeOf||function(h,p){return h.__proto__=p,h})(c,f)}JR=!0;var i,o,s={};function a(c,f,h){h||(h=Error);var p=(function(m){function b(v,w,y){var _;return(function(E,S){if(!(E instanceof S))throw new TypeError("Cannot call a class as a function")})(this,b),(_=e(this,t(b).call(this,(function(E,S,A){return typeof f=="string"?f:f(E,S,A)})(v,w,y)))).code=c,_}return(function(v,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function");v.prototype=Object.create(w&&w.prototype,{constructor:{value:v,writable:!0,configurable:!0}}),w&&n(v,w)})(b,m),b})(h);s[c]=p}function u(c,f){if(Array.isArray(c)){var h=c.length;return c=c.map((function(p){return String(p)})),h>2?"one of ".concat(f," ").concat(c.slice(0,h-1).join(", "),", or ")+c[h-1]:h===2?"one of ".concat(f," ").concat(c[0]," or ").concat(c[1]):"of ".concat(f," ").concat(c[0])}return"of ".concat(f," ").concat(String(c))}return a("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),a("ERR_INVALID_ARG_TYPE",(function(c,f,h){var p,m,b;if(i===void 0&&(i=F_()),i(typeof c=="string","'name' must be a string"),typeof f=="string"&&(m="not ",f.substr(0,m.length)===m)?(p="must not be",f=f.replace(/^not /,"")):p="must be",(function(w,y,_){return(_===void 0||_>w.length)&&(_=w.length),w.substring(_-y.length,_)===y})(c," argument"))b="The ".concat(c," ").concat(p," ").concat(u(f,"type"));else{var v=(function(w,y,_){return typeof _!="number"&&(_=0),!(_+y.length>w.length)&&w.indexOf(y,_)!==-1})(c,".")?"property":"argument";b='The "'.concat(c,'" ').concat(v," ").concat(p," ").concat(u(f,"type"))}return b+=". Received type ".concat(r(h))}),TypeError),a("ERR_INVALID_ARG_VALUE",(function(c,f){var h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";o===void 0&&(o=ze);var p=o.inspect(f);return p.length>128&&(p="".concat(p.slice(0,128),"...")),"The argument '".concat(c,"' ").concat(h,". Received ").concat(p)}),TypeError),a("ERR_INVALID_RETURN_VALUE",(function(c,f,h){var p;return p=h&&h.constructor&&h.constructor.name?"instance of ".concat(h.constructor.name):"type ".concat(r(h)),"Expected ".concat(c,' to be returned from the "').concat(f,'"')+" function but got ".concat(p,".")}),TypeError),a("ERR_MISSING_ARGS",(function(){for(var c=arguments.length,f=new Array(c),h=0;h<c;h++)f[h]=arguments[h];i===void 0&&(i=F_()),i(f.length>0,"At least one arg needs to be specified");var p="The ",m=f.length;switch(f=f.map((function(b){return'"'.concat(b,'"')})),m){case 1:p+="".concat(f[0]," argument");break;case 2:p+="".concat(f[0]," and ").concat(f[1]," arguments");break;default:p+=f.slice(0,m-1).join(", "),p+=", and ".concat(f[m-1]," arguments")}return"".concat(p," must be specified")}),TypeError),N_.codes=s,N_}function r8(){if(eD)return QR;eD=!0;var r=lr;function e(D,H,J){return H in D?Object.defineProperty(D,H,{value:J,enumerable:!0,configurable:!0,writable:!0}):D[H]=J,D}function t(D,H){for(var J=0;J<H.length;J++){var K=H[J];K.enumerable=K.enumerable||!1,K.configurable=!0,"value"in K&&(K.writable=!0),Object.defineProperty(D,K.key,K)}}function n(D,H){return!H||f(H)!=="object"&&typeof H!="function"?i(D):H}function i(D){if(D===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function o(D){var H=typeof Map=="function"?new Map:void 0;return(o=function(J){if(J===null||(K=J,Function.toString.call(K).indexOf("[native code]")===-1))return J;var K;if(typeof J!="function")throw new TypeError("Super expression must either be null or a function");if(H!==void 0){if(H.has(J))return H.get(J);H.set(J,ne)}function ne(){return a(J,arguments,c(this).constructor)}return ne.prototype=Object.create(J.prototype,{constructor:{value:ne,enumerable:!1,writable:!0,configurable:!0}}),u(ne,J)})(D)}function s(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch{return!1}}function a(D,H,J){return(a=s()?Reflect.construct:function(K,ne,k){var $=[null];$.push.apply($,ne);var Y=new(Function.bind.apply(K,$));return k&&u(Y,k.prototype),Y}).apply(null,arguments)}function u(D,H){return(u=Object.setPrototypeOf||function(J,K){return J.__proto__=K,J})(D,H)}function c(D){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(H){return H.__proto__||Object.getPrototypeOf(H)})(D)}function f(D){return(f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(H){return typeof H}:function(H){return H&&typeof Symbol=="function"&&H.constructor===Symbol&&H!==Symbol.prototype?"symbol":typeof H})(D)}var h=ze.inspect,p=DD().codes.ERR_INVALID_ARG_TYPE;function m(D,H,J){return(J===void 0||J>D.length)&&(J=D.length),D.substring(J-H.length,J)===H}var b="",v="",w="",y="",_={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function E(D){var H=Object.keys(D),J=Object.create(Object.getPrototypeOf(D));return H.forEach((function(K){J[K]=D[K]})),Object.defineProperty(J,"message",{value:D.message}),J}function S(D){return h(D,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function A(D,H,J){var K="",ne="",k=0,$="",Y=!1,ie=S(D),re=ie.split(`
20
+ `),N=S(H).split(`
21
+ `),x=0,P="";if(J==="strictEqual"&&f(D)==="object"&&f(H)==="object"&&D!==null&&H!==null&&(J="strictEqualObject"),re.length===1&&N.length===1&&re[0]!==N[0]){var C=re[0].length+N[0].length;if(C<=10){if(!(f(D)==="object"&&D!==null||f(H)==="object"&&H!==null||D===0&&H===0))return"".concat(_[J],`
22
+
23
+ `)+"".concat(re[0]," !== ").concat(N[0],`
24
+ `)}else if(J!=="strictEqualObject"&&C<(r.stderr&&r.stderr.isTTY?r.stderr.columns:80)){for(;re[0][x]===N[0][x];)x++;x>2&&(P=`
25
+ `.concat((function(X,M){if(M=Math.floor(M),X.length==0||M==0)return"";var ae=X.length*M;for(M=Math.floor(Math.log(M)/Math.log(2));M;)X+=X,M--;return X+=X.substring(0,ae-X.length)})(" ",x),"^"),x=0)}}for(var j=re[re.length-1],U=N[N.length-1];j===U&&(x++<2?$=`
26
+ `.concat(j).concat($):K=j,re.pop(),N.pop(),re.length!==0&&N.length!==0);)j=re[re.length-1],U=N[N.length-1];var B=Math.max(re.length,N.length);if(B===0){var Q=ie.split(`
27
+ `);if(Q.length>30)for(Q[26]="".concat(b,"...").concat(y);Q.length>27;)Q.pop();return"".concat(_.notIdentical,`
28
+
29
+ `).concat(Q.join(`
30
+ `),`
31
+ `)}x>3&&($=`
32
+ `.concat(b,"...").concat(y).concat($),Y=!0),K!==""&&($=`
33
+ `.concat(K).concat($),K="");var fe=0,_e=_[J]+`
34
+ `.concat(v,"+ actual").concat(y," ").concat(w,"- expected").concat(y),te=" ".concat(b,"...").concat(y," Lines skipped");for(x=0;x<B;x++){var W=x-k;if(re.length<x+1)W>1&&x>2&&(W>4?(ne+=`
35
+ `.concat(b,"...").concat(y),Y=!0):W>3&&(ne+=`
36
+ `.concat(N[x-2]),fe++),ne+=`
37
+ `.concat(N[x-1]),fe++),k=x,K+=`
38
+ `.concat(w,"-").concat(y," ").concat(N[x]),fe++;else if(N.length<x+1)W>1&&x>2&&(W>4?(ne+=`
39
+ `.concat(b,"...").concat(y),Y=!0):W>3&&(ne+=`
40
+ `.concat(re[x-2]),fe++),ne+=`
41
+ `.concat(re[x-1]),fe++),k=x,ne+=`
42
+ `.concat(v,"+").concat(y," ").concat(re[x]),fe++;else{var oe=N[x],be=re[x],xe=be!==oe&&(!m(be,",")||be.slice(0,-1)!==oe);xe&&m(oe,",")&&oe.slice(0,-1)===be&&(xe=!1,be+=","),xe?(W>1&&x>2&&(W>4?(ne+=`
43
+ `.concat(b,"...").concat(y),Y=!0):W>3&&(ne+=`
44
+ `.concat(re[x-2]),fe++),ne+=`
45
+ `.concat(re[x-1]),fe++),k=x,ne+=`
46
+ `.concat(v,"+").concat(y," ").concat(be),K+=`
47
+ `.concat(w,"-").concat(y," ").concat(oe),fe+=2):(ne+=K,K="",W!==1&&x!==0||(ne+=`
48
+ `.concat(be),fe++))}if(fe>20&&x<B-2)return"".concat(_e).concat(te,`
49
+ `).concat(ne,`
50
+ `).concat(b,"...").concat(y).concat(K,`
51
+ `)+"".concat(b,"...").concat(y)}return"".concat(_e).concat(Y?te:"",`
52
+ `).concat(ne).concat(K).concat($).concat(P)}var F=(function(D){function H(ne){var k;if((function(Q,fe){if(!(Q instanceof fe))throw new TypeError("Cannot call a class as a function")})(this,H),f(ne)!=="object"||ne===null)throw new p("options","Object",ne);var $=ne.message,Y=ne.operator,ie=ne.stackStartFn,re=ne.actual,N=ne.expected,x=Error.stackTraceLimit;if(Error.stackTraceLimit=0,$!=null)k=n(this,c(H).call(this,String($)));else if(r.stderr&&r.stderr.isTTY&&(r.stderr&&r.stderr.getColorDepth&&r.stderr.getColorDepth()!==1?(b="\x1B[34m",v="\x1B[32m",y="\x1B[39m",w="\x1B[31m"):(b="",v="",y="",w="")),f(re)==="object"&&re!==null&&f(N)==="object"&&N!==null&&"stack"in re&&re instanceof Error&&"stack"in N&&N instanceof Error&&(re=E(re),N=E(N)),Y==="deepStrictEqual"||Y==="strictEqual")k=n(this,c(H).call(this,A(re,N,Y)));else if(Y==="notDeepStrictEqual"||Y==="notStrictEqual"){var P=_[Y],C=S(re).split(`
53
+ `);if(Y==="notStrictEqual"&&f(re)==="object"&&re!==null&&(P=_.notStrictEqualObject),C.length>30)for(C[26]="".concat(b,"...").concat(y);C.length>27;)C.pop();k=C.length===1?n(this,c(H).call(this,"".concat(P," ").concat(C[0]))):n(this,c(H).call(this,"".concat(P,`
54
+
55
+ `).concat(C.join(`
56
+ `),`
57
+ `)))}else{var j=S(re),U="",B=_[Y];Y==="notDeepEqual"||Y==="notEqual"?(j="".concat(_[Y],`
58
+
59
+ `).concat(j)).length>1024&&(j="".concat(j.slice(0,1021),"...")):(U="".concat(S(N)),j.length>512&&(j="".concat(j.slice(0,509),"...")),U.length>512&&(U="".concat(U.slice(0,509),"...")),Y==="deepEqual"||Y==="equal"?j="".concat(B,`
60
+
61
+ `).concat(j,`
62
+
63
+ should equal
64
+
65
+ `):U=" ".concat(Y," ").concat(U)),k=n(this,c(H).call(this,"".concat(j).concat(U)))}return Error.stackTraceLimit=x,k.generatedMessage=!$,Object.defineProperty(i(k),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),k.code="ERR_ASSERTION",k.actual=re,k.expected=N,k.operator=Y,Error.captureStackTrace&&Error.captureStackTrace(i(k),ie),k.stack,k.name="AssertionError",n(k)}var J,K;return(function(ne,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function");ne.prototype=Object.create(k&&k.prototype,{constructor:{value:ne,writable:!0,configurable:!0}}),k&&u(ne,k)})(H,D),J=H,(K=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:h.custom,value:function(ne,k){return h(this,(function($){for(var Y=1;Y<arguments.length;Y++){var ie=arguments[Y]!=null?arguments[Y]:{},re=Object.keys(ie);typeof Object.getOwnPropertySymbols=="function"&&(re=re.concat(Object.getOwnPropertySymbols(ie).filter((function(N){return Object.getOwnPropertyDescriptor(ie,N).enumerable})))),re.forEach((function(N){e($,N,ie[N])}))}return $})({},k,{customInspect:!1,depth:0}))}}])&&t(J.prototype,K),H})(o(Error));return QR=F}function tD(r,e){return(function(t){if(Array.isArray(t))return t})(r)||(function(t,n){var i=[],o=!0,s=!1,a=void 0;try{for(var u,c=t[Symbol.iterator]();!(o=(u=c.next()).done)&&(i.push(u.value),!n||i.length!==n);o=!0);}catch(f){s=!0,a=f}finally{try{o||c.return==null||c.return()}finally{if(s)throw a}}return i})(r,e)||(function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")})()}function Ts(r){return(Ts=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(r)}function $_(r){return r.call.bind(r)}function f8(r){if(r.length===0||r.length>10)return!0;for(var e=0;e<r.length;e++){var t=r.charCodeAt(e);if(t<48||t>57)return!0}return r.length===10&&r>=Math.pow(2,32)}function B0(r){return Object.keys(r).filter(f8).concat(U0(r).filter(Object.prototype.propertyIsEnumerable.bind(r)))}function fD(r,e){if(r===e)return 0;for(var t=r.length,n=e.length,i=0,o=Math.min(t,n);i<o;++i)if(r[i]!==e[i]){t=r[i],n=e[i];break}return t<n?-1:n<t?1:0}function ts(r,e,t,n){if(r===e)return r!==0||!t||nD(r,e);if(t){if(Ts(r)!=="object")return typeof r=="number"&&B_(r)&&B_(e);if(Ts(e)!=="object"||r===null||e===null||Object.getPrototypeOf(r)!==Object.getPrototypeOf(e))return!1}else{if(r===null||Ts(r)!=="object")return(e===null||Ts(e)!=="object")&&r==e;if(e===null||Ts(e)!=="object")return!1}var i,o,s,a,u=iD(r);if(u!==iD(e))return!1;if(Array.isArray(r)){if(r.length!==e.length)return!1;var c=B0(r),f=B0(e);return c.length===f.length&&Op(r,e,t,n,1,c)}if(u==="[object Object]"&&(!P0(r)&&P0(e)||!M0(r)&&M0(e)))return!1;if(sD(r)){if(!sD(e)||Date.prototype.getTime.call(r)!==Date.prototype.getTime.call(e))return!1}else if(oD(r)){if(!oD(e)||(s=r,a=e,!(n8?s.source===a.source&&s.flags===a.flags:RegExp.prototype.toString.call(s)===RegExp.prototype.toString.call(a))))return!1}else if(o8(r)||r instanceof Error){if(r.message!==e.message||r.name!==e.name)return!1}else{if(s8(r)){if(t||!u8(r)&&!c8(r)){if(!(function(m,b){return m.byteLength===b.byteLength&&fD(new Uint8Array(m.buffer,m.byteOffset,m.byteLength),new Uint8Array(b.buffer,b.byteOffset,b.byteLength))===0})(r,e))return!1}else if(!(function(m,b){if(m.byteLength!==b.byteLength)return!1;for(var v=0;v<m.byteLength;v++)if(m[v]!==b[v])return!1;return!0})(r,e))return!1;var h=B0(r),p=B0(e);return h.length===p.length&&Op(r,e,t,n,0,h)}if(M0(r))return!(!M0(e)||r.size!==e.size)&&Op(r,e,t,n,2);if(P0(r))return!(!P0(e)||r.size!==e.size)&&Op(r,e,t,n,3);if(i8(r)){if(o=e,(i=r).byteLength!==o.byteLength||fD(new Uint8Array(i),new Uint8Array(o))!==0)return!1}else if(a8(r)&&!(function(m,b){return aD(m)?aD(b)&&nD(Number.prototype.valueOf.call(m),Number.prototype.valueOf.call(b)):lD(m)?lD(b)&&String.prototype.valueOf.call(m)===String.prototype.valueOf.call(b):uD(m)?uD(b)&&Boolean.prototype.valueOf.call(m)===Boolean.prototype.valueOf.call(b):cD(m)?cD(b)&&BigInt.prototype.valueOf.call(m)===BigInt.prototype.valueOf.call(b):l8(b)&&Symbol.prototype.valueOf.call(m)===Symbol.prototype.valueOf.call(b)})(r,e))return!1}return Op(r,e,t,n,0)}function hD(r,e){return e.filter((function(t){return j0(r,t)}))}function Op(r,e,t,n,i,o){if(arguments.length===5){o=Object.keys(r);var s=Object.keys(e);if(o.length!==s.length)return!1}for(var a=0;a<o.length;a++)if(!Np(e,o[a]))return!1;if(t&&arguments.length===5){var u=U0(r);if(u.length!==0){var c=0;for(a=0;a<u.length;a++){var f=u[a];if(j0(r,f)){if(!j0(e,f))return!1;o.push(f),c++}else if(j0(e,f))return!1}var h=U0(e);if(u.length!==h.length&&hD(e,h).length!==c)return!1}else{var p=U0(e);if(p.length!==0&&hD(e,p).length!==0)return!1}}if(o.length===0&&(i===0||i===1&&r.length===0||r.size===0))return!0;if(n===void 0)n={val1:new Map,val2:new Map,position:0};else{var m=n.val1.get(r);if(m!==void 0){var b=n.val2.get(e);if(b!==void 0)return m===b}n.position++}n.val1.set(r,n.position),n.val2.set(e,n.position);var v=p8(r,e,t,o,n,i);return n.val1.delete(r),n.val2.delete(e),v}function dD(r,e,t,n){for(var i=$0(r),o=0;o<i.length;o++){var s=i[o];if(ts(e,s,t,n))return r.delete(s),!0}return!1}function ID(r){switch(Ts(r)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":r=+r;case"number":if(B_(r))return!1}return!0}function h8(r,e,t){var n=ID(t);return n??(e.has(n)&&!r.has(n))}function d8(r,e,t,n,i){var o=ID(t);if(o!=null)return o;var s=e.get(o);return!(s===void 0&&!e.has(o)||!ts(n,s,!1,i))&&!r.has(o)&&ts(n,s,!1,i)}function pD(r,e,t,n,i,o){for(var s=$0(r),a=0;a<s.length;a++){var u=s[a];if(ts(t,u,i,o)&&ts(n,e.get(u),i,o))return r.delete(u),!0}return!1}function p8(r,e,t,n,i,o){var s=0;if(o===2){if(!(function(f,h,p,m){for(var b=null,v=$0(f),w=0;w<v.length;w++){var y=v[w];if(Ts(y)==="object"&&y!==null)b===null&&(b=new Set),b.add(y);else if(!h.has(y)){if(p||!h8(f,h,y))return!1;b===null&&(b=new Set),b.add(y)}}if(b!==null){for(var _=$0(h),E=0;E<_.length;E++){var S=_[E];if(Ts(S)==="object"&&S!==null){if(!dD(b,S,p,m))return!1}else if(!p&&!f.has(S)&&!dD(b,S,p,m))return!1}return b.size===0}return!0})(r,e,t,i))return!1}else if(o===3){if(!(function(f,h,p,m){for(var b=null,v=rD(f),w=0;w<v.length;w++){var y=tD(v[w],2),_=y[0],E=y[1];if(Ts(_)==="object"&&_!==null)b===null&&(b=new Set),b.add(_);else{var S=h.get(_);if(S===void 0&&!h.has(_)||!ts(E,S,p,m)){if(p||!d8(f,h,_,E,m))return!1;b===null&&(b=new Set),b.add(_)}}}if(b!==null){for(var A=rD(h),F=0;F<A.length;F++){var D=tD(A[F],2),H=(_=D[0],D[1]);if(Ts(_)==="object"&&_!==null){if(!pD(b,f,_,H,p,m))return!1}else if(!(p||f.has(_)&&ts(f.get(_),H,!1,m)||pD(b,f,_,H,!1,m)))return!1}return b.size===0}return!0})(r,e,t,i))return!1}else if(o===1)for(;s<r.length;s++){if(!Np(r,s)){if(Np(e,s))return!1;for(var a=Object.keys(r);s<a.length;s++){var u=a[s];if(!Np(e,u)||!ts(r[u],e[u],t,i))return!1}return a.length===Object.keys(e).length}if(!Np(e,s)||!ts(r[s],e[s],t,i))return!1}for(s=0;s<n.length;s++){var c=n[s];if(!ts(r[c],e[c],t,i))return!1}return!0}function F_(){if(mD)return k_;mD=!0;var r=lr;function e(N){return(e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(x){return typeof x}:function(x){return x&&typeof Symbol=="function"&&x.constructor===Symbol&&x!==Symbol.prototype?"symbol":typeof x})(N)}var t,n,i=DD().codes,o=i.ERR_AMBIGUOUS_ARGUMENT,s=i.ERR_INVALID_ARG_TYPE,a=i.ERR_INVALID_ARG_VALUE,u=i.ERR_INVALID_RETURN_VALUE,c=i.ERR_MISSING_ARGS,f=r8(),h=ze.inspect,p=ze.types,m=p.isPromise,b=p.isRegExp,v=Object.assign?Object.assign:b6.assign,w=Object.is?Object.is:TD;function y(){t=gD.isDeepEqual,n=gD.isDeepStrictEqual}var _=!1,E=k_=D,S={};function A(N){throw N.message instanceof Error?N.message:new f(N)}function F(N,x,P,C){if(!P){var j=!1;if(x===0)j=!0,C="No value argument passed to `assert.ok()`";else if(C instanceof Error)throw C;var U=new f({actual:P,expected:!0,message:C,operator:"==",stackStartFn:N});throw U.generatedMessage=j,U}}function D(){for(var N=arguments.length,x=new Array(N),P=0;P<N;P++)x[P]=arguments[P];F.apply(void 0,[D,x.length].concat(x))}E.fail=function N(x,P,C,j,U){var B,Q=arguments.length;if(Q===0)B="Failed";else if(Q===1)C=x,x=void 0;else{if(_===!1){_=!0;var fe=r.emitWarning?r.emitWarning:console.warn.bind(console);fe("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")}Q===2&&(j="!=")}if(C instanceof Error)throw C;var _e={actual:x,expected:P,operator:j===void 0?"fail":j,stackStartFn:U||N};C!==void 0&&(_e.message=C);var te=new f(_e);throw B&&(te.message=B,te.generatedMessage=!0),te},E.AssertionError=f,E.ok=D,E.equal=function N(x,P,C){if(arguments.length<2)throw new c("actual","expected");x!=P&&A({actual:x,expected:P,message:C,operator:"==",stackStartFn:N})},E.notEqual=function N(x,P,C){if(arguments.length<2)throw new c("actual","expected");x==P&&A({actual:x,expected:P,message:C,operator:"!=",stackStartFn:N})},E.deepEqual=function N(x,P,C){if(arguments.length<2)throw new c("actual","expected");t===void 0&&y(),t(x,P)||A({actual:x,expected:P,message:C,operator:"deepEqual",stackStartFn:N})},E.notDeepEqual=function N(x,P,C){if(arguments.length<2)throw new c("actual","expected");t===void 0&&y(),t(x,P)&&A({actual:x,expected:P,message:C,operator:"notDeepEqual",stackStartFn:N})},E.deepStrictEqual=function N(x,P,C){if(arguments.length<2)throw new c("actual","expected");t===void 0&&y(),n(x,P)||A({actual:x,expected:P,message:C,operator:"deepStrictEqual",stackStartFn:N})},E.notDeepStrictEqual=function N(x,P,C){if(arguments.length<2)throw new c("actual","expected");t===void 0&&y(),n(x,P)&&A({actual:x,expected:P,message:C,operator:"notDeepStrictEqual",stackStartFn:N})},E.strictEqual=function N(x,P,C){if(arguments.length<2)throw new c("actual","expected");w(x,P)||A({actual:x,expected:P,message:C,operator:"strictEqual",stackStartFn:N})},E.notStrictEqual=function N(x,P,C){if(arguments.length<2)throw new c("actual","expected");w(x,P)&&A({actual:x,expected:P,message:C,operator:"notStrictEqual",stackStartFn:N})};var H=function N(x,P,C){var j=this;(function(U,B){if(!(U instanceof B))throw new TypeError("Cannot call a class as a function")})(this,N),P.forEach((function(U){U in x&&(C!==void 0&&typeof C[U]=="string"&&b(x[U])&&x[U].test(C[U])?j[U]=C[U]:j[U]=x[U])}))};function J(N,x,P,C,j,U){if(!(P in N)||!n(N[P],x[P])){if(!C){var B=new H(N,j),Q=new H(x,j,N),fe=new f({actual:B,expected:Q,operator:"deepStrictEqual",stackStartFn:U});throw fe.actual=N,fe.expected=x,fe.operator=U.name,fe}A({actual:N,expected:x,message:C,operator:U.name,stackStartFn:U})}}function K(N,x,P,C){if(typeof x!="function"){if(b(x))return x.test(N);if(arguments.length===2)throw new s("expected",["Function","RegExp"],x);if(e(N)!=="object"||N===null){var j=new f({actual:N,expected:x,message:P,operator:"deepStrictEqual",stackStartFn:C});throw j.operator=C.name,j}var U=Object.keys(x);if(x instanceof Error)U.push("name","message");else if(U.length===0)throw new a("error",x,"may not be an empty object");return t===void 0&&y(),U.forEach((function(B){typeof N[B]=="string"&&b(x[B])&&x[B].test(N[B])||J(N,x,B,P,U,C)})),!0}return x.prototype!==void 0&&N instanceof x||!Error.isPrototypeOf(x)&&x.call({},N)===!0}function ne(N){if(typeof N!="function")throw new s("fn","Function",N);try{N()}catch(x){return x}return S}function k(N){return m(N)||N!==null&&e(N)==="object"&&typeof N.then=="function"&&typeof N.catch=="function"}function $(N){return Promise.resolve().then((function(){var x;if(typeof N=="function"){if(!k(x=N()))throw new u("instance of Promise","promiseFn",x)}else{if(!k(N))throw new s("promiseFn",["Function","Promise"],N);x=N}return Promise.resolve().then((function(){return x})).then((function(){return S})).catch((function(P){return P}))}))}function Y(N,x,P,C){if(typeof P=="string"){if(arguments.length===4)throw new s("error",["Object","Error","Function","RegExp"],P);if(e(x)==="object"&&x!==null){if(x.message===P)throw new o("error/message",'The error message "'.concat(x.message,'" is identical to the message.'))}else if(x===P)throw new o("error/message",'The error "'.concat(x,'" is identical to the message.'));C=P,P=void 0}else if(P!=null&&e(P)!=="object"&&typeof P!="function")throw new s("error",["Object","Error","Function","RegExp"],P);if(x===S){var j="";P&&P.name&&(j+=" (".concat(P.name,")")),j+=C?": ".concat(C):".";var U=N.name==="rejects"?"rejection":"exception";A({actual:void 0,expected:P,operator:N.name,message:"Missing expected ".concat(U).concat(j),stackStartFn:N})}if(P&&!K(x,P,C,N))throw x}function ie(N,x,P,C){if(x!==S){if(typeof P=="string"&&(C=P,P=void 0),!P||K(x,P)){var j=C?": ".concat(C):".",U=N.name==="doesNotReject"?"rejection":"exception";A({actual:x,expected:P,operator:N.name,message:"Got unwanted ".concat(U).concat(j,`
66
+ `)+'Actual message: "'.concat(x&&x.message,'"'),stackStartFn:N})}throw x}}function re(){for(var N=arguments.length,x=new Array(N),P=0;P<N;P++)x[P]=arguments[P];F.apply(void 0,[re,x.length].concat(x))}return E.throws=function N(x){for(var P=arguments.length,C=new Array(P>1?P-1:0),j=1;j<P;j++)C[j-1]=arguments[j];Y.apply(void 0,[N,ne(x)].concat(C))},E.rejects=function N(x){for(var P=arguments.length,C=new Array(P>1?P-1:0),j=1;j<P;j++)C[j-1]=arguments[j];return $(x).then((function(U){return Y.apply(void 0,[N,U].concat(C))}))},E.doesNotThrow=function N(x){for(var P=arguments.length,C=new Array(P>1?P-1:0),j=1;j<P;j++)C[j-1]=arguments[j];ie.apply(void 0,[N,ne(x)].concat(C))},E.doesNotReject=function N(x){for(var P=arguments.length,C=new Array(P>1?P-1:0),j=1;j<P;j++)C[j-1]=arguments[j];return $(x).then((function(U){return ie.apply(void 0,[N,U].concat(C))}))},E.ifError=function N(x){if(x!=null){var P="ifError got unwanted exception: ";e(x)==="object"&&typeof x.message=="string"?x.message.length===0&&x.constructor?P+=x.constructor.name:P+=x.message:P+=h(x);var C=new f({actual:x,expected:null,operator:"ifError",message:P,stackStartFn:N}),j=x.stack;if(typeof j=="string"){var U=j.split(`
67
+ `);U.shift();for(var B=C.stack.split(`
68
+ `),Q=0;Q<U.length;Q++){var fe=B.indexOf(U[Q]);if(fe!==-1){B=B.slice(0,fe);break}}C.stack="".concat(B.join(`
69
+ `),`
70
+ `).concat(U.join(`
71
+ `))}throw C}},E.strict=v(re,E,{equal:E.strictEqual,deepEqual:E.deepStrictEqual,notEqual:E.notStrictEqual,notDeepEqual:E.notDeepStrictEqual}),E.strict.strict=E.strict,k_}var b6,yD,jR,bD,Dp,T_,$R,C_,zR,WR,Ip,L0,qR,HR,w6,v6,_6,GR,F0,VR,E6,A6,x6,S6,T6,L_,wD,C6,vD,z0,R6,YR,D6,I6,O6,R_,N6,k6,_D,kp,ku,D_,L6,Ou,Nu,I_,O_,XR,P6,M6,B6,F6,U6,ED,KR,AD,j6,$6,z6,P_,M_,ZR,W6,q6,H6,G6,V6,xD,Y6,SD,TD,U_,j_,X6,K6,Z6,J6,Q6,CD,e8,RD,t8,N_,JR,QR,eD,n8,$0,rD,nD,U0,B_,Np,j0,iD,Hn,i8,s8,sD,P0,oD,M0,o8,a8,aD,lD,uD,cD,l8,u8,c8,gD,k_,mD,pt,z_=Jt(()=>{Ce();De();Re();ul();b6={assign:UR,polyfill:function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:UR})}},jR=Object.prototype.toString,bD=function(r){var e=jR.call(r),t=e==="[object Arguments]";return t||(t=e!=="[object Array]"&&r!==null&&typeof r=="object"&&typeof r.length=="number"&&r.length>=0&&jR.call(r.callee)==="[object Function]"),t};Object.keys||(Dp=Object.prototype.hasOwnProperty,T_=Object.prototype.toString,$R=bD,C_=Object.prototype.propertyIsEnumerable,zR=!C_.call({toString:null},"toString"),WR=C_.call((function(){}),"prototype"),Ip=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],L0=function(r){var e=r.constructor;return e&&e.prototype===r},qR={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},HR=(function(){if(typeof window>"u")return!1;for(var r in window)try{if(!qR["$"+r]&&Dp.call(window,r)&&window[r]!==null&&typeof window[r]=="object")try{L0(window[r])}catch{return!0}}catch{return!0}return!1})(),yD=function(r){var e=r!==null&&typeof r=="object",t=T_.call(r)==="[object Function]",n=$R(r),i=e&&T_.call(r)==="[object String]",o=[];if(!e&&!t&&!n)throw new TypeError("Object.keys called on a non-object");var s=WR&&t;if(i&&r.length>0&&!Dp.call(r,0))for(var a=0;a<r.length;++a)o.push(String(a));if(n&&r.length>0)for(var u=0;u<r.length;++u)o.push(String(u));else for(var c in r)s&&c==="prototype"||!Dp.call(r,c)||o.push(String(c));if(zR)for(var f=(function(p){if(typeof window>"u"||!HR)return L0(p);try{return L0(p)}catch{return!1}})(r),h=0;h<Ip.length;++h)f&&Ip[h]==="constructor"||!Dp.call(r,Ip[h])||o.push(Ip[h]);return o});w6=yD,v6=Array.prototype.slice,_6=bD,GR=Object.keys,F0=GR?function(r){return GR(r)}:w6,VR=Object.keys;F0.shim=function(){return Object.keys?(function(){var r=Object.keys(arguments);return r&&r.length===arguments.length})(1,2)||(Object.keys=function(r){return _6(r)?VR(v6.call(r)):VR(r)}):Object.keys=F0,Object.keys||F0};E6=F0,A6=E6,x6=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",S6=Object.prototype.toString,T6=Array.prototype.concat,L_=Object.defineProperty,wD=L_&&(function(){var r={};try{for(var e in L_(r,"x",{enumerable:!1,value:r}),r)return!1;return r.x===r}catch{return!1}})(),C6=function(r,e,t,n){var i;(!(e in r)||typeof(i=n)=="function"&&S6.call(i)==="[object Function]"&&n())&&(wD?L_(r,e,{configurable:!0,enumerable:!1,value:t,writable:!0}):r[e]=t)},vD=function(r,e){var t=arguments.length>2?arguments[2]:{},n=A6(e);x6&&(n=T6.call(n,Object.getOwnPropertySymbols(e)));for(var i=0;i<n.length;i+=1)C6(r,n[i],e[n[i]],t[n[i]])};vD.supportsDescriptors=!!wD;z0=vD,R6=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var r={},e=Symbol("test"),t=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(t)!=="[object Symbol]")return!1;for(e in r[e]=42,r)return!1;if(typeof Object.keys=="function"&&Object.keys(r).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(r).length!==0)return!1;var n=Object.getOwnPropertySymbols(r);if(n.length!==1||n[0]!==e||!Object.prototype.propertyIsEnumerable.call(r,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var i=Object.getOwnPropertyDescriptor(r,e);if(i.value!==42||i.enumerable!==!0)return!1}return!0},YR=(typeof globalThis<"u"?globalThis:typeof self<"u"?self:window).Symbol,D6=R6,I6=function(){return typeof YR=="function"&&typeof Symbol=="function"&&typeof YR("foo")=="symbol"&&typeof Symbol("bar")=="symbol"&&D6()},O6="Function.prototype.bind called on incompatible ",R_=Array.prototype.slice,N6=Object.prototype.toString,k6=function(r){var e=this;if(typeof e!="function"||N6.call(e)!=="[object Function]")throw new TypeError(O6+e);for(var t,n=R_.call(arguments,1),i=function(){if(this instanceof t){var c=e.apply(this,n.concat(R_.call(arguments)));return Object(c)===c?c:this}return e.apply(r,n.concat(R_.call(arguments)))},o=Math.max(0,e.length-n.length),s=[],a=0;a<o;a++)s.push("$"+a);if(t=Function("binder","return function ("+s.join(",")+"){ return binder.apply(this,arguments); }")(i),e.prototype){var u=function(){};u.prototype=e.prototype,t.prototype=new u,u.prototype=null}return t},_D=Function.prototype.bind||k6,kp=TypeError,ku=Object.getOwnPropertyDescriptor;if(ku)try{ku({},"")}catch{ku=null}D_=function(){throw new kp},L6=ku?(function(){try{return arguments.callee,D_}catch{try{return ku(arguments,"callee").get}catch{return D_}}})():D_,Ou=I6(),Nu=Object.getPrototypeOf||function(r){return r.__proto__},I_=typeof Uint8Array>"u"?void 0:Nu(Uint8Array),O_={"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?void 0:ArrayBuffer,"%ArrayBufferPrototype%":typeof ArrayBuffer>"u"?void 0:ArrayBuffer.prototype,"%ArrayIteratorPrototype%":Ou?Nu([][Symbol.iterator]()):void 0,"%ArrayPrototype%":Array.prototype,"%ArrayProto_entries%":Array.prototype.entries,"%ArrayProto_forEach%":Array.prototype.forEach,"%ArrayProto_keys%":Array.prototype.keys,"%ArrayProto_values%":Array.prototype.values,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":void 0,"%AsyncFunctionPrototype%":void 0,"%AsyncGenerator%":void 0,"%AsyncGeneratorFunction%":void 0,"%AsyncGeneratorPrototype%":void 0,"%AsyncIteratorPrototype%":void 0,"%Atomics%":typeof Atomics>"u"?void 0:Atomics,"%Boolean%":Boolean,"%BooleanPrototype%":Boolean.prototype,"%DataView%":typeof DataView>"u"?void 0:DataView,"%DataViewPrototype%":typeof DataView>"u"?void 0:DataView.prototype,"%Date%":Date,"%DatePrototype%":Date.prototype,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%ErrorPrototype%":Error.prototype,"%eval%":eval,"%EvalError%":EvalError,"%EvalErrorPrototype%":EvalError.prototype,"%Float32Array%":typeof Float32Array>"u"?void 0:Float32Array,"%Float32ArrayPrototype%":typeof Float32Array>"u"?void 0:Float32Array.prototype,"%Float64Array%":typeof Float64Array>"u"?void 0:Float64Array,"%Float64ArrayPrototype%":typeof Float64Array>"u"?void 0:Float64Array.prototype,"%Function%":Function,"%FunctionPrototype%":Function.prototype,"%Generator%":void 0,"%GeneratorFunction%":void 0,"%GeneratorPrototype%":void 0,"%Int8Array%":typeof Int8Array>"u"?void 0:Int8Array,"%Int8ArrayPrototype%":typeof Int8Array>"u"?void 0:Int8Array.prototype,"%Int16Array%":typeof Int16Array>"u"?void 0:Int16Array,"%Int16ArrayPrototype%":typeof Int16Array>"u"?void 0:Int8Array.prototype,"%Int32Array%":typeof Int32Array>"u"?void 0:Int32Array,"%Int32ArrayPrototype%":typeof Int32Array>"u"?void 0:Int32Array.prototype,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ou?Nu(Nu([][Symbol.iterator]())):void 0,"%JSON%":typeof JSON=="object"?JSON:void 0,"%JSONParse%":typeof JSON=="object"?JSON.parse:void 0,"%Map%":typeof Map>"u"?void 0:Map,"%MapIteratorPrototype%":typeof Map<"u"&&Ou?Nu(new Map()[Symbol.iterator]()):void 0,"%MapPrototype%":typeof Map>"u"?void 0:Map.prototype,"%Math%":Math,"%Number%":Number,"%NumberPrototype%":Number.prototype,"%Object%":Object,"%ObjectPrototype%":Object.prototype,"%ObjProto_toString%":Object.prototype.toString,"%ObjProto_valueOf%":Object.prototype.valueOf,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?void 0:Promise,"%PromisePrototype%":typeof Promise>"u"?void 0:Promise.prototype,"%PromiseProto_then%":typeof Promise>"u"?void 0:Promise.prototype.then,"%Promise_all%":typeof Promise>"u"?void 0:Promise.all,"%Promise_reject%":typeof Promise>"u"?void 0:Promise.reject,"%Promise_resolve%":typeof Promise>"u"?void 0:Promise.resolve,"%Proxy%":typeof Proxy>"u"?void 0:Proxy,"%RangeError%":RangeError,"%RangeErrorPrototype%":RangeError.prototype,"%ReferenceError%":ReferenceError,"%ReferenceErrorPrototype%":ReferenceError.prototype,"%Reflect%":typeof Reflect>"u"?void 0:Reflect,"%RegExp%":RegExp,"%RegExpPrototype%":RegExp.prototype,"%Set%":typeof Set>"u"?void 0:Set,"%SetIteratorPrototype%":typeof Set<"u"&&Ou?Nu(new Set()[Symbol.iterator]()):void 0,"%SetPrototype%":typeof Set>"u"?void 0:Set.prototype,"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?void 0:SharedArrayBuffer,"%SharedArrayBufferPrototype%":typeof SharedArrayBuffer>"u"?void 0:SharedArrayBuffer.prototype,"%String%":String,"%StringIteratorPrototype%":Ou?Nu(""[Symbol.iterator]()):void 0,"%StringPrototype%":String.prototype,"%Symbol%":Ou?Symbol:void 0,"%SymbolPrototype%":Ou?Symbol.prototype:void 0,"%SyntaxError%":SyntaxError,"%SyntaxErrorPrototype%":SyntaxError.prototype,"%ThrowTypeError%":L6,"%TypedArray%":I_,"%TypedArrayPrototype%":I_?I_.prototype:void 0,"%TypeError%":kp,"%TypeErrorPrototype%":kp.prototype,"%Uint8Array%":typeof Uint8Array>"u"?void 0:Uint8Array,"%Uint8ArrayPrototype%":typeof Uint8Array>"u"?void 0:Uint8Array.prototype,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray,"%Uint8ClampedArrayPrototype%":typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray.prototype,"%Uint16Array%":typeof Uint16Array>"u"?void 0:Uint16Array,"%Uint16ArrayPrototype%":typeof Uint16Array>"u"?void 0:Uint16Array.prototype,"%Uint32Array%":typeof Uint32Array>"u"?void 0:Uint32Array,"%Uint32ArrayPrototype%":typeof Uint32Array>"u"?void 0:Uint32Array.prototype,"%URIError%":URIError,"%URIErrorPrototype%":URIError.prototype,"%WeakMap%":typeof WeakMap>"u"?void 0:WeakMap,"%WeakMapPrototype%":typeof WeakMap>"u"?void 0:WeakMap.prototype,"%WeakSet%":typeof WeakSet>"u"?void 0:WeakSet,"%WeakSetPrototype%":typeof WeakSet>"u"?void 0:WeakSet.prototype},XR=_D.call(Function.call,String.prototype.replace),P6=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,M6=/\\(\\)?/g,B6=function(r){var e=[];return XR(r,P6,(function(t,n,i,o){e[e.length]=i?XR(o,M6,"$1"):n||t})),e},F6=function(r,e){if(!(r in O_))throw new SyntaxError("intrinsic "+r+" does not exist!");if(O_[r]===void 0&&!e)throw new kp("intrinsic "+r+" exists, but is not available. Please file an issue!");return O_[r]},U6=function(r,e){if(r.length===0)throw new TypeError("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new TypeError('"allowMissing" argument must be a boolean');for(var t=B6(r),n=F6("%"+(t.length>0?t[0]:"")+"%",e),i=1;i<t.length;i+=1)if(n!=null)if(ku&&i+1>=t.length){var o=ku(n,t[i]);if(!(t[i]in n))throw new kp("base intrinsic for "+r+" exists, but the property is not available.");n=o?o.get||o.value:n[t[i]]}else n=n[t[i]];return n},KR=_D,AD=U6("%Function%"),j6=AD.apply,$6=AD.call;(ED=function(){return KR.apply($6,arguments)}).apply=function(){return KR.apply(j6,arguments)};z6=ED,ZR=function(r){return r!=r},W6=(P_=function(r,e){return r===0&&e===0?1/r==1/e:r===e||!(!ZR(r)||!ZR(e))},P_),q6=(M_=function(){return typeof Object.is=="function"?Object.is:W6},M_),H6=z0,G6=z0,V6=P_,xD=M_,Y6=function(){var r=q6();return H6(Object,{is:r},{is:function(){return Object.is!==r}}),r},SD=z6(xD(),Object);G6(SD,{getPolyfill:xD,implementation:V6,shim:Y6});TD=SD;U_=function(r){return r!=r};X6=U_,K6=(j_=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:X6},z0),Z6=j_,J6=z0,Q6=U_,CD=j_,e8=function(){var r=Z6();return K6(Number,{isNaN:r},{isNaN:function(){return Number.isNaN!==r}}),r},RD=CD();J6(RD,{getPolyfill:CD,implementation:Q6,shim:e8});t8=RD,N_={},JR=!1;QR={},eD=!1;n8=/a/g.flags!==void 0,$0=function(r){var e=[];return r.forEach((function(t){return e.push(t)})),e},rD=function(r){var e=[];return r.forEach((function(t,n){return e.push([n,t])})),e},nD=Object.is?Object.is:TD,U0=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},B_=Number.isNaN?Number.isNaN:t8;Np=$_(Object.prototype.hasOwnProperty),j0=$_(Object.prototype.propertyIsEnumerable),iD=$_(Object.prototype.toString),Hn=ze.types,i8=Hn.isAnyArrayBuffer,s8=Hn.isArrayBufferView,sD=Hn.isDate,P0=Hn.isMap,oD=Hn.isRegExp,M0=Hn.isSet,o8=Hn.isNativeError,a8=Hn.isBoxedPrimitive,aD=Hn.isNumberObject,lD=Hn.isStringObject,uD=Hn.isBooleanObject,cD=Hn.isBigIntObject,l8=Hn.isSymbolObject,u8=Hn.isFloat32Array,c8=Hn.isFloat64Array;gD={isDeepEqual:function(r,e){return ts(r,e,!1)},isDeepStrictEqual:function(r,e){return ts(r,e,!0)}},k_={},mD=!1;pt=F_();pt.AssertionError;pt.deepEqual;pt.deepStrictEqual;pt.doesNotReject;pt.doesNotThrow;pt.equal;pt.fail;pt.ifError;pt.notDeepEqual;pt.notDeepStrictEqual;pt.notEqual;pt.notStrictEqual;pt.ok;pt.rejects;pt.strict;pt.strictEqual;pt.throws;pt.AssertionError;pt.deepEqual;pt.deepStrictEqual;pt.doesNotReject;pt.doesNotThrow;pt.equal;pt.fail;pt.ifError;pt.notDeepEqual;pt.notDeepStrictEqual;pt.notEqual;pt.notStrictEqual;pt.ok;pt.rejects;pt.strict;pt.strictEqual;pt.throws;pt.AssertionError;pt.deepEqual;pt.deepStrictEqual;pt.doesNotReject;pt.doesNotThrow;pt.equal;pt.fail;pt.ifError;pt.notDeepEqual;pt.notDeepStrictEqual;pt.notEqual;pt.notStrictEqual;pt.ok;pt.rejects;pt.strict;pt.strictEqual;pt.throws});var W_,W0=Jt(()=>{Ce();De();Re();ul();ze._extend;ze.callbackify;ze.debuglog;ze.deprecate;ze.format;ze.inherits;ze.inspect;ze.isArray;ze.isBoolean;ze.isBuffer;ze.isDate;ze.isError;ze.isFunction;ze.isNull;ze.isNullOrUndefined;ze.isNumber;ze.isObject;ze.isPrimitive;ze.isRegExp;ze.isString;ze.isSymbol;ze.isUndefined;ze.log;W_=ze.promisify;ze.types;ze.TextEncoder=globalThis.TextEncoder;ze.TextDecoder=globalThis.TextDecoder});function g8(){if(OD)return q_;OD=!0;var r=q_={},e,t;function n(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?e=setTimeout:e=n}catch{e=n}try{typeof clearTimeout=="function"?t=clearTimeout:t=i}catch{t=i}})();function o(v){if(e===setTimeout)return setTimeout(v,0);if((e===n||!e)&&setTimeout)return e=setTimeout,setTimeout(v,0);try{return e(v,0)}catch{try{return e.call(null,v,0)}catch{return e.call(this||zf,v,0)}}}function s(v){if(t===clearTimeout)return clearTimeout(v);if((t===i||!t)&&clearTimeout)return t=clearTimeout,clearTimeout(v);try{return t(v)}catch{try{return t.call(null,v)}catch{return t.call(this||zf,v)}}}var a=[],u=!1,c,f=-1;function h(){!u||!c||(u=!1,c.length?a=c.concat(a):f=-1,a.length&&p())}function p(){if(!u){var v=o(h);u=!0;for(var w=a.length;w;){for(c=a,a=[];++f<w;)c&&c[f].run();f=-1,w=a.length}c=null,u=!1,s(v)}}r.nextTick=function(v){var w=new Array(arguments.length-1);if(arguments.length>1)for(var y=1;y<arguments.length;y++)w[y-1]=arguments[y];a.push(new m(v,w)),a.length===1&&!u&&o(p)};function m(v,w){(this||zf).fun=v,(this||zf).array=w}m.prototype.run=function(){(this||zf).fun.apply(null,(this||zf).array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={};function b(){}return r.on=b,r.addListener=b,r.once=b,r.off=b,r.removeListener=b,r.removeAllListeners=b,r.emit=b,r.prependListener=b,r.prependOnceListener=b,r.listeners=function(v){return[]},r.binding=function(v){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(v){throw new Error("process.chdir is not supported")},r.umask=function(){return 0},q_}var q_,OD,zf,Gt,Wf=Jt(()=>{Ce();De();Re();q_={},OD=!1,zf=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;Gt=g8();Gt.platform="browser";Gt.addListener;Gt.argv;Gt.binding;Gt.browser;Gt.chdir;Gt.cwd;Gt.emit;Gt.env;Gt.listeners;Gt.nextTick;Gt.off;Gt.on;Gt.once;Gt.prependListener;Gt.prependOnceListener;Gt.removeAllListeners;Gt.removeListener;Gt.title;Gt.umask;Gt.version;Gt.versions});function m8(){if(ND)return H_;ND=!0;var r=Gt;function e(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function t(o,s){for(var a="",u=0,c=-1,f=0,h,p=0;p<=o.length;++p){if(p<o.length)h=o.charCodeAt(p);else{if(h===47)break;h=47}if(h===47){if(!(c===p-1||f===1))if(c!==p-1&&f===2){if(a.length<2||u!==2||a.charCodeAt(a.length-1)!==46||a.charCodeAt(a.length-2)!==46){if(a.length>2){var m=a.lastIndexOf("/");if(m!==a.length-1){m===-1?(a="",u=0):(a=a.slice(0,m),u=a.length-1-a.lastIndexOf("/")),c=p,f=0;continue}}else if(a.length===2||a.length===1){a="",u=0,c=p,f=0;continue}}s&&(a.length>0?a+="/..":a="..",u=2)}else a.length>0?a+="/"+o.slice(c+1,p):a=o.slice(c+1,p),u=p-c-1;c=p,f=0}else h===46&&f!==-1?++f:f=-1}return a}function n(o,s){var a=s.dir||s.root,u=s.base||(s.name||"")+(s.ext||"");return a?a===s.root?a+u:a+o+u:u}var i={resolve:function(){for(var s="",a=!1,u,c=arguments.length-1;c>=-1&&!a;c--){var f;c>=0?f=arguments[c]:(u===void 0&&(u=r.cwd()),f=u),e(f),f.length!==0&&(s=f+"/"+s,a=f.charCodeAt(0)===47)}return s=t(s,!a),a?s.length>0?"/"+s:"/":s.length>0?s:"."},normalize:function(s){if(e(s),s.length===0)return".";var a=s.charCodeAt(0)===47,u=s.charCodeAt(s.length-1)===47;return s=t(s,!a),s.length===0&&!a&&(s="."),s.length>0&&u&&(s+="/"),a?"/"+s:s},isAbsolute:function(s){return e(s),s.length>0&&s.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var s,a=0;a<arguments.length;++a){var u=arguments[a];e(u),u.length>0&&(s===void 0?s=u:s+="/"+u)}return s===void 0?".":i.normalize(s)},relative:function(s,a){if(e(s),e(a),s===a||(s=i.resolve(s),a=i.resolve(a),s===a))return"";for(var u=1;u<s.length&&s.charCodeAt(u)===47;++u);for(var c=s.length,f=c-u,h=1;h<a.length&&a.charCodeAt(h)===47;++h);for(var p=a.length,m=p-h,b=f<m?f:m,v=-1,w=0;w<=b;++w){if(w===b){if(m>b){if(a.charCodeAt(h+w)===47)return a.slice(h+w+1);if(w===0)return a.slice(h+w)}else f>b&&(s.charCodeAt(u+w)===47?v=w:w===0&&(v=0));break}var y=s.charCodeAt(u+w),_=a.charCodeAt(h+w);if(y!==_)break;y===47&&(v=w)}var E="";for(w=u+v+1;w<=c;++w)(w===c||s.charCodeAt(w)===47)&&(E.length===0?E+="..":E+="/..");return E.length>0?E+a.slice(h+v):(h+=v,a.charCodeAt(h)===47&&++h,a.slice(h))},_makeLong:function(s){return s},dirname:function(s){if(e(s),s.length===0)return".";for(var a=s.charCodeAt(0),u=a===47,c=-1,f=!0,h=s.length-1;h>=1;--h)if(a=s.charCodeAt(h),a===47){if(!f){c=h;break}}else f=!1;return c===-1?u?"/":".":u&&c===1?"//":s.slice(0,c)},basename:function(s,a){if(a!==void 0&&typeof a!="string")throw new TypeError('"ext" argument must be a string');e(s);var u=0,c=-1,f=!0,h;if(a!==void 0&&a.length>0&&a.length<=s.length){if(a.length===s.length&&a===s)return"";var p=a.length-1,m=-1;for(h=s.length-1;h>=0;--h){var b=s.charCodeAt(h);if(b===47){if(!f){u=h+1;break}}else m===-1&&(f=!1,m=h+1),p>=0&&(b===a.charCodeAt(p)?--p===-1&&(c=h):(p=-1,c=m))}return u===c?c=m:c===-1&&(c=s.length),s.slice(u,c)}else{for(h=s.length-1;h>=0;--h)if(s.charCodeAt(h)===47){if(!f){u=h+1;break}}else c===-1&&(f=!1,c=h+1);return c===-1?"":s.slice(u,c)}},extname:function(s){e(s);for(var a=-1,u=0,c=-1,f=!0,h=0,p=s.length-1;p>=0;--p){var m=s.charCodeAt(p);if(m===47){if(!f){u=p+1;break}continue}c===-1&&(f=!1,c=p+1),m===46?a===-1?a=p:h!==1&&(h=1):a!==-1&&(h=-1)}return a===-1||c===-1||h===0||h===1&&a===c-1&&a===u+1?"":s.slice(a,c)},format:function(s){if(s===null||typeof s!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof s);return n("/",s)},parse:function(s){e(s);var a={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return a;var u=s.charCodeAt(0),c=u===47,f;c?(a.root="/",f=1):f=0;for(var h=-1,p=0,m=-1,b=!0,v=s.length-1,w=0;v>=f;--v){if(u=s.charCodeAt(v),u===47){if(!b){p=v+1;break}continue}m===-1&&(b=!1,m=v+1),u===46?h===-1?h=v:w!==1&&(w=1):h!==-1&&(w=-1)}return h===-1||m===-1||w===0||w===1&&h===m-1&&h===p+1?m!==-1&&(p===0&&c?a.base=a.name=s.slice(1,m):a.base=a.name=s.slice(p,m)):(p===0&&c?(a.name=s.slice(1,h),a.base=s.slice(1,m)):(a.name=s.slice(p,h),a.base=s.slice(p,m)),a.ext=s.slice(h,m)),p>0?a.dir=s.slice(0,p-1):c&&(a.dir="/"),a},sep:"/",delimiter:":",win32:null,posix:null};return i.posix=i,H_=i,H_}function Lu(r){throw new RangeError(v8[r])}function kD(r,e){let t=r.split("@"),n="";t.length>1&&(n=t[0]+"@",r=t[1]);let i=(function(o,s){let a=[],u=o.length;for(;u--;)a[u]=s(o[u]);return a})((r=r.replace(w8,".")).split("."),e).join(".");return n+i}function zD(r){let e=[],t=0,n=r.length;for(;t<n;){let i=r.charCodeAt(t++);if(i>=55296&&i<=56319&&t<n){let o=r.charCodeAt(t++);(64512&o)==56320?e.push(((1023&i)<<10)+(1023&o)+65536):(e.push(i),t--)}else e.push(i)}return e}function E8(r,e){return Object.prototype.hasOwnProperty.call(r,e)}function rs(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function Pp(r,e,t){if(r&&Qs.isObject(r)&&r instanceof rs)return r;var n=new rs;return n.parse(r,e,t),n}function N8(){if(jD)return X_;jD=!0;var r=lr;function e(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function t(o,s){for(var a="",u=0,c=-1,f=0,h,p=0;p<=o.length;++p){if(p<o.length)h=o.charCodeAt(p);else{if(h===47)break;h=47}if(h===47){if(!(c===p-1||f===1))if(c!==p-1&&f===2){if(a.length<2||u!==2||a.charCodeAt(a.length-1)!==46||a.charCodeAt(a.length-2)!==46){if(a.length>2){var m=a.lastIndexOf("/");if(m!==a.length-1){m===-1?(a="",u=0):(a=a.slice(0,m),u=a.length-1-a.lastIndexOf("/")),c=p,f=0;continue}}else if(a.length===2||a.length===1){a="",u=0,c=p,f=0;continue}}s&&(a.length>0?a+="/..":a="..",u=2)}else a.length>0?a+="/"+o.slice(c+1,p):a=o.slice(c+1,p),u=p-c-1;c=p,f=0}else h===46&&f!==-1?++f:f=-1}return a}function n(o,s){var a=s.dir||s.root,u=s.base||(s.name||"")+(s.ext||"");return a?a===s.root?a+u:a+o+u:u}var i={resolve:function(){for(var s="",a=!1,u,c=arguments.length-1;c>=-1&&!a;c--){var f;c>=0?f=arguments[c]:(u===void 0&&(u=r.cwd()),f=u),e(f),f.length!==0&&(s=f+"/"+s,a=f.charCodeAt(0)===47)}return s=t(s,!a),a?s.length>0?"/"+s:"/":s.length>0?s:"."},normalize:function(s){if(e(s),s.length===0)return".";var a=s.charCodeAt(0)===47,u=s.charCodeAt(s.length-1)===47;return s=t(s,!a),s.length===0&&!a&&(s="."),s.length>0&&u&&(s+="/"),a?"/"+s:s},isAbsolute:function(s){return e(s),s.length>0&&s.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var s,a=0;a<arguments.length;++a){var u=arguments[a];e(u),u.length>0&&(s===void 0?s=u:s+="/"+u)}return s===void 0?".":i.normalize(s)},relative:function(s,a){if(e(s),e(a),s===a||(s=i.resolve(s),a=i.resolve(a),s===a))return"";for(var u=1;u<s.length&&s.charCodeAt(u)===47;++u);for(var c=s.length,f=c-u,h=1;h<a.length&&a.charCodeAt(h)===47;++h);for(var p=a.length,m=p-h,b=f<m?f:m,v=-1,w=0;w<=b;++w){if(w===b){if(m>b){if(a.charCodeAt(h+w)===47)return a.slice(h+w+1);if(w===0)return a.slice(h+w)}else f>b&&(s.charCodeAt(u+w)===47?v=w:w===0&&(v=0));break}var y=s.charCodeAt(u+w),_=a.charCodeAt(h+w);if(y!==_)break;y===47&&(v=w)}var E="";for(w=u+v+1;w<=c;++w)(w===c||s.charCodeAt(w)===47)&&(E.length===0?E+="..":E+="/..");return E.length>0?E+a.slice(h+v):(h+=v,a.charCodeAt(h)===47&&++h,a.slice(h))},_makeLong:function(s){return s},dirname:function(s){if(e(s),s.length===0)return".";for(var a=s.charCodeAt(0),u=a===47,c=-1,f=!0,h=s.length-1;h>=1;--h)if(a=s.charCodeAt(h),a===47){if(!f){c=h;break}}else f=!1;return c===-1?u?"/":".":u&&c===1?"//":s.slice(0,c)},basename:function(s,a){if(a!==void 0&&typeof a!="string")throw new TypeError('"ext" argument must be a string');e(s);var u=0,c=-1,f=!0,h;if(a!==void 0&&a.length>0&&a.length<=s.length){if(a.length===s.length&&a===s)return"";var p=a.length-1,m=-1;for(h=s.length-1;h>=0;--h){var b=s.charCodeAt(h);if(b===47){if(!f){u=h+1;break}}else m===-1&&(f=!1,m=h+1),p>=0&&(b===a.charCodeAt(p)?--p===-1&&(c=h):(p=-1,c=m))}return u===c?c=m:c===-1&&(c=s.length),s.slice(u,c)}else{for(h=s.length-1;h>=0;--h)if(s.charCodeAt(h)===47){if(!f){u=h+1;break}}else c===-1&&(f=!1,c=h+1);return c===-1?"":s.slice(u,c)}},extname:function(s){e(s);for(var a=-1,u=0,c=-1,f=!0,h=0,p=s.length-1;p>=0;--p){var m=s.charCodeAt(p);if(m===47){if(!f){u=p+1;break}continue}c===-1&&(f=!1,c=p+1),m===46?a===-1?a=p:h!==1&&(h=1):a!==-1&&(h=-1)}return a===-1||c===-1||h===0||h===1&&a===c-1&&a===u+1?"":s.slice(a,c)},format:function(s){if(s===null||typeof s!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof s);return n("/",s)},parse:function(s){e(s);var a={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return a;var u=s.charCodeAt(0),c=u===47,f;c?(a.root="/",f=1):f=0;for(var h=-1,p=0,m=-1,b=!0,v=s.length-1,w=0;v>=f;--v){if(u=s.charCodeAt(v),u===47){if(!b){p=v+1;break}continue}m===-1&&(b=!1,m=v+1),u===46?h===-1?h=v:w!==1&&(w=1):h!==-1&&(w=-1)}return h===-1||m===-1||w===0||w===1&&h===m-1&&h===p+1?m!==-1&&(p===0&&c?a.base=a.name=s.slice(1,m):a.base=a.name=s.slice(p,m)):(p===0&&c?(a.name=s.slice(1,h),a.base=s.slice(1,m)):(a.name=s.slice(p,h),a.base=s.slice(p,m)),a.ext=s.slice(h,m)),p>0?a.dir=s.slice(0,p-1):c&&(a.dir="/"),a},sep:"/",delimiter:":",win32:null,posix:null};return i.posix=i,X_=i,X_}function q8(r){if(typeof r=="string")r=new URL(r);else if(!(r instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if(r.protocol!=="file:")throw new Deno.errors.InvalidData("invalid url scheme");return Z_?H8(r):G8(r)}function H8(r){let e=r.hostname,t=r.pathname;for(let n=0;n<t.length;n++)if(t[n]==="%"){let i=t.codePointAt(n+2)||32;if(t[n+1]==="2"&&i===102||t[n+1]==="5"&&i===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(t=t.replace(F8,"\\"),t=decodeURIComponent(t),e!=="")return`\\\\${e}${t}`;{let n=t.codePointAt(1)|32,i=t[2];if(n<M8||n>B8||i!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return t.slice(1)}}function G8(r){if(r.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let e=r.pathname;for(let t=0;t<e.length;t++)if(e[t]==="%"){let n=e.codePointAt(t+2)||32;if(e[t+1]==="2"&&n===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(e)}function V8(r){let e=$D.resolve(r),t=r.charCodeAt(r.length-1);(t===P8||Z_&&t===L8)&&e[e.length-1]!==$D.sep&&(e+="/");let n=new URL("file://");return e.includes("%")&&(e=e.replace(U8,"%25")),!Z_&&e.includes("\\")&&(e=e.replace(j8,"%5C")),e.includes(`
72
+ `)&&(e=e.replace($8,"%0A")),e.includes("\r")&&(e=e.replace(z8,"%0D")),e.includes(" ")&&(e=e.replace(W8,"%09")),n.pathname=e,n}function s4(r){if(typeof r=="string")r=new URL(r);else if(!(r instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if(r.protocol!=="file:")throw new Deno.errors.InvalidData("invalid url scheme");return J_?o4(r):a4(r)}function o4(r){let e=r.hostname,t=r.pathname;for(let n=0;n<t.length;n++)if(t[n]==="%"){let i=t.codePointAt(n+2)||32;if(t[n+1]==="2"&&i===102||t[n+1]==="5"&&i===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(t=t.replace(Q8,"\\"),t=decodeURIComponent(t),e!=="")return`\\\\${e}${t}`;{let n=t.codePointAt(1)|32,i=t[2];if(n<Z8||n>J8||i!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return t.slice(1)}}function a4(r){if(r.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let e=r.pathname;for(let t=0;t<e.length;t++)if(e[t]==="%"){let n=e.codePointAt(t+2)||32;if(e[t+1]==="2"&&n===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(e)}function l4(r){let e=rn.resolve(r),t=r.charCodeAt(r.length-1);(t===K8||J_&&t===X8)&&e[e.length-1]!==rn.sep&&(e+="/");let n=new URL("file://");return e.includes("%")&&(e=e.replace(e4,"%25")),!J_&&e.includes("\\")&&(e=e.replace(t4,"%5C")),e.includes(`
73
+ `)&&(e=e.replace(r4,"%0A")),e.includes("\r")&&(e=e.replace(n4,"%0D")),e.includes(" ")&&(e=e.replace(i4,"%09")),n.pathname=e,n}var H_,ND,rn,Hf,y8,b8,w8,v8,eo,G_,LD,WD,PD,MD,_8,A8,Lp,x8,Go,Qt,S8,Qs,T8,C8,R8,D8,K_,BD,FD,UD,I8,O8,V_,qf,Y_,X_,jD,$D,k8,L8,P8,M8,B8,Z_,F8,U8,j8,$8,z8,W8,Y8,X8,K8,Z8,J8,J_,Q8,e4,t4,r4,n4,i4,qD=Jt(()=>{Ce();De();Re();ul();Wf();H_={},ND=!1;rn=m8(),Hf=2147483647,y8=/^xn--/,b8=/[^\0-\x7E]/,w8=/[\x2E\u3002\uFF0E\uFF61]/g,v8={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},eo=Math.floor,G_=String.fromCharCode;LD=function(r,e){return r+22+75*(r<26)-((e!=0)<<5)},WD=function(r,e,t){let n=0;for(r=t?eo(r/700):r>>1,r+=eo(r/e);r>455;n+=36)r=eo(r/35);return eo(n+36*r/(r+38))},PD=function(r){let e=[],t=r.length,n=0,i=128,o=72,s=r.lastIndexOf("-");s<0&&(s=0);for(let u=0;u<s;++u)r.charCodeAt(u)>=128&&Lu("not-basic"),e.push(r.charCodeAt(u));for(let u=s>0?s+1:0;u<t;){let c=n;for(let h=1,p=36;;p+=36){u>=t&&Lu("invalid-input");let m=(a=r.charCodeAt(u++))-48<10?a-22:a-65<26?a-65:a-97<26?a-97:36;(m>=36||m>eo((Hf-n)/h))&&Lu("overflow"),n+=m*h;let b=p<=o?1:p>=o+26?26:p-o;if(m<b)break;let v=36-b;h>eo(Hf/v)&&Lu("overflow"),h*=v}let f=e.length+1;o=WD(n-c,f,c==0),eo(n/f)>Hf-i&&Lu("overflow"),i+=eo(n/f),n%=f,e.splice(n++,0,i)}var a;return String.fromCodePoint(...e)},MD=function(r){let e=[],t=(r=zD(r)).length,n=128,i=0,o=72;for(let u of r)u<128&&e.push(G_(u));let s=e.length,a=s;for(s&&e.push("-");a<t;){let u=Hf;for(let f of r)f>=n&&f<u&&(u=f);let c=a+1;u-n>eo((Hf-i)/c)&&Lu("overflow"),i+=(u-n)*c,n=u;for(let f of r)if(f<n&&++i>Hf&&Lu("overflow"),f==n){let h=i;for(let p=36;;p+=36){let m=p<=o?1:p>=o+26?26:p-o;if(h<m)break;let b=h-m,v=36-m;e.push(G_(LD(m+b%v,0))),h=eo(b/v)}e.push(G_(LD(h,0))),o=WD(i,c,a==s),i=0,++a}++i,++n}return e.join("")},_8={version:"2.1.0",ucs2:{decode:zD,encode:r=>String.fromCodePoint(...r)},decode:PD,encode:MD,toASCII:function(r){return kD(r,(function(e){return b8.test(e)?"xn--"+MD(e):e}))},toUnicode:function(r){return kD(r,(function(e){return y8.test(e)?PD(e.slice(4).toLowerCase()):e}))}};A8=function(r,e,t,n){e=e||"&",t=t||"=";var i={};if(typeof r!="string"||r.length===0)return i;var o=/\+/g;r=r.split(e);var s=1e3;n&&typeof n.maxKeys=="number"&&(s=n.maxKeys);var a=r.length;s>0&&a>s&&(a=s);for(var u=0;u<a;++u){var c,f,h,p,m=r[u].replace(o,"%20"),b=m.indexOf(t);b>=0?(c=m.substr(0,b),f=m.substr(b+1)):(c=m,f=""),h=decodeURIComponent(c),p=decodeURIComponent(f),E8(i,h)?Array.isArray(i[h])?i[h].push(p):i[h]=[i[h],p]:i[h]=p}return i},Lp=function(r){switch(typeof r){case"string":return r;case"boolean":return r?"true":"false";case"number":return isFinite(r)?r:"";default:return""}},x8=function(r,e,t,n){return e=e||"&",t=t||"=",r===null&&(r=void 0),typeof r=="object"?Object.keys(r).map((function(i){var o=encodeURIComponent(Lp(i))+t;return Array.isArray(r[i])?r[i].map((function(s){return o+encodeURIComponent(Lp(s))})).join(e):o+encodeURIComponent(Lp(r[i]))})).join(e):n?encodeURIComponent(Lp(n))+t+encodeURIComponent(Lp(r)):""},Go={};Go.decode=Go.parse=A8,Go.encode=Go.stringify=x8;Go.decode;Go.encode;Go.parse;Go.stringify;Qt={},S8=_8,Qs={isString:function(r){return typeof r=="string"},isObject:function(r){return typeof r=="object"&&r!==null},isNull:function(r){return r===null},isNullOrUndefined:function(r){return r==null}};Qt.parse=Pp,Qt.resolve=function(r,e){return Pp(r,!1,!0).resolve(e)},Qt.resolveObject=function(r,e){return r?Pp(r,!1,!0).resolveObject(e):e},Qt.format=function(r){return Qs.isString(r)&&(r=Pp(r)),r instanceof rs?r.format():rs.prototype.format.call(r)},Qt.Url=rs;T8=/^([a-z0-9.+-]+:)/i,C8=/:[0-9]*$/,R8=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,D8=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
74
+ `," "]),K_=["'"].concat(D8),BD=["%","/","?",";","#"].concat(K_),FD=["/","?","#"],UD=/^[+a-z0-9A-Z_-]{0,63}$/,I8=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,O8={javascript:!0,"javascript:":!0},V_={javascript:!0,"javascript:":!0},qf={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},Y_=Go;rs.prototype.parse=function(r,e,t){if(!Qs.isString(r))throw new TypeError("Parameter 'url' must be a string, not "+typeof r);var n=r.indexOf("?"),i=n!==-1&&n<r.indexOf("#")?"?":"#",o=r.split(i);o[0]=o[0].replace(/\\/g,"/");var s=r=o.join(i);if(s=s.trim(),!t&&r.split("#").length===1){var a=R8.exec(s);if(a)return this.path=s,this.href=s,this.pathname=a[1],a[2]?(this.search=a[2],this.query=e?Y_.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var u=T8.exec(s);if(u){var c=(u=u[0]).toLowerCase();this.protocol=c,s=s.substr(u.length)}if(t||u||s.match(/^\/\/[^@\/]+@[^@\/]+/)){var f=s.substr(0,2)==="//";!f||u&&V_[u]||(s=s.substr(2),this.slashes=!0)}if(!V_[u]&&(f||u&&!qf[u])){for(var h,p,m=-1,b=0;b<FD.length;b++)(v=s.indexOf(FD[b]))!==-1&&(m===-1||v<m)&&(m=v);for((p=m===-1?s.lastIndexOf("@"):s.lastIndexOf("@",m))!==-1&&(h=s.slice(0,p),s=s.slice(p+1),this.auth=decodeURIComponent(h)),m=-1,b=0;b<BD.length;b++){var v;(v=s.indexOf(BD[b]))!==-1&&(m===-1||v<m)&&(m=v)}m===-1&&(m=s.length),this.host=s.slice(0,m),s=s.slice(m),this.parseHost(),this.hostname=this.hostname||"";var w=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!w)for(var y=this.hostname.split(/\./),_=(b=0,y.length);b<_;b++){var E=y[b];if(E&&!E.match(UD)){for(var S="",A=0,F=E.length;A<F;A++)E.charCodeAt(A)>127?S+="x":S+=E[A];if(!S.match(UD)){var D=y.slice(0,b),H=y.slice(b+1),J=E.match(I8);J&&(D.push(J[1]),H.unshift(J[2])),H.length&&(s="/"+H.join(".")+s),this.hostname=D.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),w||(this.hostname=S8.toASCII(this.hostname));var K=this.port?":"+this.port:"",ne=this.hostname||"";this.host=ne+K,this.href+=this.host,w&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),s[0]!=="/"&&(s="/"+s))}if(!O8[c])for(b=0,_=K_.length;b<_;b++){var k=K_[b];if(s.indexOf(k)!==-1){var $=encodeURIComponent(k);$===k&&($=escape(k)),s=s.split(k).join($)}}var Y=s.indexOf("#");Y!==-1&&(this.hash=s.substr(Y),s=s.slice(0,Y));var ie=s.indexOf("?");if(ie!==-1?(this.search=s.substr(ie),this.query=s.substr(ie+1),e&&(this.query=Y_.parse(this.query)),s=s.slice(0,ie)):e&&(this.search="",this.query={}),s&&(this.pathname=s),qf[c]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){K=this.pathname||"";var re=this.search||"";this.path=K+re}return this.href=this.format(),this},rs.prototype.format=function(){var r=this.auth||"";r&&(r=(r=encodeURIComponent(r)).replace(/%3A/i,":"),r+="@");var e=this.protocol||"",t=this.pathname||"",n=this.hash||"",i=!1,o="";this.host?i=r+this.host:this.hostname&&(i=r+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&Qs.isObject(this.query)&&Object.keys(this.query).length&&(o=Y_.stringify(this.query));var s=this.search||o&&"?"+o||"";return e&&e.substr(-1)!==":"&&(e+=":"),this.slashes||(!e||qf[e])&&i!==!1?(i="//"+(i||""),t&&t.charAt(0)!=="/"&&(t="/"+t)):i||(i=""),n&&n.charAt(0)!=="#"&&(n="#"+n),s&&s.charAt(0)!=="?"&&(s="?"+s),e+i+(t=t.replace(/[?#]/g,(function(a){return encodeURIComponent(a)})))+(s=s.replace("#","%23"))+n},rs.prototype.resolve=function(r){return this.resolveObject(Pp(r,!1,!0)).format()},rs.prototype.resolveObject=function(r){if(Qs.isString(r)){var e=new rs;e.parse(r,!1,!0),r=e}for(var t=new rs,n=Object.keys(this),i=0;i<n.length;i++){var o=n[i];t[o]=this[o]}if(t.hash=r.hash,r.href==="")return t.href=t.format(),t;if(r.slashes&&!r.protocol){for(var s=Object.keys(r),a=0;a<s.length;a++){var u=s[a];u!=="protocol"&&(t[u]=r[u])}return qf[t.protocol]&&t.hostname&&!t.pathname&&(t.path=t.pathname="/"),t.href=t.format(),t}if(r.protocol&&r.protocol!==t.protocol){if(!qf[r.protocol]){for(var c=Object.keys(r),f=0;f<c.length;f++){var h=c[f];t[h]=r[h]}return t.href=t.format(),t}if(t.protocol=r.protocol,r.host||V_[r.protocol])t.pathname=r.pathname;else{for(var p=(r.pathname||"").split("/");p.length&&!(r.host=p.shift()););r.host||(r.host=""),r.hostname||(r.hostname=""),p[0]!==""&&p.unshift(""),p.length<2&&p.unshift(""),t.pathname=p.join("/")}if(t.search=r.search,t.query=r.query,t.host=r.host||"",t.auth=r.auth,t.hostname=r.hostname||r.host,t.port=r.port,t.pathname||t.search){var m=t.pathname||"",b=t.search||"";t.path=m+b}return t.slashes=t.slashes||r.slashes,t.href=t.format(),t}var v=t.pathname&&t.pathname.charAt(0)==="/",w=r.host||r.pathname&&r.pathname.charAt(0)==="/",y=w||v||t.host&&r.pathname,_=y,E=t.pathname&&t.pathname.split("/")||[],S=(p=r.pathname&&r.pathname.split("/")||[],t.protocol&&!qf[t.protocol]);if(S&&(t.hostname="",t.port=null,t.host&&(E[0]===""?E[0]=t.host:E.unshift(t.host)),t.host="",r.protocol&&(r.hostname=null,r.port=null,r.host&&(p[0]===""?p[0]=r.host:p.unshift(r.host)),r.host=null),y=y&&(p[0]===""||E[0]==="")),w)t.host=r.host||r.host===""?r.host:t.host,t.hostname=r.hostname||r.hostname===""?r.hostname:t.hostname,t.search=r.search,t.query=r.query,E=p;else if(p.length)E||(E=[]),E.pop(),E=E.concat(p),t.search=r.search,t.query=r.query;else if(!Qs.isNullOrUndefined(r.search))return S&&(t.hostname=t.host=E.shift(),(J=!!(t.host&&t.host.indexOf("@")>0)&&t.host.split("@"))&&(t.auth=J.shift(),t.host=t.hostname=J.shift())),t.search=r.search,t.query=r.query,Qs.isNull(t.pathname)&&Qs.isNull(t.search)||(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.href=t.format(),t;if(!E.length)return t.pathname=null,t.search?t.path="/"+t.search:t.path=null,t.href=t.format(),t;for(var A=E.slice(-1)[0],F=(t.host||r.host||E.length>1)&&(A==="."||A==="..")||A==="",D=0,H=E.length;H>=0;H--)(A=E[H])==="."?E.splice(H,1):A===".."?(E.splice(H,1),D++):D&&(E.splice(H,1),D--);if(!y&&!_)for(;D--;D)E.unshift("..");!y||E[0]===""||E[0]&&E[0].charAt(0)==="/"||E.unshift(""),F&&E.join("/").substr(-1)!=="/"&&E.push("");var J,K=E[0]===""||E[0]&&E[0].charAt(0)==="/";return S&&(t.hostname=t.host=K?"":E.length?E.shift():"",(J=!!(t.host&&t.host.indexOf("@")>0)&&t.host.split("@"))&&(t.auth=J.shift(),t.host=t.hostname=J.shift())),(y=y||t.host&&E.length)&&!K&&E.unshift(""),E.length?t.pathname=E.join("/"):(t.pathname=null,t.path=null),Qs.isNull(t.pathname)&&Qs.isNull(t.search)||(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.auth=r.auth||t.auth,t.slashes=t.slashes||r.slashes,t.href=t.format(),t},rs.prototype.parseHost=function(){var r=this.host,e=C8.exec(r);e&&((e=e[0])!==":"&&(this.port=e.substr(1)),r=r.substr(0,r.length-e.length)),r&&(this.hostname=r)};Qt.Url;Qt.format;Qt.resolve;Qt.resolveObject;X_={},jD=!1;$D=N8(),k8=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;Qt.URL=typeof URL<"u"?URL:null;Qt.pathToFileURL=V8;Qt.fileURLToPath=q8;Qt.Url;Qt.format;Qt.resolve;Qt.resolveObject;Qt.URL;L8=92,P8=47,M8=97,B8=122,Z_=k8==="win32",F8=/\//g,U8=/%/g,j8=/\\/g,$8=/\n/g,z8=/\r/g,W8=/\t/g;Y8=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;Qt.URL=typeof URL<"u"?URL:null;Qt.pathToFileURL=l4;Qt.fileURLToPath=s4;Qt.Url;Qt.format;Qt.resolve;Qt.resolveObject;Qt.parse;Qt.URL;X8=92,K8=47,Z8=97,J8=122,J_=Y8==="win32",Q8=/\//g,e4=/%/g,t4=/\\/g,r4=/\n/g,n4=/\r/g,i4=/\t/g});function rE(r){throw new Error("Node.js process "+r+" is not supported by JSPM core outside of Node.js")}function u4(){!Gf||!Pu||(Gf=!1,Pu.length?Vo=Pu.concat(Vo):q0=-1,Vo.length&&HD())}function HD(){if(!Gf){var r=setTimeout(u4,0);Gf=!0;for(var e=Vo.length;e;){for(Pu=Vo,Vo=[];++q0<e;)Pu&&Pu[q0].run();q0=-1,e=Vo.length}Pu=null,Gf=!1,clearTimeout(r)}}function c4(r){var e=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];Vo.push(new GD(r,e)),Vo.length===1&&!Gf&&setTimeout(HD,0)}function GD(r,e){this.fun=r,this.array=e}function kn(){}function C4(r){rE("_linkedBinding")}function O4(r){rE("dlopen")}function N4(){return[]}function k4(){return[]}function z4(r,e){if(!r)throw new Error(e||"assertion error")}function G4(){return!1}function u5(){return cl.now()/1e3}function tE(r){var e=Math.floor((Date.now()-cl.now())*.001),t=cl.now()*.001,n=Math.floor(t)+e,i=Math.floor(t%1*1e9);return r&&(n=n-r[0],i=i-r[1],i<0&&(n--,i+=eE)),[n,i]}function fl(){return zr}function _5(r){return[]}var Vo,Gf,Pu,q0,f4,h4,d4,p4,g4,m4,y4,b4,w4,v4,_4,E4,A4,x4,S4,T4,R4,D4,I4,L4,P4,nE,M4,B4,F4,U4,j4,$4,W4,q4,H4,V4,Y4,X4,K4,Z4,J4,Q4,e5,t5,r5,n5,i5,s5,o5,a5,l5,cl,Q_,eE,c5,f5,h5,d5,p5,g5,m5,y5,b5,w5,v5,zr,Mu=Jt(()=>{Ce();De();Re();Vo=[],Gf=!1,q0=-1;GD.prototype.run=function(){this.fun.apply(null,this.array)};f4="browser",h4="x64",d4="browser",p4={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},g4=["/usr/bin/node"],m4=[],y4="v16.8.0",b4={},w4=function(r,e){console.warn((e?e+": ":"")+r)},v4=function(r){rE("binding")},_4=function(r){return 0},E4=function(){return"/"},A4=function(r){},x4={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};S4=kn,T4=[];R4={},D4=!1,I4={};L4=kn,P4=kn,nE=function(){return{}},M4=nE,B4=nE,F4=kn,U4=kn,j4=kn,$4={};W4={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},q4=kn,H4=kn;V4=kn,Y4=kn,X4=kn,K4=kn,Z4=kn,J4=void 0,Q4=void 0,e5=void 0,t5=kn,r5=2,n5=1,i5="/bin/usr/node",s5=9229,o5="node",a5=[],l5=kn,cl={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};cl.now===void 0&&(Q_=Date.now(),cl.timing&&cl.timing.navigationStart&&(Q_=cl.timing.navigationStart),cl.now=()=>Date.now()-Q_);eE=1e9;tE.bigint=function(r){var e=tE(r);return typeof BigInt>"u"?e[0]*eE+e[1]:BigInt(e[0]*eE)+BigInt(e[1])};c5=10,f5={},h5=0;d5=fl,p5=fl,g5=fl,m5=fl,y5=fl,b5=kn,w5=fl,v5=fl;zr={version:y4,versions:b4,arch:h4,platform:d4,release:x4,_rawDebug:S4,moduleLoadList:T4,binding:v4,_linkedBinding:C4,_events:f5,_eventsCount:h5,_maxListeners:c5,on:fl,addListener:d5,once:p5,off:g5,removeListener:m5,removeAllListeners:y5,emit:b5,prependListener:w5,prependOnceListener:v5,listeners:_5,domain:R4,_exiting:D4,config:I4,dlopen:O4,uptime:u5,_getActiveRequests:N4,_getActiveHandles:k4,reallyExit:L4,_kill:P4,cpuUsage:nE,resourceUsage:M4,memoryUsage:B4,kill:F4,exit:U4,openStdin:j4,allowedNodeEnvironmentFlags:$4,assert:z4,features:W4,_fatalExceptions:q4,setUncaughtExceptionCaptureCallback:H4,hasUncaughtExceptionCaptureCallback:G4,emitWarning:w4,nextTick:c4,_tickCallback:V4,_debugProcess:Y4,_debugEnd:X4,_startProfilerIdleNotifier:K4,_stopProfilerIdleNotifier:Z4,stdout:J4,stdin:e5,stderr:Q4,abort:t5,umask:_4,chdir:A4,cwd:E4,env:p4,title:f4,argv:g4,execArgv:m4,pid:r5,ppid:n5,execPath:i5,debugPort:s5,hrtime:tE,argv0:o5,_preload_modules:a5,setSourceMapsEnabled:l5}});function er(){er.init.call(this)}function H0(r){if(typeof r!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)}function rI(r){return r._maxListeners===void 0?er.defaultMaxListeners:r._maxListeners}function KD(r,e,t,n){var i,o,s,a;if(H0(t),(o=r._events)===void 0?(o=r._events=Object.create(null),r._eventsCount=0):(o.newListener!==void 0&&(r.emit("newListener",e,t.listener?t.listener:t),o=r._events),s=o[e]),s===void 0)s=o[e]=t,++r._eventsCount;else if(typeof s=="function"?s=o[e]=n?[t,s]:[s,t]:n?s.unshift(t):s.push(t),(i=rI(r))>0&&s.length>i&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=r,u.type=e,u.count=s.length,a=u,console&&console.warn&&console.warn(a)}return r}function E5(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function ZD(r,e,t){var n={fired:!1,wrapFn:void 0,target:r,type:e,listener:t},i=E5.bind(n);return i.listener=t,n.wrapFn=i,i}function JD(r,e,t){var n=r._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?t?[i.listener||i]:[i]:t?(function(o){for(var s=new Array(o.length),a=0;a<s.length;++a)s[a]=o[a].listener||o[a];return s})(i):nI(i,i.length)}function QD(r){var e=this._events;if(e!==void 0){var t=e[r];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}function nI(r,e){for(var t=new Array(e),n=0;n<e;++n)t[n]=r[n];return t}var eI,tI,Vf,VD,YD,XD,nn,Yf=Jt(()=>{Ce();De();Re();Vf=typeof Reflect=="object"?Reflect:null,VD=Vf&&typeof Vf.apply=="function"?Vf.apply:function(r,e,t){return Function.prototype.apply.call(r,e,t)};tI=Vf&&typeof Vf.ownKeys=="function"?Vf.ownKeys:Object.getOwnPropertySymbols?function(r){return Object.getOwnPropertyNames(r).concat(Object.getOwnPropertySymbols(r))}:function(r){return Object.getOwnPropertyNames(r)};YD=Number.isNaN||function(r){return r!=r};eI=er,er.EventEmitter=er,er.prototype._events=void 0,er.prototype._eventsCount=0,er.prototype._maxListeners=void 0;XD=10;Object.defineProperty(er,"defaultMaxListeners",{enumerable:!0,get:function(){return XD},set:function(r){if(typeof r!="number"||r<0||YD(r))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");XD=r}}),er.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},er.prototype.setMaxListeners=function(r){if(typeof r!="number"||r<0||YD(r))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+r+".");return this._maxListeners=r,this},er.prototype.getMaxListeners=function(){return rI(this)},er.prototype.emit=function(r){for(var e=[],t=1;t<arguments.length;t++)e.push(arguments[t]);var n=r==="error",i=this._events;if(i!==void 0)n=n&&i.error===void 0;else if(!n)return!1;if(n){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var a=i[r];if(a===void 0)return!1;if(typeof a=="function")VD(a,this,e);else{var u=a.length,c=nI(a,u);for(t=0;t<u;++t)VD(c[t],this,e)}return!0},er.prototype.addListener=function(r,e){return KD(this,r,e,!1)},er.prototype.on=er.prototype.addListener,er.prototype.prependListener=function(r,e){return KD(this,r,e,!0)},er.prototype.once=function(r,e){return H0(e),this.on(r,ZD(this,r,e)),this},er.prototype.prependOnceListener=function(r,e){return H0(e),this.prependListener(r,ZD(this,r,e)),this},er.prototype.removeListener=function(r,e){var t,n,i,o,s;if(H0(e),(n=this._events)===void 0)return this;if((t=n[r])===void 0)return this;if(t===e||t.listener===e)--this._eventsCount==0?this._events=Object.create(null):(delete n[r],n.removeListener&&this.emit("removeListener",r,t.listener||e));else if(typeof t!="function"){for(i=-1,o=t.length-1;o>=0;o--)if(t[o]===e||t[o].listener===e){s=t[o].listener,i=o;break}if(i<0)return this;i===0?t.shift():(function(a,u){for(;u+1<a.length;u++)a[u]=a[u+1];a.pop()})(t,i),t.length===1&&(n[r]=t[0]),n.removeListener!==void 0&&this.emit("removeListener",r,s||e)}return this},er.prototype.off=er.prototype.removeListener,er.prototype.removeAllListeners=function(r){var e,t,n;if((t=this._events)===void 0)return this;if(t.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):t[r]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete t[r]),this;if(arguments.length===0){var i,o=Object.keys(t);for(n=0;n<o.length;++n)(i=o[n])!=="removeListener"&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(e=t[r])=="function")this.removeListener(r,e);else if(e!==void 0)for(n=e.length-1;n>=0;n--)this.removeListener(r,e[n]);return this},er.prototype.listeners=function(r){return JD(this,r,!0)},er.prototype.rawListeners=function(r){return JD(this,r,!1)},er.listenerCount=function(r,e){return typeof r.listenerCount=="function"?r.listenerCount(e):QD.call(r,e)},er.prototype.listenerCount=QD,er.prototype.eventNames=function(){return this._eventsCount>0?tI(this._events):[]};nn=eI;nn.EventEmitter;nn.defaultMaxListeners;nn.init;nn.listenerCount;nn.EventEmitter;nn.defaultMaxListeners;nn.init;nn.listenerCount});var G0=Jt(()=>{Ce();De();Re();Yf();nn.once=function(r,e){return new Promise((t,n)=>{function i(...s){o!==void 0&&r.removeListener("error",o),t(s)}let o;e!=="error"&&(o=s=>{r.removeListener(name,i),n(s)},r.once("error",o)),r.once(e,i)})};nn.on=function(r,e){let t=[],n=[],i=null,o=!1,s={async next(){let c=t.shift();if(c)return createIterResult(c,!1);if(i){let f=Promise.reject(i);return i=null,f}return o?createIterResult(void 0,!0):new Promise((f,h)=>n.push({resolve:f,reject:h}))},async return(){r.removeListener(e,a),r.removeListener("error",u),o=!0;for(let c of n)c.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(c){i=c,r.removeListener(e,a),r.removeListener("error",u)},[Symbol.asyncIterator](){return this}};return r.on(e,a),r.on("error",u),s;function a(...c){let f=n.shift();f?f.resolve(createIterResult(c,!1)):t.push(c)}function u(c){o=!0;let f=n.shift();f?f.reject(c):i=c,s.return()}}});function oI(r){var e=r.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=r.indexOf("=");return t===-1&&(t=e),[t,t===e?0:4-t%4]}function A5(r,e,t){for(var n,i,o=[],s=e;s<t;s+=3)n=(r[s]<<16&16711680)+(r[s+1]<<8&65280)+(255&r[s+2]),o.push(Cs[(i=n)>>18&63]+Cs[i>>12&63]+Cs[i>>6&63]+Cs[63&i]);return o.join("")}function Yo(r){if(r>2147483647)throw new RangeError('The value "'+r+'" is invalid for option "size"');var e=new Uint8Array(r);return Object.setPrototypeOf(e,Ge.prototype),e}function Ge(r,e,t){if(typeof r=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return AE(r)}return PI(r,e,t)}function PI(r,e,t){if(typeof r=="string")return(function(o,s){if(typeof s=="string"&&s!==""||(s="utf8"),!Ge.isEncoding(s))throw new TypeError("Unknown encoding: "+s);var a=0|BI(o,s),u=Yo(a),c=u.write(o,s);return c!==a&&(u=u.slice(0,c)),u})(r,e);if(ArrayBuffer.isView(r))return iE(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(Xo(r,ArrayBuffer)||r&&Xo(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Xo(r,SharedArrayBuffer)||r&&Xo(r.buffer,SharedArrayBuffer)))return lI(r,e,t);if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var n=r.valueOf&&r.valueOf();if(n!=null&&n!==r)return Ge.from(n,e,t);var i=(function(o){if(Ge.isBuffer(o)){var s=0|CE(o.length),a=Yo(s);return a.length===0||o.copy(a,0,0,s),a}if(o.length!==void 0)return typeof o.length!="number"||RE(o.length)?Yo(0):iE(o);if(o.type==="Buffer"&&Array.isArray(o.data))return iE(o.data)})(r);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return Ge.from(r[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}function MI(r){if(typeof r!="number")throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}function AE(r){return MI(r),Yo(r<0?0:0|CE(r))}function iE(r){for(var e=r.length<0?0:0|CE(r.length),t=Yo(e),n=0;n<e;n+=1)t[n]=255&r[n];return t}function lI(r,e,t){if(e<0||r.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(r.byteLength<e+(t||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=e===void 0&&t===void 0?new Uint8Array(r):t===void 0?new Uint8Array(r,e):new Uint8Array(r,e,t),Object.setPrototypeOf(n,Ge.prototype),n}function CE(r){if(r>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|r}function BI(r,e){if(Ge.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||Xo(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof r);var t=r.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&t===0)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return xE(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*t;case"hex":return t>>>1;case"base64":return $I(r).length;default:if(i)return n?-1:xE(r).length;e=(""+e).toLowerCase(),i=!0}}function S5(r,e,t){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0)<=(e>>>=0))return"";for(r||(r="utf8");;)switch(r){case"hex":return L5(this,e,t);case"utf8":case"utf-8":return UI(this,e,t);case"ascii":return N5(this,e,t);case"latin1":case"binary":return k5(this,e,t);case"base64":return O5(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P5(this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}function Fu(r,e,t){var n=r[e];r[e]=r[t],r[t]=n}function uI(r,e,t,n,i){if(r.length===0)return-1;if(typeof t=="string"?(n=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),RE(t=+t)&&(t=i?0:r.length-1),t<0&&(t=r.length+t),t>=r.length){if(i)return-1;t=r.length-1}else if(t<0){if(!i)return-1;t=0}if(typeof e=="string"&&(e=Ge.from(e,n)),Ge.isBuffer(e))return e.length===0?-1:cI(r,e,t,n,i);if(typeof e=="number")return e&=255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):cI(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}function cI(r,e,t,n,i){var o,s=1,a=r.length,u=e.length;if(n!==void 0&&((n=String(n).toLowerCase())==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(r.length<2||e.length<2)return-1;s=2,a/=2,u/=2,t/=2}function c(m,b){return s===1?m[b]:m.readUInt16BE(b*s)}if(i){var f=-1;for(o=t;o<a;o++)if(c(r,o)===c(e,f===-1?0:o-f)){if(f===-1&&(f=o),o-f+1===u)return f*s}else f!==-1&&(o-=o-f),f=-1}else for(t+u>a&&(t=a-u),o=t;o>=0;o--){for(var h=!0,p=0;p<u;p++)if(c(r,o+p)!==c(e,p)){h=!1;break}if(h)return o}return-1}function T5(r,e,t,n){t=Number(t)||0;var i=r.length-t;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(e.substr(2*s,2),16);if(RE(a))return s;r[t+s]=a}return s}function C5(r,e,t,n){return J0(xE(e,r.length-t),r,t,n)}function FI(r,e,t,n){return J0((function(i){for(var o=[],s=0;s<i.length;++s)o.push(255&i.charCodeAt(s));return o})(e),r,t,n)}function R5(r,e,t,n){return FI(r,e,t,n)}function D5(r,e,t,n){return J0($I(e),r,t,n)}function I5(r,e,t,n){return J0((function(i,o){for(var s,a,u,c=[],f=0;f<i.length&&!((o-=2)<0);++f)s=i.charCodeAt(f),a=s>>8,u=s%256,c.push(u),c.push(a);return c})(e,r.length-t),r,t,n)}function O5(r,e,t){return e===0&&t===r.length?EE.fromByteArray(r):EE.fromByteArray(r.slice(e,t))}function UI(r,e,t){t=Math.min(r.length,t);for(var n=[],i=e;i<t;){var o,s,a,u,c=r[i],f=null,h=c>239?4:c>223?3:c>191?2:1;if(i+h<=t)switch(h){case 1:c<128&&(f=c);break;case 2:(192&(o=r[i+1]))==128&&(u=(31&c)<<6|63&o)>127&&(f=u);break;case 3:o=r[i+1],s=r[i+2],(192&o)==128&&(192&s)==128&&(u=(15&c)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:o=r[i+1],s=r[i+2],a=r[i+3],(192&o)==128&&(192&s)==128&&(192&a)==128&&(u=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(f=u)}f===null?(f=65533,h=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=h}return(function(p){var m=p.length;if(m<=4096)return String.fromCharCode.apply(String,p);for(var b="",v=0;v<m;)b+=String.fromCharCode.apply(String,p.slice(v,v+=4096));return b})(n)}function N5(r,e,t){var n="";t=Math.min(r.length,t);for(var i=e;i<t;++i)n+=String.fromCharCode(127&r[i]);return n}function k5(r,e,t){var n="";t=Math.min(r.length,t);for(var i=e;i<t;++i)n+=String.fromCharCode(r[i]);return n}function L5(r,e,t){var n=r.length;(!e||e<0)&&(e=0),(!t||t<0||t>n)&&(t=n);for(var i="",o=e;o<t;++o)i+=B5[r[o]];return i}function P5(r,e,t){for(var n=r.slice(e,t),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function hn(r,e,t){if(r%1!=0||r<0)throw new RangeError("offset is not uint");if(r+e>t)throw new RangeError("Trying to access beyond buffer length")}function ni(r,e,t,n,i,o){if(!Ge.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(t+n>r.length)throw new RangeError("Index out of range")}function jI(r,e,t,n,i,o){if(t+n>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function fI(r,e,t,n,i){return e=+e,t>>>=0,i||jI(r,0,t,4),Xf.write(r,e,t,n,23,4),t+4}function hI(r,e,t,n,i){return e=+e,t>>>=0,i||jI(r,0,t,8),Xf.write(r,e,t,n,52,8),t+8}function xE(r,e){var t;e=e||1/0;for(var n=r.length,i=null,o=[],s=0;s<n;++s){if((t=r.charCodeAt(s))>55295&&t<57344){if(!i){if(t>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=t;continue}if(t<56320){(e-=3)>-1&&o.push(239,191,189),i=t;continue}t=65536+(i-55296<<10|t-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,t<128){if((e-=1)<0)break;o.push(t)}else if(t<2048){if((e-=2)<0)break;o.push(t>>6|192,63&t|128)}else if(t<65536){if((e-=3)<0)break;o.push(t>>12|224,t>>6&63|128,63&t|128)}else{if(!(t<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(t>>18|240,t>>12&63|128,t>>6&63|128,63&t|128)}}return o}function $I(r){return EE.toByteArray((function(e){if((e=(e=e.split("=")[0]).trim().replace(M5,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e})(r))}function J0(r,e,t,n){for(var i=0;i<n&&!(i+t>=e.length||i>=r.length);++i)e[i+t]=r[i];return i}function Xo(r,e){return r instanceof e||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===e.name}function RE(r){return r!=r}function dI(r,e){for(var t in r)e[t]=r[t]}function Uu(r,e,t){return to(r,e,t)}function Mp(r){var e;switch(this.encoding=(function(t){var n=(function(i){if(!i)return"utf8";for(var o;;)switch(i){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return i;default:if(o)return;i=(""+i).toLowerCase(),o=!0}})(t);if(typeof n!="string"&&(TE.isEncoding===pI||!pI(t)))throw new Error("Unknown encoding: "+t);return n||t})(r),this.encoding){case"utf16le":this.text=j5,this.end=$5,e=4;break;case"utf8":this.fillLast=U5,e=4;break;case"base64":this.text=z5,this.end=W5,e=3;break;default:return this.write=q5,this.end=H5,void 0}this.lastNeed=0,this.lastTotal=0,this.lastChar=TE.allocUnsafe(e)}function sE(r){return r<=127?0:r>>5==6?2:r>>4==14?3:r>>3==30?4:r>>6==2?-1:-2}function U5(r){var e=this.lastTotal-this.lastNeed,t=(function(n,i,o){if((192&i[0])!=128)return n.lastNeed=0,"\uFFFD";if(n.lastNeed>1&&i.length>1){if((192&i[1])!=128)return n.lastNeed=1,"\uFFFD";if(n.lastNeed>2&&i.length>2&&(192&i[2])!=128)return n.lastNeed=2,"\uFFFD"}})(this,r);return t!==void 0?t:this.lastNeed<=r.length?(r.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(r.copy(this.lastChar,e,0,r.length),this.lastNeed-=r.length,void 0)}function j5(r,e){if((r.length-e)%2==0){var t=r.toString("utf16le",e);if(t){var n=t.charCodeAt(t.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=r[r.length-2],this.lastChar[1]=r[r.length-1],t.slice(0,-1)}return t}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=r[r.length-1],r.toString("utf16le",e,r.length-1)}function $5(r){var e=r&&r.length?this.write(r):"";if(this.lastNeed){var t=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,t)}return e}function z5(r,e){var t=(r.length-e)%3;return t===0?r.toString("base64",e):(this.lastNeed=3-t,this.lastTotal=3,t===1?this.lastChar[0]=r[r.length-1]:(this.lastChar[0]=r[r.length-2],this.lastChar[1]=r[r.length-1]),r.toString("base64",e,r.length-t))}function W5(r){var e=r&&r.length?this.write(r):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function q5(r){return r.toString(this.encoding)}function H5(r){return r&&r.length?this.write(r):""}function G5(){if(gI)return Bp;gI=!0,Bp.byteLength=a,Bp.toByteArray=c,Bp.fromByteArray=p;for(var r=[],e=[],t=typeof Uint8Array<"u"?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,o=n.length;i<o;++i)r[i]=n[i],e[n.charCodeAt(i)]=i;e[45]=62,e[95]=63;function s(m){var b=m.length;if(b%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var v=m.indexOf("=");v===-1&&(v=b);var w=v===b?0:4-v%4;return[v,w]}function a(m){var b=s(m),v=b[0],w=b[1];return(v+w)*3/4-w}function u(m,b,v){return(b+v)*3/4-v}function c(m){var b,v=s(m),w=v[0],y=v[1],_=new t(u(m,w,y)),E=0,S=y>0?w-4:w,A;for(A=0;A<S;A+=4)b=e[m.charCodeAt(A)]<<18|e[m.charCodeAt(A+1)]<<12|e[m.charCodeAt(A+2)]<<6|e[m.charCodeAt(A+3)],_[E++]=b>>16&255,_[E++]=b>>8&255,_[E++]=b&255;return y===2&&(b=e[m.charCodeAt(A)]<<2|e[m.charCodeAt(A+1)]>>4,_[E++]=b&255),y===1&&(b=e[m.charCodeAt(A)]<<10|e[m.charCodeAt(A+1)]<<4|e[m.charCodeAt(A+2)]>>2,_[E++]=b>>8&255,_[E++]=b&255),_}function f(m){return r[m>>18&63]+r[m>>12&63]+r[m>>6&63]+r[m&63]}function h(m,b,v){for(var w,y=[],_=b;_<v;_+=3)w=(m[_]<<16&16711680)+(m[_+1]<<8&65280)+(m[_+2]&255),y.push(f(w));return y.join("")}function p(m){for(var b,v=m.length,w=v%3,y=[],_=16383,E=0,S=v-w;E<S;E+=_)y.push(h(m,E,E+_>S?S:E+_));return w===1?(b=m[v-1],y.push(r[b>>2]+r[b<<4&63]+"==")):w===2&&(b=(m[v-2]<<8)+m[v-1],y.push(r[b>>10]+r[b>>4&63]+r[b<<2&63]+"=")),y.join("")}return Bp}function V5(){if(mI)return Y0;mI=!0;return Y0.read=function(r,e,t,n,i){var o,s,a=i*8-n-1,u=(1<<a)-1,c=u>>1,f=-7,h=t?i-1:0,p=t?-1:1,m=r[e+h];for(h+=p,o=m&(1<<-f)-1,m>>=-f,f+=a;f>0;o=o*256+r[e+h],h+=p,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=s*256+r[e+h],h+=p,f-=8);if(o===0)o=1-c;else{if(o===u)return s?NaN:(m?-1:1)*(1/0);s=s+Math.pow(2,n),o=o-c}return(m?-1:1)*s*Math.pow(2,o-n)},Y0.write=function(r,e,t,n,i,o){var s,a,u,c=o*8-i-1,f=(1<<c)-1,h=f>>1,p=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:o-1,b=n?1:-1,v=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),s+h>=1?e+=p/u:e+=p*Math.pow(2,1-h),e*u>=2&&(s++,u/=2),s+h>=f?(a=0,s=f):s+h>=1?(a=(e*u-1)*Math.pow(2,i),s=s+h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;r[t+m]=a&255,m+=b,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;r[t+m]=s&255,m+=b,s/=256,c-=8);r[t+m-b]|=v*128},Y0}function Y5(){if(yI)return ju;yI=!0;let r=G5(),e=V5(),t=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ju.Buffer=s,ju.SlowBuffer=y,ju.INSPECT_MAX_BYTES=50;let n=2147483647;ju.kMaxLength=n,s.TYPED_ARRAY_SUPPORT=i(),!s.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function i(){try{let T=new Uint8Array(1),d={foo:function(){return 42}};return Object.setPrototypeOf(d,Uint8Array.prototype),Object.setPrototypeOf(T,d),T.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function o(T){if(T>n)throw new RangeError('The value "'+T+'" is invalid for option "size"');let d=new Uint8Array(T);return Object.setPrototypeOf(d,s.prototype),d}function s(T,d,g){if(typeof T=="number"){if(typeof d=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return f(T)}return a(T,d,g)}s.poolSize=8192;function a(T,d,g){if(typeof T=="string")return h(T,d);if(ArrayBuffer.isView(T))return m(T);if(T==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T);if(ke(T,ArrayBuffer)||T&&ke(T.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ke(T,SharedArrayBuffer)||T&&ke(T.buffer,SharedArrayBuffer)))return b(T,d,g);if(typeof T=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let I=T.valueOf&&T.valueOf();if(I!=null&&I!==T)return s.from(I,d,g);let Z=v(T);if(Z)return Z;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof T[Symbol.toPrimitive]=="function")return s.from(T[Symbol.toPrimitive]("string"),d,g);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T)}s.from=function(T,d,g){return a(T,d,g)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function u(T){if(typeof T!="number")throw new TypeError('"size" argument must be of type number');if(T<0)throw new RangeError('The value "'+T+'" is invalid for option "size"')}function c(T,d,g){return u(T),T<=0?o(T):d!==void 0?typeof g=="string"?o(T).fill(d,g):o(T).fill(d):o(T)}s.alloc=function(T,d,g){return c(T,d,g)};function f(T){return u(T),o(T<0?0:w(T)|0)}s.allocUnsafe=function(T){return f(T)},s.allocUnsafeSlow=function(T){return f(T)};function h(T,d){if((typeof d!="string"||d==="")&&(d="utf8"),!s.isEncoding(d))throw new TypeError("Unknown encoding: "+d);let g=_(T,d)|0,I=o(g),Z=I.write(T,d);return Z!==g&&(I=I.slice(0,Z)),I}function p(T){let d=T.length<0?0:w(T.length)|0,g=o(d);for(let I=0;I<d;I+=1)g[I]=T[I]&255;return g}function m(T){if(ke(T,Uint8Array)){let d=new Uint8Array(T);return b(d.buffer,d.byteOffset,d.byteLength)}return p(T)}function b(T,d,g){if(d<0||T.byteLength<d)throw new RangeError('"offset" is outside of buffer bounds');if(T.byteLength<d+(g||0))throw new RangeError('"length" is outside of buffer bounds');let I;return d===void 0&&g===void 0?I=new Uint8Array(T):g===void 0?I=new Uint8Array(T,d):I=new Uint8Array(T,d,g),Object.setPrototypeOf(I,s.prototype),I}function v(T){if(s.isBuffer(T)){let d=w(T.length)|0,g=o(d);return g.length===0||T.copy(g,0,0,d),g}if(T.length!==void 0)return typeof T.length!="number"||Oe(T.length)?o(0):p(T);if(T.type==="Buffer"&&Array.isArray(T.data))return p(T.data)}function w(T){if(T>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return T|0}function y(T){return+T!=T&&(T=0),s.alloc(+T)}s.isBuffer=function(d){return d!=null&&d._isBuffer===!0&&d!==s.prototype},s.compare=function(d,g){if(ke(d,Uint8Array)&&(d=s.from(d,d.offset,d.byteLength)),ke(g,Uint8Array)&&(g=s.from(g,g.offset,g.byteLength)),!s.isBuffer(d)||!s.isBuffer(g))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(d===g)return 0;let I=d.length,Z=g.length;for(let R=0,le=Math.min(I,Z);R<le;++R)if(d[R]!==g[R]){I=d[R],Z=g[R];break}return I<Z?-1:Z<I?1:0},s.isEncoding=function(d){switch(String(d).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(d,g){if(!Array.isArray(d))throw new TypeError('"list" argument must be an Array of Buffers');if(d.length===0)return s.alloc(0);let I;if(g===void 0)for(g=0,I=0;I<d.length;++I)g+=d[I].length;let Z=s.allocUnsafe(g),R=0;for(I=0;I<d.length;++I){let le=d[I];if(ke(le,Uint8Array))R+le.length>Z.length?(s.isBuffer(le)||(le=s.from(le)),le.copy(Z,R)):Uint8Array.prototype.set.call(Z,le,R);else if(s.isBuffer(le))le.copy(Z,R);else throw new TypeError('"list" argument must be an Array of Buffers');R+=le.length}return Z};function _(T,d){if(s.isBuffer(T))return T.length;if(ArrayBuffer.isView(T)||ke(T,ArrayBuffer))return T.byteLength;if(typeof T!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof T);let g=T.length,I=arguments.length>2&&arguments[2]===!0;if(!I&&g===0)return 0;let Z=!1;for(;;)switch(d){case"ascii":case"latin1":case"binary":return g;case"utf8":case"utf-8":return Se(T).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return g*2;case"hex":return g>>>1;case"base64":return Ae(T).length;default:if(Z)return I?-1:Se(T).length;d=(""+d).toLowerCase(),Z=!0}}s.byteLength=_;function E(T,d,g){let I=!1;if((d===void 0||d<0)&&(d=0),d>this.length||((g===void 0||g>this.length)&&(g=this.length),g<=0)||(g>>>=0,d>>>=0,g<=d))return"";for(T||(T="utf8");;)switch(T){case"hex":return x(this,d,g);case"utf8":case"utf-8":return $(this,d,g);case"ascii":return re(this,d,g);case"latin1":case"binary":return N(this,d,g);case"base64":return k(this,d,g);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,d,g);default:if(I)throw new TypeError("Unknown encoding: "+T);T=(T+"").toLowerCase(),I=!0}}s.prototype._isBuffer=!0;function S(T,d,g){let I=T[d];T[d]=T[g],T[g]=I}s.prototype.swap16=function(){let d=this.length;if(d%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let g=0;g<d;g+=2)S(this,g,g+1);return this},s.prototype.swap32=function(){let d=this.length;if(d%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let g=0;g<d;g+=4)S(this,g,g+3),S(this,g+1,g+2);return this},s.prototype.swap64=function(){let d=this.length;if(d%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let g=0;g<d;g+=8)S(this,g,g+7),S(this,g+1,g+6),S(this,g+2,g+5),S(this,g+3,g+4);return this},s.prototype.toString=function(){let d=this.length;return d===0?"":arguments.length===0?$(this,0,d):E.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(d){if(!s.isBuffer(d))throw new TypeError("Argument must be a Buffer");return this===d?!0:s.compare(this,d)===0},s.prototype.inspect=function(){let d="",g=ju.INSPECT_MAX_BYTES;return d=this.toString("hex",0,g).replace(/(.{2})/g,"$1 ").trim(),this.length>g&&(d+=" ... "),"<Buffer "+d+">"},t&&(s.prototype[t]=s.prototype.inspect),s.prototype.compare=function(d,g,I,Z,R){if(ke(d,Uint8Array)&&(d=s.from(d,d.offset,d.byteLength)),!s.isBuffer(d))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof d);if(g===void 0&&(g=0),I===void 0&&(I=d?d.length:0),Z===void 0&&(Z=0),R===void 0&&(R=this.length),g<0||I>d.length||Z<0||R>this.length)throw new RangeError("out of range index");if(Z>=R&&g>=I)return 0;if(Z>=R)return-1;if(g>=I)return 1;if(g>>>=0,I>>>=0,Z>>>=0,R>>>=0,this===d)return 0;let le=R-Z,pe=I-g,Ee=Math.min(le,pe),ve=this.slice(Z,R),Ie=d.slice(g,I);for(let V=0;V<Ee;++V)if(ve[V]!==Ie[V]){le=ve[V],pe=Ie[V];break}return le<pe?-1:pe<le?1:0};function A(T,d,g,I,Z){if(T.length===0)return-1;if(typeof g=="string"?(I=g,g=0):g>2147483647?g=2147483647:g<-2147483648&&(g=-2147483648),g=+g,Oe(g)&&(g=Z?0:T.length-1),g<0&&(g=T.length+g),g>=T.length){if(Z)return-1;g=T.length-1}else if(g<0)if(Z)g=0;else return-1;if(typeof d=="string"&&(d=s.from(d,I)),s.isBuffer(d))return d.length===0?-1:F(T,d,g,I,Z);if(typeof d=="number")return d=d&255,typeof Uint8Array.prototype.indexOf=="function"?Z?Uint8Array.prototype.indexOf.call(T,d,g):Uint8Array.prototype.lastIndexOf.call(T,d,g):F(T,[d],g,I,Z);throw new TypeError("val must be string, number or Buffer")}function F(T,d,g,I,Z){let R=1,le=T.length,pe=d.length;if(I!==void 0&&(I=String(I).toLowerCase(),I==="ucs2"||I==="ucs-2"||I==="utf16le"||I==="utf-16le")){if(T.length<2||d.length<2)return-1;R=2,le/=2,pe/=2,g/=2}function Ee(Ie,V){return R===1?Ie[V]:Ie.readUInt16BE(V*R)}let ve;if(Z){let Ie=-1;for(ve=g;ve<le;ve++)if(Ee(T,ve)===Ee(d,Ie===-1?0:ve-Ie)){if(Ie===-1&&(Ie=ve),ve-Ie+1===pe)return Ie*R}else Ie!==-1&&(ve-=ve-Ie),Ie=-1}else for(g+pe>le&&(g=le-pe),ve=g;ve>=0;ve--){let Ie=!0;for(let V=0;V<pe;V++)if(Ee(T,ve+V)!==Ee(d,V)){Ie=!1;break}if(Ie)return ve}return-1}s.prototype.includes=function(d,g,I){return this.indexOf(d,g,I)!==-1},s.prototype.indexOf=function(d,g,I){return A(this,d,g,I,!0)},s.prototype.lastIndexOf=function(d,g,I){return A(this,d,g,I,!1)};function D(T,d,g,I){g=Number(g)||0;let Z=T.length-g;I?(I=Number(I),I>Z&&(I=Z)):I=Z;let R=d.length;I>R/2&&(I=R/2);let le;for(le=0;le<I;++le){let pe=parseInt(d.substr(le*2,2),16);if(Oe(pe))return le;T[g+le]=pe}return le}function H(T,d,g,I){return je(Se(d,T.length-g),T,g,I)}function J(T,d,g,I){return je(we(d),T,g,I)}function K(T,d,g,I){return je(Ae(d),T,g,I)}function ne(T,d,g,I){return je(de(d,T.length-g),T,g,I)}s.prototype.write=function(d,g,I,Z){if(g===void 0)Z="utf8",I=this.length,g=0;else if(I===void 0&&typeof g=="string")Z=g,I=this.length,g=0;else if(isFinite(g))g=g>>>0,isFinite(I)?(I=I>>>0,Z===void 0&&(Z="utf8")):(Z=I,I=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let R=this.length-g;if((I===void 0||I>R)&&(I=R),d.length>0&&(I<0||g<0)||g>this.length)throw new RangeError("Attempt to write outside buffer bounds");Z||(Z="utf8");let le=!1;for(;;)switch(Z){case"hex":return D(this,d,g,I);case"utf8":case"utf-8":return H(this,d,g,I);case"ascii":case"latin1":case"binary":return J(this,d,g,I);case"base64":return K(this,d,g,I);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ne(this,d,g,I);default:if(le)throw new TypeError("Unknown encoding: "+Z);Z=(""+Z).toLowerCase(),le=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function k(T,d,g){return d===0&&g===T.length?r.fromByteArray(T):r.fromByteArray(T.slice(d,g))}function $(T,d,g){g=Math.min(T.length,g);let I=[],Z=d;for(;Z<g;){let R=T[Z],le=null,pe=R>239?4:R>223?3:R>191?2:1;if(Z+pe<=g){let Ee,ve,Ie,V;switch(pe){case 1:R<128&&(le=R);break;case 2:Ee=T[Z+1],(Ee&192)===128&&(V=(R&31)<<6|Ee&63,V>127&&(le=V));break;case 3:Ee=T[Z+1],ve=T[Z+2],(Ee&192)===128&&(ve&192)===128&&(V=(R&15)<<12|(Ee&63)<<6|ve&63,V>2047&&(V<55296||V>57343)&&(le=V));break;case 4:Ee=T[Z+1],ve=T[Z+2],Ie=T[Z+3],(Ee&192)===128&&(ve&192)===128&&(Ie&192)===128&&(V=(R&15)<<18|(Ee&63)<<12|(ve&63)<<6|Ie&63,V>65535&&V<1114112&&(le=V))}}le===null?(le=65533,pe=1):le>65535&&(le-=65536,I.push(le>>>10&1023|55296),le=56320|le&1023),I.push(le),Z+=pe}return ie(I)}let Y=4096;function ie(T){let d=T.length;if(d<=Y)return String.fromCharCode.apply(String,T);let g="",I=0;for(;I<d;)g+=String.fromCharCode.apply(String,T.slice(I,I+=Y));return g}function re(T,d,g){let I="";g=Math.min(T.length,g);for(let Z=d;Z<g;++Z)I+=String.fromCharCode(T[Z]&127);return I}function N(T,d,g){let I="";g=Math.min(T.length,g);for(let Z=d;Z<g;++Z)I+=String.fromCharCode(T[Z]);return I}function x(T,d,g){let I=T.length;(!d||d<0)&&(d=0),(!g||g<0||g>I)&&(g=I);let Z="";for(let R=d;R<g;++R)Z+=Ve[T[R]];return Z}function P(T,d,g){let I=T.slice(d,g),Z="";for(let R=0;R<I.length-1;R+=2)Z+=String.fromCharCode(I[R]+I[R+1]*256);return Z}s.prototype.slice=function(d,g){let I=this.length;d=~~d,g=g===void 0?I:~~g,d<0?(d+=I,d<0&&(d=0)):d>I&&(d=I),g<0?(g+=I,g<0&&(g=0)):g>I&&(g=I),g<d&&(g=d);let Z=this.subarray(d,g);return Object.setPrototypeOf(Z,s.prototype),Z};function C(T,d,g){if(T%1!==0||T<0)throw new RangeError("offset is not uint");if(T+d>g)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(d,g,I){d=d>>>0,g=g>>>0,I||C(d,g,this.length);let Z=this[d],R=1,le=0;for(;++le<g&&(R*=256);)Z+=this[d+le]*R;return Z},s.prototype.readUintBE=s.prototype.readUIntBE=function(d,g,I){d=d>>>0,g=g>>>0,I||C(d,g,this.length);let Z=this[d+--g],R=1;for(;g>0&&(R*=256);)Z+=this[d+--g]*R;return Z},s.prototype.readUint8=s.prototype.readUInt8=function(d,g){return d=d>>>0,g||C(d,1,this.length),this[d]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(d,g){return d=d>>>0,g||C(d,2,this.length),this[d]|this[d+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(d,g){return d=d>>>0,g||C(d,2,this.length),this[d]<<8|this[d+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(d,g){return d=d>>>0,g||C(d,4,this.length),(this[d]|this[d+1]<<8|this[d+2]<<16)+this[d+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(d,g){return d=d>>>0,g||C(d,4,this.length),this[d]*16777216+(this[d+1]<<16|this[d+2]<<8|this[d+3])},s.prototype.readBigUInt64LE=Je(function(d){d=d>>>0,X(d,"offset");let g=this[d],I=this[d+7];(g===void 0||I===void 0)&&M(d,this.length-8);let Z=g+this[++d]*2**8+this[++d]*2**16+this[++d]*2**24,R=this[++d]+this[++d]*2**8+this[++d]*2**16+I*2**24;return BigInt(Z)+(BigInt(R)<<BigInt(32))}),s.prototype.readBigUInt64BE=Je(function(d){d=d>>>0,X(d,"offset");let g=this[d],I=this[d+7];(g===void 0||I===void 0)&&M(d,this.length-8);let Z=g*2**24+this[++d]*2**16+this[++d]*2**8+this[++d],R=this[++d]*2**24+this[++d]*2**16+this[++d]*2**8+I;return(BigInt(Z)<<BigInt(32))+BigInt(R)}),s.prototype.readIntLE=function(d,g,I){d=d>>>0,g=g>>>0,I||C(d,g,this.length);let Z=this[d],R=1,le=0;for(;++le<g&&(R*=256);)Z+=this[d+le]*R;return R*=128,Z>=R&&(Z-=Math.pow(2,8*g)),Z},s.prototype.readIntBE=function(d,g,I){d=d>>>0,g=g>>>0,I||C(d,g,this.length);let Z=g,R=1,le=this[d+--Z];for(;Z>0&&(R*=256);)le+=this[d+--Z]*R;return R*=128,le>=R&&(le-=Math.pow(2,8*g)),le},s.prototype.readInt8=function(d,g){return d=d>>>0,g||C(d,1,this.length),this[d]&128?(255-this[d]+1)*-1:this[d]},s.prototype.readInt16LE=function(d,g){d=d>>>0,g||C(d,2,this.length);let I=this[d]|this[d+1]<<8;return I&32768?I|4294901760:I},s.prototype.readInt16BE=function(d,g){d=d>>>0,g||C(d,2,this.length);let I=this[d+1]|this[d]<<8;return I&32768?I|4294901760:I},s.prototype.readInt32LE=function(d,g){return d=d>>>0,g||C(d,4,this.length),this[d]|this[d+1]<<8|this[d+2]<<16|this[d+3]<<24},s.prototype.readInt32BE=function(d,g){return d=d>>>0,g||C(d,4,this.length),this[d]<<24|this[d+1]<<16|this[d+2]<<8|this[d+3]},s.prototype.readBigInt64LE=Je(function(d){d=d>>>0,X(d,"offset");let g=this[d],I=this[d+7];(g===void 0||I===void 0)&&M(d,this.length-8);let Z=this[d+4]+this[d+5]*2**8+this[d+6]*2**16+(I<<24);return(BigInt(Z)<<BigInt(32))+BigInt(g+this[++d]*2**8+this[++d]*2**16+this[++d]*2**24)}),s.prototype.readBigInt64BE=Je(function(d){d=d>>>0,X(d,"offset");let g=this[d],I=this[d+7];(g===void 0||I===void 0)&&M(d,this.length-8);let Z=(g<<24)+this[++d]*2**16+this[++d]*2**8+this[++d];return(BigInt(Z)<<BigInt(32))+BigInt(this[++d]*2**24+this[++d]*2**16+this[++d]*2**8+I)}),s.prototype.readFloatLE=function(d,g){return d=d>>>0,g||C(d,4,this.length),e.read(this,d,!0,23,4)},s.prototype.readFloatBE=function(d,g){return d=d>>>0,g||C(d,4,this.length),e.read(this,d,!1,23,4)},s.prototype.readDoubleLE=function(d,g){return d=d>>>0,g||C(d,8,this.length),e.read(this,d,!0,52,8)},s.prototype.readDoubleBE=function(d,g){return d=d>>>0,g||C(d,8,this.length),e.read(this,d,!1,52,8)};function j(T,d,g,I,Z,R){if(!s.isBuffer(T))throw new TypeError('"buffer" argument must be a Buffer instance');if(d>Z||d<R)throw new RangeError('"value" argument is out of bounds');if(g+I>T.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(d,g,I,Z){if(d=+d,g=g>>>0,I=I>>>0,!Z){let pe=Math.pow(2,8*I)-1;j(this,d,g,I,pe,0)}let R=1,le=0;for(this[g]=d&255;++le<I&&(R*=256);)this[g+le]=d/R&255;return g+I},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(d,g,I,Z){if(d=+d,g=g>>>0,I=I>>>0,!Z){let pe=Math.pow(2,8*I)-1;j(this,d,g,I,pe,0)}let R=I-1,le=1;for(this[g+R]=d&255;--R>=0&&(le*=256);)this[g+R]=d/le&255;return g+I},s.prototype.writeUint8=s.prototype.writeUInt8=function(d,g,I){return d=+d,g=g>>>0,I||j(this,d,g,1,255,0),this[g]=d&255,g+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(d,g,I){return d=+d,g=g>>>0,I||j(this,d,g,2,65535,0),this[g]=d&255,this[g+1]=d>>>8,g+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(d,g,I){return d=+d,g=g>>>0,I||j(this,d,g,2,65535,0),this[g]=d>>>8,this[g+1]=d&255,g+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(d,g,I){return d=+d,g=g>>>0,I||j(this,d,g,4,4294967295,0),this[g+3]=d>>>24,this[g+2]=d>>>16,this[g+1]=d>>>8,this[g]=d&255,g+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(d,g,I){return d=+d,g=g>>>0,I||j(this,d,g,4,4294967295,0),this[g]=d>>>24,this[g+1]=d>>>16,this[g+2]=d>>>8,this[g+3]=d&255,g+4};function U(T,d,g,I,Z){xe(d,I,Z,T,g,7);let R=Number(d&BigInt(4294967295));T[g++]=R,R=R>>8,T[g++]=R,R=R>>8,T[g++]=R,R=R>>8,T[g++]=R;let le=Number(d>>BigInt(32)&BigInt(4294967295));return T[g++]=le,le=le>>8,T[g++]=le,le=le>>8,T[g++]=le,le=le>>8,T[g++]=le,g}function B(T,d,g,I,Z){xe(d,I,Z,T,g,7);let R=Number(d&BigInt(4294967295));T[g+7]=R,R=R>>8,T[g+6]=R,R=R>>8,T[g+5]=R,R=R>>8,T[g+4]=R;let le=Number(d>>BigInt(32)&BigInt(4294967295));return T[g+3]=le,le=le>>8,T[g+2]=le,le=le>>8,T[g+1]=le,le=le>>8,T[g]=le,g+8}s.prototype.writeBigUInt64LE=Je(function(d,g=0){return U(this,d,g,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeBigUInt64BE=Je(function(d,g=0){return B(this,d,g,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeIntLE=function(d,g,I,Z){if(d=+d,g=g>>>0,!Z){let Ee=Math.pow(2,8*I-1);j(this,d,g,I,Ee-1,-Ee)}let R=0,le=1,pe=0;for(this[g]=d&255;++R<I&&(le*=256);)d<0&&pe===0&&this[g+R-1]!==0&&(pe=1),this[g+R]=(d/le>>0)-pe&255;return g+I},s.prototype.writeIntBE=function(d,g,I,Z){if(d=+d,g=g>>>0,!Z){let Ee=Math.pow(2,8*I-1);j(this,d,g,I,Ee-1,-Ee)}let R=I-1,le=1,pe=0;for(this[g+R]=d&255;--R>=0&&(le*=256);)d<0&&pe===0&&this[g+R+1]!==0&&(pe=1),this[g+R]=(d/le>>0)-pe&255;return g+I},s.prototype.writeInt8=function(d,g,I){return d=+d,g=g>>>0,I||j(this,d,g,1,127,-128),d<0&&(d=255+d+1),this[g]=d&255,g+1},s.prototype.writeInt16LE=function(d,g,I){return d=+d,g=g>>>0,I||j(this,d,g,2,32767,-32768),this[g]=d&255,this[g+1]=d>>>8,g+2},s.prototype.writeInt16BE=function(d,g,I){return d=+d,g=g>>>0,I||j(this,d,g,2,32767,-32768),this[g]=d>>>8,this[g+1]=d&255,g+2},s.prototype.writeInt32LE=function(d,g,I){return d=+d,g=g>>>0,I||j(this,d,g,4,2147483647,-2147483648),this[g]=d&255,this[g+1]=d>>>8,this[g+2]=d>>>16,this[g+3]=d>>>24,g+4},s.prototype.writeInt32BE=function(d,g,I){return d=+d,g=g>>>0,I||j(this,d,g,4,2147483647,-2147483648),d<0&&(d=4294967295+d+1),this[g]=d>>>24,this[g+1]=d>>>16,this[g+2]=d>>>8,this[g+3]=d&255,g+4},s.prototype.writeBigInt64LE=Je(function(d,g=0){return U(this,d,g,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeBigInt64BE=Je(function(d,g=0){return B(this,d,g,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Q(T,d,g,I,Z,R){if(g+I>T.length)throw new RangeError("Index out of range");if(g<0)throw new RangeError("Index out of range")}function fe(T,d,g,I,Z){return d=+d,g=g>>>0,Z||Q(T,d,g,4),e.write(T,d,g,I,23,4),g+4}s.prototype.writeFloatLE=function(d,g,I){return fe(this,d,g,!0,I)},s.prototype.writeFloatBE=function(d,g,I){return fe(this,d,g,!1,I)};function _e(T,d,g,I,Z){return d=+d,g=g>>>0,Z||Q(T,d,g,8),e.write(T,d,g,I,52,8),g+8}s.prototype.writeDoubleLE=function(d,g,I){return _e(this,d,g,!0,I)},s.prototype.writeDoubleBE=function(d,g,I){return _e(this,d,g,!1,I)},s.prototype.copy=function(d,g,I,Z){if(!s.isBuffer(d))throw new TypeError("argument should be a Buffer");if(I||(I=0),!Z&&Z!==0&&(Z=this.length),g>=d.length&&(g=d.length),g||(g=0),Z>0&&Z<I&&(Z=I),Z===I||d.length===0||this.length===0)return 0;if(g<0)throw new RangeError("targetStart out of bounds");if(I<0||I>=this.length)throw new RangeError("Index out of range");if(Z<0)throw new RangeError("sourceEnd out of bounds");Z>this.length&&(Z=this.length),d.length-g<Z-I&&(Z=d.length-g+I);let R=Z-I;return this===d&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(g,I,Z):Uint8Array.prototype.set.call(d,this.subarray(I,Z),g),R},s.prototype.fill=function(d,g,I,Z){if(typeof d=="string"){if(typeof g=="string"?(Z=g,g=0,I=this.length):typeof I=="string"&&(Z=I,I=this.length),Z!==void 0&&typeof Z!="string")throw new TypeError("encoding must be a string");if(typeof Z=="string"&&!s.isEncoding(Z))throw new TypeError("Unknown encoding: "+Z);if(d.length===1){let le=d.charCodeAt(0);(Z==="utf8"&&le<128||Z==="latin1")&&(d=le)}}else typeof d=="number"?d=d&255:typeof d=="boolean"&&(d=Number(d));if(g<0||this.length<g||this.length<I)throw new RangeError("Out of range index");if(I<=g)return this;g=g>>>0,I=I===void 0?this.length:I>>>0,d||(d=0);let R;if(typeof d=="number")for(R=g;R<I;++R)this[R]=d;else{let le=s.isBuffer(d)?d:s.from(d,Z),pe=le.length;if(pe===0)throw new TypeError('The value "'+d+'" is invalid for argument "value"');for(R=0;R<I-g;++R)this[R+g]=le[R%pe]}return this};let te={};function W(T,d,g){te[T]=class extends g{constructor(){super(),Object.defineProperty(this,"message",{value:d.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${T}]`,this.stack,delete this.name}get code(){return T}set code(Z){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:Z,writable:!0})}toString(){return`${this.name} [${T}]: ${this.message}`}}}W("ERR_BUFFER_OUT_OF_BOUNDS",function(T){return T?`${T} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),W("ERR_INVALID_ARG_TYPE",function(T,d){return`The "${T}" argument must be of type number. Received type ${typeof d}`},TypeError),W("ERR_OUT_OF_RANGE",function(T,d,g){let I=`The value of "${T}" is out of range.`,Z=g;return Number.isInteger(g)&&Math.abs(g)>2**32?Z=oe(String(g)):typeof g=="bigint"&&(Z=String(g),(g>BigInt(2)**BigInt(32)||g<-(BigInt(2)**BigInt(32)))&&(Z=oe(Z)),Z+="n"),I+=` It must be ${d}. Received ${Z}`,I},RangeError);function oe(T){let d="",g=T.length,I=T[0]==="-"?1:0;for(;g>=I+4;g-=3)d=`_${T.slice(g-3,g)}${d}`;return`${T.slice(0,g)}${d}`}function be(T,d,g){X(d,"offset"),(T[d]===void 0||T[d+g]===void 0)&&M(d,T.length-(g+1))}function xe(T,d,g,I,Z,R){if(T>g||T<d){let le=typeof d=="bigint"?"n":"",pe;throw d===0||d===BigInt(0)?pe=`>= 0${le} and < 2${le} ** ${(R+1)*8}${le}`:pe=`>= -(2${le} ** ${(R+1)*8-1}${le}) and < 2 ** ${(R+1)*8-1}${le}`,new te.ERR_OUT_OF_RANGE("value",pe,T)}be(I,Z,R)}function X(T,d){if(typeof T!="number")throw new te.ERR_INVALID_ARG_TYPE(d,"number",T)}function M(T,d,g){throw Math.floor(T)!==T?(X(T,g),new te.ERR_OUT_OF_RANGE("offset","an integer",T)):d<0?new te.ERR_BUFFER_OUT_OF_BOUNDS:new te.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${d}`,T)}let ae=/[^+/0-9A-Za-z-_]/g;function ge(T){if(T=T.split("=")[0],T=T.trim().replace(ae,""),T.length<2)return"";for(;T.length%4!==0;)T=T+"=";return T}function Se(T,d){d=d||1/0;let g,I=T.length,Z=null,R=[];for(let le=0;le<I;++le){if(g=T.charCodeAt(le),g>55295&&g<57344){if(!Z){if(g>56319){(d-=3)>-1&&R.push(239,191,189);continue}else if(le+1===I){(d-=3)>-1&&R.push(239,191,189);continue}Z=g;continue}if(g<56320){(d-=3)>-1&&R.push(239,191,189),Z=g;continue}g=(Z-55296<<10|g-56320)+65536}else Z&&(d-=3)>-1&&R.push(239,191,189);if(Z=null,g<128){if((d-=1)<0)break;R.push(g)}else if(g<2048){if((d-=2)<0)break;R.push(g>>6|192,g&63|128)}else if(g<65536){if((d-=3)<0)break;R.push(g>>12|224,g>>6&63|128,g&63|128)}else if(g<1114112){if((d-=4)<0)break;R.push(g>>18|240,g>>12&63|128,g>>6&63|128,g&63|128)}else throw new Error("Invalid code point")}return R}function we(T){let d=[];for(let g=0;g<T.length;++g)d.push(T.charCodeAt(g)&255);return d}function de(T,d){let g,I,Z,R=[];for(let le=0;le<T.length&&!((d-=2)<0);++le)g=T.charCodeAt(le),I=g>>8,Z=g%256,R.push(Z),R.push(I);return R}function Ae(T){return r.toByteArray(ge(T))}function je(T,d,g,I){let Z;for(Z=0;Z<I&&!(Z+g>=d.length||Z>=T.length);++Z)d[Z+g]=T[Z];return Z}function ke(T,d){return T instanceof d||T!=null&&T.constructor!=null&&T.constructor.name!=null&&T.constructor.name===d.name}function Oe(T){return T!==T}let Ve=(function(){let T="0123456789abcdef",d=new Array(256);for(let g=0;g<16;++g){let I=g*16;for(let Z=0;Z<16;++Z)d[I+Z]=T[g]+T[Z]}return d})();function Je(T){return typeof BigInt>"u"?et:T}function et(){throw new Error("BigInt not supported")}return ju}function zu(){return bI||(bI=!0,typeof Object.create=="function"?X0=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:X0=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}),X0}function zI(){return wI||(wI=!0,oE=nn.EventEmitter),oE}function X5(){if(vI)return aE;vI=!0;function r(p,m){var b=Object.keys(p);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(p);m&&(v=v.filter(function(w){return Object.getOwnPropertyDescriptor(p,w).enumerable})),b.push.apply(b,v)}return b}function e(p){for(var m=1;m<arguments.length;m++){var b=arguments[m]!=null?arguments[m]:{};m%2?r(Object(b),!0).forEach(function(v){t(p,v,b[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(b)):r(Object(b)).forEach(function(v){Object.defineProperty(p,v,Object.getOwnPropertyDescriptor(b,v))})}return p}function t(p,m,b){return m in p?Object.defineProperty(p,m,{value:b,enumerable:!0,configurable:!0,writable:!0}):p[m]=b,p}function n(p,m){if(!(p instanceof m))throw new TypeError("Cannot call a class as a function")}function i(p,m){for(var b=0;b<m.length;b++){var v=m[b];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(p,v.key,v)}}function o(p,m,b){return m&&i(p.prototype,m),p}var s=Kf,a=s.Buffer,u=ze,c=u.inspect,f=c&&c.custom||"inspect";function h(p,m,b){a.prototype.copy.call(p,m,b)}return aE=(function(){function p(){n(this,p),this.head=null,this.tail=null,this.length=0}return o(p,[{key:"push",value:function(b){var v={data:b,next:null};this.length>0?this.tail.next=v:this.head=v,this.tail=v,++this.length}},{key:"unshift",value:function(b){var v={data:b,next:this.head};this.length===0&&(this.tail=v),this.head=v,++this.length}},{key:"shift",value:function(){if(this.length!==0){var b=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,b}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(b){if(this.length===0)return"";for(var v=this.head,w=""+v.data;v=v.next;)w+=b+v.data;return w}},{key:"concat",value:function(b){if(this.length===0)return a.alloc(0);for(var v=a.allocUnsafe(b>>>0),w=this.head,y=0;w;)h(w.data,v,y),y+=w.data.length,w=w.next;return v}},{key:"consume",value:function(b,v){var w;return b<this.head.data.length?(w=this.head.data.slice(0,b),this.head.data=this.head.data.slice(b)):b===this.head.data.length?w=this.shift():w=v?this._getString(b):this._getBuffer(b),w}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(b){var v=this.head,w=1,y=v.data;for(b-=y.length;v=v.next;){var _=v.data,E=b>_.length?_.length:b;if(E===_.length?y+=_:y+=_.slice(0,b),b-=E,b===0){E===_.length?(++w,v.next?this.head=v.next:this.head=this.tail=null):(this.head=v,v.data=_.slice(E));break}++w}return this.length-=w,y}},{key:"_getBuffer",value:function(b){var v=a.allocUnsafe(b),w=this.head,y=1;for(w.data.copy(v),b-=w.data.length;w=w.next;){var _=w.data,E=b>_.length?_.length:b;if(_.copy(v,v.length-b,0,E),b-=E,b===0){E===_.length?(++y,w.next?this.head=w.next:this.head=this.tail=null):(this.head=w,w.data=_.slice(E));break}++y}return this.length-=y,v}},{key:f,value:function(b,v){return c(this,e({},v,{depth:0,customInspect:!1}))}}]),p})(),aE}function WI(){if(_I)return lE;_I=!0;var r=Gt;function e(a,u){var c=this,f=this._readableState&&this._readableState.destroyed,h=this._writableState&&this._writableState.destroyed;return f||h?(u?u(a):a&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,r.nextTick(o,this,a)):r.nextTick(o,this,a)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(a||null,function(p){!u&&p?c._writableState?c._writableState.errorEmitted?r.nextTick(n,c):(c._writableState.errorEmitted=!0,r.nextTick(t,c,p)):r.nextTick(t,c,p):u?(r.nextTick(n,c),u(p)):r.nextTick(n,c)}),this)}function t(a,u){o(a,u),n(a)}function n(a){a._writableState&&!a._writableState.emitClose||a._readableState&&!a._readableState.emitClose||a.emit("close")}function i(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function o(a,u){a.emit("error",u)}function s(a,u){var c=a._readableState,f=a._writableState;c&&c.autoDestroy||f&&f.autoDestroy?a.destroy(u):a.emit("error",u)}return lE={destroy:e,undestroy:i,errorOrDestroy:s},lE}function Zf(){if(EI)return uE;EI=!0;let r={};function e(s,a,u){u||(u=Error);function c(h,p,m){return typeof a=="string"?a:a(h,p,m)}class f extends u{constructor(p,m,b){super(c(p,m,b))}}f.prototype.name=u.name,f.prototype.code=s,r[s]=f}function t(s,a){if(Array.isArray(s)){let u=s.length;return s=s.map(c=>String(c)),u>2?`one of ${a} ${s.slice(0,u-1).join(", ")}, or `+s[u-1]:u===2?`one of ${a} ${s[0]} or ${s[1]}`:`of ${a} ${s[0]}`}else return`of ${a} ${String(s)}`}function n(s,a,u){return s.substr(0,a.length)===a}function i(s,a,u){return(u===void 0||u>s.length)&&(u=s.length),s.substring(u-a.length,u)===a}function o(s,a,u){return typeof u!="number"&&(u=0),u+a.length>s.length?!1:s.indexOf(a,u)!==-1}return e("ERR_INVALID_OPT_VALUE",function(s,a){return'The value "'+a+'" is invalid for option "'+s+'"'},TypeError),e("ERR_INVALID_ARG_TYPE",function(s,a,u){let c;typeof a=="string"&&n(a,"not ")?(c="must not be",a=a.replace(/^not /,"")):c="must be";let f;if(i(s," argument"))f=`The ${s} ${c} ${t(a,"type")}`;else{let h=o(s,".")?"property":"argument";f=`The "${s}" ${h} ${c} ${t(a,"type")}`}return f+=`. Received type ${typeof u}`,f},TypeError),e("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),e("ERR_METHOD_NOT_IMPLEMENTED",function(s){return"The "+s+" method is not implemented"}),e("ERR_STREAM_PREMATURE_CLOSE","Premature close"),e("ERR_STREAM_DESTROYED",function(s){return"Cannot call "+s+" after a stream was destroyed"}),e("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),e("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),e("ERR_STREAM_WRITE_AFTER_END","write after end"),e("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),e("ERR_UNKNOWN_ENCODING",function(s){return"Unknown encoding: "+s},TypeError),e("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),uE.codes=r,uE}function qI(){if(AI)return cE;AI=!0;var r=Zf().codes.ERR_INVALID_OPT_VALUE;function e(n,i,o){return n.highWaterMark!=null?n.highWaterMark:i?n[o]:null}function t(n,i,o,s){var a=e(i,s,o);if(a!=null){if(!(isFinite(a)&&Math.floor(a)===a)||a<0){var u=s?o:"highWaterMark";throw new r(u,a)}return Math.floor(a)}return n.objectMode?16:16*1024}return cE={getHighWaterMark:t},cE}function K5(){if(xI)return fE;xI=!0,fE=r;function r(t,n){if(e("noDeprecation"))return t;var i=!1;function o(){if(!i){if(e("throwDeprecation"))throw new Error(n);e("traceDeprecation")?console.trace(n):console.warn(n),i=!0}return t.apply(this||hE,arguments)}return o}function e(t){try{if(!hE.localStorage)return!1}catch{return!1}var n=hE.localStorage[t];return n==null?!1:String(n).toLowerCase()==="true"}return fE}function DE(){if(SI)return dE;SI=!0;var r=Gt;dE=J;function e(te){var W=this;this.next=null,this.entry=null,this.finish=function(){_e(W,te)}}var t;J.WritableState=D;var n={deprecate:K5()},i=zI(),o=Kf.Buffer,s=Z5.Uint8Array||function(){};function a(te){return o.from(te)}function u(te){return o.isBuffer(te)||te instanceof s}var c=WI(),f=qI(),h=f.getHighWaterMark,p=Zf().codes,m=p.ERR_INVALID_ARG_TYPE,b=p.ERR_METHOD_NOT_IMPLEMENTED,v=p.ERR_MULTIPLE_CALLBACK,w=p.ERR_STREAM_CANNOT_PIPE,y=p.ERR_STREAM_DESTROYED,_=p.ERR_STREAM_NULL_VALUES,E=p.ERR_STREAM_WRITE_AFTER_END,S=p.ERR_UNKNOWN_ENCODING,A=c.errorOrDestroy;zu()(J,i);function F(){}function D(te,W,oe){t=t||$u(),te=te||{},typeof oe!="boolean"&&(oe=W instanceof t),this.objectMode=!!te.objectMode,oe&&(this.objectMode=this.objectMode||!!te.writableObjectMode),this.highWaterMark=h(this,te,"writableHighWaterMark",oe),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var be=te.decodeStrings===!1;this.decodeStrings=!be,this.defaultEncoding=te.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(xe){N(W,xe)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=te.emitClose!==!1,this.autoDestroy=!!te.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}D.prototype.getBuffer=function(){for(var W=this.bufferedRequest,oe=[];W;)oe.push(W),W=W.next;return oe},(function(){try{Object.defineProperty(D.prototype,"buffer",{get:n.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var H;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(H=Function.prototype[Symbol.hasInstance],Object.defineProperty(J,Symbol.hasInstance,{value:function(W){return H.call(this,W)?!0:this!==J?!1:W&&W._writableState instanceof D}})):H=function(W){return W instanceof this};function J(te){t=t||$u();var W=this instanceof t;if(!W&&!H.call(J,this))return new J(te);this._writableState=new D(te,this,W),this.writable=!0,te&&(typeof te.write=="function"&&(this._write=te.write),typeof te.writev=="function"&&(this._writev=te.writev),typeof te.destroy=="function"&&(this._destroy=te.destroy),typeof te.final=="function"&&(this._final=te.final)),i.call(this)}J.prototype.pipe=function(){A(this,new w)};function K(te,W){var oe=new E;A(te,oe),r.nextTick(W,oe)}function ne(te,W,oe,be){var xe;return oe===null?xe=new _:typeof oe!="string"&&!W.objectMode&&(xe=new m("chunk",["string","Buffer"],oe)),xe?(A(te,xe),r.nextTick(be,xe),!1):!0}J.prototype.write=function(te,W,oe){var be=this._writableState,xe=!1,X=!be.objectMode&&u(te);return X&&!o.isBuffer(te)&&(te=a(te)),typeof W=="function"&&(oe=W,W=null),X?W="buffer":W||(W=be.defaultEncoding),typeof oe!="function"&&(oe=F),be.ending?K(this,oe):(X||ne(this,be,te,oe))&&(be.pendingcb++,xe=$(this,be,X,te,W,oe)),xe},J.prototype.cork=function(){this._writableState.corked++},J.prototype.uncork=function(){var te=this._writableState;te.corked&&(te.corked--,!te.writing&&!te.corked&&!te.bufferProcessing&&te.bufferedRequest&&C(this,te))},J.prototype.setDefaultEncoding=function(W){if(typeof W=="string"&&(W=W.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((W+"").toLowerCase())>-1))throw new S(W);return this._writableState.defaultEncoding=W,this},Object.defineProperty(J.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function k(te,W,oe){return!te.objectMode&&te.decodeStrings!==!1&&typeof W=="string"&&(W=o.from(W,oe)),W}Object.defineProperty(J.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function $(te,W,oe,be,xe,X){if(!oe){var M=k(W,be,xe);be!==M&&(oe=!0,xe="buffer",be=M)}var ae=W.objectMode?1:be.length;W.length+=ae;var ge=W.length<W.highWaterMark;if(ge||(W.needDrain=!0),W.writing||W.corked){var Se=W.lastBufferedRequest;W.lastBufferedRequest={chunk:be,encoding:xe,isBuf:oe,callback:X,next:null},Se?Se.next=W.lastBufferedRequest:W.bufferedRequest=W.lastBufferedRequest,W.bufferedRequestCount+=1}else Y(te,W,!1,ae,be,xe,X);return ge}function Y(te,W,oe,be,xe,X,M){W.writelen=be,W.writecb=M,W.writing=!0,W.sync=!0,W.destroyed?W.onwrite(new y("write")):oe?te._writev(xe,W.onwrite):te._write(xe,X,W.onwrite),W.sync=!1}function ie(te,W,oe,be,xe){--W.pendingcb,oe?(r.nextTick(xe,be),r.nextTick(Q,te,W),te._writableState.errorEmitted=!0,A(te,be)):(xe(be),te._writableState.errorEmitted=!0,A(te,be),Q(te,W))}function re(te){te.writing=!1,te.writecb=null,te.length-=te.writelen,te.writelen=0}function N(te,W){var oe=te._writableState,be=oe.sync,xe=oe.writecb;if(typeof xe!="function")throw new v;if(re(oe),W)ie(te,oe,be,W,xe);else{var X=j(oe)||te.destroyed;!X&&!oe.corked&&!oe.bufferProcessing&&oe.bufferedRequest&&C(te,oe),be?r.nextTick(x,te,oe,X,xe):x(te,oe,X,xe)}}function x(te,W,oe,be){oe||P(te,W),W.pendingcb--,be(),Q(te,W)}function P(te,W){W.length===0&&W.needDrain&&(W.needDrain=!1,te.emit("drain"))}function C(te,W){W.bufferProcessing=!0;var oe=W.bufferedRequest;if(te._writev&&oe&&oe.next){var be=W.bufferedRequestCount,xe=new Array(be),X=W.corkedRequestsFree;X.entry=oe;for(var M=0,ae=!0;oe;)xe[M]=oe,oe.isBuf||(ae=!1),oe=oe.next,M+=1;xe.allBuffers=ae,Y(te,W,!0,W.length,xe,"",X.finish),W.pendingcb++,W.lastBufferedRequest=null,X.next?(W.corkedRequestsFree=X.next,X.next=null):W.corkedRequestsFree=new e(W),W.bufferedRequestCount=0}else{for(;oe;){var ge=oe.chunk,Se=oe.encoding,we=oe.callback,de=W.objectMode?1:ge.length;if(Y(te,W,!1,de,ge,Se,we),oe=oe.next,W.bufferedRequestCount--,W.writing)break}oe===null&&(W.lastBufferedRequest=null)}W.bufferedRequest=oe,W.bufferProcessing=!1}J.prototype._write=function(te,W,oe){oe(new b("_write()"))},J.prototype._writev=null,J.prototype.end=function(te,W,oe){var be=this._writableState;return typeof te=="function"?(oe=te,te=null,W=null):typeof W=="function"&&(oe=W,W=null),te!=null&&this.write(te,W),be.corked&&(be.corked=1,this.uncork()),be.ending||fe(this,be,oe),this},Object.defineProperty(J.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function j(te){return te.ending&&te.length===0&&te.bufferedRequest===null&&!te.finished&&!te.writing}function U(te,W){te._final(function(oe){W.pendingcb--,oe&&A(te,oe),W.prefinished=!0,te.emit("prefinish"),Q(te,W)})}function B(te,W){!W.prefinished&&!W.finalCalled&&(typeof te._final=="function"&&!W.destroyed?(W.pendingcb++,W.finalCalled=!0,r.nextTick(U,te,W)):(W.prefinished=!0,te.emit("prefinish")))}function Q(te,W){var oe=j(W);if(oe&&(B(te,W),W.pendingcb===0&&(W.finished=!0,te.emit("finish"),W.autoDestroy))){var be=te._readableState;(!be||be.autoDestroy&&be.endEmitted)&&te.destroy()}return oe}function fe(te,W,oe){W.ending=!0,Q(te,W),oe&&(W.finished?r.nextTick(oe):te.once("finish",oe)),W.ended=!0,te.writable=!1}function _e(te,W,oe){var be=te.entry;for(te.entry=null;be;){var xe=be.callback;W.pendingcb--,xe(oe),be=be.next}W.corkedRequestsFree.next=te}return Object.defineProperty(J.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(W){this._writableState&&(this._writableState.destroyed=W)}}),J.prototype.destroy=c.destroy,J.prototype._undestroy=c.undestroy,J.prototype._destroy=function(te,W){W(te)},dE}function $u(){if(TI)return pE;TI=!0;var r=Gt,e=Object.keys||function(f){var h=[];for(var p in f)h.push(p);return h};pE=a;var t=IE(),n=DE();zu()(a,t);for(var i=e(n.prototype),o=0;o<i.length;o++){var s=i[o];a.prototype[s]||(a.prototype[s]=n.prototype[s])}function a(f){if(!(this instanceof a))return new a(f);t.call(this,f),n.call(this,f),this.allowHalfOpen=!0,f&&(f.readable===!1&&(this.readable=!1),f.writable===!1&&(this.writable=!1),f.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",u)))}Object.defineProperty(a.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(a.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(a.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function u(){this._writableState.ended||r.nextTick(c,this)}function c(f){f.end()}return Object.defineProperty(a.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(h){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=h,this._writableState.destroyed=h)}}),pE}function Q0(){if(CI)return gE;CI=!0;var r=Zf().codes.ERR_STREAM_PREMATURE_CLOSE;function e(o){var s=!1;return function(){if(!s){s=!0;for(var a=arguments.length,u=new Array(a),c=0;c<a;c++)u[c]=arguments[c];o.apply(this,u)}}}function t(){}function n(o){return o.setHeader&&typeof o.abort=="function"}function i(o,s,a){if(typeof s=="function")return i(o,null,s);s||(s={}),a=e(a||t);var u=s.readable||s.readable!==!1&&o.readable,c=s.writable||s.writable!==!1&&o.writable,f=function(){o.writable||p()},h=o._writableState&&o._writableState.finished,p=function(){c=!1,h=!0,u||a.call(o)},m=o._readableState&&o._readableState.endEmitted,b=function(){u=!1,m=!0,c||a.call(o)},v=function(E){a.call(o,E)},w=function(){var E;if(u&&!m)return(!o._readableState||!o._readableState.ended)&&(E=new r),a.call(o,E);if(c&&!h)return(!o._writableState||!o._writableState.ended)&&(E=new r),a.call(o,E)},y=function(){o.req.on("finish",p)};return n(o)?(o.on("complete",p),o.on("abort",w),o.req?y():o.on("request",y)):c&&!o._writableState&&(o.on("end",f),o.on("close",f)),o.on("end",b),o.on("finish",p),s.error!==!1&&o.on("error",v),o.on("close",w),function(){o.removeListener("complete",p),o.removeListener("abort",w),o.removeListener("request",y),o.req&&o.req.removeListener("finish",p),o.removeListener("end",f),o.removeListener("close",f),o.removeListener("finish",p),o.removeListener("end",b),o.removeListener("error",v),o.removeListener("close",w)}}return gE=i,gE}function J5(){if(RI)return mE;RI=!0;var r=Gt,e;function t(_,E,S){return E in _?Object.defineProperty(_,E,{value:S,enumerable:!0,configurable:!0,writable:!0}):_[E]=S,_}var n=Q0(),i=Symbol("lastResolve"),o=Symbol("lastReject"),s=Symbol("error"),a=Symbol("ended"),u=Symbol("lastPromise"),c=Symbol("handlePromise"),f=Symbol("stream");function h(_,E){return{value:_,done:E}}function p(_){var E=_[i];if(E!==null){var S=_[f].read();S!==null&&(_[u]=null,_[i]=null,_[o]=null,E(h(S,!1)))}}function m(_){r.nextTick(p,_)}function b(_,E){return function(S,A){_.then(function(){if(E[a]){S(h(void 0,!0));return}E[c](S,A)},A)}}var v=Object.getPrototypeOf(function(){}),w=Object.setPrototypeOf((e={get stream(){return this[f]},next:function(){var E=this,S=this[s];if(S!==null)return Promise.reject(S);if(this[a])return Promise.resolve(h(void 0,!0));if(this[f].destroyed)return new Promise(function(H,J){r.nextTick(function(){E[s]?J(E[s]):H(h(void 0,!0))})});var A=this[u],F;if(A)F=new Promise(b(A,this));else{var D=this[f].read();if(D!==null)return Promise.resolve(h(D,!1));F=new Promise(this[c])}return this[u]=F,F}},t(e,Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var E=this;return new Promise(function(S,A){E[f].destroy(null,function(F){if(F){A(F);return}S(h(void 0,!0))})})}),e),v),y=function(E){var S,A=Object.create(w,(S={},t(S,f,{value:E,writable:!0}),t(S,i,{value:null,writable:!0}),t(S,o,{value:null,writable:!0}),t(S,s,{value:null,writable:!0}),t(S,a,{value:E._readableState.endEmitted,writable:!0}),t(S,c,{value:function(D,H){var J=A[f].read();J?(A[u]=null,A[i]=null,A[o]=null,D(h(J,!1))):(A[i]=D,A[o]=H)},writable:!0}),S));return A[u]=null,n(E,function(F){if(F&&F.code!=="ERR_STREAM_PREMATURE_CLOSE"){var D=A[o];D!==null&&(A[u]=null,A[i]=null,A[o]=null,D(F)),A[s]=F;return}var H=A[i];H!==null&&(A[u]=null,A[i]=null,A[o]=null,H(h(void 0,!0))),A[a]=!0}),E.on("readable",m.bind(null,A)),A};return mE=y,mE}function Q5(){return DI||(DI=!0,yE=function(){throw new Error("Readable.from is not available in the browser")}),yE}function IE(){if(II)return bE;II=!0;var r=Gt;bE=K;var e;K.ReadableState=J,nn.EventEmitter;var t=function(M,ae){return M.listeners(ae).length},n=zI(),i=Kf.Buffer,o=eU.Uint8Array||function(){};function s(X){return i.from(X)}function a(X){return i.isBuffer(X)||X instanceof o}var u=ze,c;u&&u.debuglog?c=u.debuglog("stream"):c=function(){};var f=X5(),h=WI(),p=qI(),m=p.getHighWaterMark,b=Zf().codes,v=b.ERR_INVALID_ARG_TYPE,w=b.ERR_STREAM_PUSH_AFTER_EOF,y=b.ERR_METHOD_NOT_IMPLEMENTED,_=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,E,S,A;zu()(K,n);var F=h.errorOrDestroy,D=["error","close","destroy","pause","resume"];function H(X,M,ae){if(typeof X.prependListener=="function")return X.prependListener(M,ae);!X._events||!X._events[M]?X.on(M,ae):Array.isArray(X._events[M])?X._events[M].unshift(ae):X._events[M]=[ae,X._events[M]]}function J(X,M,ae){e=e||$u(),X=X||{},typeof ae!="boolean"&&(ae=M instanceof e),this.objectMode=!!X.objectMode,ae&&(this.objectMode=this.objectMode||!!X.readableObjectMode),this.highWaterMark=m(this,X,"readableHighWaterMark",ae),this.buffer=new f,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=X.emitClose!==!1,this.autoDestroy=!!X.autoDestroy,this.destroyed=!1,this.defaultEncoding=X.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,X.encoding&&(E||(E=SE.StringDecoder),this.decoder=new E(X.encoding),this.encoding=X.encoding)}function K(X){if(e=e||$u(),!(this instanceof K))return new K(X);var M=this instanceof e;this._readableState=new J(X,this,M),this.readable=!0,X&&(typeof X.read=="function"&&(this._read=X.read),typeof X.destroy=="function"&&(this._destroy=X.destroy)),n.call(this)}Object.defineProperty(K.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(M){this._readableState&&(this._readableState.destroyed=M)}}),K.prototype.destroy=h.destroy,K.prototype._undestroy=h.undestroy,K.prototype._destroy=function(X,M){M(X)},K.prototype.push=function(X,M){var ae=this._readableState,ge;return ae.objectMode?ge=!0:typeof X=="string"&&(M=M||ae.defaultEncoding,M!==ae.encoding&&(X=i.from(X,M),M=""),ge=!0),ne(this,X,M,!1,ge)},K.prototype.unshift=function(X){return ne(this,X,null,!0,!1)};function ne(X,M,ae,ge,Se){c("readableAddChunk",M);var we=X._readableState;if(M===null)we.reading=!1,N(X,we);else{var de;if(Se||(de=$(we,M)),de)F(X,de);else if(we.objectMode||M&&M.length>0)if(typeof M!="string"&&!we.objectMode&&Object.getPrototypeOf(M)!==i.prototype&&(M=s(M)),ge)we.endEmitted?F(X,new _):k(X,we,M,!0);else if(we.ended)F(X,new w);else{if(we.destroyed)return!1;we.reading=!1,we.decoder&&!ae?(M=we.decoder.write(M),we.objectMode||M.length!==0?k(X,we,M,!1):C(X,we)):k(X,we,M,!1)}else ge||(we.reading=!1,C(X,we))}return!we.ended&&(we.length<we.highWaterMark||we.length===0)}function k(X,M,ae,ge){M.flowing&&M.length===0&&!M.sync?(M.awaitDrain=0,X.emit("data",ae)):(M.length+=M.objectMode?1:ae.length,ge?M.buffer.unshift(ae):M.buffer.push(ae),M.needReadable&&x(X)),C(X,M)}function $(X,M){var ae;return!a(M)&&typeof M!="string"&&M!==void 0&&!X.objectMode&&(ae=new v("chunk",["string","Buffer","Uint8Array"],M)),ae}K.prototype.isPaused=function(){return this._readableState.flowing===!1},K.prototype.setEncoding=function(X){E||(E=SE.StringDecoder);var M=new E(X);this._readableState.decoder=M,this._readableState.encoding=this._readableState.decoder.encoding;for(var ae=this._readableState.buffer.head,ge="";ae!==null;)ge+=M.write(ae.data),ae=ae.next;return this._readableState.buffer.clear(),ge!==""&&this._readableState.buffer.push(ge),this._readableState.length=ge.length,this};var Y=1073741824;function ie(X){return X>=Y?X=Y:(X--,X|=X>>>1,X|=X>>>2,X|=X>>>4,X|=X>>>8,X|=X>>>16,X++),X}function re(X,M){return X<=0||M.length===0&&M.ended?0:M.objectMode?1:X!==X?M.flowing&&M.length?M.buffer.head.data.length:M.length:(X>M.highWaterMark&&(M.highWaterMark=ie(X)),X<=M.length?X:M.ended?M.length:(M.needReadable=!0,0))}K.prototype.read=function(X){c("read",X),X=parseInt(X,10);var M=this._readableState,ae=X;if(X!==0&&(M.emittedReadable=!1),X===0&&M.needReadable&&((M.highWaterMark!==0?M.length>=M.highWaterMark:M.length>0)||M.ended))return c("read: emitReadable",M.length,M.ended),M.length===0&&M.ended?oe(this):x(this),null;if(X=re(X,M),X===0&&M.ended)return M.length===0&&oe(this),null;var ge=M.needReadable;c("need readable",ge),(M.length===0||M.length-X<M.highWaterMark)&&(ge=!0,c("length less than watermark",ge)),M.ended||M.reading?(ge=!1,c("reading or ended",ge)):ge&&(c("do read"),M.reading=!0,M.sync=!0,M.length===0&&(M.needReadable=!0),this._read(M.highWaterMark),M.sync=!1,M.reading||(X=re(ae,M)));var Se;return X>0?Se=W(X,M):Se=null,Se===null?(M.needReadable=M.length<=M.highWaterMark,X=0):(M.length-=X,M.awaitDrain=0),M.length===0&&(M.ended||(M.needReadable=!0),ae!==X&&M.ended&&oe(this)),Se!==null&&this.emit("data",Se),Se};function N(X,M){if(c("onEofChunk"),!M.ended){if(M.decoder){var ae=M.decoder.end();ae&&ae.length&&(M.buffer.push(ae),M.length+=M.objectMode?1:ae.length)}M.ended=!0,M.sync?x(X):(M.needReadable=!1,M.emittedReadable||(M.emittedReadable=!0,P(X)))}}function x(X){var M=X._readableState;c("emitReadable",M.needReadable,M.emittedReadable),M.needReadable=!1,M.emittedReadable||(c("emitReadable",M.flowing),M.emittedReadable=!0,r.nextTick(P,X))}function P(X){var M=X._readableState;c("emitReadable_",M.destroyed,M.length,M.ended),!M.destroyed&&(M.length||M.ended)&&(X.emit("readable"),M.emittedReadable=!1),M.needReadable=!M.flowing&&!M.ended&&M.length<=M.highWaterMark,te(X)}function C(X,M){M.readingMore||(M.readingMore=!0,r.nextTick(j,X,M))}function j(X,M){for(;!M.reading&&!M.ended&&(M.length<M.highWaterMark||M.flowing&&M.length===0);){var ae=M.length;if(c("maybeReadMore read 0"),X.read(0),ae===M.length)break}M.readingMore=!1}K.prototype._read=function(X){F(this,new y("_read()"))},K.prototype.pipe=function(X,M){var ae=this,ge=this._readableState;switch(ge.pipesCount){case 0:ge.pipes=X;break;case 1:ge.pipes=[ge.pipes,X];break;default:ge.pipes.push(X);break}ge.pipesCount+=1,c("pipe count=%d opts=%j",ge.pipesCount,M);var Se=(!M||M.end!==!1)&&X!==r.stdout&&X!==r.stderr,we=Se?Ae:d;ge.endEmitted?r.nextTick(we):ae.once("end",we),X.on("unpipe",de);function de(g,I){c("onunpipe"),g===ae&&I&&I.hasUnpiped===!1&&(I.hasUnpiped=!0,Oe())}function Ae(){c("onend"),X.end()}var je=U(ae);X.on("drain",je);var ke=!1;function Oe(){c("cleanup"),X.removeListener("close",et),X.removeListener("finish",T),X.removeListener("drain",je),X.removeListener("error",Je),X.removeListener("unpipe",de),ae.removeListener("end",Ae),ae.removeListener("end",d),ae.removeListener("data",Ve),ke=!0,ge.awaitDrain&&(!X._writableState||X._writableState.needDrain)&&je()}ae.on("data",Ve);function Ve(g){c("ondata");var I=X.write(g);c("dest.write",I),I===!1&&((ge.pipesCount===1&&ge.pipes===X||ge.pipesCount>1&&xe(ge.pipes,X)!==-1)&&!ke&&(c("false write response, pause",ge.awaitDrain),ge.awaitDrain++),ae.pause())}function Je(g){c("onerror",g),d(),X.removeListener("error",Je),t(X,"error")===0&&F(X,g)}H(X,"error",Je);function et(){X.removeListener("finish",T),d()}X.once("close",et);function T(){c("onfinish"),X.removeListener("close",et),d()}X.once("finish",T);function d(){c("unpipe"),ae.unpipe(X)}return X.emit("pipe",ae),ge.flowing||(c("pipe resume"),ae.resume()),X};function U(X){return function(){var ae=X._readableState;c("pipeOnDrain",ae.awaitDrain),ae.awaitDrain&&ae.awaitDrain--,ae.awaitDrain===0&&t(X,"data")&&(ae.flowing=!0,te(X))}}K.prototype.unpipe=function(X){var M=this._readableState,ae={hasUnpiped:!1};if(M.pipesCount===0)return this;if(M.pipesCount===1)return X&&X!==M.pipes?this:(X||(X=M.pipes),M.pipes=null,M.pipesCount=0,M.flowing=!1,X&&X.emit("unpipe",this,ae),this);if(!X){var ge=M.pipes,Se=M.pipesCount;M.pipes=null,M.pipesCount=0,M.flowing=!1;for(var we=0;we<Se;we++)ge[we].emit("unpipe",this,{hasUnpiped:!1});return this}var de=xe(M.pipes,X);return de===-1?this:(M.pipes.splice(de,1),M.pipesCount-=1,M.pipesCount===1&&(M.pipes=M.pipes[0]),X.emit("unpipe",this,ae),this)},K.prototype.on=function(X,M){var ae=n.prototype.on.call(this,X,M),ge=this._readableState;return X==="data"?(ge.readableListening=this.listenerCount("readable")>0,ge.flowing!==!1&&this.resume()):X==="readable"&&!ge.endEmitted&&!ge.readableListening&&(ge.readableListening=ge.needReadable=!0,ge.flowing=!1,ge.emittedReadable=!1,c("on readable",ge.length,ge.reading),ge.length?x(this):ge.reading||r.nextTick(Q,this)),ae},K.prototype.addListener=K.prototype.on,K.prototype.removeListener=function(X,M){var ae=n.prototype.removeListener.call(this,X,M);return X==="readable"&&r.nextTick(B,this),ae},K.prototype.removeAllListeners=function(X){var M=n.prototype.removeAllListeners.apply(this,arguments);return(X==="readable"||X===void 0)&&r.nextTick(B,this),M};function B(X){var M=X._readableState;M.readableListening=X.listenerCount("readable")>0,M.resumeScheduled&&!M.paused?M.flowing=!0:X.listenerCount("data")>0&&X.resume()}function Q(X){c("readable nexttick read 0"),X.read(0)}K.prototype.resume=function(){var X=this._readableState;return X.flowing||(c("resume"),X.flowing=!X.readableListening,fe(this,X)),X.paused=!1,this};function fe(X,M){M.resumeScheduled||(M.resumeScheduled=!0,r.nextTick(_e,X,M))}function _e(X,M){c("resume",M.reading),M.reading||X.read(0),M.resumeScheduled=!1,X.emit("resume"),te(X),M.flowing&&!M.reading&&X.read(0)}K.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function te(X){var M=X._readableState;for(c("flow",M.flowing);M.flowing&&X.read()!==null;);}K.prototype.wrap=function(X){var M=this,ae=this._readableState,ge=!1;X.on("end",function(){if(c("wrapped end"),ae.decoder&&!ae.ended){var de=ae.decoder.end();de&&de.length&&M.push(de)}M.push(null)}),X.on("data",function(de){if(c("wrapped data"),ae.decoder&&(de=ae.decoder.write(de)),!(ae.objectMode&&de==null)&&!(!ae.objectMode&&(!de||!de.length))){var Ae=M.push(de);Ae||(ge=!0,X.pause())}});for(var Se in X)this[Se]===void 0&&typeof X[Se]=="function"&&(this[Se]=(function(Ae){return function(){return X[Ae].apply(X,arguments)}})(Se));for(var we=0;we<D.length;we++)X.on(D[we],this.emit.bind(this,D[we]));return this._read=function(de){c("wrapped _read",de),ge&&(ge=!1,X.resume())},this},typeof Symbol=="function"&&(K.prototype[Symbol.asyncIterator]=function(){return S===void 0&&(S=J5()),S(this)}),Object.defineProperty(K.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(K.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(K.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(M){this._readableState&&(this._readableState.flowing=M)}}),K._fromList=W,Object.defineProperty(K.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function W(X,M){if(M.length===0)return null;var ae;return M.objectMode?ae=M.buffer.shift():!X||X>=M.length?(M.decoder?ae=M.buffer.join(""):M.buffer.length===1?ae=M.buffer.first():ae=M.buffer.concat(M.length),M.buffer.clear()):ae=M.buffer.consume(X,M.decoder),ae}function oe(X){var M=X._readableState;c("endReadable",M.endEmitted),M.endEmitted||(M.ended=!0,r.nextTick(be,M,X))}function be(X,M){if(c("endReadableNT",X.endEmitted,X.length),!X.endEmitted&&X.length===0&&(X.endEmitted=!0,M.readable=!1,M.emit("end"),X.autoDestroy)){var ae=M._writableState;(!ae||ae.autoDestroy&&ae.finished)&&M.destroy()}}typeof Symbol=="function"&&(K.from=function(X,M){return A===void 0&&(A=Q5()),A(K,X,M)});function xe(X,M){for(var ae=0,ge=X.length;ae<ge;ae++)if(X[ae]===M)return ae;return-1}return bE}function OE(){if(OI)return wE;OI=!0,wE=a;var r=Zf().codes,e=r.ERR_METHOD_NOT_IMPLEMENTED,t=r.ERR_MULTIPLE_CALLBACK,n=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,i=r.ERR_TRANSFORM_WITH_LENGTH_0,o=$u();zu()(a,o);function s(f,h){var p=this._transformState;p.transforming=!1;var m=p.writecb;if(m===null)return this.emit("error",new t);p.writechunk=null,p.writecb=null,h!=null&&this.push(h),m(f);var b=this._readableState;b.reading=!1,(b.needReadable||b.length<b.highWaterMark)&&this._read(b.highWaterMark)}function a(f){if(!(this instanceof a))return new a(f);o.call(this,f),this._transformState={afterTransform:s.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,f&&(typeof f.transform=="function"&&(this._transform=f.transform),typeof f.flush=="function"&&(this._flush=f.flush)),this.on("prefinish",u)}function u(){var f=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(h,p){c(f,h,p)}):c(this,null,null)}a.prototype.push=function(f,h){return this._transformState.needTransform=!1,o.prototype.push.call(this,f,h)},a.prototype._transform=function(f,h,p){p(new e("_transform()"))},a.prototype._write=function(f,h,p){var m=this._transformState;if(m.writecb=p,m.writechunk=f,m.writeencoding=h,!m.transforming){var b=this._readableState;(m.needTransform||b.needReadable||b.length<b.highWaterMark)&&this._read(b.highWaterMark)}},a.prototype._read=function(f){var h=this._transformState;h.writechunk!==null&&!h.transforming?(h.transforming=!0,this._transform(h.writechunk,h.writeencoding,h.afterTransform)):h.needTransform=!0},a.prototype._destroy=function(f,h){o.prototype._destroy.call(this,f,function(p){h(p)})};function c(f,h,p){if(h)return f.emit("error",h);if(p!=null&&f.push(p),f._writableState.length)throw new i;if(f._transformState.transforming)throw new n;return f.push(null)}return wE}function HI(){if(NI)return vE;NI=!0,vE=e;var r=OE();zu()(e,r);function e(t){if(!(this instanceof e))return new e(t);r.call(this,t)}return e.prototype._transform=function(t,n,i){i(null,t)},vE}function GI(){if(kI)return _E;kI=!0;var r;function e(p){var m=!1;return function(){m||(m=!0,p.apply(void 0,arguments))}}var t=Zf().codes,n=t.ERR_MISSING_ARGS,i=t.ERR_STREAM_DESTROYED;function o(p){if(p)throw p}function s(p){return p.setHeader&&typeof p.abort=="function"}function a(p,m,b,v){v=e(v);var w=!1;p.on("close",function(){w=!0}),r===void 0&&(r=Q0()),r(p,{readable:m,writable:b},function(_){if(_)return v(_);w=!0,v()});var y=!1;return function(_){if(!w&&!y){if(y=!0,s(p))return p.abort();if(typeof p.destroy=="function")return p.destroy();v(_||new i("pipe"))}}}function u(p){p()}function c(p,m){return p.pipe(m)}function f(p){return!p.length||typeof p[p.length-1]!="function"?o:p.pop()}function h(){for(var p=arguments.length,m=new Array(p),b=0;b<p;b++)m[b]=arguments[b];var v=f(m);if(Array.isArray(m[0])&&(m=m[0]),m.length<2)throw new n("streams");var w,y=m.map(function(_,E){var S=E<m.length-1,A=E>0;return a(_,S,A,function(F){w||(w=F),F&&y.forEach(u),!S&&(y.forEach(u),v(w))})});return m.reduce(c)}return _E=h,_E}var LI,Cs,Ai,iI,V0,Bu,sI,x5,Ko,EE,Xf,aI,M5,B5,K0,Z0,to,F5,SE,TE,pI,Bp,gI,Y0,mI,ju,yI,Kf,X0,bI,oE,wI,aE,vI,lE,_I,uE,EI,cE,AI,fE,xI,hE,dE,SI,Z5,pE,TI,gE,CI,mE,RI,yE,DI,bE,II,eU,wE,OI,vE,NI,_E,kI,eb=Jt(()=>{Ce();De();Re();Yf();ul();Wf();for(LI={byteLength:function(r){var e=oI(r),t=e[0],n=e[1];return 3*(t+n)/4-n},toByteArray:function(r){var e,t,n=oI(r),i=n[0],o=n[1],s=new iI((function(c,f,h){return 3*(f+h)/4-h})(0,i,o)),a=0,u=o>0?i-4:i;for(t=0;t<u;t+=4)e=Ai[r.charCodeAt(t)]<<18|Ai[r.charCodeAt(t+1)]<<12|Ai[r.charCodeAt(t+2)]<<6|Ai[r.charCodeAt(t+3)],s[a++]=e>>16&255,s[a++]=e>>8&255,s[a++]=255&e;return o===2&&(e=Ai[r.charCodeAt(t)]<<2|Ai[r.charCodeAt(t+1)]>>4,s[a++]=255&e),o===1&&(e=Ai[r.charCodeAt(t)]<<10|Ai[r.charCodeAt(t+1)]<<4|Ai[r.charCodeAt(t+2)]>>2,s[a++]=e>>8&255,s[a++]=255&e),s},fromByteArray:function(r){for(var e,t=r.length,n=t%3,i=[],o=0,s=t-n;o<s;o+=16383)i.push(A5(r,o,o+16383>s?s:o+16383));return n===1?(e=r[t-1],i.push(Cs[e>>2]+Cs[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1],i.push(Cs[e>>10]+Cs[e>>4&63]+Cs[e<<2&63]+"=")),i.join("")}},Cs=[],Ai=[],iI=typeof Uint8Array<"u"?Uint8Array:Array,V0="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Bu=0,sI=V0.length;Bu<sI;++Bu)Cs[Bu]=V0[Bu],Ai[V0.charCodeAt(Bu)]=Bu;Ai[45]=62,Ai[95]=63;x5={read:function(r,e,t,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,c=u>>1,f=-7,h=t?i-1:0,p=t?-1:1,m=r[e+h];for(h+=p,o=m&(1<<-f)-1,m>>=-f,f+=a;f>0;o=256*o+r[e+h],h+=p,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=256*s+r[e+h],h+=p,f-=8);if(o===0)o=1-c;else{if(o===u)return s?NaN:1/0*(m?-1:1);s+=Math.pow(2,n),o-=c}return(m?-1:1)*s*Math.pow(2,o-n)},write:function(r,e,t,n,i,o){var s,a,u,c=8*o-i-1,f=(1<<c)-1,h=f>>1,p=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:o-1,b=n?1:-1,v=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+h>=1?p/u:p*Math.pow(2,1-h))*u>=2&&(s++,u/=2),s+h>=f?(a=0,s=f):s+h>=1?(a=(e*u-1)*Math.pow(2,i),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;r[t+m]=255&a,m+=b,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;r[t+m]=255&s,m+=b,s/=256,c-=8);r[t+m-b]|=128*v}},Ko={},EE=LI,Xf=x5,aI=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Ko.Buffer=Ge,Ko.SlowBuffer=function(r){return+r!=r&&(r=0),Ge.alloc(+r)},Ko.INSPECT_MAX_BYTES=50;Ko.kMaxLength=2147483647,Ge.TYPED_ARRAY_SUPPORT=(function(){try{var r=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(r,e),r.foo()===42}catch{return!1}})(),Ge.TYPED_ARRAY_SUPPORT||typeof console>"u"||typeof console.error!="function"||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(Ge.prototype,"parent",{enumerable:!0,get:function(){if(Ge.isBuffer(this))return this.buffer}}),Object.defineProperty(Ge.prototype,"offset",{enumerable:!0,get:function(){if(Ge.isBuffer(this))return this.byteOffset}}),Ge.poolSize=8192,Ge.from=function(r,e,t){return PI(r,e,t)},Object.setPrototypeOf(Ge.prototype,Uint8Array.prototype),Object.setPrototypeOf(Ge,Uint8Array),Ge.alloc=function(r,e,t){return(function(n,i,o){return MI(n),n<=0?Yo(n):i!==void 0?typeof o=="string"?Yo(n).fill(i,o):Yo(n).fill(i):Yo(n)})(r,e,t)},Ge.allocUnsafe=function(r){return AE(r)},Ge.allocUnsafeSlow=function(r){return AE(r)},Ge.isBuffer=function(r){return r!=null&&r._isBuffer===!0&&r!==Ge.prototype},Ge.compare=function(r,e){if(Xo(r,Uint8Array)&&(r=Ge.from(r,r.offset,r.byteLength)),Xo(e,Uint8Array)&&(e=Ge.from(e,e.offset,e.byteLength)),!Ge.isBuffer(r)||!Ge.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===e)return 0;for(var t=r.length,n=e.length,i=0,o=Math.min(t,n);i<o;++i)if(r[i]!==e[i]){t=r[i],n=e[i];break}return t<n?-1:n<t?1:0},Ge.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Ge.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return Ge.alloc(0);var t;if(e===void 0)for(e=0,t=0;t<r.length;++t)e+=r[t].length;var n=Ge.allocUnsafe(e),i=0;for(t=0;t<r.length;++t){var o=r[t];if(Xo(o,Uint8Array)&&(o=Ge.from(o)),!Ge.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},Ge.byteLength=BI,Ge.prototype._isBuffer=!0,Ge.prototype.swap16=function(){var r=this.length;if(r%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<r;e+=2)Fu(this,e,e+1);return this},Ge.prototype.swap32=function(){var r=this.length;if(r%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<r;e+=4)Fu(this,e,e+3),Fu(this,e+1,e+2);return this},Ge.prototype.swap64=function(){var r=this.length;if(r%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<r;e+=8)Fu(this,e,e+7),Fu(this,e+1,e+6),Fu(this,e+2,e+5),Fu(this,e+3,e+4);return this},Ge.prototype.toString=function(){var r=this.length;return r===0?"":arguments.length===0?UI(this,0,r):S5.apply(this,arguments)},Ge.prototype.toLocaleString=Ge.prototype.toString,Ge.prototype.equals=function(r){if(!Ge.isBuffer(r))throw new TypeError("Argument must be a Buffer");return this===r||Ge.compare(this,r)===0},Ge.prototype.inspect=function(){var r="",e=Ko.INSPECT_MAX_BYTES;return r=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(r+=" ... "),"<Buffer "+r+">"},aI&&(Ge.prototype[aI]=Ge.prototype.inspect),Ge.prototype.compare=function(r,e,t,n,i){if(Xo(r,Uint8Array)&&(r=Ge.from(r,r.offset,r.byteLength)),!Ge.isBuffer(r))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof r);if(e===void 0&&(e=0),t===void 0&&(t=r?r.length:0),n===void 0&&(n=0),i===void 0&&(i=this.length),e<0||t>r.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=t)return 0;if(n>=i)return-1;if(e>=t)return 1;if(this===r)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(t>>>=0)-(e>>>=0),a=Math.min(o,s),u=this.slice(n,i),c=r.slice(e,t),f=0;f<a;++f)if(u[f]!==c[f]){o=u[f],s=c[f];break}return o<s?-1:s<o?1:0},Ge.prototype.includes=function(r,e,t){return this.indexOf(r,e,t)!==-1},Ge.prototype.indexOf=function(r,e,t){return uI(this,r,e,t,!0)},Ge.prototype.lastIndexOf=function(r,e,t){return uI(this,r,e,t,!1)},Ge.prototype.write=function(r,e,t,n){if(e===void 0)n="utf8",t=this.length,e=0;else if(t===void 0&&typeof e=="string")n=e,t=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(t)?(t>>>=0,n===void 0&&(n="utf8")):(n=t,t=void 0)}var i=this.length-e;if((t===void 0||t>i)&&(t=i),r.length>0&&(t<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return T5(this,r,e,t);case"utf8":case"utf-8":return C5(this,r,e,t);case"ascii":return FI(this,r,e,t);case"latin1":case"binary":return R5(this,r,e,t);case"base64":return D5(this,r,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I5(this,r,e,t);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},Ge.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};Ge.prototype.slice=function(r,e){var t=this.length;(r=~~r)<0?(r+=t)<0&&(r=0):r>t&&(r=t),(e=e===void 0?t:~~e)<0?(e+=t)<0&&(e=0):e>t&&(e=t),e<r&&(e=r);var n=this.subarray(r,e);return Object.setPrototypeOf(n,Ge.prototype),n},Ge.prototype.readUIntLE=function(r,e,t){r>>>=0,e>>>=0,t||hn(r,e,this.length);for(var n=this[r],i=1,o=0;++o<e&&(i*=256);)n+=this[r+o]*i;return n},Ge.prototype.readUIntBE=function(r,e,t){r>>>=0,e>>>=0,t||hn(r,e,this.length);for(var n=this[r+--e],i=1;e>0&&(i*=256);)n+=this[r+--e]*i;return n},Ge.prototype.readUInt8=function(r,e){return r>>>=0,e||hn(r,1,this.length),this[r]},Ge.prototype.readUInt16LE=function(r,e){return r>>>=0,e||hn(r,2,this.length),this[r]|this[r+1]<<8},Ge.prototype.readUInt16BE=function(r,e){return r>>>=0,e||hn(r,2,this.length),this[r]<<8|this[r+1]},Ge.prototype.readUInt32LE=function(r,e){return r>>>=0,e||hn(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+16777216*this[r+3]},Ge.prototype.readUInt32BE=function(r,e){return r>>>=0,e||hn(r,4,this.length),16777216*this[r]+(this[r+1]<<16|this[r+2]<<8|this[r+3])},Ge.prototype.readIntLE=function(r,e,t){r>>>=0,e>>>=0,t||hn(r,e,this.length);for(var n=this[r],i=1,o=0;++o<e&&(i*=256);)n+=this[r+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},Ge.prototype.readIntBE=function(r,e,t){r>>>=0,e>>>=0,t||hn(r,e,this.length);for(var n=e,i=1,o=this[r+--n];n>0&&(i*=256);)o+=this[r+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},Ge.prototype.readInt8=function(r,e){return r>>>=0,e||hn(r,1,this.length),128&this[r]?-1*(255-this[r]+1):this[r]},Ge.prototype.readInt16LE=function(r,e){r>>>=0,e||hn(r,2,this.length);var t=this[r]|this[r+1]<<8;return 32768&t?4294901760|t:t},Ge.prototype.readInt16BE=function(r,e){r>>>=0,e||hn(r,2,this.length);var t=this[r+1]|this[r]<<8;return 32768&t?4294901760|t:t},Ge.prototype.readInt32LE=function(r,e){return r>>>=0,e||hn(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24},Ge.prototype.readInt32BE=function(r,e){return r>>>=0,e||hn(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]},Ge.prototype.readFloatLE=function(r,e){return r>>>=0,e||hn(r,4,this.length),Xf.read(this,r,!0,23,4)},Ge.prototype.readFloatBE=function(r,e){return r>>>=0,e||hn(r,4,this.length),Xf.read(this,r,!1,23,4)},Ge.prototype.readDoubleLE=function(r,e){return r>>>=0,e||hn(r,8,this.length),Xf.read(this,r,!0,52,8)},Ge.prototype.readDoubleBE=function(r,e){return r>>>=0,e||hn(r,8,this.length),Xf.read(this,r,!1,52,8)},Ge.prototype.writeUIntLE=function(r,e,t,n){r=+r,e>>>=0,t>>>=0,n||ni(this,r,e,t,Math.pow(2,8*t)-1,0);var i=1,o=0;for(this[e]=255&r;++o<t&&(i*=256);)this[e+o]=r/i&255;return e+t},Ge.prototype.writeUIntBE=function(r,e,t,n){r=+r,e>>>=0,t>>>=0,n||ni(this,r,e,t,Math.pow(2,8*t)-1,0);var i=t-1,o=1;for(this[e+i]=255&r;--i>=0&&(o*=256);)this[e+i]=r/o&255;return e+t},Ge.prototype.writeUInt8=function(r,e,t){return r=+r,e>>>=0,t||ni(this,r,e,1,255,0),this[e]=255&r,e+1},Ge.prototype.writeUInt16LE=function(r,e,t){return r=+r,e>>>=0,t||ni(this,r,e,2,65535,0),this[e]=255&r,this[e+1]=r>>>8,e+2},Ge.prototype.writeUInt16BE=function(r,e,t){return r=+r,e>>>=0,t||ni(this,r,e,2,65535,0),this[e]=r>>>8,this[e+1]=255&r,e+2},Ge.prototype.writeUInt32LE=function(r,e,t){return r=+r,e>>>=0,t||ni(this,r,e,4,4294967295,0),this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=255&r,e+4},Ge.prototype.writeUInt32BE=function(r,e,t){return r=+r,e>>>=0,t||ni(this,r,e,4,4294967295,0),this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=255&r,e+4},Ge.prototype.writeIntLE=function(r,e,t,n){if(r=+r,e>>>=0,!n){var i=Math.pow(2,8*t-1);ni(this,r,e,t,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&r;++o<t&&(s*=256);)r<0&&a===0&&this[e+o-1]!==0&&(a=1),this[e+o]=(r/s>>0)-a&255;return e+t},Ge.prototype.writeIntBE=function(r,e,t,n){if(r=+r,e>>>=0,!n){var i=Math.pow(2,8*t-1);ni(this,r,e,t,i-1,-i)}var o=t-1,s=1,a=0;for(this[e+o]=255&r;--o>=0&&(s*=256);)r<0&&a===0&&this[e+o+1]!==0&&(a=1),this[e+o]=(r/s>>0)-a&255;return e+t},Ge.prototype.writeInt8=function(r,e,t){return r=+r,e>>>=0,t||ni(this,r,e,1,127,-128),r<0&&(r=255+r+1),this[e]=255&r,e+1},Ge.prototype.writeInt16LE=function(r,e,t){return r=+r,e>>>=0,t||ni(this,r,e,2,32767,-32768),this[e]=255&r,this[e+1]=r>>>8,e+2},Ge.prototype.writeInt16BE=function(r,e,t){return r=+r,e>>>=0,t||ni(this,r,e,2,32767,-32768),this[e]=r>>>8,this[e+1]=255&r,e+2},Ge.prototype.writeInt32LE=function(r,e,t){return r=+r,e>>>=0,t||ni(this,r,e,4,2147483647,-2147483648),this[e]=255&r,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24,e+4},Ge.prototype.writeInt32BE=function(r,e,t){return r=+r,e>>>=0,t||ni(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=255&r,e+4},Ge.prototype.writeFloatLE=function(r,e,t){return fI(this,r,e,!0,t)},Ge.prototype.writeFloatBE=function(r,e,t){return fI(this,r,e,!1,t)},Ge.prototype.writeDoubleLE=function(r,e,t){return hI(this,r,e,!0,t)},Ge.prototype.writeDoubleBE=function(r,e,t){return hI(this,r,e,!1,t)},Ge.prototype.copy=function(r,e,t,n){if(!Ge.isBuffer(r))throw new TypeError("argument should be a Buffer");if(t||(t=0),n||n===0||(n=this.length),e>=r.length&&(e=r.length),e||(e=0),n>0&&n<t&&(n=t),n===t||r.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(t<0||t>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),r.length-e<n-t&&(n=r.length-e+t);var i=n-t;if(this===r&&typeof Uint8Array.prototype.copyWithin=="function")this.copyWithin(e,t,n);else if(this===r&&t<e&&e<n)for(var o=i-1;o>=0;--o)r[o+e]=this[o+t];else Uint8Array.prototype.set.call(r,this.subarray(t,n),e);return i},Ge.prototype.fill=function(r,e,t,n){if(typeof r=="string"){if(typeof e=="string"?(n=e,e=0,t=this.length):typeof t=="string"&&(n=t,t=this.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!Ge.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(r.length===1){var i=r.charCodeAt(0);(n==="utf8"&&i<128||n==="latin1")&&(r=i)}}else typeof r=="number"?r&=255:typeof r=="boolean"&&(r=Number(r));if(e<0||this.length<e||this.length<t)throw new RangeError("Out of range index");if(t<=e)return this;var o;if(e>>>=0,t=t===void 0?this.length:t>>>0,r||(r=0),typeof r=="number")for(o=e;o<t;++o)this[o]=r;else{var s=Ge.isBuffer(r)?r:Ge.from(r,n),a=s.length;if(a===0)throw new TypeError('The value "'+r+'" is invalid for argument "value"');for(o=0;o<t-e;++o)this[o+e]=s[o%a]}return this};M5=/[^+/0-9A-Za-z-_]/g;B5=(function(){for(var r=new Array(256),e=0;e<16;++e)for(var t=16*e,n=0;n<16;++n)r[t+n]="0123456789abcdef"[e]+"0123456789abcdef"[n];return r})();Ko.Buffer;Ko.INSPECT_MAX_BYTES;Ko.kMaxLength;K0={},Z0=Ko,to=Z0.Buffer;to.from&&to.alloc&&to.allocUnsafe&&to.allocUnsafeSlow?K0=Z0:(dI(Z0,K0),K0.Buffer=Uu),Uu.prototype=Object.create(to.prototype),dI(to,Uu),Uu.from=function(r,e,t){if(typeof r=="number")throw new TypeError("Argument must not be a number");return to(r,e,t)},Uu.alloc=function(r,e,t){if(typeof r!="number")throw new TypeError("Argument must be a number");var n=to(r);return e!==void 0?typeof t=="string"?n.fill(e,t):n.fill(e):n.fill(0),n},Uu.allocUnsafe=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return to(r)},Uu.allocUnsafeSlow=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return Z0.SlowBuffer(r)};F5=K0,SE={},TE=F5.Buffer,pI=TE.isEncoding||function(r){switch((r=""+r)&&r.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};SE.StringDecoder=Mp,Mp.prototype.write=function(r){if(r.length===0)return"";var e,t;if(this.lastNeed){if((e=this.fillLast(r))===void 0)return"";t=this.lastNeed,this.lastNeed=0}else t=0;return t<r.length?e?e+this.text(r,t):this.text(r,t):e||""},Mp.prototype.end=function(r){var e=r&&r.length?this.write(r):"";return this.lastNeed?e+"\uFFFD":e},Mp.prototype.text=function(r,e){var t=(function(i,o,s){var a=o.length-1;if(a<s)return 0;var u=sE(o[a]);return u>=0?(u>0&&(i.lastNeed=u-1),u):--a<s||u===-2?0:(u=sE(o[a]))>=0?(u>0&&(i.lastNeed=u-2),u):--a<s||u===-2?0:(u=sE(o[a]))>=0?(u>0&&(u===2?u=0:i.lastNeed=u-3),u):0})(this,r,e);if(!this.lastNeed)return r.toString("utf8",e);this.lastTotal=t;var n=r.length-(t-this.lastNeed);return r.copy(this.lastChar,0,n),r.toString("utf8",e,n)},Mp.prototype.fillLast=function(r){if(this.lastNeed<=r.length)return r.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);r.copy(this.lastChar,this.lastTotal-this.lastNeed,0,r.length),this.lastNeed-=r.length};Bp={},gI=!1;Y0={},mI=!1;ju={},yI=!1;Kf=Y5();Kf.Buffer;Kf.INSPECT_MAX_BYTES;Kf.kMaxLength;X0={},bI=!1;oE={},wI=!1;aE={},vI=!1;lE={},_I=!1;uE={},EI=!1;cE={},AI=!1;fE={},xI=!1,hE=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;dE={},SI=!1,Z5=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;pE={},TI=!1;gE={},CI=!1;mE={},RI=!1;yE={},DI=!1;bE={},II=!1,eU=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;wE={},OI=!1;vE={},NI=!1;_E={},kI=!1});function tU(){if(VI)return NE;VI=!0,NE=t;var r=nn.EventEmitter,e=zu();e(t,r),t.Readable=IE(),t.Writable=DE(),t.Duplex=$u(),t.Transform=OE(),t.PassThrough=HI(),t.finished=Q0(),t.pipeline=GI(),t.Stream=t;function t(){r.call(this||kE)}return t.prototype.pipe=function(n,i){var o=this||kE;function s(m){n.writable&&n.write(m)===!1&&o.pause&&o.pause()}o.on("data",s);function a(){o.readable&&o.resume&&o.resume()}n.on("drain",a),!n._isStdio&&(!i||i.end!==!1)&&(o.on("end",c),o.on("close",f));var u=!1;function c(){u||(u=!0,n.end())}function f(){u||(u=!0,typeof n.destroy=="function"&&n.destroy())}function h(m){if(p(),r.listenerCount(this||kE,"error")===0)throw m}o.on("error",h),n.on("error",h);function p(){o.removeListener("data",s),n.removeListener("drain",a),o.removeListener("end",c),o.removeListener("close",f),o.removeListener("error",h),n.removeListener("error",h),o.removeListener("end",p),o.removeListener("close",p),n.removeListener("close",p)}return o.on("end",p),o.on("close",p),n.on("close",p),n.emit("pipe",o),n},NE}var NE,VI,kE,ii,YI,LE=Jt(()=>{Ce();De();Re();G0();eb();Yf();W0();ul();Wf();NE={},VI=!1,kE=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;ii=tU(),YI=ii.Readable;YI.wrap=function(r,e){return e=Object.assign({objectMode:r.readableObjectMode!=null||r.objectMode!=null||!0},e),e.destroy=function(t,n){r.destroy(t),n(t)},new YI(e).wrap(r)};ii.Writable;ii.Duplex;ii.Transform;ii.PassThrough;ii.finished;ii.pipeline;ii.Stream;W_(ii.finished),W_(ii.pipeline)});function rU(){if(XI)return PE;XI=!0;let r=2147483647,e=36,t=1,n=26,i=38,o=700,s=72,a=128,u="-",c=/^xn--/,f=/[^\0-\x7F]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=e-t,b=Math.floor,v=String.fromCharCode;function w($){throw new RangeError(p[$])}function y($,Y){let ie=[],re=$.length;for(;re--;)ie[re]=Y($[re]);return ie}function _($,Y){let ie=$.split("@"),re="";ie.length>1&&(re=ie[0]+"@",$=ie[1]),$=$.replace(h,".");let N=$.split("."),x=y(N,Y).join(".");return re+x}function E($){let Y=[],ie=0,re=$.length;for(;ie<re;){let N=$.charCodeAt(ie++);if(N>=55296&&N<=56319&&ie<re){let x=$.charCodeAt(ie++);(x&64512)==56320?Y.push(((N&1023)<<10)+(x&1023)+65536):(Y.push(N),ie--)}else Y.push(N)}return Y}let S=$=>String.fromCodePoint(...$),A=function($){return $>=48&&$<58?26+($-48):$>=65&&$<91?$-65:$>=97&&$<123?$-97:e},F=function($,Y){return $+22+75*($<26)-((Y!=0)<<5)},D=function($,Y,ie){let re=0;for($=ie?b($/o):$>>1,$+=b($/Y);$>m*n>>1;re+=e)$=b($/m);return b(re+(m+1)*$/($+i))},H=function($){let Y=[],ie=$.length,re=0,N=a,x=s,P=$.lastIndexOf(u);P<0&&(P=0);for(let C=0;C<P;++C)$.charCodeAt(C)>=128&&w("not-basic"),Y.push($.charCodeAt(C));for(let C=P>0?P+1:0;C<ie;){let j=re;for(let B=1,Q=e;;Q+=e){C>=ie&&w("invalid-input");let fe=A($.charCodeAt(C++));fe>=e&&w("invalid-input"),fe>b((r-re)/B)&&w("overflow"),re+=fe*B;let _e=Q<=x?t:Q>=x+n?n:Q-x;if(fe<_e)break;let te=e-_e;B>b(r/te)&&w("overflow"),B*=te}let U=Y.length+1;x=D(re-j,U,j==0),b(re/U)>r-N&&w("overflow"),N+=b(re/U),re%=U,Y.splice(re++,0,N)}return String.fromCodePoint(...Y)},J=function($){let Y=[];$=E($);let ie=$.length,re=a,N=0,x=s;for(let j of $)j<128&&Y.push(v(j));let P=Y.length,C=P;for(P&&Y.push(u);C<ie;){let j=r;for(let B of $)B>=re&&B<j&&(j=B);let U=C+1;j-re>b((r-N)/U)&&w("overflow"),N+=(j-re)*U,re=j;for(let B of $)if(B<re&&++N>r&&w("overflow"),B===re){let Q=N;for(let fe=e;;fe+=e){let _e=fe<=x?t:fe>=x+n?n:fe-x;if(Q<_e)break;let te=Q-_e,W=e-_e;Y.push(v(F(_e+te%W,0))),Q=b(te/W)}Y.push(v(F(Q,0))),x=D(N,U,C===P),N=0,++C}++N,++re}return Y.join("")};return PE={version:"2.3.1",ucs2:{decode:E,encode:S},decode:H,encode:J,toASCII:function($){return _($,function(Y){return f.test(Y)?"xn--"+J(Y):Y})},toUnicode:function($){return _($,function(Y){return c.test(Y)?H(Y.slice(4).toLowerCase()):Y})}},PE}var PE,XI,hl,QY,eX,tX,rX,nX,iX,ME=Jt(()=>{Ce();De();Re();PE={},XI=!1;hl=rU(),QY=hl.decode,eX=hl.encode,tX=hl.toASCII,rX=hl.toUnicode,nX=hl.ucs2,iX=hl.version});function n2(){return KI||(KI=!0,BE=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[t]=i;for(t in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(e,t);if(s.value!==i||s.enumerable!==!0)return!1}return!0}),BE}function nU(){return ZI||(ZI=!0,FE=Error),FE}function iU(){return JI||(JI=!0,UE=EvalError),UE}function sU(){return QI||(QI=!0,jE=RangeError),jE}function oU(){return eO||(eO=!0,$E=ReferenceError),$E}function yO(){return tO||(tO=!0,zE=SyntaxError),zE}function Jf(){return rO||(rO=!0,WE=TypeError),WE}function aU(){return nO||(nO=!0,qE=URIError),qE}function lU(){if(iO)return HE;iO=!0;var r=typeof Symbol<"u"&&Symbol,e=n2();return HE=function(){return typeof r!="function"||typeof Symbol!="function"||typeof r("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},HE}function uU(){if(sO)return GE;sO=!0;var r={__proto__:null,foo:{}},e=Object;return GE=function(){return{__proto__:r}.foo===r.foo&&!(r instanceof e)},GE}function cU(){if(oO)return VE;oO=!0;var r="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,t=Math.max,n="[object Function]",i=function(u,c){for(var f=[],h=0;h<u.length;h+=1)f[h]=u[h];for(var p=0;p<c.length;p+=1)f[p+u.length]=c[p];return f},o=function(u,c){for(var f=[],h=c,p=0;h<u.length;h+=1,p+=1)f[p]=u[h];return f},s=function(a,u){for(var c="",f=0;f<a.length;f+=1)c+=a[f],f+1<a.length&&(c+=u);return c};return VE=function(u){var c=this;if(typeof c!="function"||e.apply(c)!==n)throw new TypeError(r+c);for(var f=o(arguments,1),h,p=function(){if(this instanceof h){var y=c.apply(this,i(f,arguments));return Object(y)===y?y:this}return c.apply(u,i(f,arguments))},m=t(0,c.length-f.length),b=[],v=0;v<m;v++)b[v]="$"+v;if(h=Function("binder","return function ("+s(b,",")+"){ return binder.apply(this,arguments); }")(p),c.prototype){var w=function(){};w.prototype=c.prototype,h.prototype=new w,w.prototype=null}return h},VE}function i2(){if(aO)return YE;aO=!0;var r=cU();return YE=Function.prototype.bind||r,YE}function fU(){if(lO)return XE;lO=!0;var r=Function.prototype.call,e=Object.prototype.hasOwnProperty,t=i2();return XE=t.call(r,e),XE}function Wu(){if(uO)return KE;uO=!0;var r,e=nU(),t=iU(),n=sU(),i=oU(),o=yO(),s=Jf(),a=aU(),u=Function,c=function(N){try{return u('"use strict"; return ('+N+").constructor;")()}catch{}},f=Object.getOwnPropertyDescriptor;if(f)try{f({},"")}catch{f=null}var h=function(){throw new s},p=f?(function(){try{return arguments.callee,h}catch{try{return f(arguments,"callee").get}catch{return h}}})():h,m=lU()(),b=uU()(),v=Object.getPrototypeOf||(b?function(N){return N.__proto__}:null),w={},y=typeof Uint8Array>"u"||!v?r:v(Uint8Array),_={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?r:ArrayBuffer,"%ArrayIteratorPrototype%":m&&v?v([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":w,"%AsyncGenerator%":w,"%AsyncGeneratorFunction%":w,"%AsyncIteratorPrototype%":w,"%Atomics%":typeof Atomics>"u"?r:Atomics,"%BigInt%":typeof BigInt>"u"?r:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?r:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":e,"%eval%":eval,"%EvalError%":t,"%Float32Array%":typeof Float32Array>"u"?r:Float32Array,"%Float64Array%":typeof Float64Array>"u"?r:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?r:FinalizationRegistry,"%Function%":u,"%GeneratorFunction%":w,"%Int8Array%":typeof Int8Array>"u"?r:Int8Array,"%Int16Array%":typeof Int16Array>"u"?r:Int16Array,"%Int32Array%":typeof Int32Array>"u"?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":m&&v?v(v([][Symbol.iterator]())):r,"%JSON%":typeof JSON=="object"?JSON:r,"%Map%":typeof Map>"u"?r:Map,"%MapIteratorPrototype%":typeof Map>"u"||!m||!v?r:v(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?r:Promise,"%Proxy%":typeof Proxy>"u"?r:Proxy,"%RangeError%":n,"%ReferenceError%":i,"%Reflect%":typeof Reflect>"u"?r:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?r:Set,"%SetIteratorPrototype%":typeof Set>"u"||!m||!v?r:v(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":m&&v?v(""[Symbol.iterator]()):r,"%Symbol%":m?Symbol:r,"%SyntaxError%":o,"%ThrowTypeError%":p,"%TypedArray%":y,"%TypeError%":s,"%Uint8Array%":typeof Uint8Array>"u"?r:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?r:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?r:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?r:Uint32Array,"%URIError%":a,"%WeakMap%":typeof WeakMap>"u"?r:WeakMap,"%WeakRef%":typeof WeakRef>"u"?r:WeakRef,"%WeakSet%":typeof WeakSet>"u"?r:WeakSet};if(v)try{null.error}catch(N){var E=v(v(N));_["%Error.prototype%"]=E}var S=function N(x){var P;if(x==="%AsyncFunction%")P=c("async function () {}");else if(x==="%GeneratorFunction%")P=c("function* () {}");else if(x==="%AsyncGeneratorFunction%")P=c("async function* () {}");else if(x==="%AsyncGenerator%"){var C=N("%AsyncGeneratorFunction%");C&&(P=C.prototype)}else if(x==="%AsyncIteratorPrototype%"){var j=N("%AsyncGenerator%");j&&v&&(P=v(j.prototype))}return _[x]=P,P},A={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},F=i2(),D=fU(),H=F.call(Function.call,Array.prototype.concat),J=F.call(Function.apply,Array.prototype.splice),K=F.call(Function.call,String.prototype.replace),ne=F.call(Function.call,String.prototype.slice),k=F.call(Function.call,RegExp.prototype.exec),$=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Y=/\\(\\)?/g,ie=function(x){var P=ne(x,0,1),C=ne(x,-1);if(P==="%"&&C!=="%")throw new o("invalid intrinsic syntax, expected closing `%`");if(C==="%"&&P!=="%")throw new o("invalid intrinsic syntax, expected opening `%`");var j=[];return K(x,$,function(U,B,Q,fe){j[j.length]=Q?K(fe,Y,"$1"):B||U}),j},re=function(x,P){var C=x,j;if(D(A,C)&&(j=A[C],C="%"+j[0]+"%"),D(_,C)){var U=_[C];if(U===w&&(U=S(C)),typeof U>"u"&&!P)throw new s("intrinsic "+x+" exists, but is not available. Please file an issue!");return{alias:j,name:C,value:U}}throw new o("intrinsic "+x+" does not exist!")};return KE=function(x,P){if(typeof x!="string"||x.length===0)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof P!="boolean")throw new s('"allowMissing" argument must be a boolean');if(k(/^%?[^%]*%?$/,x)===null)throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var C=ie(x),j=C.length>0?C[0]:"",U=re("%"+j+"%",P),B=U.name,Q=U.value,fe=!1,_e=U.alias;_e&&(j=_e[0],J(C,H([0,1],_e)));for(var te=1,W=!0;te<C.length;te+=1){var oe=C[te],be=ne(oe,0,1),xe=ne(oe,-1);if((be==='"'||be==="'"||be==="`"||xe==='"'||xe==="'"||xe==="`")&&be!==xe)throw new o("property names with quotes must have matching quotes");if((oe==="constructor"||!W)&&(fe=!0),j+="."+oe,B="%"+j+"%",D(_,B))Q=_[B];else if(Q!=null){if(!(oe in Q)){if(!P)throw new s("base intrinsic for "+x+" exists, but the property is not available.");return}if(f&&te+1>=C.length){var X=f(Q,oe);W=!!X,W&&"get"in X&&!("originalValue"in X.get)?Q=X.get:Q=Q[oe]}else W=D(Q,oe),Q=Q[oe];W&&!fe&&(_[B]=Q)}}return Q},KE}function s2(){if(cO)return ZE;cO=!0;var r=Wu(),e=r("%Object.defineProperty%",!0)||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return ZE=e,ZE}function tb(){if(fO)return JE;fO=!0;var r=Wu(),e=r("%Object.getOwnPropertyDescriptor%",!0);if(e)try{e([],"length")}catch{e=null}return JE=e,JE}function hU(){if(hO)return QE;hO=!0;var r=s2(),e=yO(),t=Jf(),n=tb();return QE=function(o,s,a){if(!o||typeof o!="object"&&typeof o!="function")throw new t("`obj` must be an object or a function`");if(typeof s!="string"&&typeof s!="symbol")throw new t("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new t("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new t("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new t("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new t("`loose`, if provided, must be a boolean");var u=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,f=arguments.length>5?arguments[5]:null,h=arguments.length>6?arguments[6]:!1,p=!!n&&n(o,s);if(r)r(o,s,{configurable:f===null&&p?p.configurable:!f,enumerable:u===null&&p?p.enumerable:!u,value:a,writable:c===null&&p?p.writable:!c});else if(h||!u&&!c&&!f)o[s]=a;else throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},QE}function dU(){if(dO)return e2;dO=!0;var r=s2(),e=function(){return!!r};return e.hasArrayLengthDefineBug=function(){if(!r)return null;try{return r([],"length",{value:1}).length!==1}catch{return!0}},e2=e,e2}function pU(){if(pO)return t2;pO=!0;var r=Wu(),e=hU(),t=dU()(),n=tb(),i=Jf(),o=r("%Math.floor%");return t2=function(a,u){if(typeof a!="function")throw new i("`fn` is not a function");if(typeof u!="number"||u<0||u>4294967295||o(u)!==u)throw new i("`length` must be a positive 32-bit integer");var c=arguments.length>2&&!!arguments[2],f=!0,h=!0;if("length"in a&&n){var p=n(a,"length");p&&!p.configurable&&(f=!1),p&&!p.writable&&(h=!1)}return(f||h||!c)&&(t?e(a,"length",u,!0,!0):e(a,"length",u)),a},t2}function o2(){if(gO)return Fp;gO=!0;var r=i2(),e=Wu(),t=pU(),n=Jf(),i=e("%Function.prototype.apply%"),o=e("%Function.prototype.call%"),s=e("%Reflect.apply%",!0)||r.call(o,i),a=s2(),u=e("%Math.max%");Fp=function(h){if(typeof h!="function")throw new n("a function is required");var p=s(r,o,arguments);return t(p,1+u(0,h.length-(arguments.length-1)),!0)};var c=function(){return s(r,i,arguments)};return a?a(Fp,"apply",{value:c}):Fp.apply=c,Fp}function Up(){if(mO)return r2;mO=!0;var r=Wu(),e=o2(),t=e(r("String.prototype.indexOf"));return r2=function(i,o){var s=r(i,!!o);return typeof s=="function"&&t(i,".prototype.")>-1?e(s):s},r2}var BE,KI,FE,ZI,UE,JI,jE,QI,$E,eO,zE,tO,WE,rO,qE,nO,HE,iO,GE,sO,VE,oO,YE,aO,XE,lO,KE,uO,ZE,cO,JE,fO,QE,hO,e2,dO,t2,pO,Fp,gO,r2,mO,jp=Jt(()=>{Ce();De();Re();BE={},KI=!1;FE={},ZI=!1;UE={},JI=!1;jE={},QI=!1;$E={},eO=!1;zE={},tO=!1;WE={},rO=!1;qE={},nO=!1;HE={},iO=!1;GE={},sO=!1;VE={},oO=!1;YE={},aO=!1;XE={},lO=!1;KE={},uO=!1;ZE={},cO=!1;JE={},fO=!1;QE={},hO=!1;e2={},dO=!1;t2={},pO=!1;Fp={},gO=!1;r2={},mO=!1});function gU(){if(bO)return a2;bO=!0;var r=zr;function e(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function t(o,s){for(var a="",u=0,c=-1,f=0,h,p=0;p<=o.length;++p){if(p<o.length)h=o.charCodeAt(p);else{if(h===47)break;h=47}if(h===47){if(!(c===p-1||f===1))if(c!==p-1&&f===2){if(a.length<2||u!==2||a.charCodeAt(a.length-1)!==46||a.charCodeAt(a.length-2)!==46){if(a.length>2){var m=a.lastIndexOf("/");if(m!==a.length-1){m===-1?(a="",u=0):(a=a.slice(0,m),u=a.length-1-a.lastIndexOf("/")),c=p,f=0;continue}}else if(a.length===2||a.length===1){a="",u=0,c=p,f=0;continue}}s&&(a.length>0?a+="/..":a="..",u=2)}else a.length>0?a+="/"+o.slice(c+1,p):a=o.slice(c+1,p),u=p-c-1;c=p,f=0}else h===46&&f!==-1?++f:f=-1}return a}function n(o,s){var a=s.dir||s.root,u=s.base||(s.name||"")+(s.ext||"");return a?a===s.root?a+u:a+o+u:u}var i={resolve:function(){for(var s="",a=!1,u,c=arguments.length-1;c>=-1&&!a;c--){var f;c>=0?f=arguments[c]:(u===void 0&&(u=r.cwd()),f=u),e(f),f.length!==0&&(s=f+"/"+s,a=f.charCodeAt(0)===47)}return s=t(s,!a),a?s.length>0?"/"+s:"/":s.length>0?s:"."},normalize:function(s){if(e(s),s.length===0)return".";var a=s.charCodeAt(0)===47,u=s.charCodeAt(s.length-1)===47;return s=t(s,!a),s.length===0&&!a&&(s="."),s.length>0&&u&&(s+="/"),a?"/"+s:s},isAbsolute:function(s){return e(s),s.length>0&&s.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var s,a=0;a<arguments.length;++a){var u=arguments[a];e(u),u.length>0&&(s===void 0?s=u:s+="/"+u)}return s===void 0?".":i.normalize(s)},relative:function(s,a){if(e(s),e(a),s===a||(s=i.resolve(s),a=i.resolve(a),s===a))return"";for(var u=1;u<s.length&&s.charCodeAt(u)===47;++u);for(var c=s.length,f=c-u,h=1;h<a.length&&a.charCodeAt(h)===47;++h);for(var p=a.length,m=p-h,b=f<m?f:m,v=-1,w=0;w<=b;++w){if(w===b){if(m>b){if(a.charCodeAt(h+w)===47)return a.slice(h+w+1);if(w===0)return a.slice(h+w)}else f>b&&(s.charCodeAt(u+w)===47?v=w:w===0&&(v=0));break}var y=s.charCodeAt(u+w),_=a.charCodeAt(h+w);if(y!==_)break;y===47&&(v=w)}var E="";for(w=u+v+1;w<=c;++w)(w===c||s.charCodeAt(w)===47)&&(E.length===0?E+="..":E+="/..");return E.length>0?E+a.slice(h+v):(h+=v,a.charCodeAt(h)===47&&++h,a.slice(h))},_makeLong:function(s){return s},dirname:function(s){if(e(s),s.length===0)return".";for(var a=s.charCodeAt(0),u=a===47,c=-1,f=!0,h=s.length-1;h>=1;--h)if(a=s.charCodeAt(h),a===47){if(!f){c=h;break}}else f=!1;return c===-1?u?"/":".":u&&c===1?"//":s.slice(0,c)},basename:function(s,a){if(a!==void 0&&typeof a!="string")throw new TypeError('"ext" argument must be a string');e(s);var u=0,c=-1,f=!0,h;if(a!==void 0&&a.length>0&&a.length<=s.length){if(a.length===s.length&&a===s)return"";var p=a.length-1,m=-1;for(h=s.length-1;h>=0;--h){var b=s.charCodeAt(h);if(b===47){if(!f){u=h+1;break}}else m===-1&&(f=!1,m=h+1),p>=0&&(b===a.charCodeAt(p)?--p===-1&&(c=h):(p=-1,c=m))}return u===c?c=m:c===-1&&(c=s.length),s.slice(u,c)}else{for(h=s.length-1;h>=0;--h)if(s.charCodeAt(h)===47){if(!f){u=h+1;break}}else c===-1&&(f=!1,c=h+1);return c===-1?"":s.slice(u,c)}},extname:function(s){e(s);for(var a=-1,u=0,c=-1,f=!0,h=0,p=s.length-1;p>=0;--p){var m=s.charCodeAt(p);if(m===47){if(!f){u=p+1;break}continue}c===-1&&(f=!1,c=p+1),m===46?a===-1?a=p:h!==1&&(h=1):a!==-1&&(h=-1)}return a===-1||c===-1||h===0||h===1&&a===c-1&&a===u+1?"":s.slice(a,c)},format:function(s){if(s===null||typeof s!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof s);return n("/",s)},parse:function(s){e(s);var a={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return a;var u=s.charCodeAt(0),c=u===47,f;c?(a.root="/",f=1):f=0;for(var h=-1,p=0,m=-1,b=!0,v=s.length-1,w=0;v>=f;--v){if(u=s.charCodeAt(v),u===47){if(!b){p=v+1;break}continue}m===-1&&(b=!1,m=v+1),u===46?h===-1?h=v:w!==1&&(w=1):h!==-1&&(w=-1)}return h===-1||m===-1||w===0||w===1&&h===m-1&&h===p+1?m!==-1&&(p===0&&c?a.base=a.name=s.slice(1,m):a.base=a.name=s.slice(p,m)):(p===0&&c?(a.name=s.slice(1,h),a.base=s.slice(1,m)):(a.name=s.slice(p,h),a.base=s.slice(p,m)),a.ext=s.slice(h,m)),p>0?a.dir=s.slice(0,p-1):c&&(a.dir="/"),a},sep:"/",delimiter:":",win32:null,posix:null};return i.posix=i,a2=i,a2}var a2,bO,l2,u2=Jt(()=>{Ce();De();Re();Mu();a2={},bO=!1;l2=gU()});function yU(){if(wO)return c2;wO=!0;var r=typeof Map=="function"&&Map.prototype,e=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,t=r&&e&&typeof e.get=="function"?e.get:null,n=r&&Map.prototype.forEach,i=typeof Set=="function"&&Set.prototype,o=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,s=i&&o&&typeof o.get=="function"?o.get:null,a=i&&Set.prototype.forEach,u=typeof WeakMap=="function"&&WeakMap.prototype,c=u?WeakMap.prototype.has:null,f=typeof WeakSet=="function"&&WeakSet.prototype,h=f?WeakSet.prototype.has:null,p=typeof WeakRef=="function"&&WeakRef.prototype,m=p?WeakRef.prototype.deref:null,b=Boolean.prototype.valueOf,v=Object.prototype.toString,w=Function.prototype.toString,y=String.prototype.match,_=String.prototype.slice,E=String.prototype.replace,S=String.prototype.toUpperCase,A=String.prototype.toLowerCase,F=RegExp.prototype.test,D=Array.prototype.concat,H=Array.prototype.join,J=Array.prototype.slice,K=Math.floor,ne=typeof BigInt=="function"?BigInt.prototype.valueOf:null,k=Object.getOwnPropertySymbols,$=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Y=typeof Symbol=="function"&&typeof Symbol.iterator=="object",ie=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Y||!0)?Symbol.toStringTag:null,re=Object.prototype.propertyIsEnumerable,N=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(pe){return pe.__proto__}:null);function x(pe,Ee){if(pe===1/0||pe===-1/0||pe!==pe||pe&&pe>-1e3&&pe<1e3||F.call(/e/,Ee))return Ee;var ve=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof pe=="number"){var Ie=pe<0?-K(-pe):K(pe);if(Ie!==pe){var V=String(Ie),Fe=_.call(Ee,V.length+1);return E.call(V,ve,"$&_")+"."+E.call(E.call(Fe,/([0-9]{3})/g,"$&_"),/_$/,"")}}return E.call(Ee,ve,"$&_")}var P=mU,C=P.custom,j=xe(C)?C:null;c2=function pe(Ee,ve,Ie,V){var Fe=ve||{};if(ae(Fe,"quoteStyle")&&Fe.quoteStyle!=="single"&&Fe.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ae(Fe,"maxStringLength")&&(typeof Fe.maxStringLength=="number"?Fe.maxStringLength<0&&Fe.maxStringLength!==1/0:Fe.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var st=ae(Fe,"customInspect")?Fe.customInspect:!0;if(typeof st!="boolean"&&st!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(ae(Fe,"indent")&&Fe.indent!==null&&Fe.indent!==" "&&!(parseInt(Fe.indent,10)===Fe.indent&&Fe.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(ae(Fe,"numericSeparator")&&typeof Fe.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var O=Fe.numericSeparator;if(typeof Ee>"u")return"undefined";if(Ee===null)return"null";if(typeof Ee=="boolean")return Ee?"true":"false";if(typeof Ee=="string")return Je(Ee,Fe);if(typeof Ee=="number"){if(Ee===0)return 1/0/Ee>0?"0":"-0";var Pe=String(Ee);return O?x(Ee,Pe):Pe}if(typeof Ee=="bigint"){var $e=String(Ee)+"n";return O?x(Ee,$e):$e}var he=typeof Fe.depth>"u"?5:Fe.depth;if(typeof Ie>"u"&&(Ie=0),Ie>=he&&he>0&&typeof Ee=="object")return Q(Ee)?"[Array]":"[Object]";var Te=Z(Fe,Ie);if(typeof V>"u")V=[];else if(we(V,Ee)>=0)return"[Circular]";function Me(Yt,Zr,Jr){if(Zr&&(V=J.call(V),V.push(Zr)),Jr){var Qr={depth:Fe.depth};return ae(Fe,"quoteStyle")&&(Qr.quoteStyle=Fe.quoteStyle),pe(Yt,Qr,Ie+1,V)}return pe(Yt,Fe,Ie+1,V)}if(typeof Ee=="function"&&!_e(Ee)){var ut=Se(Ee),ue=le(Ee,Me);return"[Function"+(ut?": "+ut:" (anonymous)")+"]"+(ue.length>0?" { "+H.call(ue,", ")+" }":"")}if(xe(Ee)){var me=Y?E.call(String(Ee),/^(Symbol\(.*\))_[^)]*$/,"$1"):$.call(Ee);return typeof Ee=="object"&&!Y?T(me):me}if(Ve(Ee)){for(var We="<"+A.call(String(Ee.nodeName)),Ue=Ee.attributes||[],Ze=0;Ze<Ue.length;Ze++)We+=" "+Ue[Ze].name+"="+U(B(Ue[Ze].value),"double",Fe);return We+=">",Ee.childNodes&&Ee.childNodes.length&&(We+="..."),We+="</"+A.call(String(Ee.nodeName))+">",We}if(Q(Ee)){if(Ee.length===0)return"[]";var dt=le(Ee,Me);return Te&&!I(dt)?"["+R(dt,Te)+"]":"[ "+H.call(dt,", ")+" ]"}if(te(Ee)){var Rt=le(Ee,Me);return!("cause"in Error.prototype)&&"cause"in Ee&&!re.call(Ee,"cause")?"{ ["+String(Ee)+"] "+H.call(D.call("[cause]: "+Me(Ee.cause),Rt),", ")+" }":Rt.length===0?"["+String(Ee)+"]":"{ ["+String(Ee)+"] "+H.call(Rt,", ")+" }"}if(typeof Ee=="object"&&st){if(j&&typeof Ee[j]=="function"&&P)return P(Ee,{depth:he-Ie});if(st!=="symbol"&&typeof Ee.inspect=="function")return Ee.inspect()}if(de(Ee)){var Et=[];return n&&n.call(Ee,function(Yt,Zr){Et.push(Me(Zr,Ee,!0)+" => "+Me(Yt,Ee))}),g("Map",t.call(Ee),Et,Te)}if(ke(Ee)){var ar=[];return a&&a.call(Ee,function(Yt){ar.push(Me(Yt,Ee))}),g("Set",s.call(Ee),ar,Te)}if(Ae(Ee))return d("WeakMap");if(Oe(Ee))return d("WeakSet");if(je(Ee))return d("WeakRef");if(oe(Ee))return T(Me(Number(Ee)));if(X(Ee))return T(Me(ne.call(Ee)));if(be(Ee))return T(b.call(Ee));if(W(Ee))return T(Me(String(Ee)));if(typeof window<"u"&&Ee===window)return"{ [object Window] }";if(typeof globalThis<"u"&&Ee===globalThis||typeof f2<"u"&&Ee===f2)return"{ [object globalThis] }";if(!fe(Ee)&&!_e(Ee)){var _i=le(Ee,Me),qn=N?N(Ee)===Object.prototype:Ee instanceof Object||Ee.constructor===Object,Ht=Ee instanceof Object?"":"null prototype",Dr=!qn&&ie&&Object(Ee)===Ee&&ie in Ee?_.call(ge(Ee),8,-1):Ht?"Object":"",yr=qn||typeof Ee.constructor!="function"?"":Ee.constructor.name?Ee.constructor.name+" ":"",zt=yr+(Dr||Ht?"["+H.call(D.call([],Dr||[],Ht||[]),": ")+"] ":"");return _i.length===0?zt+"{}":Te?zt+"{"+R(_i,Te)+"}":zt+"{ "+H.call(_i,", ")+" }"}return String(Ee)};function U(pe,Ee,ve){var Ie=(ve.quoteStyle||Ee)==="double"?'"':"'";return Ie+pe+Ie}function B(pe){return E.call(String(pe),/"/g,"&quot;")}function Q(pe){return ge(pe)==="[object Array]"&&(!ie||!(typeof pe=="object"&&ie in pe))}function fe(pe){return ge(pe)==="[object Date]"&&(!ie||!(typeof pe=="object"&&ie in pe))}function _e(pe){return ge(pe)==="[object RegExp]"&&(!ie||!(typeof pe=="object"&&ie in pe))}function te(pe){return ge(pe)==="[object Error]"&&(!ie||!(typeof pe=="object"&&ie in pe))}function W(pe){return ge(pe)==="[object String]"&&(!ie||!(typeof pe=="object"&&ie in pe))}function oe(pe){return ge(pe)==="[object Number]"&&(!ie||!(typeof pe=="object"&&ie in pe))}function be(pe){return ge(pe)==="[object Boolean]"&&(!ie||!(typeof pe=="object"&&ie in pe))}function xe(pe){if(Y)return pe&&typeof pe=="object"&&pe instanceof Symbol;if(typeof pe=="symbol")return!0;if(!pe||typeof pe!="object"||!$)return!1;try{return $.call(pe),!0}catch{}return!1}function X(pe){if(!pe||typeof pe!="object"||!ne)return!1;try{return ne.call(pe),!0}catch{}return!1}var M=Object.prototype.hasOwnProperty||function(pe){return pe in(this||f2)};function ae(pe,Ee){return M.call(pe,Ee)}function ge(pe){return v.call(pe)}function Se(pe){if(pe.name)return pe.name;var Ee=y.call(w.call(pe),/^function\s*([\w$]+)/);return Ee?Ee[1]:null}function we(pe,Ee){if(pe.indexOf)return pe.indexOf(Ee);for(var ve=0,Ie=pe.length;ve<Ie;ve++)if(pe[ve]===Ee)return ve;return-1}function de(pe){if(!t||!pe||typeof pe!="object")return!1;try{t.call(pe);try{s.call(pe)}catch{return!0}return pe instanceof Map}catch{}return!1}function Ae(pe){if(!c||!pe||typeof pe!="object")return!1;try{c.call(pe,c);try{h.call(pe,h)}catch{return!0}return pe instanceof WeakMap}catch{}return!1}function je(pe){if(!m||!pe||typeof pe!="object")return!1;try{return m.call(pe),!0}catch{}return!1}function ke(pe){if(!s||!pe||typeof pe!="object")return!1;try{s.call(pe);try{t.call(pe)}catch{return!0}return pe instanceof Set}catch{}return!1}function Oe(pe){if(!h||!pe||typeof pe!="object")return!1;try{h.call(pe,h);try{c.call(pe,c)}catch{return!0}return pe instanceof WeakSet}catch{}return!1}function Ve(pe){return!pe||typeof pe!="object"?!1:typeof HTMLElement<"u"&&pe instanceof HTMLElement?!0:typeof pe.nodeName=="string"&&typeof pe.getAttribute=="function"}function Je(pe,Ee){if(pe.length>Ee.maxStringLength){var ve=pe.length-Ee.maxStringLength,Ie="... "+ve+" more character"+(ve>1?"s":"");return Je(_.call(pe,0,Ee.maxStringLength),Ee)+Ie}var V=E.call(E.call(pe,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,et);return U(V,"single",Ee)}function et(pe){var Ee=pe.charCodeAt(0),ve={8:"b",9:"t",10:"n",12:"f",13:"r"}[Ee];return ve?"\\"+ve:"\\x"+(Ee<16?"0":"")+S.call(Ee.toString(16))}function T(pe){return"Object("+pe+")"}function d(pe){return pe+" { ? }"}function g(pe,Ee,ve,Ie){var V=Ie?R(ve,Ie):H.call(ve,", ");return pe+" ("+Ee+") {"+V+"}"}function I(pe){for(var Ee=0;Ee<pe.length;Ee++)if(we(pe[Ee],`
75
+ `)>=0)return!1;return!0}function Z(pe,Ee){var ve;if(pe.indent===" ")ve=" ";else if(typeof pe.indent=="number"&&pe.indent>0)ve=H.call(Array(pe.indent+1)," ");else return null;return{base:ve,prev:H.call(Array(Ee+1),ve)}}function R(pe,Ee){if(pe.length===0)return"";var ve=`
76
+ `+Ee.prev+Ee.base;return ve+H.call(pe,","+ve)+`
77
+ `+Ee.prev}function le(pe,Ee){var ve=Q(pe),Ie=[];if(ve){Ie.length=pe.length;for(var V=0;V<pe.length;V++)Ie[V]=ae(pe,V)?Ee(pe[V],pe):""}var Fe=typeof k=="function"?k(pe):[],st;if(Y){st={};for(var O=0;O<Fe.length;O++)st["$"+Fe[O]]=Fe[O]}for(var Pe in pe)ae(pe,Pe)&&(ve&&String(Number(Pe))===Pe&&Pe<pe.length||Y&&st["$"+Pe]instanceof Symbol||(F.call(/[^\w$]/,Pe)?Ie.push(Ee(Pe,pe)+": "+Ee(pe[Pe],pe)):Ie.push(Pe+": "+Ee(pe[Pe],pe))));if(typeof k=="function")for(var $e=0;$e<Fe.length;$e++)re.call(pe,Fe[$e])&&Ie.push("["+Ee(Fe[$e])+"]: "+Ee(pe[Fe[$e]],pe));return Ie}return c2}function bU(){if(vO)return h2;vO=!0;var r=Wu(),e=Up(),t=yU(),n=Jf(),i=r("%WeakMap%",!0),o=r("%Map%",!0),s=e("WeakMap.prototype.get",!0),a=e("WeakMap.prototype.set",!0),u=e("WeakMap.prototype.has",!0),c=e("Map.prototype.get",!0),f=e("Map.prototype.set",!0),h=e("Map.prototype.has",!0),p=function(w,y){for(var _=w,E;(E=_.next)!==null;_=E)if(E.key===y)return _.next=E.next,E.next=w.next,w.next=E,E},m=function(w,y){var _=p(w,y);return _&&_.value},b=function(w,y,_){var E=p(w,y);E?E.value=_:w.next={key:y,next:w.next,value:_}},v=function(w,y){return!!p(w,y)};return h2=function(){var y,_,E,S={assert:function(A){if(!S.has(A))throw new n("Side channel does not contain "+t(A))},get:function(A){if(i&&A&&(typeof A=="object"||typeof A=="function")){if(y)return s(y,A)}else if(o){if(_)return c(_,A)}else if(E)return m(E,A)},has:function(A){if(i&&A&&(typeof A=="object"||typeof A=="function")){if(y)return u(y,A)}else if(o){if(_)return h(_,A)}else if(E)return v(E,A);return!1},set:function(A,F){i&&A&&(typeof A=="object"||typeof A=="function")?(y||(y=new i),a(y,A,F)):o?(_||(_=new o),f(_,A,F)):(E||(E={key:{},next:null}),b(E,A,F))}};return S},h2}function w2(){if(_O)return d2;_O=!0;var r=String.prototype.replace,e=/%20/g,t={RFC1738:"RFC1738",RFC3986:"RFC3986"};return d2={default:t.RFC3986,formatters:{RFC1738:function(n){return r.call(n,e,"+")},RFC3986:function(n){return String(n)}},RFC1738:t.RFC1738,RFC3986:t.RFC3986},d2}function CO(){if(EO)return p2;EO=!0;var r=w2(),e=Object.prototype.hasOwnProperty,t=Array.isArray,n=(function(){for(var w=[],y=0;y<256;++y)w.push("%"+((y<16?"0":"")+y.toString(16)).toUpperCase());return w})(),i=function(y){for(;y.length>1;){var _=y.pop(),E=_.obj[_.prop];if(t(E)){for(var S=[],A=0;A<E.length;++A)typeof E[A]<"u"&&S.push(E[A]);_.obj[_.prop]=S}}},o=function(y,_){for(var E=_&&_.plainObjects?Object.create(null):{},S=0;S<y.length;++S)typeof y[S]<"u"&&(E[S]=y[S]);return E},s=function w(y,_,E){if(!_)return y;if(typeof _!="object"){if(t(y))y.push(_);else if(y&&typeof y=="object")(E&&(E.plainObjects||E.allowPrototypes)||!e.call(Object.prototype,_))&&(y[_]=!0);else return[y,_];return y}if(!y||typeof y!="object")return[y].concat(_);var S=y;return t(y)&&!t(_)&&(S=o(y,E)),t(y)&&t(_)?(_.forEach(function(A,F){if(e.call(y,F)){var D=y[F];D&&typeof D=="object"&&A&&typeof A=="object"?y[F]=w(D,A,E):y.push(A)}else y[F]=A}),y):Object.keys(_).reduce(function(A,F){var D=_[F];return e.call(A,F)?A[F]=w(A[F],D,E):A[F]=D,A},S)},a=function(y,_){return Object.keys(_).reduce(function(E,S){return E[S]=_[S],E},y)},u=function(w,y,_){var E=w.replace(/\+/g," ");if(_==="iso-8859-1")return E.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(E)}catch{return E}},c=1024,f=function(y,_,E,S,A){if(y.length===0)return y;var F=y;if(typeof y=="symbol"?F=Symbol.prototype.toString.call(y):typeof y!="string"&&(F=String(y)),E==="iso-8859-1")return escape(F).replace(/%u[0-9a-f]{4}/gi,function($){return"%26%23"+parseInt($.slice(2),16)+"%3B"});for(var D="",H=0;H<F.length;H+=c){for(var J=F.length>=c?F.slice(H,H+c):F,K=[],ne=0;ne<J.length;++ne){var k=J.charCodeAt(ne);if(k===45||k===46||k===95||k===126||k>=48&&k<=57||k>=65&&k<=90||k>=97&&k<=122||A===r.RFC1738&&(k===40||k===41)){K[K.length]=J.charAt(ne);continue}if(k<128){K[K.length]=n[k];continue}if(k<2048){K[K.length]=n[192|k>>6]+n[128|k&63];continue}if(k<55296||k>=57344){K[K.length]=n[224|k>>12]+n[128|k>>6&63]+n[128|k&63];continue}ne+=1,k=65536+((k&1023)<<10|J.charCodeAt(ne)&1023),K[K.length]=n[240|k>>18]+n[128|k>>12&63]+n[128|k>>6&63]+n[128|k&63]}D+=K.join("")}return D},h=function(y){for(var _=[{obj:{o:y},prop:"o"}],E=[],S=0;S<_.length;++S)for(var A=_[S],F=A.obj[A.prop],D=Object.keys(F),H=0;H<D.length;++H){var J=D[H],K=F[J];typeof K=="object"&&K!==null&&E.indexOf(K)===-1&&(_.push({obj:F,prop:J}),E.push(K))}return i(_),y},p=function(y){return Object.prototype.toString.call(y)==="[object RegExp]"},m=function(y){return!y||typeof y!="object"?!1:!!(y.constructor&&y.constructor.isBuffer&&y.constructor.isBuffer(y))},b=function(y,_){return[].concat(y,_)},v=function(y,_){if(t(y)){for(var E=[],S=0;S<y.length;S+=1)E.push(_(y[S]));return E}return _(y)};return p2={arrayToObject:o,assign:a,combine:b,compact:h,decode:u,encode:f,isBuffer:m,isRegExp:p,maybeMap:v,merge:s},p2}function wU(){if(AO)return g2;AO=!0;var r=bU(),e=CO(),t=w2(),n=Object.prototype.hasOwnProperty,i={brackets:function(w){return w+"[]"},comma:"comma",indices:function(w,y){return w+"["+y+"]"},repeat:function(w){return w}},o=Array.isArray,s=Array.prototype.push,a=function(v,w){s.apply(v,o(w)?w:[w])},u=Date.prototype.toISOString,c=t.default,f={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:e.encode,encodeValuesOnly:!1,format:c,formatter:t.formatters[c],indices:!1,serializeDate:function(w){return u.call(w)},skipNulls:!1,strictNullHandling:!1},h=function(w){return typeof w=="string"||typeof w=="number"||typeof w=="boolean"||typeof w=="symbol"||typeof w=="bigint"},p={},m=function v(w,y,_,E,S,A,F,D,H,J,K,ne,k,$,Y,ie,re,N){for(var x=w,P=N,C=0,j=!1;(P=P.get(p))!==void 0&&!j;){var U=P.get(w);if(C+=1,typeof U<"u"){if(U===C)throw new RangeError("Cyclic object value");j=!0}typeof P.get(p)>"u"&&(C=0)}if(typeof J=="function"?x=J(y,x):x instanceof Date?x=k(x):_==="comma"&&o(x)&&(x=e.maybeMap(x,function(ge){return ge instanceof Date?k(ge):ge})),x===null){if(A)return H&&!ie?H(y,f.encoder,re,"key",$):y;x=""}if(h(x)||e.isBuffer(x)){if(H){var B=ie?y:H(y,f.encoder,re,"key",$);return[Y(B)+"="+Y(H(x,f.encoder,re,"value",$))]}return[Y(y)+"="+Y(String(x))]}var Q=[];if(typeof x>"u")return Q;var fe;if(_==="comma"&&o(x))ie&&H&&(x=e.maybeMap(x,H)),fe=[{value:x.length>0?x.join(",")||null:void 0}];else if(o(J))fe=J;else{var _e=Object.keys(x);fe=K?_e.sort(K):_e}var te=D?y.replace(/\./g,"%2E"):y,W=E&&o(x)&&x.length===1?te+"[]":te;if(S&&o(x)&&x.length===0)return W+"[]";for(var oe=0;oe<fe.length;++oe){var be=fe[oe],xe=typeof be=="object"&&typeof be.value<"u"?be.value:x[be];if(!(F&&xe===null)){var X=ne&&D?be.replace(/\./g,"%2E"):be,M=o(x)?typeof _=="function"?_(W,X):W:W+(ne?"."+X:"["+X+"]");N.set(w,C);var ae=r();ae.set(p,N),a(Q,v(xe,M,_,E,S,A,F,D,_==="comma"&&ie&&o(x)?null:H,J,K,ne,k,$,Y,ie,re,ae))}}return Q},b=function(w){if(!w)return f;if(typeof w.allowEmptyArrays<"u"&&typeof w.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof w.encodeDotInKeys<"u"&&typeof w.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(w.encoder!==null&&typeof w.encoder<"u"&&typeof w.encoder!="function")throw new TypeError("Encoder has to be a function.");var y=w.charset||f.charset;if(typeof w.charset<"u"&&w.charset!=="utf-8"&&w.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var _=t.default;if(typeof w.format<"u"){if(!n.call(t.formatters,w.format))throw new TypeError("Unknown format option provided.");_=w.format}var E=t.formatters[_],S=f.filter;(typeof w.filter=="function"||o(w.filter))&&(S=w.filter);var A;if(w.arrayFormat in i?A=w.arrayFormat:"indices"in w?A=w.indices?"indices":"repeat":A=f.arrayFormat,"commaRoundTrip"in w&&typeof w.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var F=typeof w.allowDots>"u"?w.encodeDotInKeys===!0?!0:f.allowDots:!!w.allowDots;return{addQueryPrefix:typeof w.addQueryPrefix=="boolean"?w.addQueryPrefix:f.addQueryPrefix,allowDots:F,allowEmptyArrays:typeof w.allowEmptyArrays=="boolean"?!!w.allowEmptyArrays:f.allowEmptyArrays,arrayFormat:A,charset:y,charsetSentinel:typeof w.charsetSentinel=="boolean"?w.charsetSentinel:f.charsetSentinel,commaRoundTrip:w.commaRoundTrip,delimiter:typeof w.delimiter>"u"?f.delimiter:w.delimiter,encode:typeof w.encode=="boolean"?w.encode:f.encode,encodeDotInKeys:typeof w.encodeDotInKeys=="boolean"?w.encodeDotInKeys:f.encodeDotInKeys,encoder:typeof w.encoder=="function"?w.encoder:f.encoder,encodeValuesOnly:typeof w.encodeValuesOnly=="boolean"?w.encodeValuesOnly:f.encodeValuesOnly,filter:S,format:_,formatter:E,serializeDate:typeof w.serializeDate=="function"?w.serializeDate:f.serializeDate,skipNulls:typeof w.skipNulls=="boolean"?w.skipNulls:f.skipNulls,sort:typeof w.sort=="function"?w.sort:null,strictNullHandling:typeof w.strictNullHandling=="boolean"?w.strictNullHandling:f.strictNullHandling}};return g2=function(v,w){var y=v,_=b(w),E,S;typeof _.filter=="function"?(S=_.filter,y=S("",y)):o(_.filter)&&(S=_.filter,E=S);var A=[];if(typeof y!="object"||y===null)return"";var F=i[_.arrayFormat],D=F==="comma"&&_.commaRoundTrip;E||(E=Object.keys(y)),_.sort&&E.sort(_.sort);for(var H=r(),J=0;J<E.length;++J){var K=E[J];_.skipNulls&&y[K]===null||a(A,m(y[K],K,F,D,_.allowEmptyArrays,_.strictNullHandling,_.skipNulls,_.encodeDotInKeys,_.encode?_.encoder:null,_.filter,_.sort,_.allowDots,_.serializeDate,_.format,_.formatter,_.encodeValuesOnly,_.charset,H))}var ne=A.join(_.delimiter),k=_.addQueryPrefix===!0?"?":"";return _.charsetSentinel&&(_.charset==="iso-8859-1"?k+="utf8=%26%2310003%3B&":k+="utf8=%E2%9C%93&"),ne.length>0?k+ne:""},g2}function vU(){if(xO)return m2;xO=!0;var r=CO(),e=Object.prototype.hasOwnProperty,t=Array.isArray,n={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:r.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1},i=function(p){return p.replace(/&#(\d+);/g,function(m,b){return String.fromCharCode(parseInt(b,10))})},o=function(p,m){return p&&typeof p=="string"&&m.comma&&p.indexOf(",")>-1?p.split(","):p},s="utf8=%26%2310003%3B",a="utf8=%E2%9C%93",u=function(m,b){var v={__proto__:null},w=b.ignoreQueryPrefix?m.replace(/^\?/,""):m;w=w.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var y=b.parameterLimit===1/0?void 0:b.parameterLimit,_=w.split(b.delimiter,y),E=-1,S,A=b.charset;if(b.charsetSentinel)for(S=0;S<_.length;++S)_[S].indexOf("utf8=")===0&&(_[S]===a?A="utf-8":_[S]===s&&(A="iso-8859-1"),E=S,S=_.length);for(S=0;S<_.length;++S)if(S!==E){var F=_[S],D=F.indexOf("]="),H=D===-1?F.indexOf("="):D+1,J,K;H===-1?(J=b.decoder(F,n.decoder,A,"key"),K=b.strictNullHandling?null:""):(J=b.decoder(F.slice(0,H),n.decoder,A,"key"),K=r.maybeMap(o(F.slice(H+1),b),function(k){return b.decoder(k,n.decoder,A,"value")})),K&&b.interpretNumericEntities&&A==="iso-8859-1"&&(K=i(K)),F.indexOf("[]=")>-1&&(K=t(K)?[K]:K);var ne=e.call(v,J);ne&&b.duplicates==="combine"?v[J]=r.combine(v[J],K):(!ne||b.duplicates==="last")&&(v[J]=K)}return v},c=function(p,m,b,v){for(var w=v?m:o(m,b),y=p.length-1;y>=0;--y){var _,E=p[y];if(E==="[]"&&b.parseArrays)_=b.allowEmptyArrays&&(w===""||b.strictNullHandling&&w===null)?[]:[].concat(w);else{_=b.plainObjects?Object.create(null):{};var S=E.charAt(0)==="["&&E.charAt(E.length-1)==="]"?E.slice(1,-1):E,A=b.decodeDotInKeys?S.replace(/%2E/g,"."):S,F=parseInt(A,10);!b.parseArrays&&A===""?_={0:w}:!isNaN(F)&&E!==A&&String(F)===A&&F>=0&&b.parseArrays&&F<=b.arrayLimit?(_=[],_[F]=w):A!=="__proto__"&&(_[A]=w)}w=_}return w},f=function(m,b,v,w){if(m){var y=v.allowDots?m.replace(/\.([^.[]+)/g,"[$1]"):m,_=/(\[[^[\]]*])/,E=/(\[[^[\]]*])/g,S=v.depth>0&&_.exec(y),A=S?y.slice(0,S.index):y,F=[];if(A){if(!v.plainObjects&&e.call(Object.prototype,A)&&!v.allowPrototypes)return;F.push(A)}for(var D=0;v.depth>0&&(S=E.exec(y))!==null&&D<v.depth;){if(D+=1,!v.plainObjects&&e.call(Object.prototype,S[1].slice(1,-1))&&!v.allowPrototypes)return;F.push(S[1])}if(S){if(v.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+v.depth+" and strictDepth is true");F.push("["+y.slice(S.index)+"]")}return c(F,b,v,w)}},h=function(m){if(!m)return n;if(typeof m.allowEmptyArrays<"u"&&typeof m.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof m.decodeDotInKeys<"u"&&typeof m.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(m.decoder!==null&&typeof m.decoder<"u"&&typeof m.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof m.charset<"u"&&m.charset!=="utf-8"&&m.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var b=typeof m.charset>"u"?n.charset:m.charset,v=typeof m.duplicates>"u"?n.duplicates:m.duplicates;if(v!=="combine"&&v!=="first"&&v!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var w=typeof m.allowDots>"u"?m.decodeDotInKeys===!0?!0:n.allowDots:!!m.allowDots;return{allowDots:w,allowEmptyArrays:typeof m.allowEmptyArrays=="boolean"?!!m.allowEmptyArrays:n.allowEmptyArrays,allowPrototypes:typeof m.allowPrototypes=="boolean"?m.allowPrototypes:n.allowPrototypes,allowSparse:typeof m.allowSparse=="boolean"?m.allowSparse:n.allowSparse,arrayLimit:typeof m.arrayLimit=="number"?m.arrayLimit:n.arrayLimit,charset:b,charsetSentinel:typeof m.charsetSentinel=="boolean"?m.charsetSentinel:n.charsetSentinel,comma:typeof m.comma=="boolean"?m.comma:n.comma,decodeDotInKeys:typeof m.decodeDotInKeys=="boolean"?m.decodeDotInKeys:n.decodeDotInKeys,decoder:typeof m.decoder=="function"?m.decoder:n.decoder,delimiter:typeof m.delimiter=="string"||r.isRegExp(m.delimiter)?m.delimiter:n.delimiter,depth:typeof m.depth=="number"||m.depth===!1?+m.depth:n.depth,duplicates:v,ignoreQueryPrefix:m.ignoreQueryPrefix===!0,interpretNumericEntities:typeof m.interpretNumericEntities=="boolean"?m.interpretNumericEntities:n.interpretNumericEntities,parameterLimit:typeof m.parameterLimit=="number"?m.parameterLimit:n.parameterLimit,parseArrays:m.parseArrays!==!1,plainObjects:typeof m.plainObjects=="boolean"?m.plainObjects:n.plainObjects,strictDepth:typeof m.strictDepth=="boolean"?!!m.strictDepth:n.strictDepth,strictNullHandling:typeof m.strictNullHandling=="boolean"?m.strictNullHandling:n.strictNullHandling}};return m2=function(p,m){var b=h(m);if(p===""||p===null||typeof p>"u")return b.plainObjects?Object.create(null):{};for(var v=typeof p=="string"?u(p,b):p,w=b.plainObjects?Object.create(null):{},y=Object.keys(v),_=0;_<y.length;++_){var E=y[_],S=f(E,v[E],b,typeof p=="string");w=r.merge(w,S,b)}return b.allowSparse===!0?w:r.compact(w)},m2}function _U(){if(SO)return y2;SO=!0;var r=wU(),e=vU(),t=w2();return y2={formats:t,parse:e,stringify:r},y2}function EU(){if(TO)return qu;TO=!0;var r=hl;function e(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var t=/^([a-z0-9.+-]+:)/i,n=/:[0-9]*$/,i=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,o=["<",">",'"',"`"," ","\r",`
78
+ `," "],s=["{","}","|","\\","^","`"].concat(o),a=["'"].concat(s),u=["%","/","?",";","#"].concat(a),c=["/","?","#"],f=255,h=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},b={javascript:!0,"javascript:":!0},v={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},w=_U();function y(A,F,D){if(A&&typeof A=="object"&&A instanceof e)return A;var H=new e;return H.parse(A,F,D),H}e.prototype.parse=function(A,F,D){if(typeof A!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof A);var H=A.indexOf("?"),J=H!==-1&&H<A.indexOf("#")?"?":"#",K=A.split(J),ne=/\\/g;K[0]=K[0].replace(ne,"/"),A=K.join(J);var k=A;if(k=k.trim(),!D&&A.split("#").length===1){var $=i.exec(k);if($)return this.path=k,this.href=k,this.pathname=$[1],$[2]?(this.search=$[2],F?this.query=w.parse(this.search.substr(1)):this.query=this.search.substr(1)):F&&(this.search="",this.query={}),this}var Y=t.exec(k);if(Y){Y=Y[0];var ie=Y.toLowerCase();this.protocol=ie,k=k.substr(Y.length)}if(D||Y||k.match(/^\/\/[^@/]+@[^@/]+/)){var re=k.substr(0,2)==="//";re&&!(Y&&b[Y])&&(k=k.substr(2),this.slashes=!0)}if(!b[Y]&&(re||Y&&!v[Y])){for(var N=-1,x=0;x<c.length;x++){var P=k.indexOf(c[x]);P!==-1&&(N===-1||P<N)&&(N=P)}var C,j;N===-1?j=k.lastIndexOf("@"):j=k.lastIndexOf("@",N),j!==-1&&(C=k.slice(0,j),k=k.slice(j+1),this.auth=decodeURIComponent(C)),N=-1;for(var x=0;x<u.length;x++){var P=k.indexOf(u[x]);P!==-1&&(N===-1||P<N)&&(N=P)}N===-1&&(N=k.length),this.host=k.slice(0,N),k=k.slice(N),this.parseHost(),this.hostname=this.hostname||"";var U=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!U)for(var B=this.hostname.split(/\./),x=0,Q=B.length;x<Q;x++){var fe=B[x];if(fe&&!fe.match(h)){for(var _e="",te=0,W=fe.length;te<W;te++)fe.charCodeAt(te)>127?_e+="x":_e+=fe[te];if(!_e.match(h)){var oe=B.slice(0,x),be=B.slice(x+1),xe=fe.match(p);xe&&(oe.push(xe[1]),be.unshift(xe[2])),be.length&&(k="/"+be.join(".")+k),this.hostname=oe.join(".");break}}}this.hostname.length>f?this.hostname="":this.hostname=this.hostname.toLowerCase(),U||(this.hostname=r.toASCII(this.hostname));var X=this.port?":"+this.port:"",M=this.hostname||"";this.host=M+X,this.href+=this.host,U&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),k[0]!=="/"&&(k="/"+k))}if(!m[ie])for(var x=0,Q=a.length;x<Q;x++){var ae=a[x];if(k.indexOf(ae)!==-1){var ge=encodeURIComponent(ae);ge===ae&&(ge=escape(ae)),k=k.split(ae).join(ge)}}var Se=k.indexOf("#");Se!==-1&&(this.hash=k.substr(Se),k=k.slice(0,Se));var we=k.indexOf("?");if(we!==-1?(this.search=k.substr(we),this.query=k.substr(we+1),F&&(this.query=w.parse(this.query)),k=k.slice(0,we)):F&&(this.search="",this.query={}),k&&(this.pathname=k),v[ie]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var X=this.pathname||"",de=this.search||"";this.path=X+de}return this.href=this.format(),this};function _(A){return typeof A=="string"&&(A=y(A)),A instanceof e?A.format():e.prototype.format.call(A)}e.prototype.format=function(){var A=this.auth||"";A&&(A=encodeURIComponent(A),A=A.replace(/%3A/i,":"),A+="@");var F=this.protocol||"",D=this.pathname||"",H=this.hash||"",J=!1,K="";this.host?J=A+this.host:this.hostname&&(J=A+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(J+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(K=w.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var ne=this.search||K&&"?"+K||"";return F&&F.substr(-1)!==":"&&(F+=":"),this.slashes||(!F||v[F])&&J!==!1?(J="//"+(J||""),D&&D.charAt(0)!=="/"&&(D="/"+D)):J||(J=""),H&&H.charAt(0)!=="#"&&(H="#"+H),ne&&ne.charAt(0)!=="?"&&(ne="?"+ne),D=D.replace(/[?#]/g,function(k){return encodeURIComponent(k)}),ne=ne.replace("#","%23"),F+J+D+ne+H};function E(A,F){return y(A,!1,!0).resolve(F)}e.prototype.resolve=function(A){return this.resolveObject(y(A,!1,!0)).format()};function S(A,F){return A?y(A,!1,!0).resolveObject(F):F}return e.prototype.resolveObject=function(A){if(typeof A=="string"){var F=new e;F.parse(A,!1,!0),A=F}for(var D=new e,H=Object.keys(this),J=0;J<H.length;J++){var K=H[J];D[K]=this[K]}if(D.hash=A.hash,A.href==="")return D.href=D.format(),D;if(A.slashes&&!A.protocol){for(var ne=Object.keys(A),k=0;k<ne.length;k++){var $=ne[k];$!=="protocol"&&(D[$]=A[$])}return v[D.protocol]&&D.hostname&&!D.pathname&&(D.pathname="/",D.path=D.pathname),D.href=D.format(),D}if(A.protocol&&A.protocol!==D.protocol){if(!v[A.protocol]){for(var Y=Object.keys(A),ie=0;ie<Y.length;ie++){var re=Y[ie];D[re]=A[re]}return D.href=D.format(),D}if(D.protocol=A.protocol,!A.host&&!b[A.protocol]){for(var Q=(A.pathname||"").split("/");Q.length&&!(A.host=Q.shift()););A.host||(A.host=""),A.hostname||(A.hostname=""),Q[0]!==""&&Q.unshift(""),Q.length<2&&Q.unshift(""),D.pathname=Q.join("/")}else D.pathname=A.pathname;if(D.search=A.search,D.query=A.query,D.host=A.host||"",D.auth=A.auth,D.hostname=A.hostname||A.host,D.port=A.port,D.pathname||D.search){var N=D.pathname||"",x=D.search||"";D.path=N+x}return D.slashes=D.slashes||A.slashes,D.href=D.format(),D}var P=D.pathname&&D.pathname.charAt(0)==="/",C=A.host||A.pathname&&A.pathname.charAt(0)==="/",j=C||P||D.host&&A.pathname,U=j,B=D.pathname&&D.pathname.split("/")||[],Q=A.pathname&&A.pathname.split("/")||[],fe=D.protocol&&!v[D.protocol];if(fe&&(D.hostname="",D.port=null,D.host&&(B[0]===""?B[0]=D.host:B.unshift(D.host)),D.host="",A.protocol&&(A.hostname=null,A.port=null,A.host&&(Q[0]===""?Q[0]=A.host:Q.unshift(A.host)),A.host=null),j=j&&(Q[0]===""||B[0]==="")),C)D.host=A.host||A.host===""?A.host:D.host,D.hostname=A.hostname||A.hostname===""?A.hostname:D.hostname,D.search=A.search,D.query=A.query,B=Q;else if(Q.length)B||(B=[]),B.pop(),B=B.concat(Q),D.search=A.search,D.query=A.query;else if(A.search!=null){if(fe){D.host=B.shift(),D.hostname=D.host;var _e=D.host&&D.host.indexOf("@")>0?D.host.split("@"):!1;_e&&(D.auth=_e.shift(),D.hostname=_e.shift(),D.host=D.hostname)}return D.search=A.search,D.query=A.query,(D.pathname!==null||D.search!==null)&&(D.path=(D.pathname?D.pathname:"")+(D.search?D.search:"")),D.href=D.format(),D}if(!B.length)return D.pathname=null,D.search?D.path="/"+D.search:D.path=null,D.href=D.format(),D;for(var te=B.slice(-1)[0],W=(D.host||A.host||B.length>1)&&(te==="."||te==="..")||te==="",oe=0,be=B.length;be>=0;be--)te=B[be],te==="."?B.splice(be,1):te===".."?(B.splice(be,1),oe++):oe&&(B.splice(be,1),oe--);if(!j&&!U)for(;oe--;oe)B.unshift("..");j&&B[0]!==""&&(!B[0]||B[0].charAt(0)!=="/")&&B.unshift(""),W&&B.join("/").substr(-1)!=="/"&&B.push("");var xe=B[0]===""||B[0]&&B[0].charAt(0)==="/";if(fe){D.hostname=xe?"":B.length?B.shift():"",D.host=D.hostname;var _e=D.host&&D.host.indexOf("@")>0?D.host.split("@"):!1;_e&&(D.auth=_e.shift(),D.hostname=_e.shift(),D.host=D.hostname)}return j=j||D.host&&B.length,j&&!xe&&B.unshift(""),B.length>0?D.pathname=B.join("/"):(D.pathname=null,D.path=null),(D.pathname!==null||D.search!==null)&&(D.path=(D.pathname?D.pathname:"")+(D.search?D.search:"")),D.auth=A.auth||D.auth,D.slashes=D.slashes||A.slashes,D.href=D.format(),D},e.prototype.parseHost=function(){var A=this.host,F=n.exec(A);F&&(F=F[0],F!==":"&&(this.port=F.substr(1)),A=A.substr(0,A.length-F.length)),A&&(this.hostname=A)},qu.parse=y,qu.resolve=E,qu.resolveObject=S,qu.format=_,qu.Url=e,qu}function v2(r){if(typeof r=="string")r=new URL(r);else if(!(r instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if(r.protocol!=="file:")throw new Deno.errors.InvalidData("invalid url scheme");return b2?LU(r):PU(r)}function LU(r){let e=r.hostname,t=r.pathname;for(let n=0;n<t.length;n++)if(t[n]==="%"){let i=t.codePointAt(n+2)||32;if(t[n+1]==="2"&&i===102||t[n+1]==="5"&&i===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(t=t.replace(RU,"\\"),t=decodeURIComponent(t),e!=="")return`\\\\${e}${t}`;{let n=t.codePointAt(1)|32,i=t[2];if(n<TU||n>CU||i!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return t.slice(1)}}function PU(r){if(r.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let e=r.pathname;for(let t=0;t<e.length;t++)if(e[t]==="%"){let n=e.codePointAt(t+2)||32;if(e[t+1]==="2"&&n===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(e)}function MU(r){let e=l2.resolve(r),t=r.charCodeAt(r.length-1);(t===SU||b2&&t===xU)&&e[e.length-1]!==l2.sep&&(e+="/");let n=new URL("file://");return e.includes("%")&&(e=e.replace(DU,"%25")),!b2&&e.includes("\\")&&(e=e.replace(IU,"%5C")),e.includes(`
79
+ `)&&(e=e.replace(OU,"%0A")),e.includes("\r")&&(e=e.replace(NU,"%0D")),e.includes(" ")&&(e=e.replace(kU,"%09")),n.pathname=e,n}var mU,c2,wO,f2,h2,vO,d2,_O,p2,EO,g2,AO,m2,xO,y2,SO,qu,TO,si,AU,EX,AX,xX,SX,TX,CX,xU,SU,TU,CU,b2,RU,DU,IU,OU,NU,kU,RO=Jt(()=>{Ce();De();Re();ME();jp();u2();Mu();mU=Object.freeze(Object.create(null)),c2={},wO=!1,f2=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;h2={},vO=!1;d2={},_O=!1;p2={},EO=!1;g2={},AO=!1;m2={},xO=!1;y2={},SO=!1;qu={},TO=!1;si=EU();si.parse;si.resolve;si.resolveObject;si.format;si.Url;AU=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;si.URL=typeof URL<"u"?URL:null;si.pathToFileURL=MU;si.fileURLToPath=v2;EX=si.Url,AX=si.format,xX=si.resolve,SX=si.resolveObject,TX=si.parse,CX=si.URL,xU=92,SU=47,TU=97,CU=122,b2=AU==="win32",RU=/\//g,DU=/%/g,IU=/\\/g,OU=/\n/g,NU=/\r/g,kU=/\t/g});var qp={};Uo(qp,{Dir:()=>x$,Dirent:()=>S$,F_OK:()=>N$,FileReadStream:()=>D$,FileWriteStream:()=>I$,R_OK:()=>k$,ReadStream:()=>C$,Stats:()=>T$,W_OK:()=>L$,WriteStream:()=>R$,X_OK:()=>P$,_toUnixTimestamp:()=>O$,access:()=>QU,accessSync:()=>ej,appendFile:()=>ZU,appendFileSync:()=>JU,chmod:()=>nj,chmodSync:()=>ij,chown:()=>tj,chownSync:()=>rj,close:()=>sj,closeSync:()=>oj,constants:()=>M$,copyFile:()=>aj,copyFileSync:()=>lj,cp:()=>uj,cpSync:()=>cj,createReadStream:()=>fj,createWriteStream:()=>hj,default:()=>br,exists:()=>dj,existsSync:()=>sb,fchmod:()=>mj,fchmodSync:()=>yj,fchown:()=>pj,fchownSync:()=>gj,fdatasync:()=>bj,fdatasyncSync:()=>wj,fstat:()=>vj,fstatSync:()=>_j,fsync:()=>Ej,fsyncSync:()=>Aj,ftruncate:()=>xj,ftruncateSync:()=>Sj,futimes:()=>Tj,futimesSync:()=>Cj,lchmod:()=>Ij,lchmodSync:()=>Oj,lchown:()=>Rj,lchownSync:()=>Dj,link:()=>Nj,linkSync:()=>kj,lstat:()=>Lj,lstatSync:()=>x2,mkdir:()=>Pj,mkdirSync:()=>Mj,mkdtemp:()=>Bj,mkdtempSync:()=>Fj,open:()=>Uj,openSync:()=>jj,opendir:()=>$j,opendirSync:()=>zj,promises:()=>B$,read:()=>Hj,readFile:()=>Xj,readFileSync:()=>S2,readSync:()=>Gj,readdir:()=>Wj,readdirSync:()=>qj,readlink:()=>Kj,readlinkSync:()=>Zj,readv:()=>Vj,readvSync:()=>Yj,realpath:()=>Jj,realpathSync:()=>Qj,rename:()=>e$,renameSync:()=>t$,rm:()=>r$,rmSync:()=>n$,rmdir:()=>i$,rmdirSync:()=>s$,stat:()=>o$,statSync:()=>a$,symlink:()=>l$,symlinkSync:()=>u$,truncate:()=>c$,truncateSync:()=>f$,unlink:()=>d$,unlinkSync:()=>p$,unwatchFile:()=>h$,utimes:()=>g$,utimesSync:()=>m$,watch:()=>y$,watchFile:()=>b$,write:()=>v$,writeFile:()=>w$,writeFileSync:()=>QO,writeSync:()=>_$,writev:()=>E$,writevSync:()=>A$});function Wp(){return DO||(DO=!0,Object.defineProperty($p,"__esModule",{value:!0}),$p.constants=void 0,$p.constants={O_RDONLY:0,O_WRONLY:1,O_RDWR:2,S_IFMT:61440,S_IFREG:32768,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960,S_IFSOCK:49152,O_CREAT:64,O_EXCL:128,O_NOCTTY:256,O_TRUNC:512,O_APPEND:1024,O_DIRECTORY:65536,O_NOATIME:262144,O_NOFOLLOW:131072,O_SYNC:1052672,O_DIRECT:16384,O_NONBLOCK:2048,S_IRWXU:448,S_IRUSR:256,S_IWUSR:128,S_IXUSR:64,S_IRWXG:56,S_IRGRP:32,S_IWGRP:16,S_IXGRP:8,S_IRWXO:7,S_IROTH:4,S_IWOTH:2,S_IXOTH:1,F_OK:0,R_OK:4,W_OK:2,X_OK:1,UV_FS_SYMLINK_DIR:1,UV_FS_SYMLINK_JUNCTION:2,UV_FS_COPYFILE_EXCL:1,UV_FS_COPYFILE_FICLONE:2,UV_FS_COPYFILE_FICLONE_FORCE:4,COPYFILE_EXCL:1,COPYFILE_FICLONE:2,COPYFILE_FICLONE_FORCE:4}),$p}function BU(){return IO||(IO=!0,typeof BigInt=="function"?rb.default=BigInt:rb.default=function(){throw new Error("BigInt is not supported in this environment.")}),rb}function _2(){if(OO)return Qf;OO=!0,Object.defineProperty(Qf,"__esModule",{value:!0}),Qf.Stats=void 0;var r=Wp(),e=BU(),t=r.constants.S_IFMT,n=r.constants.S_IFDIR,i=r.constants.S_IFREG,o=r.constants.S_IFBLK,s=r.constants.S_IFCHR,a=r.constants.S_IFLNK,u=r.constants.S_IFIFO,c=r.constants.S_IFSOCK,f=(function(){function h(){}return h.build=function(p,m){m===void 0&&(m=!1);var b=new h,v=p.uid,w=p.gid,y=p.atime,_=p.mtime,E=p.ctime,S=m?e.default:function(F){return F};b.uid=S(v),b.gid=S(w),b.rdev=S(0),b.blksize=S(4096),b.ino=S(p.ino),b.size=S(p.getSize()),b.blocks=S(1),b.atime=y,b.mtime=_,b.ctime=E,b.birthtime=E,b.atimeMs=S(y.getTime()),b.mtimeMs=S(_.getTime());var A=S(E.getTime());return b.ctimeMs=A,b.birthtimeMs=A,b.dev=S(0),b.mode=S(p.mode),b.nlink=S(p.nlink),b},h.prototype._checkModeProperty=function(p){return(Number(this.mode)&t)===p},h.prototype.isDirectory=function(){return this._checkModeProperty(n)},h.prototype.isFile=function(){return this._checkModeProperty(i)},h.prototype.isBlockDevice=function(){return this._checkModeProperty(o)},h.prototype.isCharacterDevice=function(){return this._checkModeProperty(s)},h.prototype.isSymbolicLink=function(){return this._checkModeProperty(a)},h.prototype.isFIFO=function(){return this._checkModeProperty(u)},h.prototype.isSocket=function(){return this._checkModeProperty(c)},h})();return Qf.Stats=f,Qf.default=f,Qf}function E2(){if(NO)return Rs;NO=!0;var r=Rs&&Rs.__spreadArray||function(o,s,a){if(a||arguments.length===2)for(var u=0,c=s.length,f;u<c;u++)(f||!(u in s))&&(f||(f=Array.prototype.slice.call(s,0,u)),f[u]=s[u]);return o.concat(f||Array.prototype.slice.call(s))};Object.defineProperty(Rs,"__esModule",{value:!0}),Rs.bufferFrom=Rs.bufferAllocUnsafe=Rs.Buffer=void 0;var e=fn();Object.defineProperty(Rs,"Buffer",{enumerable:!0,get:function(){return e.Buffer}});function t(o){for(var s=[],a=1;a<arguments.length;a++)s[a-1]=arguments[a];return new(e.Buffer.bind.apply(e.Buffer,r([void 0,o],s,!1)))}var n=e.Buffer.allocUnsafe||t;Rs.bufferAllocUnsafe=n;var i=e.Buffer.from||t;return Rs.bufferFrom=i,Rs}function GO(){if(kO)return sn;kO=!0;var r=sn&&sn.__extends||(function(){var b=function(v,w){return b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,_){y.__proto__=_}||function(y,_){for(var E in _)Object.prototype.hasOwnProperty.call(_,E)&&(y[E]=_[E])},b(v,w)};return function(v,w){if(typeof w!="function"&&w!==null)throw new TypeError("Class extends value "+String(w)+" is not a constructor or null");b(v,w);function y(){this.constructor=v}v.prototype=w===null?Object.create(w):(y.prototype=w.prototype,new y)}})();Object.defineProperty(sn,"__esModule",{value:!0}),sn.E=sn.AssertionError=sn.message=sn.RangeError=sn.TypeError=sn.Error=void 0;var e=pt,t=ze,n=typeof Symbol>"u"?"_kCode":Symbol("code"),i={};function o(b){return(function(v){r(w,v);function w(y){for(var _=[],E=1;E<arguments.length;E++)_[E-1]=arguments[E];var S=v.call(this,u(y,_))||this;return S.code=y,S[n]=y,S.name="".concat(v.prototype.name," [").concat(S[n],"]"),S}return w})(b)}var s=typeof globalThis<"u"?globalThis:FU,a=(function(b){r(v,b);function v(w){var y=this;if(typeof w!="object"||w===null)throw new sn.TypeError("ERR_INVALID_ARG_TYPE","options","object");return w.message?y=b.call(this,w.message)||this:y=b.call(this,"".concat(t.inspect(w.actual).slice(0,128)," ")+"".concat(w.operator," ").concat(t.inspect(w.expected).slice(0,128)))||this,y.generatedMessage=!w.message,y.name="AssertionError [ERR_ASSERTION]",y.code="ERR_ASSERTION",y.actual=w.actual,y.expected=w.expected,y.operator=w.operator,sn.Error.captureStackTrace(y,w.stackStartFunction),y}return v})(s.Error);sn.AssertionError=a;function u(b,v){e.strictEqual(typeof b,"string");var w=i[b];e(w,"An invalid error message key was used: ".concat(b,"."));var y;if(typeof w=="function")y=w;else{if(y=t.format,v===void 0||v.length===0)return w;v.unshift(w)}return String(y.apply(null,v))}sn.message=u;function c(b,v){i[b]=typeof v=="function"?v:String(v)}sn.E=c,sn.Error=o(s.Error),sn.TypeError=o(s.TypeError),sn.RangeError=o(s.RangeError),c("ERR_ARG_NOT_ITERABLE","%s must be iterable"),c("ERR_ASSERTION","%s"),c("ERR_BUFFER_OUT_OF_BOUNDS",m),c("ERR_CHILD_CLOSED_BEFORE_REPLY","Child closed before reply received"),c("ERR_CONSOLE_WRITABLE_STREAM","Console expects a writable stream instance for %s"),c("ERR_CPU_USAGE","Unable to obtain cpu usage %s"),c("ERR_DNS_SET_SERVERS_FAILED",function(b,v){return'c-ares failed to set servers: "'.concat(b,'" [').concat(v,"]")}),c("ERR_FALSY_VALUE_REJECTION","Promise was rejected with falsy value"),c("ERR_ENCODING_NOT_SUPPORTED",function(b){return'The "'.concat(b,'" encoding is not supported')}),c("ERR_ENCODING_INVALID_ENCODED_DATA",function(b){return"The encoded data was not valid for encoding ".concat(b)}),c("ERR_HTTP_HEADERS_SENT","Cannot render headers after they are sent to the client"),c("ERR_HTTP_INVALID_STATUS_CODE","Invalid status code: %s"),c("ERR_HTTP_TRAILER_INVALID","Trailers are invalid with this transfer encoding"),c("ERR_INDEX_OUT_OF_RANGE","Index out of range"),c("ERR_INVALID_ARG_TYPE",f),c("ERR_INVALID_ARRAY_LENGTH",function(b,v,w){return e.strictEqual(typeof w,"number"),'The array "'.concat(b,'" (length ').concat(w,") must be of length ").concat(v,".")}),c("ERR_INVALID_BUFFER_SIZE","Buffer size must be a multiple of %s"),c("ERR_INVALID_CALLBACK","Callback must be a function"),c("ERR_INVALID_CHAR","Invalid character in %s"),c("ERR_INVALID_CURSOR_POS","Cannot set cursor row without setting its column"),c("ERR_INVALID_FD",'"fd" must be a positive integer: %s'),c("ERR_INVALID_FILE_URL_HOST",'File URL host must be "localhost" or empty on %s'),c("ERR_INVALID_FILE_URL_PATH","File URL path %s"),c("ERR_INVALID_HANDLE_TYPE","This handle type cannot be sent"),c("ERR_INVALID_IP_ADDRESS","Invalid IP address: %s"),c("ERR_INVALID_OPT_VALUE",function(b,v){return'The value "'.concat(String(v),'" is invalid for option "').concat(b,'"')}),c("ERR_INVALID_OPT_VALUE_ENCODING",function(b){return'The value "'.concat(String(b),'" is invalid for option "encoding"')}),c("ERR_INVALID_REPL_EVAL_CONFIG",'Cannot specify both "breakEvalOnSigint" and "eval" for REPL'),c("ERR_INVALID_SYNC_FORK_INPUT","Asynchronous forks do not support Buffer, Uint8Array or string input: %s"),c("ERR_INVALID_THIS",'Value of "this" must be of type %s'),c("ERR_INVALID_TUPLE","%s must be an iterable %s tuple"),c("ERR_INVALID_URL","Invalid URL: %s"),c("ERR_INVALID_URL_SCHEME",function(b){return"The URL must be ".concat(p(b,"scheme"))}),c("ERR_IPC_CHANNEL_CLOSED","Channel closed"),c("ERR_IPC_DISCONNECTED","IPC channel is already disconnected"),c("ERR_IPC_ONE_PIPE","Child process can have only one IPC pipe"),c("ERR_IPC_SYNC_FORK","IPC cannot be used with synchronous forks"),c("ERR_MISSING_ARGS",h),c("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),c("ERR_NAPI_CONS_FUNCTION","Constructor must be a function"),c("ERR_NAPI_CONS_PROTOTYPE_OBJECT","Constructor.prototype must be an object"),c("ERR_NO_CRYPTO","Node.js is not compiled with OpenSSL crypto support"),c("ERR_NO_LONGER_SUPPORTED","%s is no longer supported"),c("ERR_PARSE_HISTORY_DATA","Could not parse history data in %s"),c("ERR_SOCKET_ALREADY_BOUND","Socket is already bound"),c("ERR_SOCKET_BAD_PORT","Port should be > 0 and < 65536"),c("ERR_SOCKET_BAD_TYPE","Bad socket type specified. Valid types are: udp4, udp6"),c("ERR_SOCKET_CANNOT_SEND","Unable to send data"),c("ERR_SOCKET_CLOSED","Socket is closed"),c("ERR_SOCKET_DGRAM_NOT_RUNNING","Not running"),c("ERR_STDERR_CLOSE","process.stderr cannot be closed"),c("ERR_STDOUT_CLOSE","process.stdout cannot be closed"),c("ERR_STREAM_WRAP","Stream has StringDecoder set or is in objectMode"),c("ERR_TLS_CERT_ALTNAME_INVALID","Hostname/IP does not match certificate's altnames: %s"),c("ERR_TLS_DH_PARAM_SIZE",function(b){return"DH parameter size ".concat(b," is less than 2048")}),c("ERR_TLS_HANDSHAKE_TIMEOUT","TLS handshake timeout"),c("ERR_TLS_RENEGOTIATION_FAILED","Failed to renegotiate"),c("ERR_TLS_REQUIRED_SERVER_NAME",'"servername" is required parameter for Server.addContext'),c("ERR_TLS_SESSION_ATTACK","TSL session renegotiation attack detected"),c("ERR_TRANSFORM_ALREADY_TRANSFORMING","Calling transform done when still transforming"),c("ERR_TRANSFORM_WITH_LENGTH_0","Calling transform done when writableState.length != 0"),c("ERR_UNKNOWN_ENCODING","Unknown encoding: %s"),c("ERR_UNKNOWN_SIGNAL","Unknown signal: %s"),c("ERR_UNKNOWN_STDIN_TYPE","Unknown stdin file type"),c("ERR_UNKNOWN_STREAM_TYPE","Unknown stream file type"),c("ERR_V8BREAKITERATOR","Full ICU data not installed. See https://github.com/nodejs/node/wiki/Intl");function f(b,v,w){e(b,"name is required");var y;v.includes("not ")?(y="must not be",v=v.split("not ")[1]):y="must be";var _;if(Array.isArray(b)){var E=b.map(function(A){return'"'.concat(A,'"')}).join(", ");_="The ".concat(E," arguments ").concat(y," ").concat(p(v,"type"))}else if(b.includes(" argument"))_="The ".concat(b," ").concat(y," ").concat(p(v,"type"));else{var S=b.includes(".")?"property":"argument";_='The "'.concat(b,'" ').concat(S," ").concat(y," ").concat(p(v,"type"))}return arguments.length>=3&&(_+=". Received type ".concat(w!==null?typeof w:"null")),_}function h(){for(var b=[],v=0;v<arguments.length;v++)b[v]=arguments[v];e(b.length>0,"At least one arg needs to be specified");var w="The ",y=b.length;switch(b=b.map(function(_){return'"'.concat(_,'"')}),y){case 1:w+="".concat(b[0]," argument");break;case 2:w+="".concat(b[0]," and ").concat(b[1]," arguments");break;default:w+=b.slice(0,y-1).join(", "),w+=", and ".concat(b[y-1]," arguments");break}return"".concat(w," must be specified")}function p(b,v){if(e(b,"expected is required"),e(typeof v=="string","thing is required"),Array.isArray(b)){var w=b.length;return e(w>0,"At least one expected value needs to be specified"),b=b.map(function(y){return String(y)}),w>2?"one of ".concat(v," ").concat(b.slice(0,w-1).join(", "),", or ")+b[w-1]:w===2?"one of ".concat(v," ").concat(b[0]," or ").concat(b[1]):"of ".concat(v," ").concat(b[0])}else return"of ".concat(v," ").concat(String(b))}function m(b,v){return v?"Attempt to write outside buffer bounds":'"'.concat(b,'" is outside of buffer bounds')}return sn}function VO(){if(LO)return ro;LO=!0,Object.defineProperty(ro,"__esModule",{value:!0}),ro.strToEncoding=ro.assertEncoding=ro.ENCODING_UTF8=void 0;var r=E2(),e=GO();ro.ENCODING_UTF8="utf8";function t(i){if(i&&!r.Buffer.isEncoding(i))throw new e.TypeError("ERR_INVALID_OPT_VALUE_ENCODING",i)}ro.assertEncoding=t;function n(i,o){return!o||o===ro.ENCODING_UTF8?i:o==="buffer"?new r.Buffer(i):new r.Buffer(i).toString(o)}return ro.strToEncoding=n,ro}function YO(){if(PO)return eh;PO=!0,Object.defineProperty(eh,"__esModule",{value:!0}),eh.Dirent=void 0;var r=Wp(),e=VO(),t=r.constants.S_IFMT,n=r.constants.S_IFDIR,i=r.constants.S_IFREG,o=r.constants.S_IFBLK,s=r.constants.S_IFCHR,a=r.constants.S_IFLNK,u=r.constants.S_IFIFO,c=r.constants.S_IFSOCK,f=(function(){function h(){this.name="",this.mode=0}return h.build=function(p,m){var b=new h,v=p.getNode().mode;return b.name=(0,e.strToEncoding)(p.getName(),m),b.mode=v,b},h.prototype._checkModeProperty=function(p){return(this.mode&t)===p},h.prototype.isDirectory=function(){return this._checkModeProperty(n)},h.prototype.isFile=function(){return this._checkModeProperty(i)},h.prototype.isBlockDevice=function(){return this._checkModeProperty(o)},h.prototype.isCharacterDevice=function(){return this._checkModeProperty(s)},h.prototype.isSymbolicLink=function(){return this._checkModeProperty(a)},h.prototype.isFIFO=function(){return this._checkModeProperty(u)},h.prototype.isSocket=function(){return this._checkModeProperty(c)},h})();return eh.Dirent=f,eh.default=f,eh}function XO(){if(MO)return nb;MO=!0;var r=zr;Object.defineProperty(nb,"__esModule",{value:!0});var e;return typeof r.nextTick=="function"?e=r.nextTick.bind(typeof globalThis<"u"?globalThis:BO):e=setTimeout.bind(typeof globalThis<"u"?globalThis:BO),nb.default=e,nb}function KO(){if(FO)return th;FO=!0;var r=zr;Object.defineProperty(th,"__esModule",{value:!0}),th.createProcess=void 0;var e=function(){if(typeof r<"u")return r;try{return zr}catch{return}};function t(){var n=e()||{};return n.cwd||(n.cwd=function(){return"/"}),n.nextTick||(n.nextTick=XO().default),n.emitWarning||(n.emitWarning=function(i,o){console.warn("".concat(o).concat(o?": ":"").concat(i))}),n.env||(n.env={}),n}return th.createProcess=t,th.default=t(),th}function UU(){if(UO)return oi;UO=!0;var r=oi&&oi.__extends||(function(){var w=function(y,_){return w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,S){E.__proto__=S}||function(E,S){for(var A in S)Object.prototype.hasOwnProperty.call(S,A)&&(E[A]=S[A])},w(y,_)};return function(y,_){if(typeof _!="function"&&_!==null)throw new TypeError("Class extends value "+String(_)+" is not a constructor or null");w(y,_);function E(){this.constructor=y}y.prototype=_===null?Object.create(_):(E.prototype=_.prototype,new E)}})();Object.defineProperty(oi,"__esModule",{value:!0}),oi.File=oi.Link=oi.Node=oi.SEP=void 0;var e=KO(),t=E2(),n=Wp(),i=nn,o=_2(),s=n.constants.S_IFMT,a=n.constants.S_IFDIR,u=n.constants.S_IFREG,c=n.constants.S_IFLNK,f=n.constants.O_APPEND,h=function(){var w,y;return(y=(w=e.default.getuid)===null||w===void 0?void 0:w.call(e.default))!==null&&y!==void 0?y:0},p=function(){var w,y;return(y=(w=e.default.getgid)===null||w===void 0?void 0:w.call(e.default))!==null&&y!==void 0?y:0};oi.SEP="/";var m=(function(w){r(y,w);function y(_,E){E===void 0&&(E=438);var S=w.call(this)||this;return S._uid=h(),S._gid=p(),S._atime=new Date,S._mtime=new Date,S._ctime=new Date,S._perm=438,S.mode=u,S._nlink=1,S._perm=E,S.mode|=E,S.ino=_,S}return Object.defineProperty(y.prototype,"ctime",{get:function(){return this._ctime},set:function(_){this._ctime=_},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"uid",{get:function(){return this._uid},set:function(_){this._uid=_,this.ctime=new Date},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"gid",{get:function(){return this._gid},set:function(_){this._gid=_,this.ctime=new Date},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"atime",{get:function(){return this._atime},set:function(_){this._atime=_,this.ctime=new Date},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"mtime",{get:function(){return this._mtime},set:function(_){this._mtime=_,this.ctime=new Date},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"perm",{get:function(){return this._perm},set:function(_){this._perm=_,this.ctime=new Date},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"nlink",{get:function(){return this._nlink},set:function(_){this._nlink=_,this.ctime=new Date},enumerable:!1,configurable:!0}),y.prototype.getString=function(_){return _===void 0&&(_="utf8"),this.atime=new Date,this.getBuffer().toString(_)},y.prototype.setString=function(_){this.buf=(0,t.bufferFrom)(_,"utf8"),this.touch()},y.prototype.getBuffer=function(){return this.atime=new Date,this.buf||this.setBuffer((0,t.bufferAllocUnsafe)(0)),(0,t.bufferFrom)(this.buf)},y.prototype.setBuffer=function(_){this.buf=(0,t.bufferFrom)(_),this.touch()},y.prototype.getSize=function(){return this.buf?this.buf.length:0},y.prototype.setModeProperty=function(_){this.mode=this.mode&~s|_},y.prototype.setIsFile=function(){this.setModeProperty(u)},y.prototype.setIsDirectory=function(){this.setModeProperty(a)},y.prototype.setIsSymlink=function(){this.setModeProperty(c)},y.prototype.isFile=function(){return(this.mode&s)===u},y.prototype.isDirectory=function(){return(this.mode&s)===a},y.prototype.isSymlink=function(){return(this.mode&s)===c},y.prototype.makeSymlink=function(_){this.symlink=_,this.setIsSymlink()},y.prototype.write=function(_,E,S,A){if(E===void 0&&(E=0),S===void 0&&(S=_.length),A===void 0&&(A=0),this.buf||(this.buf=(0,t.bufferAllocUnsafe)(0)),A+S>this.buf.length){var F=(0,t.bufferAllocUnsafe)(A+S);this.buf.copy(F,0,0,this.buf.length),this.buf=F}return _.copy(this.buf,A,E,E+S),this.touch(),S},y.prototype.read=function(_,E,S,A){E===void 0&&(E=0),S===void 0&&(S=_.byteLength),A===void 0&&(A=0),this.atime=new Date,this.buf||(this.buf=(0,t.bufferAllocUnsafe)(0));var F=S;return F>_.byteLength&&(F=_.byteLength),F+A>this.buf.length&&(F=this.buf.length-A),this.buf.copy(_,E,A,A+F),F},y.prototype.truncate=function(_){if(_===void 0&&(_=0),!_)this.buf=(0,t.bufferAllocUnsafe)(0);else if(this.buf||(this.buf=(0,t.bufferAllocUnsafe)(0)),_<=this.buf.length)this.buf=this.buf.slice(0,_);else{var E=(0,t.bufferAllocUnsafe)(_);this.buf.copy(E),E.fill(0,this.buf.length),this.buf=E}this.touch()},y.prototype.chmod=function(_){this.perm=_,this.mode=this.mode&-512|_,this.touch()},y.prototype.chown=function(_,E){this.uid=_,this.gid=E,this.touch()},y.prototype.touch=function(){this.mtime=new Date,this.emit("change",this)},y.prototype.canRead=function(_,E){return _===void 0&&(_=h()),E===void 0&&(E=p()),!!(this.perm&4||E===this.gid&&this.perm&32||_===this.uid&&this.perm&256)},y.prototype.canWrite=function(_,E){return _===void 0&&(_=h()),E===void 0&&(E=p()),!!(this.perm&2||E===this.gid&&this.perm&16||_===this.uid&&this.perm&128)},y.prototype.del=function(){this.emit("delete",this)},y.prototype.toJSON=function(){return{ino:this.ino,uid:this.uid,gid:this.gid,atime:this.atime.getTime(),mtime:this.mtime.getTime(),ctime:this.ctime.getTime(),perm:this.perm,mode:this.mode,nlink:this.nlink,symlink:this.symlink,data:this.getString()}},y})(i.EventEmitter);oi.Node=m;var b=(function(w){r(y,w);function y(_,E,S){var A=w.call(this)||this;return A.children={},A._steps=[],A.ino=0,A.length=0,A.vol=_,A.parent=E,A.name=S,A.syncSteps(),A}return Object.defineProperty(y.prototype,"steps",{get:function(){return this._steps},set:function(_){this._steps=_;for(var E=0,S=Object.entries(this.children);E<S.length;E++){var A=S[E],F=A[0],D=A[1];F==="."||F===".."||D?.syncSteps()}},enumerable:!1,configurable:!0}),y.prototype.setNode=function(_){this.node=_,this.ino=_.ino},y.prototype.getNode=function(){return this.node},y.prototype.createChild=function(_,E){E===void 0&&(E=this.vol.createNode());var S=new y(this.vol,this,_);return S.setNode(E),E.isDirectory()&&(S.children["."]=S,S.getNode().nlink++),this.setChild(_,S),S},y.prototype.setChild=function(_,E){E===void 0&&(E=new y(this.vol,this,_)),this.children[_]=E,E.parent=this,this.length++;var S=E.getNode();return S.isDirectory()&&(E.children[".."]=this,this.getNode().nlink++),this.getNode().mtime=new Date,this.emit("child:add",E,this),E},y.prototype.deleteChild=function(_){var E=_.getNode();E.isDirectory()&&(delete _.children[".."],this.getNode().nlink--),delete this.children[_.getName()],this.length--,this.getNode().mtime=new Date,this.emit("child:delete",_,this)},y.prototype.getChild=function(_){if(this.getNode().mtime=new Date,Object.hasOwnProperty.call(this.children,_))return this.children[_]},y.prototype.getPath=function(){return this.steps.join(oi.SEP)},y.prototype.getName=function(){return this.steps[this.steps.length-1]},y.prototype.walk=function(_,E,S){if(E===void 0&&(E=_.length),S===void 0&&(S=0),S>=_.length)return this;if(S>=E)return this;var A=_[S],F=this.getChild(A);return F?F.walk(_,E,S+1):null},y.prototype.toJSON=function(){return{steps:this.steps,ino:this.ino,children:Object.keys(this.children)}},y.prototype.syncSteps=function(){this.steps=this.parent?this.parent.steps.concat([this.name]):[this.name]},y})(i.EventEmitter);oi.Link=b;var v=(function(){function w(y,_,E,S){this.position=0,this.link=y,this.node=_,this.flags=E,this.fd=S}return w.prototype.getString=function(y){return this.node.getString()},w.prototype.setString=function(y){this.node.setString(y)},w.prototype.getBuffer=function(){return this.node.getBuffer()},w.prototype.setBuffer=function(y){this.node.setBuffer(y)},w.prototype.getSize=function(){return this.node.getSize()},w.prototype.truncate=function(y){this.node.truncate(y)},w.prototype.seekTo=function(y){this.position=y},w.prototype.stats=function(){return o.default.build(this.node)},w.prototype.write=function(y,_,E,S){_===void 0&&(_=0),E===void 0&&(E=y.length),typeof S!="number"&&(S=this.position),this.flags&f&&(S=this.getSize());var A=this.node.write(y,_,E,S);return this.position=S+A,A},w.prototype.read=function(y,_,E,S){_===void 0&&(_=0),E===void 0&&(E=y.byteLength),typeof S!="number"&&(S=this.position);var A=this.node.read(y,_,E,S);return this.position=S+A,A},w.prototype.chmod=function(y){this.node.chmod(y)},w.prototype.chown=function(y,_){this.node.chown(y,_)},w})();return oi.File=v,oi}function $U(){if(jO)return ib;jO=!0,Object.defineProperty(ib,"__esModule",{value:!0});function r(e,t,n){var i=setTimeout.apply(typeof globalThis<"u"?globalThis:jU,arguments);return i&&typeof i=="object"&&typeof i.unref=="function"&&i.unref(),i}return ib.default=r,ib}function zU(){if($O)return dl;$O=!0;var r=dl&&dl.__spreadArray||function(i,o,s){if(s||arguments.length===2)for(var a=0,u=o.length,c;a<u;a++)(c||!(a in o))&&(c||(c=Array.prototype.slice.call(o,0,a)),c[a]=o[a]);return i.concat(c||Array.prototype.slice.call(o))};Object.defineProperty(dl,"__esModule",{value:!0}),dl.FileHandle=void 0;function e(i,o,s){return s===void 0&&(s=function(a){return a}),function(){for(var a=[],u=0;u<arguments.length;u++)a[u]=arguments[u];return new Promise(function(c,f){i[o].bind(i).apply(void 0,r(r([],a,!1),[function(h,p){return h?f(h):c(s(p))}],!1))})}}var t=(function(){function i(o,s){this.vol=o,this.fd=s}return i.prototype.appendFile=function(o,s){return e(this.vol,"appendFile")(this.fd,o,s)},i.prototype.chmod=function(o){return e(this.vol,"fchmod")(this.fd,o)},i.prototype.chown=function(o,s){return e(this.vol,"fchown")(this.fd,o,s)},i.prototype.close=function(){return e(this.vol,"close")(this.fd)},i.prototype.datasync=function(){return e(this.vol,"fdatasync")(this.fd)},i.prototype.read=function(o,s,a,u){return e(this.vol,"read",function(c){return{bytesRead:c,buffer:o}})(this.fd,o,s,a,u)},i.prototype.readFile=function(o){return e(this.vol,"readFile")(this.fd,o)},i.prototype.stat=function(o){return e(this.vol,"fstat")(this.fd,o)},i.prototype.sync=function(){return e(this.vol,"fsync")(this.fd)},i.prototype.truncate=function(o){return e(this.vol,"ftruncate")(this.fd,o)},i.prototype.utimes=function(o,s){return e(this.vol,"futimes")(this.fd,o,s)},i.prototype.write=function(o,s,a,u){return e(this.vol,"write",function(c){return{bytesWritten:c,buffer:o}})(this.fd,o,s,a,u)},i.prototype.writeFile=function(o,s){return e(this.vol,"writeFile")(this.fd,o,s)},i})();dl.FileHandle=t;function n(i){return typeof Promise>"u"?null:{FileHandle:t,access:function(o,s){return e(i,"access")(o,s)},appendFile:function(o,s,a){return e(i,"appendFile")(o instanceof t?o.fd:o,s,a)},chmod:function(o,s){return e(i,"chmod")(o,s)},chown:function(o,s,a){return e(i,"chown")(o,s,a)},copyFile:function(o,s,a){return e(i,"copyFile")(o,s,a)},lchmod:function(o,s){return e(i,"lchmod")(o,s)},lchown:function(o,s,a){return e(i,"lchown")(o,s,a)},link:function(o,s){return e(i,"link")(o,s)},lstat:function(o,s){return e(i,"lstat")(o,s)},mkdir:function(o,s){return e(i,"mkdir")(o,s)},mkdtemp:function(o,s){return e(i,"mkdtemp")(o,s)},open:function(o,s,a){return e(i,"open",function(u){return new t(i,u)})(o,s,a)},readdir:function(o,s){return e(i,"readdir")(o,s)},readFile:function(o,s){return e(i,"readFile")(o instanceof t?o.fd:o,s)},readlink:function(o,s){return e(i,"readlink")(o,s)},realpath:function(o,s){return e(i,"realpath")(o,s)},rename:function(o,s){return e(i,"rename")(o,s)},rmdir:function(o){return e(i,"rmdir")(o)},rm:function(o,s){return e(i,"rm")(o,s)},stat:function(o,s){return e(i,"stat")(o,s)},symlink:function(o,s,a){return e(i,"symlink")(o,s,a)},truncate:function(o,s){return e(i,"truncate")(o,s)},unlink:function(o){return e(i,"unlink")(o)},utimes:function(o,s,a){return e(i,"utimes")(o,s,a)},writeFile:function(o,s,a){return e(i,"writeFile")(o instanceof t?o.fd:o,s,a)}}}return dl.default=n,dl}function WU(){if(zO)return zp;zO=!0;var r=zr;Object.defineProperty(zp,"__esModule",{value:!0}),zp.correctPath=s,zp.unixify=o;var e=r.platform==="win32";function t(a){var u=a.length-1;if(u<2)return a;for(;n(a,u);)u--;return a.substr(0,u+1)}function n(a,u){var c=a[u];return u>0&&(c==="/"||e&&c==="\\")}function i(a,u){if(typeof a!="string")throw new TypeError("expected a string");return a=a.replace(/[\\\/]+/g,"/"),u!==!1&&(a=t(a)),a}function o(a){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return e?(a=i(a,u),a.replace(/^([a-zA-Z]+:|\.\/)/,"")):a}function s(a){return o(a.replace(/^\\\\\?\\.:\\/,"\\"))}return zp}function ZO(){if(WO)return Ft;WO=!0;var r=Ft&&Ft.__extends||(function(){var ce=function(z,G){return ce=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(se,ye){se.__proto__=ye}||function(se,ye){for(var Ne in ye)Object.prototype.hasOwnProperty.call(ye,Ne)&&(se[Ne]=ye[Ne])},ce(z,G)};return function(z,G){if(typeof G!="function"&&G!==null)throw new TypeError("Class extends value "+String(G)+" is not a constructor or null");ce(z,G);function se(){this.constructor=z}z.prototype=G===null?Object.create(G):(se.prototype=G.prototype,new se)}})(),e=Ft&&Ft.__spreadArray||function(ce,z,G){if(G||arguments.length===2)for(var se=0,ye=z.length,Ne;se<ye;se++)(Ne||!(se in z))&&(Ne||(Ne=Array.prototype.slice.call(z,0,se)),Ne[se]=z[se]);return ce.concat(Ne||Array.prototype.slice.call(z))};Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.FSWatcher=Ft.StatWatcher=Ft.Volume=Ft.toUnixTimestamp=Ft.bufferToEncoding=Ft.dataToBuffer=Ft.dataToStr=Ft.pathToSteps=Ft.filenameToSteps=Ft.pathToFilename=Ft.flagsToNumber=Ft.FLAGS=void 0;var t=rn,n=UU(),i=_2(),o=YO(),s=E2(),a=XO(),u=KO(),c=$U(),f=ii,h=Wp(),p=nn,m=VO(),b=GO(),v=ze,w=zU(),y=t.resolve,_=h.constants.O_RDONLY,E=h.constants.O_WRONLY,S=h.constants.O_RDWR,A=h.constants.O_CREAT,F=h.constants.O_EXCL,D=h.constants.O_TRUNC,H=h.constants.O_APPEND,J=h.constants.O_SYNC,K=h.constants.O_DIRECTORY,ne=h.constants.F_OK,k=h.constants.COPYFILE_EXCL,$=h.constants.COPYFILE_FICLONE_FORCE,Y=t.posix?t.posix:t,ie=Y.sep,re=Y.relative,N=Y.join,x=Y.dirname,P=u.default.platform==="win32",C=128,j={PATH_STR:"path must be a string or Buffer",FD:"fd must be a file descriptor",MODE_INT:"mode must be an int",CB:"callback must be a function",UID:"uid must be an unsigned int",GID:"gid must be an unsigned int",LEN:"len must be an integer",ATIME:"atime must be an integer",MTIME:"mtime must be an integer",PREFIX:"filename prefix is required",BUFFER:"buffer must be an instance of Buffer or StaticBuffer",OFFSET:"offset must be an integer",LENGTH:"length must be an integer",POSITION:"position must be an integer"},U=function(ce){return"Expected options to be either an object or a string, but got ".concat(ce," instead")},B="ENOENT",Q="EBADF",fe="EINVAL",_e="EPERM",te="EPROTO",W="EEXIST",oe="ENOTDIR",be="EMFILE",xe="EACCES",X="EISDIR",M="ENOTEMPTY",ae="ENOSYS",ge="ERR_FS_EISDIR";function Se(ce,z,G,se){z===void 0&&(z=""),G===void 0&&(G=""),se===void 0&&(se="");var ye="";switch(G&&(ye=" '".concat(G,"'")),se&&(ye+=" -> '".concat(se,"'")),ce){case B:return"ENOENT: no such file or directory, ".concat(z).concat(ye);case Q:return"EBADF: bad file descriptor, ".concat(z).concat(ye);case fe:return"EINVAL: invalid argument, ".concat(z).concat(ye);case _e:return"EPERM: operation not permitted, ".concat(z).concat(ye);case te:return"EPROTO: protocol error, ".concat(z).concat(ye);case W:return"EEXIST: file already exists, ".concat(z).concat(ye);case oe:return"ENOTDIR: not a directory, ".concat(z).concat(ye);case X:return"EISDIR: illegal operation on a directory, ".concat(z).concat(ye);case xe:return"EACCES: permission denied, ".concat(z).concat(ye);case M:return"ENOTEMPTY: directory not empty, ".concat(z).concat(ye);case be:return"EMFILE: too many open files, ".concat(z).concat(ye);case ae:return"ENOSYS: function not implemented, ".concat(z).concat(ye);case ge:return"[ERR_FS_EISDIR]: Path is a directory: ".concat(z," returned EISDIR (is a directory) ").concat(G);default:return"".concat(ce,": error occurred, ").concat(z).concat(ye)}}function we(ce,z,G,se,ye){z===void 0&&(z=""),G===void 0&&(G=""),se===void 0&&(se=""),ye===void 0&&(ye=Error);var Ne=new ye(Se(ce,z,G,se));return Ne.code=ce,G&&(Ne.path=G),Ne}var de;(function(ce){ce[ce.r=_]="r",ce[ce["r+"]=S]="r+",ce[ce.rs=_|J]="rs",ce[ce.sr=ce.rs]="sr",ce[ce["rs+"]=S|J]="rs+",ce[ce["sr+"]=ce["rs+"]]="sr+",ce[ce.w=E|A|D]="w",ce[ce.wx=E|A|D|F]="wx",ce[ce.xw=ce.wx]="xw",ce[ce["w+"]=S|A|D]="w+",ce[ce["wx+"]=S|A|D|F]="wx+",ce[ce["xw+"]=ce["wx+"]]="xw+",ce[ce.a=E|H|A]="a",ce[ce.ax=E|H|A|F]="ax",ce[ce.xa=ce.ax]="xa",ce[ce["a+"]=S|H|A]="a+",ce[ce["ax+"]=S|H|A|F]="ax+",ce[ce["xa+"]=ce["ax+"]]="xa+"})(de=Ft.FLAGS||(Ft.FLAGS={}));function Ae(ce){if(typeof ce=="number")return ce;if(typeof ce=="string"){var z=de[ce];if(typeof z<"u")return z}throw new b.TypeError("ERR_INVALID_OPT_VALUE","flags",ce)}Ft.flagsToNumber=Ae;function je(ce,z){var G;if(z){var se=typeof z;switch(se){case"string":G=Object.assign({},ce,{encoding:z});break;case"object":G=Object.assign({},ce,z);break;default:throw TypeError(U(se))}}else return ce;return G.encoding!=="buffer"&&(0,m.assertEncoding)(G.encoding),G}function ke(ce){return function(z){return je(ce,z)}}function Oe(ce){if(typeof ce!="function")throw TypeError(j.CB);return ce}function Ve(ce){return function(z,G){return typeof z=="function"?[ce(),z]:[ce(z),Oe(G)]}}var Je={encoding:"utf8"},et=ke(Je),T=Ve(et),d={flag:"r"},g=ke(d),I={encoding:"utf8",mode:438,flag:de[de.w]},Z=ke(I),R={encoding:"utf8",mode:438,flag:de[de.a]},le=ke(R),pe=Ve(le),Ee=Je,ve=ke(Ee),Ie=Ve(ve),V={mode:511,recursive:!1},Fe=function(ce){return typeof ce=="number"?Object.assign({},V,{mode:ce}):Object.assign({},V,ce)},st={recursive:!1},O=function(ce){return Object.assign({},st,ce)},Pe=ke(Je),$e=Ve(Pe),he={encoding:"utf8",withFileTypes:!1},Te=ke(he),Me=Ve(Te),ut={bigint:!1},ue=function(ce){return ce===void 0&&(ce={}),Object.assign({},ut,ce)},me=function(ce,z){return typeof ce=="function"?[ue(),ce]:[ue(ce),Oe(z)]};function We(ce){if(ce.hostname!=="")throw new b.TypeError("ERR_INVALID_FILE_URL_HOST",u.default.platform);for(var z=ce.pathname,G=0;G<z.length;G++)if(z[G]==="%"){var se=z.codePointAt(G+2)|32;if(z[G+1]==="2"&&se===102)throw new b.TypeError("ERR_INVALID_FILE_URL_PATH","must not include encoded / characters")}return decodeURIComponent(z)}function Ue(ce){if(typeof ce!="string"&&!s.Buffer.isBuffer(ce)){try{if(!(ce instanceof Qt.URL))throw new TypeError(j.PATH_STR)}catch{throw new TypeError(j.PATH_STR)}ce=We(ce)}var z=String(ce);return Dr(z),z}Ft.pathToFilename=Ue;var Ze=function(ce,z){return z===void 0&&(z=u.default.cwd()),y(z,ce)};if(P){var dt=Ze,Rt=WU().unixify;Ze=function(ce,z){return Rt(dt(ce,z))}}function Et(ce,z){var G=Ze(ce,z),se=G.substring(1);return se?se.split(ie):[]}Ft.filenameToSteps=Et;function ar(ce){return Et(Ue(ce))}Ft.pathToSteps=ar;function _i(ce,z){return z===void 0&&(z=m.ENCODING_UTF8),s.Buffer.isBuffer(ce)?ce.toString(z):ce instanceof Uint8Array?(0,s.bufferFrom)(ce).toString(z):String(ce)}Ft.dataToStr=_i;function qn(ce,z){return z===void 0&&(z=m.ENCODING_UTF8),s.Buffer.isBuffer(ce)?ce:ce instanceof Uint8Array?(0,s.bufferFrom)(ce):(0,s.bufferFrom)(String(ce),z)}Ft.dataToBuffer=qn;function Ht(ce,z){return!z||z==="buffer"?ce:ce.toString(z)}Ft.bufferToEncoding=Ht;function Dr(ce,z){if((""+ce).indexOf("\0")!==-1){var G=new Error("Path must be a string without null bytes");throw G.code=B,G}return!0}function yr(ce,z){if(typeof ce=="number")return ce;if(typeof ce=="string")return parseInt(ce,8);if(z)return zt(z)}function zt(ce,z){var G=yr(ce,z);if(typeof G!="number"||isNaN(G))throw new TypeError(j.MODE_INT);return G}function Yt(ce){return ce>>>0===ce}function Zr(ce){if(!Yt(ce))throw TypeError(j.FD)}function Jr(ce){if(typeof ce=="string"&&+ce==ce)return+ce;if(ce instanceof Date)return ce.getTime()/1e3;if(isFinite(ce))return ce<0?Date.now()/1e3:ce;throw new Error("Cannot parse time: "+ce)}Ft.toUnixTimestamp=Jr;function Qr(ce){if(typeof ce!="number")throw TypeError(j.UID)}function Pf(ce){if(typeof ce!="number")throw TypeError(j.GID)}function O3(ce){var z={};function G(se,ye){for(var Ne in ye){var Be=ye[Ne],He=N(se,Ne);typeof Be=="string"?z[He]=Be:typeof Be=="object"&&Be!==null&&Object.keys(Be).length>0?G(He,Be):z[He]=null}}return G("",ce),z}var N3=(function(){function ce(z){z===void 0&&(z={}),this.ino=0,this.inodes={},this.releasedInos=[],this.fds={},this.releasedFds=[],this.maxFiles=1e4,this.openFiles=0,this.promisesApi=(0,w.default)(this),this.statWatchers={},this.props=Object.assign({Node:n.Node,Link:n.Link,File:n.File},z);var G=this.createLink();G.setNode(this.createNode(!0));var se=this;this.StatWatcher=(function(Be){r(He,Be);function He(){return Be.call(this,se)||this}return He})(NT);var ye=Ks;this.ReadStream=(function(Be){r(He,Be);function He(){for(var tt=[],ot=0;ot<arguments.length;ot++)tt[ot]=arguments[ot];return Be.apply(this,e([se],tt,!1))||this}return He})(ye);var Ne=Ji;this.WriteStream=(function(Be){r(He,Be);function He(){for(var tt=[],ot=0;ot<arguments.length;ot++)tt[ot]=arguments[ot];return Be.apply(this,e([se],tt,!1))||this}return He})(Ne),this.FSWatcher=(function(Be){r(He,Be);function He(){return Be.call(this,se)||this}return He})(LT),G.setChild(".",G),G.getNode().nlink++,G.setChild("..",G),G.getNode().nlink++,this.root=G}return ce.fromJSON=function(z,G){var se=new ce;return se.fromJSON(z,G),se},ce.fromNestedJSON=function(z,G){var se=new ce;return se.fromNestedJSON(z,G),se},Object.defineProperty(ce.prototype,"promises",{get:function(){if(this.promisesApi===null)throw new Error("Promise is not supported in this environment.");return this.promisesApi},enumerable:!1,configurable:!0}),ce.prototype.createLink=function(z,G,se,ye){if(se===void 0&&(se=!1),!z)return new this.props.Link(this,null,"");if(!G)throw new Error("createLink: name cannot be empty");return z.createChild(G,this.createNode(se,ye))},ce.prototype.deleteLink=function(z){var G=z.parent;return G?(G.deleteChild(z),!0):!1},ce.prototype.newInoNumber=function(){var z=this.releasedInos.pop();return z||(this.ino=(this.ino+1)%4294967295,this.ino)},ce.prototype.newFdNumber=function(){var z=this.releasedFds.pop();return typeof z=="number"?z:ce.fd--},ce.prototype.createNode=function(z,G){z===void 0&&(z=!1);var se=new this.props.Node(this.newInoNumber(),G);return z&&se.setIsDirectory(),this.inodes[se.ino]=se,se},ce.prototype.getNode=function(z){return this.inodes[z]},ce.prototype.deleteNode=function(z){z.del(),delete this.inodes[z.ino],this.releasedInos.push(z.ino)},ce.prototype.genRndStr=function(){var z=(Math.random()+1).toString(36).substring(2,8);return z.length===6?z:this.genRndStr()},ce.prototype.getLink=function(z){return this.root.walk(z)},ce.prototype.getLinkOrThrow=function(z,G){var se=Et(z),ye=this.getLink(se);if(!ye)throw we(B,G,z);return ye},ce.prototype.getResolvedLink=function(z){for(var G=typeof z=="string"?Et(z):z,se=this.root,ye=0;ye<G.length;){var Ne=G[ye];if(se=se.getChild(Ne),!se)return null;var Be=se.getNode();if(Be.isSymlink()){G=Be.symlink.concat(G.slice(ye+1)),se=this.root,ye=0;continue}ye++}return se},ce.prototype.getResolvedLinkOrThrow=function(z,G){var se=this.getResolvedLink(z);if(!se)throw we(B,G,z);return se},ce.prototype.resolveSymlinks=function(z){return this.getResolvedLink(z.steps.slice(1))},ce.prototype.getLinkAsDirOrThrow=function(z,G){var se=this.getLinkOrThrow(z,G);if(!se.getNode().isDirectory())throw we(oe,G,z);return se},ce.prototype.getLinkParent=function(z){return this.root.walk(z,z.length-1)},ce.prototype.getLinkParentAsDirOrThrow=function(z,G){var se=z instanceof Array?z:Et(z),ye=this.getLinkParent(se);if(!ye)throw we(B,G,ie+se.join(ie));if(!ye.getNode().isDirectory())throw we(oe,G,ie+se.join(ie));return ye},ce.prototype.getFileByFd=function(z){return this.fds[String(z)]},ce.prototype.getFileByFdOrThrow=function(z,G){if(!Yt(z))throw TypeError(j.FD);var se=this.getFileByFd(z);if(!se)throw we(Q,G);return se},ce.prototype.wrapAsync=function(z,G,se){var ye=this;Oe(se),(0,a.default)(function(){var Ne;try{Ne=z.apply(ye,G)}catch(Be){se(Be);return}se(null,Ne)})},ce.prototype._toJSON=function(z,G,se){var ye;z===void 0&&(z=this.root),G===void 0&&(G={});var Ne=!0,Be=z.children;z.getNode().isFile()&&(Be=(ye={},ye[z.getName()]=z.parent.getChild(z.getName()),ye),z=z.parent);for(var He in Be)if(!(He==="."||He==="..")){Ne=!1;var tt=z.getChild(He);if(!tt)throw new Error("_toJSON: unexpected undefined");var ot=tt.getNode();if(ot.isFile()){var yt=tt.getPath();se&&(yt=re(se,yt)),G[yt]=ot.getString()}else ot.isDirectory()&&this._toJSON(tt,G,se)}var Lt=z.getPath();return se&&(Lt=re(se,Lt)),Lt&&Ne&&(G[Lt]=null),G},ce.prototype.toJSON=function(z,G,se){G===void 0&&(G={}),se===void 0&&(se=!1);var ye=[];if(z){z instanceof Array||(z=[z]);for(var Ne=0,Be=z;Ne<Be.length;Ne++){var He=Be[Ne],tt=Ue(He),ot=this.getResolvedLink(tt);ot&&ye.push(ot)}}else ye.push(this.root);if(!ye.length)return G;for(var yt=0,Lt=ye;yt<Lt.length;yt++){var ot=Lt[yt];this._toJSON(ot,G,se?ot.getPath():"")}return G},ce.prototype.fromJSON=function(z,G){G===void 0&&(G=u.default.cwd());for(var se in z){var ye=z[se];if(se=Ze(se,G),typeof ye=="string"){var Ne=x(se);this.mkdirpBase(Ne,511),this.writeFileSync(se,ye)}else this.mkdirpBase(se,511)}},ce.prototype.fromNestedJSON=function(z,G){this.fromJSON(O3(z),G)},ce.prototype.reset=function(){this.ino=0,this.inodes={},this.releasedInos=[],this.fds={},this.releasedFds=[],this.openFiles=0,this.root=this.createLink(),this.root.setNode(this.createNode(!0))},ce.prototype.mountSync=function(z,G){this.fromJSON(G,z)},ce.prototype.openLink=function(z,G,se){if(se===void 0&&(se=!0),this.openFiles>=this.maxFiles)throw we(be,"open",z.getPath());var ye=z;if(se&&(ye=this.resolveSymlinks(z)),!ye)throw we(B,"open",z.getPath());var Ne=ye.getNode();if(Ne.isDirectory()){if((G&(_|S|E))!==_)throw we(X,"open",z.getPath())}else if(G&K)throw we(oe,"open",z.getPath());if(!(G&E)&&!Ne.canRead())throw we(xe,"open",z.getPath());var Be=new this.props.File(z,Ne,G,this.newFdNumber());return this.fds[Be.fd]=Be,this.openFiles++,G&D&&Be.truncate(),Be},ce.prototype.openFile=function(z,G,se,ye){ye===void 0&&(ye=!0);var Ne=Et(z),Be=ye?this.getResolvedLink(Ne):this.getLink(Ne);if(Be&&G&F)throw we(W,"open",z);if(!Be&&G&A){var He=this.getResolvedLink(Ne.slice(0,Ne.length-1));if(!He)throw we(B,"open",ie+Ne.join(ie));G&A&&typeof se=="number"&&(Be=this.createLink(He,Ne[Ne.length-1],!1,se))}if(Be)return this.openLink(Be,G,ye);throw we(B,"open",z)},ce.prototype.openBase=function(z,G,se,ye){ye===void 0&&(ye=!0);var Ne=this.openFile(z,G,se,ye);if(!Ne)throw we(B,"open",z);return Ne.fd},ce.prototype.openSync=function(z,G,se){se===void 0&&(se=438);var ye=zt(se),Ne=Ue(z),Be=Ae(G);return this.openBase(Ne,Be,ye)},ce.prototype.open=function(z,G,se,ye){var Ne=se,Be=ye;typeof se=="function"&&(Ne=438,Be=se),Ne=Ne||438;var He=zt(Ne),tt=Ue(z),ot=Ae(G);this.wrapAsync(this.openBase,[tt,ot,He],Be)},ce.prototype.closeFile=function(z){this.fds[z.fd]&&(this.openFiles--,delete this.fds[z.fd],this.releasedFds.push(z.fd))},ce.prototype.closeSync=function(z){Zr(z);var G=this.getFileByFdOrThrow(z,"close");this.closeFile(G)},ce.prototype.close=function(z,G){Zr(z),this.wrapAsync(this.closeSync,[z],G)},ce.prototype.openFileOrGetById=function(z,G,se){if(typeof z=="number"){var ye=this.fds[z];if(!ye)throw we(B);return ye}else return this.openFile(Ue(z),G,se)},ce.prototype.readBase=function(z,G,se,ye,Ne){var Be=this.getFileByFdOrThrow(z);return Be.read(G,Number(se),Number(ye),Ne)},ce.prototype.readSync=function(z,G,se,ye,Ne){return Zr(z),this.readBase(z,G,se,ye,Ne)},ce.prototype.read=function(z,G,se,ye,Ne,Be){var He=this;if(Oe(Be),ye===0)return u.default.nextTick(function(){Be&&Be(null,0,G)});(0,a.default)(function(){try{var tt=He.readBase(z,G,se,ye,Ne);Be(null,tt,G)}catch(ot){Be(ot)}})},ce.prototype.readFileBase=function(z,G,se){var ye,Ne=typeof z=="number",Be=Ne&&Yt(z),He;if(Be)He=z;else{var tt=Ue(z),ot=Et(tt),yt=this.getResolvedLink(ot);if(yt){var Lt=yt.getNode();if(Lt.isDirectory())throw we(X,"open",yt.getPath())}He=this.openSync(z,G)}try{ye=Ht(this.getFileByFdOrThrow(He).getBuffer(),se)}finally{Be||this.closeSync(He)}return ye},ce.prototype.readFileSync=function(z,G){var se=g(G),ye=Ae(se.flag);return this.readFileBase(z,ye,se.encoding)},ce.prototype.readFile=function(z,G,se){var ye=Ve(g)(G,se),Ne=ye[0],Be=ye[1],He=Ae(Ne.flag);this.wrapAsync(this.readFileBase,[z,He,Ne.encoding],Be)},ce.prototype.writeBase=function(z,G,se,ye,Ne){var Be=this.getFileByFdOrThrow(z,"write");return Be.write(G,se,ye,Ne)},ce.prototype.writeSync=function(z,G,se,ye,Ne){Zr(z);var Be,He,tt,ot,yt=typeof G!="string";yt?(He=(se||0)|0,tt=ye,ot=Ne):(ot=se,Be=ye);var Lt=qn(G,Be);return yt?typeof tt>"u"&&(tt=Lt.length):(He=0,tt=Lt.length),this.writeBase(z,Lt,He,tt,ot)},ce.prototype.write=function(z,G,se,ye,Ne,Be){var He=this;Zr(z);var tt,ot,yt,Lt,en,_u=typeof G,Zs=typeof se,il=typeof ye,Eu=typeof Ne;_u!=="string"?Zs==="function"?en=se:il==="function"?(tt=se|0,en=ye):Eu==="function"?(tt=se|0,ot=ye,en=Ne):(tt=se|0,ot=ye,yt=Ne,en=Be):Zs==="function"?en=se:il==="function"?(yt=se,en=ye):Eu==="function"&&(yt=se,Lt=ye,en=Ne);var jr=qn(G,Lt);_u!=="string"?typeof ot>"u"&&(ot=jr.length):(tt=0,ot=jr.length);var Qi=Oe(en);(0,a.default)(function(){try{var Ss=He.writeBase(z,jr,tt,ot,yt);_u!=="string"?Qi(null,Ss,jr):Qi(null,Ss,G)}catch(d0){Qi(d0)}})},ce.prototype.writeFileBase=function(z,G,se,ye){var Ne=typeof z=="number",Be;Ne?Be=z:Be=this.openBase(Ue(z),se,ye);var He=0,tt=G.length,ot=se&H?void 0:0;try{for(;tt>0;){var yt=this.writeSync(Be,G,He,tt,ot);He+=yt,tt-=yt,ot!==void 0&&(ot+=yt)}}finally{Ne||this.closeSync(Be)}},ce.prototype.writeFileSync=function(z,G,se){var ye=Z(se),Ne=Ae(ye.flag),Be=zt(ye.mode),He=qn(G,ye.encoding);this.writeFileBase(z,He,Ne,Be)},ce.prototype.writeFile=function(z,G,se,ye){var Ne=se,Be=ye;typeof se=="function"&&(Ne=I,Be=se);var He=Oe(Be),tt=Z(Ne),ot=Ae(tt.flag),yt=zt(tt.mode),Lt=qn(G,tt.encoding);this.wrapAsync(this.writeFileBase,[z,Lt,ot,yt],He)},ce.prototype.linkBase=function(z,G){var se=Et(z),ye=this.getLink(se);if(!ye)throw we(B,"link",z,G);var Ne=Et(G),Be=this.getLinkParent(Ne);if(!Be)throw we(B,"link",z,G);var He=Ne[Ne.length-1];if(Be.getChild(He))throw we(W,"link",z,G);var tt=ye.getNode();tt.nlink++,Be.createChild(He,tt)},ce.prototype.copyFileBase=function(z,G,se){var ye=this.readFileSync(z);if(se&k&&this.existsSync(G))throw we(W,"copyFile",z,G);if(se&$)throw we(ae,"copyFile",z,G);this.writeFileBase(G,ye,de.w,438)},ce.prototype.copyFileSync=function(z,G,se){var ye=Ue(z),Ne=Ue(G);return this.copyFileBase(ye,Ne,(se||0)|0)},ce.prototype.copyFile=function(z,G,se,ye){var Ne=Ue(z),Be=Ue(G),He,tt;typeof se=="function"?(He=0,tt=se):(He=se,tt=ye),Oe(tt),this.wrapAsync(this.copyFileBase,[Ne,Be,He],tt)},ce.prototype.linkSync=function(z,G){var se=Ue(z),ye=Ue(G);this.linkBase(se,ye)},ce.prototype.link=function(z,G,se){var ye=Ue(z),Ne=Ue(G);this.wrapAsync(this.linkBase,[ye,Ne],se)},ce.prototype.unlinkBase=function(z){var G=Et(z),se=this.getLink(G);if(!se)throw we(B,"unlink",z);if(se.length)throw Error("Dir not empty...");this.deleteLink(se);var ye=se.getNode();ye.nlink--,ye.nlink<=0&&this.deleteNode(ye)},ce.prototype.unlinkSync=function(z){var G=Ue(z);this.unlinkBase(G)},ce.prototype.unlink=function(z,G){var se=Ue(z);this.wrapAsync(this.unlinkBase,[se],G)},ce.prototype.symlinkBase=function(z,G){var se=Et(G),ye=this.getLinkParent(se);if(!ye)throw we(B,"symlink",z,G);var Ne=se[se.length-1];if(ye.getChild(Ne))throw we(W,"symlink",z,G);var Be=ye.createChild(Ne);return Be.getNode().makeSymlink(Et(z)),Be},ce.prototype.symlinkSync=function(z,G,se){var ye=Ue(z),Ne=Ue(G);this.symlinkBase(ye,Ne)},ce.prototype.symlink=function(z,G,se,ye){var Ne=Oe(typeof se=="function"?se:ye),Be=Ue(z),He=Ue(G);this.wrapAsync(this.symlinkBase,[Be,He],Ne)},ce.prototype.realpathBase=function(z,G){var se=Et(z),ye=this.getResolvedLink(se);if(!ye)throw we(B,"realpath",z);return(0,m.strToEncoding)(ye.getPath()||"/",G)},ce.prototype.realpathSync=function(z,G){return this.realpathBase(Ue(z),ve(G).encoding)},ce.prototype.realpath=function(z,G,se){var ye=Ie(G,se),Ne=ye[0],Be=ye[1],He=Ue(z);this.wrapAsync(this.realpathBase,[He,Ne.encoding],Be)},ce.prototype.lstatBase=function(z,G,se){G===void 0&&(G=!1),se===void 0&&(se=!1);var ye=this.getLink(Et(z));if(ye)return i.default.build(ye.getNode(),G);if(se)throw we(B,"lstat",z)},ce.prototype.lstatSync=function(z,G){var se=ue(G),ye=se.throwIfNoEntry,Ne=ye===void 0?!0:ye,Be=se.bigint,He=Be===void 0?!1:Be;return this.lstatBase(Ue(z),He,Ne)},ce.prototype.lstat=function(z,G,se){var ye=me(G,se),Ne=ye[0],Be=Ne.throwIfNoEntry,He=Be===void 0?!0:Be,tt=Ne.bigint,ot=tt===void 0?!1:tt,yt=ye[1];this.wrapAsync(this.lstatBase,[Ue(z),ot,He],yt)},ce.prototype.statBase=function(z,G,se){G===void 0&&(G=!1),se===void 0&&(se=!0);var ye=this.getResolvedLink(Et(z));if(ye)return i.default.build(ye.getNode(),G);if(se)throw we(B,"stat",z)},ce.prototype.statSync=function(z,G){var se=ue(G),ye=se.bigint,Ne=ye===void 0?!0:ye,Be=se.throwIfNoEntry,He=Be===void 0?!0:Be;return this.statBase(Ue(z),Ne,He)},ce.prototype.stat=function(z,G,se){var ye=me(G,se),Ne=ye[0],Be=Ne.bigint,He=Be===void 0?!1:Be,tt=Ne.throwIfNoEntry,ot=tt===void 0?!0:tt,yt=ye[1];this.wrapAsync(this.statBase,[Ue(z),He,ot],yt)},ce.prototype.fstatBase=function(z,G){G===void 0&&(G=!1);var se=this.getFileByFd(z);if(!se)throw we(Q,"fstat");return i.default.build(se.node,G)},ce.prototype.fstatSync=function(z,G){return this.fstatBase(z,ue(G).bigint)},ce.prototype.fstat=function(z,G,se){var ye=me(G,se),Ne=ye[0],Be=ye[1];this.wrapAsync(this.fstatBase,[z,Ne.bigint],Be)},ce.prototype.renameBase=function(z,G){var se=this.getLink(Et(z));if(!se)throw we(B,"rename",z,G);var ye=Et(G),Ne=this.getLinkParent(ye);if(!Ne)throw we(B,"rename",z,G);var Be=se.parent;Be&&Be.deleteChild(se);var He=ye[ye.length-1];se.name=He,se.steps=e(e([],Ne.steps,!0),[He],!1),Ne.setChild(se.getName(),se)},ce.prototype.renameSync=function(z,G){var se=Ue(z),ye=Ue(G);this.renameBase(se,ye)},ce.prototype.rename=function(z,G,se){var ye=Ue(z),Ne=Ue(G);this.wrapAsync(this.renameBase,[ye,Ne],se)},ce.prototype.existsBase=function(z){return!!this.statBase(z)},ce.prototype.existsSync=function(z){try{return this.existsBase(Ue(z))}catch{return!1}},ce.prototype.exists=function(z,G){var se=this,ye=Ue(z);if(typeof G!="function")throw Error(j.CB);(0,a.default)(function(){try{G(se.existsBase(ye))}catch{G(!1)}})},ce.prototype.accessBase=function(z,G){this.getLinkOrThrow(z,"access")},ce.prototype.accessSync=function(z,G){G===void 0&&(G=ne);var se=Ue(z);G=G|0,this.accessBase(se,G)},ce.prototype.access=function(z,G,se){var ye=ne,Ne;typeof G!="function"?(ye=G|0,Ne=Oe(se)):Ne=G;var Be=Ue(z);this.wrapAsync(this.accessBase,[Be,ye],Ne)},ce.prototype.appendFileSync=function(z,G,se){se===void 0&&(se=R);var ye=le(se);(!ye.flag||Yt(z))&&(ye.flag="a"),this.writeFileSync(z,G,ye)},ce.prototype.appendFile=function(z,G,se,ye){var Ne=pe(se,ye),Be=Ne[0],He=Ne[1];(!Be.flag||Yt(z))&&(Be.flag="a"),this.writeFile(z,G,Be,He)},ce.prototype.readdirBase=function(z,G){var se=Et(z),ye=this.getResolvedLink(se);if(!ye)throw we(B,"readdir",z);var Ne=ye.getNode();if(!Ne.isDirectory())throw we(oe,"scandir",z);if(G.withFileTypes){var Be=[];for(var He in ye.children){var tt=ye.getChild(He);!tt||He==="."||He===".."||Be.push(o.default.build(tt,G.encoding))}return!P&&G.encoding!=="buffer"&&Be.sort(function(Lt,en){return Lt.name<en.name?-1:Lt.name>en.name?1:0}),Be}var ot=[];for(var yt in ye.children)yt==="."||yt===".."||ot.push((0,m.strToEncoding)(yt,G.encoding));return!P&&G.encoding!=="buffer"&&ot.sort(),ot},ce.prototype.readdirSync=function(z,G){var se=Te(G),ye=Ue(z);return this.readdirBase(ye,se)},ce.prototype.readdir=function(z,G,se){var ye=Me(G,se),Ne=ye[0],Be=ye[1],He=Ue(z);this.wrapAsync(this.readdirBase,[He,Ne],Be)},ce.prototype.readlinkBase=function(z,G){var se=this.getLinkOrThrow(z,"readlink"),ye=se.getNode();if(!ye.isSymlink())throw we(fe,"readlink",z);var Ne=ie+ye.symlink.join(ie);return(0,m.strToEncoding)(Ne,G)},ce.prototype.readlinkSync=function(z,G){var se=et(G),ye=Ue(z);return this.readlinkBase(ye,se.encoding)},ce.prototype.readlink=function(z,G,se){var ye=T(G,se),Ne=ye[0],Be=ye[1],He=Ue(z);this.wrapAsync(this.readlinkBase,[He,Ne.encoding],Be)},ce.prototype.fsyncBase=function(z){this.getFileByFdOrThrow(z,"fsync")},ce.prototype.fsyncSync=function(z){this.fsyncBase(z)},ce.prototype.fsync=function(z,G){this.wrapAsync(this.fsyncBase,[z],G)},ce.prototype.fdatasyncBase=function(z){this.getFileByFdOrThrow(z,"fdatasync")},ce.prototype.fdatasyncSync=function(z){this.fdatasyncBase(z)},ce.prototype.fdatasync=function(z,G){this.wrapAsync(this.fdatasyncBase,[z],G)},ce.prototype.ftruncateBase=function(z,G){var se=this.getFileByFdOrThrow(z,"ftruncate");se.truncate(G)},ce.prototype.ftruncateSync=function(z,G){this.ftruncateBase(z,G)},ce.prototype.ftruncate=function(z,G,se){var ye=typeof G=="number"?G:0,Ne=Oe(typeof G=="number"?se:G);this.wrapAsync(this.ftruncateBase,[z,ye],Ne)},ce.prototype.truncateBase=function(z,G){var se=this.openSync(z,"r+");try{this.ftruncateSync(se,G)}finally{this.closeSync(se)}},ce.prototype.truncateSync=function(z,G){if(Yt(z))return this.ftruncateSync(z,G);this.truncateBase(z,G)},ce.prototype.truncate=function(z,G,se){var ye=typeof G=="number"?G:0,Ne=Oe(typeof G=="number"?se:G);if(Yt(z))return this.ftruncate(z,ye,Ne);this.wrapAsync(this.truncateBase,[z,ye],Ne)},ce.prototype.futimesBase=function(z,G,se){var ye=this.getFileByFdOrThrow(z,"futimes"),Ne=ye.node;Ne.atime=new Date(G*1e3),Ne.mtime=new Date(se*1e3)},ce.prototype.futimesSync=function(z,G,se){this.futimesBase(z,Jr(G),Jr(se))},ce.prototype.futimes=function(z,G,se,ye){this.wrapAsync(this.futimesBase,[z,Jr(G),Jr(se)],ye)},ce.prototype.utimesBase=function(z,G,se){var ye=this.openSync(z,"r");try{this.futimesBase(ye,G,se)}finally{this.closeSync(ye)}},ce.prototype.utimesSync=function(z,G,se){this.utimesBase(Ue(z),Jr(G),Jr(se))},ce.prototype.utimes=function(z,G,se,ye){this.wrapAsync(this.utimesBase,[Ue(z),Jr(G),Jr(se)],ye)},ce.prototype.mkdirBase=function(z,G){var se=Et(z);if(!se.length)throw we(W,"mkdir",z);var ye=this.getLinkParentAsDirOrThrow(z,"mkdir"),Ne=se[se.length-1];if(ye.getChild(Ne))throw we(W,"mkdir",z);ye.createChild(Ne,this.createNode(!0,G))},ce.prototype.mkdirpBase=function(z,G){for(var se=Ze(z),ye=se.substring(1),Ne=ye?ye.split(ie):[],Be=this.root,He=!1,tt=0;tt<Ne.length;tt++){var ot=Ne[tt];if(!Be.getNode().isDirectory())throw we(oe,"mkdir",Be.getPath());var yt=Be.getChild(ot);if(yt)if(yt.getNode().isDirectory())Be=yt;else throw we(oe,"mkdir",yt.getPath());else Be=Be.createChild(ot,this.createNode(!0,G)),He=!0}return He?se:void 0},ce.prototype.mkdirSync=function(z,G){var se=Fe(G),ye=zt(se.mode,511),Ne=Ue(z);if(se.recursive)return this.mkdirpBase(Ne,ye);this.mkdirBase(Ne,ye)},ce.prototype.mkdir=function(z,G,se){var ye=Fe(G),Ne=Oe(typeof G=="function"?G:se),Be=zt(ye.mode,511),He=Ue(z);ye.recursive?this.wrapAsync(this.mkdirpBase,[He,Be],Ne):this.wrapAsync(this.mkdirBase,[He,Be],Ne)},ce.prototype.mkdirpSync=function(z,G){return this.mkdirSync(z,{mode:G,recursive:!0})},ce.prototype.mkdirp=function(z,G,se){var ye=typeof G=="function"?void 0:G,Ne=Oe(typeof G=="function"?G:se);this.mkdir(z,{mode:ye,recursive:!0},Ne)},ce.prototype.mkdtempBase=function(z,G,se){se===void 0&&(se=5);var ye=z+this.genRndStr();try{return this.mkdirBase(ye,511),(0,m.strToEncoding)(ye,G)}catch(Ne){if(Ne.code===W){if(se>1)return this.mkdtempBase(z,G,se-1);throw Error("Could not create temp dir.")}else throw Ne}},ce.prototype.mkdtempSync=function(z,G){var se=et(G).encoding;if(!z||typeof z!="string")throw new TypeError("filename prefix is required");return Dr(z),this.mkdtempBase(z,se)},ce.prototype.mkdtemp=function(z,G,se){var ye=T(G,se),Ne=ye[0].encoding,Be=ye[1];if(!z||typeof z!="string")throw new TypeError("filename prefix is required");Dr(z)&&this.wrapAsync(this.mkdtempBase,[z,Ne],Be)},ce.prototype.rmdirBase=function(z,G){var se=O(G),ye=this.getLinkAsDirOrThrow(z,"rmdir");if(ye.length&&!se.recursive)throw we(M,"rmdir",z);this.deleteLink(ye)},ce.prototype.rmdirSync=function(z,G){this.rmdirBase(Ue(z),G)},ce.prototype.rmdir=function(z,G,se){var ye=O(G),Ne=Oe(typeof G=="function"?G:se);this.wrapAsync(this.rmdirBase,[Ue(z),ye],Ne)},ce.prototype.rmBase=function(z,G){G===void 0&&(G={});var se=this.getResolvedLink(z);if(!se){if(!G.force)throw we(B,"stat",z);return}if(se.getNode().isDirectory()&&!G.recursive)throw we(ge,"rm",z);this.deleteLink(se)},ce.prototype.rmSync=function(z,G){this.rmBase(Ue(z),G)},ce.prototype.rm=function(z,G,se){var ye=$e(G,se),Ne=ye[0],Be=ye[1];this.wrapAsync(this.rmBase,[Ue(z),Ne],Be)},ce.prototype.fchmodBase=function(z,G){var se=this.getFileByFdOrThrow(z,"fchmod");se.chmod(G)},ce.prototype.fchmodSync=function(z,G){this.fchmodBase(z,zt(G))},ce.prototype.fchmod=function(z,G,se){this.wrapAsync(this.fchmodBase,[z,zt(G)],se)},ce.prototype.chmodBase=function(z,G){var se=this.openSync(z,"r");try{this.fchmodBase(se,G)}finally{this.closeSync(se)}},ce.prototype.chmodSync=function(z,G){var se=zt(G),ye=Ue(z);this.chmodBase(ye,se)},ce.prototype.chmod=function(z,G,se){var ye=zt(G),Ne=Ue(z);this.wrapAsync(this.chmodBase,[Ne,ye],se)},ce.prototype.lchmodBase=function(z,G){var se=this.openBase(z,S,0,!1);try{this.fchmodBase(se,G)}finally{this.closeSync(se)}},ce.prototype.lchmodSync=function(z,G){var se=zt(G),ye=Ue(z);this.lchmodBase(ye,se)},ce.prototype.lchmod=function(z,G,se){var ye=zt(G),Ne=Ue(z);this.wrapAsync(this.lchmodBase,[Ne,ye],se)},ce.prototype.fchownBase=function(z,G,se){this.getFileByFdOrThrow(z,"fchown").chown(G,se)},ce.prototype.fchownSync=function(z,G,se){Qr(G),Pf(se),this.fchownBase(z,G,se)},ce.prototype.fchown=function(z,G,se,ye){Qr(G),Pf(se),this.wrapAsync(this.fchownBase,[z,G,se],ye)},ce.prototype.chownBase=function(z,G,se){var ye=this.getResolvedLinkOrThrow(z,"chown"),Ne=ye.getNode();Ne.chown(G,se)},ce.prototype.chownSync=function(z,G,se){Qr(G),Pf(se),this.chownBase(Ue(z),G,se)},ce.prototype.chown=function(z,G,se,ye){Qr(G),Pf(se),this.wrapAsync(this.chownBase,[Ue(z),G,se],ye)},ce.prototype.lchownBase=function(z,G,se){this.getLinkOrThrow(z,"lchown").getNode().chown(G,se)},ce.prototype.lchownSync=function(z,G,se){Qr(G),Pf(se),this.lchownBase(Ue(z),G,se)},ce.prototype.lchown=function(z,G,se,ye){Qr(G),Pf(se),this.wrapAsync(this.lchownBase,[Ue(z),G,se],ye)},ce.prototype.watchFile=function(z,G,se){var ye=Ue(z),Ne=G,Be=se;if(typeof Ne=="function"&&(Be=G,Ne=null),typeof Be!="function")throw Error('"watchFile()" requires a listener function');var He=5007,tt=!0;Ne&&typeof Ne=="object"&&(typeof Ne.interval=="number"&&(He=Ne.interval),typeof Ne.persistent=="boolean"&&(tt=Ne.persistent));var ot=this.statWatchers[ye];return ot||(ot=new this.StatWatcher,ot.start(ye,tt,He),this.statWatchers[ye]=ot),ot.addListener("change",Be),ot},ce.prototype.unwatchFile=function(z,G){var se=Ue(z),ye=this.statWatchers[se];ye&&(typeof G=="function"?ye.removeListener("change",G):ye.removeAllListeners("change"),ye.listenerCount("change")===0&&(ye.stop(),delete this.statWatchers[se]))},ce.prototype.createReadStream=function(z,G){return new this.ReadStream(z,G)},ce.prototype.createWriteStream=function(z,G){return new this.WriteStream(z,G)},ce.prototype.watch=function(z,G,se){var ye=Ue(z),Ne=G;typeof G=="function"&&(se=G,Ne=null);var Be=et(Ne),He=Be.persistent,tt=Be.recursive,ot=Be.encoding;He===void 0&&(He=!0),tt===void 0&&(tt=!1);var yt=new this.FSWatcher;return yt.start(ye,He,tt,ot),se&&yt.addListener("change",se),yt},ce.fd=2147483647,ce})();Ft.Volume=N3;function k3(ce){ce.emit("stop")}var NT=(function(ce){r(z,ce);function z(G){var se=ce.call(this)||this;return se.onInterval=function(){try{var ye=se.vol.statSync(se.filename);se.hasChanged(ye)&&(se.emit("change",ye,se.prev),se.prev=ye)}finally{se.loop()}},se.vol=G,se}return z.prototype.loop=function(){this.timeoutRef=this.setTimeout(this.onInterval,this.interval)},z.prototype.hasChanged=function(G){return G.mtimeMs>this.prev.mtimeMs||G.nlink!==this.prev.nlink},z.prototype.start=function(G,se,ye){se===void 0&&(se=!0),ye===void 0&&(ye=5007),this.filename=Ue(G),this.setTimeout=se?setTimeout.bind(typeof globalThis<"u"?globalThis:qU):c.default,this.interval=ye,this.prev=this.vol.statSync(this.filename),this.loop()},z.prototype.stop=function(){clearTimeout(this.timeoutRef),u.default.nextTick(k3,this)},z})(p.EventEmitter);Ft.StatWatcher=NT;var Zi;function L3(ce){Zi=(0,s.bufferAllocUnsafe)(ce),Zi.used=0}v.inherits(Ks,f.Readable),Ft.ReadStream=Ks;function Ks(ce,z,G){if(!(this instanceof Ks))return new Ks(ce,z,G);if(this._vol=ce,G=Object.assign({},je(G,{})),G.highWaterMark===void 0&&(G.highWaterMark=64*1024),f.Readable.call(this,G),this.path=Ue(z),this.fd=G.fd===void 0?null:G.fd,this.flags=G.flags===void 0?"r":G.flags,this.mode=G.mode===void 0?438:G.mode,this.start=G.start,this.end=G.end,this.autoClose=G.autoClose===void 0?!0:G.autoClose,this.pos=void 0,this.bytesRead=0,this.start!==void 0){if(typeof this.start!="number")throw new TypeError('"start" option must be a Number');if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw new TypeError('"end" option must be a Number');if(this.start>this.end)throw new Error('"start" option must be <= "end" option');this.pos=this.start}typeof this.fd!="number"&&this.open(),this.on("end",function(){this.autoClose&&this.destroy&&this.destroy()})}Ks.prototype.open=function(){var ce=this;this._vol.open(this.path,this.flags,this.mode,function(z,G){if(z){ce.autoClose&&ce.destroy&&ce.destroy(),ce.emit("error",z);return}ce.fd=G,ce.emit("open",G),ce.read()})},Ks.prototype._read=function(ce){if(typeof this.fd!="number")return this.once("open",function(){this._read(ce)});if(this.destroyed)return;(!Zi||Zi.length-Zi.used<C)&&L3(this._readableState.highWaterMark);var z=Zi,G=Math.min(Zi.length-Zi.used,ce),se=Zi.used;if(this.pos!==void 0&&(G=Math.min(this.end-this.pos+1,G)),G<=0)return this.push(null);var ye=this;this._vol.read(this.fd,Zi,Zi.used,G,this.pos,Ne),this.pos!==void 0&&(this.pos+=G),Zi.used+=G;function Ne(Be,He){if(Be)ye.autoClose&&ye.destroy&&ye.destroy(),ye.emit("error",Be);else{var tt=null;He>0&&(ye.bytesRead+=He,tt=z.slice(se,se+He)),ye.push(tt)}}},Ks.prototype._destroy=function(ce,z){this.close(function(G){z(ce||G)})},Ks.prototype.close=function(ce){var z=this,G;if(ce&&this.once("close",ce),this.closed||typeof this.fd!="number"){if(typeof this.fd!="number"){this.once("open",kT);return}return u.default.nextTick(function(){return z.emit("close")})}typeof((G=this._readableState)===null||G===void 0?void 0:G.closed)=="boolean"?this._readableState.closed=!0:this.closed=!0,this._vol.close(this.fd,function(se){se?z.emit("error",se):z.emit("close")}),this.fd=null};function kT(ce){this.close()}v.inherits(Ji,f.Writable),Ft.WriteStream=Ji;function Ji(ce,z,G){if(!(this instanceof Ji))return new Ji(ce,z,G);if(this._vol=ce,G=Object.assign({},je(G,{})),f.Writable.call(this,G),this.path=Ue(z),this.fd=G.fd===void 0?null:G.fd,this.flags=G.flags===void 0?"w":G.flags,this.mode=G.mode===void 0?438:G.mode,this.start=G.start,this.autoClose=G.autoClose===void 0?!0:!!G.autoClose,this.pos=void 0,this.bytesWritten=0,this.start!==void 0){if(typeof this.start!="number")throw new TypeError('"start" option must be a Number');if(this.start<0)throw new Error('"start" must be >= zero');this.pos=this.start}G.encoding&&this.setDefaultEncoding(G.encoding),typeof this.fd!="number"&&this.open(),this.once("finish",function(){this.autoClose&&this.close()})}Ji.prototype.open=function(){this._vol.open(this.path,this.flags,this.mode,function(ce,z){if(ce){this.autoClose&&this.destroy&&this.destroy(),this.emit("error",ce);return}this.fd=z,this.emit("open",z)}.bind(this))},Ji.prototype._write=function(ce,z,G){if(!(ce instanceof s.Buffer||ce instanceof Uint8Array))return this.emit("error",new Error("Invalid data"));if(typeof this.fd!="number")return this.once("open",function(){this._write(ce,z,G)});var se=this;this._vol.write(this.fd,ce,0,ce.length,this.pos,function(ye,Ne){if(ye)return se.autoClose&&se.destroy&&se.destroy(),G(ye);se.bytesWritten+=Ne,G()}),this.pos!==void 0&&(this.pos+=ce.length)},Ji.prototype._writev=function(ce,z){if(typeof this.fd!="number")return this.once("open",function(){this._writev(ce,z)});for(var G=this,se=ce.length,ye=new Array(se),Ne=0,Be=0;Be<se;Be++){var He=ce[Be].chunk;ye[Be]=He,Ne+=He.length}var tt=s.Buffer.concat(ye);this._vol.write(this.fd,tt,0,tt.length,this.pos,function(ot,yt){if(ot)return G.destroy&&G.destroy(),z(ot);G.bytesWritten+=yt,z()}),this.pos!==void 0&&(this.pos+=Ne)},Ji.prototype.close=function(ce){var z=this,G;if(ce&&this.once("close",ce),this.closed||typeof this.fd!="number"){if(typeof this.fd!="number"){this.once("open",kT);return}return u.default.nextTick(function(){return z.emit("close")})}typeof((G=this._writableState)===null||G===void 0?void 0:G.closed)=="boolean"?this._writableState.closed=!0:this.closed=!0,this._vol.close(this.fd,function(se){se?z.emit("error",se):z.emit("close")}),this.fd=null},Ji.prototype._destroy=Ks.prototype._destroy,Ji.prototype.destroySoon=Ji.prototype.end;var LT=(function(ce){r(z,ce);function z(G){var se=ce.call(this)||this;return se._filename="",se._filenameEncoded="",se._recursive=!1,se._encoding=m.ENCODING_UTF8,se._listenerRemovers=new Map,se._onParentChild=function(ye){ye.getName()===se._getName()&&se._emit("rename")},se._emit=function(ye){se.emit("change",ye,se._filenameEncoded)},se._persist=function(){se._timer=setTimeout(se._persist,1e6)},se._vol=G,se}return z.prototype._getName=function(){return this._steps[this._steps.length-1]},z.prototype.start=function(G,se,ye,Ne){var Be=this;se===void 0&&(se=!0),ye===void 0&&(ye=!1),Ne===void 0&&(Ne=m.ENCODING_UTF8),this._filename=Ue(G),this._steps=Et(this._filename),this._filenameEncoded=(0,m.strToEncoding)(this._filename),this._recursive=ye,this._encoding=Ne;try{this._link=this._vol.getLinkOrThrow(this._filename,"FSWatcher")}catch(Lt){var He=new Error("watch ".concat(this._filename," ").concat(Lt.code));throw He.code=Lt.code,He.errno=Lt.code,He}var tt=function(Lt){var en,_u=Lt.getPath(),Zs=Lt.getNode(),il=function(){var jr=re(Be._filename,_u);return jr||(jr=Be._getName()),Be.emit("change","change",jr)};Zs.on("change",il);var Eu=(en=Be._listenerRemovers.get(Zs.ino))!==null&&en!==void 0?en:[];Eu.push(function(){return Zs.removeListener("change",il)}),Be._listenerRemovers.set(Zs.ino,Eu)},ot=function(Lt){var en,_u=Lt.getNode(),Zs=function(jr){Be.emit("change","rename",re(Be._filename,jr.getPath())),setTimeout(function(){tt(jr),ot(jr)})},il=function(jr){var Qi=function(Ss){var d0=Ss.getNode().ino,PT=Be._listenerRemovers.get(d0);PT&&(PT.forEach(function(p0){return p0()}),Be._listenerRemovers.delete(d0)),Object.values(Ss.children).forEach(function(p0){p0&&Qi(p0)})};Qi(jr),Be.emit("change","rename",re(Be._filename,jr.getPath()))};Object.entries(Lt.children).forEach(function(jr){var Qi=jr[0],Ss=jr[1];Ss&&Qi!=="."&&Qi!==".."&&tt(Ss)}),Lt.on("child:add",Zs),Lt.on("child:delete",il);var Eu=(en=Be._listenerRemovers.get(_u.ino))!==null&&en!==void 0?en:[];Eu.push(function(){Lt.removeListener("child:add",Zs),Lt.removeListener("child:delete",il)}),ye&&Object.entries(Lt.children).forEach(function(jr){var Qi=jr[0],Ss=jr[1];Ss&&Qi!=="."&&Qi!==".."&&ot(Ss)})};tt(this._link),ot(this._link);var yt=this._link.parent;yt&&(yt.setMaxListeners(yt.getMaxListeners()+1),yt.on("child:delete",this._onParentChild)),se&&this._persist()},z.prototype.close=function(){clearTimeout(this._timer),this._listenerRemovers.forEach(function(se){se.forEach(function(ye){return ye()})}),this._listenerRemovers.clear();var G=this._link.parent;G&&G.removeListener("child:delete",this._onParentChild)},z})(p.EventEmitter);return Ft.FSWatcher=LT,Ft}function HU(){return qO||(qO=!0,Object.defineProperty(Zo,"__esModule",{value:!0}),Zo.fsSyncMethods=Zo.fsProps=Zo.fsAsyncMethods=void 0,Zo.fsProps=["constants","F_OK","R_OK","W_OK","X_OK","Stats"],Zo.fsSyncMethods=["renameSync","ftruncateSync","truncateSync","chownSync","fchownSync","lchownSync","chmodSync","fchmodSync","lchmodSync","statSync","lstatSync","fstatSync","linkSync","symlinkSync","readlinkSync","realpathSync","unlinkSync","rmdirSync","mkdirSync","mkdirpSync","readdirSync","closeSync","openSync","utimesSync","futimesSync","fsyncSync","writeSync","readSync","readFileSync","writeFileSync","appendFileSync","existsSync","accessSync","fdatasyncSync","mkdtempSync","copyFileSync","rmSync","createReadStream","createWriteStream"],Zo.fsAsyncMethods=["rename","ftruncate","truncate","chown","fchown","lchown","chmod","fchmod","lchmod","stat","lstat","fstat","link","symlink","readlink","realpath","unlink","rmdir","mkdir","mkdirp","readdir","close","open","utimes","futimes","fsync","write","read","readFile","writeFile","appendFile","exists","access","fdatasync","mkdtemp","copyFile","rm","watchFile","unwatchFile","watch"]),Zo}function GU(){if(HO)return dn;HO=!0;var r=dn&&dn.__assign||function(){return r=Object.assign||function(m){for(var b,v=1,w=arguments.length;v<w;v++){b=arguments[v];for(var y in b)Object.prototype.hasOwnProperty.call(b,y)&&(m[y]=b[y])}return m},r.apply(this,arguments)};Object.defineProperty(dn,"__esModule",{value:!0}),dn.fs=dn.createFsFromVolume=dn.vol=dn.Volume=void 0;var e=_2(),t=YO(),n=ZO(),i=HU(),o=i.fsSyncMethods,s=i.fsAsyncMethods,a=Wp(),u=a.constants.F_OK,c=a.constants.R_OK,f=a.constants.W_OK,h=a.constants.X_OK;dn.Volume=n.Volume,dn.vol=new n.Volume;function p(m){for(var b={F_OK:u,R_OK:c,W_OK:f,X_OK:h,constants:a.constants,Stats:e.default,Dirent:t.default},v=0,w=o;v<w.length;v++){var y=w[v];typeof m[y]=="function"&&(b[y]=m[y].bind(m))}for(var _=0,E=s;_<E.length;_++){var y=E[_];typeof m[y]=="function"&&(b[y]=m[y].bind(m))}return b.StatWatcher=m.StatWatcher,b.FSWatcher=m.FSWatcher,b.WriteStream=m.WriteStream,b.ReadStream=m.ReadStream,b.promises=m.promises,b._toUnixTimestamp=n.toUnixTimestamp,b}return dn.createFsFromVolume=p,dn.fs=p(dn.vol),dn=r(r({},dn),dn.fs),dn.semantic=!0,dn}function xi(r){throw new Error(`Node.js fs ${r} is not supported by JSPM core in the browser`)}function JO(r,e,t){let n=0,i=new TextDecoder;Jo.watch(r,"utf8",()=>{let{size:o}=Jo.fstatSync(e),s=Buffer.alloc(o-n);Jo.readSync(e,s,0,s.length,n),n=o,t(i.decode(s,{stream:!0}))})}function A2(r,e){if(r.protocol==="file:")return v2(r);if(r.protocol==="https:"||r.protocol==="http:"){let t="\\\\url\\"+r.href.replaceAll(/\//g,"\\\\");if(sb(t))return t;if(e)throw new Error(`Cannot sync request URL ${r} via FS. JSPM FS support for network URLs requires using async FS methods or priming the MemFS cache first with an async request before a sync request.`);return(async()=>{let n=await fetch(r);if(!n.ok)throw new Error(`Unable to fetch ${r.href}, ${n.status}`);let i=await n.arrayBuffer();return QO(t,Buffer.from(i)),t})()}throw new Error("URL "+r+" not supported in JSPM FS implementation.")}function YU(r){return function(e,...t){return e instanceof URL?r(A2(e,!0),...t):r(e,...t)}}function XU(r){return async function(e,...t){return e instanceof URL?r(await A2(e),...t):r(e,...t)}}function KU(r){return function(e,...t){let n=t[t.length-1];e instanceof URL&&typeof n=="function"?A2(e).then(i=>{r(i,...t)},n):r(e,...t)}}var $p,DO,rb,IO,Qf,OO,Rs,NO,sn,kO,FU,ro,LO,eh,PO,nb,MO,BO,th,FO,oi,UO,ib,jO,jU,dl,$O,zp,zO,Ft,WO,qU,Zo,qO,dn,HO,Hu,Gn,Jo,VU,br,ZU,JU,QU,ej,tj,rj,nj,ij,sj,oj,aj,lj,uj,cj,fj,hj,dj,sb,pj,gj,mj,yj,bj,wj,vj,_j,Ej,Aj,xj,Sj,Tj,Cj,Rj,Dj,Ij,Oj,Nj,kj,Lj,x2,Pj,Mj,Bj,Fj,Uj,jj,$j,zj,Wj,qj,Hj,Gj,Vj,Yj,Xj,S2,Kj,Zj,Jj,Qj,e$,t$,r$,n$,i$,s$,o$,a$,l$,u$,c$,f$,h$,d$,p$,g$,m$,y$,b$,w$,QO,v$,_$,E$,A$,x$,S$,T$,C$,R$,D$,I$,O$,N$,k$,L$,P$,M$,B$,Hp=Jt(()=>{Ce();De();Re();Bf();z_();W0();ul();qD();Wf();Mu();G0();Yf();LE();al();RO();eb();ME();jp();u2();$p={},DO=!1;rb={},IO=!1;Qf={},OO=!1;Rs={},NO=!1;sn={},kO=!1,FU=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;ro={},LO=!1;eh={},PO=!1;rn._makeLong;rn.basename;rn.delimiter;rn.dirname;rn.extname;rn.format;rn.isAbsolute;rn.join;rn.normalize;rn.parse;rn.posix;rn.relative;rn.resolve;rn.sep;rn.win32;nb={},MO=!1,BO=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;th={},FO=!1;oi={},UO=!1;ib={},jO=!1,jU=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;dl={},$O=!1;zp={},zO=!1;Ft={},WO=!1,qU=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;Zo={},qO=!1;dn={},HO=!1;Hu=GU();Hu.__esModule;Hu.fs;Hu.createFsFromVolume;Hu.vol;Hu.Volume;Hu.semantic;Gn=ZO();Gn.__esModule;Gn.FSWatcher;Gn.StatWatcher;Gn.Volume;Gn.toUnixTimestamp;Gn.bufferToEncoding;Gn.dataToBuffer;Gn.dataToStr;Gn.pathToSteps;Gn.filenameToSteps;Gn.pathToFilename;Gn.flagsToNumber;Gn.FLAGS;Gn.ReadStream;Gn.WriteStream;({vol:Jo,createFsFromVolume:VU}=Hu);Jo.fromNestedJSON({"/dev":{stdin:"",stdout:"",stderr:""},"/usr/bin":{},"/home":{},"/tmp":{}});Jo.releasedFds=[2,1,0];Jo.openSync("/dev/stdin","w");Jo.openSync("/dev/stdout","r");Jo.openSync("/dev/stderr","r");JO("/dev/stdout",1,console.log);JO("/dev/stderr",2,console.error);br=VU(Jo);br.opendir=()=>xi("opendir");br.opendirSync=()=>xi("opendirSync");br.promises.opendir=()=>xi("promises.opendir");br.cp=()=>xi("cp");br.cpSync=()=>xi("cpSync");br.promises.cp=()=>xi("promises.cp");br.readv=()=>xi("readv");br.readvSync=()=>xi("readvSync");br.rm=()=>xi("rm");br.rmSync=()=>xi("rmSync");br.promises.rm=()=>xi("promises.rm");br.Dir=()=>xi("Dir");br.promises.watch=()=>xi("promises.watch");br.FileReadStream=br.ReadStream;br.FileWriteStream=br.WriteStream;br.promises.readFile=XU(br.promises.readFile);br.readFile=KU(br.readFile);br.readFileSync=YU(br.readFileSync);({appendFile:ZU,appendFileSync:JU,access:QU,accessSync:ej,chown:tj,chownSync:rj,chmod:nj,chmodSync:ij,close:sj,closeSync:oj,copyFile:aj,copyFileSync:lj,cp:uj,cpSync:cj,createReadStream:fj,createWriteStream:hj,exists:dj,existsSync:sb,fchown:pj,fchownSync:gj,fchmod:mj,fchmodSync:yj,fdatasync:bj,fdatasyncSync:wj,fstat:vj,fstatSync:_j,fsync:Ej,fsyncSync:Aj,ftruncate:xj,ftruncateSync:Sj,futimes:Tj,futimesSync:Cj,lchown:Rj,lchownSync:Dj,lchmod:Ij,lchmodSync:Oj,link:Nj,linkSync:kj,lstat:Lj,lstatSync:x2,mkdir:Pj,mkdirSync:Mj,mkdtemp:Bj,mkdtempSync:Fj,open:Uj,openSync:jj,opendir:$j,opendirSync:zj,readdir:Wj,readdirSync:qj,read:Hj,readSync:Gj,readv:Vj,readvSync:Yj,readFile:Xj,readFileSync:S2,readlink:Kj,readlinkSync:Zj,realpath:Jj,realpathSync:Qj,rename:e$,renameSync:t$,rm:r$,rmSync:n$,rmdir:i$,rmdirSync:s$,stat:o$,statSync:a$,symlink:l$,symlinkSync:u$,truncate:c$,truncateSync:f$,unwatchFile:h$,unlink:d$,unlinkSync:p$,utimes:g$,utimesSync:m$,watch:y$,watchFile:b$,writeFile:w$,writeFileSync:QO,write:v$,writeSync:_$,writev:E$,writevSync:A$,Dir:x$,Dirent:S$,Stats:T$,ReadStream:C$,WriteStream:R$,FileReadStream:D$,FileWriteStream:I$,_toUnixTimestamp:O$,constants:{F_OK:N$,R_OK:k$,W_OK:L$,X_OK:P$},constants:M$,promises:B$}=br)});var T2=it(Vr=>{"use strict";Ce();De();Re();Object.defineProperty(Vr,"__esModule",{value:!0});Vr.readFile=Vr.writeFileSync=Vr.writeFile=Vr.read=Vr.open=Vr.close=Vr.stat=Vr.createReadStream=Vr.pathExists=void 0;var Qo=(Hp(),Ir(qp));Vr.pathExists=Qo.existsSync;Vr.createReadStream=Qo.createReadStream;async function F$(r){return new Promise((e,t)=>{Qo.stat(r,(n,i)=>{n?t(n):e(i)})})}Vr.stat=F$;async function U$(r){return new Promise((e,t)=>{Qo.close(r,n=>{n?t(n):e()})})}Vr.close=U$;async function j$(r,e){return new Promise((t,n)=>{Qo.open(r,e,(i,o)=>{i?n(i):t(o)})})}Vr.open=j$;async function $$(r,e,t,n,i){return new Promise((o,s)=>{Qo.read(r,e,t,n,i,(a,u,c)=>{a?s(a):o({bytesRead:u,buffer:c})})})}Vr.read=$$;async function z$(r,e){return new Promise((t,n)=>{Qo.writeFile(r,e,i=>{i?n(i):t()})})}Vr.writeFile=z$;function W$(r,e){Qo.writeFileSync(r,e)}Vr.writeFileSync=W$;async function q$(r){return new Promise((e,t)=>{Qo.readFile(r,(n,i)=>{n?t(n):e(i)})})}Vr.readFile=q$});var ob=it(Gu=>{"use strict";Ce();De();Re();Object.defineProperty(Gu,"__esModule",{value:!0});Gu.EndOfStreamError=Gu.defaultMessages=void 0;Gu.defaultMessages="End-Of-Stream";var C2=class extends Error{constructor(){super(Gu.defaultMessages)}};Gu.EndOfStreamError=C2});var eN=it(ab=>{"use strict";Ce();De();Re();Object.defineProperty(ab,"__esModule",{value:!0});ab.Deferred=void 0;var R2=class{constructor(){this.resolve=()=>null,this.reject=()=>null,this.promise=new Promise((e,t)=>{this.reject=t,this.resolve=e})}};ab.Deferred=R2});var rN=it(rh=>{"use strict";Ce();De();Re();Object.defineProperty(rh,"__esModule",{value:!0});rh.StreamReader=rh.EndOfStreamError=void 0;var tN=ob(),H$=eN(),G$=ob();Object.defineProperty(rh,"EndOfStreamError",{enumerable:!0,get:function(){return G$.EndOfStreamError}});var V$=1*1024*1024,D2=class{constructor(e){if(this.s=e,this.deferred=null,this.endOfStream=!1,this.peekQueue=[],!e.read||!e.once)throw new Error("Expected an instance of stream.Readable");this.s.once("end",()=>this.reject(new tN.EndOfStreamError)),this.s.once("error",t=>this.reject(t)),this.s.once("close",()=>this.reject(new Error("Stream closed")))}async peek(e,t,n){let i=await this.read(e,t,n);return this.peekQueue.push(e.subarray(t,t+i)),i}async read(e,t,n){if(n===0)return 0;if(this.peekQueue.length===0&&this.endOfStream)throw new tN.EndOfStreamError;let i=n,o=0;for(;this.peekQueue.length>0&&i>0;){let s=this.peekQueue.pop();if(!s)throw new Error("peekData should be defined");let a=Math.min(s.length,i);e.set(s.subarray(0,a),t+o),o+=a,i-=a,a<s.length&&this.peekQueue.push(s.subarray(a))}for(;i>0&&!this.endOfStream;){let s=Math.min(i,V$),a=await this.readFromStream(e,t+o,s);if(o+=a,a<s)break;i-=a}return o}async readFromStream(e,t,n){let i=this.s.read(n);if(i)return e.set(i,t),i.length;{let o={buffer:e,offset:t,length:n,deferred:new H$.Deferred};return this.deferred=o.deferred,this.s.once("readable",()=>{this.readDeferred(o)}),o.deferred.promise}}readDeferred(e){let t=this.s.read(e.length);t?(e.buffer.set(t,e.offset),e.deferred.resolve(t.length),this.deferred=null):this.s.once("readable",()=>{this.readDeferred(e)})}reject(e){this.endOfStream=!0,this.deferred&&(this.deferred.reject(e),this.deferred=null)}};rh.StreamReader=D2});var ih=it(nh=>{"use strict";Ce();De();Re();Object.defineProperty(nh,"__esModule",{value:!0});nh.StreamReader=nh.EndOfStreamError=void 0;var Y$=ob();Object.defineProperty(nh,"EndOfStreamError",{enumerable:!0,get:function(){return Y$.EndOfStreamError}});var X$=rN();Object.defineProperty(nh,"StreamReader",{enumerable:!0,get:function(){return X$.StreamReader}})});var cb=it(ub=>{"use strict";Ce();De();Re();Object.defineProperty(ub,"__esModule",{value:!0});ub.AbstractTokenizer=void 0;var lb=ih(),I2=class{constructor(e){this.position=0,this.numBuffer=new Uint8Array(8),this.fileInfo=e||{}}async readToken(e,t=this.position){let n=Buffer.alloc(e.len);if(await this.readBuffer(n,{position:t})<e.len)throw new lb.EndOfStreamError;return e.get(n,0)}async peekToken(e,t=this.position){let n=Buffer.alloc(e.len);if(await this.peekBuffer(n,{position:t})<e.len)throw new lb.EndOfStreamError;return e.get(n,0)}async readNumber(e){if(await this.readBuffer(this.numBuffer,{length:e.len})<e.len)throw new lb.EndOfStreamError;return e.get(this.numBuffer,0)}async peekNumber(e){if(await this.peekBuffer(this.numBuffer,{length:e.len})<e.len)throw new lb.EndOfStreamError;return e.get(this.numBuffer,0)}async ignore(e){if(this.fileInfo.size!==void 0){let t=this.fileInfo.size-this.position;if(e>t)return this.position+=t,t}return this.position+=e,e}async close(){}normalizeOptions(e,t){if(t&&t.position!==void 0&&t.position<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");return t?{mayBeLess:t.mayBeLess===!0,offset:t.offset?t.offset:0,length:t.length?t.length:e.length-(t.offset?t.offset:0),position:t.position?t.position:this.position}:{mayBeLess:!1,offset:0,length:e.length,position:this.position}}};ub.AbstractTokenizer=I2});var nN=it(hb=>{"use strict";Ce();De();Re();Object.defineProperty(hb,"__esModule",{value:!0});hb.ReadStreamTokenizer=void 0;var K$=cb(),fb=ih(),Z$=256e3,O2=class extends K$.AbstractTokenizer{constructor(e,t){super(t),this.streamReader=new fb.StreamReader(e)}async getFileInfo(){return this.fileInfo}async readBuffer(e,t){let n=this.normalizeOptions(e,t),i=n.position-this.position;if(i>0)return await this.ignore(i),this.readBuffer(e,t);if(i<0)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");if(n.length===0)return 0;let o=await this.streamReader.read(e,n.offset,n.length);if(this.position+=o,(!t||!t.mayBeLess)&&o<n.length)throw new fb.EndOfStreamError;return o}async peekBuffer(e,t){let n=this.normalizeOptions(e,t),i=0;if(n.position){let o=n.position-this.position;if(o>0){let s=new Uint8Array(n.length+o);return i=await this.peekBuffer(s,{mayBeLess:n.mayBeLess}),e.set(s.subarray(o),n.offset),i-o}else if(o<0)throw new Error("Cannot peek from a negative offset in a stream")}if(n.length>0){try{i=await this.streamReader.peek(e,n.offset,n.length)}catch(o){if(t&&t.mayBeLess&&o instanceof fb.EndOfStreamError)return 0;throw o}if(!n.mayBeLess&&i<n.length)throw new fb.EndOfStreamError}return i}async ignore(e){let t=Math.min(Z$,e),n=new Uint8Array(t),i=0;for(;i<e;){let o=e-i,s=await this.readBuffer(n,{length:Math.min(t,o)});if(s<0)return s;i+=s}return i}};hb.ReadStreamTokenizer=O2});var iN=it(db=>{"use strict";Ce();De();Re();Object.defineProperty(db,"__esModule",{value:!0});db.BufferTokenizer=void 0;var J$=ih(),Q$=cb(),N2=class extends Q$.AbstractTokenizer{constructor(e,t){super(t),this.uint8Array=e,this.fileInfo.size=this.fileInfo.size?this.fileInfo.size:e.length}async readBuffer(e,t){if(t&&t.position){if(t.position<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");this.position=t.position}let n=await this.peekBuffer(e,t);return this.position+=n,n}async peekBuffer(e,t){let n=this.normalizeOptions(e,t),i=Math.min(this.uint8Array.length-n.position,n.length);if(!n.mayBeLess&&i<n.length)throw new J$.EndOfStreamError;return e.set(this.uint8Array.subarray(n.position,n.position+i),n.offset),i}async close(){}};db.BufferTokenizer=N2});var pb=it(pl=>{"use strict";Ce();De();Re();Object.defineProperty(pl,"__esModule",{value:!0});pl.fromBuffer=pl.fromStream=pl.EndOfStreamError=void 0;var e9=nN(),t9=iN(),r9=ih();Object.defineProperty(pl,"EndOfStreamError",{enumerable:!0,get:function(){return r9.EndOfStreamError}});function n9(r,e){return e=e||{},new e9.ReadStreamTokenizer(r,e)}pl.fromStream=n9;function i9(r,e){return new t9.BufferTokenizer(r,e)}pl.fromBuffer=i9});var oN=it(sh=>{"use strict";Ce();De();Re();Object.defineProperty(sh,"__esModule",{value:!0});sh.fromFile=sh.FileTokenizer=void 0;var s9=cb(),sN=ih(),Gp=T2(),gb=class extends s9.AbstractTokenizer{constructor(e,t){super(t),this.fd=e}async readBuffer(e,t){let n=this.normalizeOptions(e,t);this.position=n.position;let i=await Gp.read(this.fd,e,n.offset,n.length,n.position);if(this.position+=i.bytesRead,i.bytesRead<n.length&&(!t||!t.mayBeLess))throw new sN.EndOfStreamError;return i.bytesRead}async peekBuffer(e,t){let n=this.normalizeOptions(e,t),i=await Gp.read(this.fd,e,n.offset,n.length,n.position);if(!n.mayBeLess&&i.bytesRead<n.length)throw new sN.EndOfStreamError;return i.bytesRead}async close(){return Gp.close(this.fd)}};sh.FileTokenizer=gb;async function o9(r){let e=await Gp.stat(r);if(!e.isFile)throw new Error(`File not a file: ${r}`);let t=await Gp.open(r,"r");return new gb(t,{path:r,size:e.size})}sh.fromFile=o9});var lN=it(no=>{"use strict";Ce();De();Re();Object.defineProperty(no,"__esModule",{value:!0});no.fromStream=no.fromBuffer=no.EndOfStreamError=no.fromFile=void 0;var a9=T2(),l9=pb(),u9=oN();Object.defineProperty(no,"fromFile",{enumerable:!0,get:function(){return u9.fromFile}});var aN=pb();Object.defineProperty(no,"EndOfStreamError",{enumerable:!0,get:function(){return aN.EndOfStreamError}});Object.defineProperty(no,"fromBuffer",{enumerable:!0,get:function(){return aN.fromBuffer}});async function c9(r,e){if(e=e||{},r.path){let t=await a9.stat(r.path);e.path=r.path,e.size=t.size}return l9.fromStream(r,e)}no.fromStream=c9});var uN=it(k2=>{Ce();De();Re();k2.read=function(r,e,t,n,i){var o,s,a=i*8-n-1,u=(1<<a)-1,c=u>>1,f=-7,h=t?i-1:0,p=t?-1:1,m=r[e+h];for(h+=p,o=m&(1<<-f)-1,m>>=-f,f+=a;f>0;o=o*256+r[e+h],h+=p,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=s*256+r[e+h],h+=p,f-=8);if(o===0)o=1-c;else{if(o===u)return s?NaN:(m?-1:1)*(1/0);s=s+Math.pow(2,n),o=o-c}return(m?-1:1)*s*Math.pow(2,o-n)};k2.write=function(r,e,t,n,i,o){var s,a,u,c=o*8-i-1,f=(1<<c)-1,h=f>>1,p=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:o-1,b=n?1:-1,v=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),s+h>=1?e+=p/u:e+=p*Math.pow(2,1-h),e*u>=2&&(s++,u/=2),s+h>=f?(a=0,s=f):s+h>=1?(a=(e*u-1)*Math.pow(2,i),s=s+h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;r[t+m]=a&255,m+=b,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;r[t+m]=s&255,m+=b,s/=256,c-=8);r[t+m-b]|=v*128}});var cN=it(ct=>{"use strict";Ce();De();Re();Object.defineProperty(ct,"__esModule",{value:!0});ct.AnsiStringType=ct.StringType=ct.BufferType=ct.Uint8ArrayType=ct.IgnoreType=ct.Float80_LE=ct.Float80_BE=ct.Float64_LE=ct.Float64_BE=ct.Float32_LE=ct.Float32_BE=ct.Float16_LE=ct.Float16_BE=ct.INT64_BE=ct.UINT64_BE=ct.INT64_LE=ct.UINT64_LE=ct.INT32_LE=ct.INT32_BE=ct.INT24_BE=ct.INT24_LE=ct.INT16_LE=ct.INT16_BE=ct.INT8=ct.UINT32_BE=ct.UINT32_LE=ct.UINT24_BE=ct.UINT24_LE=ct.UINT16_BE=ct.UINT16_LE=ct.UINT8=void 0;var gl=uN();function xt(r){return new DataView(r.buffer,r.byteOffset)}ct.UINT8={len:1,get(r,e){return xt(r).getUint8(e)},put(r,e,t){return xt(r).setUint8(e,t),e+1}};ct.UINT16_LE={len:2,get(r,e){return xt(r).getUint16(e,!0)},put(r,e,t){return xt(r).setUint16(e,t,!0),e+2}};ct.UINT16_BE={len:2,get(r,e){return xt(r).getUint16(e)},put(r,e,t){return xt(r).setUint16(e,t),e+2}};ct.UINT24_LE={len:3,get(r,e){let t=xt(r);return t.getUint8(e)+(t.getUint16(e+1,!0)<<8)},put(r,e,t){let n=xt(r);return n.setUint8(e,t&255),n.setUint16(e+1,t>>8,!0),e+3}};ct.UINT24_BE={len:3,get(r,e){let t=xt(r);return(t.getUint16(e)<<8)+t.getUint8(e+2)},put(r,e,t){let n=xt(r);return n.setUint16(e,t>>8),n.setUint8(e+2,t&255),e+3}};ct.UINT32_LE={len:4,get(r,e){return xt(r).getUint32(e,!0)},put(r,e,t){return xt(r).setUint32(e,t,!0),e+4}};ct.UINT32_BE={len:4,get(r,e){return xt(r).getUint32(e)},put(r,e,t){return xt(r).setUint32(e,t),e+4}};ct.INT8={len:1,get(r,e){return xt(r).getInt8(e)},put(r,e,t){return xt(r).setInt8(e,t),e+1}};ct.INT16_BE={len:2,get(r,e){return xt(r).getInt16(e)},put(r,e,t){return xt(r).setInt16(e,t),e+2}};ct.INT16_LE={len:2,get(r,e){return xt(r).getInt16(e,!0)},put(r,e,t){return xt(r).setInt16(e,t,!0),e+2}};ct.INT24_LE={len:3,get(r,e){let t=ct.UINT24_LE.get(r,e);return t>8388607?t-16777216:t},put(r,e,t){let n=xt(r);return n.setUint8(e,t&255),n.setUint16(e+1,t>>8,!0),e+3}};ct.INT24_BE={len:3,get(r,e){let t=ct.UINT24_BE.get(r,e);return t>8388607?t-16777216:t},put(r,e,t){let n=xt(r);return n.setUint16(e,t>>8),n.setUint8(e+2,t&255),e+3}};ct.INT32_BE={len:4,get(r,e){return xt(r).getInt32(e)},put(r,e,t){return xt(r).setInt32(e,t),e+4}};ct.INT32_LE={len:4,get(r,e){return xt(r).getInt32(e,!0)},put(r,e,t){return xt(r).setInt32(e,t,!0),e+4}};ct.UINT64_LE={len:8,get(r,e){return xt(r).getBigUint64(e,!0)},put(r,e,t){return xt(r).setBigUint64(e,t,!0),e+8}};ct.INT64_LE={len:8,get(r,e){return xt(r).getBigInt64(e,!0)},put(r,e,t){return xt(r).setBigInt64(e,t,!0),e+8}};ct.UINT64_BE={len:8,get(r,e){return xt(r).getBigUint64(e)},put(r,e,t){return xt(r).setBigUint64(e,t),e+8}};ct.INT64_BE={len:8,get(r,e){return xt(r).getBigInt64(e)},put(r,e,t){return xt(r).setBigInt64(e,t),e+8}};ct.Float16_BE={len:2,get(r,e){return gl.read(r,e,!1,10,this.len)},put(r,e,t){return gl.write(r,t,e,!1,10,this.len),e+this.len}};ct.Float16_LE={len:2,get(r,e){return gl.read(r,e,!0,10,this.len)},put(r,e,t){return gl.write(r,t,e,!0,10,this.len),e+this.len}};ct.Float32_BE={len:4,get(r,e){return xt(r).getFloat32(e)},put(r,e,t){return xt(r).setFloat32(e,t),e+4}};ct.Float32_LE={len:4,get(r,e){return xt(r).getFloat32(e,!0)},put(r,e,t){return xt(r).setFloat32(e,t,!0),e+4}};ct.Float64_BE={len:8,get(r,e){return xt(r).getFloat64(e)},put(r,e,t){return xt(r).setFloat64(e,t),e+8}};ct.Float64_LE={len:8,get(r,e){return xt(r).getFloat64(e,!0)},put(r,e,t){return xt(r).setFloat64(e,t,!0),e+8}};ct.Float80_BE={len:10,get(r,e){return gl.read(r,e,!1,63,this.len)},put(r,e,t){return gl.write(r,t,e,!1,63,this.len),e+this.len}};ct.Float80_LE={len:10,get(r,e){return gl.read(r,e,!0,63,this.len)},put(r,e,t){return gl.write(r,t,e,!0,63,this.len),e+this.len}};var L2=class{constructor(e){this.len=e}get(e,t){}};ct.IgnoreType=L2;var P2=class{constructor(e){this.len=e}get(e,t){return e.subarray(t,t+this.len)}};ct.Uint8ArrayType=P2;var M2=class{constructor(e){this.len=e}get(e,t){return Buffer.from(e.subarray(t,t+this.len))}};ct.BufferType=M2;var B2=class{constructor(e,t){this.len=e,this.encoding=t}get(e,t){return Buffer.from(e).toString(this.encoding,t,t+this.len)}};ct.StringType=B2;var mb=class r{constructor(e){this.len=e}static decode(e,t,n){let i="";for(let o=t;o<n;++o)i+=r.codePointToString(r.singleByteDecoder(e[o]));return i}static inRange(e,t,n){return t<=e&&e<=n}static codePointToString(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}static singleByteDecoder(e){if(r.inRange(e,0,127))return e;let t=r.windows1252[e-128];if(t===null)throw Error("invaliding encoding");return t}get(e,t=0){return r.decode(e,t,t+this.len)}};ct.AnsiStringType=mb;mb.windows1252=[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255]});var fN=it(yb=>{"use strict";Ce();De();Re();yb.stringToBytes=r=>[...r].map(e=>e.charCodeAt(0));yb.tarHeaderChecksumMatches=(r,e=0)=>{let t=parseInt(r.toString("utf8",148,154).replace(/\0.*$/,"").trim(),8);if(isNaN(t))return!1;let n=256;for(let i=e;i<e+148;i++)n+=r[i];for(let i=e+156;i<e+512;i++)n+=r[i];return t===n};yb.uint32SyncSafeToken={get:(r,e)=>r[e+3]&127|r[e+2]<<7|r[e+1]<<14|r[e]<<21,len:4}});var dN=it((QK,hN)=>{"use strict";Ce();De();Re();hN.exports={extensions:["jpg","png","apng","gif","webp","flif","xcf","cr2","cr3","orf","arw","dng","nef","rw2","raf","tif","bmp","icns","jxr","psd","indd","zip","tar","rar","gz","bz2","7z","dmg","mp4","mid","mkv","webm","mov","avi","mpg","mp2","mp3","m4a","oga","ogg","ogv","opus","flac","wav","spx","amr","pdf","epub","exe","swf","rtf","wasm","woff","woff2","eot","ttf","otf","ico","flv","ps","xz","sqlite","nes","crx","xpi","cab","deb","ar","rpm","Z","lz","cfb","mxf","mts","blend","bpg","docx","pptx","xlsx","3gp","3g2","jp2","jpm","jpx","mj2","aif","qcp","odt","ods","odp","xml","mobi","heic","cur","ktx","ape","wv","dcm","ics","glb","pcap","dsf","lnk","alias","voc","ac3","m4v","m4p","m4b","f4v","f4p","f4b","f4a","mie","asf","ogm","ogx","mpc","arrow","shp","aac","mp1","it","s3m","xm","ai","skp","avif","eps","lzh","pgp","asar","stl","chm","3mf","zst","jxl","vcf"],mimeTypes:["image/jpeg","image/png","image/gif","image/webp","image/flif","image/x-xcf","image/x-canon-cr2","image/x-canon-cr3","image/tiff","image/bmp","image/vnd.ms-photo","image/vnd.adobe.photoshop","application/x-indesign","application/epub+zip","application/x-xpinstall","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/zip","application/x-tar","application/x-rar-compressed","application/gzip","application/x-bzip2","application/x-7z-compressed","application/x-apple-diskimage","application/x-apache-arrow","video/mp4","audio/midi","video/x-matroska","video/webm","video/quicktime","video/vnd.avi","audio/vnd.wave","audio/qcelp","audio/x-ms-asf","video/x-ms-asf","application/vnd.ms-asf","video/mpeg","video/3gpp","audio/mpeg","audio/mp4","audio/opus","video/ogg","audio/ogg","application/ogg","audio/x-flac","audio/ape","audio/wavpack","audio/amr","application/pdf","application/x-msdownload","application/x-shockwave-flash","application/rtf","application/wasm","font/woff","font/woff2","application/vnd.ms-fontobject","font/ttf","font/otf","image/x-icon","video/x-flv","application/postscript","application/eps","application/x-xz","application/x-sqlite3","application/x-nintendo-nes-rom","application/x-google-chrome-extension","application/vnd.ms-cab-compressed","application/x-deb","application/x-unix-archive","application/x-rpm","application/x-compress","application/x-lzip","application/x-cfb","application/x-mie","application/mxf","video/mp2t","application/x-blender","image/bpg","image/jp2","image/jpx","image/jpm","image/mj2","audio/aiff","application/xml","application/x-mobipocket-ebook","image/heif","image/heif-sequence","image/heic","image/heic-sequence","image/icns","image/ktx","application/dicom","audio/x-musepack","text/calendar","text/vcard","model/gltf-binary","application/vnd.tcpdump.pcap","audio/x-dsf","application/x.ms.shortcut","application/x.apple.alias","audio/x-voc","audio/vnd.dolby.dd-raw","audio/x-m4a","image/apng","image/x-olympus-orf","image/x-sony-arw","image/x-adobe-dng","image/x-nikon-nef","image/x-panasonic-rw2","image/x-fujifilm-raf","video/x-m4v","video/3gpp2","application/x-esri-shape","audio/aac","audio/x-it","audio/x-s3m","audio/x-xm","video/MP1S","video/MP2P","application/vnd.sketchup.skp","image/avif","application/x-lzh-compressed","application/pgp-encrypted","application/x-asar","model/stl","application/vnd.ms-htmlhelp","model/3mf","image/jxl","application/zstd"]}});var pN=it((exports,module)=>{"use strict";Ce();De();Re();var Token=cN(),strtok3=pb(),{stringToBytes,tarHeaderChecksumMatches,uint32SyncSafeToken}=fN(),supported=dN(),minimumBytes=4100;async function fromStream(r){let e=await strtok3.fromStream(r);try{return await fromTokenizer(e)}finally{await e.close()}}async function fromBuffer(r){if(!(r instanceof Uint8Array||r instanceof ArrayBuffer||Buffer.isBuffer(r)))throw new TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`Buffer\` or \`ArrayBuffer\`, got \`${typeof r}\``);let e=r instanceof Buffer?r:Buffer.from(r);if(!(e&&e.length>1))return;let t=strtok3.fromBuffer(e);return fromTokenizer(t)}function _check(r,e,t){t={offset:0,...t};for(let[n,i]of e.entries())if(t.mask){if(i!==(t.mask[n]&r[n+t.offset]))return!1}else if(i!==r[n+t.offset])return!1;return!0}async function fromTokenizer(r){try{return _fromTokenizer(r)}catch(e){if(!(e instanceof strtok3.EndOfStreamError))throw e}}async function _fromTokenizer(r){let e=Buffer.alloc(minimumBytes),t=12,n=(o,s)=>_check(e,o,s),i=(o,s)=>n(stringToBytes(o),s);if(r.fileInfo.size||(r.fileInfo.size=Number.MAX_SAFE_INTEGER),await r.peekBuffer(e,{length:t,mayBeLess:!0}),n([66,77]))return{ext:"bmp",mime:"image/bmp"};if(n([11,119]))return{ext:"ac3",mime:"audio/vnd.dolby.dd-raw"};if(n([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(n([77,90]))return{ext:"exe",mime:"application/x-msdownload"};if(n([37,33]))return await r.peekBuffer(e,{length:24,mayBeLess:!0}),i("PS-Adobe-",{offset:2})&&i(" EPSF-",{offset:14})?{ext:"eps",mime:"application/eps"}:{ext:"ps",mime:"application/postscript"};if(n([31,160])||n([31,157]))return{ext:"Z",mime:"application/x-compress"};if(n([255,216,255]))return{ext:"jpg",mime:"image/jpeg"};if(n([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(n([31,139,8]))return{ext:"gz",mime:"application/gzip"};if(n([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(i("ID3")){await r.ignore(6);let o=await r.readToken(uint32SyncSafeToken);return r.position+o>r.fileInfo.size?{ext:"mp3",mime:"audio/mpeg"}:(await r.ignore(o),fromTokenizer(r))}if(i("MP+"))return{ext:"mpc",mime:"audio/x-musepack"};if((e[0]===67||e[0]===70)&&n([87,83],{offset:1}))return{ext:"swf",mime:"application/x-shockwave-flash"};if(n([71,73,70]))return{ext:"gif",mime:"image/gif"};if(i("FLIF"))return{ext:"flif",mime:"image/flif"};if(i("8BPS"))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(i("WEBP",{offset:8}))return{ext:"webp",mime:"image/webp"};if(i("MPCK"))return{ext:"mpc",mime:"audio/x-musepack"};if(i("FORM"))return{ext:"aif",mime:"audio/aiff"};if(i("icns",{offset:0}))return{ext:"icns",mime:"image/icns"};if(n([80,75,3,4])){try{for(;r.position+30<r.fileInfo.size;){await r.readBuffer(e,{length:30});let o={compressedSize:e.readUInt32LE(18),uncompressedSize:e.readUInt32LE(22),filenameLength:e.readUInt16LE(26),extraFieldLength:e.readUInt16LE(28)};if(o.filename=await r.readToken(new Token.StringType(o.filenameLength,"utf-8")),await r.ignore(o.extraFieldLength),o.filename==="META-INF/mozilla.rsa")return{ext:"xpi",mime:"application/x-xpinstall"};if(o.filename.endsWith(".rels")||o.filename.endsWith(".xml"))switch(o.filename.split("/")[0]){case"_rels":break;case"word":return{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"};case"ppt":return{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"};case"xl":return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};default:break}if(o.filename.startsWith("xl/"))return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};if(o.filename.startsWith("3D/")&&o.filename.endsWith(".model"))return{ext:"3mf",mime:"model/3mf"};if(o.filename==="mimetype"&&o.compressedSize===o.uncompressedSize)switch(await r.readToken(new Token.StringType(o.compressedSize,"utf-8"))){case"application/epub+zip":return{ext:"epub",mime:"application/epub+zip"};case"application/vnd.oasis.opendocument.text":return{ext:"odt",mime:"application/vnd.oasis.opendocument.text"};case"application/vnd.oasis.opendocument.spreadsheet":return{ext:"ods",mime:"application/vnd.oasis.opendocument.spreadsheet"};case"application/vnd.oasis.opendocument.presentation":return{ext:"odp",mime:"application/vnd.oasis.opendocument.presentation"};default:}if(o.compressedSize===0){let s=-1;for(;s<0&&r.position<r.fileInfo.size;)await r.peekBuffer(e,{mayBeLess:!0}),s=e.indexOf("504B0304",0,"hex"),await r.ignore(s>=0?s:e.length)}else await r.ignore(o.compressedSize)}}catch(o){if(!(o instanceof strtok3.EndOfStreamError))throw o}return{ext:"zip",mime:"application/zip"}}if(i("OggS")){await r.ignore(28);let o=Buffer.alloc(8);return await r.readBuffer(o),_check(o,[79,112,117,115,72,101,97,100])?{ext:"opus",mime:"audio/opus"}:_check(o,[128,116,104,101,111,114,97])?{ext:"ogv",mime:"video/ogg"}:_check(o,[1,118,105,100,101,111,0])?{ext:"ogm",mime:"video/ogg"}:_check(o,[127,70,76,65,67])?{ext:"oga",mime:"audio/ogg"}:_check(o,[83,112,101,101,120,32,32])?{ext:"spx",mime:"audio/ogg"}:_check(o,[1,118,111,114,98,105,115])?{ext:"ogg",mime:"audio/ogg"}:{ext:"ogx",mime:"application/ogg"}}if(n([80,75])&&(e[2]===3||e[2]===5||e[2]===7)&&(e[3]===4||e[3]===6||e[3]===8))return{ext:"zip",mime:"application/zip"};if(i("ftyp",{offset:4})&&(e[8]&96)!==0){let o=e.toString("binary",8,12).replace("\0"," ").trim();switch(o){case"avif":return{ext:"avif",mime:"image/avif"};case"mif1":return{ext:"heic",mime:"image/heif"};case"msf1":return{ext:"heic",mime:"image/heif-sequence"};case"heic":case"heix":return{ext:"heic",mime:"image/heic"};case"hevc":case"hevx":return{ext:"heic",mime:"image/heic-sequence"};case"qt":return{ext:"mov",mime:"video/quicktime"};case"M4V":case"M4VH":case"M4VP":return{ext:"m4v",mime:"video/x-m4v"};case"M4P":return{ext:"m4p",mime:"video/mp4"};case"M4B":return{ext:"m4b",mime:"audio/mp4"};case"M4A":return{ext:"m4a",mime:"audio/x-m4a"};case"F4V":return{ext:"f4v",mime:"video/mp4"};case"F4P":return{ext:"f4p",mime:"video/mp4"};case"F4A":return{ext:"f4a",mime:"audio/mp4"};case"F4B":return{ext:"f4b",mime:"audio/mp4"};case"crx":return{ext:"cr3",mime:"image/x-canon-cr3"};default:return o.startsWith("3g")?o.startsWith("3g2")?{ext:"3g2",mime:"video/3gpp2"}:{ext:"3gp",mime:"video/3gpp"}:{ext:"mp4",mime:"video/mp4"}}}if(i("MThd"))return{ext:"mid",mime:"audio/midi"};if(i("wOFF")&&(n([0,1,0,0],{offset:4})||i("OTTO",{offset:4})))return{ext:"woff",mime:"font/woff"};if(i("wOF2")&&(n([0,1,0,0],{offset:4})||i("OTTO",{offset:4})))return{ext:"woff2",mime:"font/woff2"};if(n([212,195,178,161])||n([161,178,195,212]))return{ext:"pcap",mime:"application/vnd.tcpdump.pcap"};if(i("DSD "))return{ext:"dsf",mime:"audio/x-dsf"};if(i("LZIP"))return{ext:"lz",mime:"application/x-lzip"};if(i("fLaC"))return{ext:"flac",mime:"audio/x-flac"};if(n([66,80,71,251]))return{ext:"bpg",mime:"image/bpg"};if(i("wvpk"))return{ext:"wv",mime:"audio/wavpack"};if(i("%PDF")){await r.ignore(1350);let o=10*1024*1024,s=Buffer.alloc(Math.min(o,r.fileInfo.size));return await r.readBuffer(s,{mayBeLess:!0}),s.includes(Buffer.from("AIPrivateData"))?{ext:"ai",mime:"application/postscript"}:{ext:"pdf",mime:"application/pdf"}}if(n([0,97,115,109]))return{ext:"wasm",mime:"application/wasm"};if(n([73,73,42,0]))return i("CR",{offset:8})?{ext:"cr2",mime:"image/x-canon-cr2"}:n([28,0,254,0],{offset:8})||n([31,0,11,0],{offset:8})?{ext:"nef",mime:"image/x-nikon-nef"}:n([8,0,0,0],{offset:4})&&(n([45,0,254,0],{offset:8})||n([39,0,254,0],{offset:8}))?{ext:"dng",mime:"image/x-adobe-dng"}:(e=Buffer.alloc(24),await r.peekBuffer(e),(n([16,251,134,1],{offset:4})||n([8,0,0,0],{offset:4}))&&n([0,254,0,4,0,1,0,0,0,1,0,0,0,3,1],{offset:9})?{ext:"arw",mime:"image/x-sony-arw"}:{ext:"tif",mime:"image/tiff"});if(n([77,77,0,42]))return{ext:"tif",mime:"image/tiff"};if(i("MAC "))return{ext:"ape",mime:"audio/ape"};if(n([26,69,223,163])){async function o(){let f=await r.peekNumber(Token.UINT8),h=128,p=0;for(;(f&h)===0&&h!==0;)++p,h>>=1;let m=Buffer.alloc(p+1);return await r.readBuffer(m),m}async function s(){let f=await o(),h=await o();h[0]^=128>>h.length-1;let p=Math.min(6,h.length);return{id:f.readUIntBE(0,f.length),len:h.readUIntBE(h.length-p,p)}}async function a(f,h){for(;h>0;){let p=await s();if(p.id===17026)return r.readToken(new Token.StringType(p.len,"utf-8"));await r.ignore(p.len),--h}}let u=await s();switch(await a(1,u.len)){case"webm":return{ext:"webm",mime:"video/webm"};case"matroska":return{ext:"mkv",mime:"video/x-matroska"};default:return}}if(n([82,73,70,70])){if(n([65,86,73],{offset:8}))return{ext:"avi",mime:"video/vnd.avi"};if(n([87,65,86,69],{offset:8}))return{ext:"wav",mime:"audio/vnd.wave"};if(n([81,76,67,77],{offset:8}))return{ext:"qcp",mime:"audio/qcelp"}}if(i("SQLi"))return{ext:"sqlite",mime:"application/x-sqlite3"};if(n([78,69,83,26]))return{ext:"nes",mime:"application/x-nintendo-nes-rom"};if(i("Cr24"))return{ext:"crx",mime:"application/x-google-chrome-extension"};if(i("MSCF")||i("ISc("))return{ext:"cab",mime:"application/vnd.ms-cab-compressed"};if(n([237,171,238,219]))return{ext:"rpm",mime:"application/x-rpm"};if(n([197,208,211,198]))return{ext:"eps",mime:"application/eps"};if(n([40,181,47,253]))return{ext:"zst",mime:"application/zstd"};if(n([79,84,84,79,0]))return{ext:"otf",mime:"font/otf"};if(i("#!AMR"))return{ext:"amr",mime:"audio/amr"};if(i("{\\rtf"))return{ext:"rtf",mime:"application/rtf"};if(n([70,76,86,1]))return{ext:"flv",mime:"video/x-flv"};if(i("IMPM"))return{ext:"it",mime:"audio/x-it"};if(i("-lh0-",{offset:2})||i("-lh1-",{offset:2})||i("-lh2-",{offset:2})||i("-lh3-",{offset:2})||i("-lh4-",{offset:2})||i("-lh5-",{offset:2})||i("-lh6-",{offset:2})||i("-lh7-",{offset:2})||i("-lzs-",{offset:2})||i("-lz4-",{offset:2})||i("-lz5-",{offset:2})||i("-lhd-",{offset:2}))return{ext:"lzh",mime:"application/x-lzh-compressed"};if(n([0,0,1,186])){if(n([33],{offset:4,mask:[241]}))return{ext:"mpg",mime:"video/MP1S"};if(n([68],{offset:4,mask:[196]}))return{ext:"mpg",mime:"video/MP2P"}}if(i("ITSF"))return{ext:"chm",mime:"application/vnd.ms-htmlhelp"};if(n([253,55,122,88,90,0]))return{ext:"xz",mime:"application/x-xz"};if(i("<?xml "))return{ext:"xml",mime:"application/xml"};if(n([55,122,188,175,39,28]))return{ext:"7z",mime:"application/x-7z-compressed"};if(n([82,97,114,33,26,7])&&(e[6]===0||e[6]===1))return{ext:"rar",mime:"application/x-rar-compressed"};if(i("solid "))return{ext:"stl",mime:"model/stl"};if(i("BLENDER"))return{ext:"blend",mime:"application/x-blender"};if(i("!<arch>"))return await r.ignore(8),await r.readToken(new Token.StringType(13,"ascii"))==="debian-binary"?{ext:"deb",mime:"application/x-deb"}:{ext:"ar",mime:"application/x-unix-archive"};if(n([137,80,78,71,13,10,26,10])){await r.ignore(8);async function o(){return{length:await r.readToken(Token.INT32_BE),type:await r.readToken(new Token.StringType(4,"binary"))}}do{let s=await o();if(s.length<0)return;switch(s.type){case"IDAT":return{ext:"png",mime:"image/png"};case"acTL":return{ext:"apng",mime:"image/apng"};default:await r.ignore(s.length+4)}}while(r.position+8<r.fileInfo.size);return{ext:"png",mime:"image/png"}}if(n([65,82,82,79,87,49,0,0]))return{ext:"arrow",mime:"application/x-apache-arrow"};if(n([103,108,84,70,2,0,0,0]))return{ext:"glb",mime:"model/gltf-binary"};if(n([102,114,101,101],{offset:4})||n([109,100,97,116],{offset:4})||n([109,111,111,118],{offset:4})||n([119,105,100,101],{offset:4}))return{ext:"mov",mime:"video/quicktime"};if(n([73,73,82,79,8,0,0,0,24]))return{ext:"orf",mime:"image/x-olympus-orf"};if(i("gimp xcf "))return{ext:"xcf",mime:"image/x-xcf"};if(n([73,73,85,0,24,0,0,0,136,231,116,216]))return{ext:"rw2",mime:"image/x-panasonic-rw2"};if(n([48,38,178,117,142,102,207,17,166,217])){async function o(){let s=Buffer.alloc(16);return await r.readBuffer(s),{id:s,size:Number(await r.readToken(Token.UINT64_LE))}}for(await r.ignore(30);r.position+24<r.fileInfo.size;){let s=await o(),a=s.size-24;if(_check(s.id,[145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101])){let u=Buffer.alloc(16);if(a-=await r.readBuffer(u),_check(u,[64,158,105,248,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"audio/x-ms-asf"};if(_check(u,[192,239,25,188,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"video/x-ms-asf"};break}await r.ignore(a)}return{ext:"asf",mime:"application/vnd.ms-asf"}}if(n([171,75,84,88,32,49,49,187,13,10,26,10]))return{ext:"ktx",mime:"image/ktx"};if((n([126,16,4])||n([126,24,4]))&&n([48,77,73,69],{offset:4}))return{ext:"mie",mime:"application/x-mie"};if(n([39,10,0,0,0,0,0,0,0,0,0,0],{offset:2}))return{ext:"shp",mime:"application/x-esri-shape"};if(n([0,0,0,12,106,80,32,32,13,10,135,10]))switch(await r.ignore(20),await r.readToken(new Token.StringType(4,"ascii"))){case"jp2 ":return{ext:"jp2",mime:"image/jp2"};case"jpx ":return{ext:"jpx",mime:"image/jpx"};case"jpm ":return{ext:"jpm",mime:"image/jpm"};case"mjp2":return{ext:"mj2",mime:"image/mj2"};default:return}if(n([255,10])||n([0,0,0,12,74,88,76,32,13,10,135,10]))return{ext:"jxl",mime:"image/jxl"};if(n([0,0,1,186])||n([0,0,1,179]))return{ext:"mpg",mime:"video/mpeg"};if(n([0,1,0,0,0]))return{ext:"ttf",mime:"font/ttf"};if(n([0,0,1,0]))return{ext:"ico",mime:"image/x-icon"};if(n([0,0,2,0]))return{ext:"cur",mime:"image/x-icon"};if(n([208,207,17,224,161,177,26,225]))return{ext:"cfb",mime:"application/x-cfb"};if(await r.peekBuffer(e,{length:Math.min(256,r.fileInfo.size),mayBeLess:!0}),i("BEGIN:")){if(i("VCARD",{offset:6}))return{ext:"vcf",mime:"text/vcard"};if(i("VCALENDAR",{offset:6}))return{ext:"ics",mime:"text/calendar"}}if(i("FUJIFILMCCD-RAW"))return{ext:"raf",mime:"image/x-fujifilm-raf"};if(i("Extended Module:"))return{ext:"xm",mime:"audio/x-xm"};if(i("Creative Voice File"))return{ext:"voc",mime:"audio/x-voc"};if(n([4,0,0,0])&&e.length>=16){let o=e.readUInt32LE(12);if(o>12&&e.length>=o+16)try{let s=e.slice(16,o+16).toString();if(JSON.parse(s).files)return{ext:"asar",mime:"application/x-asar"}}catch{}}if(n([6,14,43,52,2,5,1,1,13,1,2,1,1,2]))return{ext:"mxf",mime:"application/mxf"};if(i("SCRM",{offset:44}))return{ext:"s3m",mime:"audio/x-s3m"};if(n([71],{offset:4})&&(n([71],{offset:192})||n([71],{offset:196})))return{ext:"mts",mime:"video/mp2t"};if(n([66,79,79,75,77,79,66,73],{offset:60}))return{ext:"mobi",mime:"application/x-mobipocket-ebook"};if(n([68,73,67,77],{offset:128}))return{ext:"dcm",mime:"application/dicom"};if(n([76,0,0,0,1,20,2,0,0,0,0,0,192,0,0,0,0,0,0,70]))return{ext:"lnk",mime:"application/x.ms.shortcut"};if(n([98,111,111,107,0,0,0,0,109,97,114,107,0,0,0,0]))return{ext:"alias",mime:"application/x.apple.alias"};if(n([76,80],{offset:34})&&(n([0,0,1],{offset:8})||n([1,0,2],{offset:8})||n([2,0,2],{offset:8})))return{ext:"eot",mime:"application/vnd.ms-fontobject"};if(n([6,6,237,245,216,29,70,229,189,49,239,231,254,116,183,29]))return{ext:"indd",mime:"application/x-indesign"};if(await r.peekBuffer(e,{length:Math.min(512,r.fileInfo.size),mayBeLess:!0}),tarHeaderChecksumMatches(e))return{ext:"tar",mime:"application/x-tar"};if(n([255,254,255,14,83,0,107,0,101,0,116,0,99,0,104,0,85,0,112,0,32,0,77,0,111,0,100,0,101,0,108,0]))return{ext:"skp",mime:"application/vnd.sketchup.skp"};if(i("-----BEGIN PGP MESSAGE-----"))return{ext:"pgp",mime:"application/pgp-encrypted"};if(e.length>=2&&n([255,224],{offset:0,mask:[255,224]})){if(n([16],{offset:1,mask:[22]}))return n([8],{offset:1,mask:[8]})?{ext:"aac",mime:"audio/aac"}:{ext:"aac",mime:"audio/aac"};if(n([2],{offset:1,mask:[6]}))return{ext:"mp3",mime:"audio/mpeg"};if(n([4],{offset:1,mask:[6]}))return{ext:"mp2",mime:"audio/mpeg"};if(n([6],{offset:1,mask:[6]}))return{ext:"mp1",mime:"audio/mpeg"}}}var stream=readableStream=>new Promise((resolve,reject)=>{let stream=eval("require")("stream");readableStream.on("error",reject),readableStream.once("readable",async()=>{let r=new stream.PassThrough,e;stream.pipeline?e=stream.pipeline(readableStream,r,()=>{}):e=readableStream.pipe(r);let t=readableStream.read(minimumBytes)||readableStream.read()||Buffer.alloc(0);try{let n=await fromBuffer(t);r.fileType=n}catch(n){reject(n)}resolve(e)})}),fileType={fromStream,fromTokenizer,fromBuffer,stream};Object.defineProperty(fileType,"extensions",{get(){return new Set(supported.extensions)}});Object.defineProperty(fileType,"mimeTypes",{get(){return new Set(supported.mimeTypes)}});module.exports=fileType});var mN=it((oZ,gN)=>{"use strict";Ce();De();Re();var f9=lN(),bb=pN();async function h9(r){let e=await f9.fromFile(r);try{return await bb.fromTokenizer(e)}finally{await e.close()}}var wb={fromFile:h9};Object.assign(wb,bb);Object.defineProperty(wb,"extensions",{get(){return bb.extensions}});Object.defineProperty(wb,"mimeTypes",{get(){return bb.mimeTypes}});gN.exports=wb});var Vp=it(oh=>{"use strict";Ce();De();Re();function d9(r,e,t){if(t===void 0&&(t=Array.prototype),r&&typeof t.find=="function")return t.find.call(r,e);for(var n=0;n<r.length;n++)if(Object.prototype.hasOwnProperty.call(r,n)){var i=r[n];if(e.call(void 0,i,n,r))return i}}function F2(r,e){return e===void 0&&(e=Object),e&&typeof e.freeze=="function"?e.freeze(r):r}function p9(r,e){if(r===null||typeof r!="object")throw new TypeError("target is not an object");for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t]);return r}var yN=F2({HTML:"text/html",isHTML:function(r){return r===yN.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),bN=F2({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(r){return r===bN.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});oh.assign=p9;oh.find=d9;oh.freeze=F2;oh.MIME_TYPE=yN;oh.NAMESPACE=bN});var X2=it(ml=>{Ce();De();Re();var TN=Vp(),io=TN.find,Yp=TN.NAMESPACE;function g9(r){return r!==""}function m9(r){return r?r.split(/[\t\n\f\r ]+/).filter(g9):[]}function y9(r,e){return r.hasOwnProperty(e)||(r[e]=!0),r}function wN(r){if(!r)return[];var e=m9(r);return Object.keys(e.reduce(y9,{}))}function b9(r){return function(e){return r&&r.indexOf(e)!==-1}}function Kp(r,e){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}function li(r,e){var t=r.prototype;if(!(t instanceof e)){let i=function(){};var n=i;i.prototype=e.prototype,i=new i,Kp(t,i),r.prototype=t=i}t.constructor!=r&&(typeof r!="function"&&console.error("unknown Class:"+r),t.constructor=r)}var ui={},Ds=ui.ELEMENT_NODE=1,lh=ui.ATTRIBUTE_NODE=2,vb=ui.TEXT_NODE=3,CN=ui.CDATA_SECTION_NODE=4,RN=ui.ENTITY_REFERENCE_NODE=5,w9=ui.ENTITY_NODE=6,DN=ui.PROCESSING_INSTRUCTION_NODE=7,IN=ui.COMMENT_NODE=8,ON=ui.DOCUMENT_NODE=9,NN=ui.DOCUMENT_TYPE_NODE=10,ta=ui.DOCUMENT_FRAGMENT_NODE=11,v9=ui.NOTATION_NODE=12,Ln={},pn={},pZ=Ln.INDEX_SIZE_ERR=(pn[1]="Index size error",1),gZ=Ln.DOMSTRING_SIZE_ERR=(pn[2]="DOMString size error",2),ai=Ln.HIERARCHY_REQUEST_ERR=(pn[3]="Hierarchy request error",3),mZ=Ln.WRONG_DOCUMENT_ERR=(pn[4]="Wrong document",4),yZ=Ln.INVALID_CHARACTER_ERR=(pn[5]="Invalid character",5),bZ=Ln.NO_DATA_ALLOWED_ERR=(pn[6]="No data allowed",6),wZ=Ln.NO_MODIFICATION_ALLOWED_ERR=(pn[7]="No modification allowed",7),kN=Ln.NOT_FOUND_ERR=(pn[8]="Not found",8),vZ=Ln.NOT_SUPPORTED_ERR=(pn[9]="Not supported",9),vN=Ln.INUSE_ATTRIBUTE_ERR=(pn[10]="Attribute in use",10),_Z=Ln.INVALID_STATE_ERR=(pn[11]="Invalid state",11),EZ=Ln.SYNTAX_ERR=(pn[12]="Syntax error",12),AZ=Ln.INVALID_MODIFICATION_ERR=(pn[13]="Invalid modification",13),xZ=Ln.NAMESPACE_ERR=(pn[14]="Invalid namespace",14),SZ=Ln.INVALID_ACCESS_ERR=(pn[15]="Invalid access",15);function Wr(r,e){if(e instanceof Error)var t=e;else t=this,Error.call(this,pn[r]),this.message=pn[r],Error.captureStackTrace&&Error.captureStackTrace(this,Wr);return t.code=r,e&&(this.message=this.message+": "+e),t}Wr.prototype=Error.prototype;Kp(Ln,Wr);function ea(){}ea.prototype={length:0,item:function(r){return r>=0&&r<this.length?this[r]:null},toString:function(r,e){for(var t=[],n=0;n<this.length;n++)ah(this[n],t,r,e);return t.join("")},filter:function(r){return Array.prototype.filter.call(this,r)},indexOf:function(r){return Array.prototype.indexOf.call(this,r)}};function uh(r,e){this._node=r,this._refresh=e,$2(this)}function $2(r){var e=r._node._inc||r._node.ownerDocument._inc;if(r._inc!==e){var t=r._refresh(r._node);if(HN(r,"length",t.length),!r.$$length||t.length<r.$$length)for(var n=t.length;n in r;n++)Object.prototype.hasOwnProperty.call(r,n)&&delete r[n];Kp(t,r),r._inc=e}}uh.prototype.item=function(r){return $2(this),this[r]||null};li(uh,ea);function _b(){}function LN(r,e){for(var t=r.length;t--;)if(r[t]===e)return t}function _N(r,e,t,n){if(n?e[LN(e,n)]=t:e[e.length++]=t,r){t.ownerElement=r;var i=r.ownerDocument;i&&(n&&BN(i,r,n),_9(i,r,t))}}function EN(r,e,t){var n=LN(e,t);if(n>=0){for(var i=e.length-1;n<i;)e[n]=e[++n];if(e.length=i,r){var o=r.ownerDocument;o&&(BN(o,r,t),t.ownerElement=null)}}else throw new Wr(kN,new Error(r.tagName+"@"+t))}_b.prototype={length:0,item:ea.prototype.item,getNamedItem:function(r){for(var e=this.length;e--;){var t=this[e];if(t.nodeName==r)return t}},setNamedItem:function(r){var e=r.ownerElement;if(e&&e!=this._ownerElement)throw new Wr(vN);var t=this.getNamedItem(r.nodeName);return _N(this._ownerElement,this,r,t),t},setNamedItemNS:function(r){var e=r.ownerElement,t;if(e&&e!=this._ownerElement)throw new Wr(vN);return t=this.getNamedItemNS(r.namespaceURI,r.localName),_N(this._ownerElement,this,r,t),t},removeNamedItem:function(r){var e=this.getNamedItem(r);return EN(this._ownerElement,this,e),e},removeNamedItemNS:function(r,e){var t=this.getNamedItemNS(r,e);return EN(this._ownerElement,this,t),t},getNamedItemNS:function(r,e){for(var t=this.length;t--;){var n=this[t];if(n.localName==e&&n.namespaceURI==r)return n}return null}};function PN(){}PN.prototype={hasFeature:function(r,e){return!0},createDocument:function(r,e,t){var n=new Zp;if(n.implementation=this,n.childNodes=new ea,n.doctype=t||null,t&&n.appendChild(t),e){var i=n.createElementNS(r,e);n.appendChild(i)}return n},createDocumentType:function(r,e,t){var n=new xb;return n.name=r,n.nodeName=r,n.publicId=e||"",n.systemId=t||"",n}};function Xt(){}Xt.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(r,e){return Eb(this,r,e)},replaceChild:function(r,e){Eb(this,r,e,UN),e&&this.removeChild(e)},removeChild:function(r){return FN(this,r)},appendChild:function(r){return this.insertBefore(r,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(r){return j2(this.ownerDocument||this,this,r)},normalize:function(){for(var r=this.firstChild;r;){var e=r.nextSibling;e&&e.nodeType==vb&&r.nodeType==vb?(this.removeChild(e),r.appendData(e.data)):(r.normalize(),r=e)}},isSupported:function(r,e){return this.ownerDocument.implementation.hasFeature(r,e)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(r){for(var e=this;e;){var t=e._nsMap;if(t){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&t[n]===r)return n}e=e.nodeType==lh?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(r){for(var e=this;e;){var t=e._nsMap;if(t&&Object.prototype.hasOwnProperty.call(t,r))return t[r];e=e.nodeType==lh?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(r){var e=this.lookupPrefix(r);return e==null}};function MN(r){return r=="<"&&"&lt;"||r==">"&&"&gt;"||r=="&"&&"&amp;"||r=='"'&&"&quot;"||"&#"+r.charCodeAt()+";"}Kp(ui,Xt);Kp(ui,Xt.prototype);function Xp(r,e){if(e(r))return!0;if(r=r.firstChild)do if(Xp(r,e))return!0;while(r=r.nextSibling)}function Zp(){this.ownerDocument=this}function _9(r,e,t){r&&r._inc++;var n=t.namespaceURI;n===Yp.XMLNS&&(e._nsMap[t.prefix?t.localName:""]=t.value)}function BN(r,e,t,n){r&&r._inc++;var i=t.namespaceURI;i===Yp.XMLNS&&delete e._nsMap[t.prefix?t.localName:""]}function z2(r,e,t){if(r&&r._inc){r._inc++;var n=e.childNodes;if(t)n[n.length++]=t;else{for(var i=e.firstChild,o=0;i;)n[o++]=i,i=i.nextSibling;n.length=o,delete n[n.length]}}}function FN(r,e){var t=e.previousSibling,n=e.nextSibling;return t?t.nextSibling=n:r.firstChild=n,n?n.previousSibling=t:r.lastChild=t,e.parentNode=null,e.previousSibling=null,e.nextSibling=null,z2(r.ownerDocument,r),e}function E9(r){return r&&(r.nodeType===Xt.DOCUMENT_NODE||r.nodeType===Xt.DOCUMENT_FRAGMENT_NODE||r.nodeType===Xt.ELEMENT_NODE)}function A9(r){return r&&(so(r)||W2(r)||ra(r)||r.nodeType===Xt.DOCUMENT_FRAGMENT_NODE||r.nodeType===Xt.COMMENT_NODE||r.nodeType===Xt.PROCESSING_INSTRUCTION_NODE)}function ra(r){return r&&r.nodeType===Xt.DOCUMENT_TYPE_NODE}function so(r){return r&&r.nodeType===Xt.ELEMENT_NODE}function W2(r){return r&&r.nodeType===Xt.TEXT_NODE}function AN(r,e){var t=r.childNodes||[];if(io(t,so)||ra(e))return!1;var n=io(t,ra);return!(e&&n&&t.indexOf(n)>t.indexOf(e))}function xN(r,e){var t=r.childNodes||[];function n(o){return so(o)&&o!==e}if(io(t,n))return!1;var i=io(t,ra);return!(e&&i&&t.indexOf(i)>t.indexOf(e))}function x9(r,e,t){if(!E9(r))throw new Wr(ai,"Unexpected parent node type "+r.nodeType);if(t&&t.parentNode!==r)throw new Wr(kN,"child not in parent");if(!A9(e)||ra(e)&&r.nodeType!==Xt.DOCUMENT_NODE)throw new Wr(ai,"Unexpected node type "+e.nodeType+" for parent node type "+r.nodeType)}function S9(r,e,t){var n=r.childNodes||[],i=e.childNodes||[];if(e.nodeType===Xt.DOCUMENT_FRAGMENT_NODE){var o=i.filter(so);if(o.length>1||io(i,W2))throw new Wr(ai,"More than one element or text in fragment");if(o.length===1&&!AN(r,t))throw new Wr(ai,"Element in fragment can not be inserted before doctype")}if(so(e)&&!AN(r,t))throw new Wr(ai,"Only one element can be added and only after doctype");if(ra(e)){if(io(n,ra))throw new Wr(ai,"Only one doctype is allowed");var s=io(n,so);if(t&&n.indexOf(s)<n.indexOf(t))throw new Wr(ai,"Doctype can only be inserted before an element");if(!t&&s)throw new Wr(ai,"Doctype can not be appended since element is present")}}function UN(r,e,t){var n=r.childNodes||[],i=e.childNodes||[];if(e.nodeType===Xt.DOCUMENT_FRAGMENT_NODE){var o=i.filter(so);if(o.length>1||io(i,W2))throw new Wr(ai,"More than one element or text in fragment");if(o.length===1&&!xN(r,t))throw new Wr(ai,"Element in fragment can not be inserted before doctype")}if(so(e)&&!xN(r,t))throw new Wr(ai,"Only one element can be added and only after doctype");if(ra(e)){let u=function(c){return ra(c)&&c!==t};var a=u;if(io(n,u))throw new Wr(ai,"Only one doctype is allowed");var s=io(n,so);if(t&&n.indexOf(s)<n.indexOf(t))throw new Wr(ai,"Doctype can only be inserted before an element")}}function Eb(r,e,t,n){x9(r,e,t),r.nodeType===Xt.DOCUMENT_NODE&&(n||S9)(r,e,t);var i=e.parentNode;if(i&&i.removeChild(e),e.nodeType===ta){var o=e.firstChild;if(o==null)return e;var s=e.lastChild}else o=s=e;var a=t?t.previousSibling:r.lastChild;o.previousSibling=a,s.nextSibling=t,a?a.nextSibling=o:r.firstChild=o,t==null?r.lastChild=s:t.previousSibling=s;do o.parentNode=r;while(o!==s&&(o=o.nextSibling));return z2(r.ownerDocument||r,r),e.nodeType==ta&&(e.firstChild=e.lastChild=null),e}function T9(r,e){return e.parentNode&&e.parentNode.removeChild(e),e.parentNode=r,e.previousSibling=r.lastChild,e.nextSibling=null,e.previousSibling?e.previousSibling.nextSibling=e:r.firstChild=e,r.lastChild=e,z2(r.ownerDocument,r,e),e}Zp.prototype={nodeName:"#document",nodeType:ON,doctype:null,documentElement:null,_inc:1,insertBefore:function(r,e){if(r.nodeType==ta){for(var t=r.firstChild;t;){var n=t.nextSibling;this.insertBefore(t,e),t=n}return r}return Eb(this,r,e),r.ownerDocument=this,this.documentElement===null&&r.nodeType===Ds&&(this.documentElement=r),r},removeChild:function(r){return this.documentElement==r&&(this.documentElement=null),FN(this,r)},replaceChild:function(r,e){Eb(this,r,e,UN),r.ownerDocument=this,e&&this.removeChild(e),so(r)&&(this.documentElement=r)},importNode:function(r,e){return qN(this,r,e)},getElementById:function(r){var e=null;return Xp(this.documentElement,function(t){if(t.nodeType==Ds&&t.getAttribute("id")==r)return e=t,!0}),e},getElementsByClassName:function(r){var e=wN(r);return new uh(this,function(t){var n=[];return e.length>0&&Xp(t.documentElement,function(i){if(i!==t&&i.nodeType===Ds){var o=i.getAttribute("class");if(o){var s=r===o;if(!s){var a=wN(o);s=e.every(b9(a))}s&&n.push(i)}}}),n})},createElement:function(r){var e=new Vu;e.ownerDocument=this,e.nodeName=r,e.tagName=r,e.localName=r,e.childNodes=new ea;var t=e.attributes=new _b;return t._ownerElement=e,e},createDocumentFragment:function(){var r=new Sb;return r.ownerDocument=this,r.childNodes=new ea,r},createTextNode:function(r){var e=new q2;return e.ownerDocument=this,e.appendData(r),e},createComment:function(r){var e=new H2;return e.ownerDocument=this,e.appendData(r),e},createCDATASection:function(r){var e=new G2;return e.ownerDocument=this,e.appendData(r),e},createProcessingInstruction:function(r,e){var t=new Y2;return t.ownerDocument=this,t.tagName=t.nodeName=t.target=r,t.nodeValue=t.data=e,t},createAttribute:function(r){var e=new Ab;return e.ownerDocument=this,e.name=r,e.nodeName=r,e.localName=r,e.specified=!0,e},createEntityReference:function(r){var e=new V2;return e.ownerDocument=this,e.nodeName=r,e},createElementNS:function(r,e){var t=new Vu,n=e.split(":"),i=t.attributes=new _b;return t.childNodes=new ea,t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.namespaceURI=r,n.length==2?(t.prefix=n[0],t.localName=n[1]):t.localName=e,i._ownerElement=t,t},createAttributeNS:function(r,e){var t=new Ab,n=e.split(":");return t.ownerDocument=this,t.nodeName=e,t.name=e,t.namespaceURI=r,t.specified=!0,n.length==2?(t.prefix=n[0],t.localName=n[1]):t.localName=e,t}};li(Zp,Xt);function Vu(){this._nsMap={}}Vu.prototype={nodeType:Ds,hasAttribute:function(r){return this.getAttributeNode(r)!=null},getAttribute:function(r){var e=this.getAttributeNode(r);return e&&e.value||""},getAttributeNode:function(r){return this.attributes.getNamedItem(r)},setAttribute:function(r,e){var t=this.ownerDocument.createAttribute(r);t.value=t.nodeValue=""+e,this.setAttributeNode(t)},removeAttribute:function(r){var e=this.getAttributeNode(r);e&&this.removeAttributeNode(e)},appendChild:function(r){return r.nodeType===ta?this.insertBefore(r,null):T9(this,r)},setAttributeNode:function(r){return this.attributes.setNamedItem(r)},setAttributeNodeNS:function(r){return this.attributes.setNamedItemNS(r)},removeAttributeNode:function(r){return this.attributes.removeNamedItem(r.nodeName)},removeAttributeNS:function(r,e){var t=this.getAttributeNodeNS(r,e);t&&this.removeAttributeNode(t)},hasAttributeNS:function(r,e){return this.getAttributeNodeNS(r,e)!=null},getAttributeNS:function(r,e){var t=this.getAttributeNodeNS(r,e);return t&&t.value||""},setAttributeNS:function(r,e,t){var n=this.ownerDocument.createAttributeNS(r,e);n.value=n.nodeValue=""+t,this.setAttributeNode(n)},getAttributeNodeNS:function(r,e){return this.attributes.getNamedItemNS(r,e)},getElementsByTagName:function(r){return new uh(this,function(e){var t=[];return Xp(e,function(n){n!==e&&n.nodeType==Ds&&(r==="*"||n.tagName==r)&&t.push(n)}),t})},getElementsByTagNameNS:function(r,e){return new uh(this,function(t){var n=[];return Xp(t,function(i){i!==t&&i.nodeType===Ds&&(r==="*"||i.namespaceURI===r)&&(e==="*"||i.localName==e)&&n.push(i)}),n})}};Zp.prototype.getElementsByTagName=Vu.prototype.getElementsByTagName;Zp.prototype.getElementsByTagNameNS=Vu.prototype.getElementsByTagNameNS;li(Vu,Xt);function Ab(){}Ab.prototype.nodeType=lh;li(Ab,Xt);function Jp(){}Jp.prototype={data:"",substringData:function(r,e){return this.data.substring(r,r+e)},appendData:function(r){r=this.data+r,this.nodeValue=this.data=r,this.length=r.length},insertData:function(r,e){this.replaceData(r,0,e)},appendChild:function(r){throw new Error(pn[ai])},deleteData:function(r,e){this.replaceData(r,e,"")},replaceData:function(r,e,t){var n=this.data.substring(0,r),i=this.data.substring(r+e);t=n+t+i,this.nodeValue=this.data=t,this.length=t.length}};li(Jp,Xt);function q2(){}q2.prototype={nodeName:"#text",nodeType:vb,splitText:function(r){var e=this.data,t=e.substring(r);e=e.substring(0,r),this.data=this.nodeValue=e,this.length=e.length;var n=this.ownerDocument.createTextNode(t);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}};li(q2,Jp);function H2(){}H2.prototype={nodeName:"#comment",nodeType:IN};li(H2,Jp);function G2(){}G2.prototype={nodeName:"#cdata-section",nodeType:CN};li(G2,Jp);function xb(){}xb.prototype.nodeType=NN;li(xb,Xt);function jN(){}jN.prototype.nodeType=v9;li(jN,Xt);function $N(){}$N.prototype.nodeType=w9;li($N,Xt);function V2(){}V2.prototype.nodeType=RN;li(V2,Xt);function Sb(){}Sb.prototype.nodeName="#document-fragment";Sb.prototype.nodeType=ta;li(Sb,Xt);function Y2(){}Y2.prototype.nodeType=DN;li(Y2,Xt);function zN(){}zN.prototype.serializeToString=function(r,e,t){return WN.call(r,e,t)};Xt.prototype.toString=WN;function WN(r,e){var t=[],n=this.nodeType==9&&this.documentElement||this,i=n.prefix,o=n.namespaceURI;if(o&&i==null){var i=n.lookupPrefix(o);if(i==null)var s=[{namespace:o,prefix:null}]}return ah(this,t,r,e,s),t.join("")}function SN(r,e,t){var n=r.prefix||"",i=r.namespaceURI;if(!i||n==="xml"&&i===Yp.XML||i===Yp.XMLNS)return!1;for(var o=t.length;o--;){var s=t[o];if(s.prefix===n)return s.namespace!==i}return!0}function U2(r,e,t){r.push(" ",e,'="',t.replace(/[<>&"\t\n\r]/g,MN),'"')}function ah(r,e,t,n,i){if(i||(i=[]),n)if(r=n(r),r){if(typeof r=="string"){e.push(r);return}}else return;switch(r.nodeType){case Ds:var o=r.attributes,s=o.length,y=r.firstChild,a=r.tagName;t=Yp.isHTML(r.namespaceURI)||t;var u=a;if(!t&&!r.prefix&&r.namespaceURI){for(var c,f=0;f<o.length;f++)if(o.item(f).name==="xmlns"){c=o.item(f).value;break}if(!c)for(var h=i.length-1;h>=0;h--){var p=i[h];if(p.prefix===""&&p.namespace===r.namespaceURI){c=p.namespace;break}}if(c!==r.namespaceURI)for(var h=i.length-1;h>=0;h--){var p=i[h];if(p.namespace===r.namespaceURI){p.prefix&&(u=p.prefix+":"+a);break}}}e.push("<",u);for(var m=0;m<s;m++){var b=o.item(m);b.prefix=="xmlns"?i.push({prefix:b.localName,namespace:b.value}):b.nodeName=="xmlns"&&i.push({prefix:"",namespace:b.value})}for(var m=0;m<s;m++){var b=o.item(m);if(SN(b,t,i)){var v=b.prefix||"",w=b.namespaceURI;U2(e,v?"xmlns:"+v:"xmlns",w),i.push({prefix:v,namespace:w})}ah(b,e,t,n,i)}if(a===u&&SN(r,t,i)){var v=r.prefix||"",w=r.namespaceURI;U2(e,v?"xmlns:"+v:"xmlns",w),i.push({prefix:v,namespace:w})}if(y||t&&!/^(?:meta|link|img|br|hr|input)$/i.test(a)){if(e.push(">"),t&&/^script$/i.test(a))for(;y;)y.data?e.push(y.data):ah(y,e,t,n,i.slice()),y=y.nextSibling;else for(;y;)ah(y,e,t,n,i.slice()),y=y.nextSibling;e.push("</",u,">")}else e.push("/>");return;case ON:case ta:for(var y=r.firstChild;y;)ah(y,e,t,n,i.slice()),y=y.nextSibling;return;case lh:return U2(e,r.name,r.value);case vb:return e.push(r.data.replace(/[<&>]/g,MN));case CN:return e.push("<![CDATA[",r.data,"]]>");case IN:return e.push("<!--",r.data,"-->");case NN:var _=r.publicId,E=r.systemId;if(e.push("<!DOCTYPE ",r.name),_)e.push(" PUBLIC ",_),E&&E!="."&&e.push(" ",E),e.push(">");else if(E&&E!=".")e.push(" SYSTEM ",E,">");else{var S=r.internalSubset;S&&e.push(" [",S,"]"),e.push(">")}return;case DN:return e.push("<?",r.target," ",r.data,"?>");case RN:return e.push("&",r.nodeName,";");default:e.push("??",r.nodeName)}}function qN(r,e,t){var n;switch(e.nodeType){case Ds:n=e.cloneNode(!1),n.ownerDocument=r;case ta:break;case lh:t=!0;break}if(n||(n=e.cloneNode(!1)),n.ownerDocument=r,n.parentNode=null,t)for(var i=e.firstChild;i;)n.appendChild(qN(r,i,t)),i=i.nextSibling;return n}function j2(r,e,t){var n=new e.constructor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var o=e[i];typeof o!="object"&&o!=n[i]&&(n[i]=o)}switch(e.childNodes&&(n.childNodes=new ea),n.ownerDocument=r,n.nodeType){case Ds:var s=e.attributes,a=n.attributes=new _b,u=s.length;a._ownerElement=n;for(var c=0;c<u;c++)n.setAttributeNode(j2(r,s.item(c),!0));break;case lh:t=!0}if(t)for(var f=e.firstChild;f;)n.appendChild(j2(r,f,t)),f=f.nextSibling;return n}function HN(r,e,t){r[e]=t}try{if(Object.defineProperty){let r=function(e){switch(e.nodeType){case Ds:case ta:var t=[];for(e=e.firstChild;e;)e.nodeType!==7&&e.nodeType!==8&&t.push(r(e)),e=e.nextSibling;return t.join("");default:return e.nodeValue}};C9=r,Object.defineProperty(uh.prototype,"length",{get:function(){return $2(this),this.$$length}}),Object.defineProperty(Xt.prototype,"textContent",{get:function(){return r(this)},set:function(e){switch(this.nodeType){case Ds:case ta:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),HN=function(e,t,n){e["$$"+t]=n}}}catch{}var C9;ml.DocumentType=xb;ml.DOMException=Wr;ml.DOMImplementation=PN;ml.Element=Vu;ml.Node=Xt;ml.NodeList=ea;ml.XMLSerializer=zN});var VN=it(Qp=>{"use strict";Ce();De();Re();var GN=Vp().freeze;Qp.XML_ENTITIES=GN({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'});Qp.HTML_ENTITIES=GN({Aacute:"\xC1",aacute:"\xE1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223E",acd:"\u223F",acE:"\u223E\u0333",Acirc:"\xC2",acirc:"\xE2",acute:"\xB4",Acy:"\u0410",acy:"\u0430",AElig:"\xC6",aelig:"\xE6",af:"\u2061",Afr:"\u{1D504}",afr:"\u{1D51E}",Agrave:"\xC0",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03B1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2A3F",AMP:"&",amp:"&",And:"\u2A53",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",Aogon:"\u0104",aogon:"\u0105",Aopf:"\u{1D538}",aopf:"\u{1D552}",ap:"\u2248",apacir:"\u2A6F",apE:"\u2A70",ape:"\u224A",apid:"\u224B",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224A",Aring:"\xC5",aring:"\xE5",Ascr:"\u{1D49C}",ascr:"\u{1D4B6}",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224D",Atilde:"\xC3",atilde:"\xE3",Auml:"\xC4",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",Backslash:"\u2216",Barv:"\u2AE7",barvee:"\u22BD",Barwed:"\u2306",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",Because:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",Bernoullis:"\u212C",Beta:"\u0392",beta:"\u03B2",beth:"\u2136",between:"\u226C",Bfr:"\u{1D505}",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bNot:"\u2AED",bnot:"\u2310",Bopf:"\u{1D539}",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxbox:"\u29C9",boxDL:"\u2557",boxDl:"\u2556",boxdL:"\u2555",boxdl:"\u2510",boxDR:"\u2554",boxDr:"\u2553",boxdR:"\u2552",boxdr:"\u250C",boxH:"\u2550",boxh:"\u2500",boxHD:"\u2566",boxHd:"\u2564",boxhD:"\u2565",boxhd:"\u252C",boxHU:"\u2569",boxHu:"\u2567",boxhU:"\u2568",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxUL:"\u255D",boxUl:"\u255C",boxuL:"\u255B",boxul:"\u2518",boxUR:"\u255A",boxUr:"\u2559",boxuR:"\u2558",boxur:"\u2514",boxV:"\u2551",boxv:"\u2502",boxVH:"\u256C",boxVh:"\u256B",boxvH:"\u256A",boxvh:"\u253C",boxVL:"\u2563",boxVl:"\u2562",boxvL:"\u2561",boxvl:"\u2524",boxVR:"\u2560",boxVr:"\u255F",boxvR:"\u255E",boxvr:"\u251C",bprime:"\u2035",Breve:"\u02D8",breve:"\u02D8",brvbar:"\xA6",Bscr:"\u212C",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",Bumpeq:"\u224E",bumpeq:"\u224F",Cacute:"\u0106",cacute:"\u0107",Cap:"\u22D2",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",CapitalDifferentialD:"\u2145",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",Cayleys:"\u212D",ccaps:"\u2A4D",Ccaron:"\u010C",ccaron:"\u010D",Ccedil:"\xC7",ccedil:"\xE7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2A4C",ccupssm:"\u2A50",Cdot:"\u010A",cdot:"\u010B",cedil:"\xB8",Cedilla:"\xB8",cemptyv:"\u29B2",cent:"\xA2",CenterDot:"\xB7",centerdot:"\xB7",Cfr:"\u212D",cfr:"\u{1D520}",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03A7",chi:"\u03C7",cir:"\u25CB",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",CircleDot:"\u2299",circledR:"\xAE",circledS:"\u24C8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cirE:"\u29C3",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",Colon:"\u2237",colon:":",Colone:"\u2A74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",Congruent:"\u2261",Conint:"\u222F",conint:"\u222E",ContourIntegral:"\u222E",Copf:"\u2102",copf:"\u{1D554}",coprod:"\u2210",Coproduct:"\u2210",COPY:"\xA9",copy:"\xA9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21B5",Cross:"\u2A2F",cross:"\u2717",Cscr:"\u{1D49E}",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",Cup:"\u22D3",cup:"\u222A",cupbrcap:"\u2A48",CupCap:"\u224D",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",Dagger:"\u2021",dagger:"\u2020",daleth:"\u2138",Darr:"\u21A1",dArr:"\u21D3",darr:"\u2193",dash:"\u2010",Dashv:"\u2AE4",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",Dcaron:"\u010E",dcaron:"\u010F",Dcy:"\u0414",dcy:"\u0434",DD:"\u2145",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",DDotrahd:"\u2911",ddotseq:"\u2A77",deg:"\xB0",Del:"\u2207",Delta:"\u0394",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",Dfr:"\u{1D507}",dfr:"\u{1D521}",dHar:"\u2965",dharl:"\u21C3",dharr:"\u21C2",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",diam:"\u22C4",Diamond:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",DifferentialD:"\u2146",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",Dopf:"\u{1D53B}",dopf:"\u{1D555}",Dot:"\xA8",dot:"\u02D9",DotDot:"\u20DC",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",Downarrow:"\u21D3",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",Dscr:"\u{1D49F}",dscr:"\u{1D4B9}",DScy:"\u0405",dscy:"\u0455",dsol:"\u29F6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",DZcy:"\u040F",dzcy:"\u045F",dzigrarr:"\u27FF",Eacute:"\xC9",eacute:"\xE9",easter:"\u2A6E",Ecaron:"\u011A",ecaron:"\u011B",ecir:"\u2256",Ecirc:"\xCA",ecirc:"\xEA",ecolon:"\u2255",Ecy:"\u042D",ecy:"\u044D",eDDot:"\u2A77",Edot:"\u0116",eDot:"\u2251",edot:"\u0117",ee:"\u2147",efDot:"\u2252",Efr:"\u{1D508}",efr:"\u{1D522}",eg:"\u2A9A",Egrave:"\xC8",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",Element:"\u2208",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25FB",emptyv:"\u2205",EmptyVerySmallSquare:"\u25AB",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",ENG:"\u014A",eng:"\u014B",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\u{1D53C}",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",Epsilon:"\u0395",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",Equal:"\u2A75",equals:"=",EqualTilde:"\u2242",equest:"\u225F",Equilibrium:"\u21CC",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erarr:"\u2971",erDot:"\u2253",Escr:"\u2130",escr:"\u212F",esdot:"\u2250",Esim:"\u2A73",esim:"\u2242",Eta:"\u0397",eta:"\u03B7",ETH:"\xD0",eth:"\xF0",Euml:"\xCB",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",ExponentialE:"\u2147",exponentiale:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",Ffr:"\u{1D509}",ffr:"\u{1D523}",filig:"\uFB01",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",Fopf:"\u{1D53D}",fopf:"\u{1D557}",ForAll:"\u2200",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",Fouriertrf:"\u2131",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",Fscr:"\u2131",fscr:"\u{1D4BB}",gacute:"\u01F5",Gamma:"\u0393",gamma:"\u03B3",Gammad:"\u03DC",gammad:"\u03DD",gap:"\u2A86",Gbreve:"\u011E",gbreve:"\u011F",Gcedil:"\u0122",Gcirc:"\u011C",gcirc:"\u011D",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",gE:"\u2267",ge:"\u2265",gEl:"\u2A8C",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",Gfr:"\u{1D50A}",gfr:"\u{1D524}",Gg:"\u22D9",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gl:"\u2277",gla:"\u2AA5",glE:"\u2A92",glj:"\u2AA4",gnap:"\u2A8A",gnapprox:"\u2A8A",gnE:"\u2269",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",Gopf:"\u{1D53E}",gopf:"\u{1D558}",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",Gt:"\u226B",GT:">",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",Hacek:"\u02C7",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",HARDcy:"\u042A",hardcy:"\u044A",hArr:"\u21D4",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",Hat:"^",hbar:"\u210F",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",Hfr:"\u210C",hfr:"\u{1D525}",HilbertSpace:"\u210B",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",Hopf:"\u210D",hopf:"\u{1D559}",horbar:"\u2015",HorizontalLine:"\u2500",Hscr:"\u210B",hscr:"\u{1D4BD}",hslash:"\u210F",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224E",HumpEqual:"\u224F",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xCD",iacute:"\xED",ic:"\u2063",Icirc:"\xCE",icirc:"\xEE",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",Ifr:"\u2111",ifr:"\u{1D526}",Igrave:"\xCC",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Im:"\u2111",Imacr:"\u012A",imacr:"\u012B",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",Implies:"\u21D2",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",Int:"\u222C",int:"\u222B",intcal:"\u22BA",integers:"\u2124",Integral:"\u222B",intercal:"\u22BA",Intersection:"\u22C2",intlarhk:"\u2A17",intprod:"\u2A3C",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012E",iogon:"\u012F",Iopf:"\u{1D540}",iopf:"\u{1D55A}",Iota:"\u0399",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",Iscr:"\u2110",iscr:"\u{1D4BE}",isin:"\u2208",isindot:"\u22F5",isinE:"\u22F9",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xCF",iuml:"\xEF",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\u{1D50D}",jfr:"\u{1D527}",jmath:"\u0237",Jopf:"\u{1D541}",jopf:"\u{1D55B}",Jscr:"\u{1D4A5}",jscr:"\u{1D4BF}",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039A",kappa:"\u03BA",kappav:"\u03F0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041A",kcy:"\u043A",Kfr:"\u{1D50E}",kfr:"\u{1D528}",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040C",kjcy:"\u045C",Kopf:"\u{1D542}",kopf:"\u{1D55C}",Kscr:"\u{1D4A6}",kscr:"\u{1D4C0}",lAarr:"\u21DA",Lacute:"\u0139",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",Lambda:"\u039B",lambda:"\u03BB",Lang:"\u27EA",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",Laplacetrf:"\u2112",laquo:"\xAB",Larr:"\u219E",lArr:"\u21D0",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",lAtail:"\u291B",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lBarr:"\u290E",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",Lcaron:"\u013D",lcaron:"\u013E",Lcedil:"\u013B",lcedil:"\u013C",lceil:"\u2308",lcub:"{",Lcy:"\u041B",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",lE:"\u2266",le:"\u2264",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",Leftarrow:"\u21D0",leftarrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",leftarrowtail:"\u21A2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",LeftRightArrow:"\u2194",Leftrightarrow:"\u21D4",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",leftthreetimes:"\u22CB",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",lEg:"\u2A8B",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2AA1",lesssim:"\u2272",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",lfisht:"\u297C",lfloor:"\u230A",Lfr:"\u{1D50F}",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lHar:"\u2962",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",Ll:"\u22D8",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",Lleftarrow:"\u21DA",llhard:"\u296B",lltri:"\u25FA",Lmidot:"\u013F",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnap:"\u2A89",lnapprox:"\u2A89",lnE:"\u2268",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",LongLeftArrow:"\u27F5",Longleftarrow:"\u27F8",longleftarrow:"\u27F5",LongLeftRightArrow:"\u27F7",Longleftrightarrow:"\u27FA",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",LongRightArrow:"\u27F6",Longrightarrow:"\u27F9",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",Lopf:"\u{1D543}",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",Lscr:"\u2112",lscr:"\u{1D4C1}",Lsh:"\u21B0",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",Lstrok:"\u0141",lstrok:"\u0142",Lt:"\u226A",LT:"<",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",ltrPar:"\u2996",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",Mcy:"\u041C",mcy:"\u043C",mdash:"\u2014",mDDot:"\u223A",measuredangle:"\u2221",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",MinusPlus:"\u2213",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",Mopf:"\u{1D544}",mopf:"\u{1D55E}",mp:"\u2213",Mscr:"\u2133",mscr:"\u{1D4C2}",mstpos:"\u223E",Mu:"\u039C",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",Ncy:"\u041D",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",neArr:"\u21D7",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:`
80
+ `,nexist:"\u2204",nexists:"\u2204",Nfr:"\u{1D511}",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",nGt:"\u226B\u20D2",ngt:"\u226F",ngtr:"\u226F",nGtv:"\u226B\u0338",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",NJcy:"\u040A",njcy:"\u045A",nlArr:"\u21CD",nlarr:"\u219A",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nLeftarrow:"\u21CD",nleftarrow:"\u219A",nLeftrightarrow:"\u21CE",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nLt:"\u226A\u20D2",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",nopf:"\u{1D55F}",Not:"\u2AEC",not:"\xAC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nRightarrow:"\u21CF",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",Nscr:"\u{1D4A9}",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",Ntilde:"\xD1",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",Nu:"\u039D",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nVDash:"\u22AF",nVdash:"\u22AE",nvDash:"\u22AD",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwArr:"\u21D6",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xD3",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",Ocirc:"\xD4",ocirc:"\xF4",Ocy:"\u041E",ocy:"\u043E",odash:"\u229D",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29BF",Ofr:"\u{1D512}",ofr:"\u{1D52C}",ogon:"\u02DB",Ograve:"\xD2",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",Omacr:"\u014C",omacr:"\u014D",Omega:"\u03A9",omega:"\u03C9",Omicron:"\u039F",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",Oopf:"\u{1D546}",oopf:"\u{1D560}",opar:"\u29B7",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",operp:"\u29B9",oplus:"\u2295",Or:"\u2A54",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oS:"\u24C8",Oscr:"\u{1D4AA}",oscr:"\u2134",Oslash:"\xD8",oslash:"\xF8",osol:"\u2298",Otilde:"\xD5",otilde:"\xF5",Otimes:"\u2A37",otimes:"\u2297",otimesas:"\u2A36",Ouml:"\xD6",ouml:"\xF6",ovbar:"\u233D",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",PartialD:"\u2202",Pcy:"\u041F",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",Pfr:"\u{1D513}",pfr:"\u{1D52D}",Phi:"\u03A6",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",Pi:"\u03A0",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",PlusMinus:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",Poincareplane:"\u210C",pointint:"\u2A15",Popf:"\u2119",popf:"\u{1D561}",pound:"\xA3",Pr:"\u2ABB",pr:"\u227A",prap:"\u2AB7",prcue:"\u227C",prE:"\u2AB3",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",Prime:"\u2033",prime:"\u2032",primes:"\u2119",prnap:"\u2AB9",prnE:"\u2AB5",prnsim:"\u22E8",prod:"\u220F",Product:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",Proportion:"\u2237",Proportional:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",Pscr:"\u{1D4AB}",pscr:"\u{1D4C5}",Psi:"\u03A8",psi:"\u03C8",puncsp:"\u2008",Qfr:"\u{1D514}",qfr:"\u{1D52E}",qint:"\u2A0C",Qopf:"\u211A",qopf:"\u{1D562}",qprime:"\u2057",Qscr:"\u{1D4AC}",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",QUOT:'"',quot:'"',rAarr:"\u21DB",race:"\u223D\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",Rang:"\u27EB",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",Rarr:"\u21A0",rArr:"\u21D2",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21A3",rarrw:"\u219D",rAtail:"\u291C",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",RBarr:"\u2910",rBarr:"\u290F",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",Re:"\u211C",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",REG:"\xAE",reg:"\xAE",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",rfisht:"\u297D",rfloor:"\u230B",Rfr:"\u211C",rfr:"\u{1D52F}",rHar:"\u2964",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",Rho:"\u03A1",rho:"\u03C1",rhov:"\u03F1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",Rightarrow:"\u21D2",rightarrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",rightarrowtail:"\u21A3",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",rightthreetimes:"\u22CC",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",Ropf:"\u211D",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",Rrightarrow:"\u21DB",rsaquo:"\u203A",Rscr:"\u211B",rscr:"\u{1D4C7}",Rsh:"\u21B1",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",RuleDelayed:"\u29F4",ruluhar:"\u2968",rx:"\u211E",Sacute:"\u015A",sacute:"\u015B",sbquo:"\u201A",Sc:"\u2ABC",sc:"\u227B",scap:"\u2AB8",Scaron:"\u0160",scaron:"\u0161",sccue:"\u227D",scE:"\u2AB4",sce:"\u2AB0",Scedil:"\u015E",scedil:"\u015F",Scirc:"\u015C",scirc:"\u015D",scnap:"\u2ABA",scnE:"\u2AB6",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",Scy:"\u0421",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",searhk:"\u2925",seArr:"\u21D8",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\u{1D516}",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xAD",Sigma:"\u03A3",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",SOFTcy:"\u042C",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",Sopf:"\u{1D54A}",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",Sqrt:"\u221A",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",Square:"\u25A1",square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",Sscr:"\u{1D4AE}",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",Star:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",Sub:"\u22D0",sub:"\u2282",subdot:"\u2ABD",subE:"\u2AC5",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",Subset:"\u22D0",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",SubsetEqual:"\u2286",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",SuchThat:"\u220B",Sum:"\u2211",sum:"\u2211",sung:"\u266A",Sup:"\u22D1",sup:"\u2283",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supdot:"\u2ABE",supdsub:"\u2AD8",supE:"\u2AC6",supe:"\u2287",supedot:"\u2AC4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",Supset:"\u22D1",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swarhk:"\u2926",swArr:"\u21D9",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",Tab:" ",target:"\u2316",Tau:"\u03A4",tau:"\u03C4",tbrk:"\u23B4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",Tfr:"\u{1D517}",tfr:"\u{1D531}",there4:"\u2234",Therefore:"\u2234",therefore:"\u2234",Theta:"\u0398",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",ThickSpace:"\u205F\u200A",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223C",THORN:"\xDE",thorn:"\xFE",Tilde:"\u223C",tilde:"\u02DC",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",Topf:"\u{1D54B}",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",TRADE:"\u2122",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",TripleDot:"\u20DB",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",Tscr:"\u{1D4AF}",tscr:"\u{1D4C9}",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040B",tshcy:"\u045B",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",Uacute:"\xDA",uacute:"\xFA",Uarr:"\u219F",uArr:"\u21D1",uarr:"\u2191",Uarrocir:"\u2949",Ubrcy:"\u040E",ubrcy:"\u045E",Ubreve:"\u016C",ubreve:"\u016D",Ucirc:"\xDB",ucirc:"\xFB",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21C5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",Ufr:"\u{1D518}",ufr:"\u{1D532}",Ugrave:"\xD9",ugrave:"\xF9",uHar:"\u2963",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",Umacr:"\u016A",umacr:"\u016B",uml:"\xA8",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",uogon:"\u0173",Uopf:"\u{1D54C}",uopf:"\u{1D566}",UpArrow:"\u2191",Uparrow:"\u21D1",uparrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",Updownarrow:"\u21D5",updownarrow:"\u2195",UpEquilibrium:"\u296E",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",upsi:"\u03C5",upsih:"\u03D2",Upsilon:"\u03A5",upsilon:"\u03C5",UpTee:"\u22A5",UpTeeArrow:"\u21A5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",Uring:"\u016E",uring:"\u016F",urtri:"\u25F9",Uscr:"\u{1D4B0}",uscr:"\u{1D4CA}",utdot:"\u22F0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",Uuml:"\xDC",uuml:"\xFC",uwangle:"\u29A7",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",vArr:"\u21D5",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",Vbar:"\u2AEB",vBar:"\u2AE8",vBarv:"\u2AE9",Vcy:"\u0412",vcy:"\u0432",VDash:"\u22AB",Vdash:"\u22A9",vDash:"\u22A8",vdash:"\u22A2",Vdashl:"\u2AE6",Vee:"\u22C1",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",Verbar:"\u2016",verbar:"|",Vert:"\u2016",vert:"|",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",Vopf:"\u{1D54D}",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",Vscr:"\u{1D4B1}",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",Vvdash:"\u22AA",vzigzag:"\u299A",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2A5F",Wedge:"\u22C0",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\u{1D51A}",wfr:"\u{1D534}",Wopf:"\u{1D54E}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\u{1D4B2}",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",Xfr:"\u{1D51B}",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",Xi:"\u039E",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",Xopf:"\u{1D54F}",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",Xscr:"\u{1D4B3}",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",Yacute:"\xDD",yacute:"\xFD",YAcy:"\u042F",yacy:"\u044F",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042B",ycy:"\u044B",yen:"\xA5",Yfr:"\u{1D51C}",yfr:"\u{1D536}",YIcy:"\u0407",yicy:"\u0457",Yopf:"\u{1D550}",yopf:"\u{1D56A}",Yscr:"\u{1D4B4}",yscr:"\u{1D4CE}",YUcy:"\u042E",yucy:"\u044E",Yuml:"\u0178",yuml:"\xFF",Zacute:"\u0179",zacute:"\u017A",Zcaron:"\u017D",zcaron:"\u017E",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017B",zdot:"\u017C",zeetrf:"\u2128",ZeroWidthSpace:"\u200B",Zeta:"\u0396",zeta:"\u03B6",Zfr:"\u2128",zfr:"\u{1D537}",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21DD",Zopf:"\u2124",zopf:"\u{1D56B}",Zscr:"\u{1D4B5}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"});Qp.entityMap=Qp.HTML_ENTITIES});var tk=it(Z2=>{Ce();De();Re();var ng=Vp().NAMESPACE,K2=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,YN=new RegExp("[\\-\\.0-9"+K2.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),XN=new RegExp("^"+K2.source+YN.source+"*(?::"+K2.source+YN.source+"*)?$"),eg=0,yl=1,ch=2,tg=3,fh=4,hh=5,rg=6,Tb=7;function dh(r,e){this.message=r,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,dh)}dh.prototype=new Error;dh.prototype.name=dh.name;function JN(){}JN.prototype={parse:function(r,e,t){var n=this.domBuilder;n.startDocument(),QN(e,e={}),R9(r,e,t,n,this.errorHandler),n.endDocument()}};function R9(r,e,t,n,i){function o(re){if(re>65535){re-=65536;var N=55296+(re>>10),x=56320+(re&1023);return String.fromCharCode(N,x)}else return String.fromCharCode(re)}function s(re){var N=re.slice(1,-1);return Object.hasOwnProperty.call(t,N)?t[N]:N.charAt(0)==="#"?o(parseInt(N.substr(1).replace("x","0x"))):(i.error("entity not found:"+re),re)}function a(re){if(re>v){var N=r.substring(v,re).replace(/&#?\w+;/g,s);p&&u(v),n.characters(N,0,re-v),v=re}}function u(re,N){for(;re>=f&&(N=h.exec(r));)c=N.index,f=c+N[0].length,p.lineNumber++;p.columnNumber=re-c+1}for(var c=0,f=0,h=/.*(?:\r\n?|\n)|.*$/g,p=n.locator,m=[{currentNSMap:e}],b={},v=0;;){try{var w=r.indexOf("<",v);if(w<0){if(!r.substr(v).match(/^\s*$/)){var y=n.doc,_=y.createTextNode(r.substr(v));y.appendChild(_),n.currentElement=_}return}switch(w>v&&a(w),r.charAt(w+1)){case"/":var ne=r.indexOf(">",w+3),E=r.substring(w+2,ne).replace(/[ \t\n\r]+$/g,""),S=m.pop();ne<0?(E=r.substring(w+2).replace(/[\s<].*/,""),i.error("end tag name: "+E+" is not complete:"+S.tagName),ne=w+1+E.length):E.match(/\s</)&&(E=E.replace(/[\s<].*/,""),i.error("end tag name: "+E+" maybe not complete"),ne=w+1+E.length);var A=S.localNSMap,F=S.tagName==E,D=F||S.tagName&&S.tagName.toLowerCase()==E.toLowerCase();if(D){if(n.endElement(S.uri,S.localName,E),A)for(var H in A)Object.prototype.hasOwnProperty.call(A,H)&&n.endPrefixMapping(H);F||i.fatalError("end tag name: "+E+" is not match the current start tagName:"+S.tagName)}else m.push(S);ne++;break;case"?":p&&u(w),ne=k9(r,w,n);break;case"!":p&&u(w),ne=N9(r,w,n,i);break;default:p&&u(w);var J=new ek,K=m[m.length-1].currentNSMap,ne=D9(r,w,J,K,s,i),k=J.length;if(!J.closed&&O9(r,ne,J.tagName,b)&&(J.closed=!0,t.nbsp||i.warning("unclosed xml attribute")),p&&k){for(var $=KN(p,{}),Y=0;Y<k;Y++){var ie=J[Y];u(ie.offset),ie.locator=KN(p,{})}n.locator=$,ZN(J,n,K)&&m.push(J),n.locator=p}else ZN(J,n,K)&&m.push(J);ng.isHTML(J.uri)&&!J.closed?ne=I9(r,ne,J.tagName,s,n):ne++}}catch(re){if(re instanceof dh)throw re;i.error("element parse error: "+re),ne=-1}ne>v?v=ne:a(Math.max(w,v)+1)}}function KN(r,e){return e.lineNumber=r.lineNumber,e.columnNumber=r.columnNumber,e}function D9(r,e,t,n,i,o){function s(m,b,v){t.attributeNames.hasOwnProperty(m)&&o.fatalError("Attribute "+m+" redefined"),t.addValue(m,b.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,i),v)}for(var a,u,c=++e,f=eg;;){var h=r.charAt(c);switch(h){case"=":if(f===yl)a=r.slice(e,c),f=tg;else if(f===ch)f=tg;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(f===tg||f===yl)if(f===yl&&(o.warning('attribute value must after "="'),a=r.slice(e,c)),e=c+1,c=r.indexOf(h,e),c>0)u=r.slice(e,c),s(a,u,e-1),f=hh;else throw new Error("attribute value no end '"+h+"' match");else if(f==fh)u=r.slice(e,c),s(a,u,e),o.warning('attribute "'+a+'" missed start quot('+h+")!!"),e=c+1,f=hh;else throw new Error('attribute value must after "="');break;case"/":switch(f){case eg:t.setTagName(r.slice(e,c));case hh:case rg:case Tb:f=Tb,t.closed=!0;case fh:case yl:break;case ch:t.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return o.error("unexpected end of input"),f==eg&&t.setTagName(r.slice(e,c)),c;case">":switch(f){case eg:t.setTagName(r.slice(e,c));case hh:case rg:case Tb:break;case fh:case yl:u=r.slice(e,c),u.slice(-1)==="/"&&(t.closed=!0,u=u.slice(0,-1));case ch:f===ch&&(u=a),f==fh?(o.warning('attribute "'+u+'" missed quot(")!'),s(a,u,e)):((!ng.isHTML(n[""])||!u.match(/^(?:disabled|checked|selected)$/i))&&o.warning('attribute "'+u+'" missed value!! "'+u+'" instead!!'),s(u,u,e));break;case tg:throw new Error("attribute value missed!!")}return c;case"\x80":h=" ";default:if(h<=" ")switch(f){case eg:t.setTagName(r.slice(e,c)),f=rg;break;case yl:a=r.slice(e,c),f=ch;break;case fh:var u=r.slice(e,c);o.warning('attribute "'+u+'" missed quot(")!!'),s(a,u,e);case hh:f=rg;break}else switch(f){case ch:var p=t.tagName;(!ng.isHTML(n[""])||!a.match(/^(?:disabled|checked|selected)$/i))&&o.warning('attribute "'+a+'" missed value!! "'+a+'" instead2!!'),s(a,a,e),e=c,f=yl;break;case hh:o.warning('attribute space is required"'+a+'"!!');case rg:f=yl,e=c;break;case tg:f=fh,e=c;break;case Tb:throw new Error("elements closed character '/' and '>' must be connected to")}}c++}}function ZN(r,e,t){for(var n=r.tagName,i=null,h=r.length;h--;){var o=r[h],s=o.qName,a=o.value,p=s.indexOf(":");if(p>0)var u=o.prefix=s.slice(0,p),c=s.slice(p+1),f=u==="xmlns"&&c;else c=s,u=null,f=s==="xmlns"&&"";o.localName=c,f!==!1&&(i==null&&(i={},QN(t,t={})),t[f]=i[f]=a,o.uri=ng.XMLNS,e.startPrefixMapping(f,a))}for(var h=r.length;h--;){o=r[h];var u=o.prefix;u&&(u==="xml"&&(o.uri=ng.XML),u!=="xmlns"&&(o.uri=t[u||""]))}var p=n.indexOf(":");p>0?(u=r.prefix=n.slice(0,p),c=r.localName=n.slice(p+1)):(u=null,c=r.localName=n);var m=r.uri=t[u||""];if(e.startElement(m,c,n,r),r.closed){if(e.endElement(m,c,n),i)for(u in i)Object.prototype.hasOwnProperty.call(i,u)&&e.endPrefixMapping(u)}else return r.currentNSMap=t,r.localNSMap=i,!0}function I9(r,e,t,n,i){if(/^(?:script|textarea)$/i.test(t)){var o=r.indexOf("</"+t+">",e),s=r.substring(e+1,o);if(/[&<]/.test(s))return/^script$/i.test(t)?(i.characters(s,0,s.length),o):(s=s.replace(/&#?\w+;/g,n),i.characters(s,0,s.length),o)}return e+1}function O9(r,e,t,n){var i=n[t];return i==null&&(i=r.lastIndexOf("</"+t+">"),i<e&&(i=r.lastIndexOf("</"+t)),n[t]=i),i<e}function QN(r,e){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}function N9(r,e,t,n){var i=r.charAt(e+2);switch(i){case"-":if(r.charAt(e+3)==="-"){var o=r.indexOf("-->",e+4);return o>e?(t.comment(r,e+4,o-e-4),o+3):(n.error("Unclosed comment"),-1)}else return-1;default:if(r.substr(e+3,6)=="CDATA["){var o=r.indexOf("]]>",e+9);return t.startCDATA(),t.characters(r,e+9,o-e-9),t.endCDATA(),o+3}var s=L9(r,e),a=s.length;if(a>1&&/!doctype/i.test(s[0][0])){var u=s[1][0],c=!1,f=!1;a>3&&(/^public$/i.test(s[2][0])?(c=s[3][0],f=a>4&&s[4][0]):/^system$/i.test(s[2][0])&&(f=s[3][0]));var h=s[a-1];return t.startDTD(u,c,f),t.endDTD(),h.index+h[0].length}}return-1}function k9(r,e,t){var n=r.indexOf("?>",e);if(n){var i=r.substring(e,n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(i){var o=i[0].length;return t.processingInstruction(i[1],i[2]),n+2}else return-1}return-1}function ek(){this.attributeNames={}}ek.prototype={setTagName:function(r){if(!XN.test(r))throw new Error("invalid tagName:"+r);this.tagName=r},addValue:function(r,e,t){if(!XN.test(r))throw new Error("invalid attribute:"+r);this.attributeNames[r]=this.length,this[this.length++]={qName:r,value:e,offset:t}},length:0,getLocalName:function(r){return this[r].localName},getLocator:function(r){return this[r].locator},getQName:function(r){return this[r].qName},getURI:function(r){return this[r].uri},getValue:function(r){return this[r].value}};function L9(r,e){var t,n=[],i=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(i.lastIndex=e,i.exec(r);t=i.exec(r);)if(n.push(t),t[1])return n}Z2.XMLReader=JN;Z2.ParseError=dh});var lk=it(Rb=>{Ce();De();Re();var P9=Vp(),M9=X2(),rk=VN(),sk=tk(),B9=M9.DOMImplementation,nk=P9.NAMESPACE,F9=sk.ParseError,U9=sk.XMLReader;function ok(r){return r.replace(/\r[\n\u0085]/g,`
81
+ `).replace(/[\r\u0085\u2028]/g,`
82
+ `)}function ak(r){this.options=r||{locator:{}}}ak.prototype.parseFromString=function(r,e){var t=this.options,n=new U9,i=t.domBuilder||new ig,o=t.errorHandler,s=t.locator,a=t.xmlns||{},u=/\/x?html?$/.test(e),c=u?rk.HTML_ENTITIES:rk.XML_ENTITIES;s&&i.setDocumentLocator(s),n.errorHandler=j9(o,i,s),n.domBuilder=t.domBuilder||i,u&&(a[""]=nk.HTML),a.xml=a.xml||nk.XML;var f=t.normalizeLineEndings||ok;return r&&typeof r=="string"?n.parse(f(r),a,c):n.errorHandler.error("invalid doc source"),i.doc};function j9(r,e,t){if(!r){if(e instanceof ig)return e;r=e}var n={},i=r instanceof Function;t=t||{};function o(s){var a=r[s];!a&&i&&(a=r.length==2?function(u){r(s,u)}:r),n[s]=a&&function(u){a("[xmldom "+s+"] "+u+J2(t))}||function(){}}return o("warning"),o("error"),o("fatalError"),n}function ig(){this.cdata=!1}function ph(r,e){e.lineNumber=r.lineNumber,e.columnNumber=r.columnNumber}ig.prototype={startDocument:function(){this.doc=new B9().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(r,e,t,n){var i=this.doc,o=i.createElementNS(r,t||e),s=n.length;Cb(this,o),this.currentElement=o,this.locator&&ph(this.locator,o);for(var a=0;a<s;a++){var r=n.getURI(a),u=n.getValue(a),t=n.getQName(a),c=i.createAttributeNS(r,t);this.locator&&ph(n.getLocator(a),c),c.value=c.nodeValue=u,o.setAttributeNode(c)}},endElement:function(r,e,t){var n=this.currentElement,i=n.tagName;this.currentElement=n.parentNode},startPrefixMapping:function(r,e){},endPrefixMapping:function(r){},processingInstruction:function(r,e){var t=this.doc.createProcessingInstruction(r,e);this.locator&&ph(this.locator,t),Cb(this,t)},ignorableWhitespace:function(r,e,t){},characters:function(r,e,t){if(r=ik.apply(this,arguments),r){if(this.cdata)var n=this.doc.createCDATASection(r);else var n=this.doc.createTextNode(r);this.currentElement?this.currentElement.appendChild(n):/^\s*$/.test(r)&&this.doc.appendChild(n),this.locator&&ph(this.locator,n)}},skippedEntity:function(r){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(r){(this.locator=r)&&(r.lineNumber=0)},comment:function(r,e,t){r=ik.apply(this,arguments);var n=this.doc.createComment(r);this.locator&&ph(this.locator,n),Cb(this,n)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(r,e,t){var n=this.doc.implementation;if(n&&n.createDocumentType){var i=n.createDocumentType(r,e,t);this.locator&&ph(this.locator,i),Cb(this,i),this.doc.doctype=i}},warning:function(r){console.warn("[xmldom warning] "+r,J2(this.locator))},error:function(r){console.error("[xmldom error] "+r,J2(this.locator))},fatalError:function(r){throw new F9(r,this.locator)}};function J2(r){if(r)return`
83
+ @`+(r.systemId||"")+"#[line:"+r.lineNumber+",col:"+r.columnNumber+"]"}function ik(r,e,t){return typeof r=="string"?r.substr(e,t):r.length>=e+t||e?new java.lang.String(r,e,t)+"":r}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(r){ig.prototype[r]=function(){return null}});function Cb(r,e){r.currentElement?r.currentElement.appendChild(e):r.doc.appendChild(e)}Rb.__DOMHandler=ig;Rb.normalizeLineEndings=ok;Rb.DOMParser=ak});var Ib=it(Db=>{Ce();De();Re();var uk=X2();Db.DOMImplementation=uk.DOMImplementation;Db.XMLSerializer=uk.XMLSerializer;Db.DOMParser=lk().DOMParser});var dk=it((uJ,e1)=>{Ce();De();Re();var Q2=(function(r){"use strict";var e=Object.prototype,t=e.hasOwnProperty,n=Object.defineProperty||function(N,x,P){N[x]=P.value},i,o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(N,x,P){return Object.defineProperty(N,x,{value:P,enumerable:!0,configurable:!0,writable:!0}),N[x]}try{c({},"")}catch{c=function(x,P,C){return x[P]=C}}function f(N,x,P,C){var j=x&&x.prototype instanceof y?x:y,U=Object.create(j.prototype),B=new Y(C||[]);return n(U,"_invoke",{value:K(N,P,B)}),U}r.wrap=f;function h(N,x,P){try{return{type:"normal",arg:N.call(x,P)}}catch(C){return{type:"throw",arg:C}}}var p="suspendedStart",m="suspendedYield",b="executing",v="completed",w={};function y(){}function _(){}function E(){}var S={};c(S,s,function(){return this});var A=Object.getPrototypeOf,F=A&&A(A(ie([])));F&&F!==e&&t.call(F,s)&&(S=F);var D=E.prototype=y.prototype=Object.create(S);_.prototype=E,n(D,"constructor",{value:E,configurable:!0}),n(E,"constructor",{value:_,configurable:!0}),_.displayName=c(E,u,"GeneratorFunction");function H(N){["next","throw","return"].forEach(function(x){c(N,x,function(P){return this._invoke(x,P)})})}r.isGeneratorFunction=function(N){var x=typeof N=="function"&&N.constructor;return x?x===_||(x.displayName||x.name)==="GeneratorFunction":!1},r.mark=function(N){return Object.setPrototypeOf?Object.setPrototypeOf(N,E):(N.__proto__=E,c(N,u,"GeneratorFunction")),N.prototype=Object.create(D),N},r.awrap=function(N){return{__await:N}};function J(N,x){function P(U,B,Q,fe){var _e=h(N[U],N,B);if(_e.type==="throw")fe(_e.arg);else{var te=_e.arg,W=te.value;return W&&typeof W=="object"&&t.call(W,"__await")?x.resolve(W.__await).then(function(oe){P("next",oe,Q,fe)},function(oe){P("throw",oe,Q,fe)}):x.resolve(W).then(function(oe){te.value=oe,Q(te)},function(oe){return P("throw",oe,Q,fe)})}}var C;function j(U,B){function Q(){return new x(function(fe,_e){P(U,B,fe,_e)})}return C=C?C.then(Q,Q):Q()}n(this,"_invoke",{value:j})}H(J.prototype),c(J.prototype,a,function(){return this}),r.AsyncIterator=J,r.async=function(N,x,P,C,j){j===void 0&&(j=Promise);var U=new J(f(N,x,P,C),j);return r.isGeneratorFunction(x)?U:U.next().then(function(B){return B.done?B.value:U.next()})};function K(N,x,P){var C=p;return function(U,B){if(C===b)throw new Error("Generator is already running");if(C===v){if(U==="throw")throw B;return re()}for(P.method=U,P.arg=B;;){var Q=P.delegate;if(Q){var fe=ne(Q,P);if(fe){if(fe===w)continue;return fe}}if(P.method==="next")P.sent=P._sent=P.arg;else if(P.method==="throw"){if(C===p)throw C=v,P.arg;P.dispatchException(P.arg)}else P.method==="return"&&P.abrupt("return",P.arg);C=b;var _e=h(N,x,P);if(_e.type==="normal"){if(C=P.done?v:m,_e.arg===w)continue;return{value:_e.arg,done:P.done}}else _e.type==="throw"&&(C=v,P.method="throw",P.arg=_e.arg)}}}function ne(N,x){var P=x.method,C=N.iterator[P];if(C===i)return x.delegate=null,P==="throw"&&N.iterator.return&&(x.method="return",x.arg=i,ne(N,x),x.method==="throw")||P!=="return"&&(x.method="throw",x.arg=new TypeError("The iterator does not provide a '"+P+"' method")),w;var j=h(C,N.iterator,x.arg);if(j.type==="throw")return x.method="throw",x.arg=j.arg,x.delegate=null,w;var U=j.arg;if(!U)return x.method="throw",x.arg=new TypeError("iterator result is not an object"),x.delegate=null,w;if(U.done)x[N.resultName]=U.value,x.next=N.nextLoc,x.method!=="return"&&(x.method="next",x.arg=i);else return U;return x.delegate=null,w}H(D),c(D,u,"Generator"),c(D,s,function(){return this}),c(D,"toString",function(){return"[object Generator]"});function k(N){var x={tryLoc:N[0]};1 in N&&(x.catchLoc=N[1]),2 in N&&(x.finallyLoc=N[2],x.afterLoc=N[3]),this.tryEntries.push(x)}function $(N){var x=N.completion||{};x.type="normal",delete x.arg,N.completion=x}function Y(N){this.tryEntries=[{tryLoc:"root"}],N.forEach(k,this),this.reset(!0)}r.keys=function(N){var x=Object(N),P=[];for(var C in x)P.push(C);return P.reverse(),function j(){for(;P.length;){var U=P.pop();if(U in x)return j.value=U,j.done=!1,j}return j.done=!0,j}};function ie(N){if(N){var x=N[s];if(x)return x.call(N);if(typeof N.next=="function")return N;if(!isNaN(N.length)){var P=-1,C=function j(){for(;++P<N.length;)if(t.call(N,P))return j.value=N[P],j.done=!1,j;return j.value=i,j.done=!0,j};return C.next=C}}return{next:re}}r.values=ie;function re(){return{value:i,done:!0}}return Y.prototype={constructor:Y,reset:function(N){if(this.prev=0,this.next=0,this.sent=this._sent=i,this.done=!1,this.delegate=null,this.method="next",this.arg=i,this.tryEntries.forEach($),!N)for(var x in this)x.charAt(0)==="t"&&t.call(this,x)&&!isNaN(+x.slice(1))&&(this[x]=i)},stop:function(){this.done=!0;var N=this.tryEntries[0],x=N.completion;if(x.type==="throw")throw x.arg;return this.rval},dispatchException:function(N){if(this.done)throw N;var x=this;function P(fe,_e){return U.type="throw",U.arg=N,x.next=fe,_e&&(x.method="next",x.arg=i),!!_e}for(var C=this.tryEntries.length-1;C>=0;--C){var j=this.tryEntries[C],U=j.completion;if(j.tryLoc==="root")return P("end");if(j.tryLoc<=this.prev){var B=t.call(j,"catchLoc"),Q=t.call(j,"finallyLoc");if(B&&Q){if(this.prev<j.catchLoc)return P(j.catchLoc,!0);if(this.prev<j.finallyLoc)return P(j.finallyLoc)}else if(B){if(this.prev<j.catchLoc)return P(j.catchLoc,!0)}else if(Q){if(this.prev<j.finallyLoc)return P(j.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(N,x){for(var P=this.tryEntries.length-1;P>=0;--P){var C=this.tryEntries[P];if(C.tryLoc<=this.prev&&t.call(C,"finallyLoc")&&this.prev<C.finallyLoc){var j=C;break}}j&&(N==="break"||N==="continue")&&j.tryLoc<=x&&x<=j.finallyLoc&&(j=null);var U=j?j.completion:{};return U.type=N,U.arg=x,j?(this.method="next",this.next=j.finallyLoc,w):this.complete(U)},complete:function(N,x){if(N.type==="throw")throw N.arg;return N.type==="break"||N.type==="continue"?this.next=N.arg:N.type==="return"?(this.rval=this.arg=N.arg,this.method="return",this.next="end"):N.type==="normal"&&x&&(this.next=x),w},finish:function(N){for(var x=this.tryEntries.length-1;x>=0;--x){var P=this.tryEntries[x];if(P.finallyLoc===N)return this.complete(P.completion,P.afterLoc),$(P),w}},catch:function(N){for(var x=this.tryEntries.length-1;x>=0;--x){var P=this.tryEntries[x];if(P.tryLoc===N){var C=P.completion;if(C.type==="throw"){var j=C.arg;$(P)}return j}}throw new Error("illegal catch attempt")},delegateYield:function(N,x,P){return this.delegate={iterator:ie(N),resultName:x,nextLoc:P},this.method==="next"&&(this.arg=i),w}},r})(typeof e1=="object"?e1.exports:{});try{regeneratorRuntime=Q2}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=Q2:Function("r","regeneratorRuntime = r")(Q2)}});var Ob=it((dJ,pk)=>{"use strict";Ce();De();Re();pk.exports=(r,e)=>`${r}-${e}-${Math.random().toString(16).slice(3,8)}`});var t1=it((yJ,mk)=>{"use strict";Ce();De();Re();var G9=Ob(),gk=0;mk.exports=({id:r,action:e,payload:t={}})=>{let n=r;return typeof n>"u"&&(n=G9("Job",gk),gk+=1),{id:n,action:e,payload:t}}});var Nb=it(og=>{"use strict";Ce();De();Re();var r1=!1;og.logging=r1;og.setLogging=r=>{r1=r};og.log=(...r)=>r1?console.log.apply(og,r):null});var vk=it((bk,wk)=>{"use strict";Ce();De();Re();var V9=t1(),{log:kb}=Nb(),Y9=Ob(),yk=0;wk.exports=()=>{let r=Y9("Scheduler",yk),e={},t={},n=[];yk+=1;let i=()=>n.length,o=()=>Object.keys(e).length,s=()=>{if(n.length!==0){let h=Object.keys(e);for(let p=0;p<h.length;p+=1)if(typeof t[h[p]]>"u"){n[0](e[h[p]]);break}}},a=(h,p)=>new Promise((m,b)=>{let v=V9({action:h,payload:p});n.push(async w=>{n.shift(),t[w.id]=v;try{m(await w[h].apply(bk,[...p,v.id]))}catch(y){b(y)}finally{delete t[w.id],s()}}),kb(`[${r}]: Add ${v.id} to JobQueue`),kb(`[${r}]: JobQueue length=${n.length}`),s()});return{addWorker:h=>(e[h.id]=h,kb(`[${r}]: Add ${h.id}`),kb(`[${r}]: Number of workers=${o()}`),s(),h.id),addJob:async(h,...p)=>{if(o()===0)throw Error(`[${r}]: You need to have at least one worker before adding jobs`);return a(h,p)},terminate:async()=>{Object.keys(e).forEach(async h=>{await e[h].terminate()}),n=[]},getQueueLen:i,getNumWorkers:o}}});var Ek=it((RJ,_k)=>{"use strict";Ce();De();Re();_k.exports=r=>{let e={};return typeof WorkerGlobalScope<"u"?e.type="webworker":typeof document=="object"?e.type="browser":typeof process=="object"&&typeof Au=="function"&&(e.type="node"),typeof r>"u"?e:e[r]}});var xk=it((kJ,Ak)=>{"use strict";Ce();De();Re();var X9=Ek()("type")==="browser",K9=X9?r=>new URL(r,window.location.href).href:r=>r;Ak.exports=r=>{let e={...r};return["corePath","workerPath","langPath"].forEach(t=>{r[t]&&(e[t]=K9(e[t]))}),e}});var n1=it((BJ,Sk)=>{"use strict";Ce();De();Re();Sk.exports={TESSERACT_ONLY:0,LSTM_ONLY:1,TESSERACT_LSTM_COMBINED:2,DEFAULT:3}});var Tk=it(($J,Z9)=>{Z9.exports={name:"tesseract.js",version:"6.0.1",description:"Pure Javascript Multilingual OCR",main:"src/index.js",type:"commonjs",types:"src/index.d.ts",unpkg:"dist/tesseract.min.js",jsdelivr:"dist/tesseract.min.js",scripts:{start:"node scripts/server.js",build:"rimraf dist && webpack --config scripts/webpack.config.prod.js && rollup -c scripts/rollup.esm.mjs","profile:tesseract":"webpack-bundle-analyzer dist/tesseract-stats.json","profile:worker":"webpack-bundle-analyzer dist/worker-stats.json",prepublishOnly:"npm run build",wait:"rimraf dist && wait-on http://localhost:3000/dist/tesseract.min.js",test:"npm-run-all -p -r start test:all","test:all":"npm-run-all wait test:browser test:node:all","test:browser":"karma start karma.conf.js","test:node":"nyc mocha --exit --bail --require ./scripts/test-helper.mjs","test:node:all":"npm run test:node -- ./tests/*.test.mjs",lint:"eslint src","lint:fix":"eslint --fix src",postinstall:"opencollective-postinstall || true"},browser:{"./src/worker/node/index.js":"./src/worker/browser/index.js"},author:"",contributors:["jeromewu"],license:"Apache-2.0",devDependencies:{"@babel/core":"^7.21.4","@babel/eslint-parser":"^7.21.3","@babel/preset-env":"^7.21.4","@rollup/plugin-commonjs":"^24.1.0",acorn:"^8.8.2","babel-loader":"^9.1.2",buffer:"^6.0.3",cors:"^2.8.5",eslint:"^7.32.0","eslint-config-airbnb-base":"^14.2.1","eslint-plugin-import":"^2.27.5","expect.js":"^0.3.1",express:"^4.18.2",mocha:"^10.2.0","npm-run-all":"^4.1.5",karma:"^6.4.2","karma-chrome-launcher":"^3.2.0","karma-firefox-launcher":"^2.1.2","karma-mocha":"^2.0.1","karma-webpack":"^5.0.0",nyc:"^15.1.0",rimraf:"^5.0.0",rollup:"^3.20.7","wait-on":"^7.0.1",webpack:"^5.79.0","webpack-bundle-analyzer":"^4.8.0","webpack-cli":"^5.0.1","webpack-dev-middleware":"^6.0.2","rollup-plugin-sourcemaps":"^0.6.3"},dependencies:{"bmp-js":"^0.1.0","idb-keyval":"^6.2.0","is-url":"^1.2.4","node-fetch":"^2.6.9","opencollective-postinstall":"^2.0.3","regenerator-runtime":"^0.13.3","tesseract.js-core":"^6.0.0","wasm-feature-detect":"^1.2.11",zlibjs:"^0.3.1"},overrides:{"@rollup/pluginutils":"^5.0.2"},repository:{type:"git",url:"https://github.com/naptha/tesseract.js.git"},bugs:{url:"https://github.com/naptha/tesseract.js/issues"},homepage:"https://github.com/naptha/tesseract.js",collective:{type:"opencollective",url:"https://opencollective.com/tesseractjs"}}});var Rk=it((zJ,Ck)=>{"use strict";Ce();De();Re();Ck.exports={workerBlobURL:!0,logger:()=>{}}});var Ik=it((GJ,Dk)=>{"use strict";Ce();De();Re();var J9=Tk().version,Q9=Rk();Dk.exports={...Q9,workerPath:`https://cdn.jsdelivr.net/npm/tesseract.js@v${J9}/dist/worker.min.js`}});var Nk=it((KJ,Ok)=>{"use strict";Ce();De();Re();Ok.exports=({workerPath:r,workerBlobURL:e})=>{let t;if(Blob&&URL&&e){let n=new Blob([`importScripts("${r}");`],{type:"application/javascript"});t=new Worker(URL.createObjectURL(n))}else t=new Worker(r);return t}});var Lk=it((eQ,kk)=>{"use strict";Ce();De();Re();kk.exports=r=>{r.terminate()}});var Mk=it((iQ,Pk)=>{"use strict";Ce();De();Re();Pk.exports=(r,e)=>{r.onmessage=({data:t})=>{e(t)}}});var Fk=it((lQ,Bk)=>{"use strict";Ce();De();Re();Bk.exports=async(r,e)=>{r.postMessage(e)}});var jk=it((hQ,Uk)=>{"use strict";Ce();De();Re();var i1=r=>new Promise((e,t)=>{let n=new FileReader;n.onload=()=>{e(n.result)},n.onerror=({target:{error:{code:i}}})=>{t(Error(`File could not be read! Code=${i}`))},n.readAsArrayBuffer(r)}),s1=async r=>{let e=r;if(typeof r>"u")return"undefined";if(typeof r=="string")/data:image\/([a-zA-Z]*);base64,([^"]*)/.test(r)?e=atob(r.split(",")[1]).split("").map(t=>t.charCodeAt(0)):e=await(await fetch(r)).arrayBuffer();else if(typeof HTMLElement<"u"&&r instanceof HTMLElement)r.tagName==="IMG"&&(e=await s1(r.src)),r.tagName==="VIDEO"&&(e=await s1(r.poster)),r.tagName==="CANVAS"&&await new Promise(t=>{r.toBlob(async n=>{e=await i1(n),t()})});else if(typeof OffscreenCanvas<"u"&&r instanceof OffscreenCanvas){let t=await r.convertToBlob();e=await i1(t)}else(r instanceof File||r instanceof Blob)&&(e=await i1(r));return new Uint8Array(e)};Uk.exports=s1});var zk=it((mQ,$k)=>{"use strict";Ce();De();Re();var e7=Ik(),t7=Nk(),r7=Lk(),n7=Mk(),i7=Fk(),s7=jk();$k.exports={defaultOptions:e7,spawnWorker:t7,terminateWorker:r7,onMessage:n7,send:i7,loadImage:s7}});var o1=it((vQ,Gk)=>{"use strict";Ce();De();Re();var o7=xk(),oo=t1(),{log:Wk}=Nb(),a7=Ob(),Xu=n1(),{defaultOptions:l7,spawnWorker:u7,terminateWorker:c7,onMessage:f7,loadImage:qk,send:h7}=zk(),Hk=0;Gk.exports=async(r="eng",e=Xu.LSTM_ONLY,t={},n={})=>{let i=a7("Worker",Hk),{logger:o,errorHandler:s,...a}=o7({...l7,...t}),u={},c=typeof r=="string"?r.split("+"):r,f=e,h=n,p=[Xu.DEFAULT,Xu.LSTM_ONLY].includes(e)&&!a.legacyCore,m,b,v=new Promise((N,x)=>{b=N,m=x}),w=N=>{m(N.message)},y=u7(a);y.onerror=w,Hk+=1;let _=({id:N,action:x,payload:P})=>new Promise((C,j)=>{Wk(`[${i}]: Start ${N}, action=${x}`);let U=`${x}-${N}`;u[U]={resolve:C,reject:j},h7(y,{workerId:i,jobId:N,action:x,payload:P})}),E=()=>console.warn("`load` is depreciated and should be removed from code (workers now come pre-loaded)"),S=N=>_(oo({id:N,action:"load",payload:{options:{lstmOnly:p,corePath:a.corePath,logging:a.logging}}})),A=(N,x,P)=>_(oo({id:P,action:"FS",payload:{method:"writeFile",args:[N,x]}})),F=(N,x)=>_(oo({id:x,action:"FS",payload:{method:"readFile",args:[N,{encoding:"utf8"}]}})),D=(N,x)=>_(oo({id:x,action:"FS",payload:{method:"unlink",args:[N]}})),H=(N,x,P)=>_(oo({id:P,action:"FS",payload:{method:N,args:x}})),J=(N,x)=>_(oo({id:x,action:"loadLanguage",payload:{langs:N,options:{langPath:a.langPath,dataPath:a.dataPath,cachePath:a.cachePath,cacheMethod:a.cacheMethod,gzip:a.gzip,lstmOnly:[Xu.DEFAULT,Xu.LSTM_ONLY].includes(f)&&!a.legacyLang}}})),K=(N,x,P,C)=>_(oo({id:C,action:"initialize",payload:{langs:N,oem:x,config:P}})),ne=(N="eng",x,P,C)=>{if(p&&[Xu.TESSERACT_ONLY,Xu.TESSERACT_LSTM_COMBINED].includes(x))throw Error("Legacy model requested but code missing.");let j=x||f;f=j;let U=P||h;h=U;let Q=(typeof N=="string"?N.split("+"):N).filter(fe=>!c.includes(fe));return c.push(...Q),Q.length>0?J(Q,C).then(()=>K(N,j,U,C)):K(N,j,U,C)},k=(N={},x)=>_(oo({id:x,action:"setParameters",payload:{params:N}})),$=async(N,x={},P={text:!0},C)=>_(oo({id:C,action:"recognize",payload:{image:await qk(N),options:x,output:P}})),Y=async(N,x)=>{if(p)throw Error("`worker.detect` requires Legacy model, which was not loaded.");return _(oo({id:x,action:"detect",payload:{image:await qk(N)}}))},ie=async()=>(y!==null&&(c7(y),y=null),Promise.resolve());f7(y,({workerId:N,jobId:x,status:P,action:C,data:j})=>{let U=`${C}-${x}`;if(P==="resolve")Wk(`[${N}]: Complete ${x}`),u[U].resolve({jobId:x,data:j}),delete u[U];else if(P==="reject")if(u[U].reject(j),delete u[U],C==="load"&&m(j),s)s(j);else throw Error(j);else P==="progress"&&o({...j,userJobId:x})});let re={id:i,worker:y,load:E,writeText:A,readText:F,removeFile:D,FS:H,reinitialize:ne,setParameters:k,recognize:$,detect:Y,terminate:ie};return S().then(()=>J(r)).then(()=>K(r,e,n)).then(()=>b(re)).catch(()=>{}),v}});var Xk=it((xQ,Yk)=>{"use strict";Ce();De();Re();var Vk=o1(),d7=async(r,e,t)=>{let n=await Vk(e,1,t);return n.recognize(r).finally(async()=>{await n.terminate()})},p7=async(r,e)=>{let t=await Vk("osd",0,e);return t.detect(r).finally(async()=>{await t.terminate()})};Yk.exports={recognize:d7,detect:p7}});var Zk=it((RQ,Kk)=>{"use strict";Ce();De();Re();Kk.exports={AFR:"afr",AMH:"amh",ARA:"ara",ASM:"asm",AZE:"aze",AZE_CYRL:"aze_cyrl",BEL:"bel",BEN:"ben",BOD:"bod",BOS:"bos",BUL:"bul",CAT:"cat",CEB:"ceb",CES:"ces",CHI_SIM:"chi_sim",CHI_TRA:"chi_tra",CHR:"chr",CYM:"cym",DAN:"dan",DEU:"deu",DZO:"dzo",ELL:"ell",ENG:"eng",ENM:"enm",EPO:"epo",EST:"est",EUS:"eus",FAS:"fas",FIN:"fin",FRA:"fra",FRK:"frk",FRM:"frm",GLE:"gle",GLG:"glg",GRC:"grc",GUJ:"guj",HAT:"hat",HEB:"heb",HIN:"hin",HRV:"hrv",HUN:"hun",IKU:"iku",IND:"ind",ISL:"isl",ITA:"ita",ITA_OLD:"ita_old",JAV:"jav",JPN:"jpn",KAN:"kan",KAT:"kat",KAT_OLD:"kat_old",KAZ:"kaz",KHM:"khm",KIR:"kir",KOR:"kor",KUR:"kur",LAO:"lao",LAT:"lat",LAV:"lav",LIT:"lit",MAL:"mal",MAR:"mar",MKD:"mkd",MLT:"mlt",MSA:"msa",MYA:"mya",NEP:"nep",NLD:"nld",NOR:"nor",ORI:"ori",PAN:"pan",POL:"pol",POR:"por",PUS:"pus",RON:"ron",RUS:"rus",SAN:"san",SIN:"sin",SLK:"slk",SLV:"slv",SPA:"spa",SPA_OLD:"spa_old",SQI:"sqi",SRP:"srp",SRP_LATN:"srp_latn",SWA:"swa",SWE:"swe",SYR:"syr",TAM:"tam",TEL:"tel",TGK:"tgk",TGL:"tgl",THA:"tha",TIR:"tir",TUR:"tur",UIG:"uig",UKR:"ukr",URD:"urd",UZB:"uzb",UZB_CYRL:"uzb_cyrl",VIE:"vie",YID:"yid"}});var Qk=it((NQ,Jk)=>{"use strict";Ce();De();Re();Jk.exports={OSD_ONLY:"0",AUTO_OSD:"1",AUTO_ONLY:"2",AUTO:"3",SINGLE_COLUMN:"4",SINGLE_BLOCK_VERT_TEXT:"5",SINGLE_BLOCK:"6",SINGLE_LINE:"7",SINGLE_WORD:"8",CIRCLE_WORD:"9",SINGLE_CHAR:"10",SPARSE_TEXT:"11",SPARSE_TEXT_OSD:"12",RAW_LINE:"13"}});var tL=it((MQ,eL)=>{"use strict";Ce();De();Re();dk();var g7=vk(),m7=o1(),y7=Xk(),b7=Zk(),w7=n1(),v7=Qk(),{setLogging:_7}=Nb();eL.exports={languages:b7,OEM:w7,PSM:v7,createScheduler:g7,createWorker:m7,setLogging:_7,...y7}});var bL={};Uo(bL,{Deflate:()=>N7,DeflateRaw:()=>k7,Gunzip:()=>L7,Gzip:()=>P7,Inflate:()=>M7,InflateRaw:()=>B7,Unzip:()=>F7,Z_BEST_COMPRESSION:()=>U7,Z_BEST_SPEED:()=>j7,Z_BINARY:()=>$7,Z_BLOCK:()=>z7,Z_BUF_ERROR:()=>W7,Z_DATA_ERROR:()=>q7,Z_DEFAULT_CHUNK:()=>H7,Z_DEFAULT_COMPRESSION:()=>G7,Z_DEFAULT_LEVEL:()=>V7,Z_DEFAULT_MEMLEVEL:()=>Y7,Z_DEFAULT_STRATEGY:()=>X7,Z_DEFAULT_WINDOWBITS:()=>K7,Z_DEFLATED:()=>Z7,Z_ERRNO:()=>J7,Z_FILTERED:()=>Q7,Z_FINISH:()=>ez,Z_FIXED:()=>tz,Z_FULL_FLUSH:()=>rz,Z_HUFFMAN_ONLY:()=>nz,Z_MAX_CHUNK:()=>iz,Z_MAX_LEVEL:()=>sz,Z_MAX_MEMLEVEL:()=>oz,Z_MAX_WINDOWBITS:()=>az,Z_MIN_CHUNK:()=>lz,Z_MIN_LEVEL:()=>uz,Z_MIN_MEMLEVEL:()=>cz,Z_MIN_WINDOWBITS:()=>fz,Z_NEED_DICT:()=>hz,Z_NO_COMPRESSION:()=>dz,Z_NO_FLUSH:()=>pz,Z_OK:()=>gz,Z_PARTIAL_FLUSH:()=>mz,Z_RLE:()=>yz,Z_STREAM_END:()=>bz,Z_STREAM_ERROR:()=>wz,Z_SYNC_FLUSH:()=>vz,Z_TEXT:()=>_z,Z_TREES:()=>Ez,Z_UNKNOWN:()=>Az,Zlib:()=>xz,codes:()=>Sz,createDeflate:()=>Tz,createDeflateRaw:()=>Cz,createGunzip:()=>Rz,createGzip:()=>Dz,createInflate:()=>Iz,createInflateRaw:()=>Oz,createUnzip:()=>Nz,default:()=>Ye,deflate:()=>kz,deflateRaw:()=>Lz,deflateRawSync:()=>Pz,deflateSync:()=>Mz,gunzip:()=>Bz,gunzipSync:()=>Fz,gzip:()=>Uz,gzipSync:()=>jz,inflate:()=>$z,inflateRaw:()=>zz,inflateRawSync:()=>Wz,inflateSync:()=>qz,unzip:()=>Hz,unzipSync:()=>Gz});function E7(){if(nL)return a1;nL=!0;function r(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}return a1=r,a1}function Lb(){if(iL)return Pn;iL=!0;var r=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function e(i,o){return Object.prototype.hasOwnProperty.call(i,o)}Pn.assign=function(i){for(var o=Array.prototype.slice.call(arguments,1);o.length;){var s=o.shift();if(s){if(typeof s!="object")throw new TypeError(s+"must be non-object");for(var a in s)e(s,a)&&(i[a]=s[a])}}return i},Pn.shrinkBuf=function(i,o){return i.length===o?i:i.subarray?i.subarray(0,o):(i.length=o,i)};var t={arraySet:function(i,o,s,a,u){if(o.subarray&&i.subarray){i.set(o.subarray(s,s+a),u);return}for(var c=0;c<a;c++)i[u+c]=o[s+c]},flattenChunks:function(i){var o,s,a,u,c,f;for(a=0,o=0,s=i.length;o<s;o++)a+=i[o].length;for(f=new Uint8Array(a),u=0,o=0,s=i.length;o<s;o++)c=i[o],f.set(c,u),u+=c.length;return f}},n={arraySet:function(i,o,s,a,u){for(var c=0;c<a;c++)i[u+c]=o[s+c]},flattenChunks:function(i){return[].concat.apply([],i)}};return Pn.setTyped=function(i){i?(Pn.Buf8=Uint8Array,Pn.Buf16=Uint16Array,Pn.Buf32=Int32Array,Pn.assign(Pn,t)):(Pn.Buf8=Array,Pn.Buf16=Array,Pn.Buf32=Array,Pn.assign(Pn,n))},Pn.setTyped(r),Pn}function A7(){if(sL)return Ku;sL=!0;var r=Lb(),e=4,t=0,n=1,i=2;function o(R){for(var le=R.length;--le>=0;)R[le]=0}var s=0,a=1,u=2,c=3,f=258,h=29,p=256,m=p+1+h,b=30,v=19,w=2*m+1,y=15,_=16,E=7,S=256,A=16,F=17,D=18,H=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],J=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],K=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],ne=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],k=512,$=new Array((m+2)*2);o($);var Y=new Array(b*2);o(Y);var ie=new Array(k);o(ie);var re=new Array(f-c+1);o(re);var N=new Array(h);o(N);var x=new Array(b);o(x);function P(R,le,pe,Ee,ve){this.static_tree=R,this.extra_bits=le,this.extra_base=pe,this.elems=Ee,this.max_length=ve,this.has_stree=R&&R.length}var C,j,U;function B(R,le){this.dyn_tree=R,this.max_code=0,this.stat_desc=le}function Q(R){return R<256?ie[R]:ie[256+(R>>>7)]}function fe(R,le){R.pending_buf[R.pending++]=le&255,R.pending_buf[R.pending++]=le>>>8&255}function _e(R,le,pe){R.bi_valid>_-pe?(R.bi_buf|=le<<R.bi_valid&65535,fe(R,R.bi_buf),R.bi_buf=le>>_-R.bi_valid,R.bi_valid+=pe-_):(R.bi_buf|=le<<R.bi_valid&65535,R.bi_valid+=pe)}function te(R,le,pe){_e(R,pe[le*2],pe[le*2+1])}function W(R,le){var pe=0;do pe|=R&1,R>>>=1,pe<<=1;while(--le>0);return pe>>>1}function oe(R){R.bi_valid===16?(fe(R,R.bi_buf),R.bi_buf=0,R.bi_valid=0):R.bi_valid>=8&&(R.pending_buf[R.pending++]=R.bi_buf&255,R.bi_buf>>=8,R.bi_valid-=8)}function be(R,le){var pe=le.dyn_tree,Ee=le.max_code,ve=le.stat_desc.static_tree,Ie=le.stat_desc.has_stree,V=le.stat_desc.extra_bits,Fe=le.stat_desc.extra_base,st=le.stat_desc.max_length,O,Pe,$e,he,Te,Me,ut=0;for(he=0;he<=y;he++)R.bl_count[he]=0;for(pe[R.heap[R.heap_max]*2+1]=0,O=R.heap_max+1;O<w;O++)Pe=R.heap[O],he=pe[pe[Pe*2+1]*2+1]+1,he>st&&(he=st,ut++),pe[Pe*2+1]=he,!(Pe>Ee)&&(R.bl_count[he]++,Te=0,Pe>=Fe&&(Te=V[Pe-Fe]),Me=pe[Pe*2],R.opt_len+=Me*(he+Te),Ie&&(R.static_len+=Me*(ve[Pe*2+1]+Te)));if(ut!==0){do{for(he=st-1;R.bl_count[he]===0;)he--;R.bl_count[he]--,R.bl_count[he+1]+=2,R.bl_count[st]--,ut-=2}while(ut>0);for(he=st;he!==0;he--)for(Pe=R.bl_count[he];Pe!==0;)$e=R.heap[--O],!($e>Ee)&&(pe[$e*2+1]!==he&&(R.opt_len+=(he-pe[$e*2+1])*pe[$e*2],pe[$e*2+1]=he),Pe--)}}function xe(R,le,pe){var Ee=new Array(y+1),ve=0,Ie,V;for(Ie=1;Ie<=y;Ie++)Ee[Ie]=ve=ve+pe[Ie-1]<<1;for(V=0;V<=le;V++){var Fe=R[V*2+1];Fe!==0&&(R[V*2]=W(Ee[Fe]++,Fe))}}function X(){var R,le,pe,Ee,ve,Ie=new Array(y+1);for(pe=0,Ee=0;Ee<h-1;Ee++)for(N[Ee]=pe,R=0;R<1<<H[Ee];R++)re[pe++]=Ee;for(re[pe-1]=Ee,ve=0,Ee=0;Ee<16;Ee++)for(x[Ee]=ve,R=0;R<1<<J[Ee];R++)ie[ve++]=Ee;for(ve>>=7;Ee<b;Ee++)for(x[Ee]=ve<<7,R=0;R<1<<J[Ee]-7;R++)ie[256+ve++]=Ee;for(le=0;le<=y;le++)Ie[le]=0;for(R=0;R<=143;)$[R*2+1]=8,R++,Ie[8]++;for(;R<=255;)$[R*2+1]=9,R++,Ie[9]++;for(;R<=279;)$[R*2+1]=7,R++,Ie[7]++;for(;R<=287;)$[R*2+1]=8,R++,Ie[8]++;for(xe($,m+1,Ie),R=0;R<b;R++)Y[R*2+1]=5,Y[R*2]=W(R,5);C=new P($,H,p+1,m,y),j=new P(Y,J,0,b,y),U=new P(new Array(0),K,0,v,E)}function M(R){var le;for(le=0;le<m;le++)R.dyn_ltree[le*2]=0;for(le=0;le<b;le++)R.dyn_dtree[le*2]=0;for(le=0;le<v;le++)R.bl_tree[le*2]=0;R.dyn_ltree[S*2]=1,R.opt_len=R.static_len=0,R.last_lit=R.matches=0}function ae(R){R.bi_valid>8?fe(R,R.bi_buf):R.bi_valid>0&&(R.pending_buf[R.pending++]=R.bi_buf),R.bi_buf=0,R.bi_valid=0}function ge(R,le,pe,Ee){ae(R),fe(R,pe),fe(R,~pe),r.arraySet(R.pending_buf,R.window,le,pe,R.pending),R.pending+=pe}function Se(R,le,pe,Ee){var ve=le*2,Ie=pe*2;return R[ve]<R[Ie]||R[ve]===R[Ie]&&Ee[le]<=Ee[pe]}function we(R,le,pe){for(var Ee=R.heap[pe],ve=pe<<1;ve<=R.heap_len&&(ve<R.heap_len&&Se(le,R.heap[ve+1],R.heap[ve],R.depth)&&ve++,!Se(le,Ee,R.heap[ve],R.depth));)R.heap[pe]=R.heap[ve],pe=ve,ve<<=1;R.heap[pe]=Ee}function de(R,le,pe){var Ee,ve,Ie=0,V,Fe;if(R.last_lit!==0)do Ee=R.pending_buf[R.d_buf+Ie*2]<<8|R.pending_buf[R.d_buf+Ie*2+1],ve=R.pending_buf[R.l_buf+Ie],Ie++,Ee===0?te(R,ve,le):(V=re[ve],te(R,V+p+1,le),Fe=H[V],Fe!==0&&(ve-=N[V],_e(R,ve,Fe)),Ee--,V=Q(Ee),te(R,V,pe),Fe=J[V],Fe!==0&&(Ee-=x[V],_e(R,Ee,Fe)));while(Ie<R.last_lit);te(R,S,le)}function Ae(R,le){var pe=le.dyn_tree,Ee=le.stat_desc.static_tree,ve=le.stat_desc.has_stree,Ie=le.stat_desc.elems,V,Fe,st=-1,O;for(R.heap_len=0,R.heap_max=w,V=0;V<Ie;V++)pe[V*2]!==0?(R.heap[++R.heap_len]=st=V,R.depth[V]=0):pe[V*2+1]=0;for(;R.heap_len<2;)O=R.heap[++R.heap_len]=st<2?++st:0,pe[O*2]=1,R.depth[O]=0,R.opt_len--,ve&&(R.static_len-=Ee[O*2+1]);for(le.max_code=st,V=R.heap_len>>1;V>=1;V--)we(R,pe,V);O=Ie;do V=R.heap[1],R.heap[1]=R.heap[R.heap_len--],we(R,pe,1),Fe=R.heap[1],R.heap[--R.heap_max]=V,R.heap[--R.heap_max]=Fe,pe[O*2]=pe[V*2]+pe[Fe*2],R.depth[O]=(R.depth[V]>=R.depth[Fe]?R.depth[V]:R.depth[Fe])+1,pe[V*2+1]=pe[Fe*2+1]=O,R.heap[1]=O++,we(R,pe,1);while(R.heap_len>=2);R.heap[--R.heap_max]=R.heap[1],be(R,le),xe(pe,st,R.bl_count)}function je(R,le,pe){var Ee,ve=-1,Ie,V=le[1],Fe=0,st=7,O=4;for(V===0&&(st=138,O=3),le[(pe+1)*2+1]=65535,Ee=0;Ee<=pe;Ee++)Ie=V,V=le[(Ee+1)*2+1],!(++Fe<st&&Ie===V)&&(Fe<O?R.bl_tree[Ie*2]+=Fe:Ie!==0?(Ie!==ve&&R.bl_tree[Ie*2]++,R.bl_tree[A*2]++):Fe<=10?R.bl_tree[F*2]++:R.bl_tree[D*2]++,Fe=0,ve=Ie,V===0?(st=138,O=3):Ie===V?(st=6,O=3):(st=7,O=4))}function ke(R,le,pe){var Ee,ve=-1,Ie,V=le[1],Fe=0,st=7,O=4;for(V===0&&(st=138,O=3),Ee=0;Ee<=pe;Ee++)if(Ie=V,V=le[(Ee+1)*2+1],!(++Fe<st&&Ie===V)){if(Fe<O)do te(R,Ie,R.bl_tree);while(--Fe!==0);else Ie!==0?(Ie!==ve&&(te(R,Ie,R.bl_tree),Fe--),te(R,A,R.bl_tree),_e(R,Fe-3,2)):Fe<=10?(te(R,F,R.bl_tree),_e(R,Fe-3,3)):(te(R,D,R.bl_tree),_e(R,Fe-11,7));Fe=0,ve=Ie,V===0?(st=138,O=3):Ie===V?(st=6,O=3):(st=7,O=4)}}function Oe(R){var le;for(je(R,R.dyn_ltree,R.l_desc.max_code),je(R,R.dyn_dtree,R.d_desc.max_code),Ae(R,R.bl_desc),le=v-1;le>=3&&R.bl_tree[ne[le]*2+1]===0;le--);return R.opt_len+=3*(le+1)+5+5+4,le}function Ve(R,le,pe,Ee){var ve;for(_e(R,le-257,5),_e(R,pe-1,5),_e(R,Ee-4,4),ve=0;ve<Ee;ve++)_e(R,R.bl_tree[ne[ve]*2+1],3);ke(R,R.dyn_ltree,le-1),ke(R,R.dyn_dtree,pe-1)}function Je(R){var le=4093624447,pe;for(pe=0;pe<=31;pe++,le>>>=1)if(le&1&&R.dyn_ltree[pe*2]!==0)return t;if(R.dyn_ltree[18]!==0||R.dyn_ltree[20]!==0||R.dyn_ltree[26]!==0)return n;for(pe=32;pe<p;pe++)if(R.dyn_ltree[pe*2]!==0)return n;return t}var et=!1;function T(R){et||(X(),et=!0),R.l_desc=new B(R.dyn_ltree,C),R.d_desc=new B(R.dyn_dtree,j),R.bl_desc=new B(R.bl_tree,U),R.bi_buf=0,R.bi_valid=0,M(R)}function d(R,le,pe,Ee){_e(R,(s<<1)+(Ee?1:0),3),ge(R,le,pe)}function g(R){_e(R,a<<1,3),te(R,S,$),oe(R)}function I(R,le,pe,Ee){var ve,Ie,V=0;R.level>0?(R.strm.data_type===i&&(R.strm.data_type=Je(R)),Ae(R,R.l_desc),Ae(R,R.d_desc),V=Oe(R),ve=R.opt_len+3+7>>>3,Ie=R.static_len+3+7>>>3,Ie<=ve&&(ve=Ie)):ve=Ie=pe+5,pe+4<=ve&&le!==-1?d(R,le,pe,Ee):R.strategy===e||Ie===ve?(_e(R,(a<<1)+(Ee?1:0),3),de(R,$,Y)):(_e(R,(u<<1)+(Ee?1:0),3),Ve(R,R.l_desc.max_code+1,R.d_desc.max_code+1,V+1),de(R,R.dyn_ltree,R.dyn_dtree)),M(R),Ee&&ae(R)}function Z(R,le,pe){return R.pending_buf[R.d_buf+R.last_lit*2]=le>>>8&255,R.pending_buf[R.d_buf+R.last_lit*2+1]=le&255,R.pending_buf[R.l_buf+R.last_lit]=pe&255,R.last_lit++,le===0?R.dyn_ltree[pe*2]++:(R.matches++,le--,R.dyn_ltree[(re[pe]+p+1)*2]++,R.dyn_dtree[Q(le)*2]++),R.last_lit===R.lit_bufsize-1}return Ku._tr_init=T,Ku._tr_stored_block=d,Ku._tr_flush_block=I,Ku._tr_tally=Z,Ku._tr_align=g,Ku}function mL(){if(oL)return l1;oL=!0;function r(e,t,n,i){for(var o=e&65535|0,s=e>>>16&65535|0,a=0;n!==0;){a=n>2e3?2e3:n,n-=a;do o=o+t[i++]|0,s=s+o|0;while(--a);o%=65521,s%=65521}return o|s<<16|0}return l1=r,l1}function yL(){if(aL)return u1;aL=!0;function r(){for(var n,i=[],o=0;o<256;o++){n=o;for(var s=0;s<8;s++)n=n&1?3988292384^n>>>1:n>>>1;i[o]=n}return i}var e=r();function t(n,i,o,s){var a=e,u=s+o;n^=-1;for(var c=s;c<u;c++)n=n>>>8^a[(n^i[c])&255];return n^-1}return u1=t,u1}function x7(){return lL||(lL=!0,c1={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}),c1}function S7(){if(uL)return Os;uL=!0;var r=Lb(),e=A7(),t=mL(),n=yL(),i=x7(),o=0,s=1,a=3,u=4,c=5,f=0,h=1,p=-2,m=-3,b=-5,v=-1,w=1,y=2,_=3,E=4,S=0,A=2,F=8,D=9,H=15,J=8,K=29,ne=256,k=ne+1+K,$=30,Y=19,ie=2*k+1,re=15,N=3,x=258,P=x+N+1,C=32,j=42,U=69,B=73,Q=91,fe=103,_e=113,te=666,W=1,oe=2,be=3,xe=4,X=3;function M(O,Pe){return O.msg=i[Pe],Pe}function ae(O){return(O<<1)-(O>4?9:0)}function ge(O){for(var Pe=O.length;--Pe>=0;)O[Pe]=0}function Se(O){var Pe=O.state,$e=Pe.pending;$e>O.avail_out&&($e=O.avail_out),$e!==0&&(r.arraySet(O.output,Pe.pending_buf,Pe.pending_out,$e,O.next_out),O.next_out+=$e,Pe.pending_out+=$e,O.total_out+=$e,O.avail_out-=$e,Pe.pending-=$e,Pe.pending===0&&(Pe.pending_out=0))}function we(O,Pe){e._tr_flush_block(O,O.block_start>=0?O.block_start:-1,O.strstart-O.block_start,Pe),O.block_start=O.strstart,Se(O.strm)}function de(O,Pe){O.pending_buf[O.pending++]=Pe}function Ae(O,Pe){O.pending_buf[O.pending++]=Pe>>>8&255,O.pending_buf[O.pending++]=Pe&255}function je(O,Pe,$e,he){var Te=O.avail_in;return Te>he&&(Te=he),Te===0?0:(O.avail_in-=Te,r.arraySet(Pe,O.input,O.next_in,Te,$e),O.state.wrap===1?O.adler=t(O.adler,Pe,Te,$e):O.state.wrap===2&&(O.adler=n(O.adler,Pe,Te,$e)),O.next_in+=Te,O.total_in+=Te,Te)}function ke(O,Pe){var $e=O.max_chain_length,he=O.strstart,Te,Me,ut=O.prev_length,ue=O.nice_match,me=O.strstart>O.w_size-P?O.strstart-(O.w_size-P):0,We=O.window,Ue=O.w_mask,Ze=O.prev,dt=O.strstart+x,Rt=We[he+ut-1],Et=We[he+ut];O.prev_length>=O.good_match&&($e>>=2),ue>O.lookahead&&(ue=O.lookahead);do if(Te=Pe,!(We[Te+ut]!==Et||We[Te+ut-1]!==Rt||We[Te]!==We[he]||We[++Te]!==We[he+1])){he+=2,Te++;do;while(We[++he]===We[++Te]&&We[++he]===We[++Te]&&We[++he]===We[++Te]&&We[++he]===We[++Te]&&We[++he]===We[++Te]&&We[++he]===We[++Te]&&We[++he]===We[++Te]&&We[++he]===We[++Te]&&he<dt);if(Me=x-(dt-he),he=dt-x,Me>ut){if(O.match_start=Pe,ut=Me,Me>=ue)break;Rt=We[he+ut-1],Et=We[he+ut]}}while((Pe=Ze[Pe&Ue])>me&&--$e!==0);return ut<=O.lookahead?ut:O.lookahead}function Oe(O){var Pe=O.w_size,$e,he,Te,Me,ut;do{if(Me=O.window_size-O.lookahead-O.strstart,O.strstart>=Pe+(Pe-P)){r.arraySet(O.window,O.window,Pe,Pe,0),O.match_start-=Pe,O.strstart-=Pe,O.block_start-=Pe,he=O.hash_size,$e=he;do Te=O.head[--$e],O.head[$e]=Te>=Pe?Te-Pe:0;while(--he);he=Pe,$e=he;do Te=O.prev[--$e],O.prev[$e]=Te>=Pe?Te-Pe:0;while(--he);Me+=Pe}if(O.strm.avail_in===0)break;if(he=je(O.strm,O.window,O.strstart+O.lookahead,Me),O.lookahead+=he,O.lookahead+O.insert>=N)for(ut=O.strstart-O.insert,O.ins_h=O.window[ut],O.ins_h=(O.ins_h<<O.hash_shift^O.window[ut+1])&O.hash_mask;O.insert&&(O.ins_h=(O.ins_h<<O.hash_shift^O.window[ut+N-1])&O.hash_mask,O.prev[ut&O.w_mask]=O.head[O.ins_h],O.head[O.ins_h]=ut,ut++,O.insert--,!(O.lookahead+O.insert<N)););}while(O.lookahead<P&&O.strm.avail_in!==0)}function Ve(O,Pe){var $e=65535;for($e>O.pending_buf_size-5&&($e=O.pending_buf_size-5);;){if(O.lookahead<=1){if(Oe(O),O.lookahead===0&&Pe===o)return W;if(O.lookahead===0)break}O.strstart+=O.lookahead,O.lookahead=0;var he=O.block_start+$e;if((O.strstart===0||O.strstart>=he)&&(O.lookahead=O.strstart-he,O.strstart=he,we(O,!1),O.strm.avail_out===0)||O.strstart-O.block_start>=O.w_size-P&&(we(O,!1),O.strm.avail_out===0))return W}return O.insert=0,Pe===u?(we(O,!0),O.strm.avail_out===0?be:xe):(O.strstart>O.block_start&&(we(O,!1),O.strm.avail_out===0),W)}function Je(O,Pe){for(var $e,he;;){if(O.lookahead<P){if(Oe(O),O.lookahead<P&&Pe===o)return W;if(O.lookahead===0)break}if($e=0,O.lookahead>=N&&(O.ins_h=(O.ins_h<<O.hash_shift^O.window[O.strstart+N-1])&O.hash_mask,$e=O.prev[O.strstart&O.w_mask]=O.head[O.ins_h],O.head[O.ins_h]=O.strstart),$e!==0&&O.strstart-$e<=O.w_size-P&&(O.match_length=ke(O,$e)),O.match_length>=N)if(he=e._tr_tally(O,O.strstart-O.match_start,O.match_length-N),O.lookahead-=O.match_length,O.match_length<=O.max_lazy_match&&O.lookahead>=N){O.match_length--;do O.strstart++,O.ins_h=(O.ins_h<<O.hash_shift^O.window[O.strstart+N-1])&O.hash_mask,$e=O.prev[O.strstart&O.w_mask]=O.head[O.ins_h],O.head[O.ins_h]=O.strstart;while(--O.match_length!==0);O.strstart++}else O.strstart+=O.match_length,O.match_length=0,O.ins_h=O.window[O.strstart],O.ins_h=(O.ins_h<<O.hash_shift^O.window[O.strstart+1])&O.hash_mask;else he=e._tr_tally(O,0,O.window[O.strstart]),O.lookahead--,O.strstart++;if(he&&(we(O,!1),O.strm.avail_out===0))return W}return O.insert=O.strstart<N-1?O.strstart:N-1,Pe===u?(we(O,!0),O.strm.avail_out===0?be:xe):O.last_lit&&(we(O,!1),O.strm.avail_out===0)?W:oe}function et(O,Pe){for(var $e,he,Te;;){if(O.lookahead<P){if(Oe(O),O.lookahead<P&&Pe===o)return W;if(O.lookahead===0)break}if($e=0,O.lookahead>=N&&(O.ins_h=(O.ins_h<<O.hash_shift^O.window[O.strstart+N-1])&O.hash_mask,$e=O.prev[O.strstart&O.w_mask]=O.head[O.ins_h],O.head[O.ins_h]=O.strstart),O.prev_length=O.match_length,O.prev_match=O.match_start,O.match_length=N-1,$e!==0&&O.prev_length<O.max_lazy_match&&O.strstart-$e<=O.w_size-P&&(O.match_length=ke(O,$e),O.match_length<=5&&(O.strategy===w||O.match_length===N&&O.strstart-O.match_start>4096)&&(O.match_length=N-1)),O.prev_length>=N&&O.match_length<=O.prev_length){Te=O.strstart+O.lookahead-N,he=e._tr_tally(O,O.strstart-1-O.prev_match,O.prev_length-N),O.lookahead-=O.prev_length-1,O.prev_length-=2;do++O.strstart<=Te&&(O.ins_h=(O.ins_h<<O.hash_shift^O.window[O.strstart+N-1])&O.hash_mask,$e=O.prev[O.strstart&O.w_mask]=O.head[O.ins_h],O.head[O.ins_h]=O.strstart);while(--O.prev_length!==0);if(O.match_available=0,O.match_length=N-1,O.strstart++,he&&(we(O,!1),O.strm.avail_out===0))return W}else if(O.match_available){if(he=e._tr_tally(O,0,O.window[O.strstart-1]),he&&we(O,!1),O.strstart++,O.lookahead--,O.strm.avail_out===0)return W}else O.match_available=1,O.strstart++,O.lookahead--}return O.match_available&&(he=e._tr_tally(O,0,O.window[O.strstart-1]),O.match_available=0),O.insert=O.strstart<N-1?O.strstart:N-1,Pe===u?(we(O,!0),O.strm.avail_out===0?be:xe):O.last_lit&&(we(O,!1),O.strm.avail_out===0)?W:oe}function T(O,Pe){for(var $e,he,Te,Me,ut=O.window;;){if(O.lookahead<=x){if(Oe(O),O.lookahead<=x&&Pe===o)return W;if(O.lookahead===0)break}if(O.match_length=0,O.lookahead>=N&&O.strstart>0&&(Te=O.strstart-1,he=ut[Te],he===ut[++Te]&&he===ut[++Te]&&he===ut[++Te])){Me=O.strstart+x;do;while(he===ut[++Te]&&he===ut[++Te]&&he===ut[++Te]&&he===ut[++Te]&&he===ut[++Te]&&he===ut[++Te]&&he===ut[++Te]&&he===ut[++Te]&&Te<Me);O.match_length=x-(Me-Te),O.match_length>O.lookahead&&(O.match_length=O.lookahead)}if(O.match_length>=N?($e=e._tr_tally(O,1,O.match_length-N),O.lookahead-=O.match_length,O.strstart+=O.match_length,O.match_length=0):($e=e._tr_tally(O,0,O.window[O.strstart]),O.lookahead--,O.strstart++),$e&&(we(O,!1),O.strm.avail_out===0))return W}return O.insert=0,Pe===u?(we(O,!0),O.strm.avail_out===0?be:xe):O.last_lit&&(we(O,!1),O.strm.avail_out===0)?W:oe}function d(O,Pe){for(var $e;;){if(O.lookahead===0&&(Oe(O),O.lookahead===0)){if(Pe===o)return W;break}if(O.match_length=0,$e=e._tr_tally(O,0,O.window[O.strstart]),O.lookahead--,O.strstart++,$e&&(we(O,!1),O.strm.avail_out===0))return W}return O.insert=0,Pe===u?(we(O,!0),O.strm.avail_out===0?be:xe):O.last_lit&&(we(O,!1),O.strm.avail_out===0)?W:oe}function g(O,Pe,$e,he,Te){this.good_length=O,this.max_lazy=Pe,this.nice_length=$e,this.max_chain=he,this.func=Te}var I;I=[new g(0,0,0,0,Ve),new g(4,4,8,4,Je),new g(4,5,16,8,Je),new g(4,6,32,32,Je),new g(4,4,16,16,et),new g(8,16,32,32,et),new g(8,16,128,128,et),new g(8,32,128,256,et),new g(32,128,258,1024,et),new g(32,258,258,4096,et)];function Z(O){O.window_size=2*O.w_size,ge(O.head),O.max_lazy_match=I[O.level].max_lazy,O.good_match=I[O.level].good_length,O.nice_match=I[O.level].nice_length,O.max_chain_length=I[O.level].max_chain,O.strstart=0,O.block_start=0,O.lookahead=0,O.insert=0,O.match_length=O.prev_length=N-1,O.match_available=0,O.ins_h=0}function R(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=F,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new r.Buf16(ie*2),this.dyn_dtree=new r.Buf16((2*$+1)*2),this.bl_tree=new r.Buf16((2*Y+1)*2),ge(this.dyn_ltree),ge(this.dyn_dtree),ge(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new r.Buf16(re+1),this.heap=new r.Buf16(2*k+1),ge(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new r.Buf16(2*k+1),ge(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function le(O){var Pe;return!O||!O.state?M(O,p):(O.total_in=O.total_out=0,O.data_type=A,Pe=O.state,Pe.pending=0,Pe.pending_out=0,Pe.wrap<0&&(Pe.wrap=-Pe.wrap),Pe.status=Pe.wrap?j:_e,O.adler=Pe.wrap===2?0:1,Pe.last_flush=o,e._tr_init(Pe),f)}function pe(O){var Pe=le(O);return Pe===f&&Z(O.state),Pe}function Ee(O,Pe){return!O||!O.state||O.state.wrap!==2?p:(O.state.gzhead=Pe,f)}function ve(O,Pe,$e,he,Te,Me){if(!O)return p;var ut=1;if(Pe===v&&(Pe=6),he<0?(ut=0,he=-he):he>15&&(ut=2,he-=16),Te<1||Te>D||$e!==F||he<8||he>15||Pe<0||Pe>9||Me<0||Me>E)return M(O,p);he===8&&(he=9);var ue=new R;return O.state=ue,ue.strm=O,ue.wrap=ut,ue.gzhead=null,ue.w_bits=he,ue.w_size=1<<ue.w_bits,ue.w_mask=ue.w_size-1,ue.hash_bits=Te+7,ue.hash_size=1<<ue.hash_bits,ue.hash_mask=ue.hash_size-1,ue.hash_shift=~~((ue.hash_bits+N-1)/N),ue.window=new r.Buf8(ue.w_size*2),ue.head=new r.Buf16(ue.hash_size),ue.prev=new r.Buf16(ue.w_size),ue.lit_bufsize=1<<Te+6,ue.pending_buf_size=ue.lit_bufsize*4,ue.pending_buf=new r.Buf8(ue.pending_buf_size),ue.d_buf=1*ue.lit_bufsize,ue.l_buf=3*ue.lit_bufsize,ue.level=Pe,ue.strategy=Me,ue.method=$e,pe(O)}function Ie(O,Pe){return ve(O,Pe,F,H,J,S)}function V(O,Pe){var $e,he,Te,Me;if(!O||!O.state||Pe>c||Pe<0)return O?M(O,p):p;if(he=O.state,!O.output||!O.input&&O.avail_in!==0||he.status===te&&Pe!==u)return M(O,O.avail_out===0?b:p);if(he.strm=O,$e=he.last_flush,he.last_flush=Pe,he.status===j)if(he.wrap===2)O.adler=0,de(he,31),de(he,139),de(he,8),he.gzhead?(de(he,(he.gzhead.text?1:0)+(he.gzhead.hcrc?2:0)+(he.gzhead.extra?4:0)+(he.gzhead.name?8:0)+(he.gzhead.comment?16:0)),de(he,he.gzhead.time&255),de(he,he.gzhead.time>>8&255),de(he,he.gzhead.time>>16&255),de(he,he.gzhead.time>>24&255),de(he,he.level===9?2:he.strategy>=y||he.level<2?4:0),de(he,he.gzhead.os&255),he.gzhead.extra&&he.gzhead.extra.length&&(de(he,he.gzhead.extra.length&255),de(he,he.gzhead.extra.length>>8&255)),he.gzhead.hcrc&&(O.adler=n(O.adler,he.pending_buf,he.pending,0)),he.gzindex=0,he.status=U):(de(he,0),de(he,0),de(he,0),de(he,0),de(he,0),de(he,he.level===9?2:he.strategy>=y||he.level<2?4:0),de(he,X),he.status=_e);else{var ut=F+(he.w_bits-8<<4)<<8,ue=-1;he.strategy>=y||he.level<2?ue=0:he.level<6?ue=1:he.level===6?ue=2:ue=3,ut|=ue<<6,he.strstart!==0&&(ut|=C),ut+=31-ut%31,he.status=_e,Ae(he,ut),he.strstart!==0&&(Ae(he,O.adler>>>16),Ae(he,O.adler&65535)),O.adler=1}if(he.status===U)if(he.gzhead.extra){for(Te=he.pending;he.gzindex<(he.gzhead.extra.length&65535)&&!(he.pending===he.pending_buf_size&&(he.gzhead.hcrc&&he.pending>Te&&(O.adler=n(O.adler,he.pending_buf,he.pending-Te,Te)),Se(O),Te=he.pending,he.pending===he.pending_buf_size));)de(he,he.gzhead.extra[he.gzindex]&255),he.gzindex++;he.gzhead.hcrc&&he.pending>Te&&(O.adler=n(O.adler,he.pending_buf,he.pending-Te,Te)),he.gzindex===he.gzhead.extra.length&&(he.gzindex=0,he.status=B)}else he.status=B;if(he.status===B)if(he.gzhead.name){Te=he.pending;do{if(he.pending===he.pending_buf_size&&(he.gzhead.hcrc&&he.pending>Te&&(O.adler=n(O.adler,he.pending_buf,he.pending-Te,Te)),Se(O),Te=he.pending,he.pending===he.pending_buf_size)){Me=1;break}he.gzindex<he.gzhead.name.length?Me=he.gzhead.name.charCodeAt(he.gzindex++)&255:Me=0,de(he,Me)}while(Me!==0);he.gzhead.hcrc&&he.pending>Te&&(O.adler=n(O.adler,he.pending_buf,he.pending-Te,Te)),Me===0&&(he.gzindex=0,he.status=Q)}else he.status=Q;if(he.status===Q)if(he.gzhead.comment){Te=he.pending;do{if(he.pending===he.pending_buf_size&&(he.gzhead.hcrc&&he.pending>Te&&(O.adler=n(O.adler,he.pending_buf,he.pending-Te,Te)),Se(O),Te=he.pending,he.pending===he.pending_buf_size)){Me=1;break}he.gzindex<he.gzhead.comment.length?Me=he.gzhead.comment.charCodeAt(he.gzindex++)&255:Me=0,de(he,Me)}while(Me!==0);he.gzhead.hcrc&&he.pending>Te&&(O.adler=n(O.adler,he.pending_buf,he.pending-Te,Te)),Me===0&&(he.status=fe)}else he.status=fe;if(he.status===fe&&(he.gzhead.hcrc?(he.pending+2>he.pending_buf_size&&Se(O),he.pending+2<=he.pending_buf_size&&(de(he,O.adler&255),de(he,O.adler>>8&255),O.adler=0,he.status=_e)):he.status=_e),he.pending!==0){if(Se(O),O.avail_out===0)return he.last_flush=-1,f}else if(O.avail_in===0&&ae(Pe)<=ae($e)&&Pe!==u)return M(O,b);if(he.status===te&&O.avail_in!==0)return M(O,b);if(O.avail_in!==0||he.lookahead!==0||Pe!==o&&he.status!==te){var me=he.strategy===y?d(he,Pe):he.strategy===_?T(he,Pe):I[he.level].func(he,Pe);if((me===be||me===xe)&&(he.status=te),me===W||me===be)return O.avail_out===0&&(he.last_flush=-1),f;if(me===oe&&(Pe===s?e._tr_align(he):Pe!==c&&(e._tr_stored_block(he,0,0,!1),Pe===a&&(ge(he.head),he.lookahead===0&&(he.strstart=0,he.block_start=0,he.insert=0))),Se(O),O.avail_out===0))return he.last_flush=-1,f}return Pe!==u?f:he.wrap<=0?h:(he.wrap===2?(de(he,O.adler&255),de(he,O.adler>>8&255),de(he,O.adler>>16&255),de(he,O.adler>>24&255),de(he,O.total_in&255),de(he,O.total_in>>8&255),de(he,O.total_in>>16&255),de(he,O.total_in>>24&255)):(Ae(he,O.adler>>>16),Ae(he,O.adler&65535)),Se(O),he.wrap>0&&(he.wrap=-he.wrap),he.pending!==0?f:h)}function Fe(O){var Pe;return!O||!O.state?p:(Pe=O.state.status,Pe!==j&&Pe!==U&&Pe!==B&&Pe!==Q&&Pe!==fe&&Pe!==_e&&Pe!==te?M(O,p):(O.state=null,Pe===_e?M(O,m):f))}function st(O,Pe){var $e=Pe.length,he,Te,Me,ut,ue,me,We,Ue;if(!O||!O.state||(he=O.state,ut=he.wrap,ut===2||ut===1&&he.status!==j||he.lookahead))return p;for(ut===1&&(O.adler=t(O.adler,Pe,$e,0)),he.wrap=0,$e>=he.w_size&&(ut===0&&(ge(he.head),he.strstart=0,he.block_start=0,he.insert=0),Ue=new r.Buf8(he.w_size),r.arraySet(Ue,Pe,$e-he.w_size,he.w_size,0),Pe=Ue,$e=he.w_size),ue=O.avail_in,me=O.next_in,We=O.input,O.avail_in=$e,O.next_in=0,O.input=Pe,Oe(he);he.lookahead>=N;){Te=he.strstart,Me=he.lookahead-(N-1);do he.ins_h=(he.ins_h<<he.hash_shift^he.window[Te+N-1])&he.hash_mask,he.prev[Te&he.w_mask]=he.head[he.ins_h],he.head[he.ins_h]=Te,Te++;while(--Me);he.strstart=Te,he.lookahead=N-1,Oe(he)}return he.strstart+=he.lookahead,he.block_start=he.strstart,he.insert=he.lookahead,he.lookahead=0,he.match_length=he.prev_length=N-1,he.match_available=0,O.next_in=me,O.input=We,O.avail_in=ue,he.wrap=ut,f}return Os.deflateInit=Ie,Os.deflateInit2=ve,Os.deflateReset=pe,Os.deflateResetKeep=le,Os.deflateSetHeader=Ee,Os.deflate=V,Os.deflateEnd=Fe,Os.deflateSetDictionary=st,Os.deflateInfo="pako deflate (from Nodeca project)",Os}function T7(){if(cL)return f1;cL=!0;var r=30,e=12;return f1=function(n,i){var o,s,a,u,c,f,h,p,m,b,v,w,y,_,E,S,A,F,D,H,J,K,ne,k,$;o=n.state,s=n.next_in,k=n.input,a=s+(n.avail_in-5),u=n.next_out,$=n.output,c=u-(i-n.avail_out),f=u+(n.avail_out-257),h=o.dmax,p=o.wsize,m=o.whave,b=o.wnext,v=o.window,w=o.hold,y=o.bits,_=o.lencode,E=o.distcode,S=(1<<o.lenbits)-1,A=(1<<o.distbits)-1;e:do{y<15&&(w+=k[s++]<<y,y+=8,w+=k[s++]<<y,y+=8),F=_[w&S];t:for(;;){if(D=F>>>24,w>>>=D,y-=D,D=F>>>16&255,D===0)$[u++]=F&65535;else if(D&16){H=F&65535,D&=15,D&&(y<D&&(w+=k[s++]<<y,y+=8),H+=w&(1<<D)-1,w>>>=D,y-=D),y<15&&(w+=k[s++]<<y,y+=8,w+=k[s++]<<y,y+=8),F=E[w&A];r:for(;;){if(D=F>>>24,w>>>=D,y-=D,D=F>>>16&255,D&16){if(J=F&65535,D&=15,y<D&&(w+=k[s++]<<y,y+=8,y<D&&(w+=k[s++]<<y,y+=8)),J+=w&(1<<D)-1,J>h){n.msg="invalid distance too far back",o.mode=r;break e}if(w>>>=D,y-=D,D=u-c,J>D){if(D=J-D,D>m&&o.sane){n.msg="invalid distance too far back",o.mode=r;break e}if(K=0,ne=v,b===0){if(K+=p-D,D<H){H-=D;do $[u++]=v[K++];while(--D);K=u-J,ne=$}}else if(b<D){if(K+=p+b-D,D-=b,D<H){H-=D;do $[u++]=v[K++];while(--D);if(K=0,b<H){D=b,H-=D;do $[u++]=v[K++];while(--D);K=u-J,ne=$}}}else if(K+=b-D,D<H){H-=D;do $[u++]=v[K++];while(--D);K=u-J,ne=$}for(;H>2;)$[u++]=ne[K++],$[u++]=ne[K++],$[u++]=ne[K++],H-=3;H&&($[u++]=ne[K++],H>1&&($[u++]=ne[K++]))}else{K=u-J;do $[u++]=$[K++],$[u++]=$[K++],$[u++]=$[K++],H-=3;while(H>2);H&&($[u++]=$[K++],H>1&&($[u++]=$[K++]))}}else if((D&64)===0){F=E[(F&65535)+(w&(1<<D)-1)];continue r}else{n.msg="invalid distance code",o.mode=r;break e}break}}else if((D&64)===0){F=_[(F&65535)+(w&(1<<D)-1)];continue t}else if(D&32){o.mode=e;break e}else{n.msg="invalid literal/length code",o.mode=r;break e}break}}while(s<a&&u<f);H=y>>3,s-=H,y-=H<<3,w&=(1<<y)-1,n.next_in=s,n.next_out=u,n.avail_in=s<a?5+(a-s):5-(s-a),n.avail_out=u<f?257+(f-u):257-(u-f),o.hold=w,o.bits=y},f1}function C7(){if(fL)return h1;fL=!0;var r=Lb(),e=15,t=852,n=592,i=0,o=1,s=2,a=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],u=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],c=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],f=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];return h1=function(p,m,b,v,w,y,_,E){var S=E.bits,A=0,F=0,D=0,H=0,J=0,K=0,ne=0,k=0,$=0,Y=0,ie,re,N,x,P,C=null,j=0,U,B=new r.Buf16(e+1),Q=new r.Buf16(e+1),fe=null,_e=0,te,W,oe;for(A=0;A<=e;A++)B[A]=0;for(F=0;F<v;F++)B[m[b+F]]++;for(J=S,H=e;H>=1&&B[H]===0;H--);if(J>H&&(J=H),H===0)return w[y++]=1<<24|64<<16|0,w[y++]=1<<24|64<<16|0,E.bits=1,0;for(D=1;D<H&&B[D]===0;D++);for(J<D&&(J=D),k=1,A=1;A<=e;A++)if(k<<=1,k-=B[A],k<0)return-1;if(k>0&&(p===i||H!==1))return-1;for(Q[1]=0,A=1;A<e;A++)Q[A+1]=Q[A]+B[A];for(F=0;F<v;F++)m[b+F]!==0&&(_[Q[m[b+F]]++]=F);if(p===i?(C=fe=_,U=19):p===o?(C=a,j-=257,fe=u,_e-=257,U=256):(C=c,fe=f,U=-1),Y=0,F=0,A=D,P=y,K=J,ne=0,N=-1,$=1<<J,x=$-1,p===o&&$>t||p===s&&$>n)return 1;for(;;){te=A-ne,_[F]<U?(W=0,oe=_[F]):_[F]>U?(W=fe[_e+_[F]],oe=C[j+_[F]]):(W=96,oe=0),ie=1<<A-ne,re=1<<K,D=re;do re-=ie,w[P+(Y>>ne)+re]=te<<24|W<<16|oe|0;while(re!==0);for(ie=1<<A-1;Y&ie;)ie>>=1;if(ie!==0?(Y&=ie-1,Y+=ie):Y=0,F++,--B[A]===0){if(A===H)break;A=m[b+_[F]]}if(A>J&&(Y&x)!==N){for(ne===0&&(ne=J),P+=D,K=A-ne,k=1<<K;K+ne<H&&(k-=B[K+ne],!(k<=0));)K++,k<<=1;if($+=1<<K,p===o&&$>t||p===s&&$>n)return 1;N=Y&x,w[N]=J<<24|K<<16|P-y|0}}return Y!==0&&(w[P+Y]=A-ne<<24|64<<16|0),E.bits=J,0},h1}function R7(){if(hL)return is;hL=!0;var r=Lb(),e=mL(),t=yL(),n=T7(),i=C7(),o=0,s=1,a=2,u=4,c=5,f=6,h=0,p=1,m=2,b=-2,v=-3,w=-4,y=-5,_=8,E=1,S=2,A=3,F=4,D=5,H=6,J=7,K=8,ne=9,k=10,$=11,Y=12,ie=13,re=14,N=15,x=16,P=17,C=18,j=19,U=20,B=21,Q=22,fe=23,_e=24,te=25,W=26,oe=27,be=28,xe=29,X=30,M=31,ae=32,ge=852,Se=592,we=15,de=we;function Ae(ve){return(ve>>>24&255)+(ve>>>8&65280)+((ve&65280)<<8)+((ve&255)<<24)}function je(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function ke(ve){var Ie;return!ve||!ve.state?b:(Ie=ve.state,ve.total_in=ve.total_out=Ie.total=0,ve.msg="",Ie.wrap&&(ve.adler=Ie.wrap&1),Ie.mode=E,Ie.last=0,Ie.havedict=0,Ie.dmax=32768,Ie.head=null,Ie.hold=0,Ie.bits=0,Ie.lencode=Ie.lendyn=new r.Buf32(ge),Ie.distcode=Ie.distdyn=new r.Buf32(Se),Ie.sane=1,Ie.back=-1,h)}function Oe(ve){var Ie;return!ve||!ve.state?b:(Ie=ve.state,Ie.wsize=0,Ie.whave=0,Ie.wnext=0,ke(ve))}function Ve(ve,Ie){var V,Fe;return!ve||!ve.state||(Fe=ve.state,Ie<0?(V=0,Ie=-Ie):(V=(Ie>>4)+1,Ie<48&&(Ie&=15)),Ie&&(Ie<8||Ie>15))?b:(Fe.window!==null&&Fe.wbits!==Ie&&(Fe.window=null),Fe.wrap=V,Fe.wbits=Ie,Oe(ve))}function Je(ve,Ie){var V,Fe;return ve?(Fe=new je,ve.state=Fe,Fe.window=null,V=Ve(ve,Ie),V!==h&&(ve.state=null),V):b}function et(ve){return Je(ve,de)}var T=!0,d,g;function I(ve){if(T){var Ie;for(d=new r.Buf32(512),g=new r.Buf32(32),Ie=0;Ie<144;)ve.lens[Ie++]=8;for(;Ie<256;)ve.lens[Ie++]=9;for(;Ie<280;)ve.lens[Ie++]=7;for(;Ie<288;)ve.lens[Ie++]=8;for(i(s,ve.lens,0,288,d,0,ve.work,{bits:9}),Ie=0;Ie<32;)ve.lens[Ie++]=5;i(a,ve.lens,0,32,g,0,ve.work,{bits:5}),T=!1}ve.lencode=d,ve.lenbits=9,ve.distcode=g,ve.distbits=5}function Z(ve,Ie,V,Fe){var st,O=ve.state;return O.window===null&&(O.wsize=1<<O.wbits,O.wnext=0,O.whave=0,O.window=new r.Buf8(O.wsize)),Fe>=O.wsize?(r.arraySet(O.window,Ie,V-O.wsize,O.wsize,0),O.wnext=0,O.whave=O.wsize):(st=O.wsize-O.wnext,st>Fe&&(st=Fe),r.arraySet(O.window,Ie,V-Fe,st,O.wnext),Fe-=st,Fe?(r.arraySet(O.window,Ie,V-Fe,Fe,0),O.wnext=Fe,O.whave=O.wsize):(O.wnext+=st,O.wnext===O.wsize&&(O.wnext=0),O.whave<O.wsize&&(O.whave+=st))),0}function R(ve,Ie){var V,Fe,st,O,Pe,$e,he,Te,Me,ut,ue,me,We,Ue,Ze=0,dt,Rt,Et,ar,_i,qn,Ht,Dr,yr=new r.Buf8(4),zt,Yt,Zr=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!ve||!ve.state||!ve.output||!ve.input&&ve.avail_in!==0)return b;V=ve.state,V.mode===Y&&(V.mode=ie),Pe=ve.next_out,st=ve.output,he=ve.avail_out,O=ve.next_in,Fe=ve.input,$e=ve.avail_in,Te=V.hold,Me=V.bits,ut=$e,ue=he,Dr=h;e:for(;;)switch(V.mode){case E:if(V.wrap===0){V.mode=ie;break}for(;Me<16;){if($e===0)break e;$e--,Te+=Fe[O++]<<Me,Me+=8}if(V.wrap&2&&Te===35615){V.check=0,yr[0]=Te&255,yr[1]=Te>>>8&255,V.check=t(V.check,yr,2,0),Te=0,Me=0,V.mode=S;break}if(V.flags=0,V.head&&(V.head.done=!1),!(V.wrap&1)||(((Te&255)<<8)+(Te>>8))%31){ve.msg="incorrect header check",V.mode=X;break}if((Te&15)!==_){ve.msg="unknown compression method",V.mode=X;break}if(Te>>>=4,Me-=4,Ht=(Te&15)+8,V.wbits===0)V.wbits=Ht;else if(Ht>V.wbits){ve.msg="invalid window size",V.mode=X;break}V.dmax=1<<Ht,ve.adler=V.check=1,V.mode=Te&512?k:Y,Te=0,Me=0;break;case S:for(;Me<16;){if($e===0)break e;$e--,Te+=Fe[O++]<<Me,Me+=8}if(V.flags=Te,(V.flags&255)!==_){ve.msg="unknown compression method",V.mode=X;break}if(V.flags&57344){ve.msg="unknown header flags set",V.mode=X;break}V.head&&(V.head.text=Te>>8&1),V.flags&512&&(yr[0]=Te&255,yr[1]=Te>>>8&255,V.check=t(V.check,yr,2,0)),Te=0,Me=0,V.mode=A;case A:for(;Me<32;){if($e===0)break e;$e--,Te+=Fe[O++]<<Me,Me+=8}V.head&&(V.head.time=Te),V.flags&512&&(yr[0]=Te&255,yr[1]=Te>>>8&255,yr[2]=Te>>>16&255,yr[3]=Te>>>24&255,V.check=t(V.check,yr,4,0)),Te=0,Me=0,V.mode=F;case F:for(;Me<16;){if($e===0)break e;$e--,Te+=Fe[O++]<<Me,Me+=8}V.head&&(V.head.xflags=Te&255,V.head.os=Te>>8),V.flags&512&&(yr[0]=Te&255,yr[1]=Te>>>8&255,V.check=t(V.check,yr,2,0)),Te=0,Me=0,V.mode=D;case D:if(V.flags&1024){for(;Me<16;){if($e===0)break e;$e--,Te+=Fe[O++]<<Me,Me+=8}V.length=Te,V.head&&(V.head.extra_len=Te),V.flags&512&&(yr[0]=Te&255,yr[1]=Te>>>8&255,V.check=t(V.check,yr,2,0)),Te=0,Me=0}else V.head&&(V.head.extra=null);V.mode=H;case H:if(V.flags&1024&&(me=V.length,me>$e&&(me=$e),me&&(V.head&&(Ht=V.head.extra_len-V.length,V.head.extra||(V.head.extra=new Array(V.head.extra_len)),r.arraySet(V.head.extra,Fe,O,me,Ht)),V.flags&512&&(V.check=t(V.check,Fe,me,O)),$e-=me,O+=me,V.length-=me),V.length))break e;V.length=0,V.mode=J;case J:if(V.flags&2048){if($e===0)break e;me=0;do Ht=Fe[O+me++],V.head&&Ht&&V.length<65536&&(V.head.name+=String.fromCharCode(Ht));while(Ht&&me<$e);if(V.flags&512&&(V.check=t(V.check,Fe,me,O)),$e-=me,O+=me,Ht)break e}else V.head&&(V.head.name=null);V.length=0,V.mode=K;case K:if(V.flags&4096){if($e===0)break e;me=0;do Ht=Fe[O+me++],V.head&&Ht&&V.length<65536&&(V.head.comment+=String.fromCharCode(Ht));while(Ht&&me<$e);if(V.flags&512&&(V.check=t(V.check,Fe,me,O)),$e-=me,O+=me,Ht)break e}else V.head&&(V.head.comment=null);V.mode=ne;case ne:if(V.flags&512){for(;Me<16;){if($e===0)break e;$e--,Te+=Fe[O++]<<Me,Me+=8}if(Te!==(V.check&65535)){ve.msg="header crc mismatch",V.mode=X;break}Te=0,Me=0}V.head&&(V.head.hcrc=V.flags>>9&1,V.head.done=!0),ve.adler=V.check=0,V.mode=Y;break;case k:for(;Me<32;){if($e===0)break e;$e--,Te+=Fe[O++]<<Me,Me+=8}ve.adler=V.check=Ae(Te),Te=0,Me=0,V.mode=$;case $:if(V.havedict===0)return ve.next_out=Pe,ve.avail_out=he,ve.next_in=O,ve.avail_in=$e,V.hold=Te,V.bits=Me,m;ve.adler=V.check=1,V.mode=Y;case Y:if(Ie===c||Ie===f)break e;case ie:if(V.last){Te>>>=Me&7,Me-=Me&7,V.mode=oe;break}for(;Me<3;){if($e===0)break e;$e--,Te+=Fe[O++]<<Me,Me+=8}switch(V.last=Te&1,Te>>>=1,Me-=1,Te&3){case 0:V.mode=re;break;case 1:if(I(V),V.mode=U,Ie===f){Te>>>=2,Me-=2;break e}break;case 2:V.mode=P;break;case 3:ve.msg="invalid block type",V.mode=X}Te>>>=2,Me-=2;break;case re:for(Te>>>=Me&7,Me-=Me&7;Me<32;){if($e===0)break e;$e--,Te+=Fe[O++]<<Me,Me+=8}if((Te&65535)!==(Te>>>16^65535)){ve.msg="invalid stored block lengths",V.mode=X;break}if(V.length=Te&65535,Te=0,Me=0,V.mode=N,Ie===f)break e;case N:V.mode=x;case x:if(me=V.length,me){if(me>$e&&(me=$e),me>he&&(me=he),me===0)break e;r.arraySet(st,Fe,O,me,Pe),$e-=me,O+=me,he-=me,Pe+=me,V.length-=me;break}V.mode=Y;break;case P:for(;Me<14;){if($e===0)break e;$e--,Te+=Fe[O++]<<Me,Me+=8}if(V.nlen=(Te&31)+257,Te>>>=5,Me-=5,V.ndist=(Te&31)+1,Te>>>=5,Me-=5,V.ncode=(Te&15)+4,Te>>>=4,Me-=4,V.nlen>286||V.ndist>30){ve.msg="too many length or distance symbols",V.mode=X;break}V.have=0,V.mode=C;case C:for(;V.have<V.ncode;){for(;Me<3;){if($e===0)break e;$e--,Te+=Fe[O++]<<Me,Me+=8}V.lens[Zr[V.have++]]=Te&7,Te>>>=3,Me-=3}for(;V.have<19;)V.lens[Zr[V.have++]]=0;if(V.lencode=V.lendyn,V.lenbits=7,zt={bits:V.lenbits},Dr=i(o,V.lens,0,19,V.lencode,0,V.work,zt),V.lenbits=zt.bits,Dr){ve.msg="invalid code lengths set",V.mode=X;break}V.have=0,V.mode=j;case j:for(;V.have<V.nlen+V.ndist;){for(;Ze=V.lencode[Te&(1<<V.lenbits)-1],dt=Ze>>>24,Rt=Ze>>>16&255,Et=Ze&65535,!(dt<=Me);){if($e===0)break e;$e--,Te+=Fe[O++]<<Me,Me+=8}if(Et<16)Te>>>=dt,Me-=dt,V.lens[V.have++]=Et;else{if(Et===16){for(Yt=dt+2;Me<Yt;){if($e===0)break e;$e--,Te+=Fe[O++]<<Me,Me+=8}if(Te>>>=dt,Me-=dt,V.have===0){ve.msg="invalid bit length repeat",V.mode=X;break}Ht=V.lens[V.have-1],me=3+(Te&3),Te>>>=2,Me-=2}else if(Et===17){for(Yt=dt+3;Me<Yt;){if($e===0)break e;$e--,Te+=Fe[O++]<<Me,Me+=8}Te>>>=dt,Me-=dt,Ht=0,me=3+(Te&7),Te>>>=3,Me-=3}else{for(Yt=dt+7;Me<Yt;){if($e===0)break e;$e--,Te+=Fe[O++]<<Me,Me+=8}Te>>>=dt,Me-=dt,Ht=0,me=11+(Te&127),Te>>>=7,Me-=7}if(V.have+me>V.nlen+V.ndist){ve.msg="invalid bit length repeat",V.mode=X;break}for(;me--;)V.lens[V.have++]=Ht}}if(V.mode===X)break;if(V.lens[256]===0){ve.msg="invalid code -- missing end-of-block",V.mode=X;break}if(V.lenbits=9,zt={bits:V.lenbits},Dr=i(s,V.lens,0,V.nlen,V.lencode,0,V.work,zt),V.lenbits=zt.bits,Dr){ve.msg="invalid literal/lengths set",V.mode=X;break}if(V.distbits=6,V.distcode=V.distdyn,zt={bits:V.distbits},Dr=i(a,V.lens,V.nlen,V.ndist,V.distcode,0,V.work,zt),V.distbits=zt.bits,Dr){ve.msg="invalid distances set",V.mode=X;break}if(V.mode=U,Ie===f)break e;case U:V.mode=B;case B:if($e>=6&&he>=258){ve.next_out=Pe,ve.avail_out=he,ve.next_in=O,ve.avail_in=$e,V.hold=Te,V.bits=Me,n(ve,ue),Pe=ve.next_out,st=ve.output,he=ve.avail_out,O=ve.next_in,Fe=ve.input,$e=ve.avail_in,Te=V.hold,Me=V.bits,V.mode===Y&&(V.back=-1);break}for(V.back=0;Ze=V.lencode[Te&(1<<V.lenbits)-1],dt=Ze>>>24,Rt=Ze>>>16&255,Et=Ze&65535,!(dt<=Me);){if($e===0)break e;$e--,Te+=Fe[O++]<<Me,Me+=8}if(Rt&&(Rt&240)===0){for(ar=dt,_i=Rt,qn=Et;Ze=V.lencode[qn+((Te&(1<<ar+_i)-1)>>ar)],dt=Ze>>>24,Rt=Ze>>>16&255,Et=Ze&65535,!(ar+dt<=Me);){if($e===0)break e;$e--,Te+=Fe[O++]<<Me,Me+=8}Te>>>=ar,Me-=ar,V.back+=ar}if(Te>>>=dt,Me-=dt,V.back+=dt,V.length=Et,Rt===0){V.mode=W;break}if(Rt&32){V.back=-1,V.mode=Y;break}if(Rt&64){ve.msg="invalid literal/length code",V.mode=X;break}V.extra=Rt&15,V.mode=Q;case Q:if(V.extra){for(Yt=V.extra;Me<Yt;){if($e===0)break e;$e--,Te+=Fe[O++]<<Me,Me+=8}V.length+=Te&(1<<V.extra)-1,Te>>>=V.extra,Me-=V.extra,V.back+=V.extra}V.was=V.length,V.mode=fe;case fe:for(;Ze=V.distcode[Te&(1<<V.distbits)-1],dt=Ze>>>24,Rt=Ze>>>16&255,Et=Ze&65535,!(dt<=Me);){if($e===0)break e;$e--,Te+=Fe[O++]<<Me,Me+=8}if((Rt&240)===0){for(ar=dt,_i=Rt,qn=Et;Ze=V.distcode[qn+((Te&(1<<ar+_i)-1)>>ar)],dt=Ze>>>24,Rt=Ze>>>16&255,Et=Ze&65535,!(ar+dt<=Me);){if($e===0)break e;$e--,Te+=Fe[O++]<<Me,Me+=8}Te>>>=ar,Me-=ar,V.back+=ar}if(Te>>>=dt,Me-=dt,V.back+=dt,Rt&64){ve.msg="invalid distance code",V.mode=X;break}V.offset=Et,V.extra=Rt&15,V.mode=_e;case _e:if(V.extra){for(Yt=V.extra;Me<Yt;){if($e===0)break e;$e--,Te+=Fe[O++]<<Me,Me+=8}V.offset+=Te&(1<<V.extra)-1,Te>>>=V.extra,Me-=V.extra,V.back+=V.extra}if(V.offset>V.dmax){ve.msg="invalid distance too far back",V.mode=X;break}V.mode=te;case te:if(he===0)break e;if(me=ue-he,V.offset>me){if(me=V.offset-me,me>V.whave&&V.sane){ve.msg="invalid distance too far back",V.mode=X;break}me>V.wnext?(me-=V.wnext,We=V.wsize-me):We=V.wnext-me,me>V.length&&(me=V.length),Ue=V.window}else Ue=st,We=Pe-V.offset,me=V.length;me>he&&(me=he),he-=me,V.length-=me;do st[Pe++]=Ue[We++];while(--me);V.length===0&&(V.mode=B);break;case W:if(he===0)break e;st[Pe++]=V.length,he--,V.mode=B;break;case oe:if(V.wrap){for(;Me<32;){if($e===0)break e;$e--,Te|=Fe[O++]<<Me,Me+=8}if(ue-=he,ve.total_out+=ue,V.total+=ue,ue&&(ve.adler=V.check=V.flags?t(V.check,st,ue,Pe-ue):e(V.check,st,ue,Pe-ue)),ue=he,(V.flags?Te:Ae(Te))!==V.check){ve.msg="incorrect data check",V.mode=X;break}Te=0,Me=0}V.mode=be;case be:if(V.wrap&&V.flags){for(;Me<32;){if($e===0)break e;$e--,Te+=Fe[O++]<<Me,Me+=8}if(Te!==(V.total&4294967295)){ve.msg="incorrect length check",V.mode=X;break}Te=0,Me=0}V.mode=xe;case xe:Dr=p;break e;case X:Dr=v;break e;case M:return w;case ae:default:return b}return ve.next_out=Pe,ve.avail_out=he,ve.next_in=O,ve.avail_in=$e,V.hold=Te,V.bits=Me,(V.wsize||ue!==ve.avail_out&&V.mode<X&&(V.mode<oe||Ie!==u))&&Z(ve,ve.output,ve.next_out,ue-ve.avail_out),ut-=ve.avail_in,ue-=ve.avail_out,ve.total_in+=ut,ve.total_out+=ue,V.total+=ue,V.wrap&&ue&&(ve.adler=V.check=V.flags?t(V.check,st,ue,ve.next_out-ue):e(V.check,st,ue,ve.next_out-ue)),ve.data_type=V.bits+(V.last?64:0)+(V.mode===Y?128:0)+(V.mode===U||V.mode===N?256:0),(ut===0&&ue===0||Ie===u)&&Dr===h&&(Dr=y),Dr}function le(ve){if(!ve||!ve.state)return b;var Ie=ve.state;return Ie.window&&(Ie.window=null),ve.state=null,h}function pe(ve,Ie){var V;return!ve||!ve.state||(V=ve.state,(V.wrap&2)===0)?b:(V.head=Ie,Ie.done=!1,h)}function Ee(ve,Ie){var V=Ie.length,Fe,st,O;return!ve||!ve.state||(Fe=ve.state,Fe.wrap!==0&&Fe.mode!==$)?b:Fe.mode===$&&(st=1,st=e(st,Ie,V,0),st!==Fe.check)?v:(O=Z(ve,Ie,V,V),O?(Fe.mode=M,w):(Fe.havedict=1,h))}return is.inflateReset=Oe,is.inflateReset2=Ve,is.inflateResetKeep=ke,is.inflateInit=et,is.inflateInit2=Je,is.inflate=R,is.inflateEnd=le,is.inflateGetHeader=pe,is.inflateSetDictionary=Ee,is.inflateInfo="pako inflate (from Nodeca project)",is}function D7(){return dL||(dL=!0,d1={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}),d1}function I7(){if(pL)return Qe;pL=!0;var r=fn().Buffer,e=zr,t=pt,n=E7(),i=S7(),o=R7(),s=D7();for(var a in s)Qe[a]=s[a];Qe.NONE=0,Qe.DEFLATE=1,Qe.INFLATE=2,Qe.GZIP=3,Qe.GUNZIP=4,Qe.DEFLATERAW=5,Qe.INFLATERAW=6,Qe.UNZIP=7;var u=31,c=139;function f(h){if(typeof h!="number"||h<Qe.DEFLATE||h>Qe.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=h,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}return f.prototype.close=function(){if(this.write_in_progress){this.pending_close=!0;return}this.pending_close=!1,t(this.init_done,"close before init"),t(this.mode<=Qe.UNZIP),this.mode===Qe.DEFLATE||this.mode===Qe.GZIP||this.mode===Qe.DEFLATERAW?i.deflateEnd(this.strm):(this.mode===Qe.INFLATE||this.mode===Qe.GUNZIP||this.mode===Qe.INFLATERAW||this.mode===Qe.UNZIP)&&o.inflateEnd(this.strm),this.mode=Qe.NONE,this.dictionary=null},f.prototype.write=function(h,p,m,b,v,w,y){return this._write(!0,h,p,m,b,v,w,y)},f.prototype.writeSync=function(h,p,m,b,v,w,y){return this._write(!1,h,p,m,b,v,w,y)},f.prototype._write=function(h,p,m,b,v,w,y,_){if(t.equal(arguments.length,8),t(this.init_done,"write before init"),t(this.mode!==Qe.NONE,"already finalized"),t.equal(!1,this.write_in_progress,"write already in progress"),t.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,t.equal(!1,p===void 0,"must provide flush value"),this.write_in_progress=!0,p!==Qe.Z_NO_FLUSH&&p!==Qe.Z_PARTIAL_FLUSH&&p!==Qe.Z_SYNC_FLUSH&&p!==Qe.Z_FULL_FLUSH&&p!==Qe.Z_FINISH&&p!==Qe.Z_BLOCK)throw new Error("Invalid flush value");if(m==null&&(m=r.alloc(0),v=0,b=0),this.strm.avail_in=v,this.strm.input=m,this.strm.next_in=b,this.strm.avail_out=_,this.strm.output=w,this.strm.next_out=y,this.flush=p,!h)return this._process(),this._checkError()?this._afterSync():void 0;var E=this;return e.nextTick(function(){E._process(),E._after()}),this},f.prototype._afterSync=function(){var h=this.strm.avail_out,p=this.strm.avail_in;return this.write_in_progress=!1,[p,h]},f.prototype._process=function(){var h=null;switch(this.mode){case Qe.DEFLATE:case Qe.GZIP:case Qe.DEFLATERAW:this.err=i.deflate(this.strm,this.flush);break;case Qe.UNZIP:switch(this.strm.avail_in>0&&(h=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(h===null)break;if(this.strm.input[h]===u){if(this.gzip_id_bytes_read=1,h++,this.strm.avail_in===1)break}else{this.mode=Qe.INFLATE;break}case 1:if(h===null)break;this.strm.input[h]===c?(this.gzip_id_bytes_read=2,this.mode=Qe.GUNZIP):this.mode=Qe.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case Qe.INFLATE:case Qe.GUNZIP:case Qe.INFLATERAW:for(this.err=o.inflate(this.strm,this.flush),this.err===Qe.Z_NEED_DICT&&this.dictionary&&(this.err=o.inflateSetDictionary(this.strm,this.dictionary),this.err===Qe.Z_OK?this.err=o.inflate(this.strm,this.flush):this.err===Qe.Z_DATA_ERROR&&(this.err=Qe.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===Qe.GUNZIP&&this.err===Qe.Z_STREAM_END&&this.strm.next_in[0]!==0;)this.reset(),this.err=o.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},f.prototype._checkError=function(){switch(this.err){case Qe.Z_OK:case Qe.Z_BUF_ERROR:if(this.strm.avail_out!==0&&this.flush===Qe.Z_FINISH)return this._error("unexpected end of file"),!1;break;case Qe.Z_STREAM_END:break;case Qe.Z_NEED_DICT:return this.dictionary==null?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},f.prototype._after=function(){if(this._checkError()){var h=this.strm.avail_out,p=this.strm.avail_in;this.write_in_progress=!1,this.callback(p,h),this.pending_close&&this.close()}},f.prototype._error=function(h){this.strm.msg&&(h=this.strm.msg),this.onerror(h,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},f.prototype.init=function(h,p,m,b,v){t(arguments.length===4||arguments.length===5,"init(windowBits, level, memLevel, strategy, [dictionary])"),t(h>=8&&h<=15,"invalid windowBits"),t(p>=-1&&p<=9,"invalid compression level"),t(m>=1&&m<=9,"invalid memlevel"),t(b===Qe.Z_FILTERED||b===Qe.Z_HUFFMAN_ONLY||b===Qe.Z_RLE||b===Qe.Z_FIXED||b===Qe.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(p,h,m,b,v),this._setDictionary()},f.prototype.params=function(){throw new Error("deflateParams Not supported")},f.prototype.reset=function(){this._reset(),this._setDictionary()},f.prototype._init=function(h,p,m,b,v){switch(this.level=h,this.windowBits=p,this.memLevel=m,this.strategy=b,this.flush=Qe.Z_NO_FLUSH,this.err=Qe.Z_OK,(this.mode===Qe.GZIP||this.mode===Qe.GUNZIP)&&(this.windowBits+=16),this.mode===Qe.UNZIP&&(this.windowBits+=32),(this.mode===Qe.DEFLATERAW||this.mode===Qe.INFLATERAW)&&(this.windowBits=-1*this.windowBits),this.strm=new n,this.mode){case Qe.DEFLATE:case Qe.GZIP:case Qe.DEFLATERAW:this.err=i.deflateInit2(this.strm,this.level,Qe.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case Qe.INFLATE:case Qe.GUNZIP:case Qe.INFLATERAW:case Qe.UNZIP:this.err=o.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==Qe.Z_OK&&this._error("Init error"),this.dictionary=v,this.write_in_progress=!1,this.init_done=!0},f.prototype._setDictionary=function(){if(this.dictionary!=null){switch(this.err=Qe.Z_OK,this.mode){case Qe.DEFLATE:case Qe.DEFLATERAW:this.err=i.deflateSetDictionary(this.strm,this.dictionary);break}this.err!==Qe.Z_OK&&this._error("Failed to set dictionary")}},f.prototype._reset=function(){switch(this.err=Qe.Z_OK,this.mode){case Qe.DEFLATE:case Qe.DEFLATERAW:case Qe.GZIP:this.err=i.deflateReset(this.strm);break;case Qe.INFLATE:case Qe.INFLATERAW:case Qe.GUNZIP:this.err=o.inflateReset(this.strm);break}this.err!==Qe.Z_OK&&this._error("Failed to reset stream")},Qe.Zlib=f,Qe}function O7(){if(gL)return ht;gL=!0;var r=zr,e=fn().Buffer,t=ii.Transform,n=I7(),i=ze,o=pt.ok,s=fn().kMaxLength,a="Cannot create final Buffer. It would be larger than 0x"+s.toString(16)+" bytes";n.Z_MIN_WINDOWBITS=8,n.Z_MAX_WINDOWBITS=15,n.Z_DEFAULT_WINDOWBITS=15,n.Z_MIN_CHUNK=64,n.Z_MAX_CHUNK=1/0,n.Z_DEFAULT_CHUNK=16*1024,n.Z_MIN_MEMLEVEL=1,n.Z_MAX_MEMLEVEL=9,n.Z_DEFAULT_MEMLEVEL=8,n.Z_MIN_LEVEL=-1,n.Z_MAX_LEVEL=9,n.Z_DEFAULT_LEVEL=n.Z_DEFAULT_COMPRESSION;for(var u=Object.keys(n),c=0;c<u.length;c++){var f=u[c];f.match(/^Z/)&&Object.defineProperty(ht,f,{enumerable:!0,value:n[f],writable:!1})}for(var h={Z_OK:n.Z_OK,Z_STREAM_END:n.Z_STREAM_END,Z_NEED_DICT:n.Z_NEED_DICT,Z_ERRNO:n.Z_ERRNO,Z_STREAM_ERROR:n.Z_STREAM_ERROR,Z_DATA_ERROR:n.Z_DATA_ERROR,Z_MEM_ERROR:n.Z_MEM_ERROR,Z_BUF_ERROR:n.Z_BUF_ERROR,Z_VERSION_ERROR:n.Z_VERSION_ERROR},p=Object.keys(h),m=0;m<p.length;m++){var b=p[m];h[h[b]]=b}Object.defineProperty(ht,"codes",{enumerable:!0,value:Object.freeze(h),writable:!1}),ht.Deflate=y,ht.Inflate=_,ht.Gzip=E,ht.Gunzip=S,ht.DeflateRaw=A,ht.InflateRaw=F,ht.Unzip=D,ht.createDeflate=function(k){return new y(k)},ht.createInflate=function(k){return new _(k)},ht.createDeflateRaw=function(k){return new A(k)},ht.createInflateRaw=function(k){return new F(k)},ht.createGzip=function(k){return new E(k)},ht.createGunzip=function(k){return new S(k)},ht.createUnzip=function(k){return new D(k)},ht.deflate=function(k,$,Y){return typeof $=="function"&&(Y=$,$={}),v(new y($),k,Y)},ht.deflateSync=function(k,$){return w(new y($),k)},ht.gzip=function(k,$,Y){return typeof $=="function"&&(Y=$,$={}),v(new E($),k,Y)},ht.gzipSync=function(k,$){return w(new E($),k)},ht.deflateRaw=function(k,$,Y){return typeof $=="function"&&(Y=$,$={}),v(new A($),k,Y)},ht.deflateRawSync=function(k,$){return w(new A($),k)},ht.unzip=function(k,$,Y){return typeof $=="function"&&(Y=$,$={}),v(new D($),k,Y)},ht.unzipSync=function(k,$){return w(new D($),k)},ht.inflate=function(k,$,Y){return typeof $=="function"&&(Y=$,$={}),v(new _($),k,Y)},ht.inflateSync=function(k,$){return w(new _($),k)},ht.gunzip=function(k,$,Y){return typeof $=="function"&&(Y=$,$={}),v(new S($),k,Y)},ht.gunzipSync=function(k,$){return w(new S($),k)},ht.inflateRaw=function(k,$,Y){return typeof $=="function"&&(Y=$,$={}),v(new F($),k,Y)},ht.inflateRawSync=function(k,$){return w(new F($),k)};function v(k,$,Y){var ie=[],re=0;k.on("error",x),k.on("end",P),k.end($),N();function N(){for(var C;(C=k.read())!==null;)ie.push(C),re+=C.length;k.once("readable",N)}function x(C){k.removeListener("end",P),k.removeListener("readable",N),Y(C)}function P(){var C,j=null;re>=s?j=new RangeError(a):C=e.concat(ie,re),ie=[],k.close(),Y(j,C)}}function w(k,$){if(typeof $=="string"&&($=e.from($)),!e.isBuffer($))throw new TypeError("Not a string or buffer");var Y=k._finishFlushFlag;return k._processChunk($,Y)}function y(k){if(!(this instanceof y))return new y(k);J.call(this,k,n.DEFLATE)}function _(k){if(!(this instanceof _))return new _(k);J.call(this,k,n.INFLATE)}function E(k){if(!(this instanceof E))return new E(k);J.call(this,k,n.GZIP)}function S(k){if(!(this instanceof S))return new S(k);J.call(this,k,n.GUNZIP)}function A(k){if(!(this instanceof A))return new A(k);J.call(this,k,n.DEFLATERAW)}function F(k){if(!(this instanceof F))return new F(k);J.call(this,k,n.INFLATERAW)}function D(k){if(!(this instanceof D))return new D(k);J.call(this,k,n.UNZIP)}function H(k){return k===n.Z_NO_FLUSH||k===n.Z_PARTIAL_FLUSH||k===n.Z_SYNC_FLUSH||k===n.Z_FULL_FLUSH||k===n.Z_FINISH||k===n.Z_BLOCK}function J(k,$){var Y=this;if(this._opts=k=k||{},this._chunkSize=k.chunkSize||ht.Z_DEFAULT_CHUNK,t.call(this,k),k.flush&&!H(k.flush))throw new Error("Invalid flush flag: "+k.flush);if(k.finishFlush&&!H(k.finishFlush))throw new Error("Invalid flush flag: "+k.finishFlush);if(this._flushFlag=k.flush||n.Z_NO_FLUSH,this._finishFlushFlag=typeof k.finishFlush<"u"?k.finishFlush:n.Z_FINISH,k.chunkSize&&(k.chunkSize<ht.Z_MIN_CHUNK||k.chunkSize>ht.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+k.chunkSize);if(k.windowBits&&(k.windowBits<ht.Z_MIN_WINDOWBITS||k.windowBits>ht.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+k.windowBits);if(k.level&&(k.level<ht.Z_MIN_LEVEL||k.level>ht.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+k.level);if(k.memLevel&&(k.memLevel<ht.Z_MIN_MEMLEVEL||k.memLevel>ht.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+k.memLevel);if(k.strategy&&k.strategy!=ht.Z_FILTERED&&k.strategy!=ht.Z_HUFFMAN_ONLY&&k.strategy!=ht.Z_RLE&&k.strategy!=ht.Z_FIXED&&k.strategy!=ht.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+k.strategy);if(k.dictionary&&!e.isBuffer(k.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new n.Zlib($);var ie=this;this._hadError=!1,this._handle.onerror=function(x,P){K(ie),ie._hadError=!0;var C=new Error(x);C.errno=P,C.code=ht.codes[P],ie.emit("error",C)};var re=ht.Z_DEFAULT_COMPRESSION;typeof k.level=="number"&&(re=k.level);var N=ht.Z_DEFAULT_STRATEGY;typeof k.strategy=="number"&&(N=k.strategy),this._handle.init(k.windowBits||ht.Z_DEFAULT_WINDOWBITS,re,k.memLevel||ht.Z_DEFAULT_MEMLEVEL,N,k.dictionary),this._buffer=e.allocUnsafe(this._chunkSize),this._offset=0,this._level=re,this._strategy=N,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!Y._handle},configurable:!0,enumerable:!0})}i.inherits(J,t),J.prototype.params=function(k,$,Y){if(k<ht.Z_MIN_LEVEL||k>ht.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+k);if($!=ht.Z_FILTERED&&$!=ht.Z_HUFFMAN_ONLY&&$!=ht.Z_RLE&&$!=ht.Z_FIXED&&$!=ht.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+$);if(this._level!==k||this._strategy!==$){var ie=this;this.flush(n.Z_SYNC_FLUSH,function(){o(ie._handle,"zlib binding closed"),ie._handle.params(k,$),ie._hadError||(ie._level=k,ie._strategy=$,Y&&Y())})}else r.nextTick(Y)},J.prototype.reset=function(){return o(this._handle,"zlib binding closed"),this._handle.reset()},J.prototype._flush=function(k){this._transform(e.alloc(0),"",k)},J.prototype.flush=function(k,$){var Y=this,ie=this._writableState;(typeof k=="function"||k===void 0&&!$)&&($=k,k=n.Z_FULL_FLUSH),ie.ended?$&&r.nextTick($):ie.ending?$&&this.once("end",$):ie.needDrain?$&&this.once("drain",function(){return Y.flush(k,$)}):(this._flushFlag=k,this.write(e.alloc(0),"",$))},J.prototype.close=function(k){K(this,k),r.nextTick(ne,this)};function K(k,$){$&&r.nextTick($),k._handle&&(k._handle.close(),k._handle=null)}function ne(k){k.emit("close")}return J.prototype._transform=function(k,$,Y){var ie,re=this._writableState,N=re.ending||re.ended,x=N&&(!k||re.length===k.length);if(k!==null&&!e.isBuffer(k))return Y(new Error("invalid input"));if(!this._handle)return Y(new Error("zlib binding closed"));x?ie=this._finishFlushFlag:(ie=this._flushFlag,k.length>=re.length&&(this._flushFlag=this._opts.flush||n.Z_NO_FLUSH)),this._processChunk(k,ie,Y)},J.prototype._processChunk=function(k,$,Y){var ie=k&&k.length,re=this._chunkSize-this._offset,N=0,x=this,P=typeof Y=="function";if(!P){var C=[],j=0,U;this.on("error",function(te){U=te}),o(this._handle,"zlib binding closed");do var B=this._handle.writeSync($,k,N,ie,this._buffer,this._offset,re);while(!this._hadError&&_e(B[0],B[1]));if(this._hadError)throw U;if(j>=s)throw K(this),new RangeError(a);var Q=e.concat(C,j);return K(this),Q}o(this._handle,"zlib binding closed");var fe=this._handle.write($,k,N,ie,this._buffer,this._offset,re);fe.buffer=k,fe.callback=_e;function _e(te,W){if(this&&(this.buffer=null,this.callback=null),!x._hadError){var oe=re-W;if(o(oe>=0,"have should not go down"),oe>0){var be=x._buffer.slice(x._offset,x._offset+oe);x._offset+=oe,P?x.push(be):(C.push(be),j+=be.length)}if((W===0||x._offset>=x._chunkSize)&&(re=x._chunkSize,x._offset=0,x._buffer=e.allocUnsafe(x._chunkSize)),W===0){if(N+=ie-te,ie=te,!P)return!0;var xe=x._handle.write($,k,N,ie,x._buffer,x._offset,x._chunkSize);xe.callback=_e,xe.buffer=k;return}if(!P)return!1;Y()}}},i.inherits(y,J),i.inherits(_,J),i.inherits(E,J),i.inherits(S,J),i.inherits(A,J),i.inherits(F,J),i.inherits(D,J),ht}var a1,nL,Pn,iL,Ku,sL,l1,oL,u1,aL,c1,lL,Os,uL,f1,cL,h1,fL,is,hL,d1,dL,Qe,pL,ht,gL,Ye,N7,k7,L7,P7,M7,B7,F7,U7,j7,$7,z7,W7,q7,H7,G7,V7,Y7,X7,K7,Z7,J7,Q7,ez,tz,rz,nz,iz,sz,oz,az,lz,uz,cz,fz,hz,dz,pz,gz,mz,yz,bz,wz,vz,_z,Ez,Az,xz,Sz,Tz,Cz,Rz,Dz,Iz,Oz,Nz,kz,Lz,Pz,Mz,Bz,Fz,Uz,jz,$z,zz,Wz,qz,Hz,Gz,wL=Jt(()=>{Ce();De();Re();Bf();LE();z_();Mu();W0();ul();G0();Yf();eb();Wf();a1={},nL=!1;Pn={},iL=!1;Ku={},sL=!1;l1={},oL=!1;u1={},aL=!1;c1={},lL=!1;Os={},uL=!1;f1={},cL=!1;h1={},fL=!1;is={},hL=!1;d1={},dL=!1;Qe={},pL=!1;ht={},gL=!1;Ye=O7();Ye.codes;Ye.Deflate;Ye.Inflate;Ye.Gzip;Ye.Gunzip;Ye.DeflateRaw;Ye.InflateRaw;Ye.Unzip;Ye.createDeflate;Ye.createInflate;Ye.createDeflateRaw;Ye.createInflateRaw;Ye.createGzip;Ye.createGunzip;Ye.createUnzip;Ye.deflate;Ye.deflateSync;Ye.gzip;Ye.gzipSync;Ye.deflateRaw;Ye.deflateRawSync;Ye.unzip;Ye.unzipSync;Ye.inflate;Ye.inflateSync;Ye.gunzip;Ye.gunzipSync;Ye.inflateRaw;Ye.inflateRawSync;N7=Ye.Deflate,k7=Ye.DeflateRaw,L7=Ye.Gunzip,P7=Ye.Gzip,M7=Ye.Inflate,B7=Ye.InflateRaw,F7=Ye.Unzip,U7=Ye.Z_BEST_COMPRESSION,j7=Ye.Z_BEST_SPEED,$7=Ye.Z_BINARY,z7=Ye.Z_BLOCK,W7=Ye.Z_BUF_ERROR,q7=Ye.Z_DATA_ERROR,H7=Ye.Z_DEFAULT_CHUNK,G7=Ye.Z_DEFAULT_COMPRESSION,V7=Ye.Z_DEFAULT_LEVEL,Y7=Ye.Z_DEFAULT_MEMLEVEL,X7=Ye.Z_DEFAULT_STRATEGY,K7=Ye.Z_DEFAULT_WINDOWBITS,Z7=Ye.Z_DEFLATED,J7=Ye.Z_ERRNO,Q7=Ye.Z_FILTERED,ez=Ye.Z_FINISH,tz=Ye.Z_FIXED,rz=Ye.Z_FULL_FLUSH,nz=Ye.Z_HUFFMAN_ONLY,iz=Ye.Z_MAX_CHUNK,sz=Ye.Z_MAX_LEVEL,oz=Ye.Z_MAX_MEMLEVEL,az=Ye.Z_MAX_WINDOWBITS,lz=Ye.Z_MIN_CHUNK,uz=Ye.Z_MIN_LEVEL,cz=Ye.Z_MIN_MEMLEVEL,fz=Ye.Z_MIN_WINDOWBITS,hz=Ye.Z_NEED_DICT,dz=Ye.Z_NO_COMPRESSION,pz=Ye.Z_NO_FLUSH,gz=Ye.Z_OK,mz=Ye.Z_PARTIAL_FLUSH,yz=Ye.Z_RLE,bz=Ye.Z_STREAM_END,wz=Ye.Z_STREAM_ERROR,vz=Ye.Z_SYNC_FLUSH,_z=Ye.Z_TEXT,Ez=Ye.Z_TREES,Az=Ye.Z_UNKNOWN,xz=Ye.Zlib,Sz=Ye.codes,Tz=Ye.createDeflate,Cz=Ye.createDeflateRaw,Rz=Ye.createGunzip,Dz=Ye.createGzip,Iz=Ye.createInflate,Oz=Ye.createInflateRaw,Nz=Ye.createUnzip,kz=Ye.deflate,Lz=Ye.deflateRaw,Pz=Ye.deflateRawSync,Mz=Ye.deflateSync,Bz=Ye.gunzip,Fz=Ye.gunzipSync,Uz=Ye.gzip,jz=Ye.gzipSync,$z=Ye.inflate,zz=Ye.inflateRaw,Wz=Ye.inflateRawSync,qz=Ye.inflateSync,Hz=Ye.unzip,Gz=Ye.unzipSync});function _L(){return vL||(vL=!0,typeof Object.create=="function"?Pb=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Pb=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}),Pb}var Pb,vL,p1=Jt(()=>{Ce();De();Re();Pb={},vL=!1});var lg={};Uo(lg,{TextDecoder:()=>IW,TextEncoder:()=>DW,_extend:()=>sW,callbackify:()=>oW,debuglog:()=>aW,default:()=>gt,deprecate:()=>lW,format:()=>uW,inherits:()=>cW,inspect:()=>fW,isArray:()=>hW,isBoolean:()=>dW,isBuffer:()=>pW,isDate:()=>gW,isError:()=>mW,isFunction:()=>yW,isNull:()=>bW,isNullOrUndefined:()=>wW,isNumber:()=>vW,isObject:()=>_W,isPrimitive:()=>EW,isRegExp:()=>AW,isString:()=>xW,isSymbol:()=>SW,isUndefined:()=>TW,log:()=>CW,promisify:()=>Mb,types:()=>RW});function S1(){if(EL)return g1;EL=!0;var r=n2();return g1=function(){return r()&&!!Symbol.toStringTag},g1}function Vz(){if(AL)return m1;AL=!0;var r=S1()(),e=Up(),t=e("Object.prototype.toString"),n=function(a){return r&&a&&typeof a=="object"&&Symbol.toStringTag in a?!1:t(a)==="[object Arguments]"},i=function(a){return n(a)?!0:a!==null&&typeof a=="object"&&typeof a.length=="number"&&a.length>=0&&t(a)!=="[object Array]"&&t(a.callee)==="[object Function]"},o=(function(){return n(arguments)})();return n.isLegacyArguments=i,m1=o?n:i,m1}function Yz(){if(xL)return y1;xL=!0;var r=Object.prototype.toString,e=Function.prototype.toString,t=/^\s*(?:function)?\*/,n=S1()(),i=Object.getPrototypeOf,o=function(){if(!n)return!1;try{return Function("return function*() {}")()}catch{}},s;return y1=function(u){if(typeof u!="function")return!1;if(t.test(e.call(u)))return!0;if(!n){var c=r.call(u);return c==="[object GeneratorFunction]"}if(!i)return!1;if(typeof s>"u"){var f=o();s=f?i(f):!1}return i(u)===s},y1}function Xz(){if(SL)return b1;SL=!0;var r=Function.prototype.toString,e=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,t,n;if(typeof e=="function"&&typeof Object.defineProperty=="function")try{t=Object.defineProperty({},"length",{get:function(){throw n}}),n={},e(function(){throw 42},null,t)}catch(_){_!==n&&(e=null)}else e=null;var i=/^\s*class\b/,o=function(E){try{var S=r.call(E);return i.test(S)}catch{return!1}},s=function(E){try{return o(E)?!1:(r.call(E),!0)}catch{return!1}},a=Object.prototype.toString,u="[object Object]",c="[object Function]",f="[object GeneratorFunction]",h="[object HTMLAllCollection]",p="[object HTML document.all class]",m="[object HTMLCollection]",b=typeof Symbol=="function"&&!!Symbol.toStringTag,v=!(0 in[,]),w=function(){return!1};if(typeof document=="object"){var y=document.all;a.call(y)===a.call(document.all)&&(w=function(E){if((v||!E)&&(typeof E>"u"||typeof E=="object"))try{var S=a.call(E);return(S===h||S===p||S===m||S===u)&&E("")==null}catch{}return!1})}return b1=e?function(E){if(w(E))return!0;if(!E||typeof E!="function"&&typeof E!="object")return!1;try{e(E,null,t)}catch(S){if(S!==n)return!1}return!o(E)&&s(E)}:function(E){if(w(E))return!0;if(!E||typeof E!="function"&&typeof E!="object")return!1;if(b)return s(E);if(o(E))return!1;var S=a.call(E);return S!==c&&S!==f&&!/^\[object HTML/.test(S)?!1:s(E)},b1}function Kz(){if(TL)return w1;TL=!0;var r=Xz(),e=Object.prototype.toString,t=Object.prototype.hasOwnProperty,n=function(u,c,f){for(var h=0,p=u.length;h<p;h++)t.call(u,h)&&(f==null?c(u[h],h,u):c.call(f,u[h],h,u))},i=function(u,c,f){for(var h=0,p=u.length;h<p;h++)f==null?c(u.charAt(h),h,u):c.call(f,u.charAt(h),h,u)},o=function(u,c,f){for(var h in u)t.call(u,h)&&(f==null?c(u[h],h,u):c.call(f,u[h],h,u))},s=function(u,c,f){if(!r(c))throw new TypeError("iterator must be a function");var h;arguments.length>=3&&(h=f),e.call(u)==="[object Array]"?n(u,c,h):typeof u=="string"?i(u,c,h):o(u,c,h)};return w1=s,w1}function Zz(){return CL||(CL=!0,v1=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),v1}function Qz(){if(RL)return _1;RL=!0;var r=Zz(),e=typeof globalThis>"u"?Jz:globalThis;return _1=function(){for(var n=[],i=0;i<r.length;i++)typeof e[r[i]]=="function"&&(n[n.length]=r[i]);return n},_1}function LL(){if(DL)return E1;DL=!0;var r=Kz(),e=Qz(),t=o2(),n=Up(),i=tb(),o=n("Object.prototype.toString"),s=S1()(),a=typeof globalThis>"u"?eW:globalThis,u=e(),c=n("String.prototype.slice"),f=Object.getPrototypeOf,h=n("Array.prototype.indexOf",!0)||function(w,y){for(var _=0;_<w.length;_+=1)if(w[_]===y)return _;return-1},p={__proto__:null};s&&i&&f?r(u,function(v){var w=new a[v];if(Symbol.toStringTag in w){var y=f(w),_=i(y,Symbol.toStringTag);if(!_){var E=f(y);_=i(E,Symbol.toStringTag)}p["$"+v]=t(_.get)}}):r(u,function(v){var w=new a[v],y=w.slice||w.set;y&&(p["$"+v]=t(y))});var m=function(w){var y=!1;return r(p,function(_,E){if(!y)try{"$"+_(w)===E&&(y=c(E,1))}catch{}}),y},b=function(w){var y=!1;return r(p,function(_,E){if(!y)try{_(w),y=c(E,1)}catch{}}),y};return E1=function(w){if(!w||typeof w!="object")return!1;if(!s){var y=c(o(w),8,-1);return h(u,y)>-1?y:y!=="Object"?!1:b(w)}return i?m(w):null},E1}function tW(){if(IL)return A1;IL=!0;var r=LL();return A1=function(t){return!!r(t)},A1}function rW(){if(OL)return Dt;OL=!0;var r=Vz(),e=Yz(),t=LL(),n=tW();function i(de){return de.call.bind(de)}var o=typeof BigInt<"u",s=typeof Symbol<"u",a=i(Object.prototype.toString),u=i(Number.prototype.valueOf),c=i(String.prototype.valueOf),f=i(Boolean.prototype.valueOf);if(o)var h=i(BigInt.prototype.valueOf);if(s)var p=i(Symbol.prototype.valueOf);function m(de,Ae){if(typeof de!="object")return!1;try{return Ae(de),!0}catch{return!1}}Dt.isArgumentsObject=r,Dt.isGeneratorFunction=e,Dt.isTypedArray=n;function b(de){return typeof Promise<"u"&&de instanceof Promise||de!==null&&typeof de=="object"&&typeof de.then=="function"&&typeof de.catch=="function"}Dt.isPromise=b;function v(de){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(de):n(de)||U(de)}Dt.isArrayBufferView=v;function w(de){return t(de)==="Uint8Array"}Dt.isUint8Array=w;function y(de){return t(de)==="Uint8ClampedArray"}Dt.isUint8ClampedArray=y;function _(de){return t(de)==="Uint16Array"}Dt.isUint16Array=_;function E(de){return t(de)==="Uint32Array"}Dt.isUint32Array=E;function S(de){return t(de)==="Int8Array"}Dt.isInt8Array=S;function A(de){return t(de)==="Int16Array"}Dt.isInt16Array=A;function F(de){return t(de)==="Int32Array"}Dt.isInt32Array=F;function D(de){return t(de)==="Float32Array"}Dt.isFloat32Array=D;function H(de){return t(de)==="Float64Array"}Dt.isFloat64Array=H;function J(de){return t(de)==="BigInt64Array"}Dt.isBigInt64Array=J;function K(de){return t(de)==="BigUint64Array"}Dt.isBigUint64Array=K;function ne(de){return a(de)==="[object Map]"}ne.working=typeof Map<"u"&&ne(new Map);function k(de){return typeof Map>"u"?!1:ne.working?ne(de):de instanceof Map}Dt.isMap=k;function $(de){return a(de)==="[object Set]"}$.working=typeof Set<"u"&&$(new Set);function Y(de){return typeof Set>"u"?!1:$.working?$(de):de instanceof Set}Dt.isSet=Y;function ie(de){return a(de)==="[object WeakMap]"}ie.working=typeof WeakMap<"u"&&ie(new WeakMap);function re(de){return typeof WeakMap>"u"?!1:ie.working?ie(de):de instanceof WeakMap}Dt.isWeakMap=re;function N(de){return a(de)==="[object WeakSet]"}N.working=typeof WeakSet<"u"&&N(new WeakSet);function x(de){return N(de)}Dt.isWeakSet=x;function P(de){return a(de)==="[object ArrayBuffer]"}P.working=typeof ArrayBuffer<"u"&&P(new ArrayBuffer);function C(de){return typeof ArrayBuffer>"u"?!1:P.working?P(de):de instanceof ArrayBuffer}Dt.isArrayBuffer=C;function j(de){return a(de)==="[object DataView]"}j.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&j(new DataView(new ArrayBuffer(1),0,1));function U(de){return typeof DataView>"u"?!1:j.working?j(de):de instanceof DataView}Dt.isDataView=U;var B=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function Q(de){return a(de)==="[object SharedArrayBuffer]"}function fe(de){return typeof B>"u"?!1:(typeof Q.working>"u"&&(Q.working=Q(new B)),Q.working?Q(de):de instanceof B)}Dt.isSharedArrayBuffer=fe;function _e(de){return a(de)==="[object AsyncFunction]"}Dt.isAsyncFunction=_e;function te(de){return a(de)==="[object Map Iterator]"}Dt.isMapIterator=te;function W(de){return a(de)==="[object Set Iterator]"}Dt.isSetIterator=W;function oe(de){return a(de)==="[object Generator]"}Dt.isGeneratorObject=oe;function be(de){return a(de)==="[object WebAssembly.Module]"}Dt.isWebAssemblyCompiledModule=be;function xe(de){return m(de,u)}Dt.isNumberObject=xe;function X(de){return m(de,c)}Dt.isStringObject=X;function M(de){return m(de,f)}Dt.isBooleanObject=M;function ae(de){return o&&m(de,h)}Dt.isBigIntObject=ae;function ge(de){return s&&m(de,p)}Dt.isSymbolObject=ge;function Se(de){return xe(de)||X(de)||M(de)||ae(de)||ge(de)}Dt.isBoxedPrimitive=Se;function we(de){return typeof Uint8Array<"u"&&(C(de)||fe(de))}return Dt.isAnyArrayBuffer=we,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(de){Object.defineProperty(Dt,de,{enumerable:!1,value:function(){throw new Error(de+" is not supported in userland")}})}),Dt}function nW(){return NL||(NL=!0,x1=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"}),x1}function iW(){if(kL)return It;kL=!0;var r=zr,e=Object.getOwnPropertyDescriptors||function(B){for(var Q=Object.keys(B),fe={},_e=0;_e<Q.length;_e++)fe[Q[_e]]=Object.getOwnPropertyDescriptor(B,Q[_e]);return fe},t=/%[sdj%]/g;It.format=function(U){if(!A(U)){for(var B=[],Q=0;Q<arguments.length;Q++)B.push(s(arguments[Q]));return B.join(" ")}for(var Q=1,fe=arguments,_e=fe.length,te=String(U).replace(t,function(oe){if(oe==="%%")return"%";if(Q>=_e)return oe;switch(oe){case"%s":return String(fe[Q++]);case"%d":return Number(fe[Q++]);case"%j":try{return JSON.stringify(fe[Q++])}catch{return"[Circular]"}default:return oe}}),W=fe[Q];Q<_e;W=fe[++Q])_(W)||!J(W)?te+=" "+W:te+=" "+s(W);return te},It.deprecate=function(U,B){if(typeof r<"u"&&r.noDeprecation===!0)return U;if(typeof r>"u")return function(){return It.deprecate(U,B).apply(this||ag,arguments)};var Q=!1;function fe(){if(!Q){if(r.throwDeprecation)throw new Error(B);r.traceDeprecation?console.trace(B):console.error(B),Q=!0}return U.apply(this||ag,arguments)}return fe};var n={},i=/^$/;if(r.env.NODE_DEBUG){var o=r.env.NODE_DEBUG;o=o.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),i=new RegExp("^"+o+"$","i")}It.debuglog=function(U){if(U=U.toUpperCase(),!n[U])if(i.test(U)){var B=r.pid;n[U]=function(){var Q=It.format.apply(It,arguments);console.error("%s %d: %s",U,B,Q)}}else n[U]=function(){};return n[U]};function s(U,B){var Q={seen:[],stylize:u};return arguments.length>=3&&(Q.depth=arguments[2]),arguments.length>=4&&(Q.colors=arguments[3]),y(B)?Q.showHidden=B:B&&It._extend(Q,B),D(Q.showHidden)&&(Q.showHidden=!1),D(Q.depth)&&(Q.depth=2),D(Q.colors)&&(Q.colors=!1),D(Q.customInspect)&&(Q.customInspect=!0),Q.colors&&(Q.stylize=a),f(Q,U,Q.depth)}It.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function a(U,B){var Q=s.styles[B];return Q?"\x1B["+s.colors[Q][0]+"m"+U+"\x1B["+s.colors[Q][1]+"m":U}function u(U,B){return U}function c(U){var B={};return U.forEach(function(Q,fe){B[Q]=!0}),B}function f(U,B,Q){if(U.customInspect&&B&&k(B.inspect)&&B.inspect!==It.inspect&&!(B.constructor&&B.constructor.prototype===B)){var fe=B.inspect(Q,U);return A(fe)||(fe=f(U,fe,Q)),fe}var _e=h(U,B);if(_e)return _e;var te=Object.keys(B),W=c(te);if(U.showHidden&&(te=Object.getOwnPropertyNames(B)),ne(B)&&(te.indexOf("message")>=0||te.indexOf("description")>=0))return p(B);if(te.length===0){if(k(B)){var oe=B.name?": "+B.name:"";return U.stylize("[Function"+oe+"]","special")}if(H(B))return U.stylize(RegExp.prototype.toString.call(B),"regexp");if(K(B))return U.stylize(Date.prototype.toString.call(B),"date");if(ne(B))return p(B)}var be="",xe=!1,X=["{","}"];if(w(B)&&(xe=!0,X=["[","]"]),k(B)){var M=B.name?": "+B.name:"";be=" [Function"+M+"]"}if(H(B)&&(be=" "+RegExp.prototype.toString.call(B)),K(B)&&(be=" "+Date.prototype.toUTCString.call(B)),ne(B)&&(be=" "+p(B)),te.length===0&&(!xe||B.length==0))return X[0]+be+X[1];if(Q<0)return H(B)?U.stylize(RegExp.prototype.toString.call(B),"regexp"):U.stylize("[Object]","special");U.seen.push(B);var ae;return xe?ae=m(U,B,Q,W,te):ae=te.map(function(ge){return b(U,B,Q,W,ge,xe)}),U.seen.pop(),v(ae,be,X)}function h(U,B){if(D(B))return U.stylize("undefined","undefined");if(A(B)){var Q="'"+JSON.stringify(B).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return U.stylize(Q,"string")}if(S(B))return U.stylize(""+B,"number");if(y(B))return U.stylize(""+B,"boolean");if(_(B))return U.stylize("null","null")}function p(U){return"["+Error.prototype.toString.call(U)+"]"}function m(U,B,Q,fe,_e){for(var te=[],W=0,oe=B.length;W<oe;++W)x(B,String(W))?te.push(b(U,B,Q,fe,String(W),!0)):te.push("");return _e.forEach(function(be){be.match(/^\d+$/)||te.push(b(U,B,Q,fe,be,!0))}),te}function b(U,B,Q,fe,_e,te){var W,oe,be;if(be=Object.getOwnPropertyDescriptor(B,_e)||{value:B[_e]},be.get?be.set?oe=U.stylize("[Getter/Setter]","special"):oe=U.stylize("[Getter]","special"):be.set&&(oe=U.stylize("[Setter]","special")),x(fe,_e)||(W="["+_e+"]"),oe||(U.seen.indexOf(be.value)<0?(_(Q)?oe=f(U,be.value,null):oe=f(U,be.value,Q-1),oe.indexOf(`
84
+ `)>-1&&(te?oe=oe.split(`
85
+ `).map(function(xe){return" "+xe}).join(`
86
+ `).slice(2):oe=`
87
+ `+oe.split(`
88
+ `).map(function(xe){return" "+xe}).join(`
89
+ `))):oe=U.stylize("[Circular]","special")),D(W)){if(te&&_e.match(/^\d+$/))return oe;W=JSON.stringify(""+_e),W.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(W=W.slice(1,-1),W=U.stylize(W,"name")):(W=W.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),W=U.stylize(W,"string"))}return W+": "+oe}function v(U,B,Q){var fe=U.reduce(function(_e,te){return te.indexOf(`
90
+ `)>=0,_e+te.replace(/\u001b\[\d\d?m/g,"").length+1},0);return fe>60?Q[0]+(B===""?"":B+`
91
+ `)+" "+U.join(`,
92
+ `)+" "+Q[1]:Q[0]+B+" "+U.join(", ")+" "+Q[1]}It.types=rW();function w(U){return Array.isArray(U)}It.isArray=w;function y(U){return typeof U=="boolean"}It.isBoolean=y;function _(U){return U===null}It.isNull=_;function E(U){return U==null}It.isNullOrUndefined=E;function S(U){return typeof U=="number"}It.isNumber=S;function A(U){return typeof U=="string"}It.isString=A;function F(U){return typeof U=="symbol"}It.isSymbol=F;function D(U){return U===void 0}It.isUndefined=D;function H(U){return J(U)&&Y(U)==="[object RegExp]"}It.isRegExp=H,It.types.isRegExp=H;function J(U){return typeof U=="object"&&U!==null}It.isObject=J;function K(U){return J(U)&&Y(U)==="[object Date]"}It.isDate=K,It.types.isDate=K;function ne(U){return J(U)&&(Y(U)==="[object Error]"||U instanceof Error)}It.isError=ne,It.types.isNativeError=ne;function k(U){return typeof U=="function"}It.isFunction=k;function $(U){return U===null||typeof U=="boolean"||typeof U=="number"||typeof U=="string"||typeof U=="symbol"||typeof U>"u"}It.isPrimitive=$,It.isBuffer=nW();function Y(U){return Object.prototype.toString.call(U)}function ie(U){return U<10?"0"+U.toString(10):U.toString(10)}var re=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function N(){var U=new Date,B=[ie(U.getHours()),ie(U.getMinutes()),ie(U.getSeconds())].join(":");return[U.getDate(),re[U.getMonth()],B].join(" ")}It.log=function(){console.log("%s - %s",N(),It.format.apply(It,arguments))},It.inherits=_L(),It._extend=function(U,B){if(!B||!J(B))return U;for(var Q=Object.keys(B),fe=Q.length;fe--;)U[Q[fe]]=B[Q[fe]];return U};function x(U,B){return Object.prototype.hasOwnProperty.call(U,B)}var P=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;It.promisify=function(B){if(typeof B!="function")throw new TypeError('The "original" argument must be of type Function');if(P&&B[P]){if(Q=B[P],typeof Q!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(Q,P,{value:Q,enumerable:!1,writable:!1,configurable:!0}),Q}function Q(){for(var fe,_e,te=new Promise(function(be,xe){fe=be,_e=xe}),W=[],oe=0;oe<arguments.length;oe++)W.push(arguments[oe]);W.push(function(be,xe){be?_e(be):fe(xe)});try{B.apply(this||ag,W)}catch(be){_e(be)}return te}return Object.setPrototypeOf(Q,Object.getPrototypeOf(B)),P&&Object.defineProperty(Q,P,{value:Q,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(Q,e(B))},It.promisify.custom=P;function C(U,B){if(!U){var Q=new Error("Promise was rejected with a falsy value");Q.reason=U,U=Q}return B(U)}function j(U){if(typeof U!="function")throw new TypeError('The "original" argument must be of type Function');function B(){for(var Q=[],fe=0;fe<arguments.length;fe++)Q.push(arguments[fe]);var _e=Q.pop();if(typeof _e!="function")throw new TypeError("The last argument must be of type Function");var te=this||ag,W=function(){return _e.apply(te,arguments)};U.apply(this||ag,Q).then(function(oe){r.nextTick(W.bind(null,null,oe))},function(oe){r.nextTick(C.bind(null,oe,W))})}return Object.setPrototypeOf(B,Object.getPrototypeOf(U)),Object.defineProperties(B,e(U)),B}return It.callbackify=j,It}var g1,EL,m1,AL,y1,xL,b1,SL,w1,TL,v1,CL,_1,RL,Jz,E1,DL,eW,A1,IL,Dt,OL,x1,NL,It,kL,ag,gt,sW,oW,aW,lW,uW,cW,fW,hW,dW,pW,gW,mW,yW,bW,wW,vW,_W,EW,AW,xW,SW,TW,CW,Mb,RW,DW,IW,mh=Jt(()=>{Ce();De();Re();jp();p1();Mu();g1={},EL=!1;m1={},AL=!1;y1={},xL=!1;b1={},SL=!1;w1={},TL=!1;v1={},CL=!1;_1={},RL=!1,Jz=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;E1={},DL=!1,eW=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;A1={},IL=!1;Dt={},OL=!1;x1={},NL=!1;It={},kL=!1,ag=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;gt=iW();gt.format;gt.deprecate;gt.debuglog;gt.inspect;gt.types;gt.isArray;gt.isBoolean;gt.isNull;gt.isNullOrUndefined;gt.isNumber;gt.isString;gt.isSymbol;gt.isUndefined;gt.isRegExp;gt.isObject;gt.isDate;gt.isError;gt.isFunction;gt.isPrimitive;gt.isBuffer;gt.log;gt.inherits;gt._extend;gt.promisify;gt.callbackify;sW=gt._extend,oW=gt.callbackify,aW=gt.debuglog,lW=gt.deprecate,uW=gt.format,cW=gt.inherits,fW=gt.inspect,hW=gt.isArray,dW=gt.isBoolean,pW=gt.isBuffer,gW=gt.isDate,mW=gt.isError,yW=gt.isFunction,bW=gt.isNull,wW=gt.isNullOrUndefined,vW=gt.isNumber,_W=gt.isObject,EW=gt.isPrimitive,AW=gt.isRegExp,xW=gt.isString,SW=gt.isSymbol,TW=gt.isUndefined,CW=gt.log,Mb=gt.promisify,RW=gt.types,DW=gt.TextEncoder=globalThis.TextEncoder,IW=gt.TextDecoder=globalThis.TextDecoder});var ug={};Uo(ug,{EventEmitter:()=>NW,default:()=>ao,defaultMaxListeners:()=>kW,init:()=>LW,listenerCount:()=>PW,on:()=>MW,once:()=>BW});function OW(){if(PL)return Bb;PL=!0;var r=typeof Reflect=="object"?Reflect:null,e=r&&typeof r.apply=="function"?r.apply:function(A,F,D){return Function.prototype.apply.call(A,F,D)},t;r&&typeof r.ownKeys=="function"?t=r.ownKeys:Object.getOwnPropertySymbols?t=function(A){return Object.getOwnPropertyNames(A).concat(Object.getOwnPropertySymbols(A))}:t=function(A){return Object.getOwnPropertyNames(A)};function n(S){console&&console.warn&&console.warn(S)}var i=Number.isNaN||function(A){return A!==A};function o(){o.init.call(this)}Bb=o,Bb.once=y,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(S){if(typeof S!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof S)}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(S){if(typeof S!="number"||S<0||i(S))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+S+".");s=S}}),o.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(A){if(typeof A!="number"||A<0||i(A))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+A+".");return this._maxListeners=A,this};function u(S){return S._maxListeners===void 0?o.defaultMaxListeners:S._maxListeners}o.prototype.getMaxListeners=function(){return u(this)},o.prototype.emit=function(A){for(var F=[],D=1;D<arguments.length;D++)F.push(arguments[D]);var H=A==="error",J=this._events;if(J!==void 0)H=H&&J.error===void 0;else if(!H)return!1;if(H){var K;if(F.length>0&&(K=F[0]),K instanceof Error)throw K;var ne=new Error("Unhandled error."+(K?" ("+K.message+")":""));throw ne.context=K,ne}var k=J[A];if(k===void 0)return!1;if(typeof k=="function")e(k,this,F);else for(var $=k.length,Y=b(k,$),D=0;D<$;++D)e(Y[D],this,F);return!0};function c(S,A,F,D){var H,J,K;if(a(F),J=S._events,J===void 0?(J=S._events=Object.create(null),S._eventsCount=0):(J.newListener!==void 0&&(S.emit("newListener",A,F.listener?F.listener:F),J=S._events),K=J[A]),K===void 0)K=J[A]=F,++S._eventsCount;else if(typeof K=="function"?K=J[A]=D?[F,K]:[K,F]:D?K.unshift(F):K.push(F),H=u(S),H>0&&K.length>H&&!K.warned){K.warned=!0;var ne=new Error("Possible EventEmitter memory leak detected. "+K.length+" "+String(A)+" listeners added. Use emitter.setMaxListeners() to increase limit");ne.name="MaxListenersExceededWarning",ne.emitter=S,ne.type=A,ne.count=K.length,n(ne)}return S}o.prototype.addListener=function(A,F){return c(this,A,F,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(A,F){return c(this,A,F,!0)};function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(S,A,F){var D={fired:!1,wrapFn:void 0,target:S,type:A,listener:F},H=f.bind(D);return H.listener=F,D.wrapFn=H,H}o.prototype.once=function(A,F){return a(F),this.on(A,h(this,A,F)),this},o.prototype.prependOnceListener=function(A,F){return a(F),this.prependListener(A,h(this,A,F)),this},o.prototype.removeListener=function(A,F){var D,H,J,K,ne;if(a(F),H=this._events,H===void 0)return this;if(D=H[A],D===void 0)return this;if(D===F||D.listener===F)--this._eventsCount===0?this._events=Object.create(null):(delete H[A],H.removeListener&&this.emit("removeListener",A,D.listener||F));else if(typeof D!="function"){for(J=-1,K=D.length-1;K>=0;K--)if(D[K]===F||D[K].listener===F){ne=D[K].listener,J=K;break}if(J<0)return this;J===0?D.shift():v(D,J),D.length===1&&(H[A]=D[0]),H.removeListener!==void 0&&this.emit("removeListener",A,ne||F)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(A){var F,D,H;if(D=this._events,D===void 0)return this;if(D.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):D[A]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete D[A]),this;if(arguments.length===0){var J=Object.keys(D),K;for(H=0;H<J.length;++H)K=J[H],K!=="removeListener"&&this.removeAllListeners(K);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(F=D[A],typeof F=="function")this.removeListener(A,F);else if(F!==void 0)for(H=F.length-1;H>=0;H--)this.removeListener(A,F[H]);return this};function p(S,A,F){var D=S._events;if(D===void 0)return[];var H=D[A];return H===void 0?[]:typeof H=="function"?F?[H.listener||H]:[H]:F?w(H):b(H,H.length)}o.prototype.listeners=function(A){return p(this,A,!0)},o.prototype.rawListeners=function(A){return p(this,A,!1)},o.listenerCount=function(S,A){return typeof S.listenerCount=="function"?S.listenerCount(A):m.call(S,A)},o.prototype.listenerCount=m;function m(S){var A=this._events;if(A!==void 0){var F=A[S];if(typeof F=="function")return 1;if(F!==void 0)return F.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function b(S,A){for(var F=new Array(A),D=0;D<A;++D)F[D]=S[D];return F}function v(S,A){for(;A+1<S.length;A++)S[A]=S[A+1];S.pop()}function w(S){for(var A=new Array(S.length),F=0;F<A.length;++F)A[F]=S[F].listener||S[F];return A}function y(S,A){return new Promise(function(F,D){function H(K){S.removeListener(A,J),D(K)}function J(){typeof S.removeListener=="function"&&S.removeListener("error",H),F([].slice.call(arguments))}E(S,A,J,{once:!0}),A!=="error"&&_(S,H,{once:!0})})}function _(S,A,F){typeof S.on=="function"&&E(S,"error",A,F)}function E(S,A,F,D){if(typeof S.on=="function")D.once?S.once(A,F):S.on(A,F);else if(typeof S.addEventListener=="function")S.addEventListener(A,function H(J){D.once&&S.removeEventListener(A,H),F(J)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof S)}return Bb}var Bb,PL,ao,NW,kW,LW,PW,MW,BW,yh=Jt(()=>{Ce();De();Re();Bb={},PL=!1;ao=OW();ao.once;ao.once=function(r,e){return new Promise((t,n)=>{function i(...s){o!==void 0&&r.removeListener("error",o),t(s)}let o;e!=="error"&&(o=s=>{r.removeListener(name,i),n(s)},r.once("error",o)),r.once(e,i)})};ao.on=function(r,e){let t=[],n=[],i=null,o=!1,s={async next(){let c=t.shift();if(c)return createIterResult(c,!1);if(i){let f=Promise.reject(i);return i=null,f}return o?createIterResult(void 0,!0):new Promise((f,h)=>n.push({resolve:f,reject:h}))},async return(){r.removeListener(e,a),r.removeListener("error",u),o=!0;for(let c of n)c.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(c){i=c,r.removeListener(e,a),r.removeListener("error",u)},[Symbol.asyncIterator](){return this}};return r.on(e,a),r.on("error",u),s;function a(...c){let f=n.shift();f?f.resolve(createIterResult(c,!1)):t.push(c)}function u(c){o=!0;let f=n.shift();f?f.reject(c):i=c,s.return()}};({EventEmitter:NW,defaultMaxListeners:kW,init:LW,listenerCount:PW,on:MW,once:BW}=ao)});function FW(){if(ML)return cg;ML=!0;var r=fn(),e=r.Buffer;function t(i,o){for(var s in i)o[s]=i[s]}e.from&&e.alloc&&e.allocUnsafe&&e.allocUnsafeSlow?cg=r:(t(r,cg),cg.Buffer=n);function n(i,o,s){return e(i,o,s)}return n.prototype=Object.create(e.prototype),t(e,n),n.from=function(i,o,s){if(typeof i=="number")throw new TypeError("Argument must not be a number");return e(i,o,s)},n.alloc=function(i,o,s){if(typeof i!="number")throw new TypeError("Argument must be a number");var a=e(i);return o!==void 0?typeof s=="string"?a.fill(o,s):a.fill(o):a.fill(0),a},n.allocUnsafe=function(i){if(typeof i!="number")throw new TypeError("Argument must be a number");return e(i)},n.allocUnsafeSlow=function(i){if(typeof i!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(i)},cg}function UW(){if(BL)return T1;BL=!0;var r=FW().Buffer,e=r.isEncoding||function(y){switch(y=""+y,y&&y.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function t(y){if(!y)return"utf8";for(var _;;)switch(y){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return y;default:if(_)return;y=(""+y).toLowerCase(),_=!0}}function n(y){var _=t(y);if(typeof _!="string"&&(r.isEncoding===e||!e(y)))throw new Error("Unknown encoding: "+y);return _||y}T1.StringDecoder=i;function i(y){this.encoding=n(y);var _;switch(this.encoding){case"utf16le":this.text=h,this.end=p,_=4;break;case"utf8":this.fillLast=u,_=4;break;case"base64":this.text=m,this.end=b,_=3;break;default:this.write=v,this.end=w;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(_)}i.prototype.write=function(y){if(y.length===0)return"";var _,E;if(this.lastNeed){if(_=this.fillLast(y),_===void 0)return"";E=this.lastNeed,this.lastNeed=0}else E=0;return E<y.length?_?_+this.text(y,E):this.text(y,E):_||""},i.prototype.end=f,i.prototype.text=c,i.prototype.fillLast=function(y){if(this.lastNeed<=y.length)return y.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);y.copy(this.lastChar,this.lastTotal-this.lastNeed,0,y.length),this.lastNeed-=y.length};function o(y){return y<=127?0:y>>5===6?2:y>>4===14?3:y>>3===30?4:y>>6===2?-1:-2}function s(y,_,E){var S=_.length-1;if(S<E)return 0;var A=o(_[S]);return A>=0?(A>0&&(y.lastNeed=A-1),A):--S<E||A===-2?0:(A=o(_[S]),A>=0?(A>0&&(y.lastNeed=A-2),A):--S<E||A===-2?0:(A=o(_[S]),A>=0?(A>0&&(A===2?A=0:y.lastNeed=A-3),A):0))}function a(y,_,E){if((_[0]&192)!==128)return y.lastNeed=0,"\uFFFD";if(y.lastNeed>1&&_.length>1){if((_[1]&192)!==128)return y.lastNeed=1,"\uFFFD";if(y.lastNeed>2&&_.length>2&&(_[2]&192)!==128)return y.lastNeed=2,"\uFFFD"}}function u(y){var _=this.lastTotal-this.lastNeed,E=a(this,y);if(E!==void 0)return E;if(this.lastNeed<=y.length)return y.copy(this.lastChar,_,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);y.copy(this.lastChar,_,0,y.length),this.lastNeed-=y.length}function c(y,_){var E=s(this,y,_);if(!this.lastNeed)return y.toString("utf8",_);this.lastTotal=E;var S=y.length-(E-this.lastNeed);return y.copy(this.lastChar,0,S),y.toString("utf8",_,S)}function f(y){var _=y&&y.length?this.write(y):"";return this.lastNeed?_+"\uFFFD":_}function h(y,_){if((y.length-_)%2===0){var E=y.toString("utf16le",_);if(E){var S=E.charCodeAt(E.length-1);if(S>=55296&&S<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=y[y.length-2],this.lastChar[1]=y[y.length-1],E.slice(0,-1)}return E}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=y[y.length-1],y.toString("utf16le",_,y.length-1)}function p(y){var _=y&&y.length?this.write(y):"";if(this.lastNeed){var E=this.lastTotal-this.lastNeed;return _+this.lastChar.toString("utf16le",0,E)}return _}function m(y,_){var E=(y.length-_)%3;return E===0?y.toString("base64",_):(this.lastNeed=3-E,this.lastTotal=3,E===1?this.lastChar[0]=y[y.length-1]:(this.lastChar[0]=y[y.length-2],this.lastChar[1]=y[y.length-1]),y.toString("base64",_,y.length-E))}function b(y){var _=y&&y.length?this.write(y):"";return this.lastNeed?_+this.lastChar.toString("base64",0,3-this.lastNeed):_}function v(y){return y.toString(this.encoding)}function w(y){return y&&y.length?this.write(y):""}return T1}var cg,ML,T1,BL,Fb,yee,FL=Jt(()=>{Ce();De();Re();Bf();cg={},ML=!1;T1={},BL=!1;Fb=UW();Fb.StringDecoder;yee=Fb.StringDecoder});var gg={};Uo(gg,{Duplex:()=>HW,PassThrough:()=>VW,Readable:()=>G1,Stream:()=>KW,Transform:()=>GW,Writable:()=>qW,default:()=>ur,finished:()=>YW,pipeline:()=>XW,promises:()=>ZW});function Nr(){return UL||(UL=!0,C1={ArrayIsArray(r){return Array.isArray(r)},ArrayPrototypeIncludes(r,e){return r.includes(e)},ArrayPrototypeIndexOf(r,e){return r.indexOf(e)},ArrayPrototypeJoin(r,e){return r.join(e)},ArrayPrototypeMap(r,e){return r.map(e)},ArrayPrototypePop(r,e){return r.pop(e)},ArrayPrototypePush(r,e){return r.push(e)},ArrayPrototypeSlice(r,e,t){return r.slice(e,t)},Error,FunctionPrototypeCall(r,e,...t){return r.call(e,...t)},FunctionPrototypeSymbolHasInstance(r,e){return Function.prototype[Symbol.hasInstance].call(r,e)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(r,e){return Object.defineProperties(r,e)},ObjectDefineProperty(r,e,t){return Object.defineProperty(r,e,t)},ObjectGetOwnPropertyDescriptor(r,e){return Object.getOwnPropertyDescriptor(r,e)},ObjectKeys(r){return Object.keys(r)},ObjectSetPrototypeOf(r,e){return Object.setPrototypeOf(r,e)},Promise,PromisePrototypeCatch(r,e){return r.catch(e)},PromisePrototypeThen(r,e,t){return r.then(e,t)},PromiseReject(r){return Promise.reject(r)},PromiseResolve(r){return Promise.resolve(r)},ReflectApply:Reflect.apply,RegExpPrototypeTest(r,e){return r.test(e)},SafeSet:Set,String,StringPrototypeSlice(r,e,t){return r.slice(e,t)},StringPrototypeToLowerCase(r){return r.toLowerCase()},StringPrototypeToUpperCase(r){return r.toUpperCase()},StringPrototypeTrim(r){return r.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(r,e,t){return r.set(e,t)},Boolean,Uint8Array}),C1}function dg(){if(jL)return fg;jL=!0;let{AbortController:r,AbortSignal:e}=typeof self<"u"?self:typeof window<"u"?window:void 0;return fg=r,fg.AbortSignal=e,fg.default=r,fg}function Vn(){if($L)return Ub;$L=!0;let r=fn(),{kResistStopPropagation:e,SymbolDispose:t}=Nr(),n=globalThis.AbortSignal||dg().AbortSignal,i=globalThis.AbortController||dg().AbortController,o=Object.getPrototypeOf(async function(){}).constructor,s=globalThis.Blob||r.Blob,a=typeof s<"u"?function(p){return p instanceof s}:function(p){return!1},u=(h,p)=>{if(h!==void 0&&(h===null||typeof h!="object"||!("aborted"in h)))throw new ERR_INVALID_ARG_TYPE(p,"AbortSignal",h)},c=(h,p)=>{if(typeof h!="function")throw new ERR_INVALID_ARG_TYPE(p,"Function",h)};class f extends Error{constructor(p){if(!Array.isArray(p))throw new TypeError(`Expected input to be an Array, got ${typeof p}`);let m="";for(let b=0;b<p.length;b++)m+=` ${p[b].stack}
93
+ `;super(m),this.name="AggregateError",this.errors=p}}return Ub={AggregateError:f,kEmptyObject:Object.freeze({}),once(h){let p=!1;return function(...m){p||(p=!0,h.apply(this,m))}},createDeferredPromise:function(){let h,p;return{promise:new Promise((b,v)=>{h=b,p=v}),resolve:h,reject:p}},promisify(h){return new Promise((p,m)=>{h((b,...v)=>b?m(b):p(...v))})},debuglog(){return function(){}},format(h,...p){return h.replace(/%([sdifj])/g,function(...[m,b]){let v=p.shift();return b==="f"?v.toFixed(6):b==="j"?JSON.stringify(v):b==="s"&&typeof v=="object"?`${v.constructor!==Object?v.constructor.name:""} {}`.trim():v.toString()})},inspect(h){switch(typeof h){case"string":if(h.includes("'"))if(h.includes('"')){if(!h.includes("`")&&!h.includes("${"))return`\`${h}\``}else return`"${h}"`;return`'${h}'`;case"number":return isNaN(h)?"NaN":Object.is(h,-0)?String(h):h;case"bigint":return`${String(h)}n`;case"boolean":case"undefined":return String(h);case"object":return"{}"}},types:{isAsyncFunction(h){return h instanceof o},isArrayBufferView(h){return ArrayBuffer.isView(h)}},isBlob:a,deprecate(h,p){return h},addAbortListener:ao.addAbortListener||function(p,m){if(p===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",p);u(p,"signal"),c(m,"listener");let b;return p.aborted?queueMicrotask(()=>m()):(p.addEventListener("abort",m,{__proto__:null,once:!0,[e]:!0}),b=()=>{p.removeEventListener("abort",m)}),{__proto__:null,[t](){var v;(v=b)===null||v===void 0||v()}}},AbortSignalAny:n.any||function(p){if(p.length===1)return p[0];let m=new i,b=()=>m.abort();return p.forEach(v=>{u(v,"signals"),v.addEventListener("abort",b,{once:!0})}),m.signal.addEventListener("abort",()=>{p.forEach(v=>v.removeEventListener("abort",b))},{once:!0}),m.signal}},Ub.promisify.custom=Symbol.for("nodejs.util.promisify.custom"),Ub}function fi(){if(zL)return R1;zL=!0;let{format:r,inspect:e,AggregateError:t}=Vn(),n=globalThis.AggregateError||t,i=Symbol("kIsNodeError"),o=["string","function","number","object","Function","Object","boolean","bigint","symbol"],s=/^([A-Z][a-z0-9]*)+$/,a="__node_internal_",u={};function c(w,y){if(!w)throw new u.ERR_INTERNAL_ASSERTION(y)}function f(w){let y="",_=w.length,E=w[0]==="-"?1:0;for(;_>=E+4;_-=3)y=`_${w.slice(_-3,_)}${y}`;return`${w.slice(0,_)}${y}`}function h(w,y,_){if(typeof y=="function")return c(y.length<=_.length,`Code: ${w}; The provided arguments length (${_.length}) does not match the required ones (${y.length}).`),y(..._);let E=(y.match(/%[dfijoOs]/g)||[]).length;return c(E===_.length,`Code: ${w}; The provided arguments length (${_.length}) does not match the required ones (${E}).`),_.length===0?y:r(y,..._)}function p(w,y,_){_||(_=Error);class E extends _{constructor(...A){super(h(w,y,A))}toString(){return`${this.name} [${w}]: ${this.message}`}}Object.defineProperties(E.prototype,{name:{value:_.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${w}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),E.prototype.code=w,E.prototype[i]=!0,u[w]=E}function m(w){let y=a+w.name;return Object.defineProperty(w,"name",{value:y}),w}function b(w,y){if(w&&y&&w!==y){if(Array.isArray(y.errors))return y.errors.push(w),y;let _=new n([y,w],y.message);return _.code=y.code,_}return w||y}class v extends Error{constructor(y="The operation was aborted",_=void 0){if(_!==void 0&&typeof _!="object")throw new u.ERR_INVALID_ARG_TYPE("options","Object",_);super(y,_),this.code="ABORT_ERR",this.name="AbortError"}}return p("ERR_ASSERTION","%s",Error),p("ERR_INVALID_ARG_TYPE",(w,y,_)=>{c(typeof w=="string","'name' must be a string"),Array.isArray(y)||(y=[y]);let E="The ";w.endsWith(" argument")?E+=`${w} `:E+=`"${w}" ${w.includes(".")?"property":"argument"} `,E+="must be ";let S=[],A=[],F=[];for(let H of y)c(typeof H=="string","All expected entries have to be of type string"),o.includes(H)?S.push(H.toLowerCase()):s.test(H)?A.push(H):(c(H!=="object",'The value "object" should be written as "Object"'),F.push(H));if(A.length>0){let H=S.indexOf("object");H!==-1&&(S.splice(S,H,1),A.push("Object"))}if(S.length>0){switch(S.length){case 1:E+=`of type ${S[0]}`;break;case 2:E+=`one of type ${S[0]} or ${S[1]}`;break;default:{let H=S.pop();E+=`one of type ${S.join(", ")}, or ${H}`}}(A.length>0||F.length>0)&&(E+=" or ")}if(A.length>0){switch(A.length){case 1:E+=`an instance of ${A[0]}`;break;case 2:E+=`an instance of ${A[0]} or ${A[1]}`;break;default:{let H=A.pop();E+=`an instance of ${A.join(", ")}, or ${H}`}}F.length>0&&(E+=" or ")}switch(F.length){case 0:break;case 1:F[0].toLowerCase()!==F[0]&&(E+="an "),E+=`${F[0]}`;break;case 2:E+=`one of ${F[0]} or ${F[1]}`;break;default:{let H=F.pop();E+=`one of ${F.join(", ")}, or ${H}`}}if(_==null)E+=`. Received ${_}`;else if(typeof _=="function"&&_.name)E+=`. Received function ${_.name}`;else if(typeof _=="object"){var D;if((D=_.constructor)!==null&&D!==void 0&&D.name)E+=`. Received an instance of ${_.constructor.name}`;else{let H=e(_,{depth:-1});E+=`. Received ${H}`}}else{let H=e(_,{colors:!1});H.length>25&&(H=`${H.slice(0,25)}...`),E+=`. Received type ${typeof _} (${H})`}return E},TypeError),p("ERR_INVALID_ARG_VALUE",(w,y,_="is invalid")=>{let E=e(y);return E.length>128&&(E=E.slice(0,128)+"..."),`The ${w.includes(".")?"property":"argument"} '${w}' ${_}. Received ${E}`},TypeError),p("ERR_INVALID_RETURN_VALUE",(w,y,_)=>{var E;let S=_!=null&&(E=_.constructor)!==null&&E!==void 0&&E.name?`instance of ${_.constructor.name}`:`type ${typeof _}`;return`Expected ${w} to be returned from the "${y}" function but got ${S}.`},TypeError),p("ERR_MISSING_ARGS",(...w)=>{c(w.length>0,"At least one arg needs to be specified");let y,_=w.length;switch(w=(Array.isArray(w)?w:[w]).map(E=>`"${E}"`).join(" or "),_){case 1:y+=`The ${w[0]} argument`;break;case 2:y+=`The ${w[0]} and ${w[1]} arguments`;break;default:{let E=w.pop();y+=`The ${w.join(", ")}, and ${E} arguments`}break}return`${y} must be specified`},TypeError),p("ERR_OUT_OF_RANGE",(w,y,_)=>{c(y,'Missing "range" argument');let E;return Number.isInteger(_)&&Math.abs(_)>2**32?E=f(String(_)):typeof _=="bigint"?(E=String(_),(_>2n**32n||_<-(2n**32n))&&(E=f(E)),E+="n"):E=e(_),`The value of "${w}" is out of range. It must be ${y}. Received ${E}`},RangeError),p("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),p("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),p("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),p("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),p("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),p("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),p("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),p("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),p("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),p("ERR_STREAM_WRITE_AFTER_END","write after end",Error),p("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),R1={AbortError:v,aggregateTwoErrors:m(b),hideStackFrames:m,codes:u},R1}function pg(){if(WL)return D1;WL=!0;let{ArrayIsArray:r,ArrayPrototypeIncludes:e,ArrayPrototypeJoin:t,ArrayPrototypeMap:n,NumberIsInteger:i,NumberIsNaN:o,NumberMAX_SAFE_INTEGER:s,NumberMIN_SAFE_INTEGER:a,NumberParseInt:u,ObjectPrototypeHasOwnProperty:c,RegExpPrototypeExec:f,String:h,StringPrototypeToUpperCase:p,StringPrototypeTrim:m}=Nr(),{hideStackFrames:b,codes:{ERR_SOCKET_BAD_PORT:v,ERR_INVALID_ARG_TYPE:w,ERR_INVALID_ARG_VALUE:y,ERR_OUT_OF_RANGE:_,ERR_UNKNOWN_SIGNAL:E}}=fi(),{normalizeEncoding:S}=Vn(),{isAsyncFunction:A,isArrayBufferView:F}=Vn().types,D={};function H(Ae){return Ae===(Ae|0)}function J(Ae){return Ae===Ae>>>0}let K=/^[0-7]+$/,ne="must be a 32-bit unsigned integer or an octal string";function k(Ae,je,ke){if(typeof Ae>"u"&&(Ae=ke),typeof Ae=="string"){if(f(K,Ae)===null)throw new y(je,Ae,ne);Ae=u(Ae,8)}return ie(Ae,je),Ae}let $=b((Ae,je,ke=a,Oe=s)=>{if(typeof Ae!="number")throw new w(je,"number",Ae);if(!i(Ae))throw new _(je,"an integer",Ae);if(Ae<ke||Ae>Oe)throw new _(je,`>= ${ke} && <= ${Oe}`,Ae)}),Y=b((Ae,je,ke=-2147483648,Oe=2147483647)=>{if(typeof Ae!="number")throw new w(je,"number",Ae);if(!i(Ae))throw new _(je,"an integer",Ae);if(Ae<ke||Ae>Oe)throw new _(je,`>= ${ke} && <= ${Oe}`,Ae)}),ie=b((Ae,je,ke=!1)=>{if(typeof Ae!="number")throw new w(je,"number",Ae);if(!i(Ae))throw new _(je,"an integer",Ae);let Oe=ke?1:0,Ve=4294967295;if(Ae<Oe||Ae>Ve)throw new _(je,`>= ${Oe} && <= ${Ve}`,Ae)});function re(Ae,je){if(typeof Ae!="string")throw new w(je,"string",Ae)}function N(Ae,je,ke=void 0,Oe){if(typeof Ae!="number")throw new w(je,"number",Ae);if(ke!=null&&Ae<ke||Oe!=null&&Ae>Oe||(ke!=null||Oe!=null)&&o(Ae))throw new _(je,`${ke!=null?`>= ${ke}`:""}${ke!=null&&Oe!=null?" && ":""}${Oe!=null?`<= ${Oe}`:""}`,Ae)}let x=b((Ae,je,ke)=>{if(!e(ke,Ae)){let Ve="must be one of: "+t(n(ke,Je=>typeof Je=="string"?`'${Je}'`:h(Je)),", ");throw new y(je,Ae,Ve)}});function P(Ae,je){if(typeof Ae!="boolean")throw new w(je,"boolean",Ae)}function C(Ae,je,ke){return Ae==null||!c(Ae,je)?ke:Ae[je]}let j=b((Ae,je,ke=null)=>{let Oe=C(ke,"allowArray",!1),Ve=C(ke,"allowFunction",!1);if(!C(ke,"nullable",!1)&&Ae===null||!Oe&&r(Ae)||typeof Ae!="object"&&(!Ve||typeof Ae!="function"))throw new w(je,"Object",Ae)}),U=b((Ae,je)=>{if(Ae!=null&&typeof Ae!="object"&&typeof Ae!="function")throw new w(je,"a dictionary",Ae)}),B=b((Ae,je,ke=0)=>{if(!r(Ae))throw new w(je,"Array",Ae);if(Ae.length<ke){let Oe=`must be longer than ${ke}`;throw new y(je,Ae,Oe)}});function Q(Ae,je){B(Ae,je);for(let ke=0;ke<Ae.length;ke++)re(Ae[ke],`${je}[${ke}]`)}function fe(Ae,je){B(Ae,je);for(let ke=0;ke<Ae.length;ke++)P(Ae[ke],`${je}[${ke}]`)}function _e(Ae,je){B(Ae,je);for(let ke=0;ke<Ae.length;ke++){let Oe=Ae[ke],Ve=`${je}[${ke}]`;if(Oe==null)throw new w(Ve,"AbortSignal",Oe);xe(Oe,Ve)}}function te(Ae,je="signal"){if(re(Ae,je),D[Ae]===void 0)throw D[p(Ae)]!==void 0?new E(Ae+" (signals must use all capital letters)"):new E(Ae)}let W=b((Ae,je="buffer")=>{if(!F(Ae))throw new w(je,["Buffer","TypedArray","DataView"],Ae)});function oe(Ae,je){let ke=S(je),Oe=Ae.length;if(ke==="hex"&&Oe%2!==0)throw new y("encoding",je,`is invalid for data of length ${Oe}`)}function be(Ae,je="Port",ke=!0){if(typeof Ae!="number"&&typeof Ae!="string"||typeof Ae=="string"&&m(Ae).length===0||+Ae!==+Ae>>>0||Ae>65535||Ae===0&&!ke)throw new v(je,Ae,ke);return Ae|0}let xe=b((Ae,je)=>{if(Ae!==void 0&&(Ae===null||typeof Ae!="object"||!("aborted"in Ae)))throw new w(je,"AbortSignal",Ae)}),X=b((Ae,je)=>{if(typeof Ae!="function")throw new w(je,"Function",Ae)}),M=b((Ae,je)=>{if(typeof Ae!="function"||A(Ae))throw new w(je,"Function",Ae)}),ae=b((Ae,je)=>{if(Ae!==void 0)throw new w(je,"undefined",Ae)});function ge(Ae,je,ke){if(!e(ke,Ae))throw new w(je,`('${t(ke,"|")}')`,Ae)}let Se=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function we(Ae,je){if(typeof Ae>"u"||!f(Se,Ae))throw new y(je,Ae,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function de(Ae){if(typeof Ae=="string")return we(Ae,"hints"),Ae;if(r(Ae)){let je=Ae.length,ke="";if(je===0)return ke;for(let Oe=0;Oe<je;Oe++){let Ve=Ae[Oe];we(Ve,"hints"),ke+=Ve,Oe!==je-1&&(ke+=", ")}return ke}throw new y("hints",Ae,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}return D1={isInt32:H,isUint32:J,parseFileMode:k,validateArray:B,validateStringArray:Q,validateBooleanArray:fe,validateAbortSignalArray:_e,validateBoolean:P,validateBuffer:W,validateDictionary:U,validateEncoding:oe,validateFunction:X,validateInt32:Y,validateInteger:$,validateNumber:N,validateObject:j,validateOneOf:x,validatePlainFunction:M,validatePort:be,validateSignalName:te,validateString:re,validateUint32:ie,validateUndefined:ae,validateUnion:ge,validateAbortSignal:xe,validateLinkHeaderValue:de},D1}function sa(){if(qL)return I1;qL=!0;let{SymbolAsyncIterator:r,SymbolIterator:e,SymbolFor:t}=Nr(),n=t("nodejs.stream.destroyed"),i=t("nodejs.stream.errored"),o=t("nodejs.stream.readable"),s=t("nodejs.stream.writable"),a=t("nodejs.stream.disturbed"),u=t("nodejs.webstream.isClosedPromise"),c=t("nodejs.webstream.controllerErrorFunction");function f(C,j=!1){var U;return!!(C&&typeof C.pipe=="function"&&typeof C.on=="function"&&(!j||typeof C.pause=="function"&&typeof C.resume=="function")&&(!C._writableState||((U=C._readableState)===null||U===void 0?void 0:U.readable)!==!1)&&(!C._writableState||C._readableState))}function h(C){var j;return!!(C&&typeof C.write=="function"&&typeof C.on=="function"&&(!C._readableState||((j=C._writableState)===null||j===void 0?void 0:j.writable)!==!1))}function p(C){return!!(C&&typeof C.pipe=="function"&&C._readableState&&typeof C.on=="function"&&typeof C.write=="function")}function m(C){return C&&(C._readableState||C._writableState||typeof C.write=="function"&&typeof C.on=="function"||typeof C.pipe=="function"&&typeof C.on=="function")}function b(C){return!!(C&&!m(C)&&typeof C.pipeThrough=="function"&&typeof C.getReader=="function"&&typeof C.cancel=="function")}function v(C){return!!(C&&!m(C)&&typeof C.getWriter=="function"&&typeof C.abort=="function")}function w(C){return!!(C&&!m(C)&&typeof C.readable=="object"&&typeof C.writable=="object")}function y(C){return b(C)||v(C)||w(C)}function _(C,j){return C==null?!1:j===!0?typeof C[r]=="function":j===!1?typeof C[e]=="function":typeof C[r]=="function"||typeof C[e]=="function"}function E(C){if(!m(C))return null;let j=C._writableState,U=C._readableState,B=j||U;return!!(C.destroyed||C[n]||B!=null&&B.destroyed)}function S(C){if(!h(C))return null;if(C.writableEnded===!0)return!0;let j=C._writableState;return j!=null&&j.errored?!1:typeof j?.ended!="boolean"?null:j.ended}function A(C,j){if(!h(C))return null;if(C.writableFinished===!0)return!0;let U=C._writableState;return U!=null&&U.errored?!1:typeof U?.finished!="boolean"?null:!!(U.finished||j===!1&&U.ended===!0&&U.length===0)}function F(C){if(!f(C))return null;if(C.readableEnded===!0)return!0;let j=C._readableState;return!j||j.errored?!1:typeof j?.ended!="boolean"?null:j.ended}function D(C,j){if(!f(C))return null;let U=C._readableState;return U!=null&&U.errored?!1:typeof U?.endEmitted!="boolean"?null:!!(U.endEmitted||j===!1&&U.ended===!0&&U.length===0)}function H(C){return C&&C[o]!=null?C[o]:typeof C?.readable!="boolean"?null:E(C)?!1:f(C)&&C.readable&&!D(C)}function J(C){return C&&C[s]!=null?C[s]:typeof C?.writable!="boolean"?null:E(C)?!1:h(C)&&C.writable&&!S(C)}function K(C,j){return m(C)?E(C)?!0:!(j?.readable!==!1&&H(C)||j?.writable!==!1&&J(C)):null}function ne(C){var j,U;return m(C)?C.writableErrored?C.writableErrored:(j=(U=C._writableState)===null||U===void 0?void 0:U.errored)!==null&&j!==void 0?j:null:null}function k(C){var j,U;return m(C)?C.readableErrored?C.readableErrored:(j=(U=C._readableState)===null||U===void 0?void 0:U.errored)!==null&&j!==void 0?j:null:null}function $(C){if(!m(C))return null;if(typeof C.closed=="boolean")return C.closed;let j=C._writableState,U=C._readableState;return typeof j?.closed=="boolean"||typeof U?.closed=="boolean"?j?.closed||U?.closed:typeof C._closed=="boolean"&&Y(C)?C._closed:null}function Y(C){return typeof C._closed=="boolean"&&typeof C._defaultKeepAlive=="boolean"&&typeof C._removedConnection=="boolean"&&typeof C._removedContLen=="boolean"}function ie(C){return typeof C._sent100=="boolean"&&Y(C)}function re(C){var j;return typeof C._consuming=="boolean"&&typeof C._dumped=="boolean"&&((j=C.req)===null||j===void 0?void 0:j.upgradeOrConnect)===void 0}function N(C){if(!m(C))return null;let j=C._writableState,U=C._readableState,B=j||U;return!B&&ie(C)||!!(B&&B.autoDestroy&&B.emitClose&&B.closed===!1)}function x(C){var j;return!!(C&&((j=C[a])!==null&&j!==void 0?j:C.readableDidRead||C.readableAborted))}function P(C){var j,U,B,Q,fe,_e,te,W,oe,be;return!!(C&&((j=(U=(B=(Q=(fe=(_e=C[i])!==null&&_e!==void 0?_e:C.readableErrored)!==null&&fe!==void 0?fe:C.writableErrored)!==null&&Q!==void 0?Q:(te=C._readableState)===null||te===void 0?void 0:te.errorEmitted)!==null&&B!==void 0?B:(W=C._writableState)===null||W===void 0?void 0:W.errorEmitted)!==null&&U!==void 0?U:(oe=C._readableState)===null||oe===void 0?void 0:oe.errored)!==null&&j!==void 0?j:!((be=C._writableState)===null||be===void 0)&&be.errored))}return I1={isDestroyed:E,kIsDestroyed:n,isDisturbed:x,kIsDisturbed:a,isErrored:P,kIsErrored:i,isReadable:H,kIsReadable:o,kIsClosedPromise:u,kControllerErrorFunction:c,kIsWritable:s,isClosed:$,isDuplexNodeStream:p,isFinished:K,isIterable:_,isReadableNodeStream:f,isReadableStream:b,isReadableEnded:F,isReadableFinished:D,isReadableErrored:k,isNodeStream:m,isWebStream:y,isWritable:J,isWritableNodeStream:h,isWritableStream:v,isWritableEnded:S,isWritableFinished:A,isWritableErrored:ne,isServerRequest:re,isServerResponse:ie,willEmitClose:N,isTransformStream:w},I1}function wl(){if(HL)return jb;HL=!0;let r=zr,{AbortError:e,codes:t}=fi(),{ERR_INVALID_ARG_TYPE:n,ERR_STREAM_PREMATURE_CLOSE:i}=t,{kEmptyObject:o,once:s}=Vn(),{validateAbortSignal:a,validateFunction:u,validateObject:c,validateBoolean:f}=pg(),{Promise:h,PromisePrototypeThen:p,SymbolDispose:m}=Nr(),{isClosed:b,isReadable:v,isReadableNodeStream:w,isReadableStream:y,isReadableFinished:_,isReadableErrored:E,isWritable:S,isWritableNodeStream:A,isWritableStream:F,isWritableFinished:D,isWritableErrored:H,isNodeStream:J,willEmitClose:K,kIsClosedPromise:ne}=sa(),k;function $(x){return x.setHeader&&typeof x.abort=="function"}let Y=()=>{};function ie(x,P,C){var j,U;if(arguments.length===2?(C=P,P=o):P==null?P=o:c(P,"options"),u(C,"callback"),a(P.signal,"options.signal"),C=s(C),y(x)||F(x))return re(x,P,C);if(!J(x))throw new n("stream",["ReadableStream","WritableStream","Stream"],x);let B=(j=P.readable)!==null&&j!==void 0?j:w(x),Q=(U=P.writable)!==null&&U!==void 0?U:A(x),fe=x._writableState,_e=x._readableState,te=()=>{x.writable||be()},W=K(x)&&w(x)===B&&A(x)===Q,oe=D(x,!1),be=()=>{oe=!0,x.destroyed&&(W=!1),!(W&&(!x.readable||B))&&(!B||xe)&&C.call(x)},xe=_(x,!1),X=()=>{xe=!0,x.destroyed&&(W=!1),!(W&&(!x.writable||Q))&&(!Q||oe)&&C.call(x)},M=Ae=>{C.call(x,Ae)},ae=b(x),ge=()=>{ae=!0;let Ae=H(x)||E(x);if(Ae&&typeof Ae!="boolean")return C.call(x,Ae);if(B&&!xe&&w(x,!0)&&!_(x,!1))return C.call(x,new i);if(Q&&!oe&&!D(x,!1))return C.call(x,new i);C.call(x)},Se=()=>{ae=!0;let Ae=H(x)||E(x);if(Ae&&typeof Ae!="boolean")return C.call(x,Ae);C.call(x)},we=()=>{x.req.on("finish",be)};$(x)?(x.on("complete",be),W||x.on("abort",ge),x.req?we():x.on("request",we)):Q&&!fe&&(x.on("end",te),x.on("close",te)),!W&&typeof x.aborted=="boolean"&&x.on("aborted",ge),x.on("end",X),x.on("finish",be),P.error!==!1&&x.on("error",M),x.on("close",ge),ae?r.nextTick(ge):fe!=null&&fe.errorEmitted||_e!=null&&_e.errorEmitted?W||r.nextTick(Se):(!B&&(!W||v(x))&&(oe||S(x)===!1)||!Q&&(!W||S(x))&&(xe||v(x)===!1)||_e&&x.req&&x.aborted)&&r.nextTick(Se);let de=()=>{C=Y,x.removeListener("aborted",ge),x.removeListener("complete",be),x.removeListener("abort",ge),x.removeListener("request",we),x.req&&x.req.removeListener("finish",be),x.removeListener("end",te),x.removeListener("close",te),x.removeListener("finish",be),x.removeListener("end",X),x.removeListener("error",M),x.removeListener("close",ge)};if(P.signal&&!ae){let Ae=()=>{let je=C;de(),je.call(x,new e(void 0,{cause:P.signal.reason}))};if(P.signal.aborted)r.nextTick(Ae);else{k=k||Vn().addAbortListener;let je=k(P.signal,Ae),ke=C;C=s((...Oe)=>{je[m](),ke.apply(x,Oe)})}}return de}function re(x,P,C){let j=!1,U=Y;if(P.signal)if(U=()=>{j=!0,C.call(x,new e(void 0,{cause:P.signal.reason}))},P.signal.aborted)r.nextTick(U);else{k=k||Vn().addAbortListener;let Q=k(P.signal,U),fe=C;C=s((..._e)=>{Q[m](),fe.apply(x,_e)})}let B=(...Q)=>{j||r.nextTick(()=>C.apply(x,Q))};return p(x[ne].promise,B,B),Y}function N(x,P){var C;let j=!1;return P===null&&(P=o),(C=P)!==null&&C!==void 0&&C.cleanup&&(f(P.cleanup,"cleanup"),j=P.cleanup),new h((U,B)=>{let Q=ie(x,P,fe=>{j&&Q(),fe?B(fe):U()})})}return jb=ie,jb.finished=N,jb}function bh(){if(GL)return O1;GL=!0;let r=zr,{aggregateTwoErrors:e,codes:{ERR_MULTIPLE_CALLBACK:t},AbortError:n}=fi(),{Symbol:i}=Nr(),{kIsDestroyed:o,isDestroyed:s,isFinished:a,isServerRequest:u}=sa(),c=i("kDestroy"),f=i("kConstruct");function h(K,ne,k){K&&(K.stack,ne&&!ne.errored&&(ne.errored=K),k&&!k.errored&&(k.errored=K))}function p(K,ne){let k=this._readableState,$=this._writableState,Y=$||k;return $!=null&&$.destroyed||k!=null&&k.destroyed?(typeof ne=="function"&&ne(),this):(h(K,$,k),$&&($.destroyed=!0),k&&(k.destroyed=!0),Y.constructed?m(this,K,ne):this.once(c,function(ie){m(this,e(ie,K),ne)}),this)}function m(K,ne,k){let $=!1;function Y(ie){if($)return;$=!0;let re=K._readableState,N=K._writableState;h(ie,N,re),N&&(N.closed=!0),re&&(re.closed=!0),typeof k=="function"&&k(ie),ie?r.nextTick(b,K,ie):r.nextTick(v,K)}try{K._destroy(ne||null,Y)}catch(ie){Y(ie)}}function b(K,ne){w(K,ne),v(K)}function v(K){let ne=K._readableState,k=K._writableState;k&&(k.closeEmitted=!0),ne&&(ne.closeEmitted=!0),(k!=null&&k.emitClose||ne!=null&&ne.emitClose)&&K.emit("close")}function w(K,ne){let k=K._readableState,$=K._writableState;$!=null&&$.errorEmitted||k!=null&&k.errorEmitted||($&&($.errorEmitted=!0),k&&(k.errorEmitted=!0),K.emit("error",ne))}function y(){let K=this._readableState,ne=this._writableState;K&&(K.constructed=!0,K.closed=!1,K.closeEmitted=!1,K.destroyed=!1,K.errored=null,K.errorEmitted=!1,K.reading=!1,K.ended=K.readable===!1,K.endEmitted=K.readable===!1),ne&&(ne.constructed=!0,ne.destroyed=!1,ne.closed=!1,ne.closeEmitted=!1,ne.errored=null,ne.errorEmitted=!1,ne.finalCalled=!1,ne.prefinished=!1,ne.ended=ne.writable===!1,ne.ending=ne.writable===!1,ne.finished=ne.writable===!1)}function _(K,ne,k){let $=K._readableState,Y=K._writableState;if(Y!=null&&Y.destroyed||$!=null&&$.destroyed)return this;$!=null&&$.autoDestroy||Y!=null&&Y.autoDestroy?K.destroy(ne):ne&&(ne.stack,Y&&!Y.errored&&(Y.errored=ne),$&&!$.errored&&($.errored=ne),k?r.nextTick(w,K,ne):w(K,ne))}function E(K,ne){if(typeof K._construct!="function")return;let k=K._readableState,$=K._writableState;k&&(k.constructed=!1),$&&($.constructed=!1),K.once(f,ne),!(K.listenerCount(f)>1)&&r.nextTick(S,K)}function S(K){let ne=!1;function k($){if(ne){_(K,$??new t);return}ne=!0;let Y=K._readableState,ie=K._writableState,re=ie||Y;Y&&(Y.constructed=!0),ie&&(ie.constructed=!0),re.destroyed?K.emit(c,$):$?_(K,$,!0):r.nextTick(A,K)}try{K._construct($=>{r.nextTick(k,$)})}catch($){r.nextTick(k,$)}}function A(K){K.emit(f)}function F(K){return K?.setHeader&&typeof K.abort=="function"}function D(K){K.emit("close")}function H(K,ne){K.emit("error",ne),r.nextTick(D,K)}function J(K,ne){!K||s(K)||(!ne&&!a(K)&&(ne=new n),u(K)?(K.socket=null,K.destroy(ne)):F(K)?K.abort():F(K.req)?K.req.abort():typeof K.destroy=="function"?K.destroy(ne):typeof K.close=="function"?K.close():ne?r.nextTick(H,K,ne):r.nextTick(D,K),K.destroyed||(K[o]=!0))}return O1={construct:E,destroyer:J,destroy:p,undestroy:y,errorOrDestroy:_},O1}function V1(){if(VL)return N1;VL=!0;let{ArrayIsArray:r,ObjectSetPrototypeOf:e}=Nr(),{EventEmitter:t}=ao;function n(o){t.call(this,o)}e(n.prototype,t.prototype),e(n,t),n.prototype.pipe=function(o,s){let a=this;function u(v){o.writable&&o.write(v)===!1&&a.pause&&a.pause()}a.on("data",u);function c(){a.readable&&a.resume&&a.resume()}o.on("drain",c),!o._isStdio&&(!s||s.end!==!1)&&(a.on("end",h),a.on("close",p));let f=!1;function h(){f||(f=!0,o.end())}function p(){f||(f=!0,typeof o.destroy=="function"&&o.destroy())}function m(v){b(),t.listenerCount(this,"error")===0&&this.emit("error",v)}i(a,"error",m),i(o,"error",m);function b(){a.removeListener("data",u),o.removeListener("drain",c),a.removeListener("end",h),a.removeListener("close",p),a.removeListener("error",m),o.removeListener("error",m),a.removeListener("end",b),a.removeListener("close",b),o.removeListener("close",b)}return a.on("end",b),a.on("close",b),o.on("close",b),o.emit("pipe",a),o};function i(o,s,a){if(typeof o.prependListener=="function")return o.prependListener(s,a);!o._events||!o._events[s]?o.on(s,a):r(o._events[s])?o._events[s].unshift(a):o._events[s]=[a,o._events[s]]}return N1={Stream:n,prependListener:i},N1}function zb(){if(YL)return hg;YL=!0;let{SymbolDispose:r}=Nr(),{AbortError:e,codes:t}=fi(),{isNodeStream:n,isWebStream:i,kControllerErrorFunction:o}=sa(),s=wl(),{ERR_INVALID_ARG_TYPE:a}=t,u,c=(f,h)=>{if(typeof f!="object"||!("aborted"in f))throw new a(h,"AbortSignal",f)};return hg.addAbortSignal=function(h,p){if(c(h,"signal"),!n(p)&&!i(p))throw new a("stream",["ReadableStream","WritableStream","Stream"],p);return hg.addAbortSignalNoValidate(h,p)},hg.addAbortSignalNoValidate=function(f,h){if(typeof f!="object"||!("aborted"in f))return h;let p=n(h)?()=>{h.destroy(new e(void 0,{cause:f.reason}))}:()=>{h[o](new e(void 0,{cause:f.reason}))};if(f.aborted)p();else{u=u||Vn().addAbortListener;let m=u(f,p);s(h,m[r])}return h},hg}function jW(){if(XL)return k1;XL=!0;let{StringPrototypeSlice:r,SymbolIterator:e,TypedArrayPrototypeSet:t,Uint8Array:n}=Nr(),{Buffer:i}=fn(),{inspect:o}=Vn();return k1=class{constructor(){this.head=null,this.tail=null,this.length=0}push(a){let u={data:a,next:null};this.length>0?this.tail.next=u:this.head=u,this.tail=u,++this.length}unshift(a){let u={data:a,next:this.head};this.length===0&&(this.tail=u),this.head=u,++this.length}shift(){if(this.length===0)return;let a=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,a}clear(){this.head=this.tail=null,this.length=0}join(a){if(this.length===0)return"";let u=this.head,c=""+u.data;for(;(u=u.next)!==null;)c+=a+u.data;return c}concat(a){if(this.length===0)return i.alloc(0);let u=i.allocUnsafe(a>>>0),c=this.head,f=0;for(;c;)t(u,c.data,f),f+=c.data.length,c=c.next;return u}consume(a,u){let c=this.head.data;if(a<c.length){let f=c.slice(0,a);return this.head.data=c.slice(a),f}return a===c.length?this.shift():u?this._getString(a):this._getBuffer(a)}first(){return this.head.data}*[e](){for(let a=this.head;a;a=a.next)yield a.data}_getString(a){let u="",c=this.head,f=0;do{let h=c.data;if(a>h.length)u+=h,a-=h.length;else{a===h.length?(u+=h,++f,c.next?this.head=c.next:this.head=this.tail=null):(u+=r(h,0,a),this.head=c,c.data=r(h,a));break}++f}while((c=c.next)!==null);return this.length-=f,u}_getBuffer(a){let u=i.allocUnsafe(a),c=a,f=this.head,h=0;do{let p=f.data;if(a>p.length)t(u,p,c-a),a-=p.length;else{a===p.length?(t(u,p,c-a),++h,f.next?this.head=f.next:this.head=this.tail=null):(t(u,new n(p.buffer,p.byteOffset,a),c-a),this.head=f,f.data=p.slice(a));break}++h}while((f=f.next)!==null);return this.length-=h,u}[Symbol.for("nodejs.util.inspect.custom")](a,u){return o(this,{...u,depth:0,customInspect:!1})}},k1}function Wb(){if(KL)return L1;KL=!0;let{MathFloor:r,NumberIsInteger:e}=Nr(),{validateInteger:t}=pg(),{ERR_INVALID_ARG_VALUE:n}=fi().codes,i=16*1024,o=16;function s(f,h,p){return f.highWaterMark!=null?f.highWaterMark:h?f[p]:null}function a(f){return f?o:i}function u(f,h){t(h,"value",0),f?o=h:i=h}function c(f,h,p,m){let b=s(h,m,p);if(b!=null){if(!e(b)||b<0){let v=m?`options.${p}`:"options.highWaterMark";throw new n(v,b)}return r(b)}return a(f.objectMode)}return L1={getHighWaterMark:c,getDefaultHighWaterMark:a,setDefaultHighWaterMark:u},L1}function fP(){if(ZL)return P1;ZL=!0;let r=zr,{PromisePrototypeThen:e,SymbolAsyncIterator:t,SymbolIterator:n}=Nr(),{Buffer:i}=fn(),{ERR_INVALID_ARG_TYPE:o,ERR_STREAM_NULL_VALUES:s}=fi().codes;function a(u,c,f){let h;if(typeof c=="string"||c instanceof i)return new u({objectMode:!0,...f,read(){this.push(c),this.push(null)}});let p;if(c&&c[t])p=!0,h=c[t]();else if(c&&c[n])p=!1,h=c[n]();else throw new o("iterable",["Iterable"],c);let m=new u({objectMode:!0,highWaterMark:1,...f}),b=!1;m._read=function(){b||(b=!0,w())},m._destroy=function(y,_){e(v(y),()=>r.nextTick(_,y),E=>r.nextTick(_,E||y))};async function v(y){let _=y!=null,E=typeof h.throw=="function";if(_&&E){let{value:S,done:A}=await h.throw(y);if(await S,A)return}if(typeof h.return=="function"){let{value:S}=await h.return();await S}}async function w(){for(;;){try{let{value:y,done:_}=p?await h.next():h.next();if(_)m.push(null);else{let E=y&&typeof y.then=="function"?await y:y;if(E===null)throw b=!1,new s;if(m.push(E))continue;b=!1}}catch(y){m.destroy(y)}break}}return m}return P1=a,P1}function qb(){if(JL)return M1;JL=!0;let r=zr,{ArrayPrototypeIndexOf:e,NumberIsInteger:t,NumberIsNaN:n,NumberParseInt:i,ObjectDefineProperties:o,ObjectKeys:s,ObjectSetPrototypeOf:a,Promise:u,SafeSet:c,SymbolAsyncDispose:f,SymbolAsyncIterator:h,Symbol:p}=Nr();M1=Oe,Oe.ReadableState=ke;let{EventEmitter:m}=ao,{Stream:b,prependListener:v}=V1(),{Buffer:w}=fn(),{addAbortSignal:y}=zb(),_=wl(),E=Vn().debuglog("stream",ue=>{E=ue}),S=jW(),A=bh(),{getHighWaterMark:F,getDefaultHighWaterMark:D}=Wb(),{aggregateTwoErrors:H,codes:{ERR_INVALID_ARG_TYPE:J,ERR_METHOD_NOT_IMPLEMENTED:K,ERR_OUT_OF_RANGE:ne,ERR_STREAM_PUSH_AFTER_EOF:k,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:$},AbortError:Y}=fi(),{validateObject:ie}=pg(),re=p("kPaused"),{StringDecoder:N}=Fb,x=fP();a(Oe.prototype,b.prototype),a(Oe,b);let P=()=>{},{errorOrDestroy:C}=A,j=1,U=2,B=4,Q=8,fe=16,_e=32,te=64,W=128,oe=256,be=512,xe=1024,X=2048,M=4096,ae=8192,ge=16384,Se=32768,we=65536,de=1<<17,Ae=1<<18;function je(ue){return{enumerable:!1,get(){return((this||qe).state&ue)!==0},set(me){me?(this||qe).state|=ue:(this||qe).state&=~ue}}}o(ke.prototype,{objectMode:je(j),ended:je(U),endEmitted:je(B),reading:je(Q),constructed:je(fe),sync:je(_e),needReadable:je(te),emittedReadable:je(W),readableListening:je(oe),resumeScheduled:je(be),errorEmitted:je(xe),emitClose:je(X),autoDestroy:je(M),destroyed:je(ae),closed:je(ge),closeEmitted:je(Se),multiAwaitDrain:je(we),readingMore:je(de),dataEmitted:je(Ae)});function ke(ue,me,We){typeof We!="boolean"&&(We=me instanceof ia()),(this||qe).state=X|M|fe|_e,ue&&ue.objectMode&&((this||qe).state|=j),We&&ue&&ue.readableObjectMode&&((this||qe).state|=j),(this||qe).highWaterMark=ue?F(this||qe,ue,"readableHighWaterMark",We):D(!1),(this||qe).buffer=new S,(this||qe).length=0,(this||qe).pipes=[],(this||qe).flowing=null,(this||qe)[re]=null,ue&&ue.emitClose===!1&&((this||qe).state&=~X),ue&&ue.autoDestroy===!1&&((this||qe).state&=~M),(this||qe).errored=null,(this||qe).defaultEncoding=ue&&ue.defaultEncoding||"utf8",(this||qe).awaitDrainWriters=null,(this||qe).decoder=null,(this||qe).encoding=null,ue&&ue.encoding&&((this||qe).decoder=new N(ue.encoding),(this||qe).encoding=ue.encoding)}function Oe(ue){if(!((this||qe)instanceof Oe))return new Oe(ue);let me=(this||qe)instanceof ia();(this||qe)._readableState=new ke(ue,this||qe,me),ue&&(typeof ue.read=="function"&&((this||qe)._read=ue.read),typeof ue.destroy=="function"&&((this||qe)._destroy=ue.destroy),typeof ue.construct=="function"&&((this||qe)._construct=ue.construct),ue.signal&&!me&&y(ue.signal,this||qe)),b.call(this||qe,ue),A.construct(this||qe,()=>{(this||qe)._readableState.needReadable&&R(this||qe,(this||qe)._readableState)})}Oe.prototype.destroy=A.destroy,Oe.prototype._undestroy=A.undestroy,Oe.prototype._destroy=function(ue,me){me(ue)},Oe.prototype[m.captureRejectionSymbol]=function(ue){this.destroy(ue)},Oe.prototype[f]=function(){let ue;return(this||qe).destroyed||(ue=(this||qe).readableEnded?null:new Y,this.destroy(ue)),new u((me,We)=>_(this||qe,Ue=>Ue&&Ue!==ue?We(Ue):me(null)))},Oe.prototype.push=function(ue,me){return Ve(this||qe,ue,me,!1)},Oe.prototype.unshift=function(ue,me){return Ve(this||qe,ue,me,!0)};function Ve(ue,me,We,Ue){E("readableAddChunk",me);let Ze=ue._readableState,dt;if((Ze.state&j)===0&&(typeof me=="string"?(We=We||Ze.defaultEncoding,Ze.encoding!==We&&(Ue&&Ze.encoding?me=w.from(me,We).toString(Ze.encoding):(me=w.from(me,We),We=""))):me instanceof w?We="":b._isUint8Array(me)?(me=b._uint8ArrayToBuffer(me),We=""):me!=null&&(dt=new J("chunk",["string","Buffer","Uint8Array"],me))),dt)C(ue,dt);else if(me===null)Ze.state&=~Q,g(ue,Ze);else if((Ze.state&j)!==0||me&&me.length>0)if(Ue)if((Ze.state&B)!==0)C(ue,new $);else{if(Ze.destroyed||Ze.errored)return!1;Je(ue,Ze,me,!0)}else if(Ze.ended)C(ue,new k);else{if(Ze.destroyed||Ze.errored)return!1;Ze.state&=~Q,Ze.decoder&&!We?(me=Ze.decoder.write(me),Ze.objectMode||me.length!==0?Je(ue,Ze,me,!1):R(ue,Ze)):Je(ue,Ze,me,!1)}else Ue||(Ze.state&=~Q,R(ue,Ze));return!Ze.ended&&(Ze.length<Ze.highWaterMark||Ze.length===0)}function Je(ue,me,We,Ue){me.flowing&&me.length===0&&!me.sync&&ue.listenerCount("data")>0?((me.state&we)!==0?me.awaitDrainWriters.clear():me.awaitDrainWriters=null,me.dataEmitted=!0,ue.emit("data",We)):(me.length+=me.objectMode?1:We.length,Ue?me.buffer.unshift(We):me.buffer.push(We),(me.state&te)!==0&&I(ue)),R(ue,me)}Oe.prototype.isPaused=function(){let ue=(this||qe)._readableState;return ue[re]===!0||ue.flowing===!1},Oe.prototype.setEncoding=function(ue){let me=new N(ue);(this||qe)._readableState.decoder=me,(this||qe)._readableState.encoding=(this||qe)._readableState.decoder.encoding;let We=(this||qe)._readableState.buffer,Ue="";for(let Ze of We)Ue+=me.write(Ze);return We.clear(),Ue!==""&&We.push(Ue),(this||qe)._readableState.length=Ue.length,this||qe};let et=1073741824;function T(ue){if(ue>et)throw new ne("size","<= 1GiB",ue);return ue--,ue|=ue>>>1,ue|=ue>>>2,ue|=ue>>>4,ue|=ue>>>8,ue|=ue>>>16,ue++,ue}function d(ue,me){return ue<=0||me.length===0&&me.ended?0:(me.state&j)!==0?1:n(ue)?me.flowing&&me.length?me.buffer.first().length:me.length:ue<=me.length?ue:me.ended?me.length:0}Oe.prototype.read=function(ue){E("read",ue),ue===void 0?ue=NaN:t(ue)||(ue=i(ue,10));let me=(this||qe)._readableState,We=ue;if(ue>me.highWaterMark&&(me.highWaterMark=T(ue)),ue!==0&&(me.state&=~W),ue===0&&me.needReadable&&((me.highWaterMark!==0?me.length>=me.highWaterMark:me.length>0)||me.ended))return E("read: emitReadable",me.length,me.ended),me.length===0&&me.ended?$e(this||qe):I(this||qe),null;if(ue=d(ue,me),ue===0&&me.ended)return me.length===0&&$e(this||qe),null;let Ue=(me.state&te)!==0;if(E("need readable",Ue),(me.length===0||me.length-ue<me.highWaterMark)&&(Ue=!0,E("length less than watermark",Ue)),me.ended||me.reading||me.destroyed||me.errored||!me.constructed)Ue=!1,E("reading, ended or constructing",Ue);else if(Ue){E("do read"),me.state|=Q|_e,me.length===0&&(me.state|=te);try{this._read(me.highWaterMark)}catch(dt){C(this||qe,dt)}me.state&=~_e,me.reading||(ue=d(We,me))}let Ze;return ue>0?Ze=Pe(ue,me):Ze=null,Ze===null?(me.needReadable=me.length<=me.highWaterMark,ue=0):(me.length-=ue,me.multiAwaitDrain?me.awaitDrainWriters.clear():me.awaitDrainWriters=null),me.length===0&&(me.ended||(me.needReadable=!0),We!==ue&&me.ended&&$e(this||qe)),Ze!==null&&!me.errorEmitted&&!me.closeEmitted&&(me.dataEmitted=!0,this.emit("data",Ze)),Ze};function g(ue,me){if(E("onEofChunk"),!me.ended){if(me.decoder){let We=me.decoder.end();We&&We.length&&(me.buffer.push(We),me.length+=me.objectMode?1:We.length)}me.ended=!0,me.sync?I(ue):(me.needReadable=!1,me.emittedReadable=!0,Z(ue))}}function I(ue){let me=ue._readableState;E("emitReadable",me.needReadable,me.emittedReadable),me.needReadable=!1,me.emittedReadable||(E("emitReadable",me.flowing),me.emittedReadable=!0,r.nextTick(Z,ue))}function Z(ue){let me=ue._readableState;E("emitReadable_",me.destroyed,me.length,me.ended),!me.destroyed&&!me.errored&&(me.length||me.ended)&&(ue.emit("readable"),me.emittedReadable=!1),me.needReadable=!me.flowing&&!me.ended&&me.length<=me.highWaterMark,Fe(ue)}function R(ue,me){!me.readingMore&&me.constructed&&(me.readingMore=!0,r.nextTick(le,ue,me))}function le(ue,me){for(;!me.reading&&!me.ended&&(me.length<me.highWaterMark||me.flowing&&me.length===0);){let We=me.length;if(E("maybeReadMore read 0"),ue.read(0),We===me.length)break}me.readingMore=!1}Oe.prototype._read=function(ue){throw new K("_read()")},Oe.prototype.pipe=function(ue,me){let We=this||qe,Ue=(this||qe)._readableState;Ue.pipes.length===1&&(Ue.multiAwaitDrain||(Ue.multiAwaitDrain=!0,Ue.awaitDrainWriters=new c(Ue.awaitDrainWriters?[Ue.awaitDrainWriters]:[]))),Ue.pipes.push(ue),E("pipe count=%d opts=%j",Ue.pipes.length,me);let dt=(!me||me.end!==!1)&&ue!==r.stdout&&ue!==r.stderr?Et:Zr;Ue.endEmitted?r.nextTick(dt):We.once("end",dt),ue.on("unpipe",Rt);function Rt(Jr,Qr){E("onunpipe"),Jr===We&&Qr&&Qr.hasUnpiped===!1&&(Qr.hasUnpiped=!0,qn())}function Et(){E("onend"),ue.end()}let ar,_i=!1;function qn(){E("cleanup"),ue.removeListener("close",zt),ue.removeListener("finish",Yt),ar&&ue.removeListener("drain",ar),ue.removeListener("error",yr),ue.removeListener("unpipe",Rt),We.removeListener("end",Et),We.removeListener("end",Zr),We.removeListener("data",Dr),_i=!0,ar&&Ue.awaitDrainWriters&&(!ue._writableState||ue._writableState.needDrain)&&ar()}function Ht(){_i||(Ue.pipes.length===1&&Ue.pipes[0]===ue?(E("false write response, pause",0),Ue.awaitDrainWriters=ue,Ue.multiAwaitDrain=!1):Ue.pipes.length>1&&Ue.pipes.includes(ue)&&(E("false write response, pause",Ue.awaitDrainWriters.size),Ue.awaitDrainWriters.add(ue)),We.pause()),ar||(ar=pe(We,ue),ue.on("drain",ar))}We.on("data",Dr);function Dr(Jr){E("ondata");let Qr=ue.write(Jr);E("dest.write",Qr),Qr===!1&&Ht()}function yr(Jr){if(E("onerror",Jr),Zr(),ue.removeListener("error",yr),ue.listenerCount("error")===0){let Qr=ue._writableState||ue._readableState;Qr&&!Qr.errorEmitted?C(ue,Jr):ue.emit("error",Jr)}}v(ue,"error",yr);function zt(){ue.removeListener("finish",Yt),Zr()}ue.once("close",zt);function Yt(){E("onfinish"),ue.removeListener("close",zt),Zr()}ue.once("finish",Yt);function Zr(){E("unpipe"),We.unpipe(ue)}return ue.emit("pipe",We),ue.writableNeedDrain===!0?Ht():Ue.flowing||(E("pipe resume"),We.resume()),ue};function pe(ue,me){return function(){let Ue=ue._readableState;Ue.awaitDrainWriters===me?(E("pipeOnDrain",1),Ue.awaitDrainWriters=null):Ue.multiAwaitDrain&&(E("pipeOnDrain",Ue.awaitDrainWriters.size),Ue.awaitDrainWriters.delete(me)),(!Ue.awaitDrainWriters||Ue.awaitDrainWriters.size===0)&&ue.listenerCount("data")&&ue.resume()}}Oe.prototype.unpipe=function(ue){let me=(this||qe)._readableState,We={hasUnpiped:!1};if(me.pipes.length===0)return this||qe;if(!ue){let Ze=me.pipes;me.pipes=[],this.pause();for(let dt=0;dt<Ze.length;dt++)Ze[dt].emit("unpipe",this||qe,{hasUnpiped:!1});return this||qe}let Ue=e(me.pipes,ue);return Ue===-1?this||qe:(me.pipes.splice(Ue,1),me.pipes.length===0&&this.pause(),ue.emit("unpipe",this||qe,We),this||qe)},Oe.prototype.on=function(ue,me){let We=b.prototype.on.call(this||qe,ue,me),Ue=(this||qe)._readableState;return ue==="data"?(Ue.readableListening=this.listenerCount("readable")>0,Ue.flowing!==!1&&this.resume()):ue==="readable"&&!Ue.endEmitted&&!Ue.readableListening&&(Ue.readableListening=Ue.needReadable=!0,Ue.flowing=!1,Ue.emittedReadable=!1,E("on readable",Ue.length,Ue.reading),Ue.length?I(this||qe):Ue.reading||r.nextTick(ve,this||qe)),We},Oe.prototype.addListener=Oe.prototype.on,Oe.prototype.removeListener=function(ue,me){let We=b.prototype.removeListener.call(this||qe,ue,me);return ue==="readable"&&r.nextTick(Ee,this||qe),We},Oe.prototype.off=Oe.prototype.removeListener,Oe.prototype.removeAllListeners=function(ue){let me=b.prototype.removeAllListeners.apply(this||qe,arguments);return(ue==="readable"||ue===void 0)&&r.nextTick(Ee,this||qe),me};function Ee(ue){let me=ue._readableState;me.readableListening=ue.listenerCount("readable")>0,me.resumeScheduled&&me[re]===!1?me.flowing=!0:ue.listenerCount("data")>0?ue.resume():me.readableListening||(me.flowing=null)}function ve(ue){E("readable nexttick read 0"),ue.read(0)}Oe.prototype.resume=function(){let ue=(this||qe)._readableState;return ue.flowing||(E("resume"),ue.flowing=!ue.readableListening,Ie(this||qe,ue)),ue[re]=!1,this||qe};function Ie(ue,me){me.resumeScheduled||(me.resumeScheduled=!0,r.nextTick(V,ue,me))}function V(ue,me){E("resume",me.reading),me.reading||ue.read(0),me.resumeScheduled=!1,ue.emit("resume"),Fe(ue),me.flowing&&!me.reading&&ue.read(0)}Oe.prototype.pause=function(){return E("call pause flowing=%j",(this||qe)._readableState.flowing),(this||qe)._readableState.flowing!==!1&&(E("pause"),(this||qe)._readableState.flowing=!1,this.emit("pause")),(this||qe)._readableState[re]=!0,this||qe};function Fe(ue){let me=ue._readableState;for(E("flow",me.flowing);me.flowing&&ue.read()!==null;);}Oe.prototype.wrap=function(ue){let me=!1;ue.on("data",Ue=>{!this.push(Ue)&&ue.pause&&(me=!0,ue.pause())}),ue.on("end",()=>{this.push(null)}),ue.on("error",Ue=>{C(this||qe,Ue)}),ue.on("close",()=>{this.destroy()}),ue.on("destroy",()=>{this.destroy()}),(this||qe)._read=()=>{me&&ue.resume&&(me=!1,ue.resume())};let We=s(ue);for(let Ue=1;Ue<We.length;Ue++){let Ze=We[Ue];(this||qe)[Ze]===void 0&&typeof ue[Ze]=="function"&&((this||qe)[Ze]=ue[Ze].bind(ue))}return this||qe},Oe.prototype[h]=function(){return st(this||qe)},Oe.prototype.iterator=function(ue){return ue!==void 0&&ie(ue,"options"),st(this||qe,ue)};function st(ue,me){typeof ue.read!="function"&&(ue=Oe.wrap(ue,{objectMode:!0}));let We=O(ue,me);return We.stream=ue,We}async function*O(ue,me){let We=P;function Ue(Rt){(this||qe)===ue?(We(),We=P):We=Rt}ue.on("readable",Ue);let Ze,dt=_(ue,{writable:!1},Rt=>{Ze=Rt?H(Ze,Rt):null,We(),We=P});try{for(;;){let Rt=ue.destroyed?null:ue.read();if(Rt!==null)yield Rt;else{if(Ze)throw Ze;if(Ze===null)return;await new u(Ue)}}}catch(Rt){throw Ze=H(Ze,Rt),Ze}finally{(Ze||me?.destroyOnReturn!==!1)&&(Ze===void 0||ue._readableState.autoDestroy)?A.destroyer(ue,null):(ue.off("readable",Ue),dt())}}o(Oe.prototype,{readable:{__proto__:null,get(){let ue=(this||qe)._readableState;return!!ue&&ue.readable!==!1&&!ue.destroyed&&!ue.errorEmitted&&!ue.endEmitted},set(ue){(this||qe)._readableState&&((this||qe)._readableState.readable=!!ue)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return(this||qe)._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!((this||qe)._readableState.readable!==!1&&((this||qe)._readableState.destroyed||(this||qe)._readableState.errored)&&!(this||qe)._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return(this||qe)._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return(this||qe)._readableState&&(this||qe)._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return(this||qe)._readableState.flowing},set:function(ue){(this||qe)._readableState&&((this||qe)._readableState.flowing=ue)}},readableLength:{__proto__:null,enumerable:!1,get(){return(this||qe)._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return(this||qe)._readableState?(this||qe)._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return(this||qe)._readableState?(this||qe)._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return(this||qe)._readableState?(this||qe)._readableState.errored:null}},closed:{__proto__:null,get(){return(this||qe)._readableState?(this||qe)._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return(this||qe)._readableState?(this||qe)._readableState.destroyed:!1},set(ue){(this||qe)._readableState&&((this||qe)._readableState.destroyed=ue)}},readableEnded:{__proto__:null,enumerable:!1,get(){return(this||qe)._readableState?(this||qe)._readableState.endEmitted:!1}}}),o(ke.prototype,{pipesCount:{__proto__:null,get(){return(this||qe).pipes.length}},paused:{__proto__:null,get(){return(this||qe)[re]!==!1},set(ue){(this||qe)[re]=!!ue}}}),Oe._fromList=Pe;function Pe(ue,me){if(me.length===0)return null;let We;return me.objectMode?We=me.buffer.shift():!ue||ue>=me.length?(me.decoder?We=me.buffer.join(""):me.buffer.length===1?We=me.buffer.first():We=me.buffer.concat(me.length),me.buffer.clear()):We=me.buffer.consume(ue,me.decoder),We}function $e(ue){let me=ue._readableState;E("endReadable",me.endEmitted),me.endEmitted||(me.ended=!0,r.nextTick(he,me,ue))}function he(ue,me){if(E("endReadableNT",ue.endEmitted,ue.length),!ue.errored&&!ue.closeEmitted&&!ue.endEmitted&&ue.length===0){if(ue.endEmitted=!0,me.emit("end"),me.writable&&me.allowHalfOpen===!1)r.nextTick(Te,me);else if(ue.autoDestroy){let We=me._writableState;(!We||We.autoDestroy&&(We.finished||We.writable===!1))&&me.destroy()}}}function Te(ue){ue.writable&&!ue.writableEnded&&!ue.destroyed&&ue.end()}Oe.from=function(ue,me){return x(Oe,ue,me)};let Me;function ut(){return Me===void 0&&(Me={}),Me}return Oe.fromWeb=function(ue,me){return ut().newStreamReadableFromReadableStream(ue,me)},Oe.toWeb=function(ue,me){return ut().newReadableStreamFromStreamReadable(ue,me)},Oe.wrap=function(ue,me){var We,Ue;return new Oe({objectMode:(We=(Ue=ue.readableObjectMode)!==null&&Ue!==void 0?Ue:ue.objectMode)!==null&&We!==void 0?We:!0,...me,destroy(Ze,dt){A.destroyer(ue,Ze),dt(Ze)}}).wrap(ue)},M1}function Y1(){if(QL)return B1;QL=!0;let r=zr,{ArrayPrototypeSlice:e,Error:t,FunctionPrototypeSymbolHasInstance:n,ObjectDefineProperty:i,ObjectDefineProperties:o,ObjectSetPrototypeOf:s,StringPrototypeToLowerCase:a,Symbol:u,SymbolHasInstance:c}=Nr();B1=ie,ie.WritableState=$;let{EventEmitter:f}=ao,h=V1().Stream,{Buffer:p}=fn(),m=bh(),{addAbortSignal:b}=zb(),{getHighWaterMark:v,getDefaultHighWaterMark:w}=Wb(),{ERR_INVALID_ARG_TYPE:y,ERR_METHOD_NOT_IMPLEMENTED:_,ERR_MULTIPLE_CALLBACK:E,ERR_STREAM_CANNOT_PIPE:S,ERR_STREAM_DESTROYED:A,ERR_STREAM_ALREADY_FINISHED:F,ERR_STREAM_NULL_VALUES:D,ERR_STREAM_WRITE_AFTER_END:H,ERR_UNKNOWN_ENCODING:J}=fi().codes,{errorOrDestroy:K}=m;s(ie.prototype,h.prototype),s(ie,h);function ne(){}let k=u("kOnFinished");function $(M,ae,ge){typeof ge!="boolean"&&(ge=ae instanceof ia()),(this||Xe).objectMode=!!(M&&M.objectMode),ge&&((this||Xe).objectMode=(this||Xe).objectMode||!!(M&&M.writableObjectMode)),(this||Xe).highWaterMark=M?v(this||Xe,M,"writableHighWaterMark",ge):w(!1),(this||Xe).finalCalled=!1,(this||Xe).needDrain=!1,(this||Xe).ending=!1,(this||Xe).ended=!1,(this||Xe).finished=!1,(this||Xe).destroyed=!1;let Se=!!(M&&M.decodeStrings===!1);(this||Xe).decodeStrings=!Se,(this||Xe).defaultEncoding=M&&M.defaultEncoding||"utf8",(this||Xe).length=0,(this||Xe).writing=!1,(this||Xe).corked=0,(this||Xe).sync=!0,(this||Xe).bufferProcessing=!1,(this||Xe).onwrite=C.bind(void 0,ae),(this||Xe).writecb=null,(this||Xe).writelen=0,(this||Xe).afterWriteTickInfo=null,Y(this||Xe),(this||Xe).pendingcb=0,(this||Xe).constructed=!0,(this||Xe).prefinished=!1,(this||Xe).errorEmitted=!1,(this||Xe).emitClose=!M||M.emitClose!==!1,(this||Xe).autoDestroy=!M||M.autoDestroy!==!1,(this||Xe).errored=null,(this||Xe).closed=!1,(this||Xe).closeEmitted=!1,(this||Xe)[k]=[]}function Y(M){M.buffered=[],M.bufferedIndex=0,M.allBuffers=!0,M.allNoop=!0}$.prototype.getBuffer=function(){return e((this||Xe).buffered,(this||Xe).bufferedIndex)},i($.prototype,"bufferedRequestCount",{__proto__:null,get(){return(this||Xe).buffered.length-(this||Xe).bufferedIndex}});function ie(M){let ae=(this||Xe)instanceof ia();if(!ae&&!n(ie,this||Xe))return new ie(M);(this||Xe)._writableState=new $(M,this||Xe,ae),M&&(typeof M.write=="function"&&((this||Xe)._write=M.write),typeof M.writev=="function"&&((this||Xe)._writev=M.writev),typeof M.destroy=="function"&&((this||Xe)._destroy=M.destroy),typeof M.final=="function"&&((this||Xe)._final=M.final),typeof M.construct=="function"&&((this||Xe)._construct=M.construct),M.signal&&b(M.signal,this||Xe)),h.call(this||Xe,M),m.construct(this||Xe,()=>{let ge=(this||Xe)._writableState;ge.writing||Q(this||Xe,ge),W(this||Xe,ge)})}i(ie,c,{__proto__:null,value:function(M){return n(this||Xe,M)?!0:(this||Xe)!==ie?!1:M&&M._writableState instanceof $}}),ie.prototype.pipe=function(){K(this||Xe,new S)};function re(M,ae,ge,Se){let we=M._writableState;if(typeof ge=="function")Se=ge,ge=we.defaultEncoding;else{if(!ge)ge=we.defaultEncoding;else if(ge!=="buffer"&&!p.isEncoding(ge))throw new J(ge);typeof Se!="function"&&(Se=ne)}if(ae===null)throw new D;if(!we.objectMode)if(typeof ae=="string")we.decodeStrings!==!1&&(ae=p.from(ae,ge),ge="buffer");else if(ae instanceof p)ge="buffer";else if(h._isUint8Array(ae))ae=h._uint8ArrayToBuffer(ae),ge="buffer";else throw new y("chunk",["string","Buffer","Uint8Array"],ae);let de;return we.ending?de=new H:we.destroyed&&(de=new A("write")),de?(r.nextTick(Se,de),K(M,de,!0),de):(we.pendingcb++,N(M,we,ae,ge,Se))}ie.prototype.write=function(M,ae,ge){return re(this||Xe,M,ae,ge)===!0},ie.prototype.cork=function(){(this||Xe)._writableState.corked++},ie.prototype.uncork=function(){let M=(this||Xe)._writableState;M.corked&&(M.corked--,M.writing||Q(this||Xe,M))},ie.prototype.setDefaultEncoding=function(ae){if(typeof ae=="string"&&(ae=a(ae)),!p.isEncoding(ae))throw new J(ae);return(this||Xe)._writableState.defaultEncoding=ae,this||Xe};function N(M,ae,ge,Se,we){let de=ae.objectMode?1:ge.length;ae.length+=de;let Ae=ae.length<ae.highWaterMark;return Ae||(ae.needDrain=!0),ae.writing||ae.corked||ae.errored||!ae.constructed?(ae.buffered.push({chunk:ge,encoding:Se,callback:we}),ae.allBuffers&&Se!=="buffer"&&(ae.allBuffers=!1),ae.allNoop&&we!==ne&&(ae.allNoop=!1)):(ae.writelen=de,ae.writecb=we,ae.writing=!0,ae.sync=!0,M._write(ge,Se,ae.onwrite),ae.sync=!1),Ae&&!ae.errored&&!ae.destroyed}function x(M,ae,ge,Se,we,de,Ae){ae.writelen=Se,ae.writecb=Ae,ae.writing=!0,ae.sync=!0,ae.destroyed?ae.onwrite(new A("write")):ge?M._writev(we,ae.onwrite):M._write(we,de,ae.onwrite),ae.sync=!1}function P(M,ae,ge,Se){--ae.pendingcb,Se(ge),B(ae),K(M,ge)}function C(M,ae){let ge=M._writableState,Se=ge.sync,we=ge.writecb;if(typeof we!="function"){K(M,new E);return}ge.writing=!1,ge.writecb=null,ge.length-=ge.writelen,ge.writelen=0,ae?(ae.stack,ge.errored||(ge.errored=ae),M._readableState&&!M._readableState.errored&&(M._readableState.errored=ae),Se?r.nextTick(P,M,ge,ae,we):P(M,ge,ae,we)):(ge.buffered.length>ge.bufferedIndex&&Q(M,ge),Se?ge.afterWriteTickInfo!==null&&ge.afterWriteTickInfo.cb===we?ge.afterWriteTickInfo.count++:(ge.afterWriteTickInfo={count:1,cb:we,stream:M,state:ge},r.nextTick(j,ge.afterWriteTickInfo)):U(M,ge,1,we))}function j({stream:M,state:ae,count:ge,cb:Se}){return ae.afterWriteTickInfo=null,U(M,ae,ge,Se)}function U(M,ae,ge,Se){for(!ae.ending&&!M.destroyed&&ae.length===0&&ae.needDrain&&(ae.needDrain=!1,M.emit("drain"));ge-- >0;)ae.pendingcb--,Se();ae.destroyed&&B(ae),W(M,ae)}function B(M){if(M.writing)return;for(let we=M.bufferedIndex;we<M.buffered.length;++we){var ae;let{chunk:de,callback:Ae}=M.buffered[we],je=M.objectMode?1:de.length;M.length-=je,Ae((ae=M.errored)!==null&&ae!==void 0?ae:new A("write"))}let ge=M[k].splice(0);for(let we=0;we<ge.length;we++){var Se;ge[we]((Se=M.errored)!==null&&Se!==void 0?Se:new A("end"))}Y(M)}function Q(M,ae){if(ae.corked||ae.bufferProcessing||ae.destroyed||!ae.constructed)return;let{buffered:ge,bufferedIndex:Se,objectMode:we}=ae,de=ge.length-Se;if(!de)return;let Ae=Se;if(ae.bufferProcessing=!0,de>1&&M._writev){ae.pendingcb-=de-1;let je=ae.allNoop?ne:Oe=>{for(let Ve=Ae;Ve<ge.length;++Ve)ge[Ve].callback(Oe)},ke=ae.allNoop&&Ae===0?ge:e(ge,Ae);ke.allBuffers=ae.allBuffers,x(M,ae,!0,ae.length,ke,"",je),Y(ae)}else{do{let{chunk:je,encoding:ke,callback:Oe}=ge[Ae];ge[Ae++]=null;let Ve=we?1:je.length;x(M,ae,!1,Ve,je,ke,Oe)}while(Ae<ge.length&&!ae.writing);Ae===ge.length?Y(ae):Ae>256?(ge.splice(0,Ae),ae.bufferedIndex=0):ae.bufferedIndex=Ae}ae.bufferProcessing=!1}ie.prototype._write=function(M,ae,ge){if((this||Xe)._writev)this._writev([{chunk:M,encoding:ae}],ge);else throw new _("_write()")},ie.prototype._writev=null,ie.prototype.end=function(M,ae,ge){let Se=(this||Xe)._writableState;typeof M=="function"?(ge=M,M=null,ae=null):typeof ae=="function"&&(ge=ae,ae=null);let we;if(M!=null){let de=re(this||Xe,M,ae);de instanceof t&&(we=de)}return Se.corked&&(Se.corked=1,this.uncork()),we||(!Se.errored&&!Se.ending?(Se.ending=!0,W(this||Xe,Se,!0),Se.ended=!0):Se.finished?we=new F("end"):Se.destroyed&&(we=new A("end"))),typeof ge=="function"&&(we||Se.finished?r.nextTick(ge,we):Se[k].push(ge)),this||Xe};function fe(M){return M.ending&&!M.destroyed&&M.constructed&&M.length===0&&!M.errored&&M.buffered.length===0&&!M.finished&&!M.writing&&!M.errorEmitted&&!M.closeEmitted}function _e(M,ae){let ge=!1;function Se(we){if(ge){K(M,we??E());return}if(ge=!0,ae.pendingcb--,we){let de=ae[k].splice(0);for(let Ae=0;Ae<de.length;Ae++)de[Ae](we);K(M,we,ae.sync)}else fe(ae)&&(ae.prefinished=!0,M.emit("prefinish"),ae.pendingcb++,r.nextTick(oe,M,ae))}ae.sync=!0,ae.pendingcb++;try{M._final(Se)}catch(we){Se(we)}ae.sync=!1}function te(M,ae){!ae.prefinished&&!ae.finalCalled&&(typeof M._final=="function"&&!ae.destroyed?(ae.finalCalled=!0,_e(M,ae)):(ae.prefinished=!0,M.emit("prefinish")))}function W(M,ae,ge){fe(ae)&&(te(M,ae),ae.pendingcb===0&&(ge?(ae.pendingcb++,r.nextTick((Se,we)=>{fe(we)?oe(Se,we):we.pendingcb--},M,ae)):fe(ae)&&(ae.pendingcb++,oe(M,ae))))}function oe(M,ae){ae.pendingcb--,ae.finished=!0;let ge=ae[k].splice(0);for(let Se=0;Se<ge.length;Se++)ge[Se]();if(M.emit("finish"),ae.autoDestroy){let Se=M._readableState;(!Se||Se.autoDestroy&&(Se.endEmitted||Se.readable===!1))&&M.destroy()}}o(ie.prototype,{closed:{__proto__:null,get(){return(this||Xe)._writableState?(this||Xe)._writableState.closed:!1}},destroyed:{__proto__:null,get(){return(this||Xe)._writableState?(this||Xe)._writableState.destroyed:!1},set(M){(this||Xe)._writableState&&((this||Xe)._writableState.destroyed=M)}},writable:{__proto__:null,get(){let M=(this||Xe)._writableState;return!!M&&M.writable!==!1&&!M.destroyed&&!M.errored&&!M.ending&&!M.ended},set(M){(this||Xe)._writableState&&((this||Xe)._writableState.writable=!!M)}},writableFinished:{__proto__:null,get(){return(this||Xe)._writableState?(this||Xe)._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return(this||Xe)._writableState?(this||Xe)._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return(this||Xe)._writableState&&(this||Xe)._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return(this||Xe)._writableState?(this||Xe)._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let M=(this||Xe)._writableState;return M?!M.destroyed&&!M.ending&&M.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return(this||Xe)._writableState&&(this||Xe)._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return(this||Xe)._writableState?(this||Xe)._writableState.corked:0}},writableLength:{__proto__:null,get(){return(this||Xe)._writableState&&(this||Xe)._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return(this||Xe)._writableState?(this||Xe)._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!((this||Xe)._writableState.writable!==!1&&((this||Xe)._writableState.destroyed||(this||Xe)._writableState.errored)&&!(this||Xe)._writableState.finished)}}});let be=m.destroy;ie.prototype.destroy=function(M,ae){let ge=(this||Xe)._writableState;return!ge.destroyed&&(ge.bufferedIndex<ge.buffered.length||ge[k].length)&&r.nextTick(B,ge),be.call(this||Xe,M,ae),this||Xe},ie.prototype._undestroy=m.undestroy,ie.prototype._destroy=function(M,ae){ae(M)},ie.prototype[f.captureRejectionSymbol]=function(M){this.destroy(M)};let xe;function X(){return xe===void 0&&(xe={}),xe}return ie.fromWeb=function(M,ae){return X().newStreamWritableFromWritableStream(M,ae)},ie.toWeb=function(M){return X().newWritableStreamFromStreamWritable(M)},B1}function $W(){if(eP)return F1;eP=!0;let r=zr,e=fn(),{isReadable:t,isWritable:n,isIterable:i,isNodeStream:o,isReadableNodeStream:s,isWritableNodeStream:a,isDuplexNodeStream:u,isReadableStream:c,isWritableStream:f}=sa(),h=wl(),{AbortError:p,codes:{ERR_INVALID_ARG_TYPE:m,ERR_INVALID_RETURN_VALUE:b}}=fi(),{destroyer:v}=bh(),w=ia(),y=qb(),_=Y1(),{createDeferredPromise:E}=Vn(),S=fP(),A=globalThis.Blob||e.Blob,F=typeof A<"u"?function($){return $ instanceof A}:function($){return!1},D=globalThis.AbortController||dg().AbortController,{FunctionPrototypeCall:H}=Nr();class J extends w{constructor($){super($),$?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),$?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}F1=function k($,Y){if(u($))return $;if(s($))return ne({readable:$});if(a($))return ne({writable:$});if(o($))return ne({writable:!1,readable:!1});if(c($))return ne({readable:y.fromWeb($)});if(f($))return ne({writable:_.fromWeb($)});if(typeof $=="function"){let{value:re,write:N,final:x,destroy:P}=K($);if(i(re))return S(J,re,{objectMode:!0,write:N,final:x,destroy:P});let C=re?.then;if(typeof C=="function"){let j,U=H(C,re,B=>{if(B!=null)throw new b("nully","body",B)},B=>{v(j,B)});return j=new J({objectMode:!0,readable:!1,write:N,final(B){x(async()=>{try{await U,r.nextTick(B,null)}catch(Q){r.nextTick(B,Q)}})},destroy:P})}throw new b("Iterable, AsyncIterable or AsyncFunction",Y,re)}if(F($))return k($.arrayBuffer());if(i($))return S(J,$,{objectMode:!0,writable:!1});if(c($?.readable)&&f($?.writable))return J.fromWeb($);if(typeof $?.writable=="object"||typeof $?.readable=="object"){let re=$!=null&&$.readable?s($?.readable)?$?.readable:k($.readable):void 0,N=$!=null&&$.writable?a($?.writable)?$?.writable:k($.writable):void 0;return ne({readable:re,writable:N})}let ie=$?.then;if(typeof ie=="function"){let re;return H(ie,$,N=>{N!=null&&re.push(N),re.push(null)},N=>{v(re,N)}),re=new J({objectMode:!0,writable:!1,read(){}})}throw new m(Y,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],$)};function K(k){let{promise:$,resolve:Y}=E(),ie=new D,re=ie.signal;return{value:k((async function*(){for(;;){let x=$;$=null;let{chunk:P,done:C,cb:j}=await x;if(r.nextTick(j),C)return;if(re.aborted)throw new p(void 0,{cause:re.reason});({promise:$,resolve:Y}=E()),yield P}})(),{signal:re}),write(x,P,C){let j=Y;Y=null,j({chunk:x,done:!1,cb:C})},final(x){let P=Y;Y=null,P({done:!0,cb:x})},destroy(x,P){ie.abort(),P(x)}}}function ne(k){let $=k.readable&&typeof k.readable.read!="function"?y.wrap(k.readable):k.readable,Y=k.writable,ie=!!t($),re=!!n(Y),N,x,P,C,j;function U(B){let Q=C;C=null,Q?Q(B):B&&j.destroy(B)}return j=new J({readableObjectMode:!!($!=null&&$.readableObjectMode),writableObjectMode:!!(Y!=null&&Y.writableObjectMode),readable:ie,writable:re}),re&&(h(Y,B=>{re=!1,B&&v($,B),U(B)}),j._write=function(B,Q,fe){Y.write(B,Q)?fe():N=fe},j._final=function(B){Y.end(),x=B},Y.on("drain",function(){if(N){let B=N;N=null,B()}}),Y.on("finish",function(){if(x){let B=x;x=null,B()}})),ie&&(h($,B=>{ie=!1,B&&v($,B),U(B)}),$.on("readable",function(){if(P){let B=P;P=null,B()}}),$.on("end",function(){j.push(null)}),j._read=function(){for(;;){let B=$.read();if(B===null){P=j._read;return}if(!j.push(B))return}}),j._destroy=function(B,Q){!B&&C!==null&&(B=new p),P=null,N=null,x=null,C===null?Q(B):(C=Q,v(Y,B),v($,B))},j}return F1}function ia(){if(tP)return U1;tP=!0;let{ObjectDefineProperties:r,ObjectGetOwnPropertyDescriptor:e,ObjectKeys:t,ObjectSetPrototypeOf:n}=Nr();U1=s;let i=qb(),o=Y1();n(s.prototype,i.prototype),n(s,i);{let f=t(o.prototype);for(let h=0;h<f.length;h++){let p=f[h];s.prototype[p]||(s.prototype[p]=o.prototype[p])}}function s(f){if(!(this instanceof s))return new s(f);i.call(this,f),o.call(this,f),f?(this.allowHalfOpen=f.allowHalfOpen!==!1,f.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),f.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}r(s.prototype,{writable:{__proto__:null,...e(o.prototype,"writable")},writableHighWaterMark:{__proto__:null,...e(o.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...e(o.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...e(o.prototype,"writableBuffer")},writableLength:{__proto__:null,...e(o.prototype,"writableLength")},writableFinished:{__proto__:null,...e(o.prototype,"writableFinished")},writableCorked:{__proto__:null,...e(o.prototype,"writableCorked")},writableEnded:{__proto__:null,...e(o.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...e(o.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(f){this._readableState&&this._writableState&&(this._readableState.destroyed=f,this._writableState.destroyed=f)}}});let a;function u(){return a===void 0&&(a={}),a}s.fromWeb=function(f,h){return u().newStreamDuplexFromReadableWritablePair(f,h)},s.toWeb=function(f){return u().newReadableWritablePairFromDuplex(f)};let c;return s.from=function(f){return c||(c=$W()),c(f,"body")},U1}function hP(){if(rP)return j1;rP=!0;let{ObjectSetPrototypeOf:r,Symbol:e}=Nr();j1=s;let{ERR_METHOD_NOT_IMPLEMENTED:t}=fi().codes,n=ia(),{getHighWaterMark:i}=Wb();r(s.prototype,n.prototype),r(s,n);let o=e("kCallback");function s(c){if(!(this instanceof s))return new s(c);let f=c?i(this,c,"readableHighWaterMark",!0):null;f===0&&(c={...c,highWaterMark:null,readableHighWaterMark:f,writableHighWaterMark:c.writableHighWaterMark||0}),n.call(this,c),this._readableState.sync=!1,this[o]=null,c&&(typeof c.transform=="function"&&(this._transform=c.transform),typeof c.flush=="function"&&(this._flush=c.flush)),this.on("prefinish",u)}function a(c){typeof this._flush=="function"&&!this.destroyed?this._flush((f,h)=>{if(f){c?c(f):this.destroy(f);return}h!=null&&this.push(h),this.push(null),c&&c()}):(this.push(null),c&&c())}function u(){this._final!==a&&a.call(this)}return s.prototype._final=a,s.prototype._transform=function(c,f,h){throw new t("_transform()")},s.prototype._write=function(c,f,h){let p=this._readableState,m=this._writableState,b=p.length;this._transform(c,f,(v,w)=>{if(v){h(v);return}w!=null&&this.push(w),m.ended||b===p.length||p.length<p.highWaterMark?h():this[o]=h})},s.prototype._read=function(){if(this[o]){let c=this[o];this[o]=null,c()}},j1}function dP(){if(nP)return $1;nP=!0;let{ObjectSetPrototypeOf:r}=Nr();$1=t;let e=hP();r(t.prototype,e.prototype),r(t,e);function t(n){if(!(this instanceof t))return new t(n);e.call(this,n)}return t.prototype._transform=function(n,i,o){o(null,n)},$1}function X1(){if(iP)return z1;iP=!0;let r=zr,{ArrayIsArray:e,Promise:t,SymbolAsyncIterator:n,SymbolDispose:i}=Nr(),o=wl(),{once:s}=Vn(),a=bh(),u=ia(),{aggregateTwoErrors:c,codes:{ERR_INVALID_ARG_TYPE:f,ERR_INVALID_RETURN_VALUE:h,ERR_MISSING_ARGS:p,ERR_STREAM_DESTROYED:m,ERR_STREAM_PREMATURE_CLOSE:b},AbortError:v}=fi(),{validateFunction:w,validateAbortSignal:y}=pg(),{isIterable:_,isReadable:E,isReadableNodeStream:S,isNodeStream:A,isTransformStream:F,isWebStream:D,isReadableStream:H,isReadableFinished:J}=sa(),K=globalThis.AbortController||dg().AbortController,ne,k,$;function Y(B,Q,fe){let _e=!1;B.on("close",()=>{_e=!0});let te=o(B,{readable:Q,writable:fe},W=>{_e=!W});return{destroy:W=>{_e||(_e=!0,a.destroyer(B,W||new m("pipe")))},cleanup:te}}function ie(B){return w(B[B.length-1],"streams[stream.length - 1]"),B.pop()}function re(B){if(_(B))return B;if(S(B))return N(B);throw new f("val",["Readable","Iterable","AsyncIterable"],B)}async function*N(B){k||(k=qb()),yield*k.prototype[n].call(B)}async function x(B,Q,fe,{end:_e}){let te,W=null,oe=X=>{if(X&&(te=X),W){let M=W;W=null,M()}},be=()=>new t((X,M)=>{te?M(te):W=()=>{te?M(te):X()}});Q.on("drain",oe);let xe=o(Q,{readable:!1},oe);try{Q.writableNeedDrain&&await be();for await(let X of B)Q.write(X)||await be();_e&&(Q.end(),await be()),fe()}catch(X){fe(te!==X?c(te,X):X)}finally{xe(),Q.off("drain",oe)}}async function P(B,Q,fe,{end:_e}){F(Q)&&(Q=Q.writable);let te=Q.getWriter();try{for await(let W of B)await te.ready,te.write(W).catch(()=>{});await te.ready,_e&&await te.close(),fe()}catch(W){try{await te.abort(W),fe(W)}catch(oe){fe(oe)}}}function C(...B){return j(B,s(ie(B)))}function j(B,Q,fe){if(B.length===1&&e(B[0])&&(B=B[0]),B.length<2)throw new p("streams");let _e=new K,te=_e.signal,W=fe?.signal,oe=[];y(W,"options.signal");function be(){we(new v)}$=$||Vn().addAbortListener;let xe;W&&(xe=$(W,be));let X,M,ae=[],ge=0;function Se(ke){we(ke,--ge===0)}function we(ke,Oe){var Ve;if(ke&&(!X||X.code==="ERR_STREAM_PREMATURE_CLOSE")&&(X=ke),!(!X&&!Oe)){for(;ae.length;)ae.shift()(X);(Ve=xe)===null||Ve===void 0||Ve[i](),_e.abort(),Oe&&(X||oe.forEach(Je=>Je()),r.nextTick(Q,X,M))}}let de;for(let ke=0;ke<B.length;ke++){let Oe=B[ke],Ve=ke<B.length-1,Je=ke>0,et=Ve||fe?.end!==!1,T=ke===B.length-1;if(A(Oe)){let d=function(g){g&&g.name!=="AbortError"&&g.code!=="ERR_STREAM_PREMATURE_CLOSE"&&Se(g)};if(et){let{destroy:g,cleanup:I}=Y(Oe,Ve,Je);ae.push(g),E(Oe)&&T&&oe.push(I)}Oe.on("error",d),E(Oe)&&T&&oe.push(()=>{Oe.removeListener("error",d)})}if(ke===0)if(typeof Oe=="function"){if(de=Oe({signal:te}),!_(de))throw new h("Iterable, AsyncIterable or Stream","source",de)}else _(Oe)||S(Oe)||F(Oe)?de=Oe:de=u.from(Oe);else if(typeof Oe=="function"){if(F(de)){var Ae;de=re((Ae=de)===null||Ae===void 0?void 0:Ae.readable)}else de=re(de);if(de=Oe(de,{signal:te}),Ve){if(!_(de,!0))throw new h("AsyncIterable",`transform[${ke-1}]`,de)}else{var je;ne||(ne=dP());let d=new ne({objectMode:!0}),g=(je=de)===null||je===void 0?void 0:je.then;if(typeof g=="function")ge++,g.call(de,R=>{M=R,R!=null&&d.write(R),et&&d.end(),r.nextTick(Se)},R=>{d.destroy(R),r.nextTick(Se,R)});else if(_(de,!0))ge++,x(de,d,Se,{end:et});else if(H(de)||F(de)){let R=de.readable||de;ge++,x(R,d,Se,{end:et})}else throw new h("AsyncIterable or Promise","destination",de);de=d;let{destroy:I,cleanup:Z}=Y(de,!1,!0);ae.push(I),T&&oe.push(Z)}}else if(A(Oe)){if(S(de)){ge+=2;let d=U(de,Oe,Se,{end:et});E(Oe)&&T&&oe.push(d)}else if(F(de)||H(de)){let d=de.readable||de;ge++,x(d,Oe,Se,{end:et})}else if(_(de))ge++,x(de,Oe,Se,{end:et});else throw new f("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],de);de=Oe}else if(D(Oe)){if(S(de))ge++,P(re(de),Oe,Se,{end:et});else if(H(de)||_(de))ge++,P(de,Oe,Se,{end:et});else if(F(de))ge++,P(de.readable,Oe,Se,{end:et});else throw new f("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],de);de=Oe}else de=u.from(Oe)}return(te!=null&&te.aborted||W!=null&&W.aborted)&&r.nextTick(be),de}function U(B,Q,fe,{end:_e}){let te=!1;if(Q.on("close",()=>{te||fe(new b)}),B.pipe(Q,{end:!1}),_e){let W=function(){te=!0,Q.end()};J(B)?r.nextTick(W):B.once("end",W)}else fe();return o(B,{readable:!0,writable:!1},W=>{let oe=B._readableState;W&&W.code==="ERR_STREAM_PREMATURE_CLOSE"&&oe&&oe.ended&&!oe.errored&&!oe.errorEmitted?B.once("end",fe).once("error",fe):fe(W)}),o(Q,{readable:!1,writable:!0},fe)}return z1={pipelineImpl:j,pipeline:C},z1}function pP(){if(sP)return W1;sP=!0;let{pipeline:r}=X1(),e=ia(),{destroyer:t}=bh(),{isNodeStream:n,isReadable:i,isWritable:o,isWebStream:s,isTransformStream:a,isWritableStream:u,isReadableStream:c}=sa(),{AbortError:f,codes:{ERR_INVALID_ARG_VALUE:h,ERR_MISSING_ARGS:p}}=fi(),m=wl();return W1=function(...v){if(v.length===0)throw new p("streams");if(v.length===1)return e.from(v[0]);let w=[...v];if(typeof v[0]=="function"&&(v[0]=e.from(v[0])),typeof v[v.length-1]=="function"){let ne=v.length-1;v[ne]=e.from(v[ne])}for(let ne=0;ne<v.length;++ne)if(!(!n(v[ne])&&!s(v[ne]))){if(ne<v.length-1&&!(i(v[ne])||c(v[ne])||a(v[ne])))throw new h(`streams[${ne}]`,w[ne],"must be readable");if(ne>0&&!(o(v[ne])||u(v[ne])||a(v[ne])))throw new h(`streams[${ne}]`,w[ne],"must be writable")}let y,_,E,S,A;function F(ne){let k=S;S=null,k?k(ne):ne?A.destroy(ne):!K&&!J&&A.destroy()}let D=v[0],H=r(v,F),J=!!(o(D)||u(D)||a(D)),K=!!(i(H)||c(H)||a(H));if(A=new e({writableObjectMode:!!(D!=null&&D.writableObjectMode),readableObjectMode:!!(H!=null&&H.readableObjectMode),writable:J,readable:K}),J){if(n(D))A._write=function(k,$,Y){D.write(k,$)?Y():y=Y},A._final=function(k){D.end(),_=k},D.on("drain",function(){if(y){let k=y;y=null,k()}});else if(s(D)){let $=(a(D)?D.writable:D).getWriter();A._write=async function(Y,ie,re){try{await $.ready,$.write(Y).catch(()=>{}),re()}catch(N){re(N)}},A._final=async function(Y){try{await $.ready,$.close().catch(()=>{}),_=Y}catch(ie){Y(ie)}}}let ne=a(H)?H.readable:H;m(ne,()=>{if(_){let k=_;_=null,k()}})}if(K){if(n(H))H.on("readable",function(){if(E){let ne=E;E=null,ne()}}),H.on("end",function(){A.push(null)}),A._read=function(){for(;;){let ne=H.read();if(ne===null){E=A._read;return}if(!A.push(ne))return}};else if(s(H)){let k=(a(H)?H.readable:H).getReader();A._read=async function(){for(;;)try{let{value:$,done:Y}=await k.read();if(!A.push($))return;if(Y){A.push(null);return}}catch{return}}}}return A._destroy=function(ne,k){!ne&&S!==null&&(ne=new f),E=null,y=null,_=null,S===null?k(ne):(S=k,n(H)&&t(H,ne))},A},W1}function zW(){if(oP)return $b;oP=!0;let r=globalThis.AbortController||dg().AbortController,{codes:{ERR_INVALID_ARG_VALUE:e,ERR_INVALID_ARG_TYPE:t,ERR_MISSING_ARGS:n,ERR_OUT_OF_RANGE:i},AbortError:o}=fi(),{validateAbortSignal:s,validateInteger:a,validateObject:u}=pg(),c=Nr().Symbol("kWeak"),f=Nr().Symbol("kResistStopPropagation"),{finished:h}=wl(),p=pP(),{addAbortSignalNoValidate:m}=zb(),{isWritable:b,isNodeStream:v}=sa(),{deprecate:w}=Vn(),{ArrayPrototypePush:y,Boolean:_,MathFloor:E,Number:S,NumberIsNaN:A,Promise:F,PromiseReject:D,PromiseResolve:H,PromisePrototypeThen:J,Symbol:K}=Nr(),ne=K("kEmpty"),k=K("kEof");function $(W,oe){if(oe!=null&&u(oe,"options"),oe?.signal!=null&&s(oe.signal,"options.signal"),v(W)&&!b(W))throw new e("stream",W,"must be writable");let be=p(this,W);return oe!=null&&oe.signal&&m(oe.signal,be),be}function Y(W,oe){if(typeof W!="function")throw new t("fn",["Function","AsyncFunction"],W);oe!=null&&u(oe,"options"),oe?.signal!=null&&s(oe.signal,"options.signal");let be=1;oe?.concurrency!=null&&(be=E(oe.concurrency));let xe=be-1;return oe?.highWaterMark!=null&&(xe=E(oe.highWaterMark)),a(be,"options.concurrency",1),a(xe,"options.highWaterMark",0),xe+=be,async function*(){let M=Vn().AbortSignalAny([oe?.signal].filter(_)),ae=this,ge=[],Se={signal:M},we,de,Ae=!1,je=0;function ke(){Ae=!0,Oe()}function Oe(){je-=1,Ve()}function Ve(){de&&!Ae&&je<be&&ge.length<xe&&(de(),de=null)}async function Je(){try{for await(let et of ae){if(Ae)return;if(M.aborted)throw new o;try{if(et=W(et,Se),et===ne)continue;et=H(et)}catch(T){et=D(T)}je+=1,J(et,Oe,ke),ge.push(et),we&&(we(),we=null),!Ae&&(ge.length>=xe||je>=be)&&await new F(T=>{de=T})}ge.push(k)}catch(et){let T=D(et);J(T,Oe,ke),ge.push(T)}finally{Ae=!0,we&&(we(),we=null)}}Je();try{for(;;){for(;ge.length>0;){let et=await ge[0];if(et===k)return;if(M.aborted)throw new o;et!==ne&&(yield et),ge.shift(),Ve()}await new F(et=>{we=et})}}finally{Ae=!0,de&&(de(),de=null)}}.call(this)}function ie(W=void 0){return W!=null&&u(W,"options"),W?.signal!=null&&s(W.signal,"options.signal"),async function*(){let be=0;for await(let X of this){var xe;if(W!=null&&(xe=W.signal)!==null&&xe!==void 0&&xe.aborted)throw new o({cause:W.signal.reason});yield[be++,X]}}.call(this)}async function re(W,oe=void 0){for await(let be of C.call(this,W,oe))return!0;return!1}async function N(W,oe=void 0){if(typeof W!="function")throw new t("fn",["Function","AsyncFunction"],W);return!await re.call(this,async(...be)=>!await W(...be),oe)}async function x(W,oe){for await(let be of C.call(this,W,oe))return be}async function P(W,oe){if(typeof W!="function")throw new t("fn",["Function","AsyncFunction"],W);async function be(xe,X){return await W(xe,X),ne}for await(let xe of Y.call(this,be,oe));}function C(W,oe){if(typeof W!="function")throw new t("fn",["Function","AsyncFunction"],W);async function be(xe,X){return await W(xe,X)?xe:ne}return Y.call(this,be,oe)}class j extends n{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function U(W,oe,be){var xe;if(typeof W!="function")throw new t("reducer",["Function","AsyncFunction"],W);be!=null&&u(be,"options"),be?.signal!=null&&s(be.signal,"options.signal");let X=arguments.length>1;if(be!=null&&(xe=be.signal)!==null&&xe!==void 0&&xe.aborted){let we=new o(void 0,{cause:be.signal.reason});throw this.once("error",()=>{}),await h(this.destroy(we)),we}let M=new r,ae=M.signal;if(be!=null&&be.signal){let we={once:!0,[c]:this,[f]:!0};be.signal.addEventListener("abort",()=>M.abort(),we)}let ge=!1;try{for await(let we of this){var Se;if(ge=!0,be!=null&&(Se=be.signal)!==null&&Se!==void 0&&Se.aborted)throw new o;X?oe=await W(oe,we,{signal:ae}):(oe=we,X=!0)}if(!ge&&!X)throw new j}finally{M.abort()}return oe}async function B(W){W!=null&&u(W,"options"),W?.signal!=null&&s(W.signal,"options.signal");let oe=[];for await(let xe of this){var be;if(W!=null&&(be=W.signal)!==null&&be!==void 0&&be.aborted)throw new o(void 0,{cause:W.signal.reason});y(oe,xe)}return oe}function Q(W,oe){let be=Y.call(this,W,oe);return async function*(){for await(let X of be)yield*X}.call(this)}function fe(W){if(W=S(W),A(W))return 0;if(W<0)throw new i("number",">= 0",W);return W}function _e(W,oe=void 0){return oe!=null&&u(oe,"options"),oe?.signal!=null&&s(oe.signal,"options.signal"),W=fe(W),async function*(){var xe;if(oe!=null&&(xe=oe.signal)!==null&&xe!==void 0&&xe.aborted)throw new o;for await(let M of this){var X;if(oe!=null&&(X=oe.signal)!==null&&X!==void 0&&X.aborted)throw new o;W--<=0&&(yield M)}}.call(this)}function te(W,oe=void 0){return oe!=null&&u(oe,"options"),oe?.signal!=null&&s(oe.signal,"options.signal"),W=fe(W),async function*(){var xe;if(oe!=null&&(xe=oe.signal)!==null&&xe!==void 0&&xe.aborted)throw new o;for await(let M of this){var X;if(oe!=null&&(X=oe.signal)!==null&&X!==void 0&&X.aborted)throw new o;if(W-- >0&&(yield M),W<=0)return}}.call(this)}return $b.streamReturningOperators={asIndexedPairs:w(ie,"readable.asIndexedPairs will be removed in a future version."),drop:_e,filter:C,flatMap:Q,map:Y,take:te,compose:$},$b.promiseReturningOperators={every:N,forEach:P,reduce:U,toArray:B,some:re,find:x},$b}function gP(){if(aP)return q1;aP=!0;let{ArrayPrototypePop:r,Promise:e}=Nr(),{isIterable:t,isNodeStream:n,isWebStream:i}=sa(),{pipelineImpl:o}=X1(),{finished:s}=wl();mP();function a(...u){return new e((c,f)=>{let h,p,m=u[u.length-1];if(m&&typeof m=="object"&&!n(m)&&!t(m)&&!i(m)){let b=r(u);h=b.signal,p=b.end}o(u,(b,v)=>{b?f(b):c(v)},{signal:h,end:p})})}return q1={finished:s,pipeline:a},q1}function mP(){if(lP)return H1;lP=!0;let{Buffer:r}=fn(),{ObjectDefineProperty:e,ObjectKeys:t,ReflectApply:n}=Nr(),{promisify:{custom:i}}=Vn(),{streamReturningOperators:o,promiseReturningOperators:s}=zW(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:a}}=fi(),u=pP(),{setDefaultHighWaterMark:c,getDefaultHighWaterMark:f}=Wb(),{pipeline:h}=X1(),{destroyer:p}=bh(),m=wl(),b=gP(),v=sa(),w=H1=V1().Stream;w.isDestroyed=v.isDestroyed,w.isDisturbed=v.isDisturbed,w.isErrored=v.isErrored,w.isReadable=v.isReadable,w.isWritable=v.isWritable,w.Readable=qb();for(let _ of t(o)){let S=function(...A){if(new.target)throw a();return w.Readable.from(n(E,this||uP,A))},E=o[_];e(S,"name",{__proto__:null,value:E.name}),e(S,"length",{__proto__:null,value:E.length}),e(w.Readable.prototype,_,{__proto__:null,value:S,enumerable:!1,configurable:!0,writable:!0})}for(let _ of t(s)){let S=function(...A){if(new.target)throw a();return n(E,this||uP,A)},E=s[_];e(S,"name",{__proto__:null,value:E.name}),e(S,"length",{__proto__:null,value:E.length}),e(w.Readable.prototype,_,{__proto__:null,value:S,enumerable:!1,configurable:!0,writable:!0})}w.Writable=Y1(),w.Duplex=ia(),w.Transform=hP(),w.PassThrough=dP(),w.pipeline=h;let{addAbortSignal:y}=zb();return w.addAbortSignal=y,w.finished=m,w.destroy=p,w.compose=u,w.setDefaultHighWaterMark=c,w.getDefaultHighWaterMark=f,e(w,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return b}}),e(h,i,{__proto__:null,enumerable:!0,get(){return b.pipeline}}),e(m,i,{__proto__:null,enumerable:!0,get(){return b.finished}}),w.Stream=w,w._isUint8Array=function(E){return E instanceof Uint8Array},w._uint8ArrayToBuffer=function(E){return r.from(E.buffer,E.byteOffset,E.byteLength)},H1}function WW(){if(cP)return Or;cP=!0;let r=mP(),e=gP(),t=r.Readable.destroy;return Or=r.Readable,Or._uint8ArrayToBuffer=r._uint8ArrayToBuffer,Or._isUint8Array=r._isUint8Array,Or.isDisturbed=r.isDisturbed,Or.isErrored=r.isErrored,Or.isReadable=r.isReadable,Or.Readable=r.Readable,Or.Writable=r.Writable,Or.Duplex=r.Duplex,Or.Transform=r.Transform,Or.PassThrough=r.PassThrough,Or.addAbortSignal=r.addAbortSignal,Or.finished=r.finished,Or.destroy=r.destroy,Or.destroy=t,Or.pipeline=r.pipeline,Or.compose=r.compose,Object.defineProperty(r,"promises",{configurable:!0,enumerable:!0,get(){return e}}),Or.Stream=r.Stream,Or.default=Or,Or}var C1,UL,fg,jL,Ub,$L,R1,zL,D1,WL,I1,qL,jb,HL,O1,GL,N1,VL,hg,YL,k1,XL,L1,KL,P1,ZL,M1,JL,qe,B1,QL,Xe,F1,eP,U1,tP,j1,rP,$1,nP,z1,iP,W1,sP,$b,oP,q1,aP,H1,lP,uP,Or,cP,ur,G1,qW,HW,GW,VW,YW,XW,KW,ZW,mg=Jt(()=>{Ce();De();Re();Bf();yh();Mu();FL();mh();jp();p1();C1={},UL=!1;fg={},jL=!1;Ub={},$L=!1;R1={},zL=!1;D1={},WL=!1;I1={},qL=!1;jb={},HL=!1;O1={},GL=!1;N1={},VL=!1;hg={},YL=!1;k1={},XL=!1;L1={},KL=!1;P1={},ZL=!1;M1={},JL=!1,qe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;B1={},QL=!1,Xe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;F1={},eP=!1;U1={},tP=!1;j1={},rP=!1;$1={},nP=!1;z1={},iP=!1;W1={},sP=!1;$b={},oP=!1;q1={},aP=!1;H1={},lP=!1,uP=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;Or={},cP=!1;ur=WW();ur._uint8ArrayToBuffer;ur._isUint8Array;ur.isDisturbed;ur.isErrored;ur.isReadable;ur.Readable;ur.Writable;ur.Duplex;ur.Transform;ur.PassThrough;ur.addAbortSignal;ur.finished;ur.destroy;ur.pipeline;ur.compose;ur.Stream;G1=ur.Readable;G1.wrap=function(r,e){return e=Object.assign({objectMode:r.readableObjectMode!=null||r.objectMode!=null||!0},e),e.destroy=function(t,n){r.destroy(t),n(t)},new G1(e).wrap(r)};qW=ur.Writable,HW=ur.Duplex,GW=ur.Transform,VW=ur.PassThrough,YW=ur.finished,XW=ur.pipeline,KW=ur.Stream,ZW={finished:Mb(ur.finished),pipeline:Mb(ur.pipeline)}});var vP=it((kee,wP)=>{Ce();De();Re();wP.exports=Hb;function Hb(){this.pending=0,this.max=1/0,this.listeners=[],this.waiting=[],this.error=null}Hb.prototype.go=function(r){this.pending<this.max?bP(this,r):this.waiting.push(r)};Hb.prototype.wait=function(r){this.pending===0?r(this.error):this.listeners.push(r)};Hb.prototype.hold=function(){return yP(this)};function yP(r){r.pending+=1;var e=!1;return t;function t(i){if(e)throw new Error("callback called twice");if(e=!0,r.error=r.error||i,r.pending-=1,r.waiting.length>0&&r.pending<r.max)bP(r,r.waiting.shift());else if(r.pending===0){var o=r.listeners;r.listeners=[],o.forEach(n)}}function n(i){i(r.error)}}function bP(r,e){e(yP(r))}});var EP=it(bg=>{Ce();De();Re();var yg=(Hp(),Ir(qp)),Gb=(mh(),Ir(lg)),K1=(mg(),Ir(gg)),_P=K1.Readable,Z1=K1.Writable,JW=K1.PassThrough,QW=vP(),Vb=(yh(),Ir(ug)).EventEmitter;bg.createFromBuffer=eq;bg.createFromFd=tq;bg.BufferSlicer=aa;bg.FdSlicer=oa;Gb.inherits(oa,Vb);function oa(r,e){e=e||{},Vb.call(this),this.fd=r,this.pend=new QW,this.pend.max=1,this.refCount=0,this.autoClose=!!e.autoClose}oa.prototype.read=function(r,e,t,n,i){var o=this;o.pend.go(function(s){yg.read(o.fd,r,e,t,n,function(a,u,c){s(),i(a,u,c)})})};oa.prototype.write=function(r,e,t,n,i){var o=this;o.pend.go(function(s){yg.write(o.fd,r,e,t,n,function(a,u,c){s(),i(a,u,c)})})};oa.prototype.createReadStream=function(r){return new Yb(this,r)};oa.prototype.createWriteStream=function(r){return new Xb(this,r)};oa.prototype.ref=function(){this.refCount+=1};oa.prototype.unref=function(){var r=this;if(r.refCount-=1,r.refCount>0)return;if(r.refCount<0)throw new Error("invalid unref");r.autoClose&&yg.close(r.fd,e);function e(t){t?r.emit("error",t):r.emit("close")}};Gb.inherits(Yb,_P);function Yb(r,e){e=e||{},_P.call(this,e),this.context=r,this.context.ref(),this.start=e.start||0,this.endOffset=e.end,this.pos=this.start,this.destroyed=!1}Yb.prototype._read=function(r){var e=this;if(!e.destroyed){var t=Math.min(e._readableState.highWaterMark,r);if(e.endOffset!=null&&(t=Math.min(t,e.endOffset-e.pos)),t<=0){e.destroyed=!0,e.push(null),e.context.unref();return}e.context.pend.go(function(n){if(e.destroyed)return n();var i=Buffer.allocUnsafe(t);yg.read(e.context.fd,i,0,t,e.pos,function(o,s){o?e.destroy(o):s===0?(e.destroyed=!0,e.push(null),e.context.unref()):(e.pos+=s,e.push(i.slice(0,s))),n()})})}};Yb.prototype.destroy=function(r){this.destroyed||(r=r||new Error("stream destroyed"),this.destroyed=!0,this.emit("error",r),this.context.unref())};Gb.inherits(Xb,Z1);function Xb(r,e){e=e||{},Z1.call(this,e),this.context=r,this.context.ref(),this.start=e.start||0,this.endOffset=e.end==null?1/0:+e.end,this.bytesWritten=0,this.pos=this.start,this.destroyed=!1,this.on("finish",this.destroy.bind(this))}Xb.prototype._write=function(r,e,t){var n=this;if(!n.destroyed){if(n.pos+r.length>n.endOffset){var i=new Error("maximum file length exceeded");i.code="ETOOBIG",n.destroy(),t(i);return}n.context.pend.go(function(o){if(n.destroyed)return o();yg.write(n.context.fd,r,0,r.length,n.pos,function(s,a){s?(n.destroy(),o(),t(s)):(n.bytesWritten+=a,n.pos+=a,n.emit("progress"),o(),t())})})}};Xb.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.context.unref())};Gb.inherits(aa,Vb);function aa(r,e){Vb.call(this),e=e||{},this.refCount=0,this.buffer=r,this.maxChunkSize=e.maxChunkSize||Number.MAX_SAFE_INTEGER}aa.prototype.read=function(r,e,t,n,i){if(!(0<=e&&e<=r.length))throw new RangeError("offset outside buffer: 0 <= "+e+" <= "+r.length);if(n<0)throw new RangeError("position is negative: "+n);if(e+t>r.length&&(t=r.length-e),n+t>this.buffer.length&&(t=this.buffer.length-n),t<=0){setImmediate(function(){i(null,0)});return}this.buffer.copy(r,e,n,n+t),setImmediate(function(){i(null,t)})};aa.prototype.write=function(r,e,t,n,i){r.copy(this.buffer,n,e,e+t),setImmediate(function(){i(null,t,r)})};aa.prototype.createReadStream=function(r){r=r||{};var e=new JW(r);e.destroyed=!1,e.start=r.start||0,e.endOffset=r.end,e.pos=e.endOffset||this.buffer.length;for(var t=this.buffer.slice(e.start,e.pos),n=0;;){var i=n+this.maxChunkSize;if(i>=t.length){n<t.length&&e.write(t.slice(n,t.length));break}e.write(t.slice(n,i)),n=i}return e.end(),e.destroy=function(){e.destroyed=!0},e};aa.prototype.createWriteStream=function(r){var e=this;r=r||{};var t=new Z1(r);return t.start=r.start||0,t.endOffset=r.end==null?this.buffer.length:+r.end,t.bytesWritten=0,t.pos=t.start,t.destroyed=!1,t._write=function(n,i,o){if(!t.destroyed){var s=t.pos+n.length;if(s>t.endOffset){var a=new Error("maximum file length exceeded");a.code="ETOOBIG",t.destroyed=!0,o(a);return}n.copy(e.buffer,t.pos,0,n.length),t.bytesWritten+=n.length,t.pos=s,t.emit("progress"),o()}},t.destroy=function(){t.destroyed=!0},t};aa.prototype.ref=function(){this.refCount+=1};aa.prototype.unref=function(){if(this.refCount-=1,this.refCount<0)throw new Error("invalid unref")};function eq(r,e){return new aa(r,e)}function tq(r,e){return new oa(r,e)}});var SP=it(($ee,xP)=>{Ce();De();Re();var vl=(al(),Ir(Ff)).Buffer,J1=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];typeof Int32Array<"u"&&(J1=new Int32Array(J1));function AP(r){if(vl.isBuffer(r))return r;var e=typeof vl.alloc=="function"&&typeof vl.from=="function";if(typeof r=="number")return e?vl.alloc(r):new vl(r);if(typeof r=="string")return e?vl.from(r):new vl(r);throw new Error("input must be buffer, number, or string, received "+typeof r)}function rq(r){var e=AP(4);return e.writeInt32BE(r,0),e}function Q1(r,e){r=AP(r),vl.isBuffer(e)&&(e=e.readUInt32BE(0));for(var t=~~e^-1,n=0;n<r.length;n++)t=J1[(t^r[n])&255]^t>>>8;return t^-1}function eA(){return rq(Q1.apply(null,arguments))}eA.signed=function(){return Q1.apply(null,arguments)};eA.unsigned=function(){return Q1.apply(null,arguments)>>>0};xP.exports=eA});var PP=it(Si=>{Ce();De();Re();var tA=(Hp(),Ir(qp)),nq=(wL(),Ir(bL)),TP=EP(),iq=SP(),Jb=(mh(),Ir(lg)),Qb=(yh(),Ir(ug)).EventEmitter,CP=(mg(),Ir(gg)).Transform,nA=(mg(),Ir(gg)).PassThrough,sq=(mg(),Ir(gg)).Writable;Si.open=oq;Si.fromFd=RP;Si.fromBuffer=aq;Si.fromRandomAccessReader=iA;Si.dosDateTimeToDate=OP;Si.getFileNameLowLevel=NP;Si.validateFileName=kP;Si.parseExtraFields=LP;Si.ZipFile=uo;Si.Entry=wg;Si.LocalFileHeader=IP;Si.RandomAccessReader=_l;function oq(r,e,t){typeof e=="function"&&(t=e,e=null),e==null&&(e={}),e.autoClose==null&&(e.autoClose=!0),e.lazyEntries==null&&(e.lazyEntries=!1),e.decodeStrings==null&&(e.decodeStrings=!0),e.validateEntrySizes==null&&(e.validateEntrySizes=!0),e.strictFileNames==null&&(e.strictFileNames=!1),t==null&&(t=Zb),tA.open(r,"r",function(n,i){if(n)return t(n);RP(i,e,function(o,s){o&&tA.close(i,Zb),t(o,s)})})}function RP(r,e,t){typeof e=="function"&&(t=e,e=null),e==null&&(e={}),e.autoClose==null&&(e.autoClose=!1),e.lazyEntries==null&&(e.lazyEntries=!1),e.decodeStrings==null&&(e.decodeStrings=!0),e.validateEntrySizes==null&&(e.validateEntrySizes=!0),e.strictFileNames==null&&(e.strictFileNames=!1),t==null&&(t=Zb),tA.fstat(r,function(n,i){if(n)return t(n);var o=TP.createFromFd(r,{autoClose:!0});iA(o,i.size,e,t)})}function aq(r,e,t){typeof e=="function"&&(t=e,e=null),e==null&&(e={}),e.autoClose=!1,e.lazyEntries==null&&(e.lazyEntries=!1),e.decodeStrings==null&&(e.decodeStrings=!0),e.validateEntrySizes==null&&(e.validateEntrySizes=!0),e.strictFileNames==null&&(e.strictFileNames=!1);var n=TP.createFromBuffer(r,{maxChunkSize:65536});iA(n,r.length,e,t)}function iA(r,e,t,n){typeof t=="function"&&(n=t,t=null),t==null&&(t={}),t.autoClose==null&&(t.autoClose=!0),t.lazyEntries==null&&(t.lazyEntries=!1),t.decodeStrings==null&&(t.decodeStrings=!0);var i=!!t.decodeStrings;if(t.validateEntrySizes==null&&(t.validateEntrySizes=!0),t.strictFileNames==null&&(t.strictFileNames=!1),n==null&&(n=Zb),typeof e!="number")throw new Error("expected totalSize parameter to be a number");if(e>Number.MAX_SAFE_INTEGER)throw new Error("zip file too large. only file sizes up to 2^52 are supported due to JavaScript's Number type being an IEEE 754 double.");r.ref();var o=22,s=20,a=65535,u=Math.min(s+o+a,e),c=la(u),f=e-c.length;vh(r,c,0,u,f,function(h){if(h)return n(h);for(var p=u-o;p>=0;p-=1)if(c.readUInt32LE(p)===101010256){var m=c.subarray(p),b=m.readUInt16LE(4),v=m.readUInt16LE(10),w=m.readUInt32LE(16),y=m.readUInt16LE(20),_=m.length-o;if(y!==_)return n(new Error("Invalid comment length. Expected: "+_+". Found: "+y+". Are there extra bytes at the end of the file? Or is the end of central dir signature `PK\u263A\u263B` in the comment?"));var E=i?Kb(m.subarray(22),!1):m.subarray(22);if(p-s>=0&&c.readUInt32LE(p-s)===117853008){var S=c.subarray(p-s,p-s+s),A=wh(S,8),F=la(56);return vh(r,F,0,F.length,A,function(D){return D?n(D):F.readUInt32LE(0)!==101075792?n(new Error("invalid zip64 end of central directory record signature")):(b=F.readUInt32LE(16),b!==0?n(new Error("multi-disk zip files are not supported: found disk number: "+b)):(v=wh(F,32),w=wh(F,48),n(null,new uo(r,w,e,v,E,t.autoClose,t.lazyEntries,i,t.validateEntrySizes,t.strictFileNames))))})}return b!==0?n(new Error("multi-disk zip files are not supported: found disk number: "+b)):n(null,new uo(r,w,e,v,E,t.autoClose,t.lazyEntries,i,t.validateEntrySizes,t.strictFileNames))}n(new Error("End of central directory record signature not found. Either not a zip file, or file is truncated."))})}Jb.inherits(uo,Qb);function uo(r,e,t,n,i,o,s,a,u,c){var f=this;Qb.call(f),f.reader=r,f.reader.on("error",function(h){DP(f,h)}),f.reader.once("close",function(){f.emit("close")}),f.readEntryCursor=e,f.fileSize=t,f.entryCount=n,f.comment=i,f.entriesRead=0,f.autoClose=!!o,f.lazyEntries=!!s,f.decodeStrings=!!a,f.validateEntrySizes=!!u,f.strictFileNames=!!c,f.isOpen=!0,f.emittedError=!1,f.lazyEntries||f._readEntry()}uo.prototype.close=function(){this.isOpen&&(this.isOpen=!1,this.reader.unref())};function lo(r,e){r.autoClose&&r.close(),DP(r,e)}function DP(r,e){r.emittedError||(r.emittedError=!0,r.emit("error",e))}uo.prototype.readEntry=function(){if(!this.lazyEntries)throw new Error("readEntry() called without lazyEntries:true");this._readEntry()};uo.prototype._readEntry=function(){var r=this;if(r.entryCount===r.entriesRead){setImmediate(function(){r.autoClose&&r.close(),!r.emittedError&&r.emit("end")});return}if(!r.emittedError){var e=la(46);vh(r.reader,e,0,e.length,r.readEntryCursor,function(t){if(t)return lo(r,t);if(!r.emittedError){var n=new wg,i=e.readUInt32LE(0);if(i!==33639248)return lo(r,new Error("invalid central directory file header signature: 0x"+i.toString(16)));if(n.versionMadeBy=e.readUInt16LE(4),n.versionNeededToExtract=e.readUInt16LE(6),n.generalPurposeBitFlag=e.readUInt16LE(8),n.compressionMethod=e.readUInt16LE(10),n.lastModFileTime=e.readUInt16LE(12),n.lastModFileDate=e.readUInt16LE(14),n.crc32=e.readUInt32LE(16),n.compressedSize=e.readUInt32LE(20),n.uncompressedSize=e.readUInt32LE(24),n.fileNameLength=e.readUInt16LE(28),n.extraFieldLength=e.readUInt16LE(30),n.fileCommentLength=e.readUInt16LE(32),n.internalFileAttributes=e.readUInt16LE(36),n.externalFileAttributes=e.readUInt32LE(38),n.relativeOffsetOfLocalHeader=e.readUInt32LE(42),n.generalPurposeBitFlag&64)return lo(r,new Error("strong encryption is not supported"));r.readEntryCursor+=46,e=la(n.fileNameLength+n.extraFieldLength+n.fileCommentLength),vh(r.reader,e,0,e.length,r.readEntryCursor,function(o){if(o)return lo(r,o);if(!r.emittedError){n.fileNameRaw=e.subarray(0,n.fileNameLength);var s=n.fileNameLength+n.extraFieldLength;n.extraFieldRaw=e.subarray(n.fileNameLength,s),n.fileCommentRaw=e.subarray(s,s+n.fileCommentLength);try{n.extraFields=LP(n.extraFieldRaw)}catch(v){return lo(r,v)}if(r.decodeStrings){var a=(n.generalPurposeBitFlag&2048)!==0;n.fileComment=Kb(n.fileCommentRaw,a),n.fileName=NP(n.generalPurposeBitFlag,n.fileNameRaw,n.extraFields,r.strictFileNames);var u=kP(n.fileName);if(u!=null)return lo(r,new Error(u))}else n.fileComment=n.fileCommentRaw,n.fileName=n.fileNameRaw;n.comment=n.fileComment,r.readEntryCursor+=e.length,r.entriesRead+=1;for(var c=0;c<n.extraFields.length;c++){var f=n.extraFields[c];if(f.id===1){var h=f.data,p=0;if(n.uncompressedSize===4294967295){if(p+8>h.length)return lo(r,new Error("zip64 extended information extra field does not include uncompressed size"));n.uncompressedSize=wh(h,p),p+=8}if(n.compressedSize===4294967295){if(p+8>h.length)return lo(r,new Error("zip64 extended information extra field does not include compressed size"));n.compressedSize=wh(h,p),p+=8}if(n.relativeOffsetOfLocalHeader===4294967295){if(p+8>h.length)return lo(r,new Error("zip64 extended information extra field does not include relative header offset"));n.relativeOffsetOfLocalHeader=wh(h,p),p+=8}break}}if(r.validateEntrySizes&&n.compressionMethod===0){var m=n.uncompressedSize;if(n.isEncrypted()&&(m+=12),n.compressedSize!==m){var b="compressed/uncompressed size mismatch for stored file: "+n.compressedSize+" != "+n.uncompressedSize;return lo(r,new Error(b))}}r.emit("entry",n),r.lazyEntries||r._readEntry()}})}})}};uo.prototype.openReadStream=function(r,e,t){var n=this,i=0,o=r.compressedSize;if(t==null&&(t=e,e=null),e==null)e={};else{if(e.decrypt!=null){if(!r.isEncrypted())throw new Error("options.decrypt can only be specified for encrypted entries");if(e.decrypt!==!1)throw new Error("invalid options.decrypt value: "+e.decrypt);if(r.isCompressed()&&e.decompress!==!1)throw new Error("entry is encrypted and compressed, and options.decompress !== false")}if(e.decompress!=null){if(!r.isCompressed())throw new Error("options.decompress can only be specified for compressed entries");if(!(e.decompress===!1||e.decompress===!0))throw new Error("invalid options.decompress value: "+e.decompress)}if(e.start!=null||e.end!=null){if(r.isCompressed()&&e.decompress!==!1)throw new Error("start/end range not allowed for compressed entry without options.decompress === false");if(r.isEncrypted()&&e.decrypt!==!1)throw new Error("start/end range not allowed for encrypted entry without options.decrypt === false")}if(e.start!=null){if(i=e.start,i<0)throw new Error("options.start < 0");if(i>r.compressedSize)throw new Error("options.start > entry.compressedSize")}if(e.end!=null){if(o=e.end,o<0)throw new Error("options.end < 0");if(o>r.compressedSize)throw new Error("options.end > entry.compressedSize");if(o<i)throw new Error("options.end < options.start")}}if(!n.isOpen)return t(new Error("closed"));if(r.isEncrypted()&&e.decrypt!==!1)return t(new Error("entry is encrypted, and options.decrypt !== false"));var s;if(r.compressionMethod===0)s=!1;else if(r.compressionMethod===8)s=e.decompress!=null?e.decompress:!0;else return t(new Error("unsupported compression method: "+r.compressionMethod));n.readLocalFileHeader(r,{minimal:!0},function(a,u){if(a)return t(a);n.openReadStreamLowLevel(u.fileDataStart,r.compressedSize,i,o,s,r.uncompressedSize,t)})};uo.prototype.openReadStreamLowLevel=function(r,e,t,n,i,o,s){var a=this,u=r+e,c=a.reader.createReadStream({start:r+t,end:r+n}),f=c;if(i){var h=!1,p=nq.createInflateRaw();c.on("error",function(m){setImmediate(function(){h||p.emit("error",m)})}),c.pipe(p),a.validateEntrySizes?(f=new vg(o),p.on("error",function(m){setImmediate(function(){h||f.emit("error",m)})}),p.pipe(f)):f=p,rA(f,function(){h=!0,p!==f&&p.unpipe(f),c.unpipe(p),c.destroy()})}s(null,f)};uo.prototype.readLocalFileHeader=function(r,e,t){var n=this;t==null&&(t=e,e=null),e==null&&(e={}),n.reader.ref();var i=la(30);vh(n.reader,i,0,i.length,r.relativeOffsetOfLocalHeader,function(o){try{if(o)return t(o);var s=i.readUInt32LE(0);if(s!==67324752)return t(new Error("invalid local file header signature: 0x"+s.toString(16)));var a=i.readUInt16LE(26),u=i.readUInt16LE(28),c=r.relativeOffsetOfLocalHeader+30+a+u;if(c+r.compressedSize>n.fileSize)return t(new Error("file data overflows file bounds: "+c+" + "+r.compressedSize+" > "+n.fileSize));if(e.minimal)return t(null,{fileDataStart:c});var f=new IP;f.fileDataStart=c,f.versionNeededToExtract=i.readUInt16LE(4),f.generalPurposeBitFlag=i.readUInt16LE(6),f.compressionMethod=i.readUInt16LE(8),f.lastModFileTime=i.readUInt16LE(10),f.lastModFileDate=i.readUInt16LE(12),f.crc32=i.readUInt32LE(14),f.compressedSize=i.readUInt32LE(18),f.uncompressedSize=i.readUInt32LE(22),f.fileNameLength=a,f.extraFieldLength=u,i=la(a+u),n.reader.ref(),vh(n.reader,i,0,i.length,r.relativeOffsetOfLocalHeader+30,function(h){try{return h?t(h):(f.fileName=i.subarray(0,a),f.extraField=i.subarray(a),t(null,f))}finally{n.reader.unref()}})}finally{n.reader.unref()}})};function wg(){}wg.prototype.getLastModDate=function(){return OP(this.lastModFileDate,this.lastModFileTime)};wg.prototype.isEncrypted=function(){return(this.generalPurposeBitFlag&1)!==0};wg.prototype.isCompressed=function(){return this.compressionMethod===8};function IP(){}function OP(r,e){var t=r&31,n=(r>>5&15)-1,i=(r>>9&127)+1980,o=0,s=(e&31)*2,a=e>>5&63,u=e>>11&31;return new Date(i,n,t,u,a,s,o)}function NP(r,e,t,n){for(var i=null,o=0;o<t.length;o++){var s=t[o];if(s.id===28789){if(s.data.length<6||s.data.readUInt8(0)!==1)continue;var a=s.data.readUInt32LE(1);if(iq.unsigned(e)!==a)continue;i=Kb(s.data.subarray(5),!0);break}}if(i==null){var u=(r&2048)!==0;i=Kb(e,u)}return n||(i=i.replace(/\\/g,"/")),i}function kP(r){return r.indexOf("\\")!==-1?"invalid characters in fileName: "+r:/^[a-zA-Z]:/.test(r)||/^\//.test(r)?"absolute path: "+r:r.split("/").indexOf("..")!==-1?"invalid relative path: "+r:null}function LP(r){for(var e=[],t=0;t<r.length-3;){var n=r.readUInt16LE(t+0),i=r.readUInt16LE(t+2),o=t+4,s=o+i;if(s>r.length)throw new Error("extra field length exceeds extra field buffer size");var a=r.subarray(o,s);e.push({id:n,data:a}),t=s}return e}function vh(r,e,t,n,i,o){if(n===0)return setImmediate(function(){o(null,la(0))});r.read(e,t,n,i,function(s,a){if(s)return o(s);if(a<n)return o(new Error("unexpected EOF"));o()})}Jb.inherits(vg,CP);function vg(r){CP.call(this),this.actualByteCount=0,this.expectedByteCount=r}vg.prototype._transform=function(r,e,t){if(this.actualByteCount+=r.length,this.actualByteCount>this.expectedByteCount){var n="too many bytes in the stream. expected "+this.expectedByteCount+". got at least "+this.actualByteCount;return t(new Error(n))}t(null,r)};vg.prototype._flush=function(r){if(this.actualByteCount<this.expectedByteCount){var e="not enough bytes in the stream. expected "+this.expectedByteCount+". got only "+this.actualByteCount;return r(new Error(e))}r()};Jb.inherits(_l,Qb);function _l(){Qb.call(this),this.refCount=0}_l.prototype.ref=function(){this.refCount+=1};_l.prototype.unref=function(){var r=this;if(r.refCount-=1,r.refCount>0)return;if(r.refCount<0)throw new Error("invalid unref");r.close(e);function e(t){if(t)return r.emit("error",t);r.emit("close")}};_l.prototype.createReadStream=function(r){r==null&&(r={});var e=r.start,t=r.end;if(e===t){var n=new nA;return setImmediate(function(){n.end()}),n}var i=this._readStreamForRange(e,t),o=!1,s=new ew(this);i.on("error",function(u){setImmediate(function(){o||s.emit("error",u)})}),rA(s,function(){i.unpipe(s),s.unref(),i.destroy()});var a=new vg(t-e);return s.on("error",function(u){setImmediate(function(){o||a.emit("error",u)})}),rA(a,function(){o=!0,s.unpipe(a),s.destroy()}),i.pipe(s).pipe(a)};_l.prototype._readStreamForRange=function(r,e){throw new Error("not implemented")};_l.prototype.read=function(r,e,t,n,i){var o=this.createReadStream({start:n,end:n+t}),s=new sq,a=0;s._write=function(u,c,f){u.copy(r,e+a,0,u.length),a+=u.length,f()},s.on("finish",i),o.on("error",function(u){i(u)}),o.pipe(s)};_l.prototype.close=function(r){setImmediate(r)};Jb.inherits(ew,nA);function ew(r){nA.call(this),this.context=r,this.context.ref(),this.unreffedYet=!1}ew.prototype._flush=function(r){this.unref(),r()};ew.prototype.unref=function(r){this.unreffedYet||(this.unreffedYet=!0,this.context.unref())};var lq="\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0";function Kb(r,e){if(e)return r.toString("utf8");for(var t="",n=0;n<r.length;n++)t+=lq[r[n]];return t}function wh(r,e){var t=r.readUInt32LE(e),n=r.readUInt32LE(e+4);return n*4294967296+t}var la;typeof Buffer.allocUnsafe=="function"?la=function(r){return Buffer.allocUnsafe(r)}:la=function(r){return new Buffer(r)};function rA(r,e){typeof r.destroy=="function"?r._destroy=function(t,n){e(),n?.(t)}:r.destroy=e}function Zb(r){if(r)throw r}});var sA=it((Xee,MP)=>{Ce();De();Re();MP.exports=(yh(),Ir(ug)).EventEmitter});var zP=it((Qee,$P)=>{"use strict";Ce();De();Re();function BP(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function FP(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?BP(Object(t),!0).forEach(function(n){uq(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):BP(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function uq(r,e,t){return e=jP(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function cq(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function UP(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,jP(n.key),n)}}function fq(r,e,t){return e&&UP(r.prototype,e),t&&UP(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}function jP(r){var e=hq(r,"string");return typeof e=="symbol"?e:String(e)}function hq(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var dq=(al(),Ir(Ff)),tw=dq.Buffer,pq=(mh(),Ir(lg)),oA=pq.inspect,gq=oA&&oA.custom||"inspect";function mq(r,e,t){tw.prototype.copy.call(r,e,t)}$P.exports=(function(){function r(){cq(this,r),this.head=null,this.tail=null,this.length=0}return fq(r,[{key:"push",value:function(t){var n={data:t,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length}},{key:"unshift",value:function(t){var n={data:t,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length}},{key:"shift",value:function(){if(this.length!==0){var t=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(this.length===0)return"";for(var n=this.head,i=""+n.data;n=n.next;)i+=t+n.data;return i}},{key:"concat",value:function(t){if(this.length===0)return tw.alloc(0);for(var n=tw.allocUnsafe(t>>>0),i=this.head,o=0;i;)mq(i.data,n,o),o+=i.data.length,i=i.next;return n}},{key:"consume",value:function(t,n){var i;return t<this.head.data.length?(i=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):t===this.head.data.length?i=this.shift():i=n?this._getString(t):this._getBuffer(t),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var n=this.head,i=1,o=n.data;for(t-=o.length;n=n.next;){var s=n.data,a=t>s.length?s.length:t;if(a===s.length?o+=s:o+=s.slice(0,t),t-=a,t===0){a===s.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=s.slice(a));break}++i}return this.length-=i,o}},{key:"_getBuffer",value:function(t){var n=tw.allocUnsafe(t),i=this.head,o=1;for(i.data.copy(n),t-=i.data.length;i=i.next;){var s=i.data,a=t>s.length?s.length:t;if(s.copy(n,n.length-t,0,a),t-=a,t===0){a===s.length?(++o,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=s.slice(a));break}++o}return this.length-=o,n}},{key:gq,value:function(t,n){return oA(this,FP(FP({},n),{},{depth:0,customInspect:!1}))}}]),r})()});var lA=it((nte,qP)=>{"use strict";Ce();De();Re();function yq(r,e){var t=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(e?e(r):r&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(aA,this,r)):process.nextTick(aA,this,r)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(r||null,function(o){!e&&o?t._writableState?t._writableState.errorEmitted?process.nextTick(rw,t):(t._writableState.errorEmitted=!0,process.nextTick(WP,t,o)):process.nextTick(WP,t,o):e?(process.nextTick(rw,t),e(o)):process.nextTick(rw,t)}),this)}function WP(r,e){aA(r,e),rw(r)}function rw(r){r._writableState&&!r._writableState.emitClose||r._readableState&&!r._readableState.emitClose||r.emit("close")}function bq(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function aA(r,e){r.emit("error",e)}function wq(r,e){var t=r._readableState,n=r._writableState;t&&t.autoDestroy||n&&n.autoDestroy?r.destroy(e):r.emit("error",e)}qP.exports={destroy:yq,undestroy:bq,errorOrDestroy:wq}});var Zu=it((ate,VP)=>{"use strict";Ce();De();Re();function vq(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.__proto__=e}var GP={};function ss(r,e,t){t||(t=Error);function n(o,s,a){return typeof e=="string"?e:e(o,s,a)}var i=(function(o){vq(s,o);function s(a,u,c){return o.call(this,n(a,u,c))||this}return s})(t);i.prototype.name=t.name,i.prototype.code=r,GP[r]=i}function HP(r,e){if(Array.isArray(r)){var t=r.length;return r=r.map(function(n){return String(n)}),t>2?"one of ".concat(e," ").concat(r.slice(0,t-1).join(", "),", or ")+r[t-1]:t===2?"one of ".concat(e," ").concat(r[0]," or ").concat(r[1]):"of ".concat(e," ").concat(r[0])}else return"of ".concat(e," ").concat(String(r))}function _q(r,e,t){return r.substr(!t||t<0?0:+t,e.length)===e}function Eq(r,e,t){return(t===void 0||t>r.length)&&(t=r.length),r.substring(t-e.length,t)===e}function Aq(r,e,t){return typeof t!="number"&&(t=0),t+e.length>r.length?!1:r.indexOf(e,t)!==-1}ss("ERR_INVALID_OPT_VALUE",function(r,e){return'The value "'+e+'" is invalid for option "'+r+'"'},TypeError);ss("ERR_INVALID_ARG_TYPE",function(r,e,t){var n;typeof e=="string"&&_q(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be";var i;if(Eq(r," argument"))i="The ".concat(r," ").concat(n," ").concat(HP(e,"type"));else{var o=Aq(r,".")?"property":"argument";i='The "'.concat(r,'" ').concat(o," ").concat(n," ").concat(HP(e,"type"))}return i+=". Received type ".concat(typeof t),i},TypeError);ss("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");ss("ERR_METHOD_NOT_IMPLEMENTED",function(r){return"The "+r+" method is not implemented"});ss("ERR_STREAM_PREMATURE_CLOSE","Premature close");ss("ERR_STREAM_DESTROYED",function(r){return"Cannot call "+r+" after a stream was destroyed"});ss("ERR_MULTIPLE_CALLBACK","Callback called multiple times");ss("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");ss("ERR_STREAM_WRITE_AFTER_END","write after end");ss("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);ss("ERR_UNKNOWN_ENCODING",function(r){return"Unknown encoding: "+r},TypeError);ss("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");VP.exports.codes=GP});var uA=it((fte,YP)=>{"use strict";Ce();De();Re();var xq=Zu().codes.ERR_INVALID_OPT_VALUE;function Sq(r,e,t){return r.highWaterMark!=null?r.highWaterMark:e?r[t]:null}function Tq(r,e,t,n){var i=Sq(e,n,t);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var o=n?t:"highWaterMark";throw new xq(o,i)}return Math.floor(i)}return r.objectMode?16:16*1024}YP.exports={getHighWaterMark:Tq}});var Ju=it((gte,cA)=>{Ce();De();Re();typeof Object.create=="function"?cA.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:cA.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}});var KP=it((wte,XP)=>{Ce();De();Re();XP.exports=Cq;function Cq(r,e){if(fA("noDeprecation"))return r;var t=!1;function n(){if(!t){if(fA("throwDeprecation"))throw new Error(e);fA("traceDeprecation")?console.trace(e):console.warn(e),t=!0}return r.apply(this,arguments)}return n}function fA(r){try{if(!window.localStorage)return!1}catch{return!1}var e=window.localStorage[r];return e==null?!1:String(e).toLowerCase()==="true"}});var pA=it((Ate,rM)=>{"use strict";Ce();De();Re();rM.exports=kr;function JP(r){var e=this;this.next=null,this.entry=null,this.finish=function(){eH(e,r)}}var _h;kr.WritableState=Eg;var Rq={deprecate:KP()},QP=sA(),iw=(al(),Ir(Ff)).Buffer,Dq=(typeof window<"u"||typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Iq(r){return iw.from(r)}function Oq(r){return iw.isBuffer(r)||r instanceof Dq}var dA=lA(),Nq=uA(),kq=Nq.getHighWaterMark,El=Zu().codes,Lq=El.ERR_INVALID_ARG_TYPE,Pq=El.ERR_METHOD_NOT_IMPLEMENTED,Mq=El.ERR_MULTIPLE_CALLBACK,Bq=El.ERR_STREAM_CANNOT_PIPE,Fq=El.ERR_STREAM_DESTROYED,Uq=El.ERR_STREAM_NULL_VALUES,jq=El.ERR_STREAM_WRITE_AFTER_END,$q=El.ERR_UNKNOWN_ENCODING,Eh=dA.errorOrDestroy;Ju()(kr,QP);function zq(){}function Eg(r,e,t){_h=_h||Qu(),r=r||{},typeof t!="boolean"&&(t=e instanceof _h),this.objectMode=!!r.objectMode,t&&(this.objectMode=this.objectMode||!!r.writableObjectMode),this.highWaterMark=kq(this,r,"writableHighWaterMark",t),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=r.decodeStrings===!1;this.decodeStrings=!n,this.defaultEncoding=r.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(i){Xq(e,i)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=r.emitClose!==!1,this.autoDestroy=!!r.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new JP(this)}Eg.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t};(function(){try{Object.defineProperty(Eg.prototype,"buffer",{get:Rq.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var nw;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(nw=Function.prototype[Symbol.hasInstance],Object.defineProperty(kr,Symbol.hasInstance,{value:function(e){return nw.call(this,e)?!0:this!==kr?!1:e&&e._writableState instanceof Eg}})):nw=function(e){return e instanceof this};function kr(r){_h=_h||Qu();var e=this instanceof _h;if(!e&&!nw.call(kr,this))return new kr(r);this._writableState=new Eg(r,this,e),this.writable=!0,r&&(typeof r.write=="function"&&(this._write=r.write),typeof r.writev=="function"&&(this._writev=r.writev),typeof r.destroy=="function"&&(this._destroy=r.destroy),typeof r.final=="function"&&(this._final=r.final)),QP.call(this)}kr.prototype.pipe=function(){Eh(this,new Bq)};function Wq(r,e){var t=new jq;Eh(r,t),process.nextTick(e,t)}function qq(r,e,t,n){var i;return t===null?i=new Uq:typeof t!="string"&&!e.objectMode&&(i=new Lq("chunk",["string","Buffer"],t)),i?(Eh(r,i),process.nextTick(n,i),!1):!0}kr.prototype.write=function(r,e,t){var n=this._writableState,i=!1,o=!n.objectMode&&Oq(r);return o&&!iw.isBuffer(r)&&(r=Iq(r)),typeof e=="function"&&(t=e,e=null),o?e="buffer":e||(e=n.defaultEncoding),typeof t!="function"&&(t=zq),n.ending?Wq(this,t):(o||qq(this,n,r,t))&&(n.pendingcb++,i=Gq(this,n,o,r,e,t)),i};kr.prototype.cork=function(){this._writableState.corked++};kr.prototype.uncork=function(){var r=this._writableState;r.corked&&(r.corked--,!r.writing&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&eM(this,r))};kr.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new $q(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(kr.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Hq(r,e,t){return!r.objectMode&&r.decodeStrings!==!1&&typeof e=="string"&&(e=iw.from(e,t)),e}Object.defineProperty(kr.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Gq(r,e,t,n,i,o){if(!t){var s=Hq(e,n,i);n!==s&&(t=!0,i="buffer",n=s)}var a=e.objectMode?1:n.length;e.length+=a;var u=e.length<e.highWaterMark;if(u||(e.needDrain=!0),e.writing||e.corked){var c=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:t,callback:o,next:null},c?c.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else hA(r,e,!1,a,n,i,o);return u}function hA(r,e,t,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new Fq("write")):t?r._writev(i,e.onwrite):r._write(i,o,e.onwrite),e.sync=!1}function Vq(r,e,t,n,i){--e.pendingcb,t?(process.nextTick(i,n),process.nextTick(_g,r,e),r._writableState.errorEmitted=!0,Eh(r,n)):(i(n),r._writableState.errorEmitted=!0,Eh(r,n),_g(r,e))}function Yq(r){r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0}function Xq(r,e){var t=r._writableState,n=t.sync,i=t.writecb;if(typeof i!="function")throw new Mq;if(Yq(t),e)Vq(r,t,n,e,i);else{var o=tM(t)||r.destroyed;!o&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&eM(r,t),n?process.nextTick(ZP,r,t,o,i):ZP(r,t,o,i)}}function ZP(r,e,t,n){t||Kq(r,e),e.pendingcb--,n(),_g(r,e)}function Kq(r,e){e.length===0&&e.needDrain&&(e.needDrain=!1,r.emit("drain"))}function eM(r,e){e.bufferProcessing=!0;var t=e.bufferedRequest;if(r._writev&&t&&t.next){var n=e.bufferedRequestCount,i=new Array(n),o=e.corkedRequestsFree;o.entry=t;for(var s=0,a=!0;t;)i[s]=t,t.isBuf||(a=!1),t=t.next,s+=1;i.allBuffers=a,hA(r,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new JP(e),e.bufferedRequestCount=0}else{for(;t;){var u=t.chunk,c=t.encoding,f=t.callback,h=e.objectMode?1:u.length;if(hA(r,e,!1,h,u,c,f),t=t.next,e.bufferedRequestCount--,e.writing)break}t===null&&(e.lastBufferedRequest=null)}e.bufferedRequest=t,e.bufferProcessing=!1}kr.prototype._write=function(r,e,t){t(new Pq("_write()"))};kr.prototype._writev=null;kr.prototype.end=function(r,e,t){var n=this._writableState;return typeof r=="function"?(t=r,r=null,e=null):typeof e=="function"&&(t=e,e=null),r!=null&&this.write(r,e),n.corked&&(n.corked=1,this.uncork()),n.ending||Qq(this,n,t),this};Object.defineProperty(kr.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function tM(r){return r.ending&&r.length===0&&r.bufferedRequest===null&&!r.finished&&!r.writing}function Zq(r,e){r._final(function(t){e.pendingcb--,t&&Eh(r,t),e.prefinished=!0,r.emit("prefinish"),_g(r,e)})}function Jq(r,e){!e.prefinished&&!e.finalCalled&&(typeof r._final=="function"&&!e.destroyed?(e.pendingcb++,e.finalCalled=!0,process.nextTick(Zq,r,e)):(e.prefinished=!0,r.emit("prefinish")))}function _g(r,e){var t=tM(e);if(t&&(Jq(r,e),e.pendingcb===0&&(e.finished=!0,r.emit("finish"),e.autoDestroy))){var n=r._readableState;(!n||n.autoDestroy&&n.endEmitted)&&r.destroy()}return t}function Qq(r,e,t){e.ending=!0,_g(r,e),t&&(e.finished?process.nextTick(t):r.once("finish",t)),e.ended=!0,r.writable=!1}function eH(r,e,t){var n=r.entry;for(r.entry=null;n;){var i=n.callback;e.pendingcb--,i(t),n=n.next}e.corkedRequestsFree.next=r}Object.defineProperty(kr.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}});kr.prototype.destroy=dA.destroy;kr.prototype._undestroy=dA.undestroy;kr.prototype._destroy=function(r,e){e(r)}});var Qu=it((Cte,iM)=>{"use strict";Ce();De();Re();var tH=Object.keys||function(r){var e=[];for(var t in r)e.push(t);return e};iM.exports=co;var nM=yA(),mA=pA();Ju()(co,nM);for(gA=tH(mA.prototype),sw=0;sw<gA.length;sw++)ow=gA[sw],co.prototype[ow]||(co.prototype[ow]=mA.prototype[ow]);var gA,ow,sw;function co(r){if(!(this instanceof co))return new co(r);nM.call(this,r),mA.call(this,r),this.allowHalfOpen=!0,r&&(r.readable===!1&&(this.readable=!1),r.writable===!1&&(this.writable=!1),r.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",rH)))}Object.defineProperty(co.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(co.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(co.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function rH(){this._writableState.ended||process.nextTick(nH,this)}function nH(r){r.end()}Object.defineProperty(co.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}})});var aM=it((bA,oM)=>{Ce();De();Re();var aw=(al(),Ir(Ff)),ua=aw.Buffer;function sM(r,e){for(var t in r)e[t]=r[t]}ua.from&&ua.alloc&&ua.allocUnsafe&&ua.allocUnsafeSlow?oM.exports=aw:(sM(aw,bA),bA.Buffer=Ah);function Ah(r,e,t){return ua(r,e,t)}sM(ua,Ah);Ah.from=function(r,e,t){if(typeof r=="number")throw new TypeError("Argument must not be a number");return ua(r,e,t)};Ah.alloc=function(r,e,t){if(typeof r!="number")throw new TypeError("Argument must be a number");var n=ua(r);return e!==void 0?typeof t=="string"?n.fill(e,t):n.fill(e):n.fill(0),n};Ah.allocUnsafe=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return ua(r)};Ah.allocUnsafeSlow=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return aw.SlowBuffer(r)}});var _A=it(uM=>{"use strict";Ce();De();Re();var vA=aM().Buffer,lM=vA.isEncoding||function(r){switch(r=""+r,r&&r.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function iH(r){if(!r)return"utf8";for(var e;;)switch(r){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return r;default:if(e)return;r=(""+r).toLowerCase(),e=!0}}function sH(r){var e=iH(r);if(typeof e!="string"&&(vA.isEncoding===lM||!lM(r)))throw new Error("Unknown encoding: "+r);return e||r}uM.StringDecoder=Ag;function Ag(r){this.encoding=sH(r);var e;switch(this.encoding){case"utf16le":this.text=fH,this.end=hH,e=4;break;case"utf8":this.fillLast=lH,e=4;break;case"base64":this.text=dH,this.end=pH,e=3;break;default:this.write=gH,this.end=mH;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=vA.allocUnsafe(e)}Ag.prototype.write=function(r){if(r.length===0)return"";var e,t;if(this.lastNeed){if(e=this.fillLast(r),e===void 0)return"";t=this.lastNeed,this.lastNeed=0}else t=0;return t<r.length?e?e+this.text(r,t):this.text(r,t):e||""};Ag.prototype.end=cH;Ag.prototype.text=uH;Ag.prototype.fillLast=function(r){if(this.lastNeed<=r.length)return r.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);r.copy(this.lastChar,this.lastTotal-this.lastNeed,0,r.length),this.lastNeed-=r.length};function wA(r){return r<=127?0:r>>5===6?2:r>>4===14?3:r>>3===30?4:r>>6===2?-1:-2}function oH(r,e,t){var n=e.length-1;if(n<t)return 0;var i=wA(e[n]);return i>=0?(i>0&&(r.lastNeed=i-1),i):--n<t||i===-2?0:(i=wA(e[n]),i>=0?(i>0&&(r.lastNeed=i-2),i):--n<t||i===-2?0:(i=wA(e[n]),i>=0?(i>0&&(i===2?i=0:r.lastNeed=i-3),i):0))}function aH(r,e,t){if((e[0]&192)!==128)return r.lastNeed=0,"\uFFFD";if(r.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return r.lastNeed=1,"\uFFFD";if(r.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return r.lastNeed=2,"\uFFFD"}}function lH(r){var e=this.lastTotal-this.lastNeed,t=aH(this,r,e);if(t!==void 0)return t;if(this.lastNeed<=r.length)return r.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);r.copy(this.lastChar,e,0,r.length),this.lastNeed-=r.length}function uH(r,e){var t=oH(this,r,e);if(!this.lastNeed)return r.toString("utf8",e);this.lastTotal=t;var n=r.length-(t-this.lastNeed);return r.copy(this.lastChar,0,n),r.toString("utf8",e,n)}function cH(r){var e=r&&r.length?this.write(r):"";return this.lastNeed?e+"\uFFFD":e}function fH(r,e){if((r.length-e)%2===0){var t=r.toString("utf16le",e);if(t){var n=t.charCodeAt(t.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=r[r.length-2],this.lastChar[1]=r[r.length-1],t.slice(0,-1)}return t}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=r[r.length-1],r.toString("utf16le",e,r.length-1)}function hH(r){var e=r&&r.length?this.write(r):"";if(this.lastNeed){var t=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,t)}return e}function dH(r,e){var t=(r.length-e)%3;return t===0?r.toString("base64",e):(this.lastNeed=3-t,this.lastTotal=3,t===1?this.lastChar[0]=r[r.length-1]:(this.lastChar[0]=r[r.length-2],this.lastChar[1]=r[r.length-1]),r.toString("base64",e,r.length-t))}function pH(r){var e=r&&r.length?this.write(r):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function gH(r){return r.toString(this.encoding)}function mH(r){return r&&r.length?this.write(r):""}});var lw=it((Fte,hM)=>{"use strict";Ce();De();Re();var cM=Zu().codes.ERR_STREAM_PREMATURE_CLOSE;function yH(r){var e=!1;return function(){if(!e){e=!0;for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];r.apply(this,n)}}}function bH(){}function wH(r){return r.setHeader&&typeof r.abort=="function"}function fM(r,e,t){if(typeof e=="function")return fM(r,null,e);e||(e={}),t=yH(t||bH);var n=e.readable||e.readable!==!1&&r.readable,i=e.writable||e.writable!==!1&&r.writable,o=function(){r.writable||a()},s=r._writableState&&r._writableState.finished,a=function(){i=!1,s=!0,n||t.call(r)},u=r._readableState&&r._readableState.endEmitted,c=function(){n=!1,u=!0,i||t.call(r)},f=function(b){t.call(r,b)},h=function(){var b;if(n&&!u)return(!r._readableState||!r._readableState.ended)&&(b=new cM),t.call(r,b);if(i&&!s)return(!r._writableState||!r._writableState.ended)&&(b=new cM),t.call(r,b)},p=function(){r.req.on("finish",a)};return wH(r)?(r.on("complete",a),r.on("abort",h),r.req?p():r.on("request",p)):i&&!r._writableState&&(r.on("end",o),r.on("close",o)),r.on("end",c),r.on("finish",a),e.error!==!1&&r.on("error",f),r.on("close",h),function(){r.removeListener("complete",a),r.removeListener("abort",h),r.removeListener("request",p),r.req&&r.req.removeListener("finish",a),r.removeListener("end",o),r.removeListener("close",o),r.removeListener("finish",a),r.removeListener("end",c),r.removeListener("error",f),r.removeListener("close",h)}}hM.exports=fM});var pM=it((zte,dM)=>{"use strict";Ce();De();Re();var uw;function Al(r,e,t){return e=vH(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function vH(r){var e=_H(r,"string");return typeof e=="symbol"?e:String(e)}function _H(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var EH=lw(),xl=Symbol("lastResolve"),ec=Symbol("lastReject"),xg=Symbol("error"),cw=Symbol("ended"),tc=Symbol("lastPromise"),EA=Symbol("handlePromise"),rc=Symbol("stream");function Sl(r,e){return{value:r,done:e}}function AH(r){var e=r[xl];if(e!==null){var t=r[rc].read();t!==null&&(r[tc]=null,r[xl]=null,r[ec]=null,e(Sl(t,!1)))}}function xH(r){process.nextTick(AH,r)}function SH(r,e){return function(t,n){r.then(function(){if(e[cw]){t(Sl(void 0,!0));return}e[EA](t,n)},n)}}var TH=Object.getPrototypeOf(function(){}),CH=Object.setPrototypeOf((uw={get stream(){return this[rc]},next:function(){var e=this,t=this[xg];if(t!==null)return Promise.reject(t);if(this[cw])return Promise.resolve(Sl(void 0,!0));if(this[rc].destroyed)return new Promise(function(s,a){process.nextTick(function(){e[xg]?a(e[xg]):s(Sl(void 0,!0))})});var n=this[tc],i;if(n)i=new Promise(SH(n,this));else{var o=this[rc].read();if(o!==null)return Promise.resolve(Sl(o,!1));i=new Promise(this[EA])}return this[tc]=i,i}},Al(uw,Symbol.asyncIterator,function(){return this}),Al(uw,"return",function(){var e=this;return new Promise(function(t,n){e[rc].destroy(null,function(i){if(i){n(i);return}t(Sl(void 0,!0))})})}),uw),TH),RH=function(e){var t,n=Object.create(CH,(t={},Al(t,rc,{value:e,writable:!0}),Al(t,xl,{value:null,writable:!0}),Al(t,ec,{value:null,writable:!0}),Al(t,xg,{value:null,writable:!0}),Al(t,cw,{value:e._readableState.endEmitted,writable:!0}),Al(t,EA,{value:function(o,s){var a=n[rc].read();a?(n[tc]=null,n[xl]=null,n[ec]=null,o(Sl(a,!1))):(n[xl]=o,n[ec]=s)},writable:!0}),t));return n[tc]=null,EH(e,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=n[ec];o!==null&&(n[tc]=null,n[xl]=null,n[ec]=null,o(i)),n[xg]=i;return}var s=n[xl];s!==null&&(n[tc]=null,n[xl]=null,n[ec]=null,s(Sl(void 0,!0))),n[cw]=!0}),e.on("readable",xH.bind(null,n)),n};dM.exports=RH});var mM=it((Gte,gM)=>{Ce();De();Re();gM.exports=function(){throw new Error("Readable.from is not available in the browser")}});var yA=it((Zte,TM)=>{"use strict";Ce();De();Re();TM.exports=Ut;var xh;Ut.ReadableState=vM;var Kte=(yh(),Ir(ug)).EventEmitter,wM=function(e,t){return e.listeners(t).length},Tg=sA(),fw=(al(),Ir(Ff)).Buffer,DH=(typeof window<"u"||typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function IH(r){return fw.from(r)}function OH(r){return fw.isBuffer(r)||r instanceof DH}var AA=(mh(),Ir(lg)),Ot;AA&&AA.debuglog?Ot=AA.debuglog("stream"):Ot=function(){};var NH=zP(),IA=lA(),kH=uA(),LH=kH.getHighWaterMark,hw=Zu().codes,PH=hw.ERR_INVALID_ARG_TYPE,MH=hw.ERR_STREAM_PUSH_AFTER_EOF,BH=hw.ERR_METHOD_NOT_IMPLEMENTED,FH=hw.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Sh,xA,SA;Ju()(Ut,Tg);var Sg=IA.errorOrDestroy,TA=["error","close","destroy","pause","resume"];function UH(r,e,t){if(typeof r.prependListener=="function")return r.prependListener(e,t);!r._events||!r._events[e]?r.on(e,t):Array.isArray(r._events[e])?r._events[e].unshift(t):r._events[e]=[t,r._events[e]]}function vM(r,e,t){xh=xh||Qu(),r=r||{},typeof t!="boolean"&&(t=e instanceof xh),this.objectMode=!!r.objectMode,t&&(this.objectMode=this.objectMode||!!r.readableObjectMode),this.highWaterMark=LH(this,r,"readableHighWaterMark",t),this.buffer=new NH,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=r.emitClose!==!1,this.autoDestroy=!!r.autoDestroy,this.destroyed=!1,this.defaultEncoding=r.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,r.encoding&&(Sh||(Sh=_A().StringDecoder),this.decoder=new Sh(r.encoding),this.encoding=r.encoding)}function Ut(r){if(xh=xh||Qu(),!(this instanceof Ut))return new Ut(r);var e=this instanceof xh;this._readableState=new vM(r,this,e),this.readable=!0,r&&(typeof r.read=="function"&&(this._read=r.read),typeof r.destroy=="function"&&(this._destroy=r.destroy)),Tg.call(this)}Object.defineProperty(Ut.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}});Ut.prototype.destroy=IA.destroy;Ut.prototype._undestroy=IA.undestroy;Ut.prototype._destroy=function(r,e){e(r)};Ut.prototype.push=function(r,e){var t=this._readableState,n;return t.objectMode?n=!0:typeof r=="string"&&(e=e||t.defaultEncoding,e!==t.encoding&&(r=fw.from(r,e),e=""),n=!0),_M(this,r,e,!1,n)};Ut.prototype.unshift=function(r){return _M(this,r,null,!0,!1)};function _M(r,e,t,n,i){Ot("readableAddChunk",e);var o=r._readableState;if(e===null)o.reading=!1,zH(r,o);else{var s;if(i||(s=jH(o,e)),s)Sg(r,s);else if(o.objectMode||e&&e.length>0)if(typeof e!="string"&&!o.objectMode&&Object.getPrototypeOf(e)!==fw.prototype&&(e=IH(e)),n)o.endEmitted?Sg(r,new FH):CA(r,o,e,!0);else if(o.ended)Sg(r,new MH);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!t?(e=o.decoder.write(e),o.objectMode||e.length!==0?CA(r,o,e,!1):DA(r,o)):CA(r,o,e,!1)}else n||(o.reading=!1,DA(r,o))}return!o.ended&&(o.length<o.highWaterMark||o.length===0)}function CA(r,e,t,n){e.flowing&&e.length===0&&!e.sync?(e.awaitDrain=0,r.emit("data",t)):(e.length+=e.objectMode?1:t.length,n?e.buffer.unshift(t):e.buffer.push(t),e.needReadable&&dw(r)),DA(r,e)}function jH(r,e){var t;return!OH(e)&&typeof e!="string"&&e!==void 0&&!r.objectMode&&(t=new PH("chunk",["string","Buffer","Uint8Array"],e)),t}Ut.prototype.isPaused=function(){return this._readableState.flowing===!1};Ut.prototype.setEncoding=function(r){Sh||(Sh=_A().StringDecoder);var e=new Sh(r);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var t=this._readableState.buffer.head,n="";t!==null;)n+=e.write(t.data),t=t.next;return this._readableState.buffer.clear(),n!==""&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var yM=1073741824;function $H(r){return r>=yM?r=yM:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),r}function bM(r,e){return r<=0||e.length===0&&e.ended?0:e.objectMode?1:r!==r?e.flowing&&e.length?e.buffer.head.data.length:e.length:(r>e.highWaterMark&&(e.highWaterMark=$H(r)),r<=e.length?r:e.ended?e.length:(e.needReadable=!0,0))}Ut.prototype.read=function(r){Ot("read",r),r=parseInt(r,10);var e=this._readableState,t=r;if(r!==0&&(e.emittedReadable=!1),r===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return Ot("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?RA(this):dw(this),null;if(r=bM(r,e),r===0&&e.ended)return e.length===0&&RA(this),null;var n=e.needReadable;Ot("need readable",n),(e.length===0||e.length-r<e.highWaterMark)&&(n=!0,Ot("length less than watermark",n)),e.ended||e.reading?(n=!1,Ot("reading or ended",n)):n&&(Ot("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(r=bM(t,e)));var i;return r>0?i=xM(r,e):i=null,i===null?(e.needReadable=e.length<=e.highWaterMark,r=0):(e.length-=r,e.awaitDrain=0),e.length===0&&(e.ended||(e.needReadable=!0),t!==r&&e.ended&&RA(this)),i!==null&&this.emit("data",i),i};function zH(r,e){if(Ot("onEofChunk"),!e.ended){if(e.decoder){var t=e.decoder.end();t&&t.length&&(e.buffer.push(t),e.length+=e.objectMode?1:t.length)}e.ended=!0,e.sync?dw(r):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,EM(r)))}}function dw(r){var e=r._readableState;Ot("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(Ot("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(EM,r))}function EM(r){var e=r._readableState;Ot("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(r.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,OA(r)}function DA(r,e){e.readingMore||(e.readingMore=!0,process.nextTick(WH,r,e))}function WH(r,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){var t=e.length;if(Ot("maybeReadMore read 0"),r.read(0),t===e.length)break}e.readingMore=!1}Ut.prototype._read=function(r){Sg(this,new BH("_read()"))};Ut.prototype.pipe=function(r,e){var t=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=r;break;case 1:n.pipes=[n.pipes,r];break;default:n.pipes.push(r);break}n.pipesCount+=1,Ot("pipe count=%d opts=%j",n.pipesCount,e);var i=(!e||e.end!==!1)&&r!==process.stdout&&r!==process.stderr,o=i?a:v;n.endEmitted?process.nextTick(o):t.once("end",o),r.on("unpipe",s);function s(w,y){Ot("onunpipe"),w===t&&y&&y.hasUnpiped===!1&&(y.hasUnpiped=!0,f())}function a(){Ot("onend"),r.end()}var u=qH(t);r.on("drain",u);var c=!1;function f(){Ot("cleanup"),r.removeListener("close",m),r.removeListener("finish",b),r.removeListener("drain",u),r.removeListener("error",p),r.removeListener("unpipe",s),t.removeListener("end",a),t.removeListener("end",v),t.removeListener("data",h),c=!0,n.awaitDrain&&(!r._writableState||r._writableState.needDrain)&&u()}t.on("data",h);function h(w){Ot("ondata");var y=r.write(w);Ot("dest.write",y),y===!1&&((n.pipesCount===1&&n.pipes===r||n.pipesCount>1&&SM(n.pipes,r)!==-1)&&!c&&(Ot("false write response, pause",n.awaitDrain),n.awaitDrain++),t.pause())}function p(w){Ot("onerror",w),v(),r.removeListener("error",p),wM(r,"error")===0&&Sg(r,w)}UH(r,"error",p);function m(){r.removeListener("finish",b),v()}r.once("close",m);function b(){Ot("onfinish"),r.removeListener("close",m),v()}r.once("finish",b);function v(){Ot("unpipe"),t.unpipe(r)}return r.emit("pipe",t),n.flowing||(Ot("pipe resume"),t.resume()),r};function qH(r){return function(){var t=r._readableState;Ot("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&wM(r,"data")&&(t.flowing=!0,OA(r))}}Ut.prototype.unpipe=function(r){var e=this._readableState,t={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return r&&r!==e.pipes?this:(r||(r=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,r&&r.emit("unpipe",this,t),this);if(!r){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=SM(e.pipes,r);return s===-1?this:(e.pipes.splice(s,1),e.pipesCount-=1,e.pipesCount===1&&(e.pipes=e.pipes[0]),r.emit("unpipe",this,t),this)};Ut.prototype.on=function(r,e){var t=Tg.prototype.on.call(this,r,e),n=this._readableState;return r==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):r==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,Ot("on readable",n.length,n.reading),n.length?dw(this):n.reading||process.nextTick(HH,this)),t};Ut.prototype.addListener=Ut.prototype.on;Ut.prototype.removeListener=function(r,e){var t=Tg.prototype.removeListener.call(this,r,e);return r==="readable"&&process.nextTick(AM,this),t};Ut.prototype.removeAllListeners=function(r){var e=Tg.prototype.removeAllListeners.apply(this,arguments);return(r==="readable"||r===void 0)&&process.nextTick(AM,this),e};function AM(r){var e=r._readableState;e.readableListening=r.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:r.listenerCount("data")>0&&r.resume()}function HH(r){Ot("readable nexttick read 0"),r.read(0)}Ut.prototype.resume=function(){var r=this._readableState;return r.flowing||(Ot("resume"),r.flowing=!r.readableListening,GH(this,r)),r.paused=!1,this};function GH(r,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(VH,r,e))}function VH(r,e){Ot("resume",e.reading),e.reading||r.read(0),e.resumeScheduled=!1,r.emit("resume"),OA(r),e.flowing&&!e.reading&&r.read(0)}Ut.prototype.pause=function(){return Ot("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(Ot("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function OA(r){var e=r._readableState;for(Ot("flow",e.flowing);e.flowing&&r.read()!==null;);}Ut.prototype.wrap=function(r){var e=this,t=this._readableState,n=!1;r.on("end",function(){if(Ot("wrapped end"),t.decoder&&!t.ended){var s=t.decoder.end();s&&s.length&&e.push(s)}e.push(null)}),r.on("data",function(s){if(Ot("wrapped data"),t.decoder&&(s=t.decoder.write(s)),!(t.objectMode&&s==null)&&!(!t.objectMode&&(!s||!s.length))){var a=e.push(s);a||(n=!0,r.pause())}});for(var i in r)this[i]===void 0&&typeof r[i]=="function"&&(this[i]=(function(a){return function(){return r[a].apply(r,arguments)}})(i));for(var o=0;o<TA.length;o++)r.on(TA[o],this.emit.bind(this,TA[o]));return this._read=function(s){Ot("wrapped _read",s),n&&(n=!1,r.resume())},this};typeof Symbol=="function"&&(Ut.prototype[Symbol.asyncIterator]=function(){return xA===void 0&&(xA=pM()),xA(this)});Object.defineProperty(Ut.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(Ut.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(Ut.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}});Ut._fromList=xM;Object.defineProperty(Ut.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function xM(r,e){if(e.length===0)return null;var t;return e.objectMode?t=e.buffer.shift():!r||r>=e.length?(e.decoder?t=e.buffer.join(""):e.buffer.length===1?t=e.buffer.first():t=e.buffer.concat(e.length),e.buffer.clear()):t=e.buffer.consume(r,e.decoder),t}function RA(r){var e=r._readableState;Ot("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(YH,e,r))}function YH(r,e){if(Ot("endReadableNT",r.endEmitted,r.length),!r.endEmitted&&r.length===0&&(r.endEmitted=!0,e.readable=!1,e.emit("end"),r.autoDestroy)){var t=e._writableState;(!t||t.autoDestroy&&t.finished)&&e.destroy()}}typeof Symbol=="function"&&(Ut.from=function(r,e){return SA===void 0&&(SA=mM()),SA(Ut,r,e)});function SM(r,e){for(var t=0,n=r.length;t<n;t++)if(r[t]===e)return t;return-1}});var NA=it((tre,RM)=>{"use strict";Ce();De();Re();RM.exports=ca;var pw=Zu().codes,XH=pw.ERR_METHOD_NOT_IMPLEMENTED,KH=pw.ERR_MULTIPLE_CALLBACK,ZH=pw.ERR_TRANSFORM_ALREADY_TRANSFORMING,JH=pw.ERR_TRANSFORM_WITH_LENGTH_0,gw=Qu();Ju()(ca,gw);function QH(r,e){var t=this._transformState;t.transforming=!1;var n=t.writecb;if(n===null)return this.emit("error",new KH);t.writechunk=null,t.writecb=null,e!=null&&this.push(e),n(r);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function ca(r){if(!(this instanceof ca))return new ca(r);gw.call(this,r),this._transformState={afterTransform:QH.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,r&&(typeof r.transform=="function"&&(this._transform=r.transform),typeof r.flush=="function"&&(this._flush=r.flush)),this.on("prefinish",eG)}function eG(){var r=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,t){CM(r,e,t)}):CM(this,null,null)}ca.prototype.push=function(r,e){return this._transformState.needTransform=!1,gw.prototype.push.call(this,r,e)};ca.prototype._transform=function(r,e,t){t(new XH("_transform()"))};ca.prototype._write=function(r,e,t){var n=this._transformState;if(n.writecb=t,n.writechunk=r,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};ca.prototype._read=function(r){var e=this._transformState;e.writechunk!==null&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};ca.prototype._destroy=function(r,e){gw.prototype._destroy.call(this,r,function(t){e(t)})};function CM(r,e,t){if(e)return r.emit("error",e);if(t!=null&&r.push(t),r._writableState.length)throw new JH;if(r._transformState.transforming)throw new ZH;return r.push(null)}});var OM=it((sre,IM)=>{"use strict";Ce();De();Re();IM.exports=Cg;var DM=NA();Ju()(Cg,DM);function Cg(r){if(!(this instanceof Cg))return new Cg(r);DM.call(this,r)}Cg.prototype._transform=function(r,e,t){t(null,r)}});var MM=it((ure,PM)=>{"use strict";Ce();De();Re();var kA;function tG(r){var e=!1;return function(){e||(e=!0,r.apply(void 0,arguments))}}var LM=Zu().codes,rG=LM.ERR_MISSING_ARGS,nG=LM.ERR_STREAM_DESTROYED;function NM(r){if(r)throw r}function iG(r){return r.setHeader&&typeof r.abort=="function"}function sG(r,e,t,n){n=tG(n);var i=!1;r.on("close",function(){i=!0}),kA===void 0&&(kA=lw()),kA(r,{readable:e,writable:t},function(s){if(s)return n(s);i=!0,n()});var o=!1;return function(s){if(!i&&!o){if(o=!0,iG(r))return r.abort();if(typeof r.destroy=="function")return r.destroy();n(s||new nG("pipe"))}}}function kM(r){r()}function oG(r,e){return r.pipe(e)}function aG(r){return!r.length||typeof r[r.length-1]!="function"?NM:r.pop()}function lG(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];var n=aG(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new rG("streams");var i,o=e.map(function(s,a){var u=a<e.length-1,c=a>0;return sG(s,u,c,function(f){i||(i=f),f&&o.forEach(kM),!u&&(o.forEach(kM),n(i))})});return e.reduce(oG)}PM.exports=lG});var FM=it((os,BM)=>{Ce();De();Re();os=BM.exports=yA();os.Stream=os;os.Readable=os;os.Writable=pA();os.Duplex=Qu();os.Transform=NA();os.PassThrough=OM();os.finished=lw();os.pipeline=MM()});var jM=it((mre,UM)=>{Ce();De();Re();var uG=Object.prototype.toString,LA=typeof Buffer<"u"&&typeof Buffer.alloc=="function"&&typeof Buffer.allocUnsafe=="function"&&typeof Buffer.from=="function";function cG(r){return uG.call(r).slice(8,-1)==="ArrayBuffer"}function fG(r,e,t){e>>>=0;var n=r.byteLength-e;if(n<0)throw new RangeError("'offset' is out of bounds");if(t===void 0)t=n;else if(t>>>=0,t>n)throw new RangeError("'length' is out of bounds");return LA?Buffer.from(r.slice(e,e+t)):new Buffer(new Uint8Array(r.slice(e,e+t)))}function hG(r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!Buffer.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');return LA?Buffer.from(r,e):new Buffer(r,e)}function dG(r,e,t){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return cG(r)?fG(r,e,t):typeof r=="string"?hG(r,e):LA?Buffer.from(r):new Buffer(r)}UM.exports=dG});var GM=it(bt=>{Ce();De();Re();var $M=void 0,pG=1e5,vr=(function(){var r=Object.prototype.toString,e=Object.prototype.hasOwnProperty;return{Class:function(t){return r.call(t).replace(/^\[object *|\]$/g,"")},HasProperty:function(t,n){return n in t},HasOwnProperty:function(t,n){return e.call(t,n)},IsCallable:function(t){return typeof t=="function"},ToInt32:function(t){return t>>0},ToUint32:function(t){return t>>>0}}})(),gG=Math.LN2,mG=Math.abs,mw=Math.floor,yG=Math.log,bG=Math.min,Ns=Math.pow,wG=Math.round;function PA(r){if(zM&&Th){var e=zM(r),t;for(t=0;t<e.length;t+=1)Th(r,e[t],{value:r[e[t]],writable:!1,enumerable:!1,configurable:!1})}}var Th;Object.defineProperty&&(function(){try{return Object.defineProperty({},"x",{}),!0}catch{return!1}})()?Th=Object.defineProperty:Th=function(r,e,t){if(!r===Object(r))throw new TypeError("Object.defineProperty called on non-object");return vr.HasProperty(t,"get")&&Object.prototype.__defineGetter__&&Object.prototype.__defineGetter__.call(r,e,t.get),vr.HasProperty(t,"set")&&Object.prototype.__defineSetter__&&Object.prototype.__defineSetter__.call(r,e,t.set),vr.HasProperty(t,"value")&&(r[e]=t.value),r};var zM=Object.getOwnPropertyNames||function(r){if(r!==Object(r))throw new TypeError("Object.getOwnPropertyNames called on non-object");var e=[],t;for(t in r)vr.HasOwnProperty(r,t)&&e.push(t);return e};function vG(r){if(!Th)return;if(r.length>pG)throw new RangeError("Array too large for polyfill");function e(n){Th(r,n,{get:function(){return r._getter(n)},set:function(i){r._setter(n,i)},enumerable:!0,configurable:!1})}var t;for(t=0;t<r.length;t+=1)e(t)}function MA(r,e){var t=32-e;return r<<t>>t}function BA(r,e){var t=32-e;return r<<t>>>t}function _G(r){return[r&255]}function EG(r){return MA(r[0],8)}function AG(r){return[r&255]}function WM(r){return BA(r[0],8)}function xG(r){return r=wG(Number(r)),[r<0?0:r>255?255:r&255]}function SG(r){return[r>>8&255,r&255]}function TG(r){return MA(r[0]<<8|r[1],16)}function CG(r){return[r>>8&255,r&255]}function RG(r){return BA(r[0]<<8|r[1],16)}function DG(r){return[r>>24&255,r>>16&255,r>>8&255,r&255]}function IG(r){return MA(r[0]<<24|r[1]<<16|r[2]<<8|r[3],32)}function OG(r){return[r>>24&255,r>>16&255,r>>8&255,r&255]}function NG(r){return BA(r[0]<<24|r[1]<<16|r[2]<<8|r[3],32)}function qM(r,e,t){var n=(1<<e-1)-1,i,o,s,a,u,c,f,h;function p(m){var b=mw(m),v=m-b;return v<.5?b:v>.5||b%2?b+1:b}for(r!==r?(o=(1<<e)-1,s=Ns(2,t-1),i=0):r===1/0||r===-1/0?(o=(1<<e)-1,s=0,i=r<0?1:0):r===0?(o=0,s=0,i=1/r===-1/0?1:0):(i=r<0,r=mG(r),r>=Ns(2,1-n)?(o=bG(mw(yG(r)/gG),1023),s=p(r/Ns(2,o)*Ns(2,t)),s/Ns(2,t)>=2&&(o=o+1,s=1),o>n?(o=(1<<e)-1,s=0):(o=o+n,s=s-Ns(2,t))):(o=0,s=p(r/Ns(2,1-n-t)))),c=[],u=t;u;u-=1)c.push(s%2?1:0),s=mw(s/2);for(u=e;u;u-=1)c.push(o%2?1:0),o=mw(o/2);for(c.push(i?1:0),c.reverse(),f=c.join(""),h=[];f.length;)h.push(parseInt(f.substring(0,8),2)),f=f.substring(8);return h}function HM(r,e,t){var n=[],i,o,s,a,u,c,f,h;for(i=r.length;i;i-=1)for(s=r[i-1],o=8;o;o-=1)n.push(s%2?1:0),s=s>>1;return n.reverse(),a=n.join(""),u=(1<<e-1)-1,c=parseInt(a.substring(0,1),2)?-1:1,f=parseInt(a.substring(1,1+e),2),h=parseInt(a.substring(1+e),2),f===(1<<e)-1?h!==0?NaN:c*(1/0):f>0?c*Ns(2,f-u)*(1+h/Ns(2,t)):h!==0?c*Ns(2,-(u-1))*(h/Ns(2,t)):c<0?-0:0}function kG(r){return HM(r,11,52)}function LG(r){return qM(r,11,52)}function PG(r){return HM(r,8,23)}function MG(r){return qM(r,8,23)}(function(){var r=function(m){if(m=vr.ToInt32(m),m<0)throw new RangeError("ArrayBuffer size is not a small enough positive integer");this.byteLength=m,this._bytes=[],this._bytes.length=m;var b;for(b=0;b<this.byteLength;b+=1)this._bytes[b]=0;PA(this)};bt.ArrayBuffer=bt.ArrayBuffer||r;var e=function(){};function t(p,m,b){var v;return v=function(w,y,_){var E,S,A,F;if(!arguments.length||typeof arguments[0]=="number"){if(this.length=vr.ToInt32(arguments[0]),_<0)throw new RangeError("ArrayBufferView size is not a small enough positive integer");this.byteLength=this.length*this.BYTES_PER_ELEMENT,this.buffer=new r(this.byteLength),this.byteOffset=0}else if(typeof arguments[0]=="object"&&arguments[0].constructor===v)for(E=arguments[0],this.length=E.length,this.byteLength=this.length*this.BYTES_PER_ELEMENT,this.buffer=new r(this.byteLength),this.byteOffset=0,A=0;A<this.length;A+=1)this._setter(A,E._getter(A));else if(typeof arguments[0]=="object"&&!(arguments[0]instanceof r||vr.Class(arguments[0])==="ArrayBuffer"))for(S=arguments[0],this.length=vr.ToUint32(S.length),this.byteLength=this.length*this.BYTES_PER_ELEMENT,this.buffer=new r(this.byteLength),this.byteOffset=0,A=0;A<this.length;A+=1)F=S[A],this._setter(A,Number(F));else if(typeof arguments[0]=="object"&&(arguments[0]instanceof r||vr.Class(arguments[0])==="ArrayBuffer")){if(this.buffer=w,this.byteOffset=vr.ToUint32(y),this.byteOffset>this.buffer.byteLength)throw new RangeError("byteOffset out of range");if(this.byteOffset%this.BYTES_PER_ELEMENT)throw new RangeError("ArrayBuffer length minus the byteOffset is not a multiple of the element size.");if(arguments.length<3){if(this.byteLength=this.buffer.byteLength-this.byteOffset,this.byteLength%this.BYTES_PER_ELEMENT)throw new RangeError("length of buffer minus byteOffset not a multiple of the element size");this.length=this.byteLength/this.BYTES_PER_ELEMENT}else this.length=vr.ToUint32(_),this.byteLength=this.length*this.BYTES_PER_ELEMENT;if(this.byteOffset+this.byteLength>this.buffer.byteLength)throw new RangeError("byteOffset and length reference an area beyond the end of the buffer")}else throw new TypeError("Unexpected argument type(s)");this.constructor=v,PA(this),vG(this)},v.prototype=new e,v.prototype.BYTES_PER_ELEMENT=p,v.prototype._pack=m,v.prototype._unpack=b,v.BYTES_PER_ELEMENT=p,v.prototype._getter=function(w){if(arguments.length<1)throw new SyntaxError("Not enough arguments");if(w=vr.ToUint32(w),w>=this.length)return $M;var y=[],_,E;for(_=0,E=this.byteOffset+w*this.BYTES_PER_ELEMENT;_<this.BYTES_PER_ELEMENT;_+=1,E+=1)y.push(this.buffer._bytes[E]);return this._unpack(y)},v.prototype.get=v.prototype._getter,v.prototype._setter=function(w,y){if(arguments.length<2)throw new SyntaxError("Not enough arguments");if(w=vr.ToUint32(w),w>=this.length)return $M;var _=this._pack(y),E,S;for(E=0,S=this.byteOffset+w*this.BYTES_PER_ELEMENT;E<this.BYTES_PER_ELEMENT;E+=1,S+=1)this.buffer._bytes[S]=_[E]},v.prototype.set=function(w,y){if(arguments.length<1)throw new SyntaxError("Not enough arguments");var _,E,S,A,F,D,H,J,K,ne;if(typeof arguments[0]=="object"&&arguments[0].constructor===this.constructor){if(_=arguments[0],S=vr.ToUint32(arguments[1]),S+_.length>this.length)throw new RangeError("Offset plus length of array is out of range");if(J=this.byteOffset+S*this.BYTES_PER_ELEMENT,K=_.length*this.BYTES_PER_ELEMENT,_.buffer===this.buffer){for(ne=[],F=0,D=_.byteOffset;F<K;F+=1,D+=1)ne[F]=_.buffer._bytes[D];for(F=0,H=J;F<K;F+=1,H+=1)this.buffer._bytes[H]=ne[F]}else for(F=0,D=_.byteOffset,H=J;F<K;F+=1,D+=1,H+=1)this.buffer._bytes[H]=_.buffer._bytes[D]}else if(typeof arguments[0]=="object"&&typeof arguments[0].length<"u"){if(E=arguments[0],A=vr.ToUint32(E.length),S=vr.ToUint32(arguments[1]),S+A>this.length)throw new RangeError("Offset plus length of array is out of range");for(F=0;F<A;F+=1)D=E[F],this._setter(S+F,Number(D))}else throw new TypeError("Unexpected argument type(s)")},v.prototype.subarray=function(w,y){function _(S,A,F){return S<A?A:S>F?F:S}w=vr.ToInt32(w),y=vr.ToInt32(y),arguments.length<1&&(w=0),arguments.length<2&&(y=this.length),w<0&&(w=this.length+w),y<0&&(y=this.length+y),w=_(w,0,this.length),y=_(y,0,this.length);var E=y-w;return E<0&&(E=0),new this.constructor(this.buffer,this.byteOffset+w*this.BYTES_PER_ELEMENT,E)},v}var n=t(1,_G,EG),i=t(1,AG,WM),o=t(1,xG,WM),s=t(2,SG,TG),a=t(2,CG,RG),u=t(4,DG,IG),c=t(4,OG,NG),f=t(4,MG,PG),h=t(8,LG,kG);bt.Int8Array=bt.Int8Array||n,bt.Uint8Array=bt.Uint8Array||i,bt.Uint8ClampedArray=bt.Uint8ClampedArray||o,bt.Int16Array=bt.Int16Array||s,bt.Uint16Array=bt.Uint16Array||a,bt.Int32Array=bt.Int32Array||u,bt.Uint32Array=bt.Uint32Array||c,bt.Float32Array=bt.Float32Array||f,bt.Float64Array=bt.Float64Array||h})();(function(){function r(o,s){return vr.IsCallable(o.get)?o.get(s):o[s]}var e=(function(){var o=new bt.Uint16Array([4660]),s=new bt.Uint8Array(o.buffer);return r(s,0)===18})(),t=function(s,a,u){if(arguments.length===0)s=new bt.ArrayBuffer(0);else if(!(s instanceof bt.ArrayBuffer||vr.Class(s)==="ArrayBuffer"))throw new TypeError("TypeError");if(this.buffer=s||new bt.ArrayBuffer(0),this.byteOffset=vr.ToUint32(a),this.byteOffset>this.buffer.byteLength)throw new RangeError("byteOffset out of range");if(arguments.length<3?this.byteLength=this.buffer.byteLength-this.byteOffset:this.byteLength=vr.ToUint32(u),this.byteOffset+this.byteLength>this.buffer.byteLength)throw new RangeError("byteOffset and length reference an area beyond the end of the buffer");PA(this)};function n(o){return function(s,a){if(s=vr.ToUint32(s),s+o.BYTES_PER_ELEMENT>this.byteLength)throw new RangeError("Array index out of range");s+=this.byteOffset;var u=new bt.Uint8Array(this.buffer,s,o.BYTES_PER_ELEMENT),c=[],f;for(f=0;f<o.BYTES_PER_ELEMENT;f+=1)c.push(r(u,f));return!!a==!!e&&c.reverse(),r(new o(new bt.Uint8Array(c).buffer),0)}}t.prototype.getUint8=n(bt.Uint8Array),t.prototype.getInt8=n(bt.Int8Array),t.prototype.getUint16=n(bt.Uint16Array),t.prototype.getInt16=n(bt.Int16Array),t.prototype.getUint32=n(bt.Uint32Array),t.prototype.getInt32=n(bt.Int32Array),t.prototype.getFloat32=n(bt.Float32Array),t.prototype.getFloat64=n(bt.Float64Array);function i(o){return function(s,a,u){if(s=vr.ToUint32(s),s+o.BYTES_PER_ELEMENT>this.byteLength)throw new RangeError("Array index out of range");var c=new o([a]),f=new bt.Uint8Array(c.buffer),h=[],p,m;for(p=0;p<o.BYTES_PER_ELEMENT;p+=1)h.push(r(f,p));!!u==!!e&&h.reverse(),m=new bt.Uint8Array(this.buffer,s,o.BYTES_PER_ELEMENT),m.set(h)}}t.prototype.setUint8=i(bt.Uint8Array),t.prototype.setInt8=i(bt.Int8Array),t.prototype.setUint16=i(bt.Uint16Array),t.prototype.setInt16=i(bt.Int16Array),t.prototype.setUint32=i(bt.Uint32Array),t.prototype.setInt32=i(bt.Int32Array),t.prototype.setFloat32=i(bt.Float32Array),t.prototype.setFloat64=i(bt.Float64Array),bt.DataView=bt.DataView||t})()});var KM=it((xre,XM)=>{Ce();De();Re();var VM=FM().Writable,BG=Ju(),Rg=jM();typeof Uint8Array>"u"?yw=GM().Uint8Array:yw=Uint8Array;var yw;function nc(r,e){if(!(this instanceof nc))return new nc(r,e);typeof r=="function"&&(e=r,r={}),r||(r={});var t=r.encoding,n=!1;t?(t=String(t).toLowerCase(),(t==="u8"||t==="uint8")&&(t="uint8array")):n=!0,VM.call(this,{objectMode:!0}),this.encoding=t,this.shouldInferEncoding=n,e&&this.on("finish",function(){e(this.getBody())}),this.body=[]}XM.exports=nc;BG(nc,VM);nc.prototype._write=function(r,e,t){this.body.push(r),t()};nc.prototype.inferEncoding=function(r){var e=r===void 0?this.body[0]:r;return Buffer.isBuffer(e)?"buffer":typeof Uint8Array<"u"&&e instanceof Uint8Array?"uint8array":Array.isArray(e)?"array":typeof e=="string"?"string":Object.prototype.toString.call(e)==="[object Object]"?"object":"buffer"};nc.prototype.getBody=function(){return!this.encoding&&this.body.length===0?[]:(this.shouldInferEncoding&&(this.encoding=this.inferEncoding()),this.encoding==="array"?$G(this.body):this.encoding==="string"?UG(this.body):this.encoding==="buffer"?jG(this.body):this.encoding==="uint8array"?zG(this.body):this.body)};function FG(r){return/Array\]$/.test(Object.prototype.toString.call(r))}function YM(r){return typeof r=="string"||FG(r)||r&&typeof r.subarray=="function"}function UG(r){for(var e=[],t=!1,n=0;n<r.length;n++){var i=r[n];typeof i=="string"||Buffer.isBuffer(i)?e.push(i):YM(i)?e.push(Rg(i)):e.push(Rg(String(i)))}return Buffer.isBuffer(r[0])?(e=Buffer.concat(e),e=e.toString("utf8")):e=e.join(""),e}function jG(r){for(var e=[],t=0;t<r.length;t++){var n=r[t];Buffer.isBuffer(n)?e.push(n):YM(n)?e.push(Rg(n)):e.push(Rg(String(n)))}return Buffer.concat(e)}function $G(r){for(var e=[],t=0;t<r.length;t++)e.push.apply(e,r[t]);return e}function zG(r){for(var e=0,t=0;t<r.length;t++)typeof r[t]=="string"&&(r[t]=Rg(r[t])),e+=r[t].length;for(var n=new yw(e),t=0,i=0;t<r.length;t++)for(var o=r[t],s=0;s<o.length;s++)n[i++]=o[s];return n}});var _3={};Uo(_3,{AbortException:()=>Ys,AnnotationEditorLayer:()=>$v,AnnotationEditorParamsType:()=>Mt,AnnotationEditorType:()=>vt,AnnotationEditorUIManager:()=>wu,AnnotationLayer:()=>Lv,AnnotationMode:()=>Ka,AnnotationType:()=>qr,CSSConstants:()=>cv,ColorPicker:()=>hm,DOMSVGFactory:()=>If,DrawLayer:()=>zv,FeatureTest:()=>Ur,GlobalWorkerOptions:()=>_s,ImageKind:()=>tm,InvalidPDFException:()=>yp,MathClamp:()=>Wn,OPS:()=>mp,OutputScale:()=>Bo,PDFDataRangeTransport:()=>fm,PDFDateString:()=>Cf,PDFWorker:()=>vp,PasswordResponses:()=>_B,PermissionFlag:()=>vB,PixelsPerInch:()=>el,RenderingCancelledException:()=>bp,ResponseException:()=>Rf,SignatureExtractor:()=>Es,SupportedImageMimeTypes:()=>uv,TextLayer:()=>wp,TouchManager:()=>lm,Util:()=>nt,VerbosityLevel:()=>u0,XfaLayer:()=>om,applyOpacity:()=>RB,build:()=>RF,createValidAbsoluteUrl:()=>vT,fetchData:()=>_p,findContrastColor:()=>DB,getDocument:()=>xF,getFilenameFromUrl:()=>SB,getPdfFilenameFromUrl:()=>TB,getRGB:()=>Ep,getUuid:()=>ET,getXfaPageViewport:()=>CB,isDataScheme:()=>f0,isPdfFile:()=>c_,isValidExplicitDest:()=>uF,noContextMenu:()=>Ki,normalizeUnicode:()=>AB,renderRichText:()=>AT,setLayerDimensions:()=>bu,shadow:()=>wt,stopEvent:()=>Cr,updateUrlHash:()=>_T,version:()=>CF});function qG(r){Number.isInteger(r)&&(l_=r)}function HG(){return l_}function u_(r){l_>=u0.INFOS&&console.info(`Info: ${r}`)}function _t(r){l_>=u0.WARNINGS&&console.warn(`Warning: ${r}`)}function dr(r){throw new Error(r)}function Bt(r,e){r||dr(e)}function GG(r){switch(r?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function vT(r,e=null,t=null){if(!r)return null;if(t&&typeof r=="string"&&(t.addDefaultProtocol&&r.startsWith("www.")&&r.match(/\./g)?.length>=2&&(r=`http://${r}`),t.tryConvertEncoding))try{r=KG(r)}catch{}let n=e?URL.parse(r,e):URL.parse(r);return GG(n)?n:null}function _T(r,e,t=!1){let n=URL.parse(r);return n?(n.hash=e,n.href):t&&vT(r,"http://example.com")?r.split("#",1)[0]+`${e?`#${e}`:""}`:""}function wt(r,e,t,n=!1){return Object.defineProperty(r,e,{value:t,enumerable:!n,configurable:!0,writable:!1}),t}function EB(r){(typeof r!="object"||r?.length===void 0)&&dr("Invalid argument for bytesToString");let e=r.length,t=8192;if(e<t)return String.fromCharCode.apply(null,r);let n=[];for(let i=0;i<e;i+=t){let o=Math.min(i+t,e),s=r.subarray(i,o);n.push(String.fromCharCode.apply(null,s))}return n.join("")}function c0(r){typeof r!="string"&&dr("Invalid argument for stringToBytes");let e=r.length,t=new Uint8Array(e);for(let n=0;n<e;++n)t[n]=r.charCodeAt(n)&255;return t}function VG(r){return String.fromCharCode(r>>24&255,r>>16&255,r>>8&255,r&255)}function YG(){let r=new Uint8Array(4);return r[0]=1,new Uint32Array(r.buffer,0,1)[0]===1}function XG(){try{return new Function(""),!0}catch{return!1}}function KG(r){return decodeURIComponent(escape(r))}function AB(r){return UA||(UA=/([\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,tB=new Map([["\uFB05","\u017Ft"]])),r.replaceAll(UA,(e,t,n)=>t?t.normalize("NFKC"):tB.get(n))}function ET(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();let r=new Uint8Array(32);return crypto.getRandomValues(r),EB(r)}function ZG(r,e,t){if(!Array.isArray(t)||t.length<2)return!1;let[n,i,...o]=t;if(!r(n)&&!Number.isInteger(n)||!e(i))return!1;let s=o.length,a=!0;switch(i.name){case"XYZ":if(s<2||s>3)return!1;break;case"Fit":case"FitB":return s===0;case"FitH":case"FitBH":case"FitV":case"FitBV":if(s>1)return!1;break;case"FitR":if(s!==4)return!1;a=!1;break;default:return!1}for(let u of o)if(!(typeof u=="number"||a&&u===null))return!1;return!0}function Wn(r,e,t){return Math.min(Math.max(r,e),t)}function xB(r){return Uint8Array.prototype.toBase64?r.toBase64():btoa(EB(r))}function JG(r){return Uint8Array.fromBase64?Uint8Array.fromBase64(r):c0(atob(r))}async function _p(r,e="text"){if(Lg(r,document.baseURI)){let t=await fetch(r);if(!t.ok)throw new Error(t.statusText);switch(e){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"json":return t.json()}return t.text()}return new Promise((t,n)=>{let i=new XMLHttpRequest;i.open("GET",r,!0),i.responseType=e,i.onreadystatechange=()=>{if(i.readyState===XMLHttpRequest.DONE){if(i.status===200||i.status===0){switch(e){case"arraybuffer":case"blob":case"json":t(i.response);return}t(i.responseText);return}n(new Error(i.statusText))}},i.send(null)})}function f0(r){let e=r.length,t=0;for(;t<e&&r[t].trim()==="";)t++;return r.substring(t,t+5).toLowerCase()==="data:"}function c_(r){return typeof r=="string"&&/\.pdf$/i.test(r)}function SB(r){return[r]=r.split(/[#?]/,1),r.substring(r.lastIndexOf("/")+1)}function TB(r,e="document.pdf"){if(typeof r!="string")return e;if(f0(r))return _t('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;let n=(a=>{try{return new URL(a)}catch{try{return new URL(decodeURIComponent(a))}catch{try{return new URL(a,"https://foo.bar")}catch{try{return new URL(decodeURIComponent(a),"https://foo.bar")}catch{return null}}}}})(r);if(!n)return e;let i=a=>{try{let u=decodeURIComponent(a);return u.includes("/")?(u=u.split("/").at(-1),u.test(/^\.pdf$/i)?u:a):u}catch{return a}},o=/\.pdf$/i,s=n.pathname.split("/").at(-1);if(o.test(s))return i(s);if(n.searchParams.size>0){let a=Array.from(n.searchParams.values()).reverse();for(let c of a)if(o.test(c))return i(c);let u=Array.from(n.searchParams.keys()).reverse();for(let c of u)if(o.test(c))return i(c)}if(n.hash){let u=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i.exec(n.hash);if(u)return i(u[0])}return e}function Lg(r,e){let t=e?URL.parse(r,e):URL.parse(r);return t?.protocol==="http:"||t?.protocol==="https:"}function Ki(r){r.preventDefault()}function Cr(r){r.preventDefault(),r.stopPropagation()}function QG(r){console.log("Deprecated API usage: "+r)}function CB(r,{scale:e=1,rotation:t=0}){let{width:n,height:i}=r.attributes.style,o=[0,0,parseInt(n),parseInt(i)];return new am({viewBox:o,userUnit:1,scale:e,rotation:t})}function Ep(r){if(r.startsWith("#")){let e=parseInt(r.slice(1),16);return[(e&16711680)>>16,(e&65280)>>8,e&255]}return r.startsWith("rgb(")?r.slice(4,-1).split(",").map(e=>parseInt(e)):r.startsWith("rgba(")?r.slice(5,-1).split(",").map(e=>parseInt(e)).slice(0,3):(_t(`Not a valid color format: "${r}"`),[0,0,0])}function eV(r){let e=document.createElement("span");e.style.visibility="hidden",e.style.colorScheme="only light",document.body.append(e);for(let t of r.keys()){e.style.color=t;let n=window.getComputedStyle(e).color;r.set(t,Ep(n))}e.remove()}function Tr(r){let{a:e,b:t,c:n,d:i,e:o,f:s}=r.getTransform();return[e,t,n,i,o,s]}function fo(r){let{a:e,b:t,c:n,d:i,e:o,f:s}=r.getTransform().invertSelf();return[e,t,n,i,o,s]}function bu(r,e,t=!1,n=!0){if(e instanceof am){let{pageWidth:i,pageHeight:o}=e.rawDims,{style:s}=r,a=Ur.isCSSRoundSupported,u=`var(--total-scale-factor) * ${i}px`,c=`var(--total-scale-factor) * ${o}px`,f=a?`round(down, ${u}, var(--scale-round-x))`:`calc(${u})`,h=a?`round(down, ${c}, var(--scale-round-y))`:`calc(${c})`;!t||e.rotation%180===0?(s.width=f,s.height=h):(s.width=h,s.height=f)}n&&r.setAttribute("data-main-rotation",e.rotation)}function RB(r,e,t,n){n=Math.min(Math.max(n??1,0),1);let i=255*(1-n);return r=Math.round(r*n+i),e=Math.round(e*n+i),t=Math.round(t*n+i),[r,e,t]}function rB(r,e){let t=r[0]/255,n=r[1]/255,i=r[2]/255,o=Math.max(t,n,i),s=Math.min(t,n,i),a=(o+s)/2;if(o===s)e[0]=e[1]=0;else{let u=o-s;switch(e[1]=a<.5?u/(o+s):u/(2-o-s),o){case t:e[0]=((n-i)/u+(n<i?6:0))*60;break;case n:e[0]=((i-t)/u+2)*60;break;case i:e[0]=((t-n)/u+4)*60;break}}e[2]=a}function XA(r,e){let t=r[0],n=r[1],i=r[2],o=(1-Math.abs(2*i-1))*n,s=o*(1-Math.abs(t/60%2-1)),a=i-o/2;switch(Math.floor(t/60)){case 0:e[0]=o+a,e[1]=s+a,e[2]=a;break;case 1:e[0]=s+a,e[1]=o+a,e[2]=a;break;case 2:e[0]=a,e[1]=o+a,e[2]=s+a;break;case 3:e[0]=a,e[1]=s+a,e[2]=o+a;break;case 4:e[0]=s+a,e[1]=a,e[2]=o+a;break;case 5:case 6:e[0]=o+a,e[1]=a,e[2]=s+a;break}}function nB(r){return r<=.03928?r/12.92:((r+.055)/1.055)**2.4}function iB(r,e,t){XA(r,t),t.map(nB);let n=.2126*t[0]+.7152*t[1]+.0722*t[2];XA(e,t),t.map(nB);let i=.2126*t[0]+.7152*t[1]+.0722*t[2];return n>i?(n+.05)/(i+.05):(i+.05)/(n+.05)}function DB(r,e){let t=r[0]+r[1]*256+r[2]*65536+e[0]*16777216+e[1]*4294967296+e[2]*1099511627776,n=sB.get(t);if(n)return n;let i=new Float32Array(9),o=i.subarray(0,3),s=i.subarray(3,6);rB(r,s);let a=i.subarray(6,9);rB(e,a);let u=a[2]<.5,c=u?12:4.5;if(s[2]=u?Math.sqrt(s[2]):1-Math.sqrt(1-s[2]),iB(s,a,o)<c){let f,h;u?(f=s[2],h=1):(f=0,h=s[2]);let p=.005;for(;h-f>p;){let m=s[2]=(f+h)/2;u===iB(s,a,o)<c?f=m:h=m}s[2]=u?h:f}return XA(s,o),n=nt.makeHexColor(Math.round(o[0]*255),Math.round(o[1]*255),Math.round(o[2]*255)),sB.set(t,n),n}function AT({html:r,dir:e,className:t},n){let i=document.createDocumentFragment();if(typeof r=="string"){let o=document.createElement("p");o.dir=e||"auto";let s=r.split(/(?:\r\n?|\n)/);for(let a=0,u=s.length;a<u;++a){let c=s[a];o.append(document.createTextNode(c)),a<u-1&&o.append(document.createElement("br"))}i.append(o)}else om.render({xfaHtml:r,div:i,intent:"richText"});i.firstElementChild.classList.add("richText",t),n.append(i)}function IB(r){let e=new Path2D;if(!r)return e;for(let t=0,n=r.length;t<n;)switch(r[t++]){case Dg.moveTo:e.moveTo(r[t++],r[t++]);break;case Dg.lineTo:e.lineTo(r[t++],r[t++]);break;case Dg.curveTo:e.bezierCurveTo(r[t++],r[t++],r[t++],r[t++],r[t++],r[t++]);break;case Dg.quadraticCurveTo:e.quadraticCurveTo(r[t++],r[t++],r[t++],r[t++]);break;case Dg.closePath:e.closePath();break;default:_t(`Unrecognized drawing path operator: ${r[t-1]}`);break}return e}function MB(r,e,t){for(let n of t)e.addEventListener(n,r[n].bind(r))}function tV(r){if(r instanceof URL)return r.href;if(typeof r=="string"){if(Qn)return r;let e=URL.parse(r,window.location);if(e)return e.href}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function rV(r){if(Qn&&typeof Buffer<"u"&&r instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(r instanceof Uint8Array&&r.byteLength===r.buffer.byteLength)return r;if(typeof r=="string")return c0(r);if(r instanceof ArrayBuffer||ArrayBuffer.isView(r)||typeof r=="object"&&!isNaN(r?.length))return new Uint8Array(r);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}function bw(r){if(typeof r!="string")return null;if(r.endsWith("/"))return r;throw new Error(`Invalid factory url: "${r}" must include trailing slash.`)}function aB(){}function hi(r){if(r instanceof Ys||r instanceof yp||r instanceof av||r instanceof Rf||r instanceof rm)return r;switch(r instanceof Error||typeof r=="object"&&r!==null||dr('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),r.name){case"AbortException":return new Ys(r.message);case"InvalidPDFException":return new yp(r.message);case"PasswordException":return new av(r.message,r.code);case"ResponseException":return new Rf(r.message,r.status,r.missing);case"UnknownErrorException":return new rm(r.message,r.details)}return new rm(r.message,r.toString())}async function xT(r){let t=await process.getBuiltinModule("fs").promises.readFile(r);return new Uint8Array(t)}function vw(r,e,t,n,i,o){r[e*4+0]=Math.min(r[e*4+0],t),r[e*4+1]=Math.min(r[e*4+1],n),r[e*4+2]=Math.max(r[e*4+2],i),r[e*4+3]=Math.max(r[e*4+3],o)}function Bx(r,e){if(!e)return;let t=e[2]-e[0],n=e[3]-e[1],i=new Path2D;i.rect(e[0],e[1],t,n),r.clip(i)}function jA(r,e,t,n,i,o,s,a){let u=e.coords,c=e.colors,f=r.data,h=r.width*4,p;u[t+1]>u[n+1]&&(p=t,t=n,n=p,p=o,o=s,s=p),u[n+1]>u[i+1]&&(p=n,n=i,i=p,p=s,s=a,a=p),u[t+1]>u[n+1]&&(p=t,t=n,n=p,p=o,o=s,s=p);let m=(u[t]+e.offsetX)*e.scaleX,b=(u[t+1]+e.offsetY)*e.scaleY,v=(u[n]+e.offsetX)*e.scaleX,w=(u[n+1]+e.offsetY)*e.scaleY,y=(u[i]+e.offsetX)*e.scaleX,_=(u[i+1]+e.offsetY)*e.scaleY;if(b>=_)return;let E=c[o],S=c[o+1],A=c[o+2],F=c[s],D=c[s+1],H=c[s+2],J=c[a],K=c[a+1],ne=c[a+2],k=Math.round(b),$=Math.round(_),Y,ie,re,N,x,P,C,j;for(let U=k;U<=$;U++){if(U<w){let te=U<b?0:(b-U)/(b-w);Y=m-(m-v)*te,ie=E-(E-F)*te,re=S-(S-D)*te,N=A-(A-H)*te}else{let te;U>_?te=1:w===_?te=0:te=(w-U)/(w-_),Y=v-(v-y)*te,ie=F-(F-J)*te,re=D-(D-K)*te,N=H-(H-ne)*te}let B;U<b?B=0:U>_?B=1:B=(b-U)/(b-_),x=m-(m-y)*B,P=E-(E-J)*B,C=S-(S-K)*B,j=A-(A-ne)*B;let Q=Math.round(Math.min(Y,x)),fe=Math.round(Math.max(Y,x)),_e=h*U+Q*4;for(let te=Q;te<=fe;te++)B=(Y-te)/(Y-x),B<0?B=0:B>1&&(B=1),f[_e++]=ie-(ie-P)*B|0,f[_e++]=re-(re-C)*B|0,f[_e++]=N-(N-j)*B|0,f[_e++]=255}}function iV(r,e,t){let n=e.coords,i=e.colors,o,s;switch(e.type){case HA.LATTICE:let a=e.verticesPerRow,u=Math.floor(n.length/a)-1,c=a-1;for(o=0;o<u;o++){let f=o*a;for(let h=0;h<c;h++,f++)jA(r,t,n[f],n[f+1],n[f+a],i[f],i[f+1],i[f+a]),jA(r,t,n[f+a+1],n[f+1],n[f+a],i[f+a+1],i[f+1],i[f+a])}break;case HA.TRIANGLES:for(o=0,s=n.length;o<s;o+=3)jA(r,t,n[o],n[o+1],n[o+2],i[o],i[o+1],i[o+2]);break;default:throw new Error("illegal figure")}}function sV(r){switch(r[0]){case"RadialAxial":return new Fx(r);case"Mesh":return new Ux(r);case"Dummy":return new jx}throw new Error(`Unknown IR type: ${r[0]}`)}function oV({src:r,srcPos:e=0,dest:t,width:n,height:i,nonBlackColor:o=4294967295,inverseDecode:s=!1}){let a=Ur.isLittleEndian?4278190080:255,[u,c]=s?[o,a]:[a,o],f=n>>3,h=n&7,p=r.length;t=new Uint32Array(t.buffer);let m=0;for(let b=0;b<i;b++){for(let w=e+f;e<w;e++){let y=e<p?r[e]:255;t[m++]=y&128?c:u,t[m++]=y&64?c:u,t[m++]=y&32?c:u,t[m++]=y&16?c:u,t[m++]=y&8?c:u,t[m++]=y&4?c:u,t[m++]=y&2?c:u,t[m++]=y&1?c:u}if(h===0)continue;let v=e<p?r[e++]:255;for(let w=0;w<h;w++)t[m++]=v&1<<7-w?c:u}return{srcPos:e,destPos:m}}function lV(r,e){if(r._removeMirroring)throw new Error("Context is already forwarding operations.");r.__originalSave=r.save,r.__originalRestore=r.restore,r.__originalRotate=r.rotate,r.__originalScale=r.scale,r.__originalTranslate=r.translate,r.__originalTransform=r.transform,r.__originalSetTransform=r.setTransform,r.__originalResetTransform=r.resetTransform,r.__originalClip=r.clip,r.__originalMoveTo=r.moveTo,r.__originalLineTo=r.lineTo,r.__originalBezierCurveTo=r.bezierCurveTo,r.__originalRect=r.rect,r.__originalClosePath=r.closePath,r.__originalBeginPath=r.beginPath,r._removeMirroring=()=>{r.save=r.__originalSave,r.restore=r.__originalRestore,r.rotate=r.__originalRotate,r.scale=r.__originalScale,r.translate=r.__originalTranslate,r.transform=r.__originalTransform,r.setTransform=r.__originalSetTransform,r.resetTransform=r.__originalResetTransform,r.clip=r.__originalClip,r.moveTo=r.__originalMoveTo,r.lineTo=r.__originalLineTo,r.bezierCurveTo=r.__originalBezierCurveTo,r.rect=r.__originalRect,r.closePath=r.__originalClosePath,r.beginPath=r.__originalBeginPath,delete r._removeMirroring},r.save=function(){e.save(),this.__originalSave()},r.restore=function(){e.restore(),this.__originalRestore()},r.translate=function(t,n){e.translate(t,n),this.__originalTranslate(t,n)},r.scale=function(t,n){e.scale(t,n),this.__originalScale(t,n)},r.transform=function(t,n,i,o,s,a){e.transform(t,n,i,o,s,a),this.__originalTransform(t,n,i,o,s,a)},r.setTransform=function(t,n,i,o,s,a){e.setTransform(t,n,i,o,s,a),this.__originalSetTransform(t,n,i,o,s,a)},r.resetTransform=function(){e.resetTransform(),this.__originalResetTransform()},r.rotate=function(t){e.rotate(t),this.__originalRotate(t)},r.clip=function(t){e.clip(t),this.__originalClip(t)},r.moveTo=function(t,n){e.moveTo(t,n),this.__originalMoveTo(t,n)},r.lineTo=function(t,n){e.lineTo(t,n),this.__originalLineTo(t,n)},r.bezierCurveTo=function(t,n,i,o,s,a){e.bezierCurveTo(t,n,i,o,s,a),this.__originalBezierCurveTo(t,n,i,o,s,a)},r.rect=function(t,n,i,o){e.rect(t,n,i,o),this.__originalRect(t,n,i,o)},r.closePath=function(){e.closePath(),this.__originalClosePath()},r.beginPath=function(){e.beginPath(),this.__originalBeginPath()}}function Ew(r,e,t,n,i,o,s,a,u,c){let[f,h,p,m,b,v]=Tr(r);if(h===0&&p===0){let _=s*f+b,E=Math.round(_),S=a*m+v,A=Math.round(S),F=(s+u)*f+b,D=Math.abs(Math.round(F)-E)||1,H=(a+c)*m+v,J=Math.abs(Math.round(H)-A)||1;return r.setTransform(Math.sign(f),0,0,Math.sign(m),E,A),r.drawImage(e,t,n,i,o,0,0,D,J),r.setTransform(f,h,p,m,b,v),[D,J]}if(f===0&&m===0){let _=a*p+b,E=Math.round(_),S=s*h+v,A=Math.round(S),F=(a+c)*p+b,D=Math.abs(Math.round(F)-E)||1,H=(s+u)*h+v,J=Math.abs(Math.round(H)-A)||1;return r.setTransform(0,Math.sign(h),Math.sign(p),0,E,A),r.drawImage(e,t,n,i,o,0,0,J,D),r.setTransform(f,h,p,m,b,v),[J,D]}r.drawImage(e,t,n,i,o,s,a,u,c);let w=Math.hypot(f,h),y=Math.hypot(p,m);return[w*u,y*c]}function pB(r,e){if(e instanceof ImageData){r.putImageData(e,0,0);return}let t=e.height,n=e.width,i=t%vi,o=(t-i)/vi,s=i===0?o:o+1,a=r.createImageData(n,vi),u=0,c,f=e.data,h=a.data,p,m,b,v;if(e.kind===tm.GRAYSCALE_1BPP){let w=f.byteLength,y=new Uint32Array(h.buffer,0,h.byteLength>>2),_=y.length,E=n+7>>3,S=4294967295,A=Ur.isLittleEndian?4278190080:255;for(p=0;p<s;p++){for(b=p<o?vi:i,c=0,m=0;m<b;m++){let F=w-u,D=0,H=F>E?n:F*8-7,J=H&-8,K=0,ne=0;for(;D<J;D+=8)ne=f[u++],y[c++]=ne&128?S:A,y[c++]=ne&64?S:A,y[c++]=ne&32?S:A,y[c++]=ne&16?S:A,y[c++]=ne&8?S:A,y[c++]=ne&4?S:A,y[c++]=ne&2?S:A,y[c++]=ne&1?S:A;for(;D<H;D++)K===0&&(ne=f[u++],K=128),y[c++]=ne&K?S:A,K>>=1}for(;c<_;)y[c++]=0;r.putImageData(a,0,p*vi)}}else if(e.kind===tm.RGBA_32BPP){for(m=0,v=n*vi*4,p=0;p<o;p++)h.set(f.subarray(u,u+v)),u+=v,r.putImageData(a,0,m),m+=vi;p<s&&(v=n*i*4,h.set(f.subarray(u,u+v)),r.putImageData(a,0,m))}else if(e.kind===tm.RGB_24BPP)for(b=vi,v=n*b,p=0;p<s;p++){for(p>=o&&(b=i,v=n*b),c=0,m=v;m--;)h[c++]=f[u++],h[c++]=f[u++],h[c++]=f[u++],h[c++]=255;r.putImageData(a,0,p*vi)}else throw new Error(`bad image kind: ${e.kind}`)}function gB(r,e){if(e.bitmap){r.drawImage(e.bitmap,0,0);return}let t=e.height,n=e.width,i=t%vi,o=(t-i)/vi,s=i===0?o:o+1,a=r.createImageData(n,vi),u=0,c=e.data,f=a.data;for(let h=0;h<s;h++){let p=h<o?vi:i;({srcPos:u}=oV({src:c,srcPos:u,dest:f,width:n,height:p,nonBlackColor:0})),r.putImageData(a,0,h*vi)}}function Ig(r,e){let t=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(let n of t)r[n]!==void 0&&(e[n]=r[n]);r.setLineDash!==void 0&&(e.setLineDash(r.getLineDash()),e.lineDashOffset=r.lineDashOffset)}function Aw(r){r.strokeStyle=r.fillStyle="#000000",r.fillRule="nonzero",r.globalAlpha=1,r.lineWidth=1,r.lineCap="butt",r.lineJoin="miter",r.miterLimit=10,r.globalCompositeOperation="source-over",r.font="10px sans-serif",r.setLineDash!==void 0&&(r.setLineDash([]),r.lineDashOffset=0);let{filter:e}=r;e!=="none"&&e!==""&&(r.filter="none")}function mB(r,e){if(e)return!0;nt.singularValueDecompose2dScale(r,Vi);let t=Math.fround(Bo.pixelRatio*el.PDF_TO_CSS_UNITS);return Vi[0]<=t&&Vi[1]<=t}function hV(r){let e=!0,t=n("filename\\*","i").exec(r);if(t){t=t[1];let f=a(t);return f=unescape(f),f=u(f),f=c(f),o(f)}if(t=s(r),t){let f=c(t);return o(f)}if(t=n("filename","i").exec(r),t){t=t[1];let f=a(t);return f=c(f),o(f)}function n(f,h){return new RegExp("(?:^|;)\\s*"+f+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',h)}function i(f,h){if(f){if(!/^[\x00-\xFF]+$/.test(h))return h;try{let p=new TextDecoder(f,{fatal:!0}),m=c0(h);h=p.decode(m),e=!1}catch{}}return h}function o(f){return e&&/[\x80-\xff]/.test(f)&&(f=i("utf-8",f),e&&(f=i("iso-8859-1",f))),f}function s(f){let h=[],p,m=n("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(p=m.exec(f))!==null;){let[,v,w,y]=p;if(v=parseInt(v,10),v in h){if(v===0)break;continue}h[v]=[w,y]}let b=[];for(let v=0;v<h.length&&v in h;++v){let[w,y]=h[v];y=a(y),w&&(y=unescape(y),v===0&&(y=u(y))),b.push(y)}return b.join("")}function a(f){if(f.startsWith('"')){let h=f.slice(1).split('\\"');for(let p=0;p<h.length;++p){let m=h[p].indexOf('"');m!==-1&&(h[p]=h[p].slice(0,m),h.length=p+1),h[p]=h[p].replaceAll(/\\(.)/g,"$1")}f=h.join('"')}return f}function u(f){let h=f.indexOf("'");if(h===-1)return f;let p=f.slice(0,h),b=f.slice(h+1).replace(/^[^']*'/,"");return i(p,b)}function c(f){return!f.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(f)?f:f.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(h,p,m,b){if(m==="q"||m==="Q")return b=b.replaceAll("_"," "),b=b.replaceAll(/=([0-9a-fA-F]{2})/g,function(v,w){return String.fromCharCode(parseInt(w,16))}),i(p,b);try{b=atob(b)}catch{}return i(p,b)})}return""}function pF(r,e){let t=new Headers;if(!r||!e||typeof e!="object")return t;for(let n in e){let i=e[n];i!==void 0&&t.append(n,i)}return t}function f_(r){return URL.parse(r)?.origin??null}function gF({responseHeaders:r,isHttp:e,rangeChunkSize:t,disableRange:n}){let i={allowRangeRequests:!1,suggestedLength:void 0},o=parseInt(r.get("Content-Length"),10);return!Number.isInteger(o)||(i.suggestedLength=o,o<=2*t)||n||!e||r.get("Accept-Ranges")!=="bytes"||(r.get("Content-Encoding")||"identity")!=="identity"||(i.allowRangeRequests=!0),i}function mF(r){let e=r.get("Content-Disposition");if(e){let t=hV(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch{}if(c_(t))return t}return null}function h0(r,e){return new Rf(`Unexpected server response (${r}) while retrieving PDF "${e}".`,r,r===404||r===0&&e.startsWith("file:"))}function yF(r){return r===200||r===206}function bF(r,e,t){return{method:"GET",headers:r,signal:t.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function wF(r){return r instanceof Uint8Array?r.buffer:r instanceof ArrayBuffer?r:(_t(`getArrayBuffer - unexpected data format: ${r}`),new Uint8Array(r).buffer)}function dV(r){let e=r.response;return typeof e!="string"?e:c0(e).buffer}function gV(r){if(pV.test(r))return new URL(r);let e=process.getBuiltinModule("url");return new URL(e.pathToFileURL(r))}function xF(r={}){typeof r=="string"||r instanceof URL?r={url:r}:(r instanceof ArrayBuffer||ArrayBuffer.isView(r))&&(r={data:r});let e=new hS,{docId:t}=e,n=r.url?tV(r.url):null,i=r.data?rV(r.data):null,o=r.httpHeaders||null,s=r.withCredentials===!0,a=r.password??null,u=r.range instanceof fm?r.range:null,c=Number.isInteger(r.rangeChunkSize)&&r.rangeChunkSize>0?r.rangeChunkSize:2**16,f=r.worker instanceof vp?r.worker:null,h=r.verbosity,p=typeof r.docBaseUrl=="string"&&!f0(r.docBaseUrl)?r.docBaseUrl:null,m=bw(r.cMapUrl),b=r.cMapPacked!==!1,v=r.CMapReaderFactory||(Qn?Ix:bv),w=bw(r.iccUrl),y=bw(r.standardFontDataUrl),_=r.StandardFontDataFactory||(Qn?Ox:_v),E=bw(r.wasmUrl),S=r.WasmFactory||(Qn?Nx:Av),A=r.stopAtErrors!==!0,F=Number.isInteger(r.maxImageSize)&&r.maxImageSize>-1?r.maxImageSize:-1,D=r.isEvalSupported!==!1,H=typeof r.isOffscreenCanvasSupported=="boolean"?r.isOffscreenCanvasSupported:!Qn,J=typeof r.isImageDecoderSupported=="boolean"?r.isImageDecoderSupported:!Qn&&(Ur.platform.isFirefox||!globalThis.chrome),K=Number.isInteger(r.canvasMaxAreaInBytes)?r.canvasMaxAreaInBytes:-1,ne=typeof r.disableFontFace=="boolean"?r.disableFontFace:Qn,k=r.fontExtraProperties===!0,$=r.enableXfa===!0,Y=r.ownerDocument||globalThis.document,ie=r.disableRange===!0,re=r.disableStream===!0,N=r.disableAutoFetch===!0,x=r.pdfBug===!0,P=r.CanvasFactory||(Qn?Dx:xx),C=r.FilterFactory||(Qn?Rx:Sx),j=r.enableHWA===!0,U=r.useWasm!==!1,B=u?u.length:r.length??NaN,Q=typeof r.useSystemFonts=="boolean"?r.useSystemFonts:!Qn&&!ne,fe=typeof r.useWorkerFetch=="boolean"?r.useWorkerFetch:!!(v===bv&&_===_v&&S===Av&&m&&y&&E&&Lg(m,document.baseURI)&&Lg(y,document.baseURI)&&Lg(E,document.baseURI)),_e=null;qG(h);let te={canvasFactory:new P({ownerDocument:Y,enableHWA:j}),filterFactory:new C({docId:t,ownerDocument:Y}),cMapReaderFactory:fe?null:new v({baseUrl:m,isCompressed:b}),standardFontDataFactory:fe?null:new _({baseUrl:y}),wasmFactory:fe?null:new S({baseUrl:E})};f||(f=vp.create({verbosity:h,port:_s.workerPort}),e._worker=f);let W={docId:t,apiVersion:"5.4.530",data:i,password:a,disableAutoFetch:N,rangeChunkSize:c,length:B,docBaseUrl:p,enableXfa:$,evaluatorOptions:{maxImageSize:F,disableFontFace:ne,ignoreErrors:A,isEvalSupported:D,isOffscreenCanvasSupported:H,isImageDecoderSupported:J,canvasMaxAreaInBytes:K,fontExtraProperties:k,useSystemFonts:Q,useWasm:U,useWorkerFetch:fe,cMapUrl:m,iccUrl:w,standardFontDataUrl:y,wasmUrl:E}},oe={ownerDocument:Y,pdfBug:x,styleElement:_e,loadingParams:{disableAutoFetch:N,enableXfa:$}};return f.promise.then(function(){if(e.destroyed)throw new Error("Loading aborted");if(f.destroyed)throw new Error("Worker was destroyed");let be=f.messageHandler.sendWithPromise("GetDocRequest",W,i?[i.buffer]:null),xe;if(u)xe=new Kx(u,{disableRange:ie,disableStream:re});else if(!i){if(!n)throw new Error("getDocument - no `url` parameter provided.");let X=Lg(n)?Qx:Qn?oS:nS;xe=new X({url:n,length:B,httpHeaders:o,withCredentials:s,rangeChunkSize:c,disableRange:ie,disableStream:re})}return be.then(X=>{if(e.destroyed)throw new Error("Loading aborted");if(f.destroyed)throw new Error("Worker was destroyed");let M=new cc(t,X,f.port),ae=new gS(M,e,xe,oe,te,j);e._transport=ae,M.send("Ready",null)})}).catch(e._capability.reject),e}function wB(r){return Math.floor(Math.max(0,Math.min(1,r))*255).toString(16).padStart(2,"0")}function Ng(r){return Math.max(0,Math.min(255,255*r))}var Tw,Qn,qA,Cw,WG,Jre,Gi,Ka,im,vt,Mt,vB,HA,on,tm,qr,Rh,u0,mp,Dg,_B,l_,kf,av,rm,yp,Rf,GA,Ys,Ur,FA,Za,Rw,VA,nt,UA,tB,Mh,sm,om,fa,ac,el,am,bp,lv,wm,Cf,Bo,uv,YA,cv,sB,Rl,Dl,us,cs,vm,Il,qh,Hh,_m,Wv,OB,On,NB,kB,Dh,Pg,pa,KA,Em,fc,ma,rl,LB,PB,JA,ZA,hc,dc,Gh,pc,tr,Bn,qv,QA,Vh,Am,Fn,Yh,Dw,ST,ex,Hr,Ol,xm,Sr,tx,Hv,BB,Df,Gv,rx,Xh,Ci,Kh,Lr,ln,Zh,fs,Jh,hs,Un,Nl,kl,Qh,Ll,go,ds,gc,Sm,Tm,ed,Cm,mo,Pl,td,Ml,yo,Vv,Bl,rd,Rm,Fl,mc,nd,Ul,Dm,Xr,Kt,ya,jl,$l,Im,id,Om,zl,bo,ba,Nm,km,ps,rt,Iw,nx,FB,UB,Mg,jB,$B,zB,ix,WB,qB,HB,GB,Yn,ha,VB,YB,sx,XB,Bg,ox,Uh,wu,gn,wo,Ps,sd,vo,Ri,od,_o,pi,wa,yc,Eo,Wl,Vs,Fg,Ow,Xn,fv,xn,gs,bc,gr,Lm,wc,Ms,vc,_c,Ec,Pm,ax,Bh,ad,Ac,Mm,Bm,Fm,Um,jm,va,xc,_a,Sc,Ea,vu,KB,ZB,JB,TT,lm,Tc,Bs,Er,cr,Aa,ld,ql,$m,Sn,Cc,xa,ms,Hl,zm,Rc,Di,Wm,Dc,Sa,Ao,ud,cd,ys,Ic,qm,Yv,mt,lx,Hm,ux,Nw,QB,eF,cx,kw,fx,tF,rF,nF,hx,iF,dx,sF,oF,aF,px,Ug,At,mr,gx,oB,as,ho,hv,mx,Oc,Nc,Ta,Tn,Xv,lF,um,Gm,dv,fd,yx,rr,bx,hd,dd,Vm,pd,Lw,jh,pv,Gl,xo,kc,Lc,jg,$h,gv,gd,md,yd,bd,Ii,So,Ym,nr,Fr,ks,Pw,$g,St,wx,Xm,Km,Zm,Jm,Qm,ey,ty,ry,pr,vx,wd,_x,Ex,nV,uF,Ca,Kv,Ax,ww,Yr,vd,xs,cF,fF,hF,Mw,cc,ny,mv,xx,yv,bv,wv,Pc,_d,Ra,Da,jn,Mc,Bc,lt,Mn,zg,Ih,Bw,Oh,dF,Tx,Nh,Wg,qg,Cx,Hg,Sx,vv,_v,Ev,Av,Rx,Dx,Ix,Ox,Nx,Ch,lB,uB,kx,Ed,Vl,Lx,_w,gi,mi,Fc,Fs,Uc,Ia,Zt,ir,Oa,yi,iy,Ad,jc,$c,Na,$n,To,sy,Mx,Px,fr,Pr,Us,xd,Sd,CT,xv,ls,Dn,cm,Fx,Ux,jx,cB,Zv,$x,fB,hB,aV,dB,vi,$A,Vi,Fh,zx,Sv,uV,cV,fV,yB,Xs,Wx,qx,Hx,RT,Wh,oy,ay,_s,Td,ly,Gx,kh,uy,cy,fy,Cd,Vx,Yl,sr,Rd,Dd,hy,Xx,Yx,Kx,Zx,Jx,Qx,eS,tS,zA,WA,rS,nS,iS,sS,pV,oS,aS,lS,Og,Oi,dy,uS,Tv,mV,bB,Xl,Ni,py,gy,zc,ka,my,yy,Wc,by,Id,Kl,Od,wy,Nd,qc,vy,_y,kd,Hc,Ey,Ld,Pd,nl,vF,_F,cS,Xi,Fw,fS,EF,AF,An,wp,yV,Jv,Qv,hS,Gc,Ay,xy,Sy,Ty,fm,dS,La,Vc,Gg,pS,Zl,js,Pa,Yc,e_,Xc,Kc,ei,Uw,SF,TF,Vg,Md,jw,_r,vp,Ma,Co,Bd,Fd,Ba,Zc,Yg,gS,Jl,mS,Ql,Jc,lc,yS,CF,RF,ki,Qc,Ud,un,Cy,jd,Fa,Ry,eu,$s,Dy,or,bS,wS,vS,ic,DF,Cl,di,hm,Ro,Iy,$d,Oy,uc,Cv,Rv,_S,If,bV,Of,wV,nm,ef,zd,bs,Ny,ES,DT,Rr,AS,Yi,sc,IF,OF,dm,xS,tl,SS,TS,CS,Dv,RS,DS,ky,IS,pm,Li,tu,t_,r_,Wd,qd,Mr,Do,ru,tf,Hd,Gd,Io,Pi,Ua,ja,Br,$a,nu,Ly,za,Vd,rf,iu,mn,su,Ct,$w,NS,kS,LS,zw,PS,NF,kF,LF,PF,Ww,qw,MS,OS,Iv,Py,BS,My,FS,By,US,Fy,Ov,jS,$S,Uy,nf,jy,zS,gm,Nv,WS,qS,HS,kv,$y,zy,VS,GS,sf,of,Yd,ou,Wy,af,Mi,qy,Ja,Hw,YS,IT,Lv,xw,Bi,Hy,lf,Fi,Kr,MF,BF,FF,Gw,Qa,Vw,Yw,UF,KS,jF,wr,XS,at,Ui,zs,Xd,Kd,Oo,Nt,uf,cf,Gy,Vy,Zd,Jd,au,Yy,n_,i_,cn,Xg,$F,zF,WF,qF,HF,GF,ga,Pv,Qd,ff,Wa,Xy,ji,Ky,Gr,s_,VF,Mv,Zy,Jy,Qy,lu,Ws,ti,YF,Xw,XF,KF,ZS,mm,e0,ep,JS,ym,QS,tp,t0,qa,hf,r0,bi,n0,i0,df,$i,zi,Cn,rp,np,zn,ip,ws,s0,Tt,eT,Kw,ZF,JF,QF,tT,oc,As,Lh,e3,Zw,Jw,t3,r3,n3,i3,s3,qt,Bv,pf,Fv,Wi,sp,yn,gf,mf,jt,rT,nT,iT,Kg,o3,Qw,Zg,Ph,Pt,Uv,No,bn,wn,yf,op,Kn,Rn,vs,bf,wf,vf,ap,ev,sT,Zn,o0,a0,qi,ko,Lo,lp,up,_f,In,da,a3,l3,u3,Nf,jv,o_,c3,zh,oT,bm,Sw,kg,Ef,Vt,aT,qs,f3,h3,lT,tv,d3,p3,g3,uT,cT,m3,Es,fT,hT,uu,Po,cu,Af,Ti,dT,Ar,vn,fu,Ha,hu,cp,Ga,xf,Mo,Hi,fp,$t,Qg,em,rv,nv,iv,pT,sv,y3,Jg,Sf,hp,du,pu,Va,wi,gu,dp,pp,Hs,Ya,_n,Xa,mu,gp,ft,yu,hr,gT,b3,po,mT,yT,ov,Ls,$v,Gs,Jn,Tf,l0,a_,w3,Fo,bT,v3,wT,an,zv,E3=Jt(()=>{Ce();De();Re();Tw={};Tw.d=(r,e)=>{for(var t in e)Tw.o(e,t)&&!Tw.o(r,t)&&Object.defineProperty(r,t,{enumerable:!0,get:e[t]})};Tw.o=(r,e)=>Object.prototype.hasOwnProperty.call(r,e);Qn=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser"),qA=[.001,0,0,.001,0,0],Cw=1.35,WG=.35,Jre=WG/Cw,Gi={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},Ka={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},im="pdfjs_internal_editor_",vt={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,POPUP:16,SIGNATURE:101,COMMENT:102},Mt={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_THICKNESS:32,HIGHLIGHT_FREE:33,HIGHLIGHT_SHOW_ALL:34,DRAW_STEP:41},vB={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},HA={TRIANGLES:1,LATTICE:2,PATCH:3},on={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},tm={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},qr={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},Rh={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},u0={ERRORS:0,WARNINGS:1,INFOS:5},mp={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,setStrokeTransparent:92,setFillTransparent:93,rawFillPath:94},Dg={moveTo:0,lineTo:1,curveTo:2,quadraticCurveTo:3,closePath:4},_B={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},l_=u0.WARNINGS;kf=(function(){function e(t,n){this.message=t,this.name=n}return e.prototype=new Error,e.constructor=e,e})(),av=class extends kf{constructor(e,t){super(e,"PasswordException"),this.code=t}},rm=class extends kf{constructor(e,t){super(e,"UnknownErrorException"),this.details=t}},yp=class extends kf{constructor(e){super(e,"InvalidPDFException")}},Rf=class extends kf{constructor(e,t,n){super(e,"ResponseException"),this.status=t,this.missing=n}},GA=class extends kf{constructor(e){super(e,"FormatError")}},Ys=class extends kf{constructor(e){super(e,"AbortException")}};Ur=class{static get isLittleEndian(){return wt(this,"isLittleEndian",YG())}static get isEvalSupported(){return wt(this,"isEvalSupported",XG())}static get isOffscreenCanvasSupported(){return wt(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get isImageDecoderSupported(){return wt(this,"isImageDecoderSupported",typeof ImageDecoder<"u")}static get isFloat16ArraySupported(){return wt(this,"isFloat16ArraySupported",typeof Float16Array<"u")}static get isSanitizerSupported(){return wt(this,"isSanitizerSupported",typeof Sanitizer<"u")}static get platform(){let{platform:e,userAgent:t}=navigator;return wt(this,"platform",{isAndroid:t.includes("Android"),isLinux:e.includes("Linux"),isMac:e.includes("Mac"),isWindows:e.includes("Win"),isFirefox:t.includes("Firefox")})}static get isCSSRoundSupported(){return wt(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}},FA=Array.from(Array(256).keys(),r=>r.toString(16).padStart(2,"0")),nt=class{static makeHexColor(e,t,n){return`#${FA[e]}${FA[t]}${FA[n]}`}static domMatrixToTransform(e){return[e.a,e.b,e.c,e.d,e.e,e.f]}static scaleMinMax(e,t){let n;e[0]?(e[0]<0&&(n=t[0],t[0]=t[2],t[2]=n),t[0]*=e[0],t[2]*=e[0],e[3]<0&&(n=t[1],t[1]=t[3],t[3]=n),t[1]*=e[3],t[3]*=e[3]):(n=t[0],t[0]=t[1],t[1]=n,n=t[2],t[2]=t[3],t[3]=n,e[1]<0&&(n=t[1],t[1]=t[3],t[3]=n),t[1]*=e[1],t[3]*=e[1],e[2]<0&&(n=t[0],t[0]=t[2],t[2]=n),t[0]*=e[2],t[2]*=e[2]),t[0]+=e[4],t[1]+=e[5],t[2]+=e[4],t[3]+=e[5]}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static multiplyByDOMMatrix(e,t){return[e[0]*t.a+e[2]*t.b,e[1]*t.a+e[3]*t.b,e[0]*t.c+e[2]*t.d,e[1]*t.c+e[3]*t.d,e[0]*t.e+e[2]*t.f+e[4],e[1]*t.e+e[3]*t.f+e[5]]}static applyTransform(e,t,n=0){let i=e[n],o=e[n+1];e[n]=i*t[0]+o*t[2]+t[4],e[n+1]=i*t[1]+o*t[3]+t[5]}static applyTransformToBezier(e,t,n=0){let i=t[0],o=t[1],s=t[2],a=t[3],u=t[4],c=t[5];for(let f=0;f<6;f+=2){let h=e[n+f],p=e[n+f+1];e[n+f]=h*i+p*s+u,e[n+f+1]=h*o+p*a+c}}static applyInverseTransform(e,t){let n=e[0],i=e[1],o=t[0]*t[3]-t[1]*t[2];e[0]=(n*t[3]-i*t[2]+t[2]*t[5]-t[4]*t[3])/o,e[1]=(-n*t[1]+i*t[0]+t[4]*t[1]-t[5]*t[0])/o}static axialAlignedBoundingBox(e,t,n){let i=t[0],o=t[1],s=t[2],a=t[3],u=t[4],c=t[5],f=e[0],h=e[1],p=e[2],m=e[3],b=i*f+u,v=b,w=i*p+u,y=w,_=a*h+c,E=_,S=a*m+c,A=S;if(o!==0||s!==0){let F=o*f,D=o*p,H=s*h,J=s*m;b+=H,y+=H,w+=J,v+=J,_+=F,A+=F,S+=D,E+=D}n[0]=Math.min(n[0],b,w,v,y),n[1]=Math.min(n[1],_,S,E,A),n[2]=Math.max(n[2],b,w,v,y),n[3]=Math.max(n[3],_,S,E,A)}static inverseTransform(e){let t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]}static singularValueDecompose2dScale(e,t){let n=e[0],i=e[1],o=e[2],s=e[3],a=n**2+i**2,u=n*o+i*s,c=o**2+s**2,f=(a+c)/2,h=Math.sqrt(f**2-(a*c-u**2));t[0]=Math.sqrt(f+h||1),t[1]=Math.sqrt(f-h||1)}static normalizeRect(e){let t=e.slice(0);return e[0]>e[2]&&(t[0]=e[2],t[2]=e[0]),e[1]>e[3]&&(t[1]=e[3],t[3]=e[1]),t}static intersect(e,t){let n=Math.max(Math.min(e[0],e[2]),Math.min(t[0],t[2])),i=Math.min(Math.max(e[0],e[2]),Math.max(t[0],t[2]));if(n>i)return null;let o=Math.max(Math.min(e[1],e[3]),Math.min(t[1],t[3])),s=Math.min(Math.max(e[1],e[3]),Math.max(t[1],t[3]));return o>s?null:[n,o,i,s]}static pointBoundingBox(e,t,n){n[0]=Math.min(n[0],e),n[1]=Math.min(n[1],t),n[2]=Math.max(n[2],e),n[3]=Math.max(n[3],t)}static rectBoundingBox(e,t,n,i,o){o[0]=Math.min(o[0],e,n),o[1]=Math.min(o[1],t,i),o[2]=Math.max(o[2],e,n),o[3]=Math.max(o[3],t,i)}static bezierBoundingBox(e,t,n,i,o,s,a,u,c){c[0]=Math.min(c[0],e,a),c[1]=Math.min(c[1],t,u),c[2]=Math.max(c[2],e,a),c[3]=Math.max(c[3],t,u),ee(this,Za,VA).call(this,e,n,o,a,t,i,s,u,3*(-e+3*(n-o)+a),6*(e-2*n+o),3*(n-e),c),ee(this,Za,VA).call(this,e,n,o,a,t,i,s,u,3*(-t+3*(i-s)+u),6*(t-2*i+s),3*(i-t),c)}};Za=new WeakSet,Rw=function(e,t,n,i,o,s,a,u,c,f){if(c<=0||c>=1)return;let h=1-c,p=c*c,m=p*c,b=h*(h*(h*e+3*c*t)+3*p*n)+m*i,v=h*(h*(h*o+3*c*s)+3*p*a)+m*u;f[0]=Math.min(f[0],b),f[1]=Math.min(f[1],v),f[2]=Math.max(f[2],b),f[3]=Math.max(f[3],v)},VA=function(e,t,n,i,o,s,a,u,c,f,h,p){if(Math.abs(c)<1e-12){Math.abs(f)>=1e-12&&ee(this,Za,Rw).call(this,e,t,n,i,o,s,a,u,-h/f,p);return}let m=f**2-4*h*c;if(m<0)return;let b=Math.sqrt(m),v=2*c;ee(this,Za,Rw).call(this,e,t,n,i,o,s,a,u,(-f+b)/v,p),ee(this,Za,Rw).call(this,e,t,n,i,o,s,a,u,(-f-b)/v,p)},q(nt,Za);UA=null,tB=null;Mh="pdfjs_internal_id_";typeof Promise.try!="function"&&(Promise.try=function(r,...e){return new Promise(t=>{t(r(...e))})});typeof Math.sumPrecise!="function"&&(Math.sumPrecise=function(r){return r.reduce((e,t)=>e+t,0)});sm=class r{static textContent(e){let t=[],n={items:t,styles:Object.create(null)};function i(o){if(!o)return;let s=null,a=o.name;if(a==="#text")s=o.value;else if(r.shouldBuildText(a))o?.attributes?.textContent?s=o.attributes.textContent:o.value&&(s=o.value);else return;if(s!==null&&t.push({str:s}),!!o.children)for(let u of o.children)i(u)}return i(e),n}static shouldBuildText(e){return!(e==="textarea"||e==="input"||e==="option"||e==="select")}},om=class{static setupStorage(e,t,n,i,o){let s=i.getValue(t,{value:null});switch(n.name){case"textarea":if(s.value!==null&&(e.textContent=s.value),o==="print")break;e.addEventListener("input",a=>{i.setValue(t,{value:a.target.value})});break;case"input":if(n.attributes.type==="radio"||n.attributes.type==="checkbox"){if(s.value===n.attributes.xfaOn?e.setAttribute("checked",!0):s.value===n.attributes.xfaOff&&e.removeAttribute("checked"),o==="print")break;e.addEventListener("change",a=>{i.setValue(t,{value:a.target.checked?a.target.getAttribute("xfaOn"):a.target.getAttribute("xfaOff")})})}else{if(s.value!==null&&e.setAttribute("value",s.value),o==="print")break;e.addEventListener("input",a=>{i.setValue(t,{value:a.target.value})})}break;case"select":if(s.value!==null){e.setAttribute("value",s.value);for(let a of n.children)a.attributes.value===s.value?a.attributes.selected=!0:a.attributes.hasOwnProperty("selected")&&delete a.attributes.selected}e.addEventListener("input",a=>{let u=a.target.options,c=u.selectedIndex===-1?"":u[u.selectedIndex].value;i.setValue(t,{value:c})});break}}static setAttributes({html:e,element:t,storage:n=null,intent:i,linkService:o}){let{attributes:s}=t,a=e instanceof HTMLAnchorElement;s.type==="radio"&&(s.name=`${s.name}-${i}`);for(let[u,c]of Object.entries(s))if(c!=null)switch(u){case"class":c.length&&e.setAttribute(u,c.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",c);break;case"style":Object.assign(e.style,c);break;case"textContent":e.textContent=c;break;default:(!a||u!=="href"&&u!=="newWindow")&&e.setAttribute(u,c)}a&&o.addLinkAttributes(e,s.href,s.newWindow),n&&s.dataId&&this.setupStorage(e,s.dataId,t,n)}static render(e){let t=e.annotationStorage,n=e.linkService,i=e.xfaHtml,o=e.intent||"display",s=document.createElement(i.name);i.attributes&&this.setAttributes({html:s,element:i,intent:o,linkService:n});let a=o!=="richText",u=e.div;if(u.append(s),e.viewport){let h=`matrix(${e.viewport.transform.join(",")})`;u.style.transform=h}a&&u.setAttribute("class","xfaLayer xfaFont");let c=[];if(i.children.length===0){if(i.value){let h=document.createTextNode(i.value);s.append(h),a&&sm.shouldBuildText(i.name)&&c.push(h)}return{textDivs:c}}let f=[[i,-1,s]];for(;f.length>0;){let[h,p,m]=f.at(-1);if(p+1===h.children.length){f.pop();continue}let b=h.children[++f.at(-1)[1]];if(b===null)continue;let{name:v}=b;if(v==="#text"){let y=document.createTextNode(b.value);c.push(y),m.append(y);continue}let w=b?.attributes?.xmlns?document.createElementNS(b.attributes.xmlns,v):document.createElement(v);if(m.append(w),b.attributes&&this.setAttributes({html:w,element:b,storage:t,intent:o,linkService:n}),b.children?.length>0)f.push([b,-1,w]);else if(b.value){let y=document.createTextNode(b.value);a&&sm.shouldBuildText(v)&&c.push(y),w.append(y)}}for(let h of u.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))h.setAttribute("readOnly",!0);return{textDivs:c}}static update(e){let t=`matrix(${e.viewport.transform.join(",")})`;e.div.style.transform=t,e.div.hidden=!1}},fa="http://www.w3.org/2000/svg",ac=class ac{};Ke(ac,"CSS",96),Ke(ac,"PDF",72),Ke(ac,"PDF_TO_CSS_UNITS",ac.CSS/ac.PDF);el=ac;am=class r{constructor({viewBox:e,userUnit:t,scale:n,rotation:i,offsetX:o=0,offsetY:s=0,dontFlip:a=!1}){this.viewBox=e,this.userUnit=t,this.scale=n,this.rotation=i,this.offsetX=o,this.offsetY=s,n*=t;let u=(e[2]+e[0])/2,c=(e[3]+e[1])/2,f,h,p,m;switch(i%=360,i<0&&(i+=360),i){case 180:f=-1,h=0,p=0,m=1;break;case 90:f=0,h=1,p=1,m=0;break;case 270:f=0,h=-1,p=-1,m=0;break;case 0:f=1,h=0,p=0,m=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}a&&(p=-p,m=-m);let b,v,w,y;f===0?(b=Math.abs(c-e[1])*n+o,v=Math.abs(u-e[0])*n+s,w=(e[3]-e[1])*n,y=(e[2]-e[0])*n):(b=Math.abs(u-e[0])*n+o,v=Math.abs(c-e[1])*n+s,w=(e[2]-e[0])*n,y=(e[3]-e[1])*n),this.transform=[f*n,h*n,p*n,m*n,b-f*n*u-p*n*c,v-h*n*u-m*n*c],this.width=w,this.height=y}get rawDims(){let e=this.viewBox;return wt(this,"rawDims",{pageWidth:e[2]-e[0],pageHeight:e[3]-e[1],pageX:e[0],pageY:e[1]})}clone({scale:e=this.scale,rotation:t=this.rotation,offsetX:n=this.offsetX,offsetY:i=this.offsetY,dontFlip:o=!1}={}){return new r({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:e,rotation:t,offsetX:n,offsetY:i,dontFlip:o})}convertToViewportPoint(e,t){let n=[e,t];return nt.applyTransform(n,this.transform),n}convertToViewportRectangle(e){let t=[e[0],e[1]];nt.applyTransform(t,this.transform);let n=[e[2],e[3]];return nt.applyTransform(n,this.transform),[t[0],t[1],n[0],n[1]]}convertToPdfPoint(e,t){let n=[e,t];return nt.applyInverseTransform(n,this.transform),n}},bp=class extends kf{constructor(e,t=0){super(e,"RenderingCancelledException"),this.extraDelay=t}};lv=class{constructor(){Ke(this,"started",Object.create(null));Ke(this,"times",[])}time(e){e in this.started&&_t(`Timer is already running for ${e}`),this.started[e]=Date.now()}timeEnd(e){e in this.started||_t(`Timer has not been started for ${e}`),this.times.push({name:e,start:this.started[e],end:Date.now()}),delete this.started[e]}toString(){let e=[],t=0;for(let{name:n}of this.times)t=Math.max(n.length,t);for(let{name:n,start:i,end:o}of this.times)e.push(`${n.padEnd(t)} ${o-i}ms
94
+ `);return e.join("")}};Cf=class{static toDateObject(e){if(e instanceof Date)return e;if(!e||typeof e!="string")return null;l(this,wm)||L(this,wm,new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));let t=l(this,wm).exec(e);if(!t)return null;let n=parseInt(t[1],10),i=parseInt(t[2],10);i=i>=1&&i<=12?i-1:0;let o=parseInt(t[3],10);o=o>=1&&o<=31?o:1;let s=parseInt(t[4],10);s=s>=0&&s<=23?s:0;let a=parseInt(t[5],10);a=a>=0&&a<=59?a:0;let u=parseInt(t[6],10);u=u>=0&&u<=59?u:0;let c=t[7]||"Z",f=parseInt(t[8],10);f=f>=0&&f<=23?f:0;let h=parseInt(t[9],10)||0;return h=h>=0&&h<=59?h:0,c==="-"?(s+=f,a+=h):c==="+"&&(s-=f,a-=h),new Date(Date.UTC(n,i,o,s,a,u))}};wm=new WeakMap,q(Cf,wm);Bo=class r{constructor(){let{pixelRatio:e}=r;this.sx=e,this.sy=e}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}limitCanvas(e,t,n,i,o=-1){let s=1/0,a=1/0,u=1/0;n=r.capPixels(n,o),n>0&&(s=Math.sqrt(n/(e*t))),i!==-1&&(a=i/e,u=i/t);let c=Math.min(s,a,u);return this.sx>c||this.sy>c?(this.sx=c,this.sy=c,!0):!1}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(e,t){if(t>=0){let n=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+t/100));return e>0?Math.min(e,n):n}return e}},uv=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"],YA=class{static get isDarkMode(){return wt(this,"isDarkMode",!!window?.matchMedia?.("(prefers-color-scheme: dark)").matches)}},cv=class{static get commentForegroundColor(){let e=document.createElement("span");e.classList.add("comment","sidebar");let{style:t}=e;t.width=t.height="0",t.display="none",t.color="var(--comment-fg-color)",document.body.append(e);let{color:n}=window.getComputedStyle(e);return e.remove(),wt(this,"commentForegroundColor",Ep(n))}};sB=new Map;pa=class pa{constructor(e){q(this,On);q(this,Rl,null);q(this,Dl,null);q(this,us);q(this,cs,null);q(this,vm,null);q(this,Il,null);q(this,qh,null);q(this,Hh,null);L(this,us,e),l(pa,_m)||L(pa,_m,Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button",signature:"pdfjs-editor-remove-signature-button"}))}render(){let e=L(this,Rl,document.createElement("div"));e.classList.add("editToolbar","hidden"),e.setAttribute("role","toolbar");let t=l(this,us)._uiManager._signal;t instanceof AbortSignal&&!t.aborted&&(e.addEventListener("contextmenu",Ki,{signal:t}),e.addEventListener("pointerdown",ee(pa,Wv,OB),{signal:t}));let n=L(this,cs,document.createElement("div"));n.className="buttons",e.append(n);let i=l(this,us).toolbarPosition;if(i){let{style:o}=e,s=l(this,us)._uiManager.direction==="ltr"?1-i[0]:i[0];o.insetInlineEnd=`${100*s}%`,o.top=`calc(${100*i[1]}% + var(--editor-toolbar-vert-offset))`}return e}get div(){return l(this,Rl)}hide(){l(this,Rl).classList.add("hidden"),l(this,Dl)?.hideDropdown()}show(){l(this,Rl).classList.remove("hidden"),l(this,vm)?.shown(),l(this,Il)?.shown()}addDeleteButton(){let{editorType:e,_uiManager:t}=l(this,us),n=document.createElement("button");n.classList.add("basic","deleteButton"),n.tabIndex=0,n.setAttribute("data-l10n-id",l(pa,_m)[e]),ee(this,On,Dh).call(this,n)&&n.addEventListener("click",i=>{t.delete()},{signal:t._signal}),l(this,cs).append(n)}async addAltText(e){let t=await e.render();ee(this,On,Dh).call(this,t),l(this,cs).append(t,l(this,On,Pg)),L(this,vm,e)}addComment(e,t=null){if(l(this,Il))return;let n=e.renderForToolbar();if(!n)return;ee(this,On,Dh).call(this,n);let i=L(this,qh,l(this,On,Pg));t?(l(this,cs).insertBefore(n,t),l(this,cs).insertBefore(i,t)):l(this,cs).append(n,i),L(this,Il,e),e.toolbar=this}addColorPicker(e){if(l(this,Dl))return;L(this,Dl,e);let t=e.renderButton();ee(this,On,Dh).call(this,t),l(this,cs).append(t,l(this,On,Pg))}async addEditSignatureButton(e){let t=L(this,Hh,await e.renderEditButton(l(this,us)));ee(this,On,Dh).call(this,t),l(this,cs).append(t,l(this,On,Pg))}removeButton(e){switch(e){case"comment":l(this,Il)?.removeToolbarCommentButton(),L(this,Il,null),l(this,qh)?.remove(),L(this,qh,null);break}}async addButton(e,t){switch(e){case"colorPicker":t&&this.addColorPicker(t);break;case"altText":t&&await this.addAltText(t);break;case"editSignature":t&&await this.addEditSignatureButton(t);break;case"delete":this.addDeleteButton();break;case"comment":t&&this.addComment(t);break}}async addButtonBefore(e,t,n){if(!t&&e==="comment")return;let i=l(this,cs).querySelector(n);i&&e==="comment"&&this.addComment(t,i)}updateEditSignatureButton(e){l(this,Hh)&&(l(this,Hh).title=e)}remove(){l(this,Rl).remove(),l(this,Dl)?.destroy(),L(this,Dl,null)}};Rl=new WeakMap,Dl=new WeakMap,us=new WeakMap,cs=new WeakMap,vm=new WeakMap,Il=new WeakMap,qh=new WeakMap,Hh=new WeakMap,_m=new WeakMap,Wv=new WeakSet,OB=function(e){e.stopPropagation()},On=new WeakSet,NB=function(e){l(this,us)._focusEventsAllowed=!1,Cr(e)},kB=function(e){l(this,us)._focusEventsAllowed=!0,Cr(e)},Dh=function(e){let t=l(this,us)._uiManager._signal;return!(t instanceof AbortSignal)||t.aborted?!1:(e.addEventListener("focusin",ee(this,On,NB).bind(this),{capture:!0,signal:t}),e.addEventListener("focusout",ee(this,On,kB).bind(this),{capture:!0,signal:t}),e.addEventListener("contextmenu",Ki,{signal:t}),!0)},Pg=function(){let e=document.createElement("div");return e.className="divider",e},q(pa,Wv),q(pa,_m,null);KA=pa,ZA=class{constructor(e){q(this,rl);q(this,Em,null);q(this,fc,null);q(this,ma);L(this,ma,e)}show(e,t,n){let[i,o]=ee(this,rl,PB).call(this,t,n),{style:s}=l(this,fc)||L(this,fc,ee(this,rl,LB).call(this));e.append(l(this,fc)),s.insetInlineEnd=`${100*i}%`,s.top=`calc(${100*o}% + var(--editor-toolbar-vert-offset))`}hide(){l(this,fc).remove()}};Em=new WeakMap,fc=new WeakMap,ma=new WeakMap,rl=new WeakSet,LB=function(){let e=L(this,fc,document.createElement("div"));e.className="editToolbar",e.setAttribute("role","toolbar");let t=l(this,ma)._signal;t instanceof AbortSignal&&!t.aborted&&e.addEventListener("contextmenu",Ki,{signal:t});let n=L(this,Em,document.createElement("div"));return n.className="buttons",e.append(n),l(this,ma).hasCommentManager()&&ee(this,rl,JA).call(this,"commentButton","pdfjs-comment-floating-button","pdfjs-comment-floating-button-label",()=>{l(this,ma).commentSelection("floating_button")}),ee(this,rl,JA).call(this,"highlightButton","pdfjs-highlight-floating-button1","pdfjs-highlight-floating-button-label",()=>{l(this,ma).highlightSelection("floating_button")}),e},PB=function(e,t){let n=0,i=0;for(let o of e){let s=o.y+o.height;if(s<n)continue;let a=o.x+(t?o.width:0);if(s>n){i=a,n=s;continue}t?a>i&&(i=a):a<i&&(i=a)}return[t?1-i:i,n]},JA=function(e,t,n,i){let o=document.createElement("button");o.classList.add("basic",e),o.tabIndex=0,o.setAttribute("data-l10n-id",t);let s=document.createElement("span");o.append(s),s.className="visuallyHidden",s.setAttribute("data-l10n-id",n);let a=l(this,ma)._signal;a instanceof AbortSignal&&!a.aborted&&(o.addEventListener("contextmenu",Ki,{signal:a}),o.addEventListener("click",i,{signal:a})),l(this,Em).append(o)};tr=class tr{static initializeAndAddPointerId(e){(l(tr,dc)||L(tr,dc,new Set)).add(e)}static setPointer(e,t){l(tr,hc)||L(tr,hc,t),l(tr,pc)??L(tr,pc,e)}static setTimeStamp(e){L(tr,Gh,e)}static isSamePointerId(e){return l(tr,hc)===e}static isSamePointerIdOrRemove(e){return l(tr,hc)===e?!0:(l(tr,dc)?.delete(e),!1)}static isSamePointerType(e){return l(tr,pc)===e}static isInitializedAndDifferentPointerType(e){return l(tr,pc)!==null&&!tr.isSamePointerType(e)}static isSameTimeStamp(e){return l(tr,Gh)===e}static isUsingMultiplePointers(){return l(tr,dc)?.size>=1}static clearPointerType(){L(tr,pc,null)}static clearPointerIds(){L(tr,hc,NaN),L(tr,dc,null)}static clearTimeStamp(){L(tr,Gh,NaN)}};hc=new WeakMap,dc=new WeakMap,Gh=new WeakMap,pc=new WeakMap,q(tr,hc,NaN),q(tr,dc,null),q(tr,Gh,NaN),q(tr,pc,null);Bn=tr,QA=class{constructor(){q(this,qv,0)}get id(){return`${im}${tn(this,qv)._++}`}};qv=new WeakMap;ST=class ST{constructor(){q(this,Yh);q(this,Vh,ET());q(this,Am,0);q(this,Fn,null)}static get _isSVGFittingCanvas(){let e='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>',n=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),i=new Image;i.src=e;let o=i.decode().then(()=>(n.drawImage(i,0,0,1,1,0,0,1,3),new Uint32Array(n.getImageData(0,0,1,1).data.buffer)[0]===0));return wt(this,"_isSVGFittingCanvas",o)}async getFromFile(e){let{lastModified:t,name:n,size:i,type:o}=e;return ee(this,Yh,Dw).call(this,`${t}_${n}_${i}_${o}`,e)}async getFromUrl(e){return ee(this,Yh,Dw).call(this,e,e)}async getFromBlob(e,t){let n=await t;return ee(this,Yh,Dw).call(this,e,n)}async getFromId(e){l(this,Fn)||L(this,Fn,new Map);let t=l(this,Fn).get(e);if(!t)return null;if(t.bitmap)return t.refCounter+=1,t;if(t.file)return this.getFromFile(t.file);if(t.blobPromise){let{blobPromise:n}=t;return delete t.blobPromise,this.getFromBlob(t.id,n)}return this.getFromUrl(t.url)}getFromCanvas(e,t){l(this,Fn)||L(this,Fn,new Map);let n=l(this,Fn).get(e);if(n?.bitmap)return n.refCounter+=1,n;let i=new OffscreenCanvas(t.width,t.height);return i.getContext("2d").drawImage(t,0,0),n={bitmap:i.transferToImageBitmap(),id:`image_${l(this,Vh)}_${tn(this,Am)._++}`,refCounter:1,isSvg:!1},l(this,Fn).set(e,n),l(this,Fn).set(n.id,n),n}getSvgUrl(e){let t=l(this,Fn).get(e);return t?.isSvg?t.svgUrl:null}deleteId(e){l(this,Fn)||L(this,Fn,new Map);let t=l(this,Fn).get(e);if(!t||(t.refCounter-=1,t.refCounter!==0))return;let{bitmap:n}=t;if(!t.url&&!t.file){let i=new OffscreenCanvas(n.width,n.height);i.getContext("bitmaprenderer").transferFromImageBitmap(n),t.blobPromise=i.convertToBlob()}n.close?.(),t.bitmap=null}isValidId(e){return e.startsWith(`image_${l(this,Vh)}_`)}};Vh=new WeakMap,Am=new WeakMap,Fn=new WeakMap,Yh=new WeakSet,Dw=async function(e,t){l(this,Fn)||L(this,Fn,new Map);let n=l(this,Fn).get(e);if(n===null)return null;if(n?.bitmap)return n.refCounter+=1,n;try{n||(n={bitmap:null,id:`image_${l(this,Vh)}_${tn(this,Am)._++}`,refCounter:0,isSvg:!1});let i;if(typeof t=="string"?(n.url=t,i=await _p(t,"blob")):t instanceof File?i=n.file=t:t instanceof Blob&&(i=t),i.type==="image/svg+xml"){let o=ST._isSVGFittingCanvas,s=new FileReader,a=new Image,u=new Promise((c,f)=>{a.onload=()=>{n.bitmap=a,n.isSvg=!0,c()},s.onload=async()=>{let h=n.svgUrl=s.result;a.src=await o?`${h}#svgView(preserveAspectRatio(none))`:h},a.onerror=s.onerror=f});s.readAsDataURL(i),await u}else n.bitmap=await createImageBitmap(i);n.refCounter=1}catch(i){_t(i),n=null}return l(this,Fn).set(e,n),n&&l(this,Fn).set(n.id,n),n};ex=ST,tx=class{constructor(e=128){q(this,Hr,[]);q(this,Ol,!1);q(this,xm);q(this,Sr,-1);L(this,xm,e)}add({cmd:e,undo:t,post:n,mustExec:i,type:o=NaN,overwriteIfSameType:s=!1,keepUndo:a=!1}){if(i&&e(),l(this,Ol))return;let u={cmd:e,undo:t,post:n,type:o};if(l(this,Sr)===-1){l(this,Hr).length>0&&(l(this,Hr).length=0),L(this,Sr,0),l(this,Hr).push(u);return}if(s&&l(this,Hr)[l(this,Sr)].type===o){a&&(u.undo=l(this,Hr)[l(this,Sr)].undo),l(this,Hr)[l(this,Sr)]=u;return}let c=l(this,Sr)+1;c===l(this,xm)?l(this,Hr).splice(0,1):(L(this,Sr,c),c<l(this,Hr).length&&l(this,Hr).splice(c)),l(this,Hr).push(u)}undo(){if(l(this,Sr)===-1)return;L(this,Ol,!0);let{undo:e,post:t}=l(this,Hr)[l(this,Sr)];e(),t?.(),L(this,Ol,!1),L(this,Sr,l(this,Sr)-1)}redo(){if(l(this,Sr)<l(this,Hr).length-1){L(this,Sr,l(this,Sr)+1),L(this,Ol,!0);let{cmd:e,post:t}=l(this,Hr)[l(this,Sr)];e(),t?.(),L(this,Ol,!1)}}hasSomethingToUndo(){return l(this,Sr)!==-1}hasSomethingToRedo(){return l(this,Sr)<l(this,Hr).length-1}cleanType(e){if(l(this,Sr)!==-1){for(let t=l(this,Sr);t>=0;t--)if(l(this,Hr)[t].type!==e){l(this,Hr).splice(t+1,l(this,Sr)-t),L(this,Sr,t);return}l(this,Hr).length=0,L(this,Sr,-1)}}destroy(){L(this,Hr,null)}};Hr=new WeakMap,Ol=new WeakMap,xm=new WeakMap,Sr=new WeakMap;Df=class{constructor(e){q(this,Hv);this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;let{isMac:t}=Ur.platform;for(let[n,i,o={}]of e)for(let s of n){let a=s.startsWith("mac+");t&&a?(this.callbacks.set(s.slice(4),{callback:i,options:o}),this.allKeys.add(s.split("+").at(-1))):!t&&!a&&(this.callbacks.set(s,{callback:i,options:o}),this.allKeys.add(s.split("+").at(-1)))}}exec(e,t){if(!this.allKeys.has(t.key))return;let n=this.callbacks.get(ee(this,Hv,BB).call(this,t));if(!n)return;let{callback:i,options:{bubbles:o=!1,args:s=[],checker:a=null}}=n;a&&!a(e,t)||(i.bind(e,...s,t)(),o||Cr(t))}};Hv=new WeakSet,BB=function(e){e.altKey&&this.buffer.push("alt"),e.ctrlKey&&this.buffer.push("ctrl"),e.metaKey&&this.buffer.push("meta"),e.shiftKey&&this.buffer.push("shift"),this.buffer.push(e.key);let t=this.buffer.join("+");return this.buffer.length=0,t};Gv=class Gv{get _colors(){let e=new Map([["CanvasText",null],["Canvas",null]]);return eV(e),wt(this,"_colors",e)}convert(e){let t=Ep(e);if(!window.matchMedia("(forced-colors: active)").matches)return t;for(let[n,i]of this._colors)if(i.every((o,s)=>o===t[s]))return Gv._colorsMapping.get(n);return t}getHexCode(e){let t=this._colors.get(e);return t?nt.makeHexColor(...t):e}};Ke(Gv,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));rx=Gv,Uh=class Uh{constructor(e,t,n,i,o,s,a,u,c,f,h,p,m,b,v,w){q(this,rt);q(this,Xh,new AbortController);q(this,Ci,null);q(this,Kh,null);q(this,Lr,new Map);q(this,ln,new Map);q(this,Zh,null);q(this,fs,null);q(this,Jh,null);q(this,hs,new tx);q(this,Un,null);q(this,Nl,null);q(this,kl,null);q(this,Qh,0);q(this,Ll,new Set);q(this,go,null);q(this,ds,null);q(this,gc,new Set);Ke(this,"_editorUndoBar",null);q(this,Sm,!1);q(this,Tm,!1);q(this,ed,!1);q(this,Cm,null);q(this,mo,null);q(this,Pl,null);q(this,td,null);q(this,Ml,!1);q(this,yo,null);q(this,Vv,new QA);q(this,Bl,!1);q(this,rd,!1);q(this,Rm,!1);q(this,Fl,null);q(this,mc,null);q(this,nd,null);q(this,Ul,null);q(this,Dm,null);q(this,Xr,vt.NONE);q(this,Kt,new Set);q(this,ya,null);q(this,jl,null);q(this,$l,null);q(this,Im,null);q(this,id,null);q(this,Om,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1});q(this,zl,[0,0]);q(this,bo,null);q(this,ba,null);q(this,Nm,null);q(this,km,null);q(this,ps,null);let y=this._signal=l(this,Xh).signal;L(this,ba,e),L(this,Nm,t),L(this,km,n),L(this,Zh,i),L(this,Un,o),L(this,jl,s),L(this,id,u),this._eventBus=a,a._on("editingaction",this.onEditingAction.bind(this),{signal:y}),a._on("pagechanging",this.onPageChanging.bind(this),{signal:y}),a._on("scalechanging",this.onScaleChanging.bind(this),{signal:y}),a._on("rotationchanging",this.onRotationChanging.bind(this),{signal:y}),a._on("setpreference",this.onSetPreference.bind(this),{signal:y}),a._on("switchannotationeditorparams",_=>this.updateParams(_.type,_.value),{signal:y}),window.addEventListener("pointerdown",()=>{L(this,rd,!0)},{capture:!0,signal:y}),window.addEventListener("pointerup",()=>{L(this,rd,!1)},{capture:!0,signal:y}),ee(this,rt,jB).call(this),ee(this,rt,GB).call(this),ee(this,rt,ix).call(this),L(this,fs,u.annotationStorage),L(this,Cm,u.filterFactory),L(this,$l,c),L(this,td,f||null),L(this,Sm,h),L(this,Tm,p),L(this,ed,m),L(this,Dm,b||null),this.viewParameters={realScale:el.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=v||null,this._supportsPinchToZoom=w!==!1,o?.setSidebarUiManager(this)}static get _keyboardManager(){let e=Uh.prototype,t=s=>l(s,ba).contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&s.hasSomethingToControl(),n=(s,{target:a})=>{if(a instanceof HTMLInputElement){let{type:u}=a;return u!=="text"&&u!=="number"}return!0},i=this.TRANSLATE_SMALL,o=this.TRANSLATE_BIG;return wt(this,"_keyboardManager",new Df([[["ctrl+a","mac+meta+a"],e.selectAll,{checker:n}],[["ctrl+z","mac+meta+z"],e.undo,{checker:n}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],e.redo,{checker:n}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],e.delete,{checker:n}],[["Enter","mac+Enter"],e.addNewEditorFromKeyboard,{checker:(s,{target:a})=>!(a instanceof HTMLButtonElement)&&l(s,ba).contains(a)&&!s.isEnterHandled}],[[" ","mac+ "],e.addNewEditorFromKeyboard,{checker:(s,{target:a})=>!(a instanceof HTMLButtonElement)&&l(s,ba).contains(document.activeElement)}],[["Escape","mac+Escape"],e.unselectAll],[["ArrowLeft","mac+ArrowLeft"],e.translateSelectedEditors,{args:[-i,0],checker:t}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e.translateSelectedEditors,{args:[-o,0],checker:t}],[["ArrowRight","mac+ArrowRight"],e.translateSelectedEditors,{args:[i,0],checker:t}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e.translateSelectedEditors,{args:[o,0],checker:t}],[["ArrowUp","mac+ArrowUp"],e.translateSelectedEditors,{args:[0,-i],checker:t}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e.translateSelectedEditors,{args:[0,-o],checker:t}],[["ArrowDown","mac+ArrowDown"],e.translateSelectedEditors,{args:[0,i],checker:t}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e.translateSelectedEditors,{args:[0,o],checker:t}]]))}destroy(){l(this,ps)?.resolve(),L(this,ps,null),l(this,Xh)?.abort(),L(this,Xh,null),this._signal=null;for(let e of l(this,ln).values())e.destroy();l(this,ln).clear(),l(this,Lr).clear(),l(this,gc).clear(),l(this,Ul)?.clear(),L(this,Ci,null),l(this,Kt).clear(),l(this,hs).destroy(),l(this,Zh)?.destroy(),l(this,Un)?.destroy(),l(this,jl)?.destroy(),l(this,yo)?.hide(),L(this,yo,null),l(this,nd)?.destroy(),L(this,nd,null),L(this,Kh,null),l(this,mo)&&(clearTimeout(l(this,mo)),L(this,mo,null)),l(this,bo)&&(clearTimeout(l(this,bo)),L(this,bo,null)),this._editorUndoBar?.destroy(),L(this,id,null)}combinedSignal(e){return AbortSignal.any([this._signal,e.signal])}get mlManager(){return l(this,Dm)}get useNewAltTextFlow(){return l(this,Tm)}get useNewAltTextWhenAddingImage(){return l(this,ed)}get hcmFilter(){return wt(this,"hcmFilter",l(this,$l)?l(this,Cm).addHCMFilter(l(this,$l).foreground,l(this,$l).background):"none")}get direction(){return wt(this,"direction",getComputedStyle(l(this,ba)).direction)}get _highlightColors(){return wt(this,"_highlightColors",l(this,td)?new Map(l(this,td).split(",").map(e=>(e=e.split("=").map(t=>t.trim()),e[1]=e[1].toUpperCase(),e))):null)}get highlightColors(){let{_highlightColors:e}=this;if(!e)return wt(this,"highlightColors",null);let t=new Map,n=!!l(this,$l);for(let[i,o]of e){let s=i.endsWith("_HCM");if(n&&s){t.set(i.replace("_HCM",""),o);continue}!n&&!s&&t.set(i,o)}return wt(this,"highlightColors",t)}get highlightColorNames(){return wt(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,e=>e.reverse())):null)}getNonHCMColor(e){if(!this._highlightColors)return e;let t=this.highlightColorNames.get(e);return this._highlightColors.get(t)||e}getNonHCMColorName(e){return this.highlightColorNames.get(e)||e}setCurrentDrawingSession(e){e?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),L(this,kl,e)}setMainHighlightColorPicker(e){L(this,nd,e)}editAltText(e,t=!1){l(this,Zh)?.editAltText(this,e,t)}hasCommentManager(){return!!l(this,Un)}editComment(e,t,n,i){l(this,Un)?.showDialog(this,e,t,n,i)}selectComment(e,t){l(this,ln).get(e)?.getEditorByUID(t)?.toggleComment(!0,!0)}updateComment(e){l(this,Un)?.updateComment(e.getData())}updatePopupColor(e){l(this,Un)?.updatePopupColor(e)}removeComment(e){l(this,Un)?.removeComments([e.uid])}toggleComment(e,t,n=void 0){l(this,Un)?.toggleCommentPopup(e,t,n)}makeCommentColor(e,t){return e&&l(this,Un)?.makeCommentColor(e,t)||null}getCommentDialogElement(){return l(this,Un)?.dialogElement||null}async waitForEditorsRendered(e){if(l(this,ln).has(e-1))return;let{resolve:t,promise:n}=Promise.withResolvers(),i=o=>{o.pageNumber===e&&(this._eventBus._off("editorsrendered",i),t())};this._eventBus.on("editorsrendered",i),await n}getSignature(e){l(this,jl)?.getSignature({uiManager:this,editor:e})}get signatureManager(){return l(this,jl)}switchToMode(e,t){this._eventBus.on("annotationeditormodechanged",t,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:e})}setPreference(e,t){this._eventBus.dispatch("setpreference",{source:this,name:e,value:t})}onSetPreference({name:e,value:t}){switch(e){case"enableNewAltTextWhenAddingImage":L(this,ed,t);break}}onPageChanging({pageNumber:e}){L(this,Qh,e-1)}focusMainContainer(){l(this,ba).focus()}findParent(e,t){for(let n of l(this,ln).values()){let{x:i,y:o,width:s,height:a}=n.div.getBoundingClientRect();if(e>=i&&e<=i+s&&t>=o&&t<=o+a)return n}return null}disableUserSelect(e=!1){l(this,Nm).classList.toggle("noUserSelect",e)}addShouldRescale(e){l(this,gc).add(e)}removeShouldRescale(e){l(this,gc).delete(e)}onScaleChanging({scale:e}){this.commitOrRemove(),this.viewParameters.realScale=e*el.PDF_TO_CSS_UNITS;for(let t of l(this,gc))t.onScaleChanging();l(this,kl)?.onScaleChanging()}onRotationChanging({pagesRotation:e}){this.commitOrRemove(),this.viewParameters.rotation=e}highlightSelection(e="",t=!1){let n=document.getSelection();if(!n||n.isCollapsed)return;let{anchorNode:i,anchorOffset:o,focusNode:s,focusOffset:a}=n,u=n.toString(),f=ee(this,rt,Iw).call(this,n).closest(".textLayer"),h=this.getSelectionBoxes(f);if(!h)return;n.empty();let p=ee(this,rt,nx).call(this,f),m=l(this,Xr)===vt.NONE,b=()=>{let v=p?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:e,boxes:h,anchorNode:i,anchorOffset:o,focusNode:s,focusOffset:a,text:u});m&&this.showAllEditors("highlight",!0,!0),t&&v?.editComment()};if(m){this.switchToMode(vt.HIGHLIGHT,b);return}b()}commentSelection(e=""){this.highlightSelection(e,!0)}getAndRemoveDataFromAnnotationStorage(e){if(!l(this,fs))return null;let t=`${im}${e}`,n=l(this,fs).getRawValue(t);return n&&l(this,fs).remove(t),n}addToAnnotationStorage(e){!e.isEmpty()&&l(this,fs)&&!l(this,fs).has(e.id)&&l(this,fs).setValue(e.id,e)}a11yAlert(e,t=null){let n=l(this,km);n&&(n.setAttribute("data-l10n-id",e),t?n.setAttribute("data-l10n-args",JSON.stringify(t)):n.removeAttribute("data-l10n-args"))}blur(){if(this.isShiftKeyDown=!1,l(this,Ml)&&(L(this,Ml,!1),ee(this,rt,Mg).call(this,"main_toolbar")),!this.hasSelection)return;let{activeElement:e}=document;for(let t of l(this,Kt))if(t.div.contains(e)){L(this,mc,[t,e]),t._focusEventsAllowed=!1;break}}focus(){if(!l(this,mc))return;let[e,t]=l(this,mc);L(this,mc,null),t.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:this._signal}),t.focus()}addEditListeners(){ee(this,rt,ix).call(this),this.setEditingState(!0)}removeEditListeners(){ee(this,rt,WB).call(this),this.setEditingState(!1)}dragOver(e){for(let{type:t}of e.dataTransfer.items)for(let n of l(this,ds))if(n.isHandlingMimeForPasting(t)){e.dataTransfer.dropEffect="copy",e.preventDefault();return}}drop(e){for(let t of e.dataTransfer.items)for(let n of l(this,ds))if(n.isHandlingMimeForPasting(t.type)){n.paste(t,this.currentLayer),e.preventDefault();return}}copy(e){if(e.preventDefault(),l(this,Ci)?.commitOrRemove(),!this.hasSelection)return;let t=[];for(let n of l(this,Kt)){let i=n.serialize(!0);i&&t.push(i)}t.length!==0&&e.clipboardData.setData("application/pdfjs",JSON.stringify(t))}cut(e){this.copy(e),this.delete()}async paste(e){e.preventDefault();let{clipboardData:t}=e;for(let o of t.items)for(let s of l(this,ds))if(s.isHandlingMimeForPasting(o.type)){s.paste(o,this.currentLayer);return}let n=t.getData("application/pdfjs");if(!n)return;try{n=JSON.parse(n)}catch(o){_t(`paste: "${o.message}".`);return}if(!Array.isArray(n))return;this.unselectAll();let i=this.currentLayer;try{let o=[];for(let u of n){let c=await i.deserialize(u);if(!c)return;o.push(c)}let s=()=>{for(let u of o)ee(this,rt,sx).call(this,u);ee(this,rt,ox).call(this,o)},a=()=>{for(let u of o)u.remove()};this.addCommands({cmd:s,undo:a,mustExec:!0})}catch(o){_t(`paste: "${o.message}".`)}}keydown(e){!this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!0),l(this,Xr)!==vt.NONE&&!this.isEditorHandlingKeyboard&&Uh._keyboardManager.exec(this,e)}keyup(e){this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!1,l(this,Ml)&&(L(this,Ml,!1),ee(this,rt,Mg).call(this,"main_toolbar")))}onEditingAction({name:e}){switch(e){case"undo":case"redo":case"delete":case"selectAll":this[e]();break;case"highlightSelection":this.highlightSelection("context_menu");break;case"commentSelection":this.commentSelection("context_menu");break}}setEditingState(e){e?(ee(this,rt,$B).call(this),ee(this,rt,qB).call(this),ee(this,rt,Yn).call(this,{isEditing:l(this,Xr)!==vt.NONE,isEmpty:ee(this,rt,Bg).call(this),hasSomethingToUndo:l(this,hs).hasSomethingToUndo(),hasSomethingToRedo:l(this,hs).hasSomethingToRedo(),hasSelectedEditor:!1})):(ee(this,rt,zB).call(this),ee(this,rt,HB).call(this),ee(this,rt,Yn).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(e){if(!l(this,ds)){L(this,ds,e);for(let t of l(this,ds))ee(this,rt,ha).call(this,t.defaultPropertiesToUpdate)}}getId(){return l(this,Vv).id}get currentLayer(){return l(this,ln).get(l(this,Qh))}getLayer(e){return l(this,ln).get(e)}get currentPageIndex(){return l(this,Qh)}addLayer(e){l(this,ln).set(e.pageIndex,e),l(this,Bl)?e.enable():e.disable()}removeLayer(e){l(this,ln).delete(e.pageIndex)}async updateMode(e,t=null,n=!1,i=!1,o=!1,s=!1){if(l(this,Xr)!==e&&!(l(this,ps)&&(await l(this,ps).promise,!l(this,ps)))){if(L(this,ps,Promise.withResolvers()),l(this,kl)?.commitOrRemove(),l(this,Xr)===vt.POPUP&&l(this,Un)?.hideSidebar(),l(this,Un)?.destroyPopup(),L(this,Xr,e),e===vt.NONE){this.setEditingState(!1),ee(this,rt,YB).call(this);for(let a of l(this,Lr).values())a.hideStandaloneCommentButton();this._editorUndoBar?.hide(),this.toggleComment(null),l(this,ps).resolve();return}for(let a of l(this,Lr).values())a.addStandaloneCommentButton();e===vt.SIGNATURE&&await l(this,jl)?.loadSignatures(),n&&Bn.clearPointerType(),this.setEditingState(!0),await ee(this,rt,VB).call(this),this.unselectAll();for(let a of l(this,ln).values())a.updateMode(e);if(e===vt.POPUP){l(this,Kh)||L(this,Kh,await l(this,id).getAnnotationsByType(new Set(l(this,ds).map(c=>c._editorType))));let a=new Set,u=[];for(let c of l(this,Lr).values()){let{annotationElementId:f,hasComment:h,deleted:p}=c;f&&a.add(f),h&&!p&&u.push(c.getData())}for(let c of l(this,Kh)){let{id:f,popupRef:h,contentsObj:p}=c;h&&p?.str&&!a.has(f)&&!l(this,Ll).has(f)&&u.push(c)}l(this,Un)?.showSidebar(u)}if(!t){i&&this.addNewEditorFromKeyboard(),l(this,ps).resolve();return}for(let a of l(this,Lr).values())a.uid===t?(this.setSelected(a),s?a.editComment():o?a.enterInEditMode():a.focus()):a.unselect();l(this,ps).resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(e){e.mode!==l(this,Xr)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,...e})}updateParams(e,t){if(l(this,ds)){switch(e){case Mt.CREATE:this.currentLayer.addNewEditor(t);return;case Mt.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(l(this,Im)||L(this,Im,new Map)).set(e,t),this.showAllEditors("highlight",t);break}if(this.hasSelection)for(let n of l(this,Kt))n.updateParams(e,t);else for(let n of l(this,ds))n.updateDefaultParams(e,t)}}showAllEditors(e,t,n=!1){for(let o of l(this,Lr).values())o.editorType===e&&o.show(t);(l(this,Im)?.get(Mt.HIGHLIGHT_SHOW_ALL)??!0)!==t&&ee(this,rt,ha).call(this,[[Mt.HIGHLIGHT_SHOW_ALL,t]])}enableWaiting(e=!1){if(l(this,Rm)!==e){L(this,Rm,e);for(let t of l(this,ln).values())e?t.disableClick():t.enableClick(),t.div.classList.toggle("waiting",e)}}*getEditors(e){for(let t of l(this,Lr).values())t.pageIndex===e&&(yield t)}getEditor(e){return l(this,Lr).get(e)}addEditor(e){l(this,Lr).set(e.id,e)}removeEditor(e){e.div.contains(document.activeElement)&&(l(this,mo)&&clearTimeout(l(this,mo)),L(this,mo,setTimeout(()=>{this.focusMainContainer(),L(this,mo,null)},0))),l(this,Lr).delete(e.id),e.annotationElementId&&l(this,Ul)?.delete(e.annotationElementId),this.unselect(e),(!e.annotationElementId||!l(this,Ll).has(e.annotationElementId))&&l(this,fs)?.remove(e.id)}addDeletedAnnotationElement(e){l(this,Ll).add(e.annotationElementId),this.addChangedExistingAnnotation(e),e.deleted=!0}isDeletedAnnotationElement(e){return l(this,Ll).has(e)}removeDeletedAnnotationElement(e){l(this,Ll).delete(e.annotationElementId),this.removeChangedExistingAnnotation(e),e.deleted=!1}setActiveEditor(e){l(this,Ci)!==e&&(L(this,Ci,e),e&&ee(this,rt,ha).call(this,e.propertiesToUpdate))}updateUI(e){l(this,rt,XB)===e&&ee(this,rt,ha).call(this,e.propertiesToUpdate)}updateUIForDefaultProperties(e){ee(this,rt,ha).call(this,e.defaultPropertiesToUpdate)}toggleSelected(e){if(l(this,Kt).has(e)){l(this,Kt).delete(e),e.unselect(),ee(this,rt,Yn).call(this,{hasSelectedEditor:this.hasSelection});return}l(this,Kt).add(e),e.select(),ee(this,rt,ha).call(this,e.propertiesToUpdate),ee(this,rt,Yn).call(this,{hasSelectedEditor:!0})}setSelected(e){this.updateToolbar({mode:e.mode,editId:e.uid}),l(this,kl)?.commitOrRemove();for(let t of l(this,Kt))t!==e&&t.unselect();l(this,Kt).clear(),l(this,Kt).add(e),e.select(),ee(this,rt,ha).call(this,e.propertiesToUpdate),ee(this,rt,Yn).call(this,{hasSelectedEditor:!0})}isSelected(e){return l(this,Kt).has(e)}get firstSelectedEditor(){return l(this,Kt).values().next().value}unselect(e){e.unselect(),l(this,Kt).delete(e),ee(this,rt,Yn).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return l(this,Kt).size!==0}get isEnterHandled(){return l(this,Kt).size===1&&this.firstSelectedEditor.isEnterHandled}undo(){l(this,hs).undo(),ee(this,rt,Yn).call(this,{hasSomethingToUndo:l(this,hs).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:ee(this,rt,Bg).call(this)}),this._editorUndoBar?.hide()}redo(){l(this,hs).redo(),ee(this,rt,Yn).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:l(this,hs).hasSomethingToRedo(),isEmpty:ee(this,rt,Bg).call(this)})}addCommands(e){l(this,hs).add(e),ee(this,rt,Yn).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:ee(this,rt,Bg).call(this)})}cleanUndoStack(e){l(this,hs).cleanType(e)}delete(){this.commitOrRemove();let e=this.currentLayer?.endDrawingSession(!0);if(!this.hasSelection&&!e)return;let t=e?[e]:[...l(this,Kt)],n=()=>{this._editorUndoBar?.show(i,t.length===1?t[0].editorType:t.length);for(let o of t)o.remove()},i=()=>{for(let o of t)ee(this,rt,sx).call(this,o)};this.addCommands({cmd:n,undo:i,mustExec:!0})}commitOrRemove(){l(this,Ci)?.commitOrRemove()}hasSomethingToControl(){return l(this,Ci)||this.hasSelection}selectAll(){for(let e of l(this,Kt))e.commit();ee(this,rt,ox).call(this,l(this,Lr).values())}unselectAll(){if(!(l(this,Ci)&&(l(this,Ci).commitOrRemove(),l(this,Xr)!==vt.NONE))&&!l(this,kl)?.commitOrRemove()&&this.hasSelection){for(let e of l(this,Kt))e.unselect();l(this,Kt).clear(),ee(this,rt,Yn).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(e,t,n=!1){if(n||this.commitOrRemove(),!this.hasSelection)return;l(this,zl)[0]+=e,l(this,zl)[1]+=t;let[i,o]=l(this,zl),s=[...l(this,Kt)],a=1e3;l(this,bo)&&clearTimeout(l(this,bo)),L(this,bo,setTimeout(()=>{L(this,bo,null),l(this,zl)[0]=l(this,zl)[1]=0,this.addCommands({cmd:()=>{for(let u of s)l(this,Lr).has(u.id)&&(u.translateInPage(i,o),u.translationDone())},undo:()=>{for(let u of s)l(this,Lr).has(u.id)&&(u.translateInPage(-i,-o),u.translationDone())},mustExec:!1})},a));for(let u of s)u.translateInPage(e,t),u.translationDone()}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),L(this,go,new Map);for(let e of l(this,Kt))l(this,go).set(e,{savedX:e.x,savedY:e.y,savedPageIndex:e.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!l(this,go))return!1;this.disableUserSelect(!1);let e=l(this,go);L(this,go,null);let t=!1;for(let[{x:i,y:o,pageIndex:s},a]of e)a.newX=i,a.newY=o,a.newPageIndex=s,t||(t=i!==a.savedX||o!==a.savedY||s!==a.savedPageIndex);if(!t)return!1;let n=(i,o,s,a)=>{if(l(this,Lr).has(i.id)){let u=l(this,ln).get(a);u?i._setParentAndPosition(u,o,s):(i.pageIndex=a,i.x=o,i.y=s)}};return this.addCommands({cmd:()=>{for(let[i,{newX:o,newY:s,newPageIndex:a}]of e)n(i,o,s,a)},undo:()=>{for(let[i,{savedX:o,savedY:s,savedPageIndex:a}]of e)n(i,o,s,a)},mustExec:!0}),!0}dragSelectedEditors(e,t){if(l(this,go))for(let n of l(this,go).keys())n.drag(e,t)}rebuild(e){if(e.parent===null){let t=this.getLayer(e.pageIndex);t?(t.changeParent(e),t.addOrRebuild(e)):(this.addEditor(e),this.addToAnnotationStorage(e),e.rebuild())}else e.parent.addOrRebuild(e)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||l(this,Kt).size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(e){return l(this,Ci)===e}getActive(){return l(this,Ci)}getMode(){return l(this,Xr)}isEditingMode(){return l(this,Xr)!==vt.NONE}get imageManager(){return wt(this,"imageManager",new ex)}getSelectionBoxes(e){if(!e)return null;let t=document.getSelection();for(let c=0,f=t.rangeCount;c<f;c++)if(!e.contains(t.getRangeAt(c).commonAncestorContainer))return null;let{x:n,y:i,width:o,height:s}=e.getBoundingClientRect(),a;switch(e.getAttribute("data-main-rotation")){case"90":a=(c,f,h,p)=>({x:(f-i)/s,y:1-(c+h-n)/o,width:p/s,height:h/o});break;case"180":a=(c,f,h,p)=>({x:1-(c+h-n)/o,y:1-(f+p-i)/s,width:h/o,height:p/s});break;case"270":a=(c,f,h,p)=>({x:1-(f+p-i)/s,y:(c-n)/o,width:p/s,height:h/o});break;default:a=(c,f,h,p)=>({x:(c-n)/o,y:(f-i)/s,width:h/o,height:p/s});break}let u=[];for(let c=0,f=t.rangeCount;c<f;c++){let h=t.getRangeAt(c);if(!h.collapsed)for(let{x:p,y:m,width:b,height:v}of h.getClientRects())b===0||v===0||u.push(a(p,m,b,v))}return u.length===0?null:u}addChangedExistingAnnotation({annotationElementId:e,id:t}){(l(this,Jh)||L(this,Jh,new Map)).set(e,t)}removeChangedExistingAnnotation({annotationElementId:e}){l(this,Jh)?.delete(e)}renderAnnotationElement(e){let t=l(this,Jh)?.get(e.data.id);if(!t)return;let n=l(this,fs).getRawValue(t);n&&(l(this,Xr)===vt.NONE&&!n.hasBeenModified||n.renderAnnotationElement(e))}setMissingCanvas(e,t,n){let i=l(this,Ul)?.get(e);i&&(i.setCanvas(t,n),l(this,Ul).delete(e))}addMissingCanvas(e,t){(l(this,Ul)||L(this,Ul,new Map)).set(e,t)}};Xh=new WeakMap,Ci=new WeakMap,Kh=new WeakMap,Lr=new WeakMap,ln=new WeakMap,Zh=new WeakMap,fs=new WeakMap,Jh=new WeakMap,hs=new WeakMap,Un=new WeakMap,Nl=new WeakMap,kl=new WeakMap,Qh=new WeakMap,Ll=new WeakMap,go=new WeakMap,ds=new WeakMap,gc=new WeakMap,Sm=new WeakMap,Tm=new WeakMap,ed=new WeakMap,Cm=new WeakMap,mo=new WeakMap,Pl=new WeakMap,td=new WeakMap,Ml=new WeakMap,yo=new WeakMap,Vv=new WeakMap,Bl=new WeakMap,rd=new WeakMap,Rm=new WeakMap,Fl=new WeakMap,mc=new WeakMap,nd=new WeakMap,Ul=new WeakMap,Dm=new WeakMap,Xr=new WeakMap,Kt=new WeakMap,ya=new WeakMap,jl=new WeakMap,$l=new WeakMap,Im=new WeakMap,id=new WeakMap,Om=new WeakMap,zl=new WeakMap,bo=new WeakMap,ba=new WeakMap,Nm=new WeakMap,km=new WeakMap,ps=new WeakMap,rt=new WeakSet,Iw=function({anchorNode:e}){return e.nodeType===Node.TEXT_NODE?e.parentElement:e},nx=function(e){let{currentLayer:t}=this;if(t.hasTextLayer(e))return t;for(let n of l(this,ln).values())if(n.hasTextLayer(e))return n;return null},FB=function(){let e=document.getSelection();if(!e||e.isCollapsed)return;let n=ee(this,rt,Iw).call(this,e).closest(".textLayer"),i=this.getSelectionBoxes(n);i&&(l(this,yo)||L(this,yo,new ZA(this)),l(this,yo).show(n,i,this.direction==="ltr"))},UB=function(){let e=document.getSelection();if(!e||e.isCollapsed){l(this,ya)&&(l(this,yo)?.hide(),L(this,ya,null),ee(this,rt,Yn).call(this,{hasSelectedText:!1}));return}let{anchorNode:t}=e;if(t===l(this,ya))return;let i=ee(this,rt,Iw).call(this,e).closest(".textLayer");if(!i){l(this,ya)&&(l(this,yo)?.hide(),L(this,ya,null),ee(this,rt,Yn).call(this,{hasSelectedText:!1}));return}if(l(this,yo)?.hide(),L(this,ya,t),ee(this,rt,Yn).call(this,{hasSelectedText:!0}),!(l(this,Xr)!==vt.HIGHLIGHT&&l(this,Xr)!==vt.NONE)&&(l(this,Xr)===vt.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),L(this,Ml,this.isShiftKeyDown),!this.isShiftKeyDown)){let o=l(this,Xr)===vt.HIGHLIGHT?ee(this,rt,nx).call(this,i):null;if(o?.toggleDrawing(),l(this,rd)){let s=new AbortController,a=this.combinedSignal(s),u=c=>{c.type==="pointerup"&&c.button!==0||(s.abort(),o?.toggleDrawing(!0),c.type==="pointerup"&&ee(this,rt,Mg).call(this,"main_toolbar"))};window.addEventListener("pointerup",u,{signal:a}),window.addEventListener("blur",u,{signal:a})}else o?.toggleDrawing(!0),ee(this,rt,Mg).call(this,"main_toolbar")}},Mg=function(e=""){l(this,Xr)===vt.HIGHLIGHT?this.highlightSelection(e):l(this,Sm)&&ee(this,rt,FB).call(this)},jB=function(){document.addEventListener("selectionchange",ee(this,rt,UB).bind(this),{signal:this._signal})},$B=function(){if(l(this,Pl))return;L(this,Pl,new AbortController);let e=this.combinedSignal(l(this,Pl));window.addEventListener("focus",this.focus.bind(this),{signal:e}),window.addEventListener("blur",this.blur.bind(this),{signal:e})},zB=function(){l(this,Pl)?.abort(),L(this,Pl,null)},ix=function(){if(l(this,Fl))return;L(this,Fl,new AbortController);let e=this.combinedSignal(l(this,Fl));window.addEventListener("keydown",this.keydown.bind(this),{signal:e}),window.addEventListener("keyup",this.keyup.bind(this),{signal:e})},WB=function(){l(this,Fl)?.abort(),L(this,Fl,null)},qB=function(){if(l(this,Nl))return;L(this,Nl,new AbortController);let e=this.combinedSignal(l(this,Nl));document.addEventListener("copy",this.copy.bind(this),{signal:e}),document.addEventListener("cut",this.cut.bind(this),{signal:e}),document.addEventListener("paste",this.paste.bind(this),{signal:e})},HB=function(){l(this,Nl)?.abort(),L(this,Nl,null)},GB=function(){let e=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:e}),document.addEventListener("drop",this.drop.bind(this),{signal:e})},Yn=function(e){Object.entries(e).some(([n,i])=>l(this,Om)[n]!==i)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(l(this,Om),e)}),l(this,Xr)===vt.HIGHLIGHT&&e.hasSelectedEditor===!1&&ee(this,rt,ha).call(this,[[Mt.HIGHLIGHT_FREE,!0]]))},ha=function(e){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:e})},VB=async function(){if(!l(this,Bl)){L(this,Bl,!0);let e=[];for(let t of l(this,ln).values())e.push(t.enable());await Promise.all(e);for(let t of l(this,Lr).values())t.enable()}},YB=function(){if(this.unselectAll(),l(this,Bl)){L(this,Bl,!1);for(let e of l(this,ln).values())e.disable();for(let e of l(this,Lr).values())e.disable()}},sx=function(e){let t=l(this,ln).get(e.pageIndex);t?t.addOrRebuild(e):(this.addEditor(e),this.addToAnnotationStorage(e))},XB=function(){let e=null;for(e of l(this,Kt));return e},Bg=function(){if(l(this,Lr).size===0)return!0;if(l(this,Lr).size===1)for(let e of l(this,Lr).values())return e.isEmpty();return!1},ox=function(e){for(let t of l(this,Kt))t.unselect();l(this,Kt).clear();for(let t of e)t.isEmpty()||(l(this,Kt).add(t),t.select());ee(this,rt,Yn).call(this,{hasSelectedEditor:this.hasSelection})},Ke(Uh,"TRANSLATE_SMALL",1),Ke(Uh,"TRANSLATE_BIG",10);wu=Uh,Xn=class Xn{constructor(e){q(this,Vs);q(this,gn,null);q(this,wo,!1);q(this,Ps,null);q(this,sd,null);q(this,vo,null);q(this,Ri,null);q(this,od,!1);q(this,_o,null);q(this,pi,null);q(this,wa,null);q(this,yc,null);q(this,Eo,!1);L(this,pi,e),L(this,Eo,e._uiManager.useNewAltTextFlow),l(Xn,Wl)||L(Xn,Wl,Object.freeze({added:"pdfjs-editor-new-alt-text-added-button","added-label":"pdfjs-editor-new-alt-text-added-button-label",missing:"pdfjs-editor-new-alt-text-missing-button","missing-label":"pdfjs-editor-new-alt-text-missing-button-label",review:"pdfjs-editor-new-alt-text-to-review-button","review-label":"pdfjs-editor-new-alt-text-to-review-button-label"}))}static initialize(e){Xn._l10n??(Xn._l10n=e)}async render(){let e=L(this,Ps,document.createElement("button"));e.className="altText",e.tabIndex="0";let t=L(this,sd,document.createElement("span"));e.append(t),l(this,Eo)?(e.classList.add("new"),e.setAttribute("data-l10n-id",l(Xn,Wl).missing),t.setAttribute("data-l10n-id",l(Xn,Wl)["missing-label"])):(e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));let n=l(this,pi)._uiManager._signal;e.addEventListener("contextmenu",Ki,{signal:n}),e.addEventListener("pointerdown",o=>o.stopPropagation(),{signal:n});let i=o=>{o.preventDefault(),l(this,pi)._uiManager.editAltText(l(this,pi)),l(this,Eo)&&l(this,pi)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:l(this,Vs,Fg)}})};return e.addEventListener("click",i,{capture:!0,signal:n}),e.addEventListener("keydown",o=>{o.target===e&&o.key==="Enter"&&(L(this,od,!0),i(o))},{signal:n}),await ee(this,Vs,Ow).call(this),e}finish(){l(this,Ps)&&(l(this,Ps).focus({focusVisible:l(this,od)}),L(this,od,!1))}isEmpty(){return l(this,Eo)?l(this,gn)===null:!l(this,gn)&&!l(this,wo)}hasData(){return l(this,Eo)?l(this,gn)!==null||!!l(this,wa):this.isEmpty()}get guessedText(){return l(this,wa)}async setGuessedText(e){l(this,gn)===null&&(L(this,wa,e),L(this,yc,await Xn._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:e})),ee(this,Vs,Ow).call(this))}toggleAltTextBadge(e=!1){if(!l(this,Eo)||l(this,gn)){l(this,_o)?.remove(),L(this,_o,null);return}if(!l(this,_o)){let t=L(this,_o,document.createElement("div"));t.className="noAltTextBadge",l(this,pi).div.append(t)}l(this,_o).classList.toggle("hidden",!e)}serialize(e){let t=l(this,gn);return!e&&l(this,wa)===t&&(t=l(this,yc)),{altText:t,decorative:l(this,wo),guessedText:l(this,wa),textWithDisclaimer:l(this,yc)}}get data(){return{altText:l(this,gn),decorative:l(this,wo)}}set data({altText:e,decorative:t,guessedText:n,textWithDisclaimer:i,cancel:o=!1}){n&&(L(this,wa,n),L(this,yc,i)),!(l(this,gn)===e&&l(this,wo)===t)&&(o||(L(this,gn,e),L(this,wo,t)),ee(this,Vs,Ow).call(this))}toggle(e=!1){l(this,Ps)&&(!e&&l(this,Ri)&&(clearTimeout(l(this,Ri)),L(this,Ri,null)),l(this,Ps).disabled=!e)}shown(){l(this,pi)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:l(this,Vs,Fg)}})}destroy(){l(this,Ps)?.remove(),L(this,Ps,null),L(this,sd,null),L(this,vo,null),l(this,_o)?.remove(),L(this,_o,null)}};gn=new WeakMap,wo=new WeakMap,Ps=new WeakMap,sd=new WeakMap,vo=new WeakMap,Ri=new WeakMap,od=new WeakMap,_o=new WeakMap,pi=new WeakMap,wa=new WeakMap,yc=new WeakMap,Eo=new WeakMap,Wl=new WeakMap,Vs=new WeakSet,Fg=function(){return l(this,gn)&&"added"||l(this,gn)===null&&this.guessedText&&"review"||"missing"},Ow=async function(){let e=l(this,Ps);if(!e)return;if(l(this,Eo)){if(e.classList.toggle("done",!!l(this,gn)),e.setAttribute("data-l10n-id",l(Xn,Wl)[l(this,Vs,Fg)]),l(this,sd)?.setAttribute("data-l10n-id",l(Xn,Wl)[`${l(this,Vs,Fg)}-label`]),!l(this,gn)){l(this,vo)?.remove();return}}else{if(!l(this,gn)&&!l(this,wo)){e.classList.remove("done"),l(this,vo)?.remove();return}e.classList.add("done"),e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let t=l(this,vo);if(!t){L(this,vo,t=document.createElement("span")),t.className="tooltip",t.setAttribute("role","tooltip"),t.id=`alt-text-tooltip-${l(this,pi).id}`;let i=100,o=l(this,pi)._uiManager._signal;o.addEventListener("abort",()=>{clearTimeout(l(this,Ri)),L(this,Ri,null)},{once:!0}),e.addEventListener("mouseenter",()=>{L(this,Ri,setTimeout(()=>{L(this,Ri,null),l(this,vo).classList.add("show"),l(this,pi)._reportTelemetry({action:"alt_text_tooltip"})},i))},{signal:o}),e.addEventListener("mouseleave",()=>{l(this,Ri)&&(clearTimeout(l(this,Ri)),L(this,Ri,null)),l(this,vo)?.classList.remove("show")},{signal:o})}l(this,wo)?t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(t.removeAttribute("data-l10n-id"),t.textContent=l(this,gn)),t.parentNode||e.append(t),l(this,pi).getElementForAltText()?.setAttribute("aria-describedby",t.id)},q(Xn,Wl,null),Ke(Xn,"_l10n",null);fv=Xn,Bh=class{constructor(e){q(this,Pm);q(this,xn,null);q(this,gs,null);q(this,bc,!1);q(this,gr,null);q(this,Lm,null);q(this,wc,null);q(this,Ms,null);q(this,vc,null);q(this,_c,!1);q(this,Ec,null);L(this,gr,e)}renderForToolbar(){let e=L(this,gs,document.createElement("button"));return e.className="comment",ee(this,Pm,ax).call(this,e,!1)}renderForStandalone(){let e=L(this,xn,document.createElement("button"));e.className="annotationCommentButton";let t=l(this,gr).commentButtonPosition;if(t){let{style:n}=e;n.insetInlineEnd=`calc(${100*(l(this,gr)._uiManager.direction==="ltr"?1-t[0]:t[0])}% - var(--comment-button-dim))`,n.top=`calc(${100*t[1]}% - var(--comment-button-dim))`;let i=l(this,gr).commentButtonColor;i&&(n.backgroundColor=i)}return ee(this,Pm,ax).call(this,e,!0)}focusButton(){setTimeout(()=>{(l(this,xn)??l(this,gs))?.focus()},0)}onUpdatedColor(){if(!l(this,xn))return;let e=l(this,gr).commentButtonColor;e&&(l(this,xn).style.backgroundColor=e),l(this,gr)._uiManager.updatePopupColor(l(this,gr))}get commentButtonWidth(){return(l(this,xn)?.getBoundingClientRect().width??0)/l(this,gr).parent.boundingClientRect.width}get commentPopupPositionInLayer(){if(l(this,Ec))return l(this,Ec);if(!l(this,xn))return null;let{x:e,y:t,height:n}=l(this,xn).getBoundingClientRect(),{x:i,y:o,width:s,height:a}=l(this,gr).parent.boundingClientRect;return[(e-i)/s,(t+n-o)/a]}set commentPopupPositionInLayer(e){L(this,Ec,e)}hasDefaultPopupPosition(){return l(this,Ec)===null}removeStandaloneCommentButton(){l(this,xn)?.remove(),L(this,xn,null)}removeToolbarCommentButton(){l(this,gs)?.remove(),L(this,gs,null)}setCommentButtonStates({selected:e,hasPopup:t}){l(this,xn)&&(l(this,xn).classList.toggle("selected",e),l(this,xn).ariaExpanded=t)}edit(e){let t=this.commentPopupPositionInLayer,n,i;if(t)[n,i]=t;else{[n,i]=l(this,gr).commentButtonPosition;let{width:f,height:h,x:p,y:m}=l(this,gr);n=p+n*f,i=m+i*h}let o=l(this,gr).parent.boundingClientRect,{x:s,y:a,width:u,height:c}=o;l(this,gr)._uiManager.editComment(l(this,gr),s+n*u,a+i*c,{...e,parentDimensions:o})}finish(){l(this,gs)&&(l(this,gs).focus({focusVisible:l(this,bc)}),L(this,bc,!1))}isDeleted(){return l(this,_c)||l(this,Ms)===""}isEmpty(){return l(this,Ms)===null}hasBeenEdited(){return this.isDeleted()||l(this,Ms)!==l(this,Lm)}serialize(){return this.data}get data(){return{text:l(this,Ms),richText:l(this,wc),date:l(this,vc),deleted:this.isDeleted()}}set data(e){if(e!==l(this,Ms)&&L(this,wc,null),e===null){L(this,Ms,""),L(this,_c,!0);return}L(this,Ms,e),L(this,vc,new Date),L(this,_c,!1)}setInitialText(e,t=null){L(this,Lm,e),this.data=e,L(this,vc,null),L(this,wc,t)}shown(){}destroy(){l(this,gs)?.remove(),L(this,gs,null),l(this,xn)?.remove(),L(this,xn,null),L(this,Ms,""),L(this,wc,null),L(this,vc,null),L(this,gr,null),L(this,bc,!1),L(this,_c,!1)}};xn=new WeakMap,gs=new WeakMap,bc=new WeakMap,gr=new WeakMap,Lm=new WeakMap,wc=new WeakMap,Ms=new WeakMap,vc=new WeakMap,_c=new WeakMap,Ec=new WeakMap,Pm=new WeakSet,ax=function(e,t){if(!l(this,gr)._uiManager.hasCommentManager())return null;e.tabIndex="0",e.ariaHasPopup="dialog",t?(e.ariaControls="commentPopup",e.setAttribute("data-l10n-id","pdfjs-show-comment-button")):(e.ariaControlsElements=[l(this,gr)._uiManager.getCommentDialogElement()],e.setAttribute("data-l10n-id","pdfjs-editor-add-comment-button"));let n=l(this,gr)._uiManager._signal;if(!(n instanceof AbortSignal)||n.aborted)return e;e.addEventListener("contextmenu",Ki,{signal:n}),t&&(e.addEventListener("focusin",o=>{l(this,gr)._focusEventsAllowed=!1,Cr(o)},{capture:!0,signal:n}),e.addEventListener("focusout",o=>{l(this,gr)._focusEventsAllowed=!0,Cr(o)},{capture:!0,signal:n})),e.addEventListener("pointerdown",o=>o.stopPropagation(),{signal:n});let i=o=>{o.preventDefault(),e===l(this,gs)?this.edit():l(this,gr).toggleComment(!0)};return e.addEventListener("click",i,{capture:!0,signal:n}),e.addEventListener("keydown",o=>{o.target===e&&o.key==="Enter"&&(L(this,bc,!0),i(o))},{signal:n}),e.addEventListener("pointerenter",()=>{l(this,gr).toggleComment(!1,!0)},{signal:n}),e.addEventListener("pointerleave",()=>{l(this,gr).toggleComment(!1,!1)},{signal:n}),e};TT=class TT{constructor({container:e,isPinchingDisabled:t=null,isPinchingStopped:n=null,onPinchStart:i=null,onPinching:o=null,onPinchEnd:s=null,signal:a}){q(this,vu);q(this,ad);q(this,Ac,!1);q(this,Mm,null);q(this,Bm);q(this,Fm);q(this,Um);q(this,jm);q(this,va,null);q(this,xc);q(this,_a,null);q(this,Sc);q(this,Ea,null);L(this,ad,e),L(this,Mm,n),L(this,Bm,t),L(this,Fm,i),L(this,Um,o),L(this,jm,s),L(this,Sc,new AbortController),L(this,xc,AbortSignal.any([a,l(this,Sc).signal])),e.addEventListener("touchstart",ee(this,vu,KB).bind(this),{passive:!1,signal:l(this,xc)})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/Bo.pixelRatio}destroy(){l(this,Sc)?.abort(),L(this,Sc,null),l(this,va)?.abort(),L(this,va,null)}};ad=new WeakMap,Ac=new WeakMap,Mm=new WeakMap,Bm=new WeakMap,Fm=new WeakMap,Um=new WeakMap,jm=new WeakMap,va=new WeakMap,xc=new WeakMap,_a=new WeakMap,Sc=new WeakMap,Ea=new WeakMap,vu=new WeakSet,KB=function(e){var i,o,s;if((i=l(this,Bm))!=null&&i.call(this))return;if(e.touches.length===1){if(l(this,va))return;let a=L(this,va,new AbortController),u=AbortSignal.any([l(this,xc),a.signal]),c=l(this,ad),f={capture:!0,signal:u,passive:!1},h=p=>{p.pointerType==="touch"&&(l(this,va)?.abort(),L(this,va,null))};c.addEventListener("pointerdown",p=>{p.pointerType==="touch"&&(Cr(p),h(p))},f),c.addEventListener("pointerup",h,f),c.addEventListener("pointercancel",h,f);return}if(!l(this,Ea)){L(this,Ea,new AbortController);let a=AbortSignal.any([l(this,xc),l(this,Ea).signal]),u=l(this,ad),c={signal:a,capture:!1,passive:!1};u.addEventListener("touchmove",ee(this,vu,ZB).bind(this),c);let f=ee(this,vu,JB).bind(this);u.addEventListener("touchend",f,c),u.addEventListener("touchcancel",f,c),c.capture=!0,u.addEventListener("pointerdown",Cr,c),u.addEventListener("pointermove",Cr,c),u.addEventListener("pointercancel",Cr,c),u.addEventListener("pointerup",Cr,c),(o=l(this,Fm))==null||o.call(this)}if(Cr(e),e.touches.length!==2||(s=l(this,Mm))!=null&&s.call(this)){L(this,_a,null);return}let[t,n]=e.touches;t.identifier>n.identifier&&([t,n]=[n,t]),L(this,_a,{touch0X:t.screenX,touch0Y:t.screenY,touch1X:n.screenX,touch1Y:n.screenY})},ZB=function(e){var S;if(!l(this,_a)||e.touches.length!==2)return;Cr(e);let[t,n]=e.touches;t.identifier>n.identifier&&([t,n]=[n,t]);let{screenX:i,screenY:o}=t,{screenX:s,screenY:a}=n,u=l(this,_a),{touch0X:c,touch0Y:f,touch1X:h,touch1Y:p}=u,m=h-c,b=p-f,v=s-i,w=a-o,y=Math.hypot(v,w)||1,_=Math.hypot(m,b)||1;if(!l(this,Ac)&&Math.abs(_-y)<=TT.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(u.touch0X=i,u.touch0Y=o,u.touch1X=s,u.touch1Y=a,!l(this,Ac)){L(this,Ac,!0);return}let E=[(i+s)/2,(o+a)/2];(S=l(this,Um))==null||S.call(this,E,_,y)},JB=function(e){var t;e.touches.length>=2||(l(this,Ea)&&(l(this,Ea).abort(),L(this,Ea,null),(t=l(this,jm))==null||t.call(this)),l(this,_a)&&(Cr(e),L(this,_a,null),L(this,Ac,!1)))};lm=TT,At=class At{constructor(e){q(this,mt);q(this,Tc,null);q(this,Bs,null);q(this,Er,null);q(this,cr,null);q(this,Aa,null);q(this,ld,!1);q(this,ql,null);q(this,$m,"");q(this,Sn,null);q(this,Cc,null);q(this,xa,null);q(this,ms,null);q(this,Hl,null);q(this,zm,"");q(this,Rc,!1);q(this,Di,null);q(this,Wm,!1);q(this,Dc,!1);q(this,Sa,!1);q(this,Ao,null);q(this,ud,0);q(this,cd,0);q(this,ys,null);q(this,Ic,null);Ke(this,"isSelected",!1);Ke(this,"_isCopy",!1);Ke(this,"_editToolbar",null);Ke(this,"_initialOptions",Object.create(null));Ke(this,"_initialData",null);Ke(this,"_isVisible",!0);Ke(this,"_uiManager",null);Ke(this,"_focusEventsAllowed",!0);q(this,qm,!1);q(this,Yv,At._zIndex++);this.parent=e.parent,this.id=e.id,this.width=this.height=null,this.pageIndex=e.parent.pageIndex,this.name=e.name,this.div=null,this._uiManager=e.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=e.isCentered,this._structTreeParentId=null,this.annotationElementId=e.annotationElementId||null,this.creationDate=e.creationDate||new Date,this.modificationDate=e.modificationDate||null,this.canAddComment=!0;let{rotation:t,rawDims:{pageWidth:n,pageHeight:i,pageX:o,pageY:s}}=this.parent.viewport;this.rotation=t,this.pageRotation=(360+t-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[n,i],this.pageTranslation=[o,s];let[a,u]=this.parentDimensions;this.x=e.x/a,this.y=e.y/u,this.isAttachedToDOM=!1,this.deleted=!1}static get _resizerKeyboardManager(){let e=At.prototype._resizeWithKeyboard,t=wu.TRANSLATE_SMALL,n=wu.TRANSLATE_BIG;return wt(this,"_resizerKeyboardManager",new Df([[["ArrowLeft","mac+ArrowLeft"],e,{args:[-t,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e,{args:[-n,0]}],[["ArrowRight","mac+ArrowRight"],e,{args:[t,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e,{args:[n,0]}],[["ArrowUp","mac+ArrowUp"],e,{args:[0,-t]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e,{args:[0,-n]}],[["ArrowDown","mac+ArrowDown"],e,{args:[0,t]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e,{args:[0,n]}],[["Escape","mac+Escape"],At.prototype._stopResizingWithKeyboard]]))}get editorType(){return Object.getPrototypeOf(this).constructor._type}get mode(){return Object.getPrototypeOf(this).constructor._editorType}static get isDrawer(){return!1}static get _defaultLineColor(){return wt(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(e){let t=new gx({id:e.parent.getNextId(),parent:e.parent,uiManager:e._uiManager});t.annotationElementId=e.annotationElementId,t.deleted=!0,t._uiManager.addToAnnotationStorage(t)}static initialize(e,t){if(At._l10n??(At._l10n=e),At._l10nResizer||(At._l10nResizer=Object.freeze({topLeft:"pdfjs-editor-resizer-top-left",topMiddle:"pdfjs-editor-resizer-top-middle",topRight:"pdfjs-editor-resizer-top-right",middleRight:"pdfjs-editor-resizer-middle-right",bottomRight:"pdfjs-editor-resizer-bottom-right",bottomMiddle:"pdfjs-editor-resizer-bottom-middle",bottomLeft:"pdfjs-editor-resizer-bottom-left",middleLeft:"pdfjs-editor-resizer-middle-left"})),At._borderLineWidth!==-1)return;let n=getComputedStyle(document.documentElement);At._borderLineWidth=parseFloat(n.getPropertyValue("--outline-width"))||0}static updateDefaultParams(e,t){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(e){return!1}static paste(e,t){dr("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return l(this,qm)}set _isDraggable(e){L(this,qm,e),this.div?.classList.toggle("draggable",e)}get uid(){return this.annotationElementId||this.id}get isEnterHandled(){return!0}center(){let[e,t]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*t/(e*2),this.y+=this.width*e/(t*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*t/(e*2),this.y-=this.width*e/(t*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(e){this._uiManager.addCommands(e)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=l(this,Yv)}setParent(e){e!==null?(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions):(ee(this,mt,Ug).call(this),l(this,ms)?.remove(),L(this,ms,null)),this.parent=e}focusin(e){this._focusEventsAllowed&&(l(this,Rc)?L(this,Rc,!1):this.parent.setSelected(this))}focusout(e){!this._focusEventsAllowed||!this.isAttachedToDOM||e.relatedTarget?.closest(`#${this.id}`)||(e.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.isInEditMode()&&this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(e,t,n,i){let[o,s]=this.parentDimensions;[n,i]=this.screenToPageTranslation(n,i),this.x=(e+n)/o,this.y=(t+i)/s,this.fixAndSetPosition()}_moveAfterPaste(e,t){let[n,i]=this.parentDimensions;this.setAt(e*n,t*i,this.width*n,this.height*i),this._onTranslated()}translate(e,t){ee(this,mt,lx).call(this,this.parentDimensions,e,t)}translateInPage(e,t){l(this,Di)||L(this,Di,[this.x,this.y,this.width,this.height]),ee(this,mt,lx).call(this,this.pageDimensions,e,t),this.div.scrollIntoView({block:"nearest"})}translationDone(){this._onTranslated(this.x,this.y)}drag(e,t){l(this,Di)||L(this,Di,[this.x,this.y,this.width,this.height]);let{div:n,parentDimensions:[i,o]}=this;if(this.x+=e/i,this.y+=t/o,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){let{x:h,y:p}=this.div.getBoundingClientRect();this.parent.findNewParent(this,h,p)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:s,y:a}=this,[u,c]=this.getBaseTranslation();s+=u,a+=c;let{style:f}=n;f.left=`${(100*s).toFixed(2)}%`,f.top=`${(100*a).toFixed(2)}%`,this._onTranslating(s,a),n.scrollIntoView({block:"nearest"})}_onTranslating(e,t){}_onTranslated(e,t){}get _hasBeenMoved(){return!!l(this,Di)&&(l(this,Di)[0]!==this.x||l(this,Di)[1]!==this.y)}get _hasBeenResized(){return!!l(this,Di)&&(l(this,Di)[2]!==this.width||l(this,Di)[3]!==this.height)}getBaseTranslation(){let[e,t]=this.parentDimensions,{_borderLineWidth:n}=At,i=n/e,o=n/t;switch(this.rotation){case 90:return[-i,o];case 180:return[i,o];case 270:return[i,-o];default:return[-i,-o]}}get _mustFixPosition(){return!0}fixAndSetPosition(e=this.rotation){let{div:{style:t},pageDimensions:[n,i]}=this,{x:o,y:s,width:a,height:u}=this;if(a*=n,u*=i,o*=n,s*=i,this._mustFixPosition)switch(e){case 0:o=Wn(o,0,n-a),s=Wn(s,0,i-u);break;case 90:o=Wn(o,0,n-u),s=Wn(s,a,i);break;case 180:o=Wn(o,a,n),s=Wn(s,u,i);break;case 270:o=Wn(o,u,n),s=Wn(s,0,i-a);break}this.x=o/=n,this.y=s/=i;let[c,f]=this.getBaseTranslation();o+=c,s+=f,t.left=`${(100*o).toFixed(2)}%`,t.top=`${(100*s).toFixed(2)}%`,this.moveInDOM()}screenToPageTranslation(e,t){var n;return ee(n=At,Hm,ux).call(n,e,t,this.parentRotation)}pageTranslationToScreen(e,t){var n;return ee(n=At,Hm,ux).call(n,e,t,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){let{parentScale:e,pageDimensions:[t,n]}=this;return[t*e,n*e]}setDims(){let{div:{style:e},width:t,height:n}=this;e.width=`${(100*t).toFixed(2)}%`,e.height=`${(100*n).toFixed(2)}%`}getInitialTranslation(){return[0,0]}_onResized(){}static _round(e){return Math.round(e*1e4)/1e4}_onResizing(){}altTextFinish(){l(this,Er)?.finish()}get toolbarButtons(){return null}async addEditToolbar(){if(this._editToolbar||l(this,Dc))return this._editToolbar;this._editToolbar=new KA(this),this.div.append(this._editToolbar.render());let{toolbarButtons:e}=this;if(e)for(let[t,n]of e)await this._editToolbar.addButton(t,n);return this.hasComment||this._editToolbar.addButton("comment",this.addCommentButton()),this._editToolbar.addButton("delete"),this._editToolbar}addCommentButtonInToolbar(){this._editToolbar?.addButtonBefore("comment",this.addCommentButton(),".deleteButton")}removeCommentButtonFromToolbar(){this._editToolbar?.removeButton("comment")}removeEditToolbar(){this._editToolbar?.remove(),this._editToolbar=null,l(this,Er)?.destroy()}addContainer(e){let t=this._editToolbar?.div;t?t.before(e):this.div.append(e)}getClientDimensions(){return this.div.getBoundingClientRect()}createAltText(){return l(this,Er)||(fv.initialize(At._l10n),L(this,Er,new fv(this)),l(this,Tc)&&(l(this,Er).data=l(this,Tc),L(this,Tc,null))),l(this,Er)}get altTextData(){return l(this,Er)?.data}set altTextData(e){l(this,Er)&&(l(this,Er).data=e)}get guessedAltText(){return l(this,Er)?.guessedText}async setGuessedAltText(e){await l(this,Er)?.setGuessedText(e)}serializeAltText(e){return l(this,Er)?.serialize(e)}hasAltText(){return!!l(this,Er)&&!l(this,Er).isEmpty()}hasAltTextData(){return l(this,Er)?.hasData()??!1}focusCommentButton(){l(this,cr)?.focusButton()}addCommentButton(){return this.canAddComment?l(this,cr)||L(this,cr,new Bh(this)):null}addStandaloneCommentButton(){if(this._uiManager.hasCommentManager()){if(l(this,Aa)){this._uiManager.isEditingMode()&&l(this,Aa).classList.remove("hidden");return}this.hasComment&&(L(this,Aa,l(this,cr).renderForStandalone()),this.div.append(l(this,Aa)))}}removeStandaloneCommentButton(){l(this,cr).removeStandaloneCommentButton(),L(this,Aa,null)}hideStandaloneCommentButton(){l(this,Aa)?.classList.add("hidden")}get comment(){let{data:{richText:e,text:t,date:n,deleted:i}}=l(this,cr);return{text:t,richText:e,date:n,deleted:i,color:this.getNonHCMColor(),opacity:this.opacity??1}}set comment(e){l(this,cr)||L(this,cr,new Bh(this)),l(this,cr).data=e,this.hasComment?(this.removeCommentButtonFromToolbar(),this.addStandaloneCommentButton(),this._uiManager.updateComment(this)):(this.addCommentButtonInToolbar(),this.removeStandaloneCommentButton(),this._uiManager.removeComment(this))}setCommentData({comment:e,popupRef:t,richText:n}){if(!t||(l(this,cr)||L(this,cr,new Bh(this)),l(this,cr).setInitialText(e,n),!this.annotationElementId))return;let i=this._uiManager.getAndRemoveDataFromAnnotationStorage(this.annotationElementId);i&&this.updateFromAnnotationLayer(i)}get hasEditedComment(){return l(this,cr)?.hasBeenEdited()}get hasDeletedComment(){return l(this,cr)?.isDeleted()}get hasComment(){return!!l(this,cr)&&!l(this,cr).isEmpty()&&!l(this,cr).isDeleted()}async editComment(e){l(this,cr)||L(this,cr,new Bh(this)),l(this,cr).edit(e)}toggleComment(e,t=void 0){this.hasComment&&this._uiManager.toggleComment(this,e,t)}setSelectedCommentButton(e){l(this,cr).setSelectedButton(e)}addComment(e){if(this.hasEditedComment){let[,,,i]=e.rect,[o]=this.pageDimensions,[s]=this.pageTranslation,a=s+o+1,u=i-100,c=a+180;e.popup={contents:this.comment.text,deleted:this.comment.deleted,rect:[a,u,c,i]}}}updateFromAnnotationLayer({popup:{contents:e,deleted:t}}){l(this,cr).data=t?null:e}get parentBoundingClientRect(){return this.parent.boundingClientRect}render(){let e=this.div=document.createElement("div");e.setAttribute("data-editor-rotation",(360-this.rotation)%360),e.className=this.name,e.setAttribute("id",this.id),e.tabIndex=l(this,ld)?-1:0,e.setAttribute("role","application"),this.defaultL10nId&&e.setAttribute("data-l10n-id",this.defaultL10nId),this._isVisible||e.classList.add("hidden"),this.setInForeground(),ee(this,mt,dx).call(this);let[t,n]=this.parentDimensions;this.parentRotation%180!==0&&(e.style.maxWidth=`${(100*n/t).toFixed(2)}%`,e.style.maxHeight=`${(100*t/n).toFixed(2)}%`);let[i,o]=this.getInitialTranslation();return this.translate(i,o),MB(this,e,["keydown","pointerdown","dblclick"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(l(this,Ic)||L(this,Ic,new lm({container:e,isPinchingDisabled:()=>!this.isSelected,onPinchStart:ee(this,mt,tF).bind(this),onPinching:ee(this,mt,rF).bind(this),onPinchEnd:ee(this,mt,nF).bind(this),signal:this._uiManager._signal}))),this.addStandaloneCommentButton(),this._uiManager._editorUndoBar?.hide(),e}pointerdown(e){let{isMac:t}=Ur.platform;if(e.button!==0||e.ctrlKey&&t){e.preventDefault();return}if(L(this,Rc,!0),this._isDraggable){ee(this,mt,iF).call(this,e);return}ee(this,mt,hx).call(this,e)}_onStartDragging(){}_onStopDragging(){}moveInDOM(){l(this,Ao)&&clearTimeout(l(this,Ao)),L(this,Ao,setTimeout(()=>{L(this,Ao,null),this.parent?.moveEditorInDOM(this)},0))}_setParentAndPosition(e,t,n){e.changeParent(this),this.x=t,this.y=n,this.fixAndSetPosition(),this._onTranslated()}getRect(e,t,n=this.rotation){let i=this.parentScale,[o,s]=this.pageDimensions,[a,u]=this.pageTranslation,c=e/i,f=t/i,h=this.x*o,p=this.y*s,m=this.width*o,b=this.height*s;switch(n){case 0:return[h+c+a,s-p-f-b+u,h+c+m+a,s-p-f+u];case 90:return[h+f+a,s-p+c+u,h+f+b+a,s-p+c+m+u];case 180:return[h-c-m+a,s-p+f+u,h-c+a,s-p+f+b+u];case 270:return[h-f-b+a,s-p-c-m+u,h-f+a,s-p-c+u];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(e,t){let[n,i,o,s]=e,a=o-n,u=s-i;switch(this.rotation){case 0:return[n,t-s,a,u];case 90:return[n,t-i,u,a];case 180:return[o,t-i,a,u];case 270:return[o,t-s,u,a];default:throw new Error("Invalid rotation")}}getPDFRect(){return this.getRect(0,0)}getNonHCMColor(){return this.color&&At._colorManager.convert(this._uiManager.getNonHCMColor(this.color))}onUpdatedColor(){l(this,cr)?.onUpdatedColor()}getData(){let{comment:{text:e,color:t,date:n,opacity:i,deleted:o,richText:s},uid:a,pageIndex:u,creationDate:c,modificationDate:f}=this;return{id:a,pageIndex:u,rect:this.getPDFRect(),richText:s,contentsObj:{str:e},creationDate:c,modificationDate:n||f,popupRef:!o,color:t,opacity:i}}onceAdded(e){}isEmpty(){return!1}enableEditMode(){return this.isInEditMode()?!1:(this.parent.setEditingState(!1),L(this,Dc,!0),!0)}disableEditMode(){return this.isInEditMode()?(this.parent.setEditingState(!0),L(this,Dc,!1),!0):!1}isInEditMode(){return l(this,Dc)}shouldGetKeyboardEvents(){return l(this,Sa)}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){let{top:e,left:t,bottom:n,right:i}=this.getClientDimensions(),{innerHeight:o,innerWidth:s}=window;return t<s&&i>0&&e<o&&n>0}rebuild(){ee(this,mt,dx).call(this)}rotate(e){}resize(){}serializeDeleted(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:this._initialData?.popupRef||""}}serialize(e=!1,t=null){return{annotationType:this.mode,pageIndex:this.pageIndex,rect:this.getPDFRect(),rotation:this.rotation,structTreeParentId:this._structTreeParentId,popupRef:this._initialData?.popupRef||""}}static async deserialize(e,t,n){let i=new this.prototype.constructor({parent:t,id:t.getNextId(),uiManager:n,annotationElementId:e.annotationElementId,creationDate:e.creationDate,modificationDate:e.modificationDate});i.rotation=e.rotation,L(i,Tc,e.accessibilityData),i._isCopy=e.isCopy||!1;let[o,s]=i.pageDimensions,[a,u,c,f]=i.getRectInCurrentCoords(e.rect,s);return i.x=a/o,i.y=u/s,i.width=c/o,i.height=f/s,i}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){if(l(this,Hl)?.abort(),L(this,Hl,null),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.hideCommentPopup(),l(this,Ao)&&(clearTimeout(l(this,Ao)),L(this,Ao,null)),ee(this,mt,Ug).call(this),this.removeEditToolbar(),l(this,ys)){for(let e of l(this,ys).values())clearTimeout(e);L(this,ys,null)}this.parent=null,l(this,Ic)?.destroy(),L(this,Ic,null),l(this,ms)?.remove(),L(this,ms,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(ee(this,mt,QB).call(this),l(this,Sn).classList.remove("hidden"))}get toolbarPosition(){return null}get commentButtonPosition(){return this._uiManager.direction==="ltr"?[1,0]:[0,0]}get commentButtonPositionInPage(){let{commentButtonPosition:[e,t]}=this,[n,i,o,s]=this.getPDFRect();return[At._round(n+(o-n)*e),At._round(i+(s-i)*(1-t))]}get commentButtonColor(){return this._uiManager.makeCommentColor(this.getNonHCMColor(),this.opacity)}get commentPopupPosition(){return l(this,cr).commentPopupPositionInLayer}set commentPopupPosition(e){l(this,cr).commentPopupPositionInLayer=e}hasDefaultPopupPosition(){return l(this,cr).hasDefaultPopupPosition()}get commentButtonWidth(){return l(this,cr).commentButtonWidth}get elementBeforePopup(){return this.div}setCommentButtonStates(e){l(this,cr)?.setCommentButtonStates(e)}keydown(e){if(!this.isResizable||e.target!==this.div||e.key!=="Enter")return;this._uiManager.setSelected(this),L(this,xa,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});let t=l(this,Sn).children;if(!l(this,Bs)){L(this,Bs,Array.from(t));let s=ee(this,mt,sF).bind(this),a=ee(this,mt,oF).bind(this),u=this._uiManager._signal;for(let c of l(this,Bs)){let f=c.getAttribute("data-resizer-name");c.setAttribute("role","spinbutton"),c.addEventListener("keydown",s,{signal:u}),c.addEventListener("blur",a,{signal:u}),c.addEventListener("focus",ee(this,mt,aF).bind(this,f),{signal:u}),c.setAttribute("data-l10n-id",At._l10nResizer[f])}}let n=l(this,Bs)[0],i=0;for(let s of t){if(s===n)break;i++}let o=(360-this.rotation+this.parentRotation)%360/90*(l(this,Bs).length/4);if(o!==i){if(o<i)for(let a=0;a<i-o;a++)l(this,Sn).append(l(this,Sn).firstElementChild);else if(o>i)for(let a=0;a<o-i;a++)l(this,Sn).firstElementChild.before(l(this,Sn).lastElementChild);let s=0;for(let a of t){let c=l(this,Bs)[s++].getAttribute("data-resizer-name");a.setAttribute("data-l10n-id",At._l10nResizer[c])}}ee(this,mt,px).call(this,0),L(this,Sa,!0),l(this,Sn).firstElementChild.focus({focusVisible:!0}),e.preventDefault(),e.stopImmediatePropagation()}_resizeWithKeyboard(e,t){l(this,Sa)&&ee(this,mt,fx).call(this,l(this,zm),{deltaX:e,deltaY:t,fromKeyboard:!0})}_stopResizingWithKeyboard(){ee(this,mt,Ug).call(this),this.div.focus()}select(){if(this.isSelected&&this._editToolbar){this._editToolbar.show();return}if(this.isSelected=!0,this.makeResizable(),this.div?.classList.add("selectedEditor"),!this._editToolbar){this.addEditToolbar().then(()=>{this.div?.classList.contains("selectedEditor")&&this._editToolbar?.show()});return}this._editToolbar?.show(),l(this,Er)?.toggleAltTextBadge(!1)}focus(){this.div&&!this.div.contains(document.activeElement)&&setTimeout(()=>this.div?.focus({preventScroll:!0}),0)}unselect(){this.isSelected&&(this.isSelected=!1,l(this,Sn)?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this._editToolbar?.hide(),l(this,Er)?.toggleAltTextBadge(!0),this.hideCommentPopup())}hideCommentPopup(){this.hasComment&&this._uiManager.toggleComment(null)}updateParams(e,t){}disableEditing(){}enableEditing(){}get canChangeContent(){return!1}enterInEditMode(){this.canChangeContent&&(this.enableEditMode(),this.div.focus())}dblclick(e){e.target.nodeName!=="BUTTON"&&(this.enterInEditMode(),this.parent.updateToolbar({mode:this.constructor._editorType,editId:this.uid}))}getElementForAltText(){return this.div}get contentDiv(){return this.div}get isEditing(){return l(this,Wm)}set isEditing(e){L(this,Wm,e),this.parent&&(e?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(e,t=!1){if(t){l(this,ys)||L(this,ys,new Map);let{action:n}=e,i=l(this,ys).get(n);i&&clearTimeout(i),i=setTimeout(()=>{this._reportTelemetry(e),l(this,ys).delete(n),l(this,ys).size===0&&L(this,ys,null)},At._telemetryTimeout),l(this,ys).set(n,i);return}e.type||(e.type=this.editorType),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:e}})}show(e=this._isVisible){this.div.classList.toggle("hidden",!e),this._isVisible=e}enable(){this.div&&(this.div.tabIndex=0),L(this,ld,!1)}disable(){this.div&&(this.div.tabIndex=-1),L(this,ld,!0)}updateFakeAnnotationElement(e){if(!l(this,ms)&&!this.deleted){L(this,ms,e.addFakeAnnotation(this));return}if(this.deleted){l(this,ms).remove(),L(this,ms,null);return}(this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized)&&l(this,ms).updateEdited({rect:this.getPDFRect(),popup:this.comment})}renderAnnotationElement(e){if(this.deleted)return e.hide(),null;let t=e.container.querySelector(".annotationContent");if(!t)t=document.createElement("div"),t.classList.add("annotationContent",this.editorType),e.container.prepend(t);else if(t.nodeName==="CANVAS"){let n=t;t=document.createElement("div"),t.classList.add("annotationContent",this.editorType),n.before(t)}return t}resetAnnotationElement(e){let{firstElementChild:t}=e.container;t?.nodeName==="DIV"&&t.classList.contains("annotationContent")&&t.remove()}};Tc=new WeakMap,Bs=new WeakMap,Er=new WeakMap,cr=new WeakMap,Aa=new WeakMap,ld=new WeakMap,ql=new WeakMap,$m=new WeakMap,Sn=new WeakMap,Cc=new WeakMap,xa=new WeakMap,ms=new WeakMap,Hl=new WeakMap,zm=new WeakMap,Rc=new WeakMap,Di=new WeakMap,Wm=new WeakMap,Dc=new WeakMap,Sa=new WeakMap,Ao=new WeakMap,ud=new WeakMap,cd=new WeakMap,ys=new WeakMap,Ic=new WeakMap,qm=new WeakMap,Yv=new WeakMap,mt=new WeakSet,lx=function([e,t],n,i){[n,i]=this.screenToPageTranslation(n,i),this.x+=n/e,this.y+=i/t,this._onTranslating(this.x,this.y),this.fixAndSetPosition()},Hm=new WeakSet,ux=function(e,t,n){switch(n){case 90:return[t,-e];case 180:return[-e,-t];case 270:return[-t,e];default:return[e,t]}},Nw=function(e){switch(e){case 90:{let[t,n]=this.pageDimensions;return[0,-t/n,n/t,0]}case 180:return[-1,0,0,-1];case 270:{let[t,n]=this.pageDimensions;return[0,t/n,-n/t,0]}default:return[1,0,0,1]}},QB=function(){if(l(this,Sn))return;L(this,Sn,document.createElement("div")),l(this,Sn).classList.add("resizers");let e=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],t=this._uiManager._signal;for(let n of e){let i=document.createElement("div");l(this,Sn).append(i),i.classList.add("resizer",n),i.setAttribute("data-resizer-name",n),i.addEventListener("pointerdown",ee(this,mt,eF).bind(this,n),{signal:t}),i.addEventListener("contextmenu",Ki,{signal:t}),i.tabIndex=-1}this.div.prepend(l(this,Sn))},eF=function(e,t){t.preventDefault();let{isMac:n}=Ur.platform;if(t.button!==0||t.ctrlKey&&n)return;l(this,Er)?.toggle(!1);let i=this._isDraggable;this._isDraggable=!1,L(this,Cc,[t.screenX,t.screenY]);let o=new AbortController,s=this._uiManager.combinedSignal(o);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",ee(this,mt,fx).bind(this,e),{passive:!0,capture:!0,signal:s}),window.addEventListener("touchmove",Cr,{passive:!1,signal:s}),window.addEventListener("contextmenu",Ki,{signal:s}),L(this,xa,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});let a=this.parent.div.style.cursor,u=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(t.target).cursor;let c=()=>{o.abort(),this.parent.togglePointerEvents(!0),l(this,Er)?.toggle(!0),this._isDraggable=i,this.parent.div.style.cursor=a,this.div.style.cursor=u,ee(this,mt,kw).call(this)};window.addEventListener("pointerup",c,{signal:s}),window.addEventListener("blur",c,{signal:s})},cx=function(e,t,n,i){this.width=n,this.height=i,this.x=e,this.y=t,this.setDims(),this.fixAndSetPosition(),this._onResized()},kw=function(){if(!l(this,xa))return;let{savedX:e,savedY:t,savedWidth:n,savedHeight:i}=l(this,xa);L(this,xa,null);let o=this.x,s=this.y,a=this.width,u=this.height;o===e&&s===t&&a===n&&u===i||this.addCommands({cmd:ee(this,mt,cx).bind(this,o,s,a,u),undo:ee(this,mt,cx).bind(this,e,t,n,i),mustExec:!0})},fx=function(e,t){let[n,i]=this.parentDimensions,o=this.x,s=this.y,a=this.width,u=this.height,c=At.MIN_SIZE/n,f=At.MIN_SIZE/i,h=ee(this,mt,Nw).call(this,this.rotation),p=(re,N)=>[h[0]*re+h[2]*N,h[1]*re+h[3]*N],m=ee(this,mt,Nw).call(this,360-this.rotation),b=(re,N)=>[m[0]*re+m[2]*N,m[1]*re+m[3]*N],v,w,y=!1,_=!1;switch(e){case"topLeft":y=!0,v=(re,N)=>[0,0],w=(re,N)=>[re,N];break;case"topMiddle":v=(re,N)=>[re/2,0],w=(re,N)=>[re/2,N];break;case"topRight":y=!0,v=(re,N)=>[re,0],w=(re,N)=>[0,N];break;case"middleRight":_=!0,v=(re,N)=>[re,N/2],w=(re,N)=>[0,N/2];break;case"bottomRight":y=!0,v=(re,N)=>[re,N],w=(re,N)=>[0,0];break;case"bottomMiddle":v=(re,N)=>[re/2,N],w=(re,N)=>[re/2,0];break;case"bottomLeft":y=!0,v=(re,N)=>[0,N],w=(re,N)=>[re,0];break;case"middleLeft":_=!0,v=(re,N)=>[0,N/2],w=(re,N)=>[re,N/2];break}let E=v(a,u),S=w(a,u),A=p(...S),F=At._round(o+A[0]),D=At._round(s+A[1]),H=1,J=1,K,ne;if(t.fromKeyboard)({deltaX:K,deltaY:ne}=t);else{let{screenX:re,screenY:N}=t,[x,P]=l(this,Cc);[K,ne]=this.screenToPageTranslation(re-x,N-P),l(this,Cc)[0]=re,l(this,Cc)[1]=N}if([K,ne]=b(K/n,ne/i),y){let re=Math.hypot(a,u);H=J=Math.max(Math.min(Math.hypot(S[0]-E[0]-K,S[1]-E[1]-ne)/re,1/a,1/u),c/a,f/u)}else _?H=Wn(Math.abs(S[0]-E[0]-K),c,1)/a:J=Wn(Math.abs(S[1]-E[1]-ne),f,1)/u;let k=At._round(a*H),$=At._round(u*J);A=p(...w(k,$));let Y=F-A[0],ie=D-A[1];l(this,Di)||L(this,Di,[this.x,this.y,this.width,this.height]),this.width=k,this.height=$,this.x=Y,this.y=ie,this.setDims(),this.fixAndSetPosition(),this._onResizing()},tF=function(){L(this,xa,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height}),l(this,Er)?.toggle(!1),this.parent.togglePointerEvents(!1)},rF=function(e,t,n){let o=.7*(n/t)+1-.7;if(o===1)return;let s=ee(this,mt,Nw).call(this,this.rotation),a=(F,D)=>[s[0]*F+s[2]*D,s[1]*F+s[3]*D],[u,c]=this.parentDimensions,f=this.x,h=this.y,p=this.width,m=this.height,b=At.MIN_SIZE/u,v=At.MIN_SIZE/c;o=Math.max(Math.min(o,1/p,1/m),b/p,v/m);let w=At._round(p*o),y=At._round(m*o);if(w===p&&y===m)return;l(this,Di)||L(this,Di,[f,h,p,m]);let _=a(p/2,m/2),E=At._round(f+_[0]),S=At._round(h+_[1]),A=a(w/2,y/2);this.x=E-A[0],this.y=S-A[1],this.width=w,this.height=y,this.setDims(),this.fixAndSetPosition(),this._onResizing()},nF=function(){l(this,Er)?.toggle(!0),this.parent.togglePointerEvents(!0),ee(this,mt,kw).call(this)},hx=function(e){let{isMac:t}=Ur.platform;e.ctrlKey&&!t||e.shiftKey||e.metaKey&&t?this.parent.toggleSelected(this):this.parent.setSelected(this)},iF=function(e){let{isSelected:t}=this;this._uiManager.setUpDragSession();let n=!1,i=new AbortController,o=this._uiManager.combinedSignal(i),s={capture:!0,passive:!1,signal:o},a=c=>{i.abort(),L(this,ql,null),L(this,Rc,!1),this._uiManager.endDragSession()||ee(this,mt,hx).call(this,c),n&&this._onStopDragging()};t&&(L(this,ud,e.clientX),L(this,cd,e.clientY),L(this,ql,e.pointerId),L(this,$m,e.pointerType),window.addEventListener("pointermove",c=>{n||(n=!0,this._uiManager.toggleComment(this,!0,!1),this._onStartDragging());let{clientX:f,clientY:h,pointerId:p}=c;if(p!==l(this,ql)){Cr(c);return}let[m,b]=this.screenToPageTranslation(f-l(this,ud),h-l(this,cd));L(this,ud,f),L(this,cd,h),this._uiManager.dragSelectedEditors(m,b)},s),window.addEventListener("touchmove",Cr,s),window.addEventListener("pointerdown",c=>{c.pointerType===l(this,$m)&&(l(this,Ic)||c.isPrimary)&&a(c),Cr(c)},s));let u=c=>{if(!l(this,ql)||l(this,ql)===c.pointerId){a(c);return}Cr(c)};window.addEventListener("pointerup",u,{signal:o}),window.addEventListener("blur",u,{signal:o})},dx=function(){if(l(this,Hl)||!this.div)return;L(this,Hl,new AbortController);let e=this._uiManager.combinedSignal(l(this,Hl));this.div.addEventListener("focusin",this.focusin.bind(this),{signal:e}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:e})},sF=function(e){At._resizerKeyboardManager.exec(this,e)},oF=function(e){l(this,Sa)&&e.relatedTarget?.parentNode!==l(this,Sn)&&ee(this,mt,Ug).call(this)},aF=function(e){L(this,zm,l(this,Sa)?e:"")},px=function(e){if(l(this,Bs))for(let t of l(this,Bs))t.tabIndex=e},Ug=function(){L(this,Sa,!1),ee(this,mt,px).call(this,-1),ee(this,mt,kw).call(this)},q(At,Hm),Ke(At,"_l10n",null),Ke(At,"_l10nResizer",null),Ke(At,"_borderLineWidth",-1),Ke(At,"_colorManager",new rx),Ke(At,"_zIndex",1),Ke(At,"_telemetryTimeout",1e3);mr=At,gx=class extends mr{constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}},oB=3285377520,as=4294901760,ho=65535,hv=class{constructor(e){this.h1=e?e&4294967295:oB,this.h2=e?e&4294967295:oB}update(e){let t,n;if(typeof e=="string"){t=new Uint8Array(e.length*2),n=0;for(let v=0,w=e.length;v<w;v++){let y=e.charCodeAt(v);y<=255?t[n++]=y:(t[n++]=y>>>8,t[n++]=y&255)}}else if(ArrayBuffer.isView(e))t=e.slice(),n=t.byteLength;else throw new Error("Invalid data format, must be a string or TypedArray.");let i=n>>2,o=n-i*4,s=new Uint32Array(t.buffer,0,i),a=0,u=0,c=this.h1,f=this.h2,h=3432918353,p=461845907,m=h&ho,b=p&ho;for(let v=0;v<i;v++)v&1?(a=s[v],a=a*h&as|a*m&ho,a=a<<15|a>>>17,a=a*p&as|a*b&ho,c^=a,c=c<<13|c>>>19,c=c*5+3864292196):(u=s[v],u=u*h&as|u*m&ho,u=u<<15|u>>>17,u=u*p&as|u*b&ho,f^=u,f=f<<13|f>>>19,f=f*5+3864292196);switch(a=0,o){case 3:a^=t[i*4+2]<<16;case 2:a^=t[i*4+1]<<8;case 1:a^=t[i*4],a=a*h&as|a*m&ho,a=a<<15|a>>>17,a=a*p&as|a*b&ho,i&1?c^=a:f^=a}this.h1=c,this.h2=f}hexdigest(){let e=this.h1,t=this.h2;return e^=t>>>1,e=e*3981806797&as|e*36045&ho,t=t*4283543511&as|((t<<16|e>>>16)*2950163797&as)>>>16,e^=t>>>1,e=e*444984403&as|e*60499&ho,t=t*3301882366&as|((t<<16|e>>>16)*3120437893&as)>>>16,e^=t>>>1,(e>>>0).toString(16).padStart(8,"0")+(t>>>0).toString(16).padStart(8,"0")}},mx=Object.freeze({map:null,hash:"",transfer:void 0}),um=class{constructor(){q(this,Xv);q(this,Oc,!1);q(this,Nc,null);q(this,Ta,null);q(this,Tn,new Map);this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(e,t){let n=l(this,Tn).get(e);return n===void 0?t:Object.assign(t,n)}getRawValue(e){return l(this,Tn).get(e)}remove(e){let t=l(this,Tn).get(e);if(t!==void 0&&(t instanceof mr&&l(this,Ta).delete(t.annotationElementId),l(this,Tn).delete(e),l(this,Tn).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function")){for(let n of l(this,Tn).values())if(n instanceof mr)return;this.onAnnotationEditor(null)}}setValue(e,t){let n=l(this,Tn).get(e),i=!1;if(n!==void 0)for(let[o,s]of Object.entries(t))n[o]!==s&&(i=!0,n[o]=s);else i=!0,l(this,Tn).set(e,t);i&&ee(this,Xv,lF).call(this),t instanceof mr&&((l(this,Ta)||L(this,Ta,new Map)).set(t.annotationElementId,t),typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(t.constructor._type))}has(e){return l(this,Tn).has(e)}get size(){return l(this,Tn).size}resetModified(){l(this,Oc)&&(L(this,Oc,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new dv(this)}get serializable(){if(l(this,Tn).size===0)return mx;let e=new Map,t=new hv,n=[],i=Object.create(null),o=!1;for(let[s,a]of l(this,Tn)){let u=a instanceof mr?a.serialize(!1,i):a;u&&(e.set(s,u),t.update(`${s}:${JSON.stringify(u)}`),o||(o=!!u.bitmap))}if(o)for(let s of e.values())s.bitmap&&n.push(s.bitmap);return e.size>0?{map:e,hash:t.hexdigest(),transfer:n}:mx}get editorStats(){let e=null,t=new Map,n=0,i=0;for(let o of l(this,Tn).values()){if(!(o instanceof mr)){o.popup&&(o.popup.deleted?i+=1:n+=1);continue}o.isCommentDeleted?i+=1:o.hasEditedComment&&(n+=1);let s=o.telemetryFinalData;if(!s)continue;let{type:a}=s;t.has(a)||t.set(a,Object.getPrototypeOf(o).constructor),e||(e=Object.create(null));let u=e[a]||(e[a]=new Map);for(let[c,f]of Object.entries(s)){if(c==="type")continue;let h=u.get(c);h||(h=new Map,u.set(c,h));let p=h.get(f)??0;h.set(f,p+1)}}if((i>0||n>0)&&(e||(e=Object.create(null)),e.comments={deleted:i,edited:n}),!e)return null;for(let[o,s]of t)e[o]=s.computeTelemetryFinalData(e[o]);return e}resetModifiedIds(){L(this,Nc,null)}updateEditor(e,t){let n=l(this,Ta)?.get(e);return n?(n.updateFromAnnotationLayer(t),!0):!1}getEditor(e){return l(this,Ta)?.get(e)||null}get modifiedIds(){if(l(this,Nc))return l(this,Nc);let e=[];if(l(this,Ta))for(let t of l(this,Ta).values())t.serialize()&&e.push(t.annotationElementId);return L(this,Nc,{ids:new Set(e),hash:e.join(",")})}[Symbol.iterator](){return l(this,Tn).entries()}};Oc=new WeakMap,Nc=new WeakMap,Ta=new WeakMap,Tn=new WeakMap,Xv=new WeakSet,lF=function(){l(this,Oc)||(L(this,Oc,!0),typeof this.onSetModified=="function"&&this.onSetModified())};dv=class extends um{constructor(t){super();q(this,Gm);let{map:n,hash:i,transfer:o}=t.serializable,s=structuredClone(n,o?{transfer:o}:null);L(this,Gm,{map:s,hash:i,transfer:o})}get print(){dr("Should not call PrintAnnotationStorage.print")}get serializable(){return l(this,Gm)}get modifiedIds(){return wt(this,"modifiedIds",{ids:new Set,hash:""})}};Gm=new WeakMap;yx=class{constructor({ownerDocument:e=globalThis.document,styleElement:t=null}){q(this,fd,new Set);this._document=e,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(e){this.nativeFontFaces.add(e),this._document.fonts.add(e)}removeNativeFontFace(e){this.nativeFontFaces.delete(e),this._document.fonts.delete(e)}insertRule(e){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));let t=this.styleElement.sheet;t.insertRule(e,t.cssRules.length)}clear(){for(let e of this.nativeFontFaces)this._document.fonts.delete(e);this.nativeFontFaces.clear(),l(this,fd).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:e,disableFontFace:t,_inspectFont:n}){if(!(!e||l(this,fd).has(e.loadedName))){if(Bt(!t,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){let{loadedName:i,src:o,style:s}=e,a=new FontFace(i,o,s);this.addNativeFontFace(a);try{await a.load(),l(this,fd).add(i),n?.(e)}catch{_t(`Cannot load system font: ${e.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(a)}return}dr("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(e){if(e.attached||e.missingFile&&!e.systemFontInfo)return;if(e.attached=!0,e.systemFontInfo){await this.loadSystemFont(e);return}if(this.isFontLoadingAPISupported){let n=e.createNativeFontFace();if(n){this.addNativeFontFace(n);try{await n.loaded}catch(i){throw _t(`Failed to load font '${n.family}': '${i}'.`),e.disableFontFace=!0,i}}return}let t=e.createFontFaceRule();if(t){if(this.insertRule(t),this.isSyncFontLoadingSupported)return;await new Promise(n=>{let i=this._queueLoadingCallback(n);this._prepareFontLoadEvent(e,i)})}}get isFontLoadingAPISupported(){let e=!!this._document?.fonts;return wt(this,"isFontLoadingAPISupported",e)}get isSyncFontLoadingSupported(){return wt(this,"isSyncFontLoadingSupported",Qn||Ur.platform.isFirefox)}_queueLoadingCallback(e){function t(){for(Bt(!i.done,"completeRequest() cannot be called twice."),i.done=!0;n.length>0&&n[0].done;){let o=n.shift();setTimeout(o.callback,0)}}let{loadingRequests:n}=this,i={done:!1,complete:t,callback:e};return n.push(i),i}get _loadTestFont(){let e=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return wt(this,"_loadTestFont",e)}_prepareFontLoadEvent(e,t){function n(S,A){return S.charCodeAt(A)<<24|S.charCodeAt(A+1)<<16|S.charCodeAt(A+2)<<8|S.charCodeAt(A+3)&255}function i(S,A,F,D){let H=S.substring(0,A),J=S.substring(A+F);return H+D+J}let o,s,a=this._document.createElement("canvas");a.width=1,a.height=1;let u=a.getContext("2d"),c=0;function f(S,A){if(++c>30){_t("Load test font never loaded."),A();return}if(u.font="30px "+S,u.fillText(".",0,20),u.getImageData(0,0,1,1).data[3]>0){A();return}setTimeout(f.bind(null,S,A))}let h=`lt${Date.now()}${this.loadTestFontId++}`,p=this._loadTestFont;p=i(p,976,h.length,h);let b=16,v=1482184792,w=n(p,b);for(o=0,s=h.length-3;o<s;o+=4)w=w-v+n(h,o)|0;o<h.length&&(w=w-v+n(h+"XXX",o)|0),p=i(p,b,4,VG(w));let y=`url(data:font/opentype;base64,${btoa(p)});`,_=`@font-face {font-family:"${h}";src:${y}}`;this.insertRule(_);let E=this._document.createElement("div");E.style.visibility="hidden",E.style.width=E.style.height="10px",E.style.position="absolute",E.style.top=E.style.left="0px";for(let S of[e.loadedName,h]){let A=this._document.createElement("span");A.textContent="Hi",A.style.fontFamily=S,E.append(A)}this._document.body.append(E),f(h,()=>{E.remove(),t.complete()})}};fd=new WeakMap;bx=class{constructor(e,t=null,n,i){q(this,rr);this.compiledGlyphs=Object.create(null),L(this,rr,e),this._inspectFont=t,n&&Object.assign(this,n),i&&(this.charProcOperatorList=i)}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let e;if(!this.cssFontInfo)e=new FontFace(this.loadedName,this.data,{});else{let t={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(t.style=`oblique ${this.cssFontInfo.italicAngle}deg`),e=new FontFace(this.cssFontInfo.fontFamily,this.data,t)}return this._inspectFont?.(this),e}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;let e=`url(data:${this.mimetype};base64,${xB(this.data)});`,t;if(!this.cssFontInfo)t=`@font-face {font-family:"${this.loadedName}";src:${e}}`;else{let n=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(n+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),t=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${n}src:${e}}`}return this._inspectFont?.(this,e),t}getPathGenerator(e,t){if(this.compiledGlyphs[t]!==void 0)return this.compiledGlyphs[t];let n=this.loadedName+"_path_"+t,i;try{i=e.get(n)}catch(s){_t(`getPathGenerator - ignoring character: "${s}".`)}let o=IB(i?.path);return this.fontExtraProperties||e.delete(n),this.compiledGlyphs[t]=o}get black(){return l(this,rr).black}get bold(){return l(this,rr).bold}get disableFontFace(){return l(this,rr).disableFontFace??!1}set disableFontFace(e){wt(this,"disableFontFace",!!e)}get fontExtraProperties(){return l(this,rr).fontExtraProperties??!1}get isInvalidPDFjsFont(){return l(this,rr).isInvalidPDFjsFont}get isType3Font(){return l(this,rr).isType3Font}get italic(){return l(this,rr).italic}get missingFile(){return l(this,rr).missingFile}get remeasure(){return l(this,rr).remeasure}get vertical(){return l(this,rr).vertical}get ascent(){return l(this,rr).ascent}get defaultWidth(){return l(this,rr).defaultWidth}get descent(){return l(this,rr).descent}get bbox(){return l(this,rr).bbox}set bbox(e){wt(this,"bbox",e)}get fontMatrix(){return l(this,rr).fontMatrix}get fallbackName(){return l(this,rr).fallbackName}get loadedName(){return l(this,rr).loadedName}get mimetype(){return l(this,rr).mimetype}get name(){return l(this,rr).name}get data(){return l(this,rr).data}clearData(){l(this,rr).clearData()}get cssFontInfo(){return l(this,rr).cssFontInfo}get systemFontInfo(){return l(this,rr).systemFontInfo}get defaultVMetrics(){return l(this,rr).defaultVMetrics}};rr=new WeakMap;jh=class jh{constructor(e){q(this,pd);q(this,hd);q(this,dd);q(this,Vm);L(this,hd,e),L(this,dd,new DataView(l(this,hd))),L(this,Vm,new TextDecoder)}static write(e){let t=new TextEncoder,n={},i=0;for(let c of jh.strings){let f=t.encode(e[c]);n[c]=f,i+=4+f.length}let o=new ArrayBuffer(i),s=new Uint8Array(o),a=new DataView(o),u=0;for(let c of jh.strings){let f=n[c],h=f.length;a.setUint32(u,h),s.set(f,u+4),u+=4+h}return Bt(u===o.byteLength,"CssFontInfo.write: Buffer overflow"),o}get fontFamily(){return ee(this,pd,Lw).call(this,0)}get fontWeight(){return ee(this,pd,Lw).call(this,1)}get italicAngle(){return ee(this,pd,Lw).call(this,2)}};hd=new WeakMap,dd=new WeakMap,Vm=new WeakMap,pd=new WeakSet,Lw=function(e){Bt(e<jh.strings.length,"Invalid string index");let t=0;for(let i=0;i<e;i++)t+=l(this,dd).getUint32(t)+4;let n=l(this,dd).getUint32(t);return l(this,Vm).decode(new Uint8Array(l(this,hd),t+4,n))},Ke(jh,"strings",["fontFamily","fontWeight","italicAngle"]);pv=jh,$h=class $h{constructor(e){q(this,Lc);q(this,Gl);q(this,xo);q(this,kc);L(this,Gl,e),L(this,xo,new DataView(l(this,Gl))),L(this,kc,new TextDecoder)}static write(e){let t=new TextEncoder,n={},i=0;for(let p of $h.strings){let m=t.encode(e[p]);n[p]=m,i+=4+m.length}i+=4;let o,s,a=1+i;e.style&&(o=t.encode(e.style.style),s=t.encode(e.style.weight),a+=4+o.length+4+s.length);let u=new ArrayBuffer(a),c=new Uint8Array(u),f=new DataView(u),h=0;f.setUint8(h++,e.guessFallback?1:0),f.setUint32(h,0),h+=4,i=0;for(let p of $h.strings){let m=n[p],b=m.length;i+=4+b,f.setUint32(h,b),c.set(m,h+4),h+=4+b}return f.setUint32(h-i-4,i),e.style&&(f.setUint32(h,o.length),c.set(o,h+4),h+=4+o.length,f.setUint32(h,s.length),c.set(s,h+4),h+=4+s.length),Bt(h<=u.byteLength,"SubstitionInfo.write: Buffer overflow"),u.transferToFixedLength(h)}get guessFallback(){return l(this,xo).getUint8(0)!==0}get css(){return ee(this,Lc,jg).call(this,0)}get loadedName(){return ee(this,Lc,jg).call(this,1)}get baseFontName(){return ee(this,Lc,jg).call(this,2)}get src(){return ee(this,Lc,jg).call(this,3)}get style(){let e=1;e+=4+l(this,xo).getUint32(e);let t=l(this,xo).getUint32(e),n=l(this,kc).decode(new Uint8Array(l(this,Gl),e+4,t));e+=4+t;let i=l(this,xo).getUint32(e),o=l(this,kc).decode(new Uint8Array(l(this,Gl),e+4,i));return{style:n,weight:o}}};Gl=new WeakMap,xo=new WeakMap,kc=new WeakMap,Lc=new WeakSet,jg=function(e){Bt(e<$h.strings.length,"Invalid string index");let t=5;for(let i=0;i<e;i++)t+=l(this,xo).getUint32(t)+4;let n=l(this,xo).getUint32(t);return l(this,kc).decode(new Uint8Array(l(this,Gl),t+4,n))},Ke($h,"strings",["css","loadedName","baseFontName","src"]);gv=$h,St=class St{constructor({data:e,extra:t}){q(this,Fr);q(this,So);q(this,Ym);q(this,nr);L(this,So,e),L(this,Ym,new TextDecoder),L(this,nr,new DataView(l(this,So))),t&&Object.assign(this,t)}get black(){return ee(this,Fr,ks).call(this,0)}get bold(){return ee(this,Fr,ks).call(this,1)}get disableFontFace(){return ee(this,Fr,ks).call(this,2)}get fontExtraProperties(){return ee(this,Fr,ks).call(this,3)}get isInvalidPDFjsFont(){return ee(this,Fr,ks).call(this,4)}get isType3Font(){return ee(this,Fr,ks).call(this,5)}get italic(){return ee(this,Fr,ks).call(this,6)}get missingFile(){return ee(this,Fr,ks).call(this,7)}get remeasure(){return ee(this,Fr,ks).call(this,8)}get vertical(){return ee(this,Fr,ks).call(this,9)}get ascent(){return ee(this,Fr,Pw).call(this,0)}get defaultWidth(){return ee(this,Fr,Pw).call(this,1)}get descent(){return ee(this,Fr,Pw).call(this,2)}get bbox(){let e=l(St,md);if(l(this,nr).getUint8(e)===0)return;e+=1;let n=[];for(let i=0;i<4;i++)n.push(l(this,nr).getInt16(e,!0)),e+=2;return n}get fontMatrix(){let e=l(St,yd);if(l(this,nr).getUint8(e)===0)return;e+=1;let n=[];for(let i=0;i<6;i++)n.push(l(this,nr).getFloat64(e,!0)),e+=8;return n}get defaultVMetrics(){let e=l(St,bd);if(l(this,nr).getUint8(e)===0)return;e+=1;let n=[];for(let i=0;i<3;i++)n.push(l(this,nr).getInt16(e,!0)),e+=2;return n}get fallbackName(){return ee(this,Fr,$g).call(this,0)}get loadedName(){return ee(this,Fr,$g).call(this,1)}get mimetype(){return ee(this,Fr,$g).call(this,2)}get name(){return ee(this,Fr,$g).call(this,3)}get data(){let e=l(St,Ii),t=l(this,nr).getUint32(e);e+=4+t;let n=l(this,nr).getUint32(e);e+=4+n;let i=l(this,nr).getUint32(e);e+=4+i;let o=l(this,nr).getUint32(e);if(o!==0)return new Uint8Array(l(this,So),e+4,o)}clearData(){let e=l(St,Ii),t=l(this,nr).getUint32(e);e+=4+t;let n=l(this,nr).getUint32(e);e+=4+n;let i=l(this,nr).getUint32(e);e+=4+i;let o=l(this,nr).getUint32(e);new Uint8Array(l(this,So),e+4,o).fill(0),l(this,nr).setUint32(e,0)}get cssFontInfo(){let e=l(St,Ii),t=l(this,nr).getUint32(e);e+=4+t;let n=l(this,nr).getUint32(e);e+=4+n;let i=l(this,nr).getUint32(e);if(i===0)return null;let o=new Uint8Array(i);return o.set(new Uint8Array(l(this,So),e+4,i)),new pv(o.buffer)}get systemFontInfo(){let e=l(St,Ii),t=l(this,nr).getUint32(e);e+=4+t;let n=l(this,nr).getUint32(e);if(n===0)return null;let i=new Uint8Array(n);return i.set(new Uint8Array(l(this,So),e+4,n)),new gv(i.buffer)}static write(e){let t=e.systemFontInfo?gv.write(e.systemFontInfo):null,n=e.cssFontInfo?pv.write(e.cssFontInfo):null,i=new TextEncoder,o={},s=0;for(let v of St.strings)o[v]=i.encode(e[v]),s+=4+o[v].length;let a=l(St,Ii)+4+s+4+(t?t.byteLength:0)+4+(n?n.byteLength:0)+4+(e.data?e.data.length:0),u=new ArrayBuffer(a),c=new Uint8Array(u),f=new DataView(u),h=0,p=St.bools.length,m=0,b=0;for(let v=0;v<p;v++){let w=e[St.bools[v]];m|=(w===void 0?0:w?2:1)<<b,b+=2,(b===8||v===p-1)&&(f.setUint8(h++,m),m=0,b=0)}Bt(h===l(St,gd),"FontInfo.write: Boolean properties offset mismatch");for(let v of St.numbers)f.setFloat64(h,e[v]),h+=8;if(Bt(h===l(St,md),"FontInfo.write: Number properties offset mismatch"),e.bbox){f.setUint8(h++,4);for(let v of e.bbox)f.setInt16(h,v,!0),h+=2}else f.setUint8(h++,0),h+=8;if(Bt(h===l(St,yd),"FontInfo.write: BBox properties offset mismatch"),e.fontMatrix){f.setUint8(h++,6);for(let v of e.fontMatrix)f.setFloat64(h,v,!0),h+=8}else f.setUint8(h++,0),h+=48;if(Bt(h===l(St,bd),"FontInfo.write: FontMatrix properties offset mismatch"),e.defaultVMetrics){f.setUint8(h++,1);for(let v of e.defaultVMetrics)f.setInt16(h,v,!0),h+=2}else f.setUint8(h++,0),h+=6;Bt(h===l(St,Ii),"FontInfo.write: DefaultVMetrics properties offset mismatch"),f.setUint32(l(St,Ii),0),h+=4;for(let v of St.strings){let w=o[v],y=w.length;f.setUint32(h,y),c.set(w,h+4),h+=4+y}if(f.setUint32(l(St,Ii),h-l(St,Ii)-4),!t)f.setUint32(h,0),h+=4;else{let v=t.byteLength;f.setUint32(h,v),Bt(h+4+v<=u.byteLength,"FontInfo.write: Buffer overflow at systemFontInfo"),c.set(new Uint8Array(t),h+4),h+=4+v}if(!n)f.setUint32(h,0),h+=4;else{let v=n.byteLength;f.setUint32(h,v),Bt(h+4+v<=u.byteLength,"FontInfo.write: Buffer overflow at cssFontInfo"),c.set(new Uint8Array(n),h+4),h+=4+v}return e.data===void 0?(f.setUint32(h,0),h+=4):(f.setUint32(h,e.data.length),c.set(e.data,h+4),h+=4+e.data.length),Bt(h<=u.byteLength,"FontInfo.write: Buffer overflow"),u.transferToFixedLength(h)}};gd=new WeakMap,md=new WeakMap,yd=new WeakMap,bd=new WeakMap,Ii=new WeakMap,So=new WeakMap,Ym=new WeakMap,nr=new WeakMap,Fr=new WeakSet,ks=function(e){Bt(e<St.bools.length,"Invalid boolean index");let t=Math.floor(e/4),n=e*2%8,i=l(this,nr).getUint8(t)>>n&3;return i===0?void 0:i===2},Pw=function(e){return Bt(e<St.numbers.length,"Invalid number index"),l(this,nr).getFloat64(l(St,gd)+e*8)},$g=function(e){Bt(e<St.strings.length,"Invalid string index");let t=l(St,Ii)+4;for(let o=0;o<e;o++)t+=l(this,nr).getUint32(t)+4;let n=l(this,nr).getUint32(t),i=new Uint8Array(n);return i.set(new Uint8Array(l(this,So),t+4,n)),l(this,Ym).decode(i)},Ke(St,"bools",["black","bold","disableFontFace","fontExtraProperties","isInvalidPDFjsFont","isType3Font","italic","missingFile","remeasure","vertical"]),Ke(St,"numbers",["ascent","defaultWidth","descent"]),Ke(St,"strings",["fallbackName","loadedName","mimetype","name"]),q(St,gd,Math.ceil(St.bools.length*2/8)),q(St,md,l(St,gd)+St.numbers.length*8),q(St,yd,l(St,md)+1+8),q(St,bd,l(St,yd)+1+48),q(St,Ii,l(St,bd)+1+6);wx=St,pr=class pr{constructor(e){this.buffer=e,this.view=new DataView(e),this.data=new Uint8Array(e)}static write(e){let t,n=null,i=[],o=[],s=[],a=[],u=null,c=null;switch(e[0]){case"RadialAxial":t=e[1]==="axial"?1:2,n=e[2],s=e[3],t===1?i.push(...e[4],...e[5]):i.push(e[4][0],e[4][1],e[6],e[5][0],e[5][1],e[7]);break;case"Mesh":t=3,u=e[1],i=e[2],o=e[3],a=e[4]||[],n=e[6],c=e[7];break;default:throw new Error(`Unsupported pattern type: ${e[0]}`)}let f=Math.floor(i.length/2),h=Math.floor(o.length/3),p=s.length,m=a.length,b=0;for(let A of a)b+=1,b=Math.ceil(b/4)*4,b+=4+A.coords.length*4,b+=4+A.colors.length*4,A.verticesPerRow!==void 0&&(b+=4);let v=20+f*8+h*3+p*8+(n?16:0)+(c?3:0)+b,w=new ArrayBuffer(v),y=new DataView(w),_=new Uint8Array(w);y.setUint8(l(pr,Xm),t),y.setUint8(l(pr,Km),n?1:0),y.setUint8(l(pr,Zm),c?1:0),y.setUint8(l(pr,Jm),u),y.setUint32(l(pr,Qm),f,!0),y.setUint32(l(pr,ey),h,!0),y.setUint32(l(pr,ty),p,!0),y.setUint32(l(pr,ry),m,!0);let E=20;new Float32Array(w,E,f*2).set(i),E+=f*8,_.set(o,E),E+=h*3;for(let[A,F]of s)y.setFloat32(E,A,!0),E+=4,y.setUint32(E,parseInt(F.slice(1),16),!0),E+=4;if(n)for(let A of n)y.setFloat32(E,A,!0),E+=4;c&&(_.set(c,E),E+=3);for(let A=0;A<a.length;A++){let F=a[A];y.setUint8(E,F.type),E+=1,E=Math.ceil(E/4)*4,y.setUint32(E,F.coords.length,!0),E+=4,new Int32Array(w,E,F.coords.length).set(F.coords),E+=F.coords.length*4,y.setUint32(E,F.colors.length,!0),E+=4,new Int32Array(w,E,F.colors.length).set(F.colors),E+=F.colors.length*4,F.verticesPerRow!==void 0&&(y.setUint32(E,F.verticesPerRow,!0),E+=4)}return w}getIR(){let e=this.view,t=this.data[l(pr,Xm)],n=!!this.data[l(pr,Km)],i=!!this.data[l(pr,Zm)],o=e.getUint32(l(pr,Qm),!0),s=e.getUint32(l(pr,ey),!0),a=e.getUint32(l(pr,ty),!0),u=e.getUint32(l(pr,ry),!0),c=20,f=new Float32Array(this.buffer,c,o*2);c+=o*8;let h=new Uint8Array(this.buffer,c,s*3);c+=s*3;let p=[];for(let w=0;w<a;++w){let y=e.getFloat32(c,!0);c+=4;let _=e.getUint32(c,!0);c+=4,p.push([y,`#${_.toString(16).padStart(6,"0")}`])}let m=null;if(n){m=[];for(let w=0;w<4;++w)m.push(e.getFloat32(c,!0)),c+=4}let b=null;i&&(b=new Uint8Array(this.buffer,c,3),c+=3);let v=[];for(let w=0;w<u;++w){let y=e.getUint8(c);c+=1,c=Math.ceil(c/4)*4;let _=e.getUint32(c,!0);c+=4;let E=new Int32Array(this.buffer,c,_);c+=_*4;let S=e.getUint32(c,!0);c+=4;let A=new Int32Array(this.buffer,c,S);c+=S*4;let F={type:y,coords:E,colors:A};y===HA.LATTICE&&(F.verticesPerRow=e.getUint32(c,!0),c+=4),v.push(F)}if(t===1)return["RadialAxial","axial",m,p,Array.from(f.slice(0,2)),Array.from(f.slice(2,4)),null,null];if(t===2)return["RadialAxial","radial",m,p,[f[0],f[1]],[f[3],f[4]],f[2],f[5]];if(t===3){let w=this.data[l(pr,Jm)],y=null;if(f.length>0){let _=f[0],E=f[0],S=f[1],A=f[1];for(let F=0;F<f.length;F+=2){let D=f[F],H=f[F+1];_=_>D?D:_,S=S>H?H:S,E=E<D?D:E,A=A<H?H:A}y=[_,S,E,A]}return["Mesh",w,f,h,v,y,m,b]}throw new Error(`Unsupported pattern kind: ${t}`)}};Xm=new WeakMap,Km=new WeakMap,Zm=new WeakMap,Jm=new WeakMap,Qm=new WeakMap,ey=new WeakMap,ty=new WeakMap,ry=new WeakMap,q(pr,Xm,0),q(pr,Km,1),q(pr,Zm,2),q(pr,Jm,3),q(pr,Qm,4),q(pr,ey,8),q(pr,ty,12),q(pr,ry,16);vx=pr,_x=class{constructor(e){q(this,wd);L(this,wd,e)}static write(e){let t,n;return Ur.isFloat16ArraySupported?(n=new ArrayBuffer(e.length*2),t=new Float16Array(n)):(n=new ArrayBuffer(e.length*4),t=new Float32Array(n)),t.set(e),n}get path(){return Ur.isFloat16ArraySupported?new Float16Array(l(this,wd)):new Float32Array(l(this,wd))}};wd=new WeakMap;Ex=r=>typeof r=="object"&&Number.isInteger(r?.num)&&r.num>=0&&Number.isInteger(r?.gen)&&r.gen>=0,nV=r=>typeof r=="object"&&typeof r?.name=="string",uF=ZG.bind(null,Ex,nV),Ax=class{constructor(){q(this,Ca,new Map);q(this,Kv,Promise.resolve())}postMessage(e,t){let n={data:structuredClone(e,t?{transfer:t}:null)};l(this,Kv).then(()=>{for(let[i]of l(this,Ca))i.call(this,n)})}addEventListener(e,t,n=null){let i=null;if(n?.signal instanceof AbortSignal){let{signal:o}=n;if(o.aborted){_t("LoopbackPort - cannot use an `aborted` signal.");return}let s=()=>this.removeEventListener(e,t);i=()=>o.removeEventListener("abort",s),o.addEventListener("abort",s)}l(this,Ca).set(t,i)}removeEventListener(e,t){l(this,Ca).get(t)?.(),l(this,Ca).delete(t)}terminate(){for(let[,e]of l(this,Ca))e?.();l(this,Ca).clear()}};Ca=new WeakMap,Kv=new WeakMap;ww={DATA:1,ERROR:2},Yr={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};cc=class{constructor(e,t,n){q(this,xs);q(this,vd,new AbortController);this.sourceName=e,this.targetName=t,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),n.addEventListener("message",ee(this,xs,cF).bind(this),{signal:l(this,vd).signal})}on(e,t){let n=this.actionHandler;if(n[e])throw new Error(`There is already an actionName called "${e}"`);n[e]=t}send(e,t,n){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},n)}sendWithPromise(e,t,n){let i=this.callbackId++,o=Promise.withResolvers();this.callbackCapabilities[i]=o;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:i,data:t},n)}catch(s){o.reject(s)}return o.promise}sendWithStream(e,t,n,i){let o=this.streamId++,s=this.sourceName,a=this.targetName,u=this.comObj;return new ReadableStream({start:c=>{let f=Promise.withResolvers();return this.streamControllers[o]={controller:c,startCall:f,pullCall:null,cancelCall:null,isClosed:!1},u.postMessage({sourceName:s,targetName:a,action:e,streamId:o,data:t,desiredSize:c.desiredSize},i),f.promise},pull:c=>{let f=Promise.withResolvers();return this.streamControllers[o].pullCall=f,u.postMessage({sourceName:s,targetName:a,stream:Yr.PULL,streamId:o,desiredSize:c.desiredSize}),f.promise},cancel:c=>{Bt(c instanceof Error,"cancel must have a valid reason");let f=Promise.withResolvers();return this.streamControllers[o].cancelCall=f,this.streamControllers[o].isClosed=!0,u.postMessage({sourceName:s,targetName:a,stream:Yr.CANCEL,streamId:o,reason:hi(c)}),f.promise}},n)}destroy(){l(this,vd)?.abort(),L(this,vd,null)}};vd=new WeakMap,xs=new WeakSet,cF=function({data:e}){if(e.targetName!==this.sourceName)return;if(e.stream){ee(this,xs,hF).call(this,e);return}if(e.callback){let n=e.callbackId,i=this.callbackCapabilities[n];if(!i)throw new Error(`Cannot resolve callback ${n}`);if(delete this.callbackCapabilities[n],e.callback===ww.DATA)i.resolve(e.data);else if(e.callback===ww.ERROR)i.reject(hi(e.reason));else throw new Error("Unexpected callback case");return}let t=this.actionHandler[e.action];if(!t)throw new Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){let n=this.sourceName,i=e.sourceName,o=this.comObj;Promise.try(t,e.data).then(function(s){o.postMessage({sourceName:n,targetName:i,callback:ww.DATA,callbackId:e.callbackId,data:s})},function(s){o.postMessage({sourceName:n,targetName:i,callback:ww.ERROR,callbackId:e.callbackId,reason:hi(s)})});return}if(e.streamId){ee(this,xs,fF).call(this,e);return}t(e.data)},fF=function(e){let t=e.streamId,n=this.sourceName,i=e.sourceName,o=this.comObj,s=this,a=this.actionHandler[e.action],u={enqueue(c,f=1,h){if(this.isCancelled)return;let p=this.desiredSize;this.desiredSize-=f,p>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),o.postMessage({sourceName:n,targetName:i,stream:Yr.ENQUEUE,streamId:t,chunk:c},h)},close(){this.isCancelled||(this.isCancelled=!0,o.postMessage({sourceName:n,targetName:i,stream:Yr.CLOSE,streamId:t}),delete s.streamSinks[t])},error(c){Bt(c instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,o.postMessage({sourceName:n,targetName:i,stream:Yr.ERROR,streamId:t,reason:hi(c)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};u.sinkCapability.resolve(),u.ready=u.sinkCapability.promise,this.streamSinks[t]=u,Promise.try(a,e.data,u).then(function(){o.postMessage({sourceName:n,targetName:i,stream:Yr.START_COMPLETE,streamId:t,success:!0})},function(c){o.postMessage({sourceName:n,targetName:i,stream:Yr.START_COMPLETE,streamId:t,reason:hi(c)})})},hF=function(e){let t=e.streamId,n=this.sourceName,i=e.sourceName,o=this.comObj,s=this.streamControllers[t],a=this.streamSinks[t];switch(e.stream){case Yr.START_COMPLETE:e.success?s.startCall.resolve():s.startCall.reject(hi(e.reason));break;case Yr.PULL_COMPLETE:e.success?s.pullCall.resolve():s.pullCall.reject(hi(e.reason));break;case Yr.PULL:if(!a){o.postMessage({sourceName:n,targetName:i,stream:Yr.PULL_COMPLETE,streamId:t,success:!0});break}a.desiredSize<=0&&e.desiredSize>0&&a.sinkCapability.resolve(),a.desiredSize=e.desiredSize,Promise.try(a.onPull||aB).then(function(){o.postMessage({sourceName:n,targetName:i,stream:Yr.PULL_COMPLETE,streamId:t,success:!0})},function(c){o.postMessage({sourceName:n,targetName:i,stream:Yr.PULL_COMPLETE,streamId:t,reason:hi(c)})});break;case Yr.ENQUEUE:if(Bt(s,"enqueue should have stream controller"),s.isClosed)break;s.controller.enqueue(e.chunk);break;case Yr.CLOSE:if(Bt(s,"close should have stream controller"),s.isClosed)break;s.isClosed=!0,s.controller.close(),ee(this,xs,Mw).call(this,s,t);break;case Yr.ERROR:Bt(s,"error should have stream controller"),s.controller.error(hi(e.reason)),ee(this,xs,Mw).call(this,s,t);break;case Yr.CANCEL_COMPLETE:e.success?s.cancelCall.resolve():s.cancelCall.reject(hi(e.reason)),ee(this,xs,Mw).call(this,s,t);break;case Yr.CANCEL:if(!a)break;let u=hi(e.reason);Promise.try(a.onCancel||aB,u).then(function(){o.postMessage({sourceName:n,targetName:i,stream:Yr.CANCEL_COMPLETE,streamId:t,success:!0})},function(c){o.postMessage({sourceName:n,targetName:i,stream:Yr.CANCEL_COMPLETE,streamId:t,reason:hi(c)})}),a.sinkCapability.reject(u),a.isCancelled=!0,delete this.streamSinks[t];break;default:throw new Error("Unexpected stream case")}},Mw=async function(e,t){await Promise.allSettled([e.startCall?.promise,e.pullCall?.promise,e.cancelCall?.promise]),delete this.streamControllers[t]};mv=class{constructor({enableHWA:e=!1}){q(this,ny,!1);L(this,ny,e)}create(e,t){if(e<=0||t<=0)throw new Error("Invalid canvas size");let n=this._createCanvas(e,t);return{canvas:n,context:n.getContext("2d",{willReadFrequently:!l(this,ny)})}}reset(e,t,n){if(!e.canvas)throw new Error("Canvas is not specified");if(t<=0||n<=0)throw new Error("Invalid canvas size");e.canvas.width=t,e.canvas.height=n}destroy(e){if(!e.canvas)throw new Error("Canvas is not specified");e.canvas.width=0,e.canvas.height=0,e.canvas=null,e.context=null}_createCanvas(e,t){dr("Abstract method `_createCanvas` called.")}};ny=new WeakMap;xx=class extends mv{constructor({ownerDocument:e=globalThis.document,enableHWA:t=!1}){super({enableHWA:t}),this._document=e}_createCanvas(e,t){let n=this._document.createElement("canvas");return n.width=e,n.height=t,n}},yv=class{constructor({baseUrl:e=null,isCompressed:t=!0}){this.baseUrl=e,this.isCompressed=t}async fetch({name:e}){if(!this.baseUrl)throw new Error("Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided.");if(!e)throw new Error("CMap name must be specified.");let t=this.baseUrl+e+(this.isCompressed?".bcmap":"");return this._fetch(t).then(n=>({cMapData:n,isCompressed:this.isCompressed})).catch(n=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${t}`)})}async _fetch(e){dr("Abstract method `_fetch` called.")}},bv=class extends yv{async _fetch(e){let t=await _p(e,this.isCompressed?"arraybuffer":"text");return t instanceof ArrayBuffer?new Uint8Array(t):c0(t)}},wv=class{addFilter(e){return"none"}addHCMFilter(e,t){return"none"}addAlphaFilter(e){return"none"}addLuminosityFilter(e){return"none"}addHighlightHCMFilter(e,t,n,i,o){return"none"}destroy(e=!1){}},Sx=class extends wv{constructor({docId:t,ownerDocument:n=globalThis.document}){super();q(this,lt);q(this,Pc);q(this,_d);q(this,Ra);q(this,Da);q(this,jn);q(this,Mc);q(this,Bc,0);L(this,Da,t),L(this,jn,n)}addFilter(t){if(!t)return"none";let n=l(this,lt,Mn).get(t);if(n)return n;let[i,o,s]=ee(this,lt,Bw).call(this,t),a=t.length===1?i:`${i}${o}${s}`;if(n=l(this,lt,Mn).get(a),n)return l(this,lt,Mn).set(t,n),n;let u=`g_${l(this,Da)}_transfer_map_${tn(this,Bc)._++}`,c=ee(this,lt,Oh).call(this,u);l(this,lt,Mn).set(t,c),l(this,lt,Mn).set(a,c);let f=ee(this,lt,Nh).call(this,u);return ee(this,lt,qg).call(this,i,o,s,f),c}addHCMFilter(t,n){let i=`${t}-${n}`,o="base",s=l(this,lt,zg).get(o);if(s?.key===i||(s?(s.filter?.remove(),s.key=i,s.url="none",s.filter=null):(s={key:i,url:"none",filter:null},l(this,lt,zg).set(o,s)),!t||!n))return s.url;let a=ee(this,lt,Hg).call(this,t);t=nt.makeHexColor(...a);let u=ee(this,lt,Hg).call(this,n);if(n=nt.makeHexColor(...u),l(this,lt,Ih).style.color="",t==="#000000"&&n==="#ffffff"||t===n)return s.url;let c=new Array(256);for(let b=0;b<=255;b++){let v=b/255;c[b]=v<=.03928?v/12.92:((v+.055)/1.055)**2.4}let f=c.join(","),h=`g_${l(this,Da)}_hcm_filter`,p=s.filter=ee(this,lt,Nh).call(this,h);ee(this,lt,qg).call(this,f,f,f,p),ee(this,lt,Tx).call(this,p);let m=(b,v)=>{let w=a[b]/255,y=u[b]/255,_=new Array(v+1);for(let E=0;E<=v;E++)_[E]=w+E/v*(y-w);return _.join(",")};return ee(this,lt,qg).call(this,m(0,5),m(1,5),m(2,5),p),s.url=ee(this,lt,Oh).call(this,h),s.url}addAlphaFilter(t){let n=l(this,lt,Mn).get(t);if(n)return n;let[i]=ee(this,lt,Bw).call(this,[t]),o=`alpha_${i}`;if(n=l(this,lt,Mn).get(o),n)return l(this,lt,Mn).set(t,n),n;let s=`g_${l(this,Da)}_alpha_map_${tn(this,Bc)._++}`,a=ee(this,lt,Oh).call(this,s);l(this,lt,Mn).set(t,a),l(this,lt,Mn).set(o,a);let u=ee(this,lt,Nh).call(this,s);return ee(this,lt,Cx).call(this,i,u),a}addLuminosityFilter(t){let n=l(this,lt,Mn).get(t||"luminosity");if(n)return n;let i,o;if(t?([i]=ee(this,lt,Bw).call(this,[t]),o=`luminosity_${i}`):o="luminosity",n=l(this,lt,Mn).get(o),n)return l(this,lt,Mn).set(t,n),n;let s=`g_${l(this,Da)}_luminosity_map_${tn(this,Bc)._++}`,a=ee(this,lt,Oh).call(this,s);l(this,lt,Mn).set(t,a),l(this,lt,Mn).set(o,a);let u=ee(this,lt,Nh).call(this,s);return ee(this,lt,dF).call(this,u),t&&ee(this,lt,Cx).call(this,i,u),a}addHighlightHCMFilter(t,n,i,o,s){let a=`${n}-${i}-${o}-${s}`,u=l(this,lt,zg).get(t);if(u?.key===a||(u?(u.filter?.remove(),u.key=a,u.url="none",u.filter=null):(u={key:a,url:"none",filter:null},l(this,lt,zg).set(t,u)),!n||!i))return u.url;let[c,f]=[n,i].map(ee(this,lt,Hg).bind(this)),h=Math.round(.2126*c[0]+.7152*c[1]+.0722*c[2]),p=Math.round(.2126*f[0]+.7152*f[1]+.0722*f[2]),[m,b]=[o,s].map(ee(this,lt,Hg).bind(this));p<h&&([h,p,m,b]=[p,h,b,m]),l(this,lt,Ih).style.color="";let v=(_,E,S)=>{let A=new Array(256),F=(p-h)/S,D=_/255,H=(E-_)/(255*S),J=0;for(let K=0;K<=S;K++){let ne=Math.round(h+K*F),k=D+K*H;for(let $=J;$<=ne;$++)A[$]=k;J=ne+1}for(let K=J;K<256;K++)A[K]=A[J-1];return A.join(",")},w=`g_${l(this,Da)}_hcm_${t}_filter`,y=u.filter=ee(this,lt,Nh).call(this,w);return ee(this,lt,Tx).call(this,y),ee(this,lt,qg).call(this,v(m[0],b[0],5),v(m[1],b[1],5),v(m[2],b[2],5),y),u.url=ee(this,lt,Oh).call(this,w),u.url}destroy(t=!1){t&&l(this,Mc)?.size||(l(this,Ra)?.parentNode.parentNode.remove(),L(this,Ra,null),l(this,_d)?.clear(),L(this,_d,null),l(this,Mc)?.clear(),L(this,Mc,null),L(this,Bc,0))}};Pc=new WeakMap,_d=new WeakMap,Ra=new WeakMap,Da=new WeakMap,jn=new WeakMap,Mc=new WeakMap,Bc=new WeakMap,lt=new WeakSet,Mn=function(){return l(this,_d)||L(this,_d,new Map)},zg=function(){return l(this,Mc)||L(this,Mc,new Map)},Ih=function(){if(!l(this,Ra)){let t=l(this,jn).createElement("div"),{style:n}=t;n.visibility="hidden",n.contain="strict",n.width=n.height=0,n.position="absolute",n.top=n.left=0,n.zIndex=-1;let i=l(this,jn).createElementNS(fa,"svg");i.setAttribute("width",0),i.setAttribute("height",0),L(this,Ra,l(this,jn).createElementNS(fa,"defs")),t.append(i),i.append(l(this,Ra)),l(this,jn).body.append(t)}return l(this,Ra)},Bw=function(t){if(t.length===1){let c=t[0],f=new Array(256);for(let p=0;p<256;p++)f[p]=c[p]/255;let h=f.join(",");return[h,h,h]}let[n,i,o]=t,s=new Array(256),a=new Array(256),u=new Array(256);for(let c=0;c<256;c++)s[c]=n[c]/255,a[c]=i[c]/255,u[c]=o[c]/255;return[s.join(","),a.join(","),u.join(",")]},Oh=function(t){if(l(this,Pc)===void 0){L(this,Pc,"");let n=l(this,jn).URL;n!==l(this,jn).baseURI&&(f0(n)?_t('#createUrl: ignore "data:"-URL for performance reasons.'):L(this,Pc,_T(n,"")))}return`url(${l(this,Pc)}#${t})`},dF=function(t){let n=l(this,jn).createElementNS(fa,"feColorMatrix");n.setAttribute("type","matrix"),n.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),t.append(n)},Tx=function(t){let n=l(this,jn).createElementNS(fa,"feColorMatrix");n.setAttribute("type","matrix"),n.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(n)},Nh=function(t){let n=l(this,jn).createElementNS(fa,"filter");return n.setAttribute("color-interpolation-filters","sRGB"),n.setAttribute("id",t),l(this,lt,Ih).append(n),n},Wg=function(t,n,i){let o=l(this,jn).createElementNS(fa,n);o.setAttribute("type","discrete"),o.setAttribute("tableValues",i),t.append(o)},qg=function(t,n,i,o){let s=l(this,jn).createElementNS(fa,"feComponentTransfer");o.append(s),ee(this,lt,Wg).call(this,s,"feFuncR",t),ee(this,lt,Wg).call(this,s,"feFuncG",n),ee(this,lt,Wg).call(this,s,"feFuncB",i)},Cx=function(t,n){let i=l(this,jn).createElementNS(fa,"feComponentTransfer");n.append(i),ee(this,lt,Wg).call(this,i,"feFuncA",t)},Hg=function(t){return l(this,lt,Ih).style.color=t,Ep(getComputedStyle(l(this,lt,Ih)).getPropertyValue("color"))};vv=class{constructor({baseUrl:e=null}){this.baseUrl=e}async fetch({filename:e}){if(!this.baseUrl)throw new Error("Ensure that the `standardFontDataUrl` API parameter is provided.");if(!e)throw new Error("Font filename must be specified.");let t=`${this.baseUrl}${e}`;return this._fetch(t).catch(n=>{throw new Error(`Unable to load font data at: ${t}`)})}async _fetch(e){dr("Abstract method `_fetch` called.")}},_v=class extends vv{async _fetch(e){let t=await _p(e,"arraybuffer");return new Uint8Array(t)}},Ev=class{constructor({baseUrl:e=null}){this.baseUrl=e}async fetch({filename:e}){if(!this.baseUrl)throw new Error("Ensure that the `wasmUrl` API parameter is provided.");if(!e)throw new Error("Wasm filename must be specified.");let t=`${this.baseUrl}${e}`;return this._fetch(t).catch(n=>{throw new Error(`Unable to load wasm data at: ${t}`)})}async _fetch(e){dr("Abstract method `_fetch` called.")}},Av=class extends Ev{async _fetch(e){let t=await _p(e,"arraybuffer");return new Uint8Array(t)}};Qn&&_t("Please use the `legacy` build in Node.js environments.");Rx=class extends wv{},Dx=class extends mv{_createCanvas(e,t){return process.getBuiltinModule("module").createRequire("")("@napi-rs/canvas").createCanvas(e,t)}},Ix=class extends yv{async _fetch(e){return xT(e)}},Ox=class extends vv{async _fetch(e){return xT(e)}},Nx=class extends Ev{async _fetch(e){return xT(e)}},Ch="__forcedDependency",{floor:lB,ceil:uB}=Math;kx=new Uint32Array(new Uint8Array([255,255,0,0]).buffer)[0],Lx=class{constructor(e,t){q(this,Ed);q(this,Vl);L(this,Ed,e),L(this,Vl,t)}get length(){return l(this,Ed).length}isEmpty(e){return l(this,Ed)[e]===kx}minX(e){return l(this,Vl)[e*4+0]/256}minY(e){return l(this,Vl)[e*4+1]/256}maxX(e){return(l(this,Vl)[e*4+2]+1)/256}maxY(e){return(l(this,Vl)[e*4+3]+1)/256}};Ed=new WeakMap,Vl=new WeakMap;_w=(r,e)=>{if(!r)return;let t=r.get(e);return t||(t={dependencies:new Set,isRenderingOperation:!1},r.set(e,t)),t},Px=class{constructor(e,t,n=!1){q(this,sy);q(this,gi,{__proto__:null});q(this,mi,{__proto__:null,transform:[],moveText:[],sameLineText:[],[Ch]:[]});q(this,Fc,new Map);q(this,Fs,[]);q(this,Uc,[]);q(this,Ia,[[1,0,0,1,0,0]]);q(this,Zt,[-1/0,-1/0,1/0,1/0]);q(this,ir,new Float64Array([1/0,1/0,-1/0,-1/0]));q(this,Oa,-1);q(this,yi,new Set);q(this,iy,new Map);q(this,Ad,new Map);q(this,jc);q(this,$c);q(this,Na);q(this,$n);q(this,To);L(this,jc,e.width),L(this,$c,e.height),ee(this,sy,Mx).call(this,t),n&&L(this,To,new Map)}growOperationsCount(e){e>=l(this,$n).length&&ee(this,sy,Mx).call(this,e,l(this,$n))}save(e){return L(this,gi,{__proto__:l(this,gi)}),L(this,mi,{__proto__:l(this,mi),transform:{__proto__:l(this,mi).transform},moveText:{__proto__:l(this,mi).moveText},sameLineText:{__proto__:l(this,mi).sameLineText},[Ch]:{__proto__:l(this,mi)[Ch]}}),L(this,Zt,{__proto__:l(this,Zt)}),l(this,Fs).push(e),this}restore(e){let t=Object.getPrototypeOf(l(this,gi));if(t===null)return this;L(this,gi,t),L(this,mi,Object.getPrototypeOf(l(this,mi))),L(this,Zt,Object.getPrototypeOf(l(this,Zt)));let n=l(this,Fs).pop();return n!==void 0&&(_w(l(this,To),e)?.dependencies.add(n),l(this,$n)[e]=l(this,$n)[n]),this}recordOpenMarker(e){return l(this,Fs).push(e),this}getOpenMarker(){return l(this,Fs).length===0?null:l(this,Fs).at(-1)}recordCloseMarker(e){let t=l(this,Fs).pop();return t!==void 0&&(_w(l(this,To),e)?.dependencies.add(t),l(this,$n)[e]=l(this,$n)[t]),this}beginMarkedContent(e){return l(this,Uc).push(e),this}endMarkedContent(e){let t=l(this,Uc).pop();return t!==void 0&&(_w(l(this,To),e)?.dependencies.add(t),l(this,$n)[e]=l(this,$n)[t]),this}pushBaseTransform(e){return l(this,Ia).push(nt.multiplyByDOMMatrix(l(this,Ia).at(-1),e.getTransform())),this}popBaseTransform(){return l(this,Ia).length>1&&l(this,Ia).pop(),this}recordSimpleData(e,t){return l(this,gi)[e]=t,this}recordIncrementalData(e,t){return l(this,mi)[e].push(t),this}resetIncrementalData(e,t){return l(this,mi)[e].length=0,this}recordNamedData(e,t){return l(this,Fc).set(e,t),this}recordSimpleDataFromNamed(e,t,n){l(this,gi)[e]=l(this,Fc).get(t)??n}recordFutureForcedDependency(e,t){return this.recordIncrementalData(Ch,t),this}inheritSimpleDataAsFutureForcedDependencies(e){for(let t of e)t in l(this,gi)&&this.recordFutureForcedDependency(t,l(this,gi)[t]);return this}inheritPendingDependenciesAsFutureForcedDependencies(){for(let e of l(this,yi))this.recordFutureForcedDependency(Ch,e);return this}resetBBox(e){return l(this,Oa)!==e&&(L(this,Oa,e),l(this,ir)[0]=1/0,l(this,ir)[1]=1/0,l(this,ir)[2]=-1/0,l(this,ir)[3]=-1/0),this}recordClipBox(e,t,n,i,o,s){let a=nt.multiplyByDOMMatrix(l(this,Ia).at(-1),t.getTransform()),u=[1/0,1/0,-1/0,-1/0];nt.axialAlignedBoundingBox([n,o,i,s],a,u);let c=nt.intersect(l(this,Zt),u);return c?(l(this,Zt)[0]=c[0],l(this,Zt)[1]=c[1],l(this,Zt)[2]=c[2],l(this,Zt)[3]=c[3]):(l(this,Zt)[0]=l(this,Zt)[1]=1/0,l(this,Zt)[2]=l(this,Zt)[3]=-1/0),this}recordBBox(e,t,n,i,o,s){let a=l(this,Zt);if(a[0]===1/0)return this;let u=nt.multiplyByDOMMatrix(l(this,Ia).at(-1),t.getTransform());if(a[0]===-1/0)return nt.axialAlignedBoundingBox([n,o,i,s],u,l(this,ir)),this;let c=[1/0,1/0,-1/0,-1/0];return nt.axialAlignedBoundingBox([n,o,i,s],u,c),l(this,ir)[0]=Math.min(l(this,ir)[0],Math.max(c[0],a[0])),l(this,ir)[1]=Math.min(l(this,ir)[1],Math.max(c[1],a[1])),l(this,ir)[2]=Math.max(l(this,ir)[2],Math.min(c[2],a[2])),l(this,ir)[3]=Math.max(l(this,ir)[3],Math.min(c[3],a[3])),this}recordCharacterBBox(e,t,n,i=1,o=0,s=0,a){let u=n.bbox,c,f;if(u&&(c=u[2]!==u[0]&&u[3]!==u[1]&&l(this,Ad).get(n),c!==!1&&(f=[0,0,0,0],nt.axialAlignedBoundingBox(u,n.fontMatrix,f),(i!==1||o!==0||s!==0)&&nt.scaleMinMax([i,0,0,-i,o,s],f),c)))return this.recordBBox(e,t,f[0],f[2],f[1],f[3]);if(!a)return this.recordFullPageBBox(e);let h=a();return u&&f&&c===void 0&&(c=f[0]<=o-h.actualBoundingBoxLeft&&f[2]>=o+h.actualBoundingBoxRight&&f[1]<=s-h.actualBoundingBoxAscent&&f[3]>=s+h.actualBoundingBoxDescent,l(this,Ad).set(n,c),c)?this.recordBBox(e,t,f[0],f[2],f[1],f[3]):this.recordBBox(e,t,o-h.actualBoundingBoxLeft,o+h.actualBoundingBoxRight,s-h.actualBoundingBoxAscent,s+h.actualBoundingBoxDescent)}recordFullPageBBox(e){return l(this,ir)[0]=Math.max(0,l(this,Zt)[0]),l(this,ir)[1]=Math.max(0,l(this,Zt)[1]),l(this,ir)[2]=Math.min(l(this,jc),l(this,Zt)[2]),l(this,ir)[3]=Math.min(l(this,$c),l(this,Zt)[3]),this}getSimpleIndex(e){return l(this,gi)[e]}recordDependencies(e,t){let n=l(this,yi),i=l(this,gi),o=l(this,mi);for(let s of t)s in l(this,gi)?n.add(i[s]):s in o&&o[s].forEach(n.add,n);return this}recordNamedDependency(e,t){return l(this,Fc).has(t)&&l(this,yi).add(l(this,Fc).get(t)),this}recordOperation(e,t=!1){if(this.recordDependencies(e,[Ch]),l(this,To)){let n=_w(l(this,To),e),{dependencies:i}=n;l(this,yi).forEach(i.add,i),l(this,Fs).forEach(i.add,i),l(this,Uc).forEach(i.add,i),i.delete(e),n.isRenderingOperation=!0}if(l(this,Oa)===e){let n=lB(l(this,ir)[0]*256/l(this,jc)),i=lB(l(this,ir)[1]*256/l(this,$c)),o=uB(l(this,ir)[2]*256/l(this,jc)),s=uB(l(this,ir)[3]*256/l(this,$c));vw(l(this,Na),e,n,i,o,s);for(let a of l(this,yi))a!==e&&vw(l(this,Na),a,n,i,o,s);for(let a of l(this,Fs))a!==e&&vw(l(this,Na),a,n,i,o,s);for(let a of l(this,Uc))a!==e&&vw(l(this,Na),a,n,i,o,s);t||(l(this,yi).clear(),L(this,Oa,-1))}return this}recordShowTextOperation(e,t=!1){let n=Array.from(l(this,yi));this.recordOperation(e,t),this.recordIncrementalData("sameLineText",e);for(let i of n)this.recordIncrementalData("sameLineText",i);return this}bboxToClipBoxDropOperation(e,t=!1){return l(this,Oa)===e&&(L(this,Oa,-1),l(this,Zt)[0]=Math.max(l(this,Zt)[0],l(this,ir)[0]),l(this,Zt)[1]=Math.max(l(this,Zt)[1],l(this,ir)[1]),l(this,Zt)[2]=Math.min(l(this,Zt)[2],l(this,ir)[2]),l(this,Zt)[3]=Math.min(l(this,Zt)[3],l(this,ir)[3]),t||l(this,yi).clear()),this}_takePendingDependencies(){let e=l(this,yi);return L(this,yi,new Set),e}_extractOperation(e){let t=l(this,iy).get(e);return l(this,iy).delete(e),t}_pushPendingDependencies(e){for(let t of e)l(this,yi).add(t)}take(){return l(this,Ad).clear(),new Lx(l(this,$n),l(this,Na))}takeDebugMetadata(){return l(this,To)}};gi=new WeakMap,mi=new WeakMap,Fc=new WeakMap,Fs=new WeakMap,Uc=new WeakMap,Ia=new WeakMap,Zt=new WeakMap,ir=new WeakMap,Oa=new WeakMap,yi=new WeakMap,iy=new WeakMap,Ad=new WeakMap,jc=new WeakMap,$c=new WeakMap,Na=new WeakMap,$n=new WeakMap,To=new WeakMap,sy=new WeakSet,Mx=function(e,t){let n=new ArrayBuffer(e*4);L(this,Na,new Uint8ClampedArray(n)),L(this,$n,new Uint32Array(n)),t&&t.length>0?(l(this,$n).set(t),l(this,$n).fill(kx,t.length)):l(this,$n).fill(kx)};CT=class CT{constructor(e,t,n){q(this,fr);q(this,Pr);q(this,Us);q(this,xd,0);q(this,Sd,0);if(e instanceof CT&&l(e,Us)===!!n)return e;L(this,fr,e),L(this,Pr,t),L(this,Us,!!n)}growOperationsCount(){throw new Error("Unreachable")}save(e){return tn(this,Sd)._++,l(this,fr).save(l(this,Pr)),this}restore(e){return l(this,Sd)>0&&(l(this,fr).restore(l(this,Pr)),tn(this,Sd)._--),this}recordOpenMarker(e){return tn(this,xd)._++,this}getOpenMarker(){return l(this,xd)>0?l(this,Pr):l(this,fr).getOpenMarker()}recordCloseMarker(e){return tn(this,xd)._--,this}beginMarkedContent(e){return this}endMarkedContent(e){return this}pushBaseTransform(e){return l(this,fr).pushBaseTransform(e),this}popBaseTransform(){return l(this,fr).popBaseTransform(),this}recordSimpleData(e,t){return l(this,fr).recordSimpleData(e,l(this,Pr)),this}recordIncrementalData(e,t){return l(this,fr).recordIncrementalData(e,l(this,Pr)),this}resetIncrementalData(e,t){return l(this,fr).resetIncrementalData(e,l(this,Pr)),this}recordNamedData(e,t){return this}recordSimpleDataFromNamed(e,t,n){return l(this,fr).recordSimpleDataFromNamed(e,t,l(this,Pr)),this}recordFutureForcedDependency(e,t){return l(this,fr).recordFutureForcedDependency(e,l(this,Pr)),this}inheritSimpleDataAsFutureForcedDependencies(e){return l(this,fr).inheritSimpleDataAsFutureForcedDependencies(e),this}inheritPendingDependenciesAsFutureForcedDependencies(){return l(this,fr).inheritPendingDependenciesAsFutureForcedDependencies(),this}resetBBox(e){return l(this,Us)||l(this,fr).resetBBox(l(this,Pr)),this}recordClipBox(e,t,n,i,o,s){return l(this,Us)||l(this,fr).recordClipBox(l(this,Pr),t,n,i,o,s),this}recordBBox(e,t,n,i,o,s){return l(this,Us)||l(this,fr).recordBBox(l(this,Pr),t,n,i,o,s),this}recordCharacterBBox(e,t,n,i,o,s,a){return l(this,Us)||l(this,fr).recordCharacterBBox(l(this,Pr),t,n,i,o,s,a),this}recordFullPageBBox(e){return l(this,Us)||l(this,fr).recordFullPageBBox(l(this,Pr)),this}getSimpleIndex(e){return l(this,fr).getSimpleIndex(e)}recordDependencies(e,t){return l(this,fr).recordDependencies(l(this,Pr),t),this}recordNamedDependency(e,t){return l(this,fr).recordNamedDependency(l(this,Pr),t),this}recordOperation(e){return l(this,fr).recordOperation(l(this,Pr),!0),this}recordShowTextOperation(e){return l(this,fr).recordShowTextOperation(l(this,Pr),!0),this}bboxToClipBoxDropOperation(e){return l(this,Us)||l(this,fr).bboxToClipBoxDropOperation(l(this,Pr),!0),this}take(){throw new Error("Unreachable")}takeDebugMetadata(){throw new Error("Unreachable")}};fr=new WeakMap,Pr=new WeakMap,Us=new WeakMap,xd=new WeakMap,Sd=new WeakMap;xv=CT,ls={stroke:["path","transform","filter","strokeColor","strokeAlpha","lineWidth","lineCap","lineJoin","miterLimit","dash"],fill:["path","transform","filter","fillColor","fillAlpha","globalCompositeOperation","SMask"],imageXObject:["transform","SMask","filter","fillAlpha","strokeAlpha","globalCompositeOperation"],rawFillPath:["filter","fillColor","fillAlpha"],showText:["transform","leading","charSpacing","wordSpacing","hScale","textRise","moveText","textMatrix","font","fontObj","filter","fillColor","textRenderingMode","SMask","fillAlpha","strokeAlpha","globalCompositeOperation","sameLineText"],transform:["transform"],transformAndFill:["transform","fillColor"]},Dn={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};cm=class{isModifyingCurrentTransform(){return!1}getPattern(){dr("Abstract method `getPattern` called.")}},Fx=class extends cm{constructor(e){super(),this._type=e[1],this._bbox=e[2],this._colorStops=e[3],this._p0=e[4],this._p1=e[5],this._r0=e[6],this._r1=e[7],this.matrix=null}isOriginBased(){return this._p0[0]===0&&this._p0[1]===0&&(!this.isRadial()||this._p1[0]===0&&this._p1[1]===0)}isRadial(){return this._type==="radial"}_createGradient(e,t=null){let n,i=this._p0,o=this._p1;if(t&&(i=i.slice(),o=o.slice(),nt.applyTransform(i,t),nt.applyTransform(o,t)),this._type==="axial")n=e.createLinearGradient(i[0],i[1],o[0],o[1]);else if(this._type==="radial"){let s=this._r0,a=this._r1;if(t){let u=new Float32Array(2);nt.singularValueDecompose2dScale(t,u),s*=u[0],a*=u[0]}n=e.createRadialGradient(i[0],i[1],s,o[0],o[1],a)}for(let s of this._colorStops)n.addColorStop(s[0],s[1]);return n}getPattern(e,t,n,i){let o;if(i===Dn.STROKE||i===Dn.FILL){if(this.isOriginBased()){let p=nt.transform(n,t.baseTransform);this.matrix&&(p=nt.transform(p,this.matrix));let m=.001,b=Math.hypot(p[0],p[1]),v=Math.hypot(p[2],p[3]),w=(p[0]*p[2]+p[1]*p[3])/(b*v);if(Math.abs(w)<m)if(this.isRadial()){if(Math.abs(b-v)<m)return this._createGradient(e,p)}else return this._createGradient(e,p)}let s=t.current.getClippedPathBoundingBox(i,Tr(e))||[0,0,0,0],a=Math.ceil(s[2]-s[0])||1,u=Math.ceil(s[3]-s[1])||1,c=t.cachedCanvases.getCanvas("pattern",a,u),f=c.context;f.clearRect(0,0,f.canvas.width,f.canvas.height),f.beginPath(),f.rect(0,0,f.canvas.width,f.canvas.height),f.translate(-s[0],-s[1]),n=nt.transform(n,[1,0,0,1,s[0],s[1]]),f.transform(...t.baseTransform),this.matrix&&f.transform(...this.matrix),Bx(f,this._bbox),f.fillStyle=this._createGradient(f),f.fill(),o=e.createPattern(c.canvas,"no-repeat");let h=new DOMMatrix(n);o.setTransform(h)}else Bx(e,this._bbox),o=this._createGradient(e);return o}};Ux=class extends cm{constructor(e){super(),this._coords=e[2],this._colors=e[3],this._figures=e[4],this._bounds=e[5],this._bbox=e[6],this._background=e[7],this.matrix=null}_createMeshCanvas(e,t,n){let a=Math.floor(this._bounds[0]),u=Math.floor(this._bounds[1]),c=Math.ceil(this._bounds[2])-a,f=Math.ceil(this._bounds[3])-u,h=Math.min(Math.ceil(Math.abs(c*e[0]*1.1)),3e3),p=Math.min(Math.ceil(Math.abs(f*e[1]*1.1)),3e3),m=c/h,b=f/p,v={coords:this._coords,colors:this._colors,offsetX:-a,offsetY:-u,scaleX:1/m,scaleY:1/b},w=h+4,y=p+4,_=n.getCanvas("mesh",w,y),E=_.context,S=E.createImageData(h,p);if(t){let F=S.data;for(let D=0,H=F.length;D<H;D+=4)F[D]=t[0],F[D+1]=t[1],F[D+2]=t[2],F[D+3]=255}for(let F of this._figures)iV(S,F,v);return E.putImageData(S,2,2),{canvas:_.canvas,offsetX:a-2*m,offsetY:u-2*b,scaleX:m,scaleY:b}}isModifyingCurrentTransform(){return!0}getPattern(e,t,n,i){Bx(e,this._bbox);let o=new Float32Array(2);if(i===Dn.SHADING)nt.singularValueDecompose2dScale(Tr(e),o);else if(this.matrix){nt.singularValueDecompose2dScale(this.matrix,o);let[a,u]=o;nt.singularValueDecompose2dScale(t.baseTransform,o),o[0]*=a,o[1]*=u}else nt.singularValueDecompose2dScale(t.baseTransform,o);let s=this._createMeshCanvas(o,i===Dn.SHADING?null:this._background,t.cachedCanvases);return i!==Dn.SHADING&&(e.setTransform(...t.baseTransform),this.matrix&&e.transform(...this.matrix)),e.translate(s.offsetX,s.offsetY),e.scale(s.scaleX,s.scaleY),e.createPattern(s.canvas,"no-repeat")}},jx=class extends cm{getPattern(){return"hotpink"}};cB={COLORED:1,UNCOLORED:2},Zv=class Zv{constructor(e,t,n,i){this.color=e[1],this.operatorList=e[2],this.matrix=e[3],this.bbox=e[4],this.xstep=e[5],this.ystep=e[6],this.paintType=e[7],this.tilingType=e[8],this.ctx=t,this.canvasGraphicsFactory=n,this.baseTransform=i}createPatternCanvas(e,t){let{bbox:n,operatorList:i,paintType:o,tilingType:s,color:a,canvasGraphicsFactory:u}=this,{xstep:c,ystep:f}=this;c=Math.abs(c),f=Math.abs(f),u_("TilingType: "+s);let h=n[0],p=n[1],m=n[2],b=n[3],v=m-h,w=b-p,y=new Float32Array(2);nt.singularValueDecompose2dScale(this.matrix,y);let[_,E]=y;nt.singularValueDecompose2dScale(this.baseTransform,y);let S=_*y[0],A=E*y[1],F=v,D=w,H=!1,J=!1,K=Math.ceil(c*S),ne=Math.ceil(f*A),k=Math.ceil(v*S),$=Math.ceil(w*A);K>=k?F=c:H=!0,ne>=$?D=f:J=!0;let Y=this.getSizeAndScale(F,this.ctx.canvas.width,S),ie=this.getSizeAndScale(D,this.ctx.canvas.height,A),re=e.cachedCanvases.getCanvas("pattern",Y.size,ie.size),N=re.context,x=u.createCanvasGraphics(N,t);if(x.groupLevel=e.groupLevel,this.setFillAndStrokeStyleToContext(x,o,a),N.translate(-Y.scale*h,-ie.scale*p),x.transform(0,Y.scale,0,0,ie.scale,0,0),N.save(),x.dependencyTracker?.save(),this.clipBbox(x,h,p,m,b),x.baseTransform=Tr(x.ctx),x.executeOperatorList(i),x.endDrawing(),x.dependencyTracker?.restore(),N.restore(),H||J){let P=re.canvas;H&&(F=c),J&&(D=f);let C=this.getSizeAndScale(F,this.ctx.canvas.width,S),j=this.getSizeAndScale(D,this.ctx.canvas.height,A),U=C.size,B=j.size,Q=e.cachedCanvases.getCanvas("pattern-workaround",U,B),fe=Q.context,_e=H?Math.floor(v/c):0,te=J?Math.floor(w/f):0;for(let W=0;W<=_e;W++)for(let oe=0;oe<=te;oe++)fe.drawImage(P,U*W,B*oe,U,B,0,0,U,B);return{canvas:Q.canvas,scaleX:C.scale,scaleY:j.scale,offsetX:h,offsetY:p}}return{canvas:re.canvas,scaleX:Y.scale,scaleY:ie.scale,offsetX:h,offsetY:p}}getSizeAndScale(e,t,n){let i=Math.max(Zv.MAX_PATTERN_SIZE,t),o=Math.ceil(e*n);return o>=i?o=i:n=o/e,{scale:n,size:o}}clipBbox(e,t,n,i,o){let s=i-t,a=o-n;e.ctx.rect(t,n,s,a),nt.axialAlignedBoundingBox([t,n,i,o],Tr(e.ctx),e.current.minMax),e.clip(),e.endPath()}setFillAndStrokeStyleToContext(e,t,n){let i=e.ctx,o=e.current;switch(t){case cB.COLORED:let{fillStyle:s,strokeStyle:a}=this.ctx;i.fillStyle=o.fillColor=s,i.strokeStyle=o.strokeColor=a;break;case cB.UNCOLORED:i.fillStyle=i.strokeStyle=n,o.fillColor=o.strokeColor=n;break;default:throw new GA(`Unsupported paint type: ${t}`)}}isModifyingCurrentTransform(){return!1}getPattern(e,t,n,i,o){let s=n;i!==Dn.SHADING&&(s=nt.transform(s,t.baseTransform),this.matrix&&(s=nt.transform(s,this.matrix)));let a=this.createPatternCanvas(t,o),u=new DOMMatrix(s);u=u.translate(a.offsetX,a.offsetY),u=u.scale(1/a.scaleX,1/a.scaleY);let c=e.createPattern(a.canvas,"repeat");return c.setTransform(u),c}};Ke(Zv,"MAX_PATTERN_SIZE",3e3);$x=Zv;fB=16,hB=100,aV=15,dB=10,vi=16,$A=new DOMMatrix,Vi=new Float32Array(2),Fh=new Float32Array([1/0,1/0,-1/0,-1/0]);zx=class{constructor(e){this.canvasFactory=e,this.cache=Object.create(null)}getCanvas(e,t,n){let i;return this.cache[e]!==void 0?(i=this.cache[e],this.canvasFactory.reset(i,t,n)):(i=this.canvasFactory.create(t,n),this.cache[e]=i),i}delete(e){delete this.cache[e]}clear(){for(let e in this.cache){let t=this.cache[e];this.canvasFactory.destroy(t),delete this.cache[e]}}};Sv=class{constructor(e,t,n){Ke(this,"alphaIsShape",!1);Ke(this,"fontSize",0);Ke(this,"fontSizeScale",1);Ke(this,"textMatrix",null);Ke(this,"textMatrixScale",1);Ke(this,"fontMatrix",qA);Ke(this,"leading",0);Ke(this,"x",0);Ke(this,"y",0);Ke(this,"lineX",0);Ke(this,"lineY",0);Ke(this,"charSpacing",0);Ke(this,"wordSpacing",0);Ke(this,"textHScale",1);Ke(this,"textRenderingMode",on.FILL);Ke(this,"textRise",0);Ke(this,"fillColor","#000000");Ke(this,"strokeColor","#000000");Ke(this,"patternFill",!1);Ke(this,"patternStroke",!1);Ke(this,"fillAlpha",1);Ke(this,"strokeAlpha",1);Ke(this,"lineWidth",1);Ke(this,"activeSMask",null);Ke(this,"transferMaps","none");n?.(this),this.clipBox=new Float32Array([0,0,e,t]),this.minMax=Fh.slice()}clone(){let e=Object.create(this);return e.clipBox=this.clipBox.slice(),e.minMax=this.minMax.slice(),e}getPathBoundingBox(e=Dn.FILL,t=null){let n=this.minMax.slice();if(e===Dn.STROKE){t||dr("Stroke bounding box must include transform."),nt.singularValueDecompose2dScale(t,Vi);let i=Vi[0]*this.lineWidth/2,o=Vi[1]*this.lineWidth/2;n[0]-=i,n[1]-=o,n[2]+=i,n[3]+=o}return n}updateClipFromPath(){let e=nt.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(e||[0,0,0,0])}isEmptyClip(){return this.minMax[0]===1/0}startNewPathAndClipBox(e){this.clipBox.set(e,0),this.minMax.set(Fh,0)}getClippedPathBoundingBox(e=Dn.FILL,t=null){return nt.intersect(this.clipBox,this.getPathBoundingBox(e,t))}};uV=["butt","round","square"],cV=["miter","round","bevel"],fV={},yB={},RT=class RT{constructor(e,t,n,i,o,{optionalContentConfig:s,markedContentStack:a=null},u,c,f){q(this,Xs);this.ctx=e,this.current=new Sv(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=t,this.objs=n,this.canvasFactory=i,this.filterFactory=o,this.groupStack=[],this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=a||[],this.optionalContentConfig=s,this.cachedCanvases=new zx(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=u,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=c,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map,this.dependencyTracker=f??null}getObject(e,t,n=null){return typeof t=="string"?(this.dependencyTracker?.recordNamedDependency(e,t),t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t)):n}beginDrawing({transform:e,viewport:t,transparency:n=!1,background:i=null}){let o=this.ctx.canvas.width,s=this.ctx.canvas.height,a=this.ctx.fillStyle;if(this.ctx.fillStyle=i||"#ffffff",this.ctx.fillRect(0,0,o,s),this.ctx.fillStyle=a,n){let u=this.cachedCanvases.getCanvas("transparent",o,s);this.compositeCtx=this.ctx,this.transparentCanvas=u.canvas,this.ctx=u.context,this.ctx.save(),this.ctx.transform(...Tr(this.compositeCtx))}this.ctx.save(),Aw(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[0]),this.ctx.transform(...t.transform),this.viewportScale=t.scale,this.baseTransform=Tr(this.ctx)}executeOperatorList(e,t,n,i,o){let s=e.argsArray,a=e.fnArray,u=t||0,c=s.length;if(c===u)return u;let f=c-u>dB&&typeof n=="function",h=f?Date.now()+aV:0,p=0,m=this.commonObjs,b=this.objs,v,w;for(;;){if(i!==void 0&&u===i.nextBreakPoint)return i.breakIt(u,n),u;if(!o||o(u))if(v=a[u],w=s[u]??null,v!==mp.dependency)w===null?this[v](u):this[v](u,...w);else for(let y of w){this.dependencyTracker?.recordNamedData(y,u);let _=y.startsWith("g_")?m:b;if(!_.has(y))return _.get(y,n),u}if(u++,u===c)return u;if(f&&++p>dB){if(Date.now()>h)return n(),u;p=0}}}endDrawing(){ee(this,Xs,Wx).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(let e of this._cachedBitmapsMap.values()){for(let t of e.values())typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement&&(t.width=t.height=0);e.clear()}this._cachedBitmapsMap.clear(),ee(this,Xs,qx).call(this)}_scaleImage(e,t){let n=e.width??e.displayWidth,i=e.height??e.displayHeight,o=Math.max(Math.hypot(t[0],t[1]),1),s=Math.max(Math.hypot(t[2],t[3]),1),a=n,u=i,c="prescale1",f,h;for(;o>2&&a>1||s>2&&u>1;){let p=a,m=u;o>2&&a>1&&(p=a>=16384?Math.floor(a/2)-1||1:Math.ceil(a/2),o/=a/p),s>2&&u>1&&(m=u>=16384?Math.floor(u/2)-1||1:Math.ceil(u)/2,s/=u/m),f=this.cachedCanvases.getCanvas(c,p,m),h=f.context,h.clearRect(0,0,p,m),h.drawImage(e,0,0,a,u,0,0,p,m),e=f.canvas,a=p,u=m,c=c==="prescale1"?"prescale2":"prescale1"}return{img:e,paintWidth:a,paintHeight:u}}_createMaskCanvas(e,t){let n=this.ctx,{width:i,height:o}=t,s=this.current.fillColor,a=this.current.patternFill,u=Tr(n),c,f,h,p;if((t.bitmap||t.data)&&t.count>1){let K=t.bitmap||t.data.buffer;f=JSON.stringify(a?u:[u.slice(0,4),s]),c=this._cachedBitmapsMap.get(K),c||(c=new Map,this._cachedBitmapsMap.set(K,c));let ne=c.get(f);if(ne&&!a){let k=Math.round(Math.min(u[0],u[2])+u[4]),$=Math.round(Math.min(u[1],u[3])+u[5]);return this.dependencyTracker?.recordDependencies(e,ls.transformAndFill),{canvas:ne,offsetX:k,offsetY:$}}h=ne}h||(p=this.cachedCanvases.getCanvas("maskCanvas",i,o),gB(p.context,t));let m=nt.transform(u,[1/i,0,0,-1/o,0,0]);m=nt.transform(m,[1,0,0,1,0,-o]);let b=Fh.slice();nt.axialAlignedBoundingBox([0,0,i,o],m,b);let[v,w,y,_]=b,E=Math.round(y-v)||1,S=Math.round(_-w)||1,A=this.cachedCanvases.getCanvas("fillCanvas",E,S),F=A.context,D=v,H=w;F.translate(-D,-H),F.transform(...m),h||(h=this._scaleImage(p.canvas,fo(F)),h=h.img,c&&a&&c.set(f,h)),F.imageSmoothingEnabled=mB(Tr(F),t.interpolate),Ew(F,h,0,0,h.width,h.height,0,0,i,o),F.globalCompositeOperation="source-in";let J=nt.transform(fo(F),[1,0,0,1,-D,-H]);return F.fillStyle=a?s.getPattern(n,this,J,Dn.FILL,e):s,F.fillRect(0,0,i,o),c&&!a&&(this.cachedCanvases.delete("fillCanvas"),c.set(f,A.canvas)),this.dependencyTracker?.recordDependencies(e,ls.transformAndFill),{canvas:A.canvas,offsetX:Math.round(D),offsetY:Math.round(H)}}setLineWidth(e,t){this.dependencyTracker?.recordSimpleData("lineWidth",e),t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(e,t){this.dependencyTracker?.recordSimpleData("lineCap",e),this.ctx.lineCap=uV[t]}setLineJoin(e,t){this.dependencyTracker?.recordSimpleData("lineJoin",e),this.ctx.lineJoin=cV[t]}setMiterLimit(e,t){this.dependencyTracker?.recordSimpleData("miterLimit",e),this.ctx.miterLimit=t}setDash(e,t,n){this.dependencyTracker?.recordSimpleData("dash",e);let i=this.ctx;i.setLineDash!==void 0&&(i.setLineDash(t),i.lineDashOffset=n)}setRenderingIntent(e,t){}setFlatness(e,t){}setGState(e,t){for(let[n,i]of t)switch(n){case"LW":this.setLineWidth(e,i);break;case"LC":this.setLineCap(e,i);break;case"LJ":this.setLineJoin(e,i);break;case"ML":this.setMiterLimit(e,i);break;case"D":this.setDash(e,i[0],i[1]);break;case"RI":this.setRenderingIntent(e,i);break;case"FL":this.setFlatness(e,i);break;case"Font":this.setFont(e,i[0],i[1]);break;case"CA":this.dependencyTracker?.recordSimpleData("strokeAlpha",e),this.current.strokeAlpha=i;break;case"ca":this.dependencyTracker?.recordSimpleData("fillAlpha",e),this.ctx.globalAlpha=this.current.fillAlpha=i;break;case"BM":this.dependencyTracker?.recordSimpleData("globalCompositeOperation",e),this.ctx.globalCompositeOperation=i;break;case"SMask":this.dependencyTracker?.recordSimpleData("SMask",e),this.current.activeSMask=i?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.dependencyTracker?.recordSimpleData("filter",e),this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(i);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){let e=this.inSMaskMode;this.current.activeSMask&&!e?this.beginSMaskMode():!this.current.activeSMask&&e&&this.endSMaskMode()}beginSMaskMode(e){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");let t=this.ctx.canvas.width,n=this.ctx.canvas.height,i="smaskGroupAt"+this.groupLevel,o=this.cachedCanvases.getCanvas(i,t,n);this.suspendedCtx=this.ctx;let s=this.ctx=o.context;s.setTransform(this.suspendedCtx.getTransform()),Ig(this.suspendedCtx,s),lV(s,this.suspendedCtx),this.setGState(e,[["BM","source-over"]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),Ig(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(e){if(!this.current.activeSMask)return;e?(e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.ceil(e[2]),e[3]=Math.ceil(e[3])):e=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];let t=this.current.activeSMask,n=this.suspendedCtx;this.composeSMask(n,t,this.ctx,e),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()}composeSMask(e,t,n,i){let o=i[0],s=i[1],a=i[2]-o,u=i[3]-s;a===0||u===0||(this.genericComposeSMask(t.context,n,a,u,t.subtype,t.backdrop,t.transferMap,o,s,t.offsetX,t.offsetY),e.save(),e.globalAlpha=1,e.globalCompositeOperation="source-over",e.setTransform(1,0,0,1,0,0),e.drawImage(n.canvas,0,0),e.restore())}genericComposeSMask(e,t,n,i,o,s,a,u,c,f,h){let p=e.canvas,m=u-f,b=c-h;if(s)if(m<0||b<0||m+n>p.width||b+i>p.height){let w=this.cachedCanvases.getCanvas("maskExtension",n,i),y=w.context;y.drawImage(p,-m,-b),y.globalCompositeOperation="destination-atop",y.fillStyle=s,y.fillRect(0,0,n,i),y.globalCompositeOperation="source-over",p=w.canvas,m=b=0}else{e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0);let w=new Path2D;w.rect(m,b,n,i),e.clip(w),e.globalCompositeOperation="destination-atop",e.fillStyle=s,e.fillRect(m,b,n,i),e.restore()}t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0),o==="Alpha"&&a?t.filter=this.filterFactory.addAlphaFilter(a):o==="Luminosity"&&(t.filter=this.filterFactory.addLuminosityFilter(a));let v=new Path2D;v.rect(u,c,n,i),t.clip(v),t.globalCompositeOperation="destination-in",t.drawImage(p,m,b,n,i,u,c,n,i),t.restore()}save(e){this.inSMaskMode&&Ig(this.ctx,this.suspendedCtx),this.ctx.save();let t=this.current;this.stateStack.push(t),this.current=t.clone(),this.dependencyTracker?.save(e)}restore(e){if(this.dependencyTracker?.restore(e),this.stateStack.length===0){this.inSMaskMode&&this.endSMaskMode();return}this.current=this.stateStack.pop(),this.ctx.restore(),this.inSMaskMode&&Ig(this.suspendedCtx,this.ctx),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}transform(e,t,n,i,o,s,a){this.dependencyTracker?.recordIncrementalData("transform",e),this.ctx.transform(t,n,i,o,s,a),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(e,t,n,i){let[o]=n;if(!i){o||(o=n[0]=new Path2D),this[t](e,o);return}if(this.dependencyTracker!==null){let s=t===mp.stroke?this.current.lineWidth/2:0;this.dependencyTracker.resetBBox(e).recordBBox(e,this.ctx,i[0]-s,i[2]+s,i[1]-s,i[3]+s).recordDependencies(e,["transform"])}o instanceof Path2D||(o=n[0]=IB(o)),nt.axialAlignedBoundingBox(i,Tr(this.ctx),this.current.minMax),this[t](e,o),this._pathStartIdx=e}closePath(e){this.ctx.closePath()}stroke(e,t,n=!0){let i=this.ctx,o=this.current.strokeColor;if(i.globalAlpha=this.current.strokeAlpha,this.contentVisible)if(typeof o=="object"&&o?.getPattern){let s=o.isModifyingCurrentTransform()?i.getTransform():null;if(i.save(),i.strokeStyle=o.getPattern(i,this,fo(i),Dn.STROKE,e),s){let a=new Path2D;a.addPath(t,i.getTransform().invertSelf().multiplySelf(s)),t=a}this.rescaleAndStroke(t,!1),i.restore()}else this.rescaleAndStroke(t,!0);this.dependencyTracker?.recordDependencies(e,ls.stroke),n&&this.consumePath(e,t,this.current.getClippedPathBoundingBox(Dn.STROKE,Tr(this.ctx))),i.globalAlpha=this.current.fillAlpha}closeStroke(e,t){this.stroke(e,t)}fill(e,t,n=!0){let i=this.ctx,o=this.current.fillColor,s=this.current.patternFill,a=!1;if(s){let c=o.isModifyingCurrentTransform()?i.getTransform():null;if(this.dependencyTracker?.save(e),i.save(),i.fillStyle=o.getPattern(i,this,fo(i),Dn.FILL,e),c){let f=new Path2D;f.addPath(t,i.getTransform().invertSelf().multiplySelf(c)),t=f}a=!0}let u=this.current.getClippedPathBoundingBox();this.contentVisible&&u!==null&&(this.pendingEOFill?(i.fill(t,"evenodd"),this.pendingEOFill=!1):i.fill(t)),this.dependencyTracker?.recordDependencies(e,ls.fill),a&&(i.restore(),this.dependencyTracker?.restore(e)),n&&this.consumePath(e,t,u)}eoFill(e,t){this.pendingEOFill=!0,this.fill(e,t)}fillStroke(e,t){this.fill(e,t,!1),this.stroke(e,t,!1),this.consumePath(e,t)}eoFillStroke(e,t){this.pendingEOFill=!0,this.fillStroke(e,t)}closeFillStroke(e,t){this.fillStroke(e,t)}closeEOFillStroke(e,t){this.pendingEOFill=!0,this.fillStroke(e,t)}endPath(e,t){this.consumePath(e,t)}rawFillPath(e,t){this.ctx.fill(t),this.dependencyTracker?.recordDependencies(e,ls.rawFillPath).recordOperation(e)}clip(e){this.dependencyTracker?.recordFutureForcedDependency("clipMode",e),this.pendingClip=fV}eoClip(e){this.dependencyTracker?.recordFutureForcedDependency("clipMode",e),this.pendingClip=yB}beginText(e){this.current.textMatrix=null,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0,this.dependencyTracker?.recordOpenMarker(e).resetIncrementalData("sameLineText").resetIncrementalData("moveText",e)}endText(e){let t=this.pendingTextPaths,n=this.ctx;if(this.dependencyTracker){let{dependencyTracker:i}=this;t!==void 0&&i.recordFutureForcedDependency("textClip",i.getOpenMarker()).recordFutureForcedDependency("textClip",e),i.recordCloseMarker(e)}if(t!==void 0){let i=new Path2D,o=n.getTransform().invertSelf();for(let{transform:s,x:a,y:u,fontSize:c,path:f}of t)f&&i.addPath(f,new DOMMatrix(s).preMultiplySelf(o).translate(a,u).scale(c,-c));n.clip(i)}delete this.pendingTextPaths}setCharSpacing(e,t){this.dependencyTracker?.recordSimpleData("charSpacing",e),this.current.charSpacing=t}setWordSpacing(e,t){this.dependencyTracker?.recordSimpleData("wordSpacing",e),this.current.wordSpacing=t}setHScale(e,t){this.dependencyTracker?.recordSimpleData("hScale",e),this.current.textHScale=t/100}setLeading(e,t){this.dependencyTracker?.recordSimpleData("leading",e),this.current.leading=-t}setFont(e,t,n){this.dependencyTracker?.recordSimpleData("font",e).recordSimpleDataFromNamed("fontObj",t,e);let i=this.commonObjs.get(t),o=this.current;if(!i)throw new Error(`Can't find font for ${t}`);if(o.fontMatrix=i.fontMatrix||qA,(o.fontMatrix[0]===0||o.fontMatrix[3]===0)&&_t("Invalid font matrix for font "+t),n<0?(n=-n,o.fontDirection=-1):o.fontDirection=1,this.current.font=i,this.current.fontSize=n,i.isType3Font)return;let s=i.loadedName||"sans-serif",a=i.systemFontInfo?.css||`"${s}", ${i.fallbackName}`,u="normal";i.black?u="900":i.bold&&(u="bold");let c=i.italic?"italic":"normal",f=n;n<fB?f=fB:n>hB&&(f=hB),this.current.fontSizeScale=n/f,this.ctx.font=`${c} ${u} ${f}px ${a}`}setTextRenderingMode(e,t){this.dependencyTracker?.recordSimpleData("textRenderingMode",e),this.current.textRenderingMode=t}setTextRise(e,t){this.dependencyTracker?.recordSimpleData("textRise",e),this.current.textRise=t}moveText(e,t,n){this.dependencyTracker?.resetIncrementalData("sameLineText").recordIncrementalData("moveText",e),this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=n}setLeadingMoveText(e,t,n){this.setLeading(e,-n),this.moveText(e,t,n)}setTextMatrix(e,t){this.dependencyTracker?.resetIncrementalData("sameLineText").recordSimpleData("textMatrix",e);let{current:n}=this;n.textMatrix=t,n.textMatrixScale=Math.hypot(t[0],t[1]),n.x=n.lineX=0,n.y=n.lineY=0}nextLine(e){this.moveText(e,0,this.current.leading),this.dependencyTracker?.recordIncrementalData("moveText",this.dependencyTracker.getSimpleIndex("leading")??e)}paintChar(e,t,n,i,o,s){let a=this.ctx,u=this.current,c=u.font,f=u.textRenderingMode,h=u.fontSize/u.fontSizeScale,p=f&on.FILL_STROKE_MASK,m=!!(f&on.ADD_TO_PATH_FLAG),b=u.patternFill&&!c.missingFile,v=u.patternStroke&&!c.missingFile,w;if((c.disableFontFace||m||b||v)&&!c.missingFile&&(w=c.getPathGenerator(this.commonObjs,t)),w&&(c.disableFontFace||b||v)){a.save(),a.translate(n,i),a.scale(h,-h),this.dependencyTracker?.recordCharacterBBox(e,a,c);let y;if(p===on.FILL||p===on.FILL_STROKE)if(o){y=a.getTransform(),a.setTransform(...o);let _=ee(this,Xs,Hx).call(this,w,y,o);a.fill(_)}else a.fill(w);if(p===on.STROKE||p===on.FILL_STROKE)if(s){y||(y=a.getTransform()),a.setTransform(...s);let{a:_,b:E,c:S,d:A}=y,F=nt.inverseTransform(s),D=nt.transform([_,E,S,A,0,0],F);nt.singularValueDecompose2dScale(D,Vi),a.lineWidth*=Math.max(Vi[0],Vi[1])/h,a.stroke(ee(this,Xs,Hx).call(this,w,y,s))}else a.lineWidth/=h,a.stroke(w);a.restore()}else(p===on.FILL||p===on.FILL_STROKE)&&(a.fillText(t,n,i),this.dependencyTracker?.recordCharacterBBox(e,a,c,h,n,i,()=>a.measureText(t))),(p===on.STROKE||p===on.FILL_STROKE)&&(this.dependencyTracker&&this.dependencyTracker?.recordCharacterBBox(e,a,c,h,n,i,()=>a.measureText(t)).recordDependencies(e,ls.stroke),a.strokeText(t,n,i));m&&((this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:Tr(a),x:n,y:i,fontSize:h,path:w}),this.dependencyTracker?.recordCharacterBBox(e,a,c,h,n,i))}get isFontSubpixelAAEnabled(){let{context:e}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);e.scale(1.5,1),e.fillText("I",0,10);let t=e.getImageData(0,0,10,10).data,n=!1;for(let i=3;i<t.length;i+=4)if(t[i]>0&&t[i]<255){n=!0;break}return wt(this,"isFontSubpixelAAEnabled",n)}showText(e,t){this.dependencyTracker&&(this.dependencyTracker.recordDependencies(e,ls.showText).resetBBox(e),this.current.textRenderingMode&on.ADD_TO_PATH_FLAG&&this.dependencyTracker.recordFutureForcedDependency("textClip",e).inheritPendingDependenciesAsFutureForcedDependencies());let n=this.current,i=n.font;if(i.isType3Font){this.showType3Text(e,t),this.dependencyTracker?.recordShowTextOperation(e);return}let o=n.fontSize;if(o===0){this.dependencyTracker?.recordOperation(e);return}let s=this.ctx,a=n.fontSizeScale,u=n.charSpacing,c=n.wordSpacing,f=n.fontDirection,h=n.textHScale*f,p=t.length,m=i.vertical,b=m?1:-1,v=i.defaultVMetrics,w=o*n.fontMatrix[0],y=n.textRenderingMode===on.FILL&&!i.disableFontFace&&!n.patternFill;s.save(),n.textMatrix&&s.transform(...n.textMatrix),s.translate(n.x,n.y+n.textRise),f>0?s.scale(h,-1):s.scale(h,1);let _,E,S=n.textRenderingMode&on.FILL_STROKE_MASK,A=S===on.FILL||S===on.FILL_STROKE,F=S===on.STROKE||S===on.FILL_STROKE;if(A&&n.patternFill){s.save();let ne=n.fillColor.getPattern(s,this,fo(s),Dn.FILL,e);_=Tr(s),s.restore(),s.fillStyle=ne}if(F&&n.patternStroke){s.save();let ne=n.strokeColor.getPattern(s,this,fo(s),Dn.STROKE,e);E=Tr(s),s.restore(),s.strokeStyle=ne}let D=n.lineWidth,H=n.textMatrixScale;if(H===0||D===0?F&&(D=this.getSinglePixelWidth()):D/=H,a!==1&&(s.scale(a,a),D/=a),s.lineWidth=D,i.isInvalidPDFjsFont){let ne=[],k=0;for(let Y of t)ne.push(Y.unicode),k+=Y.width;let $=ne.join("");if(s.fillText($,0,0),this.dependencyTracker!==null){let Y=s.measureText($);this.dependencyTracker.recordBBox(e,this.ctx,-Y.actualBoundingBoxLeft,Y.actualBoundingBoxRight,-Y.actualBoundingBoxAscent,Y.actualBoundingBoxDescent).recordShowTextOperation(e)}n.x+=k*w*h,s.restore(),this.compose();return}let J=0,K;for(K=0;K<p;++K){let ne=t[K];if(typeof ne=="number"){J+=b*ne*o/1e3;continue}let k=!1,$=(ne.isSpace?c:0)+u,Y=ne.fontChar,ie=ne.accent,re,N,x=ne.width;if(m){let j=ne.vmetric||v,U=-(ne.vmetric?j[1]:x*.5)*w,B=j[2]*w;x=j?-j[0]:x,re=U/a,N=(J+B)/a}else re=J/a,N=0;let P;if(i.remeasure&&x>0){P=s.measureText(Y);let j=P.width*1e3/o*a;if(x<j&&this.isFontSubpixelAAEnabled){let U=x/j;k=!0,s.save(),s.scale(U,1),re/=U}else x!==j&&(re+=(x-j)/2e3*o/a)}if(this.contentVisible&&(ne.isInFont||i.missingFile)){if(y&&!ie)s.fillText(Y,re,N),this.dependencyTracker?.recordCharacterBBox(e,s,P?{bbox:null}:i,o/a,re,N,()=>P??s.measureText(Y));else if(this.paintChar(e,Y,re,N,_,E),ie){let j=re+o*ie.offset.x/a,U=N-o*ie.offset.y/a;this.paintChar(e,ie.fontChar,j,U,_,E)}}let C=m?x*w-$*f:x*w+$*f;J+=C,k&&s.restore()}m?n.y-=J:n.x+=J*h,s.restore(),this.compose(),this.dependencyTracker?.recordShowTextOperation(e)}showType3Text(e,t){let n=this.ctx,i=this.current,o=i.font,s=i.fontSize,a=i.fontDirection,u=o.vertical?1:-1,c=i.charSpacing,f=i.wordSpacing,h=i.textHScale*a,p=i.fontMatrix||qA,m=t.length,b=i.textRenderingMode===on.INVISIBLE,v,w,y,_;if(b||s===0)return;this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,n.save(),i.textMatrix&&n.transform(...i.textMatrix),n.translate(i.x,i.y+i.textRise),n.scale(h,a);let E=this.dependencyTracker;for(this.dependencyTracker=E?new xv(E,e):null,v=0;v<m;++v){if(w=t[v],typeof w=="number"){_=u*w*s/1e3,this.ctx.translate(_,0),i.x+=_*h;continue}let S=(w.isSpace?f:0)+c,A=o.charProcOperatorList[w.operatorListId];A?this.contentVisible&&(this.save(),n.scale(s,s),n.transform(...p),this.executeOperatorList(A),this.restore()):_t(`Type3 character "${w.operatorListId}" is not available.`);let F=[w.width,0];nt.applyTransform(F,p),y=F[0]*s+S,n.translate(y,0),i.x+=y*h}n.restore(),E&&(this.dependencyTracker=E)}setCharWidth(e,t,n){}setCharWidthAndBounds(e,t,n,i,o,s,a){let u=new Path2D;u.rect(i,o,s-i,a-o),this.ctx.clip(u),this.dependencyTracker?.recordBBox(e,this.ctx,i,s,o,a).recordClipBox(e,this.ctx,i,s,o,a),this.endPath(e)}getColorN_Pattern(e,t){let n;if(t[0]==="TilingPattern"){let i=this.baseTransform||Tr(this.ctx),o={createCanvasGraphics:(s,a)=>new RT(s,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack},void 0,void 0,this.dependencyTracker?new xv(this.dependencyTracker,a,!0):null)};n=new $x(t,this.ctx,o,i)}else n=this._getPattern(e,t[1],t[2]);return n}setStrokeColorN(e,...t){this.dependencyTracker?.recordSimpleData("strokeColor",e),this.current.strokeColor=this.getColorN_Pattern(e,t),this.current.patternStroke=!0}setFillColorN(e,...t){this.dependencyTracker?.recordSimpleData("fillColor",e),this.current.fillColor=this.getColorN_Pattern(e,t),this.current.patternFill=!0}setStrokeRGBColor(e,t){this.dependencyTracker?.recordSimpleData("strokeColor",e),this.ctx.strokeStyle=this.current.strokeColor=t,this.current.patternStroke=!1}setStrokeTransparent(e){this.dependencyTracker?.recordSimpleData("strokeColor",e),this.ctx.strokeStyle=this.current.strokeColor="transparent",this.current.patternStroke=!1}setFillRGBColor(e,t){this.dependencyTracker?.recordSimpleData("fillColor",e),this.ctx.fillStyle=this.current.fillColor=t,this.current.patternFill=!1}setFillTransparent(e){this.dependencyTracker?.recordSimpleData("fillColor",e),this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(e,t,n=null){let i;return this.cachedPatterns.has(t)?i=this.cachedPatterns.get(t):(i=sV(this.getObject(e,t)),this.cachedPatterns.set(t,i)),n&&(i.matrix=n),i}shadingFill(e,t){if(!this.contentVisible)return;let n=this.ctx;this.save(e);let i=this._getPattern(e,t);n.fillStyle=i.getPattern(n,this,fo(n),Dn.SHADING,e);let o=fo(n);if(o){let{width:s,height:a}=n.canvas,u=Fh.slice();nt.axialAlignedBoundingBox([0,0,s,a],o,u);let[c,f,h,p]=u;this.ctx.fillRect(c,f,h-c,p-f)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.dependencyTracker?.resetBBox(e).recordFullPageBBox(e).recordDependencies(e,ls.transform).recordDependencies(e,ls.fill).recordOperation(e),this.compose(this.current.getClippedPathBoundingBox()),this.restore(e)}beginInlineImage(){dr("Should not call beginInlineImage")}beginImageData(){dr("Should not call beginImageData")}paintFormXObjectBegin(e,t,n){if(this.contentVisible&&(this.save(e),this.baseTransformStack.push(this.baseTransform),t&&this.transform(e,...t),this.baseTransform=Tr(this.ctx),n)){nt.axialAlignedBoundingBox(n,this.baseTransform,this.current.minMax);let[i,o,s,a]=n,u=new Path2D;u.rect(i,o,s-i,a-o),this.ctx.clip(u),this.dependencyTracker?.recordClipBox(e,this.ctx,i,s,o,a),this.endPath(e)}}paintFormXObjectEnd(e){this.contentVisible&&(this.restore(e),this.baseTransform=this.baseTransformStack.pop())}beginGroup(e,t){if(!this.contentVisible)return;this.save(e),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);let n=this.ctx;t.isolated||u_("TODO: Support non-isolated groups."),t.knockout&&_t("Knockout groups not supported.");let i=Tr(n);if(t.matrix&&n.transform(...t.matrix),!t.bbox)throw new Error("Bounding box is required.");let o=Fh.slice();nt.axialAlignedBoundingBox(t.bbox,Tr(n),o);let s=[0,0,n.canvas.width,n.canvas.height];o=nt.intersect(o,s)||[0,0,0,0];let a=Math.floor(o[0]),u=Math.floor(o[1]),c=Math.max(Math.ceil(o[2])-a,1),f=Math.max(Math.ceil(o[3])-u,1);this.current.startNewPathAndClipBox([0,0,c,f]);let h="groupAt"+this.groupLevel;t.smask&&(h+="_smask_"+this.smaskCounter++%2);let p=this.cachedCanvases.getCanvas(h,c,f),m=p.context;m.translate(-a,-u),m.transform(...i);let b=new Path2D,[v,w,y,_]=t.bbox;if(b.rect(v,w,y-v,_-w),t.matrix){let E=new Path2D;E.addPath(b,new DOMMatrix(t.matrix)),b=E}m.clip(b),t.smask&&this.smaskStack.push({canvas:p.canvas,context:m,offsetX:a,offsetY:u,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null}),(!t.smask||this.dependencyTracker)&&(n.setTransform(1,0,0,1,0,0),n.translate(a,u),n.save()),Ig(n,m),this.ctx=m,this.dependencyTracker?.inheritSimpleDataAsFutureForcedDependencies(["fillAlpha","strokeAlpha","globalCompositeOperation"]).pushBaseTransform(n),this.setGState(e,[["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(n),this.groupLevel++}endGroup(e,t){if(!this.contentVisible)return;this.groupLevel--;let n=this.ctx,i=this.groupStack.pop();if(this.ctx=i,this.ctx.imageSmoothingEnabled=!1,this.dependencyTracker?.popBaseTransform(),t.smask)this.tempSMask=this.smaskStack.pop(),this.restore(e),this.dependencyTracker&&this.ctx.restore();else{this.ctx.restore();let o=Tr(this.ctx);this.restore(e),this.ctx.save(),this.ctx.setTransform(...o);let s=Fh.slice();nt.axialAlignedBoundingBox([0,0,n.canvas.width,n.canvas.height],o,s),this.ctx.drawImage(n.canvas,0,0),this.ctx.restore(),this.compose(s)}}beginAnnotation(e,t,n,i,o,s){if(ee(this,Xs,Wx).call(this),Aw(this.ctx),this.ctx.save(),this.save(e),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),n){let a=n[2]-n[0],u=n[3]-n[1];if(s&&this.annotationCanvasMap){i=i.slice(),i[4]-=n[0],i[5]-=n[1],n=n.slice(),n[0]=n[1]=0,n[2]=a,n[3]=u,nt.singularValueDecompose2dScale(Tr(this.ctx),Vi);let{viewportScale:c}=this,f=Math.ceil(a*this.outputScaleX*c),h=Math.ceil(u*this.outputScaleY*c);this.annotationCanvas=this.canvasFactory.create(f,h);let{canvas:p,context:m}=this.annotationCanvas;this.annotationCanvasMap.set(t,p),this.annotationCanvas.savedCtx=this.ctx,this.ctx=m,this.ctx.save(),this.ctx.setTransform(Vi[0],0,0,-Vi[1],0,u*Vi[1]),Aw(this.ctx)}else{Aw(this.ctx),this.endPath(e);let c=new Path2D;c.rect(n[0],n[1],a,u),this.ctx.clip(c)}}this.current=new Sv(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(e,...i),this.transform(e,...o)}endAnnotation(e){this.annotationCanvas&&(this.ctx.restore(),ee(this,Xs,qx).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(e,t){if(!this.contentVisible)return;let n=t.count;t=this.getObject(e,t.data,t),t.count=n;let i=this.ctx,o=this._createMaskCanvas(e,t),s=o.canvas;i.save(),i.setTransform(1,0,0,1,0,0),i.drawImage(s,o.offsetX,o.offsetY),this.dependencyTracker?.resetBBox(e).recordBBox(e,this.ctx,o.offsetX,o.offsetX+s.width,o.offsetY,o.offsetY+s.height).recordOperation(e),i.restore(),this.compose()}paintImageMaskXObjectRepeat(e,t,n,i=0,o=0,s,a){if(!this.contentVisible)return;t=this.getObject(e,t.data,t);let u=this.ctx;u.save();let c=Tr(u);u.transform(n,i,o,s,0,0);let f=this._createMaskCanvas(e,t);u.setTransform(1,0,0,1,f.offsetX-c[4],f.offsetY-c[5]),this.dependencyTracker?.resetBBox(e);for(let h=0,p=a.length;h<p;h+=2){let m=nt.transform(c,[n,i,o,s,a[h],a[h+1]]);u.drawImage(f.canvas,m[4],m[5]),this.dependencyTracker?.recordBBox(e,this.ctx,m[4],m[4]+f.canvas.width,m[5],m[5]+f.canvas.height)}u.restore(),this.compose(),this.dependencyTracker?.recordOperation(e)}paintImageMaskXObjectGroup(e,t){if(!this.contentVisible)return;let n=this.ctx,i=this.current.fillColor,o=this.current.patternFill;this.dependencyTracker?.resetBBox(e).recordDependencies(e,ls.transformAndFill);for(let s of t){let{data:a,width:u,height:c,transform:f}=s,h=this.cachedCanvases.getCanvas("maskCanvas",u,c),p=h.context;p.save();let m=this.getObject(e,a,s);gB(p,m),p.globalCompositeOperation="source-in",p.fillStyle=o?i.getPattern(p,this,fo(n),Dn.FILL,e):i,p.fillRect(0,0,u,c),p.restore(),n.save(),n.transform(...f),n.scale(1,-1),Ew(n,h.canvas,0,0,u,c,0,-1,1,1),this.dependencyTracker?.recordBBox(e,n,0,u,0,c),n.restore()}this.compose(),this.dependencyTracker?.recordOperation(e)}paintImageXObject(e,t){if(!this.contentVisible)return;let n=this.getObject(e,t);if(!n){_t("Dependent image isn't ready yet");return}this.paintInlineImageXObject(e,n)}paintImageXObjectRepeat(e,t,n,i,o){if(!this.contentVisible)return;let s=this.getObject(e,t);if(!s){_t("Dependent image isn't ready yet");return}let a=s.width,u=s.height,c=[];for(let f=0,h=o.length;f<h;f+=2)c.push({transform:[n,0,0,i,o[f],o[f+1]],x:0,y:0,w:a,h:u});this.paintInlineImageXObjectGroup(e,s,c)}applyTransferMapsToCanvas(e){return this.current.transferMaps!=="none"&&(e.filter=this.current.transferMaps,e.drawImage(e.canvas,0,0),e.filter="none"),e.canvas}applyTransferMapsToBitmap(e){if(this.current.transferMaps==="none")return e.bitmap;let{bitmap:t,width:n,height:i}=e,o=this.cachedCanvases.getCanvas("inlineImage",n,i),s=o.context;return s.filter=this.current.transferMaps,s.drawImage(t,0,0),s.filter="none",o.canvas}paintInlineImageXObject(e,t){if(!this.contentVisible)return;let n=t.width,i=t.height,o=this.ctx;this.save(e);let{filter:s}=o;s!=="none"&&s!==""&&(o.filter="none"),o.scale(1/n,-1/i);let a;if(t.bitmap)a=this.applyTransferMapsToBitmap(t);else if(typeof HTMLElement=="function"&&t instanceof HTMLElement||!t.data)a=t;else{let f=this.cachedCanvases.getCanvas("inlineImage",n,i).context;pB(f,t),a=this.applyTransferMapsToCanvas(f)}let u=this._scaleImage(a,fo(o));o.imageSmoothingEnabled=mB(Tr(o),t.interpolate),this.dependencyTracker?.resetBBox(e).recordBBox(e,o,0,n,-i,0).recordDependencies(e,ls.imageXObject).recordOperation(e),Ew(o,u.img,0,0,u.paintWidth,u.paintHeight,0,-i,n,i),this.compose(),this.restore(e)}paintInlineImageXObjectGroup(e,t,n){if(!this.contentVisible)return;let i=this.ctx,o;if(t.bitmap)o=t.bitmap;else{let s=t.width,a=t.height,c=this.cachedCanvases.getCanvas("inlineImage",s,a).context;pB(c,t),o=this.applyTransferMapsToCanvas(c)}this.dependencyTracker?.resetBBox(e);for(let s of n)i.save(),i.transform(...s.transform),i.scale(1,-1),Ew(i,o,s.x,s.y,s.w,s.h,0,-1,1,1),this.dependencyTracker?.recordBBox(e,i,0,1,-1,0),i.restore();this.dependencyTracker?.recordOperation(e),this.compose()}paintSolidColorImageMask(e){this.contentVisible&&(this.dependencyTracker?.resetBBox(e).recordBBox(e,this.ctx,0,1,0,1).recordDependencies(e,ls.fill).recordOperation(e),this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(e,t){}markPointProps(e,t,n){}beginMarkedContent(e,t){this.dependencyTracker?.beginMarkedContent(e),this.markedContentStack.push({visible:!0})}beginMarkedContentProps(e,t,n){this.dependencyTracker?.beginMarkedContent(e),t==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(n)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(e){this.dependencyTracker?.endMarkedContent(e),this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(e){}endCompat(e){}consumePath(e,t,n){let i=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(n);let o=this.ctx;this.pendingClip?(i||(this.pendingClip===yB?o.clip(t,"evenodd"):o.clip(t)),this.pendingClip=null,this.dependencyTracker?.bboxToClipBoxDropOperation(e).recordFutureForcedDependency("clipPath",e)):this.dependencyTracker?.recordOperation(e),this.current.startNewPathAndClipBox(this.current.clipBox)}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){let e=Tr(this.ctx);if(e[1]===0&&e[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(e[0]),Math.abs(e[3]));else{let t=Math.abs(e[0]*e[3]-e[2]*e[1]),n=Math.hypot(e[0],e[2]),i=Math.hypot(e[1],e[3]);this._cachedGetSinglePixelWidth=Math.max(n,i)/t}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){let{lineWidth:e}=this.current,{a:t,b:n,c:i,d:o}=this.ctx.getTransform(),s,a;if(n===0&&i===0){let u=Math.abs(t),c=Math.abs(o);if(u===c)if(e===0)s=a=1/u;else{let f=u*e;s=a=f<1?1/f:1}else if(e===0)s=1/u,a=1/c;else{let f=u*e,h=c*e;s=f<1?1/f:1,a=h<1?1/h:1}}else{let u=Math.abs(t*o-n*i),c=Math.hypot(t,n),f=Math.hypot(i,o);if(e===0)s=f/u,a=c/u;else{let h=e*u;s=f>h?f/h:1,a=c>h?c/h:1}}this._cachedScaleForStroking[0]=s,this._cachedScaleForStroking[1]=a}return this._cachedScaleForStroking}rescaleAndStroke(e,t){let{ctx:n,current:{lineWidth:i}}=this,[o,s]=this.getScaleForStroking();if(o===s){n.lineWidth=(i||1)*o,n.stroke(e);return}let a=n.getLineDash();t&&n.save(),n.scale(o,s),$A.a=1/o,$A.d=1/s;let u=new Path2D;if(u.addPath(e,$A),a.length>0){let c=Math.max(o,s);n.setLineDash(a.map(f=>f/c)),n.lineDashOffset/=c}n.lineWidth=i||1,n.stroke(u),t&&n.restore()}isContentVisible(){for(let e=this.markedContentStack.length-1;e>=0;e--)if(!this.markedContentStack[e].visible)return!1;return!0}};Xs=new WeakSet,Wx=function(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null,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)},qx=function(){if(this.pageColors){let e=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(e!=="none"){let t=this.ctx.filter;this.ctx.filter=e,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=t}}},Hx=function(e,t,n){let i=new Path2D;return i.addPath(e,new DOMMatrix(n).invertSelf().multiplySelf(t)),i};Wh=RT;for(let r in mp)Wh.prototype[r]!==void 0&&(Wh.prototype[mp[r]]=Wh.prototype[r]);_s=class{static get workerPort(){return l(this,oy)}static set workerPort(e){if(!(typeof Worker<"u"&&e instanceof Worker)&&e!==null)throw new Error("Invalid `workerPort` type.");L(this,oy,e)}static get workerSrc(){return l(this,ay)}static set workerSrc(e){if(typeof e!="string")throw new Error("Invalid `workerSrc` type.");L(this,ay,e)}};oy=new WeakMap,ay=new WeakMap,q(_s,oy,null),q(_s,ay,"");Gx=class{constructor({parsedData:e,rawData:t}){q(this,Td);q(this,ly);L(this,Td,e),L(this,ly,t)}getRaw(){return l(this,ly)}get(e){return l(this,Td).get(e)??null}[Symbol.iterator](){return l(this,Td).entries()}};Td=new WeakMap,ly=new WeakMap;kh=Symbol("INTERNAL"),Vx=class{constructor(e,{name:t,intent:n,usage:i,rbGroups:o}){q(this,uy,!1);q(this,cy,!1);q(this,fy,!1);q(this,Cd,!0);L(this,uy,!!(e&Gi.DISPLAY)),L(this,cy,!!(e&Gi.PRINT)),this.name=t,this.intent=n,this.usage=i,this.rbGroups=o}get visible(){if(l(this,fy))return l(this,Cd);if(!l(this,Cd))return!1;let{print:e,view:t}=this.usage;return l(this,uy)?t?.viewState!=="OFF":l(this,cy)?e?.printState!=="OFF":!0}_setVisible(e,t,n=!1){e!==kh&&dr("Internal method `_setVisible` called."),L(this,fy,n),L(this,Cd,t)}};uy=new WeakMap,cy=new WeakMap,fy=new WeakMap,Cd=new WeakMap;Yx=class{constructor(e,t=Gi.DISPLAY){q(this,hy);q(this,Yl,null);q(this,sr,new Map);q(this,Rd,null);q(this,Dd,null);if(this.renderingIntent=t,this.name=null,this.creator=null,e!==null){this.name=e.name,this.creator=e.creator,L(this,Dd,e.order);for(let n of e.groups)l(this,sr).set(n.id,new Vx(t,n));if(e.baseState==="OFF")for(let n of l(this,sr).values())n._setVisible(kh,!1);for(let n of e.on)l(this,sr).get(n)._setVisible(kh,!0);for(let n of e.off)l(this,sr).get(n)._setVisible(kh,!1);L(this,Rd,this.getHash())}}isVisible(e){if(l(this,sr).size===0)return!0;if(!e)return u_("Optional content group not defined."),!0;if(e.type==="OCG")return l(this,sr).has(e.id)?l(this,sr).get(e.id).visible:(_t(`Optional content group not found: ${e.id}`),!0);if(e.type==="OCMD"){if(e.expression)return ee(this,hy,Xx).call(this,e.expression);if(!e.policy||e.policy==="AnyOn"){for(let t of e.ids){if(!l(this,sr).has(t))return _t(`Optional content group not found: ${t}`),!0;if(l(this,sr).get(t).visible)return!0}return!1}else if(e.policy==="AllOn"){for(let t of e.ids){if(!l(this,sr).has(t))return _t(`Optional content group not found: ${t}`),!0;if(!l(this,sr).get(t).visible)return!1}return!0}else if(e.policy==="AnyOff"){for(let t of e.ids){if(!l(this,sr).has(t))return _t(`Optional content group not found: ${t}`),!0;if(!l(this,sr).get(t).visible)return!0}return!1}else if(e.policy==="AllOff"){for(let t of e.ids){if(!l(this,sr).has(t))return _t(`Optional content group not found: ${t}`),!0;if(l(this,sr).get(t).visible)return!1}return!0}return _t(`Unknown optional content policy ${e.policy}.`),!0}return _t(`Unknown group type ${e.type}.`),!0}setVisibility(e,t=!0,n=!0){let i=l(this,sr).get(e);if(!i){_t(`Optional content group not found: ${e}`);return}if(n&&t&&i.rbGroups.length)for(let o of i.rbGroups)for(let s of o)s!==e&&l(this,sr).get(s)?._setVisible(kh,!1,!0);i._setVisible(kh,!!t,!0),L(this,Yl,null)}setOCGState({state:e,preserveRB:t}){let n;for(let i of e){switch(i){case"ON":case"OFF":case"Toggle":n=i;continue}let o=l(this,sr).get(i);if(o)switch(n){case"ON":this.setVisibility(i,!0,t);break;case"OFF":this.setVisibility(i,!1,t);break;case"Toggle":this.setVisibility(i,!o.visible,t);break}}L(this,Yl,null)}get hasInitialVisibility(){return l(this,Rd)===null||this.getHash()===l(this,Rd)}getOrder(){return l(this,sr).size?l(this,Dd)?l(this,Dd).slice():[...l(this,sr).keys()]:null}getGroup(e){return l(this,sr).get(e)||null}getHash(){if(l(this,Yl)!==null)return l(this,Yl);let e=new hv;for(let[t,n]of l(this,sr))e.update(`${t}:${n.visible}`);return L(this,Yl,e.hexdigest())}[Symbol.iterator](){return l(this,sr).entries()}};Yl=new WeakMap,sr=new WeakMap,Rd=new WeakMap,Dd=new WeakMap,hy=new WeakSet,Xx=function(e){let t=e.length;if(t<2)return!0;let n=e[0];for(let i=1;i<t;i++){let o=e[i],s;if(Array.isArray(o))s=ee(this,hy,Xx).call(this,o);else if(l(this,sr).has(o))s=l(this,sr).get(o).visible;else return _t(`Optional content group not found: ${o}`),!0;switch(n){case"And":if(!s)return!1;break;case"Or":if(s)return!0;break;case"Not":return!s;default:return!0}}return n==="And"};Kx=class{constructor(e,{disableRange:t=!1,disableStream:n=!1}){Bt(e,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');let{length:i,initialData:o,progressiveDone:s,contentDispositionFilename:a}=e;if(this._queuedChunks=[],this._progressiveDone=s,this._contentDispositionFilename=a,o?.length>0){let u=o instanceof Uint8Array&&o.byteLength===o.buffer.byteLength?o.buffer:new Uint8Array(o).buffer;this._queuedChunks.push(u)}this._pdfDataRangeTransport=e,this._isStreamingSupported=!n,this._isRangeSupported=!t,this._contentLength=i,this._fullRequestReader=null,this._rangeReaders=[],e.addRangeListener((u,c)=>{this._onReceiveData({begin:u,chunk:c})}),e.addProgressListener((u,c)=>{this._onProgress({loaded:u,total:c})}),e.addProgressiveReadListener(u=>{this._onReceiveData({chunk:u})}),e.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),e.transportReady()}_onReceiveData({begin:e,chunk:t}){let n=t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength?t.buffer:new Uint8Array(t).buffer;if(e===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(n):this._queuedChunks.push(n);else{let i=this._rangeReaders.some(function(o){return o._begin!==e?!1:(o._enqueue(n),!0)});Bt(i,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(e){e.total===void 0?this._rangeReaders[0]?.onProgress?.({loaded:e.loaded}):this._fullRequestReader?.onProgress?.({loaded:e.loaded,total:e.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(e){let t=this._rangeReaders.indexOf(e);t>=0&&this._rangeReaders.splice(t,1)}getFullReader(){Bt(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");let e=this._queuedChunks;return this._queuedChunks=null,new Zx(this,e,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;let n=new Jx(this,e,t);return this._pdfDataRangeTransport.requestDataRange(e,t),this._rangeReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(let t of this._rangeReaders.slice(0))t.cancel(e);this._pdfDataRangeTransport.abort()}},Zx=class{constructor(e,t,n=!1,i=null){this._stream=e,this._done=n||!1,this._filename=c_(i)?i:null,this._queuedChunks=t||[],this._loaded=0;for(let o of this._queuedChunks)this._loaded+=o.byteLength;this._requests=[],this._headersReady=Promise.resolve(),e._fullRequestReader=this,this.onProgress=null}_enqueue(e){this._done||(this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunks.push(e),this._loaded+=e.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};let e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(let t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}},Jx=class{constructor(e,t,n){this._stream=e,this._begin=t,this._end=n,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(e){if(!this._done){if(this._requests.length===0)this._queuedChunk=e;else{this._requests.shift().resolve({value:e,done:!1});for(let n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){let t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};let e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(let t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}};Qx=class{constructor(e){Ke(this,"_responseOrigin",null);this.source=e,this.isHttp=/^https?:/i.test(e.url),this.headers=pF(this.isHttp,e.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return Bt(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new eS(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;let n=new tS(this,e,t);return this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(let t of this._rangeRequestReaders.slice(0))t.cancel(e)}},eS=class{constructor(e){this._stream=e,this._reader=null,this._loaded=0,this._filename=null;let t=e.source;this._withCredentials=t.withCredentials||!1,this._contentLength=t.length,this._headersCapability=Promise.withResolvers(),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;let n=new Headers(e.headers),i=t.url;fetch(i,bF(n,this._withCredentials,this._abortController)).then(o=>{if(e._responseOrigin=f_(o.url),!yF(o.status))throw h0(o.status,i);this._reader=o.body.getReader(),this._headersCapability.resolve();let s=o.headers,{allowRangeRequests:a,suggestedLength:u}=gF({responseHeaders:s,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=a,this._contentLength=u||this._contentLength,this._filename=mF(s),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new Ys("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._headersCapability.promise;let{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:wF(e),done:!1})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}},tS=class{constructor(e,t,n){this._stream=e,this._reader=null,this._loaded=0;let i=e.source;this._withCredentials=i.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!i.disableStream,this._abortController=new AbortController;let o=new Headers(e.headers);o.append("Range",`bytes=${t}-${n-1}`);let s=i.url;fetch(s,bF(o,this._withCredentials,this._abortController)).then(a=>{let u=f_(a.url);if(u!==e._responseOrigin)throw new Error(`Expected range response-origin "${u}" to match "${e._responseOrigin}".`);if(!yF(a.status))throw h0(a.status,s);this._readCapability.resolve(),this._reader=a.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;let{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this.onProgress?.({loaded:this._loaded}),{value:wF(e),done:!1})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}},zA=200,WA=206;rS=class{constructor({url:e,httpHeaders:t,withCredentials:n}){Ke(this,"_responseOrigin",null);this.url=e,this.isHttp=/^https?:/i.test(e),this.headers=pF(this.isHttp,t),this.withCredentials=n||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}request(e){let t=new XMLHttpRequest,n=this.currXhrId++,i=this.pendingRequests[n]={xhr:t};t.open("GET",this.url),t.withCredentials=this.withCredentials;for(let[o,s]of this.headers)t.setRequestHeader(o,s);return this.isHttp&&"begin"in e&&"end"in e?(t.setRequestHeader("Range",`bytes=${e.begin}-${e.end-1}`),i.expectedStatus=WA):i.expectedStatus=zA,t.responseType="arraybuffer",Bt(e.onError,"Expected `onError` callback to be provided."),t.onerror=()=>{e.onError(t.status)},t.onreadystatechange=this.onStateChange.bind(this,n),t.onprogress=this.onProgress.bind(this,n),i.onHeadersReceived=e.onHeadersReceived,i.onDone=e.onDone,i.onError=e.onError,i.onProgress=e.onProgress,t.send(null),n}onProgress(e,t){let n=this.pendingRequests[e];n&&n.onProgress?.(t)}onStateChange(e,t){let n=this.pendingRequests[e];if(!n)return;let i=n.xhr;if(i.readyState>=2&&n.onHeadersReceived&&(n.onHeadersReceived(),delete n.onHeadersReceived),i.readyState!==4||!(e in this.pendingRequests))return;if(delete this.pendingRequests[e],i.status===0&&this.isHttp){n.onError(i.status);return}let o=i.status||zA;if(!(o===zA&&n.expectedStatus===WA)&&o!==n.expectedStatus){n.onError(i.status);return}let a=dV(i);if(o===WA){let u=i.getResponseHeader("Content-Range"),c=/bytes (\d+)-(\d+)\/(\d+)/.exec(u);c?n.onDone({begin:parseInt(c[1],10),chunk:a}):(_t('Missing or invalid "Content-Range" header.'),n.onError(0))}else a?n.onDone({begin:0,chunk:a}):n.onError(i.status)}getRequestXhr(e){return this.pendingRequests[e].xhr}isPendingRequest(e){return e in this.pendingRequests}abortRequest(e){let t=this.pendingRequests[e].xhr;delete this.pendingRequests[e],t.abort()}},nS=class{constructor(e){this._source=e,this._manager=new rS(e),this._rangeChunkSize=e.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(e){let t=this._rangeRequestReaders.indexOf(e);t>=0&&this._rangeRequestReaders.splice(t,1)}getFullReader(){return Bt(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new iS(this._manager,this._source),this._fullRequestReader}getRangeReader(e,t){let n=new sS(this._manager,e,t);return n.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(let t of this._rangeRequestReaders.slice(0))t.cancel(e)}},iS=class{constructor(e,t){this._manager=e,this._url=t.url,this._fullRequestId=e.request({onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._headersCapability=Promise.withResolvers(),this._disableRange=t.disableRange||!1,this._contentLength=t.length,this._rangeChunkSize=t.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){let e=this._fullRequestId,t=this._manager.getRequestXhr(e);this._manager._responseOrigin=f_(t.responseURL);let n=t.getAllResponseHeaders(),i=new Headers(n?n.trimStart().replace(/[^\S ]+$/,"").split(/[\r\n]+/).map(a=>{let[u,...c]=a.split(": ");return[u,c.join(": ")]}):[]),{allowRangeRequests:o,suggestedLength:s}=gF({responseHeaders:i,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});o&&(this._isRangeSupported=!0),this._contentLength=s||this._contentLength,this._filename=mF(i),this._isRangeSupported&&this._manager.abortRequest(e),this._headersCapability.resolve()}_onDone(e){if(e&&(this._requests.length>0?this._requests.shift().resolve({value:e.chunk,done:!1}):this._cachedChunks.push(e.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(let t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(e){this._storedError=h0(e,this._url),this._headersCapability.reject(this._storedError);for(let t of this._requests)t.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(e){this.onProgress?.({loaded:e.loaded,total:e.lengthComputable?e.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._headersCapability.promise}async read(){if(await this._headersCapability.promise,this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};let e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._headersCapability.reject(e);for(let 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}},sS=class{constructor(e,t,n){this._manager=e,this._url=e.url,this._requestId=e.request({begin:t,end:n,onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_onHeadersReceived(){let e=f_(this._manager.getRequestXhr(this._requestId)?.responseURL);e!==this._manager._responseOrigin&&(this._storedError=new Error(`Expected range response-origin "${e}" to match "${this._manager._responseOrigin}".`),this._onError(0))}_close(){this.onClosed?.(this)}_onDone(e){let t=e.chunk;this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunk=t,this._done=!0;for(let n of this._requests)n.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(e){this._storedError??(this._storedError=h0(e,this._url));for(let t of this._requests)t.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(e){this.isStreamingSupported||this.onProgress?.({loaded:e.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){let t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};let e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(let 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()}},pV=/^[a-z][a-z0-9\-+.]+:/i;oS=class{constructor(e){this.source=e,this.url=gV(e.url),Bt(this.url.protocol==="file:","PDFNodeStream only supports file:// URLs."),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return Bt(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=new aS(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;let n=new lS(this,e,t);return this._rangeRequestReaders.push(n),n}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(let t of this._rangeRequestReaders.slice(0))t.cancel(e)}},aS=class{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null;let t=e.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=Promise.withResolvers(),this._headersCapability=Promise.withResolvers();let n=process.getBuiltinModule("fs");n.promises.lstat(this._url).then(i=>{this._contentLength=i.size,this._setReadableStream(n.createReadStream(this._url)),this._headersCapability.resolve()},i=>{i.code==="ENOENT"&&(i=h0(0,this._url.href)),this._storedError=i,this._headersCapability.reject(i)})}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;let e=this._readableStream.read();return e===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=e.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){if(!this._readableStream){this._error(e);return}this._readableStream.destroy(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",t=>{this._error(t)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new Ys("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}},lS=class{constructor(e,t,n){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();let i=e.source;this._isStreamingSupported=!i.disableStream;let o=process.getBuiltinModule("fs");this._setReadableStream(o.createReadStream(this._url,{start:t,end:n-1}))}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;let e=this._readableStream.read();return e===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=e.length,this.onProgress?.({loaded:this._loaded}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){if(!this._readableStream){this._error(e);return}this._readableStream.destroy(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",t=>{this._error(t)}),this._storedError&&this._readableStream.destroy(this._storedError)}},Og=Symbol("INITIAL_DATA"),Tv=class{constructor(){q(this,dy);q(this,Oi,Object.create(null))}get(e,t=null){if(t){let i=ee(this,dy,uS).call(this,e);return i.promise.then(()=>t(i.data)),null}let n=l(this,Oi)[e];if(!n||n.data===Og)throw new Error(`Requesting object that isn't resolved yet ${e}.`);return n.data}has(e){let t=l(this,Oi)[e];return!!t&&t.data!==Og}delete(e){let t=l(this,Oi)[e];return!t||t.data===Og?!1:(delete l(this,Oi)[e],!0)}resolve(e,t=null){let n=ee(this,dy,uS).call(this,e);n.data=t,n.resolve()}clear(){for(let e in l(this,Oi)){let{data:t}=l(this,Oi)[e];t?.bitmap?.close()}L(this,Oi,Object.create(null))}*[Symbol.iterator](){for(let e in l(this,Oi)){let{data:t}=l(this,Oi)[e];t!==Og&&(yield[e,t])}}};Oi=new WeakMap,dy=new WeakSet,uS=function(e){var t;return(t=l(this,Oi))[e]||(t[e]={...Promise.withResolvers(),data:Og})};mV=1e5,bB=30,An=class An{constructor({textContentSource:e,container:t,viewport:n}){q(this,nl);q(this,Xl,Promise.withResolvers());q(this,Ni,null);q(this,py,!1);q(this,gy,!!globalThis.FontInspector?.enabled);q(this,zc,null);q(this,ka,null);q(this,my,0);q(this,yy,0);q(this,Wc,null);q(this,by,null);q(this,Id,0);q(this,Kl,0);q(this,Od,Object.create(null));q(this,wy,[]);q(this,Nd,null);q(this,qc,[]);q(this,vy,new WeakMap);q(this,_y,null);var u;if(e instanceof ReadableStream)L(this,Nd,e);else if(typeof e=="object")L(this,Nd,new ReadableStream({start(c){c.enqueue(e),c.close()}}));else throw new Error('No "textContentSource" parameter specified.');L(this,Ni,L(this,by,t)),L(this,Kl,n.scale*Bo.pixelRatio),L(this,Id,n.rotation),L(this,ka,{div:null,properties:null,ctx:null});let{pageWidth:i,pageHeight:o,pageX:s,pageY:a}=n.rawDims;L(this,_y,[1,0,0,-1,-s,a+o]),L(this,yy,i),L(this,my,o),ee(u=An,Xi,EF).call(u),t.style.setProperty("--min-font-size",l(An,Ld)),bu(t,n),l(this,Xl).promise.finally(()=>{l(An,Pd).delete(this),L(this,ka,null),L(this,Od,null)}).catch(()=>{})}static get fontFamilyMap(){let{isWindows:e,isFirefox:t}=Ur.platform;return wt(this,"fontFamilyMap",new Map([["sans-serif",`${e&&t?"Calibri, ":""}sans-serif`],["monospace",`${e&&t?"Lucida Console, ":""}monospace`]]))}render(){let e=()=>{l(this,Wc).read().then(({value:t,done:n})=>{if(n){l(this,Xl).resolve();return}l(this,zc)??L(this,zc,t.lang),Object.assign(l(this,Od),t.styles),ee(this,nl,vF).call(this,t.items),e()},l(this,Xl).reject)};return L(this,Wc,l(this,Nd).getReader()),l(An,Pd).add(this),e(),l(this,Xl).promise}update({viewport:e,onBefore:t=null}){var o;let n=e.scale*Bo.pixelRatio,i=e.rotation;if(i!==l(this,Id)&&(t?.(),L(this,Id,i),bu(l(this,by),{rotation:i})),n!==l(this,Kl)){t?.(),L(this,Kl,n);let s={div:null,properties:null,ctx:ee(o=An,Xi,Fw).call(o,l(this,zc))};for(let a of l(this,qc))s.properties=l(this,vy).get(a),s.div=a,ee(this,nl,cS).call(this,s)}}cancel(){let e=new Ys("TextLayer task cancelled.");l(this,Wc)?.cancel(e).catch(()=>{}),L(this,Wc,null),l(this,Xl).reject(e)}get textDivs(){return l(this,qc)}get textContentItemsStr(){return l(this,wy)}static cleanup(){if(!(l(this,Pd).size>0)){l(this,kd).clear();for(let{canvas:e}of l(this,Hc).values())e.remove();l(this,Hc).clear()}}};Xl=new WeakMap,Ni=new WeakMap,py=new WeakMap,gy=new WeakMap,zc=new WeakMap,ka=new WeakMap,my=new WeakMap,yy=new WeakMap,Wc=new WeakMap,by=new WeakMap,Id=new WeakMap,Kl=new WeakMap,Od=new WeakMap,wy=new WeakMap,Nd=new WeakMap,qc=new WeakMap,vy=new WeakMap,_y=new WeakMap,kd=new WeakMap,Hc=new WeakMap,Ey=new WeakMap,Ld=new WeakMap,Pd=new WeakMap,nl=new WeakSet,vF=function(e){var i,o;if(l(this,py))return;(o=l(this,ka)).ctx??(o.ctx=ee(i=An,Xi,Fw).call(i,l(this,zc)));let t=l(this,qc),n=l(this,wy);for(let s of e){if(t.length>mV){_t("Ignoring additional textDivs for performance reasons."),L(this,py,!0);return}if(s.str===void 0){if(s.type==="beginMarkedContentProps"||s.type==="beginMarkedContent"){let a=l(this,Ni);L(this,Ni,document.createElement("span")),l(this,Ni).classList.add("markedContent"),s.id&&l(this,Ni).setAttribute("id",`${s.id}`),a.append(l(this,Ni))}else s.type==="endMarkedContent"&&L(this,Ni,l(this,Ni).parentNode);continue}n.push(s.str),ee(this,nl,_F).call(this,s)}},_F=function(e){var b;let t=document.createElement("span"),n={angle:0,canvasWidth:0,hasText:e.str!=="",hasEOL:e.hasEOL,fontSize:0};l(this,qc).push(t);let i=nt.transform(l(this,_y),e.transform),o=Math.atan2(i[1],i[0]),s=l(this,Od)[e.fontName];s.vertical&&(o+=Math.PI/2);let a=l(this,gy)&&s.fontSubstitution||s.fontFamily;a=An.fontFamilyMap.get(a)||a;let u=Math.hypot(i[2],i[3]),c=u*ee(b=An,Xi,AF).call(b,a,s,l(this,zc)),f,h;o===0?(f=i[4],h=i[5]-c):(f=i[4]+c*Math.sin(o),h=i[5]-c*Math.cos(o));let p=t.style;p.left=`${(100*f/l(this,yy)).toFixed(2)}%`,p.top=`${(100*h/l(this,my)).toFixed(2)}%`,p.setProperty("--font-height",`${u.toFixed(2)}px`),p.fontFamily=a,n.fontSize=u,t.setAttribute("role","presentation"),t.textContent=e.str,t.dir=e.dir,l(this,gy)&&(t.dataset.fontName=s.fontSubstitutionLoadedName||e.fontName),o!==0&&(n.angle=o*(180/Math.PI));let m=!1;if(e.str.length>1)m=!0;else if(e.str!==" "&&e.transform[0]!==e.transform[3]){let v=Math.abs(e.transform[0]),w=Math.abs(e.transform[3]);v!==w&&Math.max(v,w)/Math.min(v,w)>1.5&&(m=!0)}if(m&&(n.canvasWidth=s.vertical?e.height:e.width),l(this,vy).set(t,n),l(this,ka).div=t,l(this,ka).properties=n,ee(this,nl,cS).call(this,l(this,ka)),n.hasText&&l(this,Ni).append(t),n.hasEOL){let v=document.createElement("br");v.setAttribute("role","presentation"),l(this,Ni).append(v)}},cS=function(e){var s;let{div:t,properties:n,ctx:i}=e,{style:o}=t;if(n.canvasWidth!==0&&n.hasText){let{fontFamily:a}=o,{canvasWidth:u,fontSize:c}=n;ee(s=An,Xi,fS).call(s,i,c*l(this,Kl),a);let{width:f}=i.measureText(t.textContent);f>0&&o.setProperty("--scale-x",u*l(this,Kl)/f)}n.angle!==0&&o.setProperty("--rotate",`${n.angle}deg`)},Xi=new WeakSet,Fw=function(e=null){let t=l(this,Hc).get(e||(e=""));if(!t){let n=document.createElement("canvas");n.className="hiddenCanvasElement",n.lang=e,document.body.append(n),t=n.getContext("2d",{alpha:!1,willReadFrequently:!0}),l(this,Hc).set(e,t),l(this,Ey).set(t,{size:0,family:""})}return t},fS=function(e,t,n){let i=l(this,Ey).get(e);t===i.size&&n===i.family||(e.font=`${t}px ${n}`,i.size=t,i.family=n)},EF=function(){if(l(this,Ld)!==null)return;let e=document.createElement("div");e.style.opacity=0,e.style.lineHeight=1,e.style.fontSize="1px",e.style.position="absolute",e.textContent="X",document.body.append(e),L(this,Ld,e.getBoundingClientRect().height),e.remove()},AF=function(e,t,n){let i=l(this,kd).get(e);if(i)return i;let o=ee(this,Xi,Fw).call(this,n);o.canvas.width=o.canvas.height=bB,ee(this,Xi,fS).call(this,o,bB,e);let s=o.measureText(""),a=s.fontBoundingBoxAscent,u=Math.abs(s.fontBoundingBoxDescent);o.canvas.width=o.canvas.height=0;let c=.8;return a?c=a/(a+u):(Ur.platform.isFirefox&&_t("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."),t.ascent?c=t.ascent:t.descent&&(c=1+t.descent)),l(this,kd).set(e,c),c},q(An,Xi),q(An,kd,new Map),q(An,Hc,new Map),q(An,Ey,new WeakMap),q(An,Ld,null),q(An,Pd,new Set);wp=An,yV=100;Qv=class Qv{constructor(){Ke(this,"_capability",Promise.withResolvers());Ke(this,"_transport",null);Ke(this,"_worker",null);Ke(this,"docId",`d${tn(Qv,Jv)._++}`);Ke(this,"destroyed",!1);Ke(this,"onPassword",null);Ke(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(e){throw this._worker?.port&&delete this._worker._pendingDestroy,e}this._transport=null,this._worker?.destroy(),this._worker=null}async getData(){return this._transport.getData()}};Jv=new WeakMap,q(Qv,Jv,0);hS=Qv,fm=class{constructor(e,t,n=!1,i=null){q(this,Gc,Promise.withResolvers());q(this,Ay,[]);q(this,xy,[]);q(this,Sy,[]);q(this,Ty,[]);this.length=e,this.initialData=t,this.progressiveDone=n,this.contentDispositionFilename=i}addRangeListener(e){l(this,Ty).push(e)}addProgressListener(e){l(this,Sy).push(e)}addProgressiveReadListener(e){l(this,xy).push(e)}addProgressiveDoneListener(e){l(this,Ay).push(e)}onDataRange(e,t){for(let n of l(this,Ty))n(e,t)}onDataProgress(e,t){l(this,Gc).promise.then(()=>{for(let n of l(this,Sy))n(e,t)})}onDataProgressiveRead(e){l(this,Gc).promise.then(()=>{for(let t of l(this,xy))t(e)})}onDataProgressiveDone(){l(this,Gc).promise.then(()=>{for(let e of l(this,Ay))e()})}transportReady(){l(this,Gc).resolve()}requestDataRange(e,t){dr("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}};Gc=new WeakMap,Ay=new WeakMap,xy=new WeakMap,Sy=new WeakMap,Ty=new WeakMap;dS=class{constructor(e,t){this._pdfInfo=e,this._transport=t}get annotationStorage(){return this._transport.annotationStorage}get canvasFactory(){return this._transport.canvasFactory}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return wt(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(e){return this._transport.getPage(e)}getPageIndex(e){return this._transport.getPageIndex(e)}getDestinations(){return this._transport.getDestinations()}getDestination(e){return this._transport.getDestination(e)}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()}getAnnotationsByType(e,t){return this._transport.getAnnotationsByType(e,t)}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:e="display"}={}){let{renderingIntent:t}=this._transport.getRenderingIntent(e);return this._transport.getOptionalContentConfig(t)}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()}extractPages(e){return this._transport.extractPages(e)}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(e=!1){return this._transport.startCleanup(e||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(e){return this._transport.cachedPageNumber(e)}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()}},pS=class{constructor(e,t,n,i=!1){q(this,Vc);q(this,La,!1);this._pageIndex=e,this._pageInfo=t,this._transport=n,this._stats=i?new lv:null,this._pdfBug=i,this.commonObjs=n.commonObjs,this.objs=new Tv,this._intentStates=new Map,this.destroyed=!1,this.recordedBBoxes=null}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({scale:e,rotation:t=this.rotate,offsetX:n=0,offsetY:i=0,dontFlip:o=!1}={}){return new am({viewBox:this.view,userUnit:this.userUnit,scale:e,rotation:t,offsetX:n,offsetY:i,dontFlip:o})}getAnnotations({intent:e="display"}={}){let{renderingIntent:t}=this._transport.getRenderingIntent(e);return this._transport.getAnnotations(this._pageIndex,t)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return wt(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:e,canvas:t=e.canvas,viewport:n,intent:i="display",annotationMode:o=Ka.ENABLE,transform:s=null,background:a=null,optionalContentConfigPromise:u=null,annotationCanvasMap:c=null,pageColors:f=null,printAnnotationStorage:h=null,isEditing:p=!1,recordOperations:m=!1,operationsFilter:b=null}){this._stats?.time("Overall");let v=this._transport.getRenderingIntent(i,o,h,p),{renderingIntent:w,cacheKey:y}=v;L(this,La,!1),u||(u=this._transport.getOptionalContentConfig(w));let _=this._intentStates.get(y);_||(_=Object.create(null),this._intentStates.set(y,_)),_.streamReaderCancelTimeout&&(clearTimeout(_.streamReaderCancelTimeout),_.streamReaderCancelTimeout=null);let E=!!(w&Gi.PRINT);_.displayReadyCapability||(_.displayReadyCapability=Promise.withResolvers(),_.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(v));let S=!!(this._pdfBug&&globalThis.StepperManager?.enabled),A=!this.recordedBBoxes&&(m||S),F=J=>{if(_.renderTasks.delete(D),A){let K=D.gfx?.dependencyTracker.take();K&&(D.stepper&&D.stepper.setOperatorBBoxes(K,D.gfx.dependencyTracker.takeDebugMetadata()),m&&(this.recordedBBoxes=K))}E&&L(this,La,!0),ee(this,Vc,Gg).call(this),J?(D.capability.reject(J),this._abortOperatorList({intentState:_,reason:J instanceof Error?J:new Error(J)})):D.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},D=new yS({callback:F,params:{canvas:t,canvasContext:e,dependencyTracker:A?new Px(t,_.operatorList.length,S):null,viewport:n,transform:s,background:a},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:c,operatorList:_.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!E,pdfBug:this._pdfBug,pageColors:f,enableHWA:this._transport.enableHWA,operationsFilter:b});(_.renderTasks||(_.renderTasks=new Set)).add(D);let H=D.task;return Promise.all([_.displayReadyCapability.promise,u]).then(([J,K])=>{if(this.destroyed){F();return}if(this._stats?.time("Rendering"),!(K.renderingIntent&w))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");D.initializeGraphics({transparency:J,optionalContentConfig:K}),D.operatorListChanged()}).catch(F),H}getOperatorList({intent:e="display",annotationMode:t=Ka.ENABLE,printAnnotationStorage:n=null,isEditing:i=!1}={}){function o(){a.operatorList.lastChunk&&(a.opListReadCapability.resolve(a.operatorList),a.renderTasks.delete(u))}let s=this._transport.getRenderingIntent(e,t,n,i,!0),a=this._intentStates.get(s.cacheKey);a||(a=Object.create(null),this._intentStates.set(s.cacheKey,a));let u;return a.opListReadCapability||(u=Object.create(null),u.operatorListChanged=o,a.opListReadCapability=Promise.withResolvers(),(a.renderTasks||(a.renderTasks=new Set)).add(u),a.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(s)),a.opListReadCapability.promise}streamTextContent({includeMarkedContent:e=!1,disableNormalization:t=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:e===!0,disableNormalization:t===!0},{highWaterMark:100,size(i){return i.items.length}})}getTextContent(e={}){if(this._transport._htmlForXfa)return this.getXfa().then(n=>sm.textContent(n));let t=this.streamTextContent(e);return new Promise(function(n,i){function o(){s.read().then(function({value:u,done:c}){if(c){n(a);return}a.lang??(a.lang=u.lang),Object.assign(a.styles,u.styles),a.items.push(...u.items),o()},i)}let s=t.getReader(),a={items:[],styles:Object.create(null),lang:null};o()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;let e=[];for(let t of this._intentStates.values())if(this._abortOperatorList({intentState:t,reason:new Error("Page was destroyed."),force:!0}),!t.opListReadCapability)for(let n of t.renderTasks)e.push(n.completed),n.cancel();return this.objs.clear(),L(this,La,!1),Promise.all(e)}cleanup(e=!1){L(this,La,!0);let t=ee(this,Vc,Gg).call(this);return e&&t&&this._stats&&(this._stats=new lv),t}_startRenderPage(e,t){let n=this._intentStates.get(t);n&&(this._stats?.timeEnd("Page Request"),n.displayReadyCapability?.resolve(e))}_renderPageChunk(e,t){for(let n=0,i=e.length;n<i;n++)t.operatorList.fnArray.push(e.fnArray[n]),t.operatorList.argsArray.push(e.argsArray[n]);t.operatorList.lastChunk=e.lastChunk,t.operatorList.separateAnnots=e.separateAnnots;for(let n of t.renderTasks)n.operatorListChanged();e.lastChunk&&ee(this,Vc,Gg).call(this)}_pumpOperatorList({renderingIntent:e,cacheKey:t,annotationStorageSerializable:n,modifiedIds:i}){let{map:o,transfer:s}=n,u=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:e,cacheKey:t,annotationStorage:o,modifiedIds:i},s).getReader(),c=this._intentStates.get(t);c.streamReader=u;let f=()=>{u.read().then(({value:h,done:p})=>{if(p){c.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(h,c),f())},h=>{if(c.streamReader=null,!this._transport.destroyed){if(c.operatorList){c.operatorList.lastChunk=!0;for(let p of c.renderTasks)p.operatorListChanged();ee(this,Vc,Gg).call(this)}if(c.displayReadyCapability)c.displayReadyCapability.reject(h);else if(c.opListReadCapability)c.opListReadCapability.reject(h);else throw h}})};f()}_abortOperatorList({intentState:e,reason:t,force:n=!1}){if(e.streamReader){if(e.streamReaderCancelTimeout&&(clearTimeout(e.streamReaderCancelTimeout),e.streamReaderCancelTimeout=null),!n){if(e.renderTasks.size>0)return;if(t instanceof bp){let i=yV;t.extraDelay>0&&t.extraDelay<1e3&&(i+=t.extraDelay),e.streamReaderCancelTimeout=setTimeout(()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:t,force:!0})},i);return}}if(e.streamReader.cancel(new Ys(t.message)).catch(()=>{}),e.streamReader=null,!this._transport.destroyed){for(let[i,o]of this._intentStates)if(o===e){this._intentStates.delete(i);break}this.cleanup()}}}get stats(){return this._stats}};La=new WeakMap,Vc=new WeakSet,Gg=function(){if(!l(this,La)||this.destroyed)return!1;for(let{renderTasks:e,operatorList:t}of this._intentStates.values())if(e.size>0||!t.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),L(this,La,!1),!0};_r=class _r{constructor({name:e=null,port:t=null,verbosity:n=HG()}={}){q(this,ei);q(this,Zl,Promise.withResolvers());q(this,js,null);q(this,Pa,null);q(this,Yc,null);if(this.name=e,this.destroyed=!1,this.verbosity=n,t){if(l(_r,Kc).has(t))throw new Error("Cannot use more than one PDFWorker per port.");l(_r,Kc).set(t,this),ee(this,ei,SF).call(this,t)}else ee(this,ei,TF).call(this)}get promise(){return l(this,Zl).promise}get port(){return l(this,Pa)}get messageHandler(){return l(this,js)}destroy(){this.destroyed=!0,l(this,Yc)?.terminate(),L(this,Yc,null),l(_r,Kc).delete(l(this,Pa)),L(this,Pa,null),l(this,js)?.destroy(),L(this,js,null)}static create(e){let t=l(this,Kc).get(e?.port);if(t){if(t._pendingDestroy)throw new Error("PDFWorker.create - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return t}return new _r(e)}static get workerSrc(){if(_s.workerSrc)return _s.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return wt(this,"_setupFakeWorkerGlobal",(async()=>l(this,Md,jw)?l(this,Md,jw):(await import(this.workerSrc)).WorkerMessageHandler)())}};Zl=new WeakMap,js=new WeakMap,Pa=new WeakMap,Yc=new WeakMap,e_=new WeakMap,Xc=new WeakMap,Kc=new WeakMap,ei=new WeakSet,Uw=function(){l(this,Zl).resolve(),l(this,js).send("configure",{verbosity:this.verbosity})},SF=function(e){L(this,Pa,e),L(this,js,new cc("main","worker",e)),l(this,js).on("ready",()=>{}),ee(this,ei,Uw).call(this)},TF=function(){if(l(_r,Xc)||l(_r,Md,jw)){ee(this,ei,Vg).call(this);return}let{workerSrc:e}=_r;try{_r._isSameOrigin(window.location,e)||(e=_r._createCDNWrapper(new URL(e,window.location).href));let t=new Worker(e,{type:"module"}),n=new cc("main","worker",t),i=()=>{o.abort(),n.destroy(),t.terminate(),this.destroyed?l(this,Zl).reject(new Error("Worker was destroyed")):ee(this,ei,Vg).call(this)},o=new AbortController;t.addEventListener("error",()=>{l(this,Yc)||i()},{signal:o.signal}),n.on("test",a=>{if(o.abort(),this.destroyed||!a){i();return}L(this,js,n),L(this,Pa,t),L(this,Yc,t),ee(this,ei,Uw).call(this)}),n.on("ready",a=>{if(o.abort(),this.destroyed){i();return}try{s()}catch{ee(this,ei,Vg).call(this)}});let s=()=>{let a=new Uint8Array;n.send("test",a,[a.buffer])};s();return}catch{u_("The worker has been disabled.")}ee(this,ei,Vg).call(this)},Vg=function(){l(_r,Xc)||(_t("Setting up fake worker."),L(_r,Xc,!0)),_r._setupFakeWorkerGlobal.then(e=>{if(this.destroyed){l(this,Zl).reject(new Error("Worker was destroyed"));return}let t=new Ax;L(this,Pa,t);let n=`fake${tn(_r,e_)._++}`,i=new cc(n+"_worker",n,t);e.setup(i,t),L(this,js,new cc(n,n+"_worker",t)),ee(this,ei,Uw).call(this)}).catch(e=>{l(this,Zl).reject(new Error(`Setting up fake worker failed: "${e.message}".`))})},Md=new WeakSet,jw=function(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}},q(_r,Md),q(_r,e_,0),q(_r,Xc,!1),q(_r,Kc,new WeakMap),Qn&&(L(_r,Xc,!0),_s.workerSrc||(_s.workerSrc="./pdf.worker.mjs")),_r._isSameOrigin=(e,t)=>{let n=URL.parse(e);if(!n?.origin||n.origin==="null")return!1;let i=new URL(t,n);return n.origin===i.origin},_r._createCDNWrapper=e=>{let t=`await import("${e}");`;return URL.createObjectURL(new Blob([t],{type:"text/javascript"}))},_r.fromPort=e=>{if(QG("`PDFWorker.fromPort` - please use `PDFWorker.create` instead."),!e?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return _r.create(e)};vp=_r,gS=class{constructor(e,t,n,i,o,s){q(this,Zc);q(this,Ma,new Map);q(this,Co,new Map);q(this,Bd,new Map);q(this,Fd,new Map);q(this,Ba,null);this.messageHandler=e,this.loadingTask=t,this.commonObjs=new Tv,this.fontLoader=new yx({ownerDocument:i.ownerDocument,styleElement:i.styleElement}),this.loadingParams=i.loadingParams,this._params=i,this.canvasFactory=o.canvasFactory,this.filterFactory=o.filterFactory,this.cMapReaderFactory=o.cMapReaderFactory,this.standardFontDataFactory=o.standardFontDataFactory,this.wasmFactory=o.wasmFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=n,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.enableHWA=s,this.setupMessageHandler()}get annotationStorage(){return wt(this,"annotationStorage",new um)}getRenderingIntent(e,t=Ka.ENABLE,n=null,i=!1,o=!1){let s=Gi.DISPLAY,a=mx;switch(e){case"any":s=Gi.ANY;break;case"display":break;case"print":s=Gi.PRINT;break;default:_t(`getRenderingIntent - invalid intent: ${e}`)}let u=s&Gi.PRINT&&n instanceof dv?n:this.annotationStorage;switch(t){case Ka.DISABLE:s+=Gi.ANNOTATIONS_DISABLE;break;case Ka.ENABLE:break;case Ka.ENABLE_FORMS:s+=Gi.ANNOTATIONS_FORMS;break;case Ka.ENABLE_STORAGE:s+=Gi.ANNOTATIONS_STORAGE,a=u.serializable;break;default:_t(`getRenderingIntent - invalid annotationMode: ${t}`)}i&&(s+=Gi.IS_EDITING),o&&(s+=Gi.OPLIST);let{ids:c,hash:f}=u.modifiedIds,h=[s,a.hash,f];return{renderingIntent:s,cacheKey:h.join("_"),annotationStorageSerializable:a,modifiedIds:c}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),l(this,Ba)?.reject(new Error("Worker was destroyed during onPassword callback"));let e=[];for(let n of l(this,Co).values())e.push(n._destroy());l(this,Co).clear(),l(this,Bd).clear(),l(this,Fd).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();let t=this.messageHandler.sendWithPromise("Terminate",null);return e.push(t),Promise.all(e).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),l(this,Ma).clear(),this.filterFactory.destroy(),wp.cleanup(),this._networkStream?.cancelAllRequests(new Ys("Worker was terminated.")),this.messageHandler?.destroy(),this.messageHandler=null,this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){let{messageHandler:e,loadingTask:t}=this;e.on("GetReader",(n,i)=>{Bt(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=o=>{this._lastProgress={loaded:o.loaded,total:o.total}},i.onPull=()=>{this._fullReader.read().then(function({value:o,done:s}){if(s){i.close();return}Bt(o instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),i.enqueue(new Uint8Array(o),1,[o])}).catch(o=>{i.error(o)})},i.onCancel=o=>{this._fullReader.cancel(o),i.ready.catch(s=>{if(!this.destroyed)throw s})}}),e.on("ReaderHeadersReady",async n=>{await this._fullReader.headersReady;let{isStreamingSupported:i,isRangeSupported:o,contentLength:s}=this._fullReader;return(!i||!o)&&(this._lastProgress&&t.onProgress?.(this._lastProgress),this._fullReader.onProgress=a=>{t.onProgress?.({loaded:a.loaded,total:a.total})}),{isStreamingSupported:i,isRangeSupported:o,contentLength:s}}),e.on("GetRangeReader",(n,i)=>{Bt(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");let o=this._networkStream.getRangeReader(n.begin,n.end);if(!o){i.close();return}i.onPull=()=>{o.read().then(function({value:s,done:a}){if(a){i.close();return}Bt(s instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),i.enqueue(new Uint8Array(s),1,[s])}).catch(s=>{i.error(s)})},i.onCancel=s=>{o.cancel(s),i.ready.catch(a=>{if(!this.destroyed)throw a})}}),e.on("GetDoc",({pdfInfo:n})=>{this._numPages=n.numPages,this._htmlForXfa=n.htmlForXfa,delete n.htmlForXfa,t._capability.resolve(new dS(n,this))}),e.on("DocException",n=>{t._capability.reject(hi(n))}),e.on("PasswordRequest",n=>{L(this,Ba,Promise.withResolvers());try{if(!t.onPassword)throw hi(n);let i=o=>{o instanceof Error?l(this,Ba).reject(o):l(this,Ba).resolve({password:o})};t.onPassword(i,n.code)}catch(i){l(this,Ba).reject(i)}return l(this,Ba).promise}),e.on("DataLoaded",n=>{t.onProgress?.({loaded:n.length,total:n.length}),this.downloadInfoCapability.resolve(n)}),e.on("StartRenderPage",n=>{if(this.destroyed)return;l(this,Co).get(n.pageIndex)._startRenderPage(n.transparency,n.cacheKey)}),e.on("commonobj",([n,i,o])=>{if(this.destroyed||this.commonObjs.has(n))return null;switch(i){case"Font":if("error"in o){let h=o.error;_t(`Error during font loading: ${h}`),this.commonObjs.resolve(n,h);break}let s=new wx(o),a=this._params.pdfBug&&globalThis.FontInspector?.enabled?(h,p)=>globalThis.FontInspector.fontAdded(h,p):null,u=new bx(s,a,o.extra,o.charProcOperatorList);this.fontLoader.bind(u).catch(()=>e.sendWithPromise("FontFallback",{id:n})).finally(()=>{!u.fontExtraProperties&&u.data&&u.clearData(),this.commonObjs.resolve(n,u)});break;case"CopyLocalImage":let{imageRef:c}=o;Bt(c,"The imageRef must be defined.");for(let h of l(this,Co).values())for(let[,p]of h.objs)if(p?.ref===c)return p.dataLen?(this.commonObjs.resolve(n,structuredClone(p)),p.dataLen):null;break;case"FontPath":this.commonObjs.resolve(n,new _x(o));break;case"Image":this.commonObjs.resolve(n,o);break;case"Pattern":let f=new vx(o);this.commonObjs.resolve(n,f.getIR());break;default:throw new Error(`Got unknown common object type ${i}`)}return null}),e.on("obj",([n,i,o,s])=>{if(this.destroyed)return;let a=l(this,Co).get(i);if(!a.objs.has(n)){if(a._intentStates.size===0){s?.bitmap?.close();return}switch(o){case"Image":case"Pattern":a.objs.resolve(n,s);break;default:throw new Error(`Got unknown object type ${o}`)}}}),e.on("DocProgress",n=>{this.destroyed||t.onProgress?.({loaded:n.loaded,total:n.total})}),e.on("FetchBinaryData",async n=>{if(this.destroyed)throw new Error("Worker was destroyed.");let i=this[n.type];if(!i)throw new Error(`${n.type} not initialized, see the \`useWorkerFetch\` parameter.`);return i.fetch(n)})}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&_t("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");let{map:e,transfer:t}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:e,filename:this._fullReader?.filename??null},t).finally(()=>{this.annotationStorage.resetModified()})}extractPages(e){return this.messageHandler.sendWithPromise("ExtractPages",{pageInfos:e})}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(new Error("Invalid page request."));let t=e-1,n=l(this,Bd).get(t);if(n)return n;let i=this.messageHandler.sendWithPromise("GetPage",{pageIndex:t}).then(o=>{if(this.destroyed)throw new Error("Transport destroyed");o.refStr&&l(this,Fd).set(o.refStr,e);let s=new pS(t,o,this,this._params.pdfBug);return l(this,Co).set(t,s),s});return l(this,Bd).set(t,i),i}getPageIndex(e){return Ex(e)?this.messageHandler.sendWithPromise("GetPageIndex",{num:e.num,gen:e.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(e,t){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:t})}getFieldObjects(){return ee(this,Zc,Yg).call(this,"GetFieldObjects")}hasJSActions(){return ee(this,Zc,Yg).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(e){return typeof e!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:e})}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)}getAnnotationsByType(e,t){return this.messageHandler.sendWithPromise("GetAnnotationsByType",{types:e,pageIndexesToSkip:t})}getDocJSActions(){return ee(this,Zc,Yg).call(this,"GetDocJSActions")}getPageJSActions(e){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:e})}getStructTree(e){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:e})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(e){return ee(this,Zc,Yg).call(this,"GetOptionalContentConfig").then(t=>new Yx(t,e))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){let e="GetMetadata",t=l(this,Ma).get(e);if(t)return t;let n=this.messageHandler.sendWithPromise(e,null).then(i=>({info:i[0],metadata:i[1]?new Gx(i[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null,hasStructTree:i[2]}));return l(this,Ma).set(e,n),n}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(e=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(let t of l(this,Co).values())if(!t.cleanup())throw new Error(`startCleanup: Page ${t.pageNumber} is currently rendering.`);this.commonObjs.clear(),e||this.fontLoader.clear(),l(this,Ma).clear(),this.filterFactory.destroy(!0),wp.cleanup()}}cachedPageNumber(e){if(!Ex(e))return null;let t=e.gen===0?`${e.num}R`:`${e.num}R${e.gen}`;return l(this,Fd).get(t)??null}};Ma=new WeakMap,Co=new WeakMap,Bd=new WeakMap,Fd=new WeakMap,Ba=new WeakMap,Zc=new WeakSet,Yg=function(e,t=null){let n=l(this,Ma).get(e);if(n)return n;let i=this.messageHandler.sendWithPromise(e,t);return l(this,Ma).set(e,i),i};mS=class{constructor(e){q(this,Jl,null);Ke(this,"onContinue",null);Ke(this,"onError",null);L(this,Jl,e)}get promise(){return l(this,Jl).capability.promise}cancel(e=0){l(this,Jl).cancel(null,e)}get separateAnnots(){let{separateAnnots:e}=l(this,Jl).operatorList;if(!e)return!1;let{annotationCanvasMap:t}=l(this,Jl);return e.form||e.canvas&&t?.size>0}};Jl=new WeakMap;lc=class lc{constructor({callback:e,params:t,objs:n,commonObjs:i,annotationCanvasMap:o,operatorList:s,pageIndex:a,canvasFactory:u,filterFactory:c,useRequestAnimationFrame:f=!1,pdfBug:h=!1,pageColors:p=null,enableHWA:m=!1,operationsFilter:b=null}){q(this,Ql,null);this.callback=e,this.params=t,this.objs=n,this.commonObjs=i,this.annotationCanvasMap=o,this.operatorListIdx=null,this.operatorList=s,this._pageIndex=a,this.canvasFactory=u,this.filterFactory=c,this._pdfBug=h,this.pageColors=p,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=f===!0&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new mS(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=t.canvas,this._canvasContext=t.canvas?null:t.canvasContext,this._enableHWA=m,this._dependencyTracker=t.dependencyTracker,this._operationsFilter=b}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:e=!1,optionalContentConfig:t}){if(this.cancelled)return;if(this._canvas){if(l(lc,Jc).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.");l(lc,Jc).add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());let{viewport:n,transform:i,background:o,dependencyTracker:s}=this.params,a=this._canvasContext||this._canvas.getContext("2d",{alpha:!1,willReadFrequently:!this._enableHWA});this.gfx=new Wh(a,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:t},this.annotationCanvasMap,this.pageColors,s),this.gfx.beginDrawing({transform:i,viewport:n,transparency:e,background:o}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(e=null,t=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),l(this,Ql)&&(window.cancelAnimationFrame(l(this,Ql)),L(this,Ql,null)),l(lc,Jc).delete(this._canvas),e||(e=new bp(`Rendering cancelled, page ${this._pageIndex+1}`,t)),this.callback(e),this.task.onError?.(e)}operatorListChanged(){if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}this.gfx.dependencyTracker?.growOperationsCount(this.operatorList.fnArray.length),this.stepper?.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?L(this,Ql,window.requestAnimationFrame(()=>{L(this,Ql,null),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._operationsFilter),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),l(lc,Jc).delete(this._canvas),this.callback())))}};Ql=new WeakMap,Jc=new WeakMap,q(lc,Jc,new WeakSet);yS=lc,CF="5.4.530",RF="50cc4adac",di=class di{constructor({editor:e=null,uiManager:t=null}){q(this,or);q(this,ki,null);q(this,Qc,null);q(this,Ud);q(this,un,null);q(this,Cy,!1);q(this,jd,!1);q(this,Fa,null);q(this,Ry);q(this,eu,null);q(this,$s,null);e?(L(this,jd,!1),L(this,Fa,e)):L(this,jd,!0),L(this,$s,e?._uiManager||t),L(this,Ry,l(this,$s)._eventBus),L(this,Ud,e?.color?.toUpperCase()||l(this,$s)?.highlightColors.values().next().value||"#FFFF98"),l(di,Dy)||L(di,Dy,Object.freeze({blue:"pdfjs-editor-colorpicker-blue",green:"pdfjs-editor-colorpicker-green",pink:"pdfjs-editor-colorpicker-pink",red:"pdfjs-editor-colorpicker-red",yellow:"pdfjs-editor-colorpicker-yellow"}))}static get _keyboardManager(){return wt(this,"_keyboardManager",new Df([[["Escape","mac+Escape"],di.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],di.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],di.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],di.prototype._moveToPrevious],[["Home","mac+Home"],di.prototype._moveToBeginning],[["End","mac+End"],di.prototype._moveToEnd]]))}renderButton(){let e=L(this,ki,document.createElement("button"));e.className="colorPicker",e.tabIndex="0",e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),e.ariaHasPopup="true",l(this,Fa)&&(e.ariaControls=`${l(this,Fa).id}_colorpicker_dropdown`);let t=l(this,$s)._signal;e.addEventListener("click",ee(this,or,ic).bind(this),{signal:t}),e.addEventListener("keydown",ee(this,or,vS).bind(this),{signal:t});let n=L(this,Qc,document.createElement("span"));return n.className="swatch",n.ariaHidden="true",n.style.backgroundColor=l(this,Ud),e.append(n),e}renderMainDropdown(){let e=L(this,un,ee(this,or,bS).call(this));return e.ariaOrientation="horizontal",e.ariaLabelledBy="highlightColorPickerLabel",e}_colorSelectFromKeyboard(e){if(e.target===l(this,ki)){ee(this,or,ic).call(this,e);return}let t=e.target.getAttribute("data-color");t&&ee(this,or,wS).call(this,t,e)}_moveToNext(e){if(!l(this,or,Cl)){ee(this,or,ic).call(this,e);return}if(e.target===l(this,ki)){l(this,un).firstElementChild?.focus();return}e.target.nextSibling?.focus()}_moveToPrevious(e){if(e.target===l(this,un)?.firstElementChild||e.target===l(this,ki)){l(this,or,Cl)&&this._hideDropdownFromKeyboard();return}l(this,or,Cl)||ee(this,or,ic).call(this,e),e.target.previousSibling?.focus()}_moveToBeginning(e){if(!l(this,or,Cl)){ee(this,or,ic).call(this,e);return}l(this,un).firstElementChild?.focus()}_moveToEnd(e){if(!l(this,or,Cl)){ee(this,or,ic).call(this,e);return}l(this,un).lastElementChild?.focus()}hideDropdown(){l(this,un)?.classList.add("hidden"),l(this,ki).ariaExpanded="false",l(this,eu)?.abort(),L(this,eu,null)}_hideDropdownFromKeyboard(){if(!l(this,jd)){if(!l(this,or,Cl)){l(this,Fa)?.unselect();return}this.hideDropdown(),l(this,ki).focus({preventScroll:!0,focusVisible:l(this,Cy)})}}updateColor(e){if(l(this,Qc)&&(l(this,Qc).style.backgroundColor=e),!l(this,un))return;let t=l(this,$s).highlightColors.values();for(let n of l(this,un).children)n.ariaSelected=t.next().value===e.toUpperCase()}destroy(){l(this,ki)?.remove(),L(this,ki,null),L(this,Qc,null),l(this,un)?.remove(),L(this,un,null)}};ki=new WeakMap,Qc=new WeakMap,Ud=new WeakMap,un=new WeakMap,Cy=new WeakMap,jd=new WeakMap,Fa=new WeakMap,Ry=new WeakMap,eu=new WeakMap,$s=new WeakMap,Dy=new WeakMap,or=new WeakSet,bS=function(){let e=document.createElement("div"),t=l(this,$s)._signal;e.addEventListener("contextmenu",Ki,{signal:t}),e.className="dropdown",e.role="listbox",e.ariaMultiSelectable="false",e.ariaOrientation="vertical",e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown"),l(this,Fa)&&(e.id=`${l(this,Fa).id}_colorpicker_dropdown`);for(let[n,i]of l(this,$s).highlightColors){let o=document.createElement("button");o.tabIndex="0",o.role="option",o.setAttribute("data-color",i),o.title=n,o.setAttribute("data-l10n-id",l(di,Dy)[n]);let s=document.createElement("span");o.append(s),s.className="swatch",s.style.backgroundColor=i,o.ariaSelected=i===l(this,Ud),o.addEventListener("click",ee(this,or,wS).bind(this,i),{signal:t}),e.append(o)}return e.addEventListener("keydown",ee(this,or,vS).bind(this),{signal:t}),e},wS=function(e,t){t.stopPropagation(),l(this,Ry).dispatch("switchannotationeditorparams",{source:this,type:Mt.HIGHLIGHT_COLOR,value:e}),this.updateColor(e)},vS=function(e){di._keyboardManager.exec(this,e)},ic=function(e){if(l(this,or,Cl)){this.hideDropdown();return}if(L(this,Cy,e.detail===0),l(this,eu)||(L(this,eu,new AbortController),window.addEventListener("pointerdown",ee(this,or,DF).bind(this),{signal:l(this,$s).combinedSignal(l(this,eu))})),l(this,ki).ariaExpanded="true",l(this,un)){l(this,un).classList.remove("hidden");return}let t=L(this,un,ee(this,or,bS).call(this));l(this,ki).append(t)},DF=function(e){l(this,un)?.contains(e.target)||this.hideDropdown()},Cl=function(){return l(this,un)&&!l(this,un).classList.contains("hidden")},q(di,Dy,null);hm=di,uc=class uc{constructor(e){q(this,Ro,null);q(this,Iy,null);q(this,$d,null);L(this,Iy,e),L(this,$d,e._uiManager),l(uc,Oy)||L(uc,Oy,Object.freeze({freetext:"pdfjs-editor-color-picker-free-text-input",ink:"pdfjs-editor-color-picker-ink-input"}))}renderButton(){if(l(this,Ro))return l(this,Ro);let{editorType:e,colorType:t,color:n}=l(this,Iy),i=L(this,Ro,document.createElement("input"));return i.type="color",i.value=n||"#000000",i.className="basicColorPicker",i.tabIndex=0,i.setAttribute("data-l10n-id",l(uc,Oy)[e]),i.addEventListener("input",()=>{l(this,$d).updateParams(t,i.value)},{signal:l(this,$d)._signal}),i}update(e){l(this,Ro)&&(l(this,Ro).value=e)}destroy(){l(this,Ro)?.remove(),L(this,Ro,null)}hideDropdown(){}};Ro=new WeakMap,Iy=new WeakMap,$d=new WeakMap,Oy=new WeakMap,q(uc,Oy,null);Cv=uc;Rv=class{static CMYK_G([e,t,n,i]){return["G",1-Math.min(1,.3*e+.59*n+.11*t+i)]}static G_CMYK([e]){return["CMYK",0,0,0,1-e]}static G_RGB([e]){return["RGB",e,e,e]}static G_rgb([e]){return e=Ng(e),[e,e,e]}static G_HTML([e]){let t=wB(e);return`#${t}${t}${t}`}static RGB_G([e,t,n]){return["G",.3*e+.59*t+.11*n]}static RGB_rgb(e){return e.map(Ng)}static RGB_HTML(e){return`#${e.map(wB).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([e,t,n,i]){return["RGB",1-Math.min(1,e+i),1-Math.min(1,n+i),1-Math.min(1,t+i)]}static CMYK_rgb([e,t,n,i]){return[Ng(1-Math.min(1,e+i)),Ng(1-Math.min(1,n+i)),Ng(1-Math.min(1,t+i))]}static CMYK_HTML(e){let t=this.CMYK_RGB(e).slice(1);return this.RGB_HTML(t)}static RGB_CMYK([e,t,n]){let i=1-e,o=1-t,s=1-n,a=Math.min(i,o,s);return["CMYK",i,o,s,a]}},_S=class{create(e,t,n=!1){if(e<=0||t<=0)throw new Error("Invalid SVG dimensions");let i=this._createSVG("svg:svg");return i.setAttribute("version","1.1"),n||(i.setAttribute("width",`${e}px`),i.setAttribute("height",`${t}px`)),i.setAttribute("preserveAspectRatio","none"),i.setAttribute("viewBox",`0 0 ${e} ${t}`),i}createElement(e){if(typeof e!="string")throw new Error("Invalid SVG element type");return this._createSVG(e)}_createSVG(e){dr("Abstract method `_createSVG` called.")}},If=class extends _S{_createSVG(e){return document.createElementNS(fa,e)}},bV=9,Of=new WeakSet,wV=new Date().getTimezoneOffset()*60*1e3,nm=class{static create(e){switch(e.data.annotationType){case qr.LINK:return new dm(e);case qr.TEXT:return new xS(e);case qr.WIDGET:switch(e.data.fieldType){case"Tx":return new SS(e);case"Btn":return e.data.radioButton?new Dv(e):e.data.checkBox?new CS(e):new RS(e);case"Ch":return new DS(e);case"Sig":return new TS(e)}return new tl(e);case qr.POPUP:return new pm(e);case qr.FREETEXT:return new Iv(e);case qr.LINE:return new BS(e);case qr.SQUARE:return new FS(e);case qr.CIRCLE:return new US(e);case qr.POLYLINE:return new Ov(e);case qr.CARET:return new $S(e);case qr.INK:return new gm(e);case qr.POLYGON:return new jS(e);case qr.HIGHLIGHT:return new Nv(e);case qr.UNDERLINE:return new WS(e);case qr.SQUIGGLY:return new qS(e);case qr.STRIKEOUT:return new HS(e);case qr.STAMP:return new kv(e);case qr.FILEATTACHMENT:return new GS(e);default:return new Rr(e)}}},DT=class DT{constructor(e,{isRenderable:t=!1,ignoreBorder:n=!1,createQuadrilaterals:i=!1}={}){q(this,Ny);q(this,ef,null);q(this,zd,!1);q(this,bs,null);this.isRenderable=t,this.data=e.data,this.layer=e.layer,this.linkService=e.linkService,this.downloadManager=e.downloadManager,this.imageResourcesPath=e.imageResourcesPath,this.renderForms=e.renderForms,this.svgFactory=e.svgFactory,this.annotationStorage=e.annotationStorage,this.enableComment=e.enableComment,this.enableScripting=e.enableScripting,this.hasJSActions=e.hasJSActions,this._fieldObjects=e.fieldObjects,this.parent=e.parent,this.hasOwnCommentButton=!1,t&&(this.contentElement=this.container=this._createContainer(n)),i&&this._createQuadrilaterals()}static _hasPopupData({contentsObj:e,richText:t}){return!!(e?.str||t?.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return DT._hasPopupData(this.data)||this.enableComment&&!!this.commentText}get commentData(){let{data:e}=this,t=this.annotationStorage?.getEditor(e.id);return t?t.getData():e}get hasCommentButton(){return this.enableComment&&this.hasPopupElement}get commentButtonPosition(){let e=this.annotationStorage?.getEditor(this.data.id);if(e)return e.commentButtonPositionInPage;let{quadPoints:t,inkLists:n,rect:i}=this.data,o=-1/0,s=-1/0;if(t?.length>=8){for(let a=0;a<t.length;a+=8)t[a+1]>s?(s=t[a+1],o=t[a+2]):t[a+1]===s&&(o=Math.max(o,t[a+2]));return[o,s]}if(n?.length>=1){for(let a of n)for(let u=0,c=a.length;u<c;u+=2)a[u+1]>s?(s=a[u+1],o=a[u]):a[u+1]===s&&(o=Math.max(o,a[u]));if(o!==1/0)return[o,s]}return i?[i[2],i[3]]:null}_normalizePoint(e){let{page:{view:t},viewport:{rawDims:{pageWidth:n,pageHeight:i,pageX:o,pageY:s}}}=this.parent;return e[1]=t[3]-e[1]+t[1],e[0]=100*(e[0]-o)/n,e[1]=100*(e[1]-s)/i,e}get commentText(){let{data:e}=this;return this.annotationStorage.getRawValue(`${im}${e.id}`)?.popup?.contents||e.contentsObj?.str||""}set commentText(e){let{data:t}=this,n={deleted:!e,contents:e||""};this.annotationStorage.updateEditor(t.id,{popup:n})||this.annotationStorage.setValue(`${im}${t.id}`,{id:t.id,annotationType:t.annotationType,pageIndex:this.parent.page._pageIndex,popup:n,popupRef:t.popupRef,modificationDate:new Date}),e||this.removePopup()}removePopup(){(l(this,bs)?.popup||this.popup)?.remove(),L(this,bs,this.popup=null)}updateEdited(e){if(!this.container)return;e.rect&&(l(this,ef)||L(this,ef,{rect:this.data.rect.slice(0)}));let{rect:t,popup:n}=e;t&&ee(this,Ny,ES).call(this,t);let i=l(this,bs)?.popup||this.popup;!i&&n?.text&&(this._createPopup(n),i=l(this,bs).popup),i&&(i.updateEdited(e),n?.deleted&&(i.remove(),L(this,bs,null),this.popup=null))}resetEdited(){l(this,ef)&&(ee(this,Ny,ES).call(this,l(this,ef).rect),l(this,bs)?.popup.resetEdited(),L(this,ef,null))}_createContainer(e){let{data:t,parent:{page:n,viewport:i}}=this,o=document.createElement("section");o.setAttribute("data-annotation-id",t.id),!(this instanceof tl)&&!(this instanceof dm)&&(o.tabIndex=0);let{style:s}=o;if(s.zIndex=this.parent.zIndex,this.parent.zIndex+=2,t.alternativeText&&(o.title=t.alternativeText),t.noRotate&&o.classList.add("norotate"),!t.rect||this instanceof pm){let{rotation:v}=t;return!t.hasOwnCanvas&&v!==0&&this.setRotation(v,o),o}let{width:a,height:u}=this;if(!e&&t.borderStyle.width>0){s.borderWidth=`${t.borderStyle.width}px`;let v=t.borderStyle.horizontalCornerRadius,w=t.borderStyle.verticalCornerRadius;if(v>0||w>0){let _=`calc(${v}px * var(--total-scale-factor)) / calc(${w}px * var(--total-scale-factor))`;s.borderRadius=_}else if(this instanceof Dv){let _=`calc(${a}px * var(--total-scale-factor)) / calc(${u}px * var(--total-scale-factor))`;s.borderRadius=_}switch(t.borderStyle.style){case Rh.SOLID:s.borderStyle="solid";break;case Rh.DASHED:s.borderStyle="dashed";break;case Rh.BEVELED:_t("Unimplemented border style: beveled");break;case Rh.INSET:_t("Unimplemented border style: inset");break;case Rh.UNDERLINE:s.borderBottomStyle="solid";break;default:break}let y=t.borderColor||null;y?(L(this,zd,!0),s.borderColor=nt.makeHexColor(y[0]|0,y[1]|0,y[2]|0)):s.borderWidth=0}let c=nt.normalizeRect([t.rect[0],n.view[3]-t.rect[1]+n.view[1],t.rect[2],n.view[3]-t.rect[3]+n.view[1]]),{pageWidth:f,pageHeight:h,pageX:p,pageY:m}=i.rawDims;s.left=`${100*(c[0]-p)/f}%`,s.top=`${100*(c[1]-m)/h}%`;let{rotation:b}=t;return t.hasOwnCanvas||b===0?(s.width=`${100*a/f}%`,s.height=`${100*u/h}%`):this.setRotation(b,o),o}setRotation(e,t=this.container){if(!this.data.rect)return;let{pageWidth:n,pageHeight:i}=this.parent.viewport.rawDims,{width:o,height:s}=this;e%180!==0&&([o,s]=[s,o]),t.style.width=`${100*o/n}%`,t.style.height=`${100*s/i}%`,t.setAttribute("data-main-rotation",(360-e)%360)}get _commonActions(){let e=(t,n,i)=>{let o=i.detail[t],s=o[0],a=o.slice(1);i.target.style[n]=Rv[`${s}_HTML`](a),this.annotationStorage.setValue(this.data.id,{[n]:Rv[`${s}_rgb`](a)})};return wt(this,"_commonActions",{display:t=>{let{display:n}=t.detail,i=n%2===1;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:i,noPrint:n===1||n===2})},print:t=>{this.annotationStorage.setValue(this.data.id,{noPrint:!t.detail.print})},hidden:t=>{let{hidden:n}=t.detail;this.container.style.visibility=n?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:n,noView:n})},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=>{let n=t.detail.rotation;this.setRotation(n),this.annotationStorage.setValue(this.data.id,{rotation:n})}})}_dispatchEventFromSandbox(e,t){let n=this._commonActions;for(let i of Object.keys(t.detail))(e[i]||n[i])?.(t)}_setDefaultPropertiesFromJS(e){if(!this.enableScripting)return;let t=this.annotationStorage.getRawValue(this.data.id);if(!t)return;let n=this._commonActions;for(let[i,o]of Object.entries(t)){let s=n[i];if(s){let a={detail:{[i]:o},target:e};s(a),delete t[i]}}}_createQuadrilaterals(){if(!this.container)return;let{quadPoints:e}=this.data;if(!e)return;let[t,n,i,o]=this.data.rect.map(v=>Math.fround(v));if(e.length===8){let[v,w,y,_]=e.subarray(2,6);if(i===v&&o===w&&t===y&&n===_)return}let{style:s}=this.container,a;if(l(this,zd)){let{borderColor:v,borderWidth:w}=s;s.borderWidth=0,a=["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="${v}" stroke-width="${w}">`],this.container.classList.add("hasBorder")}let u=i-t,c=o-n,{svgFactory:f}=this,h=f.createElement("svg");h.classList.add("quadrilateralsContainer"),h.setAttribute("width",0),h.setAttribute("height",0),h.role="none";let p=f.createElement("defs");h.append(p);let m=f.createElement("clipPath"),b=`clippath_${this.data.id}`;m.setAttribute("id",b),m.setAttribute("clipPathUnits","objectBoundingBox"),p.append(m);for(let v=2,w=e.length;v<w;v+=8){let y=e[v],_=e[v+1],E=e[v+2],S=e[v+3],A=f.createElement("rect"),F=(E-t)/u,D=(o-_)/c,H=(y-E)/u,J=(_-S)/c;A.setAttribute("x",F),A.setAttribute("y",D),A.setAttribute("width",H),A.setAttribute("height",J),m.append(A),a?.push(`<rect vector-effect="non-scaling-stroke" x="${F}" y="${D}" width="${H}" height="${J}"/>`)}l(this,zd)&&(a.push("</g></svg>')"),s.backgroundImage=a.join("")),this.container.append(h),this.container.style.clipPath=`url(#${b})`}_createPopup(e=null){let{data:t}=this,n,i;e?(n={str:e.text},i=e.date):(n=t.contentsObj,i=t.modificationDate),L(this,bs,new pm({data:{color:t.color,titleObj:t.titleObj,modificationDate:i,contentsObj:n,richText:t.richText,parentRect:t.rect,borderStyle:0,id:`popup_${t.id}`,rotation:t.rotation,noRotate:!0},linkService:this.linkService,parent:this.parent,elements:[this]}))}get hasPopupElement(){return!!(l(this,bs)||this.popup||this.data.popupRef)}get extraPopupElement(){return l(this,bs)}render(){dr("Abstract method `AnnotationElement.render` called")}_getElementsByName(e,t=null){let n=[];if(this._fieldObjects){let i=this._fieldObjects[e];if(i)for(let{page:o,id:s,exportValues:a}of i){if(o===-1||s===t)continue;let u=typeof a=="string"?a:null,c=document.querySelector(`[data-element-id="${s}"]`);if(c&&!Of.has(c)){_t(`_getElementsByName - element not allowed: ${s}`);continue}n.push({id:s,exportValue:u,domElement:c})}return n}for(let i of document.getElementsByName(e)){let{exportValue:o}=i,s=i.getAttribute("data-element-id");s!==t&&Of.has(i)&&n.push({id:s,exportValue:o,domElement:i})}return n}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){let e=this.getElementsToTriggerPopup();if(Array.isArray(e))for(let t of e)t.classList.add("highlightArea");else e.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;let{annotationEditorType:e,data:{id:t}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:e,editId:t,mustEnterInEditMode:!0})})}get width(){return this.data.rect[2]-this.data.rect[0]}get height(){return this.data.rect[3]-this.data.rect[1]}};ef=new WeakMap,zd=new WeakMap,bs=new WeakMap,Ny=new WeakSet,ES=function(e){let{container:{style:t},data:{rect:n,rotation:i},parent:{viewport:{rawDims:{pageWidth:o,pageHeight:s,pageX:a,pageY:u}}}}=this;n?.splice(0,4,...e),t.left=`${100*(e[0]-a)/o}%`,t.top=`${100*(s-e[3]+u)/s}%`,i===0?(t.width=`${100*(e[2]-e[0])/o}%`,t.height=`${100*(e[3]-e[1])/s}%`):this.setRotation(i)};Rr=DT,AS=class extends Rr{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.editor=e.editor}render(){return this.container.className="editorAnnotation",this.container}createOrUpdatePopup(){let{editor:e}=this;e.hasComment&&this._createPopup(e.comment)}get hasCommentButton(){return this.enableComment&&this.editor.hasComment}get commentButtonPosition(){return this.editor.commentButtonPositionInPage}get commentText(){return this.editor.comment.text}set commentText(e){this.editor.comment=e,e||this.removePopup()}get commentData(){return this.editor.getData()}remove(){this.parent.removeAnnotation(this.data.id),this.container.remove(),this.container=null,this.removePopup()}},dm=class extends Rr{constructor(t,n=null){super(t,{isRenderable:!0,ignoreBorder:!!n?.ignoreBorder,createQuadrilaterals:!0});q(this,Yi);this.isTooltipOnly=t.data.isTooltipOnly}render(){let{data:t,linkService:n}=this,i=document.createElement("a");i.setAttribute("data-element-id",t.id);let o=!1;return t.url?(n.addLinkAttributes(i,t.url,t.newWindow),o=!0):t.action?(this._bindNamedAction(i,t.action,t.overlaidText),o=!0):t.attachment?(ee(this,Yi,IF).call(this,i,t.attachment,t.overlaidText,t.attachmentDest),o=!0):t.setOCGState?(ee(this,Yi,OF).call(this,i,t.setOCGState,t.overlaidText),o=!0):t.dest?(this._bindLink(i,t.dest,t.overlaidText),o=!0):(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(i,t),o=!0),t.resetForm?(this._bindResetFormAction(i,t.resetForm),o=!0):this.isTooltipOnly&&!o&&(this._bindLink(i,""),o=!0)),this.container.classList.add("linkAnnotation"),o&&(this.contentElement=i,this.container.append(i)),this.container}_bindLink(t,n,i=""){t.href=this.linkService.getDestinationHash(n),t.onclick=()=>(n&&this.linkService.goToDestination(n),!1),(n||n==="")&&ee(this,Yi,sc).call(this),i&&(t.title=i)}_bindNamedAction(t,n,i=""){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(n),!1),i&&(t.title=i),ee(this,Yi,sc).call(this)}_bindJSAction(t,n){t.href=this.linkService.getAnchorUrl("");let i=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(let o of Object.keys(n.actions)){let s=i.get(o);s&&(t[s]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:n.id,name:o}}),!1))}n.overlaidText&&(t.title=n.overlaidText),t.onclick||(t.onclick=()=>!1),ee(this,Yi,sc).call(this)}_bindResetFormAction(t,n){let i=t.onclick;if(i||(t.href=this.linkService.getAnchorUrl("")),ee(this,Yi,sc).call(this),!this._fieldObjects){_t('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),i||(t.onclick=()=>!1);return}t.onclick=()=>{i?.();let{fields:o,refs:s,include:a}=n,u=[];if(o.length!==0||s.length!==0){let h=new Set(s);for(let p of o){let m=this._fieldObjects[p]||[];for(let{id:b}of m)h.add(b)}for(let p of Object.values(this._fieldObjects))for(let m of p)h.has(m.id)===a&&u.push(m)}else for(let h of Object.values(this._fieldObjects))u.push(...h);let c=this.annotationStorage,f=[];for(let h of u){let{id:p}=h;switch(f.push(p),h.type){case"text":{let b=h.defaultValue||"";c.setValue(p,{value:b});break}case"checkbox":case"radiobutton":{let b=h.defaultValue===h.exportValues;c.setValue(p,{value:b});break}case"combobox":case"listbox":{let b=h.defaultValue||"";c.setValue(p,{value:b});break}default:continue}let m=document.querySelector(`[data-element-id="${p}"]`);if(m){if(!Of.has(m)){_t(`_bindResetFormAction - element not allowed: ${p}`);continue}}else continue;m.dispatchEvent(new Event("resetform"))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:f,name:"ResetForm"}}),!1}}};Yi=new WeakSet,sc=function(){this.container.setAttribute("data-internal-link","")},IF=function(t,n,i="",o=null){t.href=this.linkService.getAnchorUrl(""),n.description?t.title=n.description:i&&(t.title=i),t.onclick=()=>(this.downloadManager?.openOrDownloadData(n.content,n.filename,o),!1),ee(this,Yi,sc).call(this)},OF=function(t,n,i=""){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(n),!1),i&&(t.title=i),ee(this,Yi,sc).call(this)};xS=class extends Rr{constructor(e){super(e,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");let e=document.createElement("img");return e.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",e.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),e.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.append(e),this.container}},tl=class extends Rr{render(){return this.container}showElementAndHideCanvas(e){this.data.hasOwnCanvas&&(e.previousSibling?.nodeName==="CANVAS"&&(e.previousSibling.hidden=!0),e.hidden=!1)}_getKeyModifier(e){return Ur.platform.isMac?e.metaKey:e.ctrlKey}_setEventListener(e,t,n,i,o){n.includes("mouse")?e.addEventListener(n,s=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:o(s),shift:s.shiftKey,modifier:this._getKeyModifier(s)}})}):e.addEventListener(n,s=>{if(n==="blur"){if(!t.focused||!s.relatedTarget)return;t.focused=!1}else if(n==="focus"){if(t.focused)return;t.focused=!0}o&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:o(s)}})})}_setEventListeners(e,t,n,i){for(let[o,s]of n)(s==="Action"||this.data.actions?.[s])&&((s==="Focus"||s==="Blur")&&(t||(t={focused:!1})),this._setEventListener(e,t,o,s,i),s==="Focus"&&!this.data.actions?.Blur?this._setEventListener(e,t,"blur","Blur",null):s==="Blur"&&!this.data.actions?.Focus&&this._setEventListener(e,t,"focus","Focus",null))}_setBackgroundColor(e){let t=this.data.backgroundColor||null;e.style.backgroundColor=t===null?"transparent":nt.makeHexColor(t[0],t[1],t[2])}_setTextStyle(e){let t=["left","center","right"],{fontColor:n}=this.data.defaultAppearanceData,i=this.data.defaultAppearanceData.fontSize||bV,o=e.style,s,a=2,u=c=>Math.round(10*c)/10;if(this.data.multiLine){let c=Math.abs(this.data.rect[3]-this.data.rect[1]-a),f=Math.round(c/(Cw*i))||1,h=c/f;s=Math.min(i,u(h/Cw))}else{let c=Math.abs(this.data.rect[3]-this.data.rect[1]-a);s=Math.min(i,u(c/Cw))}o.fontSize=`calc(${s}px * var(--total-scale-factor))`,o.color=nt.makeHexColor(n[0],n[1],n[2]),this.data.textAlignment!==null&&(o.textAlign=t[this.data.textAlignment])}_setRequired(e,t){t?e.setAttribute("required",!0):e.removeAttribute("required"),e.setAttribute("aria-required",t)}},SS=class extends tl{constructor(e){let t=e.renderForms||e.data.hasOwnCanvas||!e.data.hasAppearance&&!!e.data.fieldValue;super(e,{isRenderable:t})}setPropertyOnSiblings(e,t,n,i){let o=this.annotationStorage;for(let s of this._getElementsByName(e.name,e.id))s.domElement&&(s.domElement[t]=n),o.setValue(s.id,{[i]:n})}render(){let e=this.annotationStorage,t=this.data.id;this.container.classList.add("textWidgetAnnotation");let n=null;if(this.renderForms){let i=e.getValue(t,{value:this.data.fieldValue}),o=i.value||"",s=e.getValue(t,{charLimit:this.data.maxLen}).charLimit;s&&o.length>s&&(o=o.slice(0,s));let a=i.formattedValue||this.data.textContent?.join(`
95
+ `)||null;a&&this.data.comb&&(a=a.replaceAll(/\s+/g,""));let u={userValue:o,formattedValue:a,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(n=document.createElement("textarea"),n.textContent=a??o,this.data.doNotScroll&&(n.style.overflowY="hidden")):(n=document.createElement("input"),n.type=this.data.password?"password":"text",n.setAttribute("value",a??o),this.data.doNotScroll&&(n.style.overflowX="hidden")),this.data.hasOwnCanvas&&(n.hidden=!0),Of.add(n),this.contentElement=n,n.setAttribute("data-element-id",t),n.disabled=this.data.readOnly,n.name=this.data.fieldName,n.tabIndex=0;let{datetimeFormat:c,datetimeType:f,timeStep:h}=this.data,p=!!f&&this.enableScripting;c&&(n.title=c),this._setRequired(n,this.data.required),s&&(n.maxLength=s),n.addEventListener("input",b=>{e.setValue(t,{value:b.target.value}),this.setPropertyOnSiblings(n,"value",b.target.value,"value"),u.formattedValue=null}),n.addEventListener("resetform",b=>{let v=this.data.defaultFieldValue??"";n.value=u.userValue=v,u.formattedValue=null});let m=b=>{let{formattedValue:v}=u;v!=null&&(b.target.value=v),b.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){n.addEventListener("focus",v=>{if(u.focused)return;let{target:w}=v;if(p&&(w.type=f,h&&(w.step=h)),u.userValue){let y=u.userValue;if(p)if(f==="time"){let _=new Date(y),E=[_.getHours(),_.getMinutes(),_.getSeconds()];w.value=E.map(S=>S.toString().padStart(2,"0")).join(":")}else w.value=new Date(y-wV).toISOString().split(f==="date"?"T":".",1)[0];else w.value=y}u.lastCommittedValue=w.value,u.commitKey=1,this.data.actions?.Focus||(u.focused=!0)}),n.addEventListener("updatefromsandbox",v=>{this.showElementAndHideCanvas(v.target);let w={value(y){u.userValue=y.detail.value??"",p||e.setValue(t,{value:u.userValue.toString()}),y.target.value=u.userValue},formattedValue(y){let{formattedValue:_}=y.detail;u.formattedValue=_,_!=null&&y.target!==document.activeElement&&(y.target.value=_);let E={formattedValue:_};p&&(E.value=_),e.setValue(t,E)},selRange(y){y.target.setSelectionRange(...y.detail.selRange)},charLimit:y=>{let{charLimit:_}=y.detail,{target:E}=y;if(_===0){E.removeAttribute("maxLength");return}E.setAttribute("maxLength",_);let S=u.userValue;!S||S.length<=_||(S=S.slice(0,_),E.value=u.userValue=S,e.setValue(t,{value:S}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:S,willCommit:!0,commitKey:1,selStart:E.selectionStart,selEnd:E.selectionEnd}}))}};this._dispatchEventFromSandbox(w,v)}),n.addEventListener("keydown",v=>{u.commitKey=1;let w=-1;if(v.key==="Escape"?w=0:v.key==="Enter"&&!this.data.multiLine?w=2:v.key==="Tab"&&(u.commitKey=3),w===-1)return;let{value:y}=v.target;u.lastCommittedValue!==y&&(u.lastCommittedValue=y,u.userValue=y,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:y,willCommit:!0,commitKey:w,selStart:v.target.selectionStart,selEnd:v.target.selectionEnd}}))});let b=m;m=null,n.addEventListener("blur",v=>{if(!u.focused||!v.relatedTarget)return;this.data.actions?.Blur||(u.focused=!1);let{target:w}=v,{value:y}=w;if(p){if(y&&f==="time"){let _=y.split(":").map(E=>parseInt(E,10));y=new Date(2e3,0,1,_[0],_[1],_[2]||0).valueOf(),w.step=""}else y.includes("T")||(y=`${y}T00:00`),y=new Date(y).valueOf();w.type="text"}u.userValue=y,u.lastCommittedValue!==y&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:y,willCommit:!0,commitKey:u.commitKey,selStart:v.target.selectionStart,selEnd:v.target.selectionEnd}}),b(v)}),this.data.actions?.Keystroke&&n.addEventListener("beforeinput",v=>{u.lastCommittedValue=null;let{data:w,target:y}=v,{value:_,selectionStart:E,selectionEnd:S}=y,A=E,F=S;switch(v.inputType){case"deleteWordBackward":{let D=_.substring(0,E).match(/\w*[^\w]*$/);D&&(A-=D[0].length);break}case"deleteWordForward":{let D=_.substring(E).match(/^[^\w]*\w*/);D&&(F+=D[0].length);break}case"deleteContentBackward":E===S&&(A-=1);break;case"deleteContentForward":E===S&&(F+=1);break}v.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:_,change:w||"",willCommit:!1,selStart:A,selEnd:F}})}),this._setEventListeners(n,u,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],v=>v.target.value)}if(m&&n.addEventListener("blur",m),this.data.comb){let v=(this.data.rect[2]-this.data.rect[0])/s;n.classList.add("comb"),n.style.letterSpacing=`calc(${v}px * var(--total-scale-factor) - 1ch)`}}else n=document.createElement("div"),n.textContent=this.data.fieldValue,n.style.verticalAlign="middle",n.style.display="table-cell",this.data.hasOwnCanvas&&(n.hidden=!0);return this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}},TS=class extends tl{constructor(e){super(e,{isRenderable:!!e.data.hasOwnCanvas})}},CS=class extends tl{constructor(e){super(e,{isRenderable:e.renderForms})}render(){let e=this.annotationStorage,t=this.data,n=t.id,i=e.getValue(n,{value:t.exportValue===t.fieldValue}).value;typeof i=="string"&&(i=i!=="Off",e.setValue(n,{value:i})),this.container.classList.add("buttonWidgetAnnotation","checkBox");let o=document.createElement("input");return Of.add(o),o.setAttribute("data-element-id",n),o.disabled=t.readOnly,this._setRequired(o,this.data.required),o.type="checkbox",o.name=t.fieldName,i&&o.setAttribute("checked",!0),o.setAttribute("exportValue",t.exportValue),o.tabIndex=0,o.addEventListener("change",s=>{let{name:a,checked:u}=s.target;for(let c of this._getElementsByName(a,n)){let f=u&&c.exportValue===t.exportValue;c.domElement&&(c.domElement.checked=f),e.setValue(c.id,{value:f})}e.setValue(n,{value:u})}),o.addEventListener("resetform",s=>{let a=t.defaultFieldValue||"Off";s.target.checked=a===t.exportValue}),this.enableScripting&&this.hasJSActions&&(o.addEventListener("updatefromsandbox",s=>{let a={value(u){u.target.checked=u.detail.value!=="Off",e.setValue(n,{value:u.target.checked})}};this._dispatchEventFromSandbox(a,s)}),this._setEventListeners(o,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],s=>s.target.checked)),this._setBackgroundColor(o),this._setDefaultPropertiesFromJS(o),this.container.append(o),this.container}},Dv=class extends tl{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");let e=this.annotationStorage,t=this.data,n=t.id,i=e.getValue(n,{value:t.fieldValue===t.buttonValue}).value;if(typeof i=="string"&&(i=i!==t.buttonValue,e.setValue(n,{value:i})),i)for(let s of this._getElementsByName(t.fieldName,n))e.setValue(s.id,{value:!1});let o=document.createElement("input");if(Of.add(o),o.setAttribute("data-element-id",n),o.disabled=t.readOnly,this._setRequired(o,this.data.required),o.type="radio",o.name=t.fieldName,i&&o.setAttribute("checked",!0),o.tabIndex=0,o.addEventListener("change",s=>{let{name:a,checked:u}=s.target;for(let c of this._getElementsByName(a,n))e.setValue(c.id,{value:!1});e.setValue(n,{value:u})}),o.addEventListener("resetform",s=>{let a=t.defaultFieldValue;s.target.checked=a!=null&&a===t.buttonValue}),this.enableScripting&&this.hasJSActions){let s=t.buttonValue;o.addEventListener("updatefromsandbox",a=>{let u={value:c=>{let f=s===c.detail.value;for(let h of this._getElementsByName(c.target.name)){let p=f&&h.id===n;h.domElement&&(h.domElement.checked=p),e.setValue(h.id,{value:p})}}};this._dispatchEventFromSandbox(u,a)}),this._setEventListeners(o,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],a=>a.target.checked)}return this._setBackgroundColor(o),this._setDefaultPropertiesFromJS(o),this.container.append(o),this.container}},RS=class extends dm{constructor(e){super(e,{ignoreBorder:e.data.hasAppearance})}render(){let e=super.render();e.classList.add("buttonWidgetAnnotation","pushButton");let t=e.lastChild;return this.enableScripting&&this.hasJSActions&&t&&(this._setDefaultPropertiesFromJS(t),t.addEventListener("updatefromsandbox",n=>{this._dispatchEventFromSandbox({},n)})),e}},DS=class extends tl{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");let e=this.annotationStorage,t=this.data.id,n=e.getValue(t,{value:this.data.fieldValue}),i=document.createElement("select");Of.add(i),i.setAttribute("data-element-id",t),i.disabled=this.data.readOnly,this._setRequired(i,this.data.required),i.name=this.data.fieldName,i.tabIndex=0;let o=this.data.combo&&this.data.options.length>0;this.data.combo||(i.size=this.data.options.length,this.data.multiSelect&&(i.multiple=!0)),i.addEventListener("resetform",f=>{let h=this.data.defaultFieldValue;for(let p of i.options)p.selected=p.value===h});for(let f of this.data.options){let h=document.createElement("option");h.textContent=f.displayValue,h.value=f.exportValue,n.value.includes(f.exportValue)&&(h.setAttribute("selected",!0),o=!1),i.append(h)}let s=null;if(o){let f=document.createElement("option");f.value=" ",f.setAttribute("hidden",!0),f.setAttribute("selected",!0),i.prepend(f),s=()=>{f.remove(),i.removeEventListener("input",s),s=null},i.addEventListener("input",s)}let a=f=>{let h=f?"value":"textContent",{options:p,multiple:m}=i;return m?Array.prototype.filter.call(p,b=>b.selected).map(b=>b[h]):p.selectedIndex===-1?null:p[p.selectedIndex][h]},u=a(!1),c=f=>{let h=f.target.options;return Array.prototype.map.call(h,p=>({displayValue:p.textContent,exportValue:p.value}))};return this.enableScripting&&this.hasJSActions?(i.addEventListener("updatefromsandbox",f=>{let h={value(p){s?.();let m=p.detail.value,b=new Set(Array.isArray(m)?m:[m]);for(let v of i.options)v.selected=b.has(v.value);e.setValue(t,{value:a(!0)}),u=a(!1)},multipleSelection(p){i.multiple=!0},remove(p){let m=i.options,b=p.detail.remove;m[b].selected=!1,i.remove(b),m.length>0&&Array.prototype.findIndex.call(m,w=>w.selected)===-1&&(m[0].selected=!0),e.setValue(t,{value:a(!0),items:c(p)}),u=a(!1)},clear(p){for(;i.length!==0;)i.remove(0);e.setValue(t,{value:null,items:[]}),u=a(!1)},insert(p){let{index:m,displayValue:b,exportValue:v}=p.detail.insert,w=i.children[m],y=document.createElement("option");y.textContent=b,y.value=v,w?w.before(y):i.append(y),e.setValue(t,{value:a(!0),items:c(p)}),u=a(!1)},items(p){let{items:m}=p.detail;for(;i.length!==0;)i.remove(0);for(let b of m){let{displayValue:v,exportValue:w}=b,y=document.createElement("option");y.textContent=v,y.value=w,i.append(y)}i.options.length>0&&(i.options[0].selected=!0),e.setValue(t,{value:a(!0),items:c(p)}),u=a(!1)},indices(p){let m=new Set(p.detail.indices);for(let b of p.target.options)b.selected=m.has(b.index);e.setValue(t,{value:a(!0)}),u=a(!1)},editable(p){p.target.disabled=!p.detail.editable}};this._dispatchEventFromSandbox(h,f)}),i.addEventListener("input",f=>{let h=a(!0),p=a(!1);e.setValue(t,{value:h}),f.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:u,change:p,changeEx:h,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(i,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],f=>f.target.value)):i.addEventListener("input",function(f){e.setValue(t,{value:a(!0)})}),this.data.combo&&this._setTextStyle(i),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}},pm=class extends Rr{constructor(t){let{data:n,elements:i,parent:o}=t,s=!!o._commentManager;super(t,{isRenderable:!s&&Rr._hasPopupData(n)});q(this,ky);if(this.elements=i,s&&Rr._hasPopupData(n)){let a=this.popup=ee(this,ky,IS).call(this);for(let u of i)u.popup=a}else this.popup=null}render(){let{container:t}=this;t.classList.add("popupAnnotation"),t.role="comment";let n=this.popup=ee(this,ky,IS).call(this),i=[];for(let o of this.elements)o.popup=n,o.container.ariaHasPopup="dialog",i.push(o.data.id),o.addHighlightArea();return this.container.setAttribute("aria-controls",i.map(o=>`${Mh}${o}`).join(",")),this.container}};ky=new WeakSet,IS=function(){return new OS({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate||this.data.creationDate,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,commentManager:this.parent._commentManager})};OS=class{constructor({container:e,color:t,elements:n,titleObj:i,modificationDate:o,contentsObj:s,richText:a,parent:u,rect:c,parentRect:f,open:h,commentManager:p=null}){q(this,Ct);q(this,Li,null);q(this,tu,ee(this,Ct,LF).bind(this));q(this,t_,ee(this,Ct,MS).bind(this));q(this,r_,ee(this,Ct,qw).bind(this));q(this,Wd,ee(this,Ct,Ww).bind(this));q(this,qd,null);q(this,Mr,null);q(this,Do,null);q(this,ru,null);q(this,tf,null);q(this,Hd,null);q(this,Gd,null);q(this,Io,!1);q(this,Pi,null);q(this,Ua,null);q(this,ja,null);q(this,Br,null);q(this,$a,null);q(this,nu,null);q(this,Ly,null);q(this,za,null);q(this,Vd,null);q(this,rf,null);q(this,iu,!1);q(this,mn,null);q(this,su,null);L(this,Mr,e),L(this,Vd,i),L(this,Do,s),L(this,za,a),L(this,Hd,u),L(this,qd,t),L(this,Ly,c),L(this,Gd,f),L(this,tf,n),L(this,Li,p),L(this,mn,n[0]),L(this,ru,Cf.toDateObject(o)),this.trigger=n.flatMap(m=>m.getElementsToTriggerPopup()),p||(ee(this,Ct,$w).call(this),l(this,Mr).hidden=!0,h&&ee(this,Ct,Ww).call(this))}renderCommentButton(){if(l(this,Br)){l(this,Br).parentNode||l(this,mn).container.after(l(this,Br));return}if(l(this,$a)||ee(this,Ct,NS).call(this),!l(this,$a))return;let{signal:e}=L(this,Ua,new AbortController),t=l(this,mn).hasOwnCommentButton,n=()=>{l(this,Li).toggleCommentPopup(this,!0,void 0,!t)},i=()=>{l(this,Li).toggleCommentPopup(this,!1,!0,!t)},o=()=>{l(this,Li).toggleCommentPopup(this,!1,!1)};if(t){L(this,Br,l(this,mn).container);for(let s of this.trigger)s.ariaHasPopup="dialog",s.ariaControls="commentPopup",s.addEventListener("keydown",l(this,tu),{signal:e}),s.addEventListener("click",n,{signal:e}),s.addEventListener("pointerenter",i,{signal:e}),s.addEventListener("pointerleave",o,{signal:e}),s.classList.add("popupTriggerArea")}else{let s=L(this,Br,document.createElement("button"));s.className="annotationCommentButton";let a=l(this,mn).container;s.style.zIndex=a.style.zIndex+1,s.tabIndex=0,s.ariaHasPopup="dialog",s.ariaControls="commentPopup",s.setAttribute("data-l10n-id","pdfjs-show-comment-button"),ee(this,Ct,LS).call(this),ee(this,Ct,kS).call(this),s.addEventListener("keydown",l(this,tu),{signal:e}),s.addEventListener("click",n,{signal:e}),s.addEventListener("pointerenter",i,{signal:e}),s.addEventListener("pointerleave",o,{signal:e}),a.after(s)}}get commentButtonColor(){let{color:e,opacity:t}=l(this,mn).commentData;return e?l(this,Hd)._commentManager.makeCommentColor(e,t):null}focusCommentButton(){setTimeout(()=>{l(this,Br)?.focus()},0)}getData(){let{richText:e,color:t,opacity:n,creationDate:i,modificationDate:o}=l(this,mn).commentData;return{contentsObj:{str:this.comment},richText:e,color:t,opacity:n,creationDate:i,modificationDate:o}}get elementBeforePopup(){return l(this,Br)}get comment(){return l(this,su)||L(this,su,l(this,mn).commentText),l(this,su)}set comment(e){e!==this.comment&&(l(this,mn).commentText=L(this,su,e))}focus(){l(this,mn).container?.focus()}get parentBoundingClientRect(){return l(this,mn).layer.getBoundingClientRect()}setCommentButtonStates({selected:e,hasPopup:t}){l(this,Br)&&(l(this,Br).classList.toggle("selected",e),l(this,Br).ariaExpanded=t)}setSelectedCommentButton(e){l(this,Br).classList.toggle("selected",e)}get commentPopupPosition(){if(l(this,nu))return l(this,nu);let{x:e,y:t,height:n}=l(this,Br).getBoundingClientRect(),{x:i,y:o,width:s,height:a}=l(this,mn).layer.getBoundingClientRect();return[(e-i)/s,(t+n-o)/a]}set commentPopupPosition(e){L(this,nu,e)}hasDefaultPopupPosition(){return l(this,nu)===null}get commentButtonPosition(){return l(this,$a)}get commentButtonWidth(){return l(this,Br).getBoundingClientRect().width/this.parentBoundingClientRect.width}editComment(e){let[t,n]=l(this,nu)||this.commentButtonPosition.map(c=>c/100),i=this.parentBoundingClientRect,{x:o,y:s,width:a,height:u}=i;l(this,Li).showDialog(null,this,o+t*a,s+n*u,{...e,parentDimensions:i})}render(){if(l(this,Pi))return;let e=L(this,Pi,document.createElement("div"));if(e.className="popup",l(this,qd)){let n=e.style.outlineColor=nt.makeHexColor(...l(this,qd));e.style.backgroundColor=`color-mix(in srgb, ${n} 30%, white)`}let t=document.createElement("span");if(t.className="header",l(this,Vd)?.str){let n=document.createElement("span");n.className="title",t.append(n),{dir:n.dir,str:n.textContent}=l(this,Vd)}if(e.append(t),l(this,ru)){let n=document.createElement("time");n.className="popupDate",n.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),n.setAttribute("data-l10n-args",JSON.stringify({dateObj:l(this,ru).valueOf()})),n.dateTime=l(this,ru).toISOString(),t.append(n)}AT({html:l(this,Ct,zw)||l(this,Do).str,dir:l(this,Do)?.dir,className:"popupContent"},e),l(this,Mr).append(e)}updateEdited({rect:e,popup:t,deleted:n}){if(l(this,Li)){n?(this.remove(),L(this,su,null)):t&&(t.deleted?this.remove():(ee(this,Ct,LS).call(this),L(this,su,t.text))),e&&(L(this,$a,null),ee(this,Ct,NS).call(this),ee(this,Ct,kS).call(this));return}if(n||t?.deleted){this.remove();return}ee(this,Ct,$w).call(this),l(this,rf)||L(this,rf,{contentsObj:l(this,Do),richText:l(this,za)}),e&&L(this,ja,null),t&&t.text&&(L(this,za,ee(this,Ct,kF).call(this,t.text)),L(this,ru,Cf.toDateObject(t.date)),L(this,Do,null)),l(this,Pi)?.remove(),L(this,Pi,null)}resetEdited(){l(this,rf)&&({contentsObj:tn(this,Do)._,richText:tn(this,za)._}=l(this,rf),L(this,rf,null),l(this,Pi)?.remove(),L(this,Pi,null),L(this,ja,null))}remove(){if(l(this,Ua)?.abort(),L(this,Ua,null),l(this,Pi)?.remove(),L(this,Pi,null),L(this,iu,!1),L(this,Io,!1),l(this,Br)?.remove(),L(this,Br,null),this.trigger)for(let e of this.trigger)e.classList.remove("popupTriggerArea")}forceHide(){L(this,iu,this.isVisible),l(this,iu)&&(l(this,Mr).hidden=!0)}maybeShow(){l(this,Li)||(ee(this,Ct,$w).call(this),l(this,iu)&&(l(this,Pi)||ee(this,Ct,qw).call(this),L(this,iu,!1),l(this,Mr).hidden=!1))}get isVisible(){return l(this,Li)?!1:l(this,Mr).hidden===!1}};Li=new WeakMap,tu=new WeakMap,t_=new WeakMap,r_=new WeakMap,Wd=new WeakMap,qd=new WeakMap,Mr=new WeakMap,Do=new WeakMap,ru=new WeakMap,tf=new WeakMap,Hd=new WeakMap,Gd=new WeakMap,Io=new WeakMap,Pi=new WeakMap,Ua=new WeakMap,ja=new WeakMap,Br=new WeakMap,$a=new WeakMap,nu=new WeakMap,Ly=new WeakMap,za=new WeakMap,Vd=new WeakMap,rf=new WeakMap,iu=new WeakMap,mn=new WeakMap,su=new WeakMap,Ct=new WeakSet,$w=function(){if(l(this,Ua))return;L(this,Ua,new AbortController);let{signal:e}=l(this,Ua);for(let t of this.trigger)t.addEventListener("click",l(this,Wd),{signal:e}),t.addEventListener("pointerenter",l(this,r_),{signal:e}),t.addEventListener("pointerleave",l(this,t_),{signal:e}),t.classList.add("popupTriggerArea");for(let t of l(this,tf))t.container?.addEventListener("keydown",l(this,tu),{signal:e})},NS=function(){let e=l(this,tf).find(t=>t.hasCommentButton);e&&L(this,$a,e._normalizePoint(e.commentButtonPosition))},kS=function(){if(l(this,mn).extraPopupElement&&!l(this,mn).editor)return;l(this,Br)||this.renderCommentButton();let[e,t]=l(this,$a),{style:n}=l(this,Br);n.left=`calc(${e}%)`,n.top=`calc(${t}% - var(--comment-button-dim))`},LS=function(){l(this,mn).extraPopupElement||(l(this,Br)||this.renderCommentButton(),l(this,Br).style.backgroundColor=this.commentButtonColor||"")},zw=function(){let e=l(this,za),t=l(this,Do);return e?.str&&(!t?.str||t.str===e.str)&&l(this,za).html||null},PS=function(){return l(this,Ct,zw)?.attributes?.style?.fontSize||0},NF=function(){return l(this,Ct,zw)?.attributes?.style?.color||null},kF=function(e){let t=[],n={str:e,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:t}]}},i={style:{color:l(this,Ct,NF),fontSize:l(this,Ct,PS)?`calc(${l(this,Ct,PS)}px * var(--total-scale-factor))`:""}};for(let o of e.split(`
96
+ `))t.push({name:"span",value:o,attributes:i});return n},LF=function(e){e.altKey||e.shiftKey||e.ctrlKey||e.metaKey||(e.key==="Enter"||e.key==="Escape"&&l(this,Io))&&ee(this,Ct,Ww).call(this)},PF=function(){if(l(this,ja)!==null)return;let{page:{view:e},viewport:{rawDims:{pageWidth:t,pageHeight:n,pageX:i,pageY:o}}}=l(this,Hd),s=!!l(this,Gd),a=s?l(this,Gd):l(this,Ly);for(let b of l(this,tf))if(!a||nt.intersect(b.data.rect,a)!==null){a=b.data.rect,s=!0;break}let u=nt.normalizeRect([a[0],e[3]-a[1]+e[1],a[2],e[3]-a[3]+e[1]]),f=s?a[2]-a[0]+5:0,h=u[0]+f,p=u[1];L(this,ja,[100*(h-i)/t,100*(p-o)/n]);let{style:m}=l(this,Mr);m.left=`${l(this,ja)[0]}%`,m.top=`${l(this,ja)[1]}%`},Ww=function(){if(l(this,Li)){l(this,Li).toggleCommentPopup(this,!1);return}L(this,Io,!l(this,Io)),l(this,Io)?(ee(this,Ct,qw).call(this),l(this,Mr).addEventListener("click",l(this,Wd)),l(this,Mr).addEventListener("keydown",l(this,tu))):(ee(this,Ct,MS).call(this),l(this,Mr).removeEventListener("click",l(this,Wd)),l(this,Mr).removeEventListener("keydown",l(this,tu)))},qw=function(){l(this,Pi)||this.render(),this.isVisible?l(this,Io)&&l(this,Mr).classList.add("focused"):(ee(this,Ct,PF).call(this),l(this,Mr).hidden=!1,l(this,Mr).style.zIndex=parseInt(l(this,Mr).style.zIndex)+1e3)},MS=function(){l(this,Mr).classList.remove("focused"),!(l(this,Io)||!this.isVisible)&&(l(this,Mr).hidden=!0,l(this,Mr).style.zIndex=parseInt(l(this,Mr).style.zIndex)-1e3)};Iv=class extends Rr{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.textContent=e.data.textContent,this.textPosition=e.data.textPosition,this.annotationEditorType=vt.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){let e=this.contentElement=document.createElement("div");e.classList.add("annotationTextContent"),e.setAttribute("role","comment");for(let t of this.textContent){let n=document.createElement("span");n.textContent=t,e.append(n)}this.container.append(e)}return!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this._editOnDoubleClick(),this.container}},BS=class extends Rr{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0});q(this,Py,null)}render(){this.container.classList.add("lineAnnotation");let{data:t,width:n,height:i}=this,o=this.svgFactory.create(n,i,!0),s=L(this,Py,this.svgFactory.createElement("svg:line"));return s.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]),s.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]),s.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]),s.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]),s.setAttribute("stroke-width",t.borderStyle.width||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),o.append(s),this.container.append(o),!t.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return l(this,Py)}addHighlightArea(){this.container.classList.add("highlightArea")}};Py=new WeakMap;FS=class extends Rr{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0});q(this,My,null)}render(){this.container.classList.add("squareAnnotation");let{data:t,width:n,height:i}=this,o=this.svgFactory.create(n,i,!0),s=t.borderStyle.width,a=L(this,My,this.svgFactory.createElement("svg:rect"));return a.setAttribute("x",s/2),a.setAttribute("y",s/2),a.setAttribute("width",n-s),a.setAttribute("height",i-s),a.setAttribute("stroke-width",s||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),o.append(a),this.container.append(o),!t.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return l(this,My)}addHighlightArea(){this.container.classList.add("highlightArea")}};My=new WeakMap;US=class extends Rr{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0});q(this,By,null)}render(){this.container.classList.add("circleAnnotation");let{data:t,width:n,height:i}=this,o=this.svgFactory.create(n,i,!0),s=t.borderStyle.width,a=L(this,By,this.svgFactory.createElement("svg:ellipse"));return a.setAttribute("cx",n/2),a.setAttribute("cy",i/2),a.setAttribute("rx",n/2-s/2),a.setAttribute("ry",i/2-s/2),a.setAttribute("stroke-width",s||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),o.append(a),this.container.append(o),!t.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return l(this,By)}addHighlightArea(){this.container.classList.add("highlightArea")}};By=new WeakMap;Ov=class extends Rr{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0});q(this,Fy,null);this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);let{data:{rect:t,vertices:n,borderStyle:i,popupRef:o},width:s,height:a}=this;if(!n)return this.container;let u=this.svgFactory.create(s,a,!0),c=[];for(let h=0,p=n.length;h<p;h+=2){let m=n[h]-t[0],b=t[3]-n[h+1];c.push(`${m},${b}`)}c=c.join(" ");let f=L(this,Fy,this.svgFactory.createElement(this.svgElementName));return f.setAttribute("points",c),f.setAttribute("stroke-width",i.width||1),f.setAttribute("stroke","transparent"),f.setAttribute("fill","transparent"),u.append(f),this.container.append(u),!o&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return l(this,Fy)}addHighlightArea(){this.container.classList.add("highlightArea")}};Fy=new WeakMap;jS=class extends Ov{constructor(e){super(e),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}},$S=class extends Rr{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}},gm=class extends Rr{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0});q(this,jy);q(this,Uy,null);q(this,nf,[]);this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=this.data.it==="InkHighlight"?vt.HIGHLIGHT:vt.INK}render(){this.container.classList.add(this.containerClassName);let{data:{rect:t,rotation:n,inkLists:i,borderStyle:o,popupRef:s}}=this,{transform:a,width:u,height:c}=ee(this,jy,zS).call(this,n,t),f=this.svgFactory.create(u,c,!0),h=L(this,Uy,this.svgFactory.createElement("svg:g"));f.append(h),h.setAttribute("stroke-width",o.width||1),h.setAttribute("stroke-linecap","round"),h.setAttribute("stroke-linejoin","round"),h.setAttribute("stroke-miterlimit",10),h.setAttribute("stroke","transparent"),h.setAttribute("fill","transparent"),h.setAttribute("transform",a);for(let p=0,m=i.length;p<m;p++){let b=this.svgFactory.createElement(this.svgElementName);l(this,nf).push(b),b.setAttribute("points",i[p].join(",")),h.append(b)}return!s&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.append(f),this._editOnDoubleClick(),this.container}updateEdited(t){super.updateEdited(t);let{thickness:n,points:i,rect:o}=t,s=l(this,Uy);if(n>=0&&s.setAttribute("stroke-width",n||1),i)for(let a=0,u=l(this,nf).length;a<u;a++)l(this,nf)[a].setAttribute("points",i[a].join(","));if(o){let{transform:a,width:u,height:c}=ee(this,jy,zS).call(this,this.data.rotation,o);s.parentElement.setAttribute("viewBox",`0 0 ${u} ${c}`),s.setAttribute("transform",a)}}getElementsToTriggerPopup(){return l(this,nf)}addHighlightArea(){this.container.classList.add("highlightArea")}};Uy=new WeakMap,nf=new WeakMap,jy=new WeakSet,zS=function(t,n){switch(t){case 90:return{transform:`rotate(90) translate(${-n[0]},${n[1]}) scale(1,-1)`,width:n[3]-n[1],height:n[2]-n[0]};case 180:return{transform:`rotate(180) translate(${-n[2]},${n[1]}) scale(1,-1)`,width:n[2]-n[0],height:n[3]-n[1]};case 270:return{transform:`rotate(270) translate(${-n[2]},${n[3]}) scale(1,-1)`,width:n[3]-n[1],height:n[2]-n[0]};default:return{transform:`translate(${-n[0]},${n[3]}) scale(1,-1)`,width:n[2]-n[0],height:n[3]-n[1]}}};Nv=class extends Rr{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=vt.HIGHLIGHT}render(){let{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add("highlightAnnotation"),this._editOnDoubleClick(),e){let n=document.createElement("mark");n.classList.add("overlaidText"),n.textContent=e,this.container.append(n)}return this.container}},WS=class extends Rr{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){let{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add("underlineAnnotation"),e){let n=document.createElement("u");n.classList.add("overlaidText"),n.textContent=e,this.container.append(n)}return this.container}},qS=class extends Rr{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){let{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add("squigglyAnnotation"),e){let n=document.createElement("u");n.classList.add("overlaidText"),n.textContent=e,this.container.append(n)}return this.container}},HS=class extends Rr{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){let{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add("strikeoutAnnotation"),e){let n=document.createElement("s");n.classList.add("overlaidText"),n.textContent=e,this.container.append(n)}return this.container}},kv=class extends Rr{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=vt.STAMP}render(){return this.container.classList.add("stampAnnotation"),this.container.setAttribute("role","img"),!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this._editOnDoubleClick(),this.container}},GS=class extends Rr{constructor(t){super(t,{isRenderable:!0});q(this,zy);q(this,$y,null);let{file:n}=this.data;this.filename=n.filename,this.content=n.content,this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,...n})}render(){this.container.classList.add("fileAttachmentAnnotation");let{container:t,data:n}=this,i;n.hasAppearance||n.fillAlpha===0?i=document.createElement("div"):(i=document.createElement("img"),i.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(n.name)?"paperclip":"pushpin"}.svg`,n.fillAlpha&&n.fillAlpha<1&&(i.style=`filter: opacity(${Math.round(n.fillAlpha*100)}%);`)),i.addEventListener("dblclick",ee(this,zy,VS).bind(this)),L(this,$y,i);let{isMac:o}=Ur.platform;return t.addEventListener("keydown",s=>{s.key==="Enter"&&(o?s.metaKey:s.ctrlKey)&&ee(this,zy,VS).call(this)}),!n.popupRef&&this.hasPopupData?(this.hasOwnCommentButton=!0,this._createPopup()):i.classList.add("popupTriggerArea"),t.append(i),t}getElementsToTriggerPopup(){return l(this,$y)}addHighlightArea(){this.container.classList.add("highlightArea")}};$y=new WeakMap,zy=new WeakSet,VS=function(){this.downloadManager?.openOrDownloadData(this.content,this.filename)};IT=class IT{constructor({div:e,accessibilityManager:t,annotationCanvasMap:n,annotationEditorUIManager:i,page:o,viewport:s,structTreeLayer:a,commentManager:u,linkService:c,annotationStorage:f}){q(this,Ja);q(this,sf,null);q(this,of,null);q(this,Yd,null);q(this,ou,new Map);q(this,Wy,null);q(this,af,null);q(this,Mi,[]);q(this,qy,!1);this.div=e,L(this,sf,t),L(this,of,n),L(this,Wy,a||null),L(this,af,c||null),L(this,Yd,f||new um),this.page=o,this.viewport=s,this.zIndex=0,this._annotationEditorUIManager=i,this._commentManager=u||null}hasEditableAnnotations(){return l(this,ou).size>0}async render(e){let{annotations:t}=e,n=this.div;bu(n,this.viewport);let i=new Map,o=[],s={data:null,layer:n,linkService:l(this,af),downloadManager:e.downloadManager,imageResourcesPath:e.imageResourcesPath||"",renderForms:e.renderForms!==!1,svgFactory:new If,annotationStorage:l(this,Yd),enableComment:e.enableComment===!0,enableScripting:e.enableScripting===!0,hasJSActions:e.hasJSActions,fieldObjects:e.fieldObjects,parent:this,elements:null};for(let a of t){if(a.noHTML)continue;let u=a.annotationType===qr.POPUP;if(u){let h=i.get(a.id);if(!h)continue;if(!this._commentManager){o.push(a);continue}s.elements=h}else if(a.rect[2]===a.rect[0]||a.rect[3]===a.rect[1])continue;s.data=a;let c=nm.create(s);if(!c.isRenderable)continue;if(!u&&(l(this,Mi).push(c),a.popupRef)){let h=i.get(a.popupRef);h?h.push(c):i.set(a.popupRef,[c])}let f=c.render();a.hidden&&(f.style.visibility="hidden"),c._isEditable&&(l(this,ou).set(c.data.id,c),this._annotationEditorUIManager?.renderAnnotationElement(c))}await ee(this,Ja,Hw).call(this);for(let a of o){let u=s.elements=i.get(a.id);s.data=a;let c=nm.create(s);if(!c.isRenderable)continue;let f=c.render();c.contentElement.id=`${Mh}${a.id}`,a.hidden&&(f.style.visibility="hidden"),u.at(-1).container.after(f)}ee(this,Ja,YS).call(this)}async addLinkAnnotations(e){let t={data:null,layer:this.div,linkService:l(this,af),svgFactory:new If,parent:this};for(let n of e){n.borderStyle||(n.borderStyle=IT._defaultBorderStyle),t.data=n;let i=nm.create(t);i.isRenderable&&(i.render(),i.contentElement.id=`${Mh}${n.id}`,l(this,Mi).push(i))}await ee(this,Ja,Hw).call(this)}update({viewport:e}){let t=this.div;this.viewport=e,bu(t,{rotation:e.rotation}),ee(this,Ja,YS).call(this),t.hidden=!1}getEditableAnnotations(){return Array.from(l(this,ou).values())}getEditableAnnotation(e){return l(this,ou).get(e)}addFakeAnnotation(e){let{div:t}=this,{id:n,rotation:i}=e,o=new AS({data:{id:n,rect:e.getPDFRect(),rotation:i},editor:e,layer:t,parent:this,enableComment:!!this._commentManager,linkService:l(this,af),annotationStorage:l(this,Yd)});return o.render(),o.contentElement.id=`${Mh}${n}`,o.createOrUpdatePopup(),l(this,Mi).push(o),o}removeAnnotation(e){let t=l(this,Mi).findIndex(i=>i.data.id===e);if(t<0)return;let[n]=l(this,Mi).splice(t,1);l(this,sf)?.removePointerInTextLayer(n.contentElement)}updateFakeAnnotations(e){if(e.length!==0){for(let t of e)t.updateFakeAnnotationElement(this);ee(this,Ja,Hw).call(this)}}togglePointerEvents(e=!1){this.div.classList.toggle("disabled",!e)}static get _defaultBorderStyle(){return wt(this,"_defaultBorderStyle",Object.freeze({width:1,rawWidth:1,style:Rh.SOLID,dashArray:[3],horizontalCornerRadius:0,verticalCornerRadius:0}))}};sf=new WeakMap,of=new WeakMap,Yd=new WeakMap,ou=new WeakMap,Wy=new WeakMap,af=new WeakMap,Mi=new WeakMap,qy=new WeakMap,Ja=new WeakSet,Hw=async function(){if(l(this,Mi).length===0)return;this.div.replaceChildren();let e=[];if(!l(this,qy)){L(this,qy,!0);for(let{contentElement:n,data:{id:i}}of l(this,Mi)){let o=n.id=`${Mh}${i}`;e.push(l(this,Wy)?.getAriaAttributes(o).then(s=>{if(s)for(let[a,u]of s)n.setAttribute(a,u)}))}}l(this,Mi).sort(({data:{rect:[n,i,o,s]}},{data:{rect:[a,u,c,f]}})=>{if(n===o&&i===s)return 1;if(a===c&&u===f)return-1;let h=s,p=i,m=(i+s)/2,b=f,v=u,w=(u+f)/2;if(m>=b&&w<=p)return-1;if(w>=h&&m<=v)return 1;let y=(n+o)/2,_=(a+c)/2;return y-_});let t=document.createDocumentFragment();for(let n of l(this,Mi))t.append(n.container),this._commentManager?(n.extraPopupElement?.popup||n.popup)?.renderCommentButton():n.extraPopupElement&&t.append(n.extraPopupElement.render());if(this.div.append(t),await Promise.all(e),l(this,sf))for(let n of l(this,Mi))l(this,sf).addPointerInTextLayer(n.contentElement,!1)},YS=function(){if(!l(this,of))return;let e=this.div;for(let[t,n]of l(this,of)){let i=e.querySelector(`[data-annotation-id="${t}"]`);if(!i)continue;n.className="annotationContent";let{firstChild:o}=i;o?o.nodeName==="CANVAS"?o.replaceWith(n):o.classList.contains("annotationContent")?o.after(n):o.before(n):i.append(n);let s=l(this,ou).get(t);s&&(s._hasNoCanvas?(this._annotationEditorUIManager?.setMissingCanvas(t,i.id,n),s._hasNoCanvas=!1):s.canvas=n)}l(this,of).clear()};Lv=IT,xw=/\r\n?|\n/g,wr=class wr extends mr{constructor(t){super({...t,name:"freeTextEditor"});q(this,Kr);q(this,Bi,"");q(this,Hy,`${this.id}-editor`);q(this,lf,null);q(this,Fi);Ke(this,"_colorPicker",null);this.color=t.color||wr._defaultColor||mr._defaultLineColor,L(this,Fi,t.fontSize||wr._defaultFontSize),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-freetext-added-alert"),this.canAddComment=!1}static get _keyboardManager(){let t=wr.prototype,n=s=>s.isEmpty(),i=wu.TRANSLATE_SMALL,o=wu.TRANSLATE_BIG;return wt(this,"_keyboardManager",new Df([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],t.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],t.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],t._translateEmpty,{args:[-i,0],checker:n}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t._translateEmpty,{args:[-o,0],checker:n}],[["ArrowRight","mac+ArrowRight"],t._translateEmpty,{args:[i,0],checker:n}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t._translateEmpty,{args:[o,0],checker:n}],[["ArrowUp","mac+ArrowUp"],t._translateEmpty,{args:[0,-i],checker:n}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t._translateEmpty,{args:[0,-o],checker:n}],[["ArrowDown","mac+ArrowDown"],t._translateEmpty,{args:[0,i],checker:n}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t._translateEmpty,{args:[0,o],checker:n}]]))}static initialize(t,n){mr.initialize(t,n);let i=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(i.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,n){switch(t){case Mt.FREETEXT_SIZE:wr._defaultFontSize=n;break;case Mt.FREETEXT_COLOR:wr._defaultColor=n;break}}updateParams(t,n){switch(t){case Mt.FREETEXT_SIZE:ee(this,Kr,MF).call(this,n);break;case Mt.FREETEXT_COLOR:ee(this,Kr,BF).call(this,n);break}}static get defaultPropertiesToUpdate(){return[[Mt.FREETEXT_SIZE,wr._defaultFontSize],[Mt.FREETEXT_COLOR,wr._defaultColor||mr._defaultLineColor]]}get propertiesToUpdate(){return[[Mt.FREETEXT_SIZE,l(this,Fi)],[Mt.FREETEXT_COLOR,this.color]]}get toolbarButtons(){return this._colorPicker||(this._colorPicker=new Cv(this)),[["colorPicker",this._colorPicker]]}get colorType(){return Mt.FREETEXT_COLOR}onUpdatedColor(){this.editorDiv.style.color=this.color,this._colorPicker?.update(this.color),super.onUpdatedColor()}_translateEmpty(t,n){this._uiManager.translateSelectedEditors(t,n,!0)}getInitialTranslation(){let t=this.parentScale;return[-wr._internalPadding*t,-(wr._internalPadding+l(this,Fi))*t]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){if(!super.enableEditMode())return!1;this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),L(this,lf,new AbortController);let t=this._uiManager.combinedSignal(l(this,lf));return this.editorDiv.addEventListener("keydown",this.editorDivKeydown.bind(this),{signal:t}),this.editorDiv.addEventListener("focus",this.editorDivFocus.bind(this),{signal:t}),this.editorDiv.addEventListener("blur",this.editorDivBlur.bind(this),{signal:t}),this.editorDiv.addEventListener("input",this.editorDivInput.bind(this),{signal:t}),this.editorDiv.addEventListener("paste",this.editorDivPaste.bind(this),{signal:t}),!0}disableEditMode(){return super.disableEditMode()?(this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",l(this,Hy)),this._isDraggable=!0,l(this,lf)?.abort(),L(this,lf,null),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"),!0):!1}focusin(t){this._focusEventsAllowed&&(super.focusin(t),t.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(t){this.width||(this.enableEditMode(),t&&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()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();let t=l(this,Bi),n=L(this,Bi,ee(this,Kr,FF).call(this).trimEnd());if(t===n)return;let i=o=>{if(L(this,Bi,o),!o){this.remove();return}ee(this,Kr,Yw).call(this),this._uiManager.rebuild(this),ee(this,Kr,Gw).call(this)};this.addCommands({cmd:()=>{i(n)},undo:()=>{i(t)},mustExec:!1}),ee(this,Kr,Gw).call(this)}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}keydown(t){t.target===this.div&&t.key==="Enter"&&(this.enterInEditMode(),t.preventDefault())}editorDivKeydown(t){wr._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)}get canChangeContent(){return!0}render(){if(this.div)return this.div;let t,n;(this._isCopy||this.annotationElementId)&&(t=this.x,n=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",l(this,Hy)),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text2"),this.editorDiv.setAttribute("data-l10n-attrs","default-content"),this.enableEditing(),this.editorDiv.contentEditable=!0;let{style:i}=this.editorDiv;if(i.fontSize=`calc(${l(this,Fi)}px * var(--total-scale-factor))`,i.color=this.color,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),this._isCopy||this.annotationElementId){let[o,s]=this.parentDimensions;if(this.annotationElementId){let{position:a}=this._initialData,[u,c]=this.getInitialTranslation();[u,c]=this.pageTranslationToScreen(u,c);let[f,h]=this.pageDimensions,[p,m]=this.pageTranslation,b,v;switch(this.rotation){case 0:b=t+(a[0]-p)/f,v=n+this.height-(a[1]-m)/h;break;case 90:b=t+(a[0]-p)/f,v=n-(a[1]-m)/h,[u,c]=[c,-u];break;case 180:b=t-this.width+(a[0]-p)/f,v=n-(a[1]-m)/h,[u,c]=[-u,-c];break;case 270:b=t+(a[0]-p-this.height*h)/f,v=n+(a[1]-m-this.width*f)/h,[u,c]=[-c,u];break}this.setAt(b*o,v*s,u,c)}else this._moveAfterPaste(t,n);ee(this,Kr,Yw).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}editorDivPaste(t){var b,v,w;let n=t.clipboardData||window.clipboardData,{types:i}=n;if(i.length===1&&i[0]==="text/plain")return;t.preventDefault();let o=ee(b=wr,Qa,KS).call(b,n.getData("text")||"").replaceAll(xw,`
97
+ `);if(!o)return;let s=window.getSelection();if(!s.rangeCount)return;this.editorDiv.normalize(),s.deleteFromDocument();let a=s.getRangeAt(0);if(!o.includes(`
98
+ `)){a.insertNode(document.createTextNode(o)),this.editorDiv.normalize(),s.collapseToStart();return}let{startContainer:u,startOffset:c}=a,f=[],h=[];if(u.nodeType===Node.TEXT_NODE){let y=u.parentElement;if(h.push(u.nodeValue.slice(c).replaceAll(xw,"")),y!==this.editorDiv){let _=f;for(let E of this.editorDiv.childNodes){if(E===y){_=h;continue}_.push(ee(v=wr,Qa,Vw).call(v,E))}}f.push(u.nodeValue.slice(0,c).replaceAll(xw,""))}else if(u===this.editorDiv){let y=f,_=0;for(let E of this.editorDiv.childNodes)_++===c&&(y=h),y.push(ee(w=wr,Qa,Vw).call(w,E))}L(this,Bi,`${f.join(`
99
+ `)}${o}${h.join(`
100
+ `)}`),ee(this,Kr,Yw).call(this);let p=new Range,m=Math.sumPrecise(f.map(y=>y.length));for(let{firstChild:y}of this.editorDiv.childNodes)if(y.nodeType===Node.TEXT_NODE){let _=y.nodeValue.length;if(m<=_){p.setStart(y,m),p.setEnd(y,m);break}m-=_}s.removeAllRanges(),s.addRange(p)}get contentDiv(){return this.editorDiv}getPDFRect(){let t=wr._internalPadding*this.parentScale;return this.getRect(t,t)}static async deserialize(t,n,i){var a;let o=null;if(t instanceof Iv){let{data:{defaultAppearanceData:{fontSize:u,fontColor:c},rect:f,rotation:h,id:p,popupRef:m,richText:b,contentsObj:v,creationDate:w,modificationDate:y},textContent:_,textPosition:E,parent:{page:{pageNumber:S}}}=t;if(!_||_.length===0)return null;o=t={annotationType:vt.FREETEXT,color:Array.from(c),fontSize:u,value:_.join(`
101
+ `),position:E,pageIndex:S-1,rect:f.slice(0),rotation:h,annotationElementId:p,id:p,deleted:!1,popupRef:m,comment:v?.str||null,richText:b,creationDate:w,modificationDate:y}}let s=await super.deserialize(t,n,i);return L(s,Fi,t.fontSize),s.color=nt.makeHexColor(...t.color),L(s,Bi,ee(a=wr,Qa,KS).call(a,t.value)),s._initialData=o,t.comment&&s.setCommentData(t),s}serialize(t=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();let n=mr._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.color),i=Object.assign(super.serialize(t),{color:n,fontSize:l(this,Fi),value:ee(this,Kr,UF).call(this)});return this.addComment(i),t?(i.isCopy=!0,i):this.annotationElementId&&!ee(this,Kr,jF).call(this,i)?null:(i.id=this.annotationElementId,i)}renderAnnotationElement(t){let n=super.renderAnnotationElement(t);if(!n)return null;let{style:i}=n;i.fontSize=`calc(${l(this,Fi)}px * var(--total-scale-factor))`,i.color=this.color,n.replaceChildren();for(let o of l(this,Bi).split(`
102
+ `)){let s=document.createElement("div");s.append(o?document.createTextNode(o):document.createElement("br")),n.append(s)}return t.updateEdited({rect:this.getPDFRect(),popup:this._uiManager.hasCommentManager()||this.hasEditedComment?this.comment:{text:l(this,Bi)}}),n}resetAnnotationElement(t){super.resetAnnotationElement(t),t.resetEdited()}};Bi=new WeakMap,Hy=new WeakMap,lf=new WeakMap,Fi=new WeakMap,Kr=new WeakSet,MF=function(t){let n=o=>{this.editorDiv.style.fontSize=`calc(${o}px * var(--total-scale-factor))`,this.translate(0,-(o-l(this,Fi))*this.parentScale),L(this,Fi,o),ee(this,Kr,Gw).call(this)},i=l(this,Fi);this.addCommands({cmd:n.bind(this,t),undo:n.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Mt.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})},BF=function(t){let n=o=>{this.color=o,this.onUpdatedColor()},i=this.color;this.addCommands({cmd:n.bind(this,t),undo:n.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Mt.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},FF=function(){var i;let t=[];this.editorDiv.normalize();let n=null;for(let o of this.editorDiv.childNodes)n?.nodeType===Node.TEXT_NODE&&o.nodeName==="BR"||(t.push(ee(i=wr,Qa,Vw).call(i,o)),n=o);return t.join(`
103
+ `)},Gw=function(){let[t,n]=this.parentDimensions,i;if(this.isAttachedToDOM)i=this.div.getBoundingClientRect();else{let{currentLayer:o,div:s}=this,a=s.style.display,u=s.classList.contains("hidden");s.classList.remove("hidden"),s.style.display="hidden",o.div.append(this.div),i=s.getBoundingClientRect(),s.remove(),s.style.display=a,s.classList.toggle("hidden",u)}this.rotation%180===this.parentRotation%180?(this.width=i.width/t,this.height=i.height/n):(this.width=i.height/t,this.height=i.width/n),this.fixAndSetPosition()},Qa=new WeakSet,Vw=function(t){return(t.nodeType===Node.TEXT_NODE?t.nodeValue:t.innerText).replaceAll(xw,"")},Yw=function(){if(this.editorDiv.replaceChildren(),!!l(this,Bi))for(let t of l(this,Bi).split(`
104
+ `)){let n=document.createElement("div");n.append(t?document.createTextNode(t):document.createElement("br")),this.editorDiv.append(n)}},UF=function(){return l(this,Bi).replaceAll("\xA0"," ")},KS=function(t){return t.replaceAll(" ","\xA0")},jF=function(t){let{value:n,fontSize:i,color:o,pageIndex:s}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||t.value!==n||t.fontSize!==i||t.color.some((a,u)=>a!==o[u])||t.pageIndex!==s},q(wr,Qa),Ke(wr,"_freeTextDefaultContent",""),Ke(wr,"_internalPadding",0),Ke(wr,"_defaultColor",null),Ke(wr,"_defaultFontSize",10),Ke(wr,"_type","freetext"),Ke(wr,"_editorType",vt.FREETEXT);XS=wr,at=class{toSVGPath(){dr("Abstract method `toSVGPath` must be implemented.")}get box(){dr("Abstract getter `box` must be implemented.")}serialize(e,t){dr("Abstract method `serialize` must be implemented.")}static _rescale(e,t,n,i,o,s){s||(s=new Float32Array(e.length));for(let a=0,u=e.length;a<u;a+=2)s[a]=t+e[a]*i,s[a+1]=n+e[a+1]*o;return s}static _rescaleAndSwap(e,t,n,i,o,s){s||(s=new Float32Array(e.length));for(let a=0,u=e.length;a<u;a+=2)s[a]=t+e[a+1]*i,s[a+1]=n+e[a]*o;return s}static _translate(e,t,n,i){i||(i=new Float32Array(e.length));for(let o=0,s=e.length;o<s;o+=2)i[o]=t+e[o],i[o+1]=n+e[o+1];return i}static svgRound(e){return Math.round(e*1e4)}static _normalizePoint(e,t,n,i,o){switch(o){case 90:return[1-t/n,e/i];case 180:return[1-e/n,1-t/i];case 270:return[t/n,1-e/i];default:return[e/n,t/i]}}static _normalizePagePoint(e,t,n){switch(n){case 90:return[1-t,e];case 180:return[1-e,1-t];case 270:return[t,1-e];default:return[e,t]}}static createBezierPoints(e,t,n,i,o,s){return[(e+5*n)/6,(t+5*i)/6,(5*n+o)/6,(5*i+s)/6,(n+o)/2,(i+s)/2]}};Ke(at,"PRECISION",1e-4);ga=class ga{constructor({x:e,y:t},n,i,o,s,a=0){q(this,cn);q(this,Ui);q(this,zs,[]);q(this,Xd);q(this,Kd);q(this,Oo,[]);q(this,Nt,new Float32Array(18));q(this,uf);q(this,cf);q(this,Gy);q(this,Vy);q(this,Zd);q(this,Jd);q(this,au,[]);L(this,Ui,n),L(this,Jd,o*i),L(this,Kd,s),l(this,Nt).set([NaN,NaN,NaN,NaN,e,t],6),L(this,Xd,a),L(this,Vy,l(ga,Yy)*i),L(this,Gy,l(ga,i_)*i),L(this,Zd,i),l(this,au).push(e,t)}isEmpty(){return isNaN(l(this,Nt)[8])}add({x:e,y:t}){L(this,uf,e),L(this,cf,t);let[n,i,o,s]=l(this,Ui),[a,u,c,f]=l(this,Nt).subarray(8,12),h=e-c,p=t-f,m=Math.hypot(h,p);if(m<l(this,Gy))return!1;let b=m-l(this,Vy),v=b/m,w=v*h,y=v*p,_=a,E=u;a=c,u=f,c+=w,f+=y,l(this,au)?.push(e,t);let S=-y/b,A=w/b,F=S*l(this,Jd),D=A*l(this,Jd);return l(this,Nt).set(l(this,Nt).subarray(2,8),0),l(this,Nt).set([c+F,f+D],4),l(this,Nt).set(l(this,Nt).subarray(14,18),12),l(this,Nt).set([c-F,f-D],16),isNaN(l(this,Nt)[6])?(l(this,Oo).length===0&&(l(this,Nt).set([a+F,u+D],2),l(this,Oo).push(NaN,NaN,NaN,NaN,(a+F-n)/o,(u+D-i)/s),l(this,Nt).set([a-F,u-D],14),l(this,zs).push(NaN,NaN,NaN,NaN,(a-F-n)/o,(u-D-i)/s)),l(this,Nt).set([_,E,a,u,c,f],6),!this.isEmpty()):(l(this,Nt).set([_,E,a,u,c,f],6),Math.abs(Math.atan2(E-u,_-a)-Math.atan2(y,w))<Math.PI/2?([a,u,c,f]=l(this,Nt).subarray(2,6),l(this,Oo).push(NaN,NaN,NaN,NaN,((a+c)/2-n)/o,((u+f)/2-i)/s),[a,u,_,E]=l(this,Nt).subarray(14,18),l(this,zs).push(NaN,NaN,NaN,NaN,((_+a)/2-n)/o,((E+u)/2-i)/s),!0):([_,E,a,u,c,f]=l(this,Nt).subarray(0,6),l(this,Oo).push(((_+5*a)/6-n)/o,((E+5*u)/6-i)/s,((5*a+c)/6-n)/o,((5*u+f)/6-i)/s,((a+c)/2-n)/o,((u+f)/2-i)/s),[c,f,a,u,_,E]=l(this,Nt).subarray(12,18),l(this,zs).push(((_+5*a)/6-n)/o,((E+5*u)/6-i)/s,((5*a+c)/6-n)/o,((5*u+f)/6-i)/s,((a+c)/2-n)/o,((u+f)/2-i)/s),!0))}toSVGPath(){if(this.isEmpty())return"";let e=l(this,Oo),t=l(this,zs);if(isNaN(l(this,Nt)[6])&&!this.isEmpty())return ee(this,cn,$F).call(this);let n=[];n.push(`M${e[4]} ${e[5]}`);for(let i=6;i<e.length;i+=6)isNaN(e[i])?n.push(`L${e[i+4]} ${e[i+5]}`):n.push(`C${e[i]} ${e[i+1]} ${e[i+2]} ${e[i+3]} ${e[i+4]} ${e[i+5]}`);ee(this,cn,WF).call(this,n);for(let i=t.length-6;i>=6;i-=6)isNaN(t[i])?n.push(`L${t[i+4]} ${t[i+5]}`):n.push(`C${t[i]} ${t[i+1]} ${t[i+2]} ${t[i+3]} ${t[i+4]} ${t[i+5]}`);return ee(this,cn,zF).call(this,n),n.join(" ")}newFreeDrawOutline(e,t,n,i,o,s){return new Mv(e,t,n,i,o,s)}getOutlines(){let e=l(this,Oo),t=l(this,zs),n=l(this,Nt),[i,o,s,a]=l(this,Ui),u=new Float32Array((l(this,au)?.length??0)+2);for(let h=0,p=u.length-2;h<p;h+=2)u[h]=(l(this,au)[h]-i)/s,u[h+1]=(l(this,au)[h+1]-o)/a;if(u[u.length-2]=(l(this,uf)-i)/s,u[u.length-1]=(l(this,cf)-o)/a,isNaN(n[6])&&!this.isEmpty())return ee(this,cn,qF).call(this,u);let c=new Float32Array(l(this,Oo).length+24+l(this,zs).length),f=e.length;for(let h=0;h<f;h+=2){if(isNaN(e[h])){c[h]=c[h+1]=NaN;continue}c[h]=e[h],c[h+1]=e[h+1]}f=ee(this,cn,GF).call(this,c,f);for(let h=t.length-6;h>=6;h-=6)for(let p=0;p<6;p+=2){if(isNaN(t[h+p])){c[f]=c[f+1]=NaN,f+=2;continue}c[f]=t[h+p],c[f+1]=t[h+p+1],f+=2}return ee(this,cn,HF).call(this,c,f),this.newFreeDrawOutline(c,u,l(this,Ui),l(this,Zd),l(this,Xd),l(this,Kd))}};Ui=new WeakMap,zs=new WeakMap,Xd=new WeakMap,Kd=new WeakMap,Oo=new WeakMap,Nt=new WeakMap,uf=new WeakMap,cf=new WeakMap,Gy=new WeakMap,Vy=new WeakMap,Zd=new WeakMap,Jd=new WeakMap,au=new WeakMap,Yy=new WeakMap,n_=new WeakMap,i_=new WeakMap,cn=new WeakSet,Xg=function(){let e=l(this,Nt).subarray(4,6),t=l(this,Nt).subarray(16,18),[n,i,o,s]=l(this,Ui);return[(l(this,uf)+(e[0]-t[0])/2-n)/o,(l(this,cf)+(e[1]-t[1])/2-i)/s,(l(this,uf)+(t[0]-e[0])/2-n)/o,(l(this,cf)+(t[1]-e[1])/2-i)/s]},$F=function(){let[e,t,n,i]=l(this,Ui),[o,s,a,u]=ee(this,cn,Xg).call(this);return`M${(l(this,Nt)[2]-e)/n} ${(l(this,Nt)[3]-t)/i} L${(l(this,Nt)[4]-e)/n} ${(l(this,Nt)[5]-t)/i} L${o} ${s} L${a} ${u} L${(l(this,Nt)[16]-e)/n} ${(l(this,Nt)[17]-t)/i} L${(l(this,Nt)[14]-e)/n} ${(l(this,Nt)[15]-t)/i} Z`},zF=function(e){let t=l(this,zs);e.push(`L${t[4]} ${t[5]} Z`)},WF=function(e){let[t,n,i,o]=l(this,Ui),s=l(this,Nt).subarray(4,6),a=l(this,Nt).subarray(16,18),[u,c,f,h]=ee(this,cn,Xg).call(this);e.push(`L${(s[0]-t)/i} ${(s[1]-n)/o} L${u} ${c} L${f} ${h} L${(a[0]-t)/i} ${(a[1]-n)/o}`)},qF=function(e){let t=l(this,Nt),[n,i,o,s]=l(this,Ui),[a,u,c,f]=ee(this,cn,Xg).call(this),h=new Float32Array(36);return h.set([NaN,NaN,NaN,NaN,(t[2]-n)/o,(t[3]-i)/s,NaN,NaN,NaN,NaN,(t[4]-n)/o,(t[5]-i)/s,NaN,NaN,NaN,NaN,a,u,NaN,NaN,NaN,NaN,c,f,NaN,NaN,NaN,NaN,(t[16]-n)/o,(t[17]-i)/s,NaN,NaN,NaN,NaN,(t[14]-n)/o,(t[15]-i)/s],0),this.newFreeDrawOutline(h,e,l(this,Ui),l(this,Zd),l(this,Xd),l(this,Kd))},HF=function(e,t){let n=l(this,zs);return e.set([NaN,NaN,NaN,NaN,n[4],n[5]],t),t+=6},GF=function(e,t){let n=l(this,Nt).subarray(4,6),i=l(this,Nt).subarray(16,18),[o,s,a,u]=l(this,Ui),[c,f,h,p]=ee(this,cn,Xg).call(this);return e.set([NaN,NaN,NaN,NaN,(n[0]-o)/a,(n[1]-s)/u,NaN,NaN,NaN,NaN,c,f,NaN,NaN,NaN,NaN,h,p,NaN,NaN,NaN,NaN,(i[0]-o)/a,(i[1]-s)/u],t),t+=24},q(ga,Yy,8),q(ga,n_,2),q(ga,i_,l(ga,Yy)+l(ga,n_));Pv=ga,Mv=class extends at{constructor(t,n,i,o,s,a){super();q(this,s_);q(this,Qd);q(this,ff,new Float32Array(4));q(this,Wa);q(this,Xy);q(this,ji);q(this,Ky);q(this,Gr);L(this,Gr,t),L(this,ji,n),L(this,Qd,i),L(this,Ky,o),L(this,Wa,s),L(this,Xy,a),this.firstPoint=[NaN,NaN],this.lastPoint=[NaN,NaN],ee(this,s_,VF).call(this,a);let[u,c,f,h]=l(this,ff);for(let p=0,m=t.length;p<m;p+=2)t[p]=(t[p]-u)/f,t[p+1]=(t[p+1]-c)/h;for(let p=0,m=n.length;p<m;p+=2)n[p]=(n[p]-u)/f,n[p+1]=(n[p+1]-c)/h}toSVGPath(){let t=[`M${l(this,Gr)[4]} ${l(this,Gr)[5]}`];for(let n=6,i=l(this,Gr).length;n<i;n+=6){if(isNaN(l(this,Gr)[n])){t.push(`L${l(this,Gr)[n+4]} ${l(this,Gr)[n+5]}`);continue}t.push(`C${l(this,Gr)[n]} ${l(this,Gr)[n+1]} ${l(this,Gr)[n+2]} ${l(this,Gr)[n+3]} ${l(this,Gr)[n+4]} ${l(this,Gr)[n+5]}`)}return t.push("Z"),t.join(" ")}serialize([t,n,i,o],s){let a=i-t,u=o-n,c,f;switch(s){case 0:c=at._rescale(l(this,Gr),t,o,a,-u),f=at._rescale(l(this,ji),t,o,a,-u);break;case 90:c=at._rescaleAndSwap(l(this,Gr),t,n,a,u),f=at._rescaleAndSwap(l(this,ji),t,n,a,u);break;case 180:c=at._rescale(l(this,Gr),i,n,-a,u),f=at._rescale(l(this,ji),i,n,-a,u);break;case 270:c=at._rescaleAndSwap(l(this,Gr),i,o,-a,-u),f=at._rescaleAndSwap(l(this,ji),i,o,-a,-u);break}return{outline:Array.from(c),points:[Array.from(f)]}}get box(){return l(this,ff)}newOutliner(t,n,i,o,s,a=0){return new Pv(t,n,i,o,s,a)}getNewOutline(t,n){let[i,o,s,a]=l(this,ff),[u,c,f,h]=l(this,Qd),p=s*f,m=a*h,b=i*f+u,v=o*h+c,w=this.newOutliner({x:l(this,ji)[0]*p+b,y:l(this,ji)[1]*m+v},l(this,Qd),l(this,Ky),t,l(this,Xy),n??l(this,Wa));for(let y=2;y<l(this,ji).length;y+=2)w.add({x:l(this,ji)[y]*p+b,y:l(this,ji)[y+1]*m+v});return w.getOutlines()}};Qd=new WeakMap,ff=new WeakMap,Wa=new WeakMap,Xy=new WeakMap,ji=new WeakMap,Ky=new WeakMap,Gr=new WeakMap,s_=new WeakSet,VF=function(t){let n=l(this,Gr),i=n[4],o=n[5],s=[i,o,i,o],a=i,u=o,c=i,f=o,h=t?Math.max:Math.min,p=new Float32Array(4);for(let b=6,v=n.length;b<v;b+=6){let w=n[b+4],y=n[b+5];isNaN(n[b])?(nt.pointBoundingBox(w,y,s),u>y?(a=w,u=y):u===y&&(a=h(a,w)),f<y?(c=w,f=y):f===y&&(c=h(c,w))):(p[0]=p[1]=1/0,p[2]=p[3]=-1/0,nt.bezierBoundingBox(i,o,...n.slice(b,b+6),p),nt.rectBoundingBox(p[0],p[1],p[2],p[3],s),u>p[1]?(a=p[0],u=p[1]):u===p[1]&&(a=h(a,p[0])),f<p[3]?(c=p[2],f=p[3]):f===p[3]&&(c=h(c,p[2]))),i=w,o=y}let m=l(this,ff);m[0]=s[0]-l(this,Wa),m[1]=s[1]-l(this,Wa),m[2]=s[2]-s[0]+2*l(this,Wa),m[3]=s[3]-s[1]+2*l(this,Wa),this.firstPoint=[a,u],this.lastPoint=[c,f]};mm=class{constructor(e,t=0,n=0,i=!0){q(this,ti);q(this,Zy);q(this,Jy);q(this,Qy);q(this,lu,[]);q(this,Ws,[]);let o=[1/0,1/0,-1/0,-1/0],a=10**-4;for(let{x:w,y,width:_,height:E}of e){let S=Math.floor((w-t)/a)*a,A=Math.ceil((w+_+t)/a)*a,F=Math.floor((y-t)/a)*a,D=Math.ceil((y+E+t)/a)*a,H=[S,F,D,!0],J=[A,F,D,!1];l(this,lu).push(H,J),nt.rectBoundingBox(S,F,A,D,o)}let u=o[2]-o[0]+2*n,c=o[3]-o[1]+2*n,f=o[0]-n,h=o[1]-n,p=i?-1/0:1/0,m=1/0,b=l(this,lu).at(i?-1:-2),v=[b[0],b[2]];for(let w of l(this,lu)){let[y,_,E,S]=w;!S&&i?_<m?(m=_,p=y):_===m&&(p=Math.max(p,y)):S&&!i&&(_<m?(m=_,p=y):_===m&&(p=Math.min(p,y))),w[0]=(y-f)/u,w[1]=(_-h)/c,w[2]=(E-h)/c}L(this,Zy,new Float32Array([f,h,u,c])),L(this,Jy,[p,m]),L(this,Qy,v)}getOutlines(){l(this,lu).sort((t,n)=>t[0]-n[0]||t[1]-n[1]||t[2]-n[2]);let e=[];for(let t of l(this,lu))t[3]?(e.push(...ee(this,ti,ZS).call(this,t)),ee(this,ti,XF).call(this,t)):(ee(this,ti,KF).call(this,t),e.push(...ee(this,ti,ZS).call(this,t)));return ee(this,ti,YF).call(this,e)}};Zy=new WeakMap,Jy=new WeakMap,Qy=new WeakMap,lu=new WeakMap,Ws=new WeakMap,ti=new WeakSet,YF=function(e){let t=[],n=new Set;for(let s of e){let[a,u,c]=s;t.push([a,u,s],[a,c,s])}t.sort((s,a)=>s[1]-a[1]||s[0]-a[0]);for(let s=0,a=t.length;s<a;s+=2){let u=t[s][2],c=t[s+1][2];u.push(c),c.push(u),n.add(u),n.add(c)}let i=[],o;for(;n.size>0;){let s=n.values().next().value,[a,u,c,f,h]=s;n.delete(s);let p=a,m=u;for(o=[a,c],i.push(o);;){let b;if(n.has(f))b=f;else if(n.has(h))b=h;else break;n.delete(b),[a,u,c,f,h]=b,p!==a&&(o.push(p,m,a,m===u?u:c),p=a),m=m===u?c:u}o.push(p,m)}return new JS(i,l(this,Zy),l(this,Jy),l(this,Qy))},Xw=function(e){let t=l(this,Ws),n=0,i=t.length-1;for(;n<=i;){let o=n+i>>1,s=t[o][0];if(s===e)return o;s<e?n=o+1:i=o-1}return i+1},XF=function([,e,t]){let n=ee(this,ti,Xw).call(this,e);l(this,Ws).splice(n,0,[e,t])},KF=function([,e,t]){let n=ee(this,ti,Xw).call(this,e);for(let i=n;i<l(this,Ws).length;i++){let[o,s]=l(this,Ws)[i];if(o!==e)break;if(o===e&&s===t){l(this,Ws).splice(i,1);return}}for(let i=n-1;i>=0;i--){let[o,s]=l(this,Ws)[i];if(o!==e)break;if(o===e&&s===t){l(this,Ws).splice(i,1);return}}},ZS=function(e){let[t,n,i]=e,o=[[t,n,i]],s=ee(this,ti,Xw).call(this,i);for(let a=0;a<s;a++){let[u,c]=l(this,Ws)[a];for(let f=0,h=o.length;f<h;f++){let[,p,m]=o[f];if(!(c<=p||m<=u)){if(p>=u){if(m>c)o[f][1]=c;else{if(h===1)return[];o.splice(f,1),f--,h--}continue}o[f][2]=u,m>c&&o.push([t,c,m])}}}return o};JS=class extends at{constructor(t,n,i,o){super();q(this,e0);q(this,ep);L(this,ep,t),L(this,e0,n),this.firstPoint=i,this.lastPoint=o}toSVGPath(){let t=[];for(let n of l(this,ep)){let[i,o]=n;t.push(`M${i} ${o}`);for(let s=2;s<n.length;s+=2){let a=n[s],u=n[s+1];a===i?(t.push(`V${u}`),o=u):u===o&&(t.push(`H${a}`),i=a)}t.push("Z")}return t.join(" ")}serialize([t,n,i,o],s){let a=[],u=i-t,c=o-n;for(let f of l(this,ep)){let h=new Array(f.length);for(let p=0;p<f.length;p+=2)h[p]=t+f[p]*u,h[p+1]=o-f[p+1]*c;a.push(h)}return a}get box(){return l(this,e0)}get classNamesForOutlining(){return["highlightOutline"]}};e0=new WeakMap,ep=new WeakMap;ym=class extends Pv{newFreeDrawOutline(e,t,n,i,o,s){return new QS(e,t,n,i,o,s)}},QS=class extends Mv{newOutliner(e,t,n,i,o,s=0){return new ym(e,t,n,i,o,s)}},qt=class qt extends mr{constructor(t){super({...t,name:"highlightEditor"});q(this,Tt);q(this,tp,null);q(this,t0,0);q(this,qa);q(this,hf,null);q(this,r0,null);q(this,bi,null);q(this,n0,null);q(this,i0,0);q(this,df,null);q(this,$i,null);q(this,zi,null);q(this,Cn,!1);q(this,rp,null);q(this,np,null);q(this,zn,null);q(this,ip,"");q(this,ws);q(this,s0,"");this.color=t.color||qt._defaultColor,L(this,ws,t.thickness||qt._defaultThickness),this.opacity=t.opacity||qt._defaultOpacity,L(this,qa,t.boxes||null),L(this,s0,t.methodOfCreation||""),L(this,ip,t.text||""),this._isDraggable=!1,this.defaultL10nId="pdfjs-editor-highlight-editor",t.highlightId>-1?(L(this,Cn,!0),ee(this,Tt,Kw).call(this,t),ee(this,Tt,oc).call(this)):l(this,qa)&&(L(this,tp,t.anchorNode),L(this,t0,t.anchorOffset),L(this,n0,t.focusNode),L(this,i0,t.focusOffset),ee(this,Tt,eT).call(this),ee(this,Tt,oc).call(this),this.rotate(this.rotation)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-highlight-added-alert")}static get _keyboardManager(){let t=qt.prototype;return wt(this,"_keyboardManager",new Df([[["ArrowLeft","mac+ArrowLeft"],t._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],t._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],t._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],t._moveCaret,{args:[3]}]]))}get telemetryInitialData(){return{action:"added",type:l(this,Cn)?"free_highlight":"highlight",color:this._uiManager.getNonHCMColorName(this.color),thickness:l(this,ws),methodOfCreation:l(this,s0)}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.getNonHCMColorName(this.color)}}static computeTelemetryFinalData(t){return{numberOfColors:t.get("color").size}}static initialize(t,n){mr.initialize(t,n),qt._defaultColor||(qt._defaultColor=n.highlightColors?.values().next().value||"#fff066")}static updateDefaultParams(t,n){switch(t){case Mt.HIGHLIGHT_COLOR:qt._defaultColor=n;break;case Mt.HIGHLIGHT_THICKNESS:qt._defaultThickness=n;break}}translateInPage(t,n){}get toolbarPosition(){return l(this,np)}get commentButtonPosition(){return l(this,rp)}updateParams(t,n){switch(t){case Mt.HIGHLIGHT_COLOR:ee(this,Tt,ZF).call(this,n);break;case Mt.HIGHLIGHT_THICKNESS:ee(this,Tt,JF).call(this,n);break}}static get defaultPropertiesToUpdate(){return[[Mt.HIGHLIGHT_COLOR,qt._defaultColor],[Mt.HIGHLIGHT_THICKNESS,qt._defaultThickness]]}get propertiesToUpdate(){return[[Mt.HIGHLIGHT_COLOR,this.color||qt._defaultColor],[Mt.HIGHLIGHT_THICKNESS,l(this,ws)||qt._defaultThickness],[Mt.HIGHLIGHT_FREE,l(this,Cn)]]}onUpdatedColor(){this.parent?.drawLayer.updateProperties(l(this,zi),{root:{fill:this.color,"fill-opacity":this.opacity}}),l(this,r0)?.updateColor(this.color),super.onUpdatedColor()}get toolbarButtons(){return this._uiManager.highlightColors?[["colorPicker",L(this,r0,new hm({editor:this}))]]:super.toolbarButtons}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(ee(this,Tt,Jw).call(this))}getBaseTranslation(){return[0,0]}getRect(t,n){return super.getRect(t,n,ee(this,Tt,Jw).call(this))}onceAdded(t){this.annotationElementId||this.parent.addUndoableEditor(this),t&&this.div.focus()}remove(){ee(this,Tt,tT).call(this),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(ee(this,Tt,oc).call(this),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){let n=!1;this.parent&&!t?ee(this,Tt,tT).call(this):t&&(ee(this,Tt,oc).call(this,t),n=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(t),this.show(this._isVisible),n&&this.select()}rotate(t){var o,s,a;let{drawLayer:n}=this.parent,i;l(this,Cn)?(t=(t-this.rotation+360)%360,i=ee(o=qt,As,Lh).call(o,l(this,$i).box,t)):i=ee(s=qt,As,Lh).call(s,[this.x,this.y,this.width,this.height],t),n.updateProperties(l(this,zi),{bbox:i,root:{"data-main-rotation":t}}),n.updateProperties(l(this,zn),{bbox:ee(a=qt,As,Lh).call(a,l(this,bi).box,t),root:{"data-main-rotation":t}})}render(){if(this.div)return this.div;let t=super.render();l(this,ip)&&(t.setAttribute("aria-label",l(this,ip)),t.setAttribute("role","mark")),l(this,Cn)?t.classList.add("free"):this.div.addEventListener("keydown",ee(this,Tt,e3).bind(this),{signal:this._uiManager._signal});let n=L(this,df,document.createElement("div"));return t.append(n),n.setAttribute("aria-hidden","true"),n.className="internal",n.style.clipPath=l(this,hf),this.setDims(),MB(this,l(this,df),["pointerover","pointerleave"]),this.enableEditing(),t}pointerover(){this.isSelected||this.parent?.drawLayer.updateProperties(l(this,zn),{rootClass:{hovered:!0}})}pointerleave(){this.isSelected||this.parent?.drawLayer.updateProperties(l(this,zn),{rootClass:{hovered:!1}})}_moveCaret(t){switch(this.parent.unselect(this),t){case 0:case 2:ee(this,Tt,Zw).call(this,!0);break;case 1:case 3:ee(this,Tt,Zw).call(this,!1);break}}select(){super.select(),l(this,zn)&&this.parent?.drawLayer.updateProperties(l(this,zn),{rootClass:{hovered:!1,selected:!0}})}unselect(){super.unselect(),l(this,zn)&&(this.parent?.drawLayer.updateProperties(l(this,zn),{rootClass:{selected:!1}}),l(this,Cn)||ee(this,Tt,Zw).call(this,!1))}get _mustFixPosition(){return!l(this,Cn)}show(t=this._isVisible){super.show(t),this.parent&&(this.parent.drawLayer.updateProperties(l(this,zi),{rootClass:{hidden:!t}}),this.parent.drawLayer.updateProperties(l(this,zn),{rootClass:{hidden:!t}}))}static startHighlighting(t,n,{target:i,x:o,y:s}){let{x:a,y:u,width:c,height:f}=i.getBoundingClientRect(),h=new AbortController,p=t.combinedSignal(h),m=b=>{h.abort(),ee(this,As,i3).call(this,t,b)};window.addEventListener("blur",m,{signal:p}),window.addEventListener("pointerup",m,{signal:p}),window.addEventListener("pointerdown",Cr,{capture:!0,passive:!1,signal:p}),window.addEventListener("contextmenu",Ki,{signal:p}),i.addEventListener("pointermove",ee(this,As,n3).bind(this,t),{signal:p}),this._freeHighlight=new ym({x:o,y:s},[a,u,c,f],t.scale,this._defaultThickness/2,n,.001),{id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=t.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:this._defaultColor,"fill-opacity":this._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:this._freeHighlight.toSVGPath()}},!0,!0)}static async deserialize(t,n,i){var v,w,y,_;let o=null;if(t instanceof Nv){let{data:{quadPoints:E,rect:S,rotation:A,id:F,color:D,opacity:H,popupRef:J,richText:K,contentsObj:ne,creationDate:k,modificationDate:$},parent:{page:{pageNumber:Y}}}=t;o=t={annotationType:vt.HIGHLIGHT,color:Array.from(D),opacity:H,quadPoints:E,boxes:null,pageIndex:Y-1,rect:S.slice(0),rotation:A,annotationElementId:F,id:F,deleted:!1,popupRef:J,richText:K,comment:ne?.str||null,creationDate:k,modificationDate:$}}else if(t instanceof gm){let{data:{inkLists:E,rect:S,rotation:A,id:F,color:D,borderStyle:{rawWidth:H},popupRef:J,richText:K,contentsObj:ne,creationDate:k,modificationDate:$},parent:{page:{pageNumber:Y}}}=t;o=t={annotationType:vt.HIGHLIGHT,color:Array.from(D),thickness:H,inkLists:E,boxes:null,pageIndex:Y-1,rect:S.slice(0),rotation:A,annotationElementId:F,id:F,deleted:!1,popupRef:J,richText:K,comment:ne?.str||null,creationDate:k,modificationDate:$}}let{color:s,quadPoints:a,inkLists:u,opacity:c}=t,f=await super.deserialize(t,n,i);f.color=nt.makeHexColor(...s),f.opacity=c||1,u&&L(f,ws,t.thickness),f._initialData=o,t.comment&&f.setCommentData(t);let[h,p]=f.pageDimensions,[m,b]=f.pageTranslation;if(a){let E=L(f,qa,[]);for(let S=0;S<a.length;S+=8)E.push({x:(a[S]-m)/h,y:1-(a[S+1]-b)/p,width:(a[S+2]-a[S])/h,height:(a[S+1]-a[S+5])/p});ee(v=f,Tt,eT).call(v),ee(w=f,Tt,oc).call(w),f.rotate(f.rotation)}else if(u){L(f,Cn,!0);let E=u[0],S={x:E[0]-m,y:p-(E[1]-b)},A=new ym(S,[0,0,h,p],1,l(f,ws)/2,!0,.001);for(let H=0,J=E.length;H<J;H+=2)S.x=E[H]-m,S.y=p-(E[H+1]-b),A.add(S);let{id:F,clipPathId:D}=n.drawLayer.draw({bbox:[0,0,1,1],root:{viewBox:"0 0 1 1",fill:f.color,"fill-opacity":f._defaultOpacity},rootClass:{highlight:!0,free:!0},path:{d:A.toSVGPath()}},!0,!0);ee(y=f,Tt,Kw).call(y,{highlightOutlines:A.getOutlines(),highlightId:F,clipPathId:D}),ee(_=f,Tt,oc).call(_),f.rotate(f.parentRotation)}return f}serialize(t=!1){if(this.isEmpty()||t)return null;if(this.deleted)return this.serializeDeleted();let n=mr._colorManager.convert(this._uiManager.getNonHCMColor(this.color)),i=super.serialize(t);return Object.assign(i,{color:n,opacity:this.opacity,thickness:l(this,ws),quadPoints:ee(this,Tt,t3).call(this),outlines:ee(this,Tt,r3).call(this,i.rect)}),this.addComment(i),this.annotationElementId&&!ee(this,Tt,s3).call(this,i)?null:(i.id=this.annotationElementId,i)}renderAnnotationElement(t){return this.deleted?(t.hide(),null):(t.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}static canCreateNewEmptyEditor(){return!1}};tp=new WeakMap,t0=new WeakMap,qa=new WeakMap,hf=new WeakMap,r0=new WeakMap,bi=new WeakMap,n0=new WeakMap,i0=new WeakMap,df=new WeakMap,$i=new WeakMap,zi=new WeakMap,Cn=new WeakMap,rp=new WeakMap,np=new WeakMap,zn=new WeakMap,ip=new WeakMap,ws=new WeakMap,s0=new WeakMap,Tt=new WeakSet,eT=function(){let t=new mm(l(this,qa),.001);L(this,$i,t.getOutlines()),[this.x,this.y,this.width,this.height]=l(this,$i).box;let n=new mm(l(this,qa),.0025,.001,this._uiManager.direction==="ltr");L(this,bi,n.getOutlines());let{firstPoint:i}=l(this,$i);L(this,rp,[(i[0]-this.x)/this.width,(i[1]-this.y)/this.height]);let{lastPoint:o}=l(this,bi);L(this,np,[(o[0]-this.x)/this.width,(o[1]-this.y)/this.height])},Kw=function({highlightOutlines:t,highlightId:n,clipPathId:i}){var p,m;if(L(this,$i,t),L(this,bi,t.getNewOutline(l(this,ws)/2+1.5,.0025)),n>=0)L(this,zi,n),L(this,hf,i),this.parent.drawLayer.finalizeDraw(n,{bbox:t.box,path:{d:t.toSVGPath()}}),L(this,zn,this.parent.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:!0},bbox:l(this,bi).box,path:{d:l(this,bi).toSVGPath()}},!0));else if(this.parent){let b=this.parent.viewport.rotation;this.parent.drawLayer.updateProperties(l(this,zi),{bbox:ee(p=qt,As,Lh).call(p,l(this,$i).box,(b-this.rotation+360)%360),path:{d:t.toSVGPath()}}),this.parent.drawLayer.updateProperties(l(this,zn),{bbox:ee(m=qt,As,Lh).call(m,l(this,bi).box,b),path:{d:l(this,bi).toSVGPath()}})}let[s,a,u,c]=t.box;switch(this.rotation){case 0:this.x=s,this.y=a,this.width=u,this.height=c;break;case 90:{let[b,v]=this.parentDimensions;this.x=a,this.y=1-s,this.width=u*v/b,this.height=c*b/v;break}case 180:this.x=1-s,this.y=1-a,this.width=u,this.height=c;break;case 270:{let[b,v]=this.parentDimensions;this.x=1-a,this.y=s,this.width=u*v/b,this.height=c*b/v;break}}let{firstPoint:f}=t;L(this,rp,[(f[0]-s)/u,(f[1]-a)/c]);let{lastPoint:h}=l(this,bi);L(this,np,[(h[0]-s)/u,(h[1]-a)/c])},ZF=function(t){let n=(s,a)=>{this.color=s,this.opacity=a,this.onUpdatedColor()},i=this.color,o=this.opacity;this.addCommands({cmd:n.bind(this,t,qt._defaultOpacity),undo:n.bind(this,i,o),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Mt.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.getNonHCMColorName(t)},!0)},JF=function(t){let n=l(this,ws),i=o=>{L(this,ws,o),ee(this,Tt,QF).call(this,o)};this.addCommands({cmd:i.bind(this,t),undo:i.bind(this,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Mt.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:t},!0)},QF=function(t){l(this,Cn)&&(ee(this,Tt,Kw).call(this,{highlightOutlines:l(this,$i).getNewOutline(t/2)}),this.fixAndSetPosition(),this.setDims())},tT=function(){l(this,zi)===null||!this.parent||(this.parent.drawLayer.remove(l(this,zi)),L(this,zi,null),this.parent.drawLayer.remove(l(this,zn)),L(this,zn,null))},oc=function(t=this.parent){l(this,zi)===null&&({id:tn(this,zi)._,clipPathId:tn(this,hf)._}=t.drawLayer.draw({bbox:l(this,$i).box,root:{viewBox:"0 0 1 1",fill:this.color,"fill-opacity":this.opacity},rootClass:{highlight:!0,free:l(this,Cn)},path:{d:l(this,$i).toSVGPath()}},!1,!0),L(this,zn,t.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:l(this,Cn)},bbox:l(this,bi).box,path:{d:l(this,bi).toSVGPath()}},l(this,Cn))),l(this,df)&&(l(this,df).style.clipPath=l(this,hf)))},As=new WeakSet,Lh=function([t,n,i,o],s){switch(s){case 90:return[1-n-o,t,o,i];case 180:return[1-t-i,1-n-o,i,o];case 270:return[n,1-t-i,o,i]}return[t,n,i,o]},e3=function(t){qt._keyboardManager.exec(this,t)},Zw=function(t){if(!l(this,tp))return;let n=window.getSelection();t?n.setPosition(l(this,tp),l(this,t0)):n.setPosition(l(this,n0),l(this,i0))},Jw=function(){return l(this,Cn)?this.rotation:0},t3=function(){if(l(this,Cn))return null;let[t,n]=this.pageDimensions,[i,o]=this.pageTranslation,s=l(this,qa),a=new Float32Array(s.length*8),u=0;for(let{x:c,y:f,width:h,height:p}of s){let m=c*t+i,b=(1-f)*n+o;a[u]=a[u+4]=m,a[u+1]=a[u+3]=b,a[u+2]=a[u+6]=m+h*t,a[u+5]=a[u+7]=b-p*n,u+=8}return a},r3=function(t){return l(this,$i).serialize(t,ee(this,Tt,Jw).call(this))},n3=function(t,n){this._freeHighlight.add(n)&&t.drawLayer.updateProperties(this._freeHighlightId,{path:{d:this._freeHighlight.toSVGPath()}})},i3=function(t,n){this._freeHighlight.isEmpty()?t.drawLayer.remove(this._freeHighlightId):t.createAndAddNewEditor(n,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""},s3=function(t){let{color:n}=this._initialData;return this.hasEditedComment||t.color.some((i,o)=>i!==n[o])},q(qt,As),Ke(qt,"_defaultColor",null),Ke(qt,"_defaultOpacity",1),Ke(qt,"_defaultThickness",12),Ke(qt,"_type","highlight"),Ke(qt,"_editorType",vt.HIGHLIGHT),Ke(qt,"_freeHighlightId",-1),Ke(qt,"_freeHighlight",null),Ke(qt,"_freeHighlightClipId","");Bv=qt,Fv=class{constructor(){q(this,pf,Object.create(null))}updateProperty(e,t){this[e]=t,this.updateSVGProperty(e,t)}updateProperties(e){if(e)for(let[t,n]of Object.entries(e))t.startsWith("_")||this.updateProperty(t,n)}updateSVGProperty(e,t){l(this,pf)[e]=t}toSVGProperties(){let e=l(this,pf);return L(this,pf,Object.create(null)),{root:e}}reset(){L(this,pf,Object.create(null))}updateAll(e=this){this.updateProperties(e)}clone(){dr("Not implemented")}};pf=new WeakMap;Pt=class Pt extends mr{constructor(t){super(t);q(this,jt);q(this,Wi,null);q(this,sp);Ke(this,"_colorPicker",null);Ke(this,"_drawId",null);L(this,sp,t.mustBeCommitted||!1),this._addOutlines(t)}onUpdatedColor(){this._colorPicker?.update(this.color),super.onUpdatedColor()}_addOutlines(t){t.drawOutlines&&(ee(this,jt,rT).call(this,t),ee(this,jt,Kg).call(this))}static _mergeSVGProperties(t,n){let i=new Set(Object.keys(t));for(let[o,s]of Object.entries(n))i.has(o)?Object.assign(t[o],s):t[o]=s;return t}static getDefaultDrawingOptions(t){dr("Not implemented")}static get typesMap(){dr("Not implemented")}static get isDrawer(){return!0}static get supportMultipleDrawings(){return!1}static updateDefaultParams(t,n){let i=this.typesMap.get(t);i&&this._defaultDrawingOptions.updateProperty(i,n),this._currentParent&&(l(Pt,yn).updateProperty(i,n),this._currentParent.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}updateParams(t,n){let i=this.constructor.typesMap.get(t);i&&this._updateProperty(t,i,n)}static get defaultPropertiesToUpdate(){let t=[],n=this._defaultDrawingOptions;for(let[i,o]of this.typesMap)t.push([i,n[o]]);return t}get propertiesToUpdate(){let t=[],{_drawingOptions:n}=this;for(let[i,o]of this.constructor.typesMap)t.push([i,n[o]]);return t}_updateProperty(t,n,i){let o=this._drawingOptions,s=o[n],a=u=>{o.updateProperty(n,u);let c=l(this,Wi).updateProperty(n,u);c&&ee(this,jt,Zg).call(this,c),this.parent?.drawLayer.updateProperties(this._drawId,o.toSVGProperties()),t===this.colorType&&this.onUpdatedColor()};this.addCommands({cmd:a.bind(this,i),undo:a.bind(this,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:t,overwriteIfSameType:!0,keepUndo:!0})}_onResizing(){this.parent?.drawLayer.updateProperties(this._drawId,Pt._mergeSVGProperties(l(this,Wi).getPathResizingSVGProperties(ee(this,jt,Qw).call(this)),{bbox:ee(this,jt,Ph).call(this)}))}_onResized(){this.parent?.drawLayer.updateProperties(this._drawId,Pt._mergeSVGProperties(l(this,Wi).getPathResizedSVGProperties(ee(this,jt,Qw).call(this)),{bbox:ee(this,jt,Ph).call(this)}))}_onTranslating(t,n){this.parent?.drawLayer.updateProperties(this._drawId,{bbox:ee(this,jt,Ph).call(this)})}_onTranslated(){this.parent?.drawLayer.updateProperties(this._drawId,Pt._mergeSVGProperties(l(this,Wi).getPathTranslatedSVGProperties(ee(this,jt,Qw).call(this),this.parentDimensions),{bbox:ee(this,jt,Ph).call(this)}))}_onStartDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!0}})}_onStopDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!1}})}commit(){super.commit(),this.disableEditMode(),this.disableEditing()}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}getBaseTranslation(){return[0,0]}get isResizable(){return!0}onceAdded(t){this.annotationElementId||this.parent.addUndoableEditor(this),this._isDraggable=!0,l(this,sp)&&(L(this,sp,!1),this.commit(),this.parent.setSelected(this),t&&this.isOnScreen&&this.div.focus())}remove(){ee(this,jt,iT).call(this),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(ee(this,jt,Kg).call(this),ee(this,jt,Zg).call(this,l(this,Wi).box),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){let n=!1;this.parent&&!t?(this._uiManager.removeShouldRescale(this),ee(this,jt,iT).call(this)):t&&(this._uiManager.addShouldRescale(this),ee(this,jt,Kg).call(this,t),n=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(t),n&&this.select()}rotate(){this.parent&&this.parent.drawLayer.updateProperties(this._drawId,Pt._mergeSVGProperties({bbox:ee(this,jt,Ph).call(this)},l(this,Wi).updateRotation((this.parentRotation-this.rotation+360)%360)))}onScaleChanging(){this.parent&&ee(this,jt,Zg).call(this,l(this,Wi).updateParentDimensions(this.parentDimensions,this.parent.scale))}static onScaleChangingWhenDrawing(){}render(){if(this.div)return this.div;let t,n;this._isCopy&&(t=this.x,n=this.y);let i=super.render();i.classList.add("draw");let o=document.createElement("div");return i.append(o),o.setAttribute("aria-hidden","true"),o.className="internal",this.setDims(),this._uiManager.addShouldRescale(this),this.disableEditing(),this._isCopy&&this._moveAfterPaste(t,n),i}static createDrawerInstance(t,n,i,o,s){dr("Not implemented")}static startDrawing(t,n,i,o){let{target:s,offsetX:a,offsetY:u,pointerId:c,pointerType:f}=o;if(Bn.isInitializedAndDifferentPointerType(f))return;let{viewport:{rotation:h}}=t,{width:p,height:m}=s.getBoundingClientRect(),b=L(Pt,gf,new AbortController),v=t.combinedSignal(b);if(Bn.setPointer(f,c),window.addEventListener("pointerup",w=>{Bn.isSamePointerIdOrRemove(w.pointerId)&&this._endDraw(w)},{signal:v}),window.addEventListener("pointercancel",w=>{Bn.isSamePointerIdOrRemove(w.pointerId)&&this._currentParent.endDrawingSession()},{signal:v}),window.addEventListener("pointerdown",w=>{Bn.isSamePointerType(w.pointerType)&&(Bn.initializeAndAddPointerId(w.pointerId),l(Pt,yn).isCancellable()&&(l(Pt,yn).removeLastElement(),l(Pt,yn).isEmpty()?this._currentParent.endDrawingSession(!0):this._endDraw(null)))},{capture:!0,passive:!1,signal:v}),window.addEventListener("contextmenu",Ki,{signal:v}),s.addEventListener("pointermove",this._drawMove.bind(this),{signal:v}),s.addEventListener("touchmove",w=>{Bn.isSameTimeStamp(w.timeStamp)&&Cr(w)},{signal:v}),t.toggleDrawing(),n._editorUndoBar?.hide(),l(Pt,yn)){t.drawLayer.updateProperties(this._currentDrawId,l(Pt,yn).startNew(a,u,p,m,h));return}n.updateUIForDefaultProperties(this),L(Pt,yn,this.createDrawerInstance(a,u,p,m,h)),L(Pt,mf,this.getDefaultDrawingOptions()),this._currentParent=t,{id:this._currentDrawId}=t.drawLayer.draw(this._mergeSVGProperties(l(Pt,mf).toSVGProperties(),l(Pt,yn).defaultSVGProperties),!0,!1)}static _drawMove(t){if(Bn.isSameTimeStamp(t.timeStamp),!l(Pt,yn))return;let{offsetX:n,offsetY:i,pointerId:o}=t;if(Bn.isSamePointerId(o)){if(Bn.isUsingMultiplePointers()){this._endDraw(t);return}this._currentParent.drawLayer.updateProperties(this._currentDrawId,l(Pt,yn).add(n,i)),Bn.setTimeStamp(t.timeStamp),Cr(t)}}static _cleanup(t){t&&(this._currentDrawId=-1,this._currentParent=null,L(Pt,yn,null),L(Pt,mf,null),Bn.clearTimeStamp()),l(Pt,gf)&&(l(Pt,gf).abort(),L(Pt,gf,null),Bn.clearPointerIds())}static _endDraw(t){let n=this._currentParent;if(n){if(n.toggleDrawing(!0),this._cleanup(!1),t?.target===n.div&&n.drawLayer.updateProperties(this._currentDrawId,l(Pt,yn).end(t.offsetX,t.offsetY)),this.supportMultipleDrawings){let i=l(Pt,yn),o=this._currentDrawId,s=i.getLastElement();n.addCommands({cmd:()=>{n.drawLayer.updateProperties(o,i.setLastElement(s))},undo:()=>{n.drawLayer.updateProperties(o,i.removeLastElement())},mustExec:!1,type:Mt.DRAW_STEP});return}this.endDrawing(!1)}}static endDrawing(t){let n=this._currentParent;if(!n)return null;if(n.toggleDrawing(!0),n.cleanUndoStack(Mt.DRAW_STEP),!l(Pt,yn).isEmpty()){let{pageDimensions:[i,o],scale:s}=n,a=n.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,drawOutlines:l(Pt,yn).getOutlines(i*s,o*s,s,this._INNER_MARGIN),drawingOptions:l(Pt,mf),mustBeCommitted:!t});return this._cleanup(!0),a}return n.drawLayer.remove(this._currentDrawId),this._cleanup(!0),null}createDrawingOptions(t){}static deserializeDraw(t,n,i,o,s,a){dr("Not implemented")}static async deserialize(t,n,i){var h,p;let{rawDims:{pageWidth:o,pageHeight:s,pageX:a,pageY:u}}=n.viewport,c=this.deserializeDraw(a,u,o,s,this._INNER_MARGIN,t),f=await super.deserialize(t,n,i);return f.createDrawingOptions(t),ee(h=f,jt,rT).call(h,{drawOutlines:c}),ee(p=f,jt,Kg).call(p),f.onScaleChanging(),f.rotate(),f}serializeDraw(t){let[n,i]=this.pageTranslation,[o,s]=this.pageDimensions;return l(this,Wi).serialize([n,i,o,s],t)}renderAnnotationElement(t){return t.updateEdited({rect:this.getPDFRect()}),null}static canCreateNewEmptyEditor(){return!1}};Wi=new WeakMap,sp=new WeakMap,yn=new WeakMap,gf=new WeakMap,mf=new WeakMap,jt=new WeakSet,rT=function({drawOutlines:t,drawId:n,drawingOptions:i}){L(this,Wi,t),this._drawingOptions||(this._drawingOptions=i),this.annotationElementId||this._uiManager.a11yAlert(`pdfjs-editor-${this.editorType}-added-alert`),n>=0?(this._drawId=n,this.parent.drawLayer.finalizeDraw(n,t.defaultProperties)):this._drawId=ee(this,jt,nT).call(this,t,this.parent),ee(this,jt,Zg).call(this,t.box)},nT=function(t,n){let{id:i}=n.drawLayer.draw(Pt._mergeSVGProperties(this._drawingOptions.toSVGProperties(),t.defaultSVGProperties),!1,!1);return i},iT=function(){this._drawId===null||!this.parent||(this.parent.drawLayer.remove(this._drawId),this._drawId=null,this._drawingOptions.reset())},Kg=function(t=this.parent){if(!(this._drawId!==null&&this.parent===t)){if(this._drawId!==null){this.parent.drawLayer.updateParent(this._drawId,t.drawLayer);return}this._drawingOptions.updateAll(),this._drawId=ee(this,jt,nT).call(this,l(this,Wi),t)}},o3=function([t,n,i,o]){let{parentDimensions:[s,a],rotation:u}=this;switch(u){case 90:return[n,1-t,i*(a/s),o*(s/a)];case 180:return[1-t,1-n,i,o];case 270:return[1-n,t,i*(a/s),o*(s/a)];default:return[t,n,i,o]}},Qw=function(){let{x:t,y:n,width:i,height:o,parentDimensions:[s,a],rotation:u}=this;switch(u){case 90:return[1-n,t,i*(s/a),o*(a/s)];case 180:return[1-t,1-n,i,o];case 270:return[n,1-t,i*(s/a),o*(a/s)];default:return[t,n,i,o]}},Zg=function(t){[this.x,this.y,this.width,this.height]=ee(this,jt,o3).call(this,t),this.div&&(this.fixAndSetPosition(),this.setDims()),this._onResized()},Ph=function(){let{x:t,y:n,width:i,height:o,rotation:s,parentRotation:a,parentDimensions:[u,c]}=this;switch((s*4+a)/90){case 1:return[1-n-o,t,o,i];case 2:return[1-t-i,1-n-o,i,o];case 3:return[n,1-t-i,o,i];case 4:return[t,n-i*(u/c),o*(c/u),i*(u/c)];case 5:return[1-n,t,i*(u/c),o*(c/u)];case 6:return[1-t-o*(c/u),1-n,o*(c/u),i*(u/c)];case 7:return[n-i*(u/c),1-t-o*(c/u),i*(u/c),o*(c/u)];case 8:return[t-i,n-o,i,o];case 9:return[1-n,t-i,o,i];case 10:return[1-t,1-n,i,o];case 11:return[n-o,1-t,o,i];case 12:return[t-o*(c/u),n,o*(c/u),i*(u/c)];case 13:return[1-n-i*(u/c),t-o*(c/u),i*(u/c),o*(c/u)];case 14:return[1-t,1-n-i*(u/c),o*(c/u),i*(u/c)];case 15:return[n,1-t,i*(u/c),o*(c/u)];default:return[t,n,i,o]}},Ke(Pt,"_currentDrawId",-1),Ke(Pt,"_currentParent",null),q(Pt,yn,null),q(Pt,gf,null),q(Pt,mf,null),Ke(Pt,"_INNER_MARGIN",3);Uv=Pt,sT=class{constructor(e,t,n,i,o,s){q(this,ap);q(this,No,new Float64Array(6));q(this,bn);q(this,wn);q(this,yf);q(this,op);q(this,Kn);q(this,Rn,"");q(this,vs,0);q(this,bf,new Nf);q(this,wf);q(this,vf);L(this,wf,n),L(this,vf,i),L(this,yf,o),L(this,op,s),[e,t]=ee(this,ap,ev).call(this,e,t);let a=L(this,bn,[NaN,NaN,NaN,NaN,e,t]);L(this,Kn,[e,t]),L(this,wn,[{line:a,points:l(this,Kn)}]),l(this,No).set(a,0)}updateProperty(e,t){e==="stroke-width"&&L(this,op,t)}isEmpty(){return!l(this,wn)||l(this,wn).length===0}isCancellable(){return l(this,Kn).length<=10}add(e,t){[e,t]=ee(this,ap,ev).call(this,e,t);let[n,i,o,s]=l(this,No).subarray(2,6),a=e-o,u=t-s;return Math.hypot(l(this,wf)*a,l(this,vf)*u)<=2?null:(l(this,Kn).push(e,t),isNaN(n)?(l(this,No).set([o,s,e,t],2),l(this,bn).push(NaN,NaN,NaN,NaN,e,t),{path:{d:this.toSVGPath()}}):(isNaN(l(this,No)[0])&&l(this,bn).splice(6,6),l(this,No).set([n,i,o,s,e,t],0),l(this,bn).push(...at.createBezierPoints(n,i,o,s,e,t)),{path:{d:this.toSVGPath()}}))}end(e,t){let n=this.add(e,t);return n||(l(this,Kn).length===2?{path:{d:this.toSVGPath()}}:null)}startNew(e,t,n,i,o){L(this,wf,n),L(this,vf,i),L(this,yf,o),[e,t]=ee(this,ap,ev).call(this,e,t);let s=L(this,bn,[NaN,NaN,NaN,NaN,e,t]);L(this,Kn,[e,t]);let a=l(this,wn).at(-1);return a&&(a.line=new Float32Array(a.line),a.points=new Float32Array(a.points)),l(this,wn).push({line:s,points:l(this,Kn)}),l(this,No).set(s,0),L(this,vs,0),this.toSVGPath(),null}getLastElement(){return l(this,wn).at(-1)}setLastElement(e){return l(this,wn)?(l(this,wn).push(e),L(this,bn,e.line),L(this,Kn,e.points),L(this,vs,0),{path:{d:this.toSVGPath()}}):l(this,bf).setLastElement(e)}removeLastElement(){if(!l(this,wn))return l(this,bf).removeLastElement();l(this,wn).pop(),L(this,Rn,"");for(let e=0,t=l(this,wn).length;e<t;e++){let{line:n,points:i}=l(this,wn)[e];L(this,bn,n),L(this,Kn,i),L(this,vs,0),this.toSVGPath()}return{path:{d:l(this,Rn)}}}toSVGPath(){let e=at.svgRound(l(this,bn)[4]),t=at.svgRound(l(this,bn)[5]);if(l(this,Kn).length===2)return L(this,Rn,`${l(this,Rn)} M ${e} ${t} Z`),l(this,Rn);if(l(this,Kn).length<=6){let i=l(this,Rn).lastIndexOf("M");L(this,Rn,`${l(this,Rn).slice(0,i)} M ${e} ${t}`),L(this,vs,6)}if(l(this,Kn).length===4){let i=at.svgRound(l(this,bn)[10]),o=at.svgRound(l(this,bn)[11]);return L(this,Rn,`${l(this,Rn)} L ${i} ${o}`),L(this,vs,12),l(this,Rn)}let n=[];l(this,vs)===0&&(n.push(`M ${e} ${t}`),L(this,vs,6));for(let i=l(this,vs),o=l(this,bn).length;i<o;i+=6){let[s,a,u,c,f,h]=l(this,bn).slice(i,i+6).map(at.svgRound);n.push(`C${s} ${a} ${u} ${c} ${f} ${h}`)}return L(this,Rn,l(this,Rn)+n.join(" ")),L(this,vs,l(this,bn).length),l(this,Rn)}getOutlines(e,t,n,i){let o=l(this,wn).at(-1);return o.line=new Float32Array(o.line),o.points=new Float32Array(o.points),l(this,bf).build(l(this,wn),e,t,n,l(this,yf),l(this,op),i),L(this,No,null),L(this,bn,null),L(this,wn,null),L(this,Rn,null),l(this,bf)}get defaultSVGProperties(){return{root:{viewBox:"0 0 10000 10000"},rootClass:{draw:!0},bbox:[0,0,1,1]}}};No=new WeakMap,bn=new WeakMap,wn=new WeakMap,yf=new WeakMap,op=new WeakMap,Kn=new WeakMap,Rn=new WeakMap,vs=new WeakMap,bf=new WeakMap,wf=new WeakMap,vf=new WeakMap,ap=new WeakSet,ev=function(e,t){return at._normalizePoint(e,t,l(this,wf),l(this,vf),l(this,yf))};Nf=class extends at{constructor(){super(...arguments);q(this,In);q(this,Zn);q(this,o0,0);q(this,a0);q(this,qi);q(this,ko);q(this,Lo);q(this,lp);q(this,up);q(this,_f)}build(t,n,i,o,s,a,u){L(this,ko,n),L(this,Lo,i),L(this,lp,o),L(this,up,s),L(this,_f,a),L(this,a0,u??0),L(this,qi,t),ee(this,In,l3).call(this)}get thickness(){return l(this,_f)}setLastElement(t){return l(this,qi).push(t),{path:{d:this.toSVGPath()}}}removeLastElement(){return l(this,qi).pop(),{path:{d:this.toSVGPath()}}}toSVGPath(){let t=[];for(let{line:n}of l(this,qi)){if(t.push(`M${at.svgRound(n[4])} ${at.svgRound(n[5])}`),n.length===6){t.push("Z");continue}if(n.length===12&&isNaN(n[6])){t.push(`L${at.svgRound(n[10])} ${at.svgRound(n[11])}`);continue}for(let i=6,o=n.length;i<o;i+=6){let[s,a,u,c,f,h]=n.subarray(i,i+6).map(at.svgRound);t.push(`C${s} ${a} ${u} ${c} ${f} ${h}`)}}return t.join("")}serialize([t,n,i,o],s){let a=[],u=[],[c,f,h,p]=ee(this,In,a3).call(this),m,b,v,w,y,_,E,S,A;switch(l(this,up)){case 0:A=at._rescale,m=t,b=n+o,v=i,w=-o,y=t+c*i,_=n+(1-f-p)*o,E=t+(c+h)*i,S=n+(1-f)*o;break;case 90:A=at._rescaleAndSwap,m=t,b=n,v=i,w=o,y=t+f*i,_=n+c*o,E=t+(f+p)*i,S=n+(c+h)*o;break;case 180:A=at._rescale,m=t+i,b=n,v=-i,w=o,y=t+(1-c-h)*i,_=n+f*o,E=t+(1-c)*i,S=n+(f+p)*o;break;case 270:A=at._rescaleAndSwap,m=t+i,b=n+o,v=-i,w=-o,y=t+(1-f-p)*i,_=n+(1-c-h)*o,E=t+(1-f)*i,S=n+(1-c)*o;break}for(let{line:F,points:D}of l(this,qi))a.push(A(F,m,b,v,w,s?new Array(F.length):null)),u.push(A(D,m,b,v,w,s?new Array(D.length):null));return{lines:a,points:u,rect:[y,_,E,S]}}static deserialize(t,n,i,o,s,{paths:{lines:a,points:u},rotation:c,thickness:f}){let h=[],p,m,b,v,w;switch(c){case 0:w=at._rescale,p=-t/i,m=n/o+1,b=1/i,v=-1/o;break;case 90:w=at._rescaleAndSwap,p=-n/o,m=-t/i,b=1/o,v=1/i;break;case 180:w=at._rescale,p=t/i+1,m=-n/o,b=-1/i,v=1/o;break;case 270:w=at._rescaleAndSwap,p=n/o+1,m=t/i+1,b=-1/o,v=-1/i;break}if(!a){a=[];for(let _ of u){let E=_.length;if(E===2){a.push(new Float32Array([NaN,NaN,NaN,NaN,_[0],_[1]]));continue}if(E===4){a.push(new Float32Array([NaN,NaN,NaN,NaN,_[0],_[1],NaN,NaN,NaN,NaN,_[2],_[3]]));continue}let S=new Float32Array(3*(E-2));a.push(S);let[A,F,D,H]=_.subarray(0,4);S.set([NaN,NaN,NaN,NaN,A,F],0);for(let J=4;J<E;J+=2){let K=_[J],ne=_[J+1];S.set(at.createBezierPoints(A,F,D,H,K,ne),(J-2)*3),[A,F,D,H]=[D,H,K,ne]}}}for(let _=0,E=a.length;_<E;_++)h.push({line:w(a[_].map(S=>S??NaN),p,m,b,v),points:w(u[_].map(S=>S??NaN),p,m,b,v)});let y=new this.prototype.constructor;return y.build(h,i,o,1,c,f,s),y}get box(){return l(this,Zn)}updateProperty(t,n){return t==="stroke-width"?ee(this,In,u3).call(this,n):null}updateParentDimensions([t,n],i){let[o,s]=ee(this,In,da).call(this);L(this,ko,t),L(this,Lo,n),L(this,lp,i);let[a,u]=ee(this,In,da).call(this),c=a-o,f=u-s,h=l(this,Zn);return h[0]-=c,h[1]-=f,h[2]+=2*c,h[3]+=2*f,h}updateRotation(t){return L(this,o0,t),{path:{transform:this.rotationTransform}}}get viewBox(){return l(this,Zn).map(at.svgRound).join(" ")}get defaultProperties(){let[t,n]=l(this,Zn);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${at.svgRound(t)} ${at.svgRound(n)}`}}}get rotationTransform(){let[,,t,n]=l(this,Zn),i=0,o=0,s=0,a=0,u=0,c=0;switch(l(this,o0)){case 90:o=n/t,s=-t/n,u=t;break;case 180:i=-1,a=-1,u=t,c=n;break;case 270:o=-n/t,s=t/n,c=n;break;default:return""}return`matrix(${i} ${o} ${s} ${a} ${at.svgRound(u)} ${at.svgRound(c)})`}getPathResizingSVGProperties([t,n,i,o]){let[s,a]=ee(this,In,da).call(this),[u,c,f,h]=l(this,Zn);if(Math.abs(f-s)<=at.PRECISION||Math.abs(h-a)<=at.PRECISION){let w=t+i/2-(u+f/2),y=n+o/2-(c+h/2);return{path:{"transform-origin":`${at.svgRound(t)} ${at.svgRound(n)}`,transform:`${this.rotationTransform} translate(${w} ${y})`}}}let p=(i-2*s)/(f-2*s),m=(o-2*a)/(h-2*a),b=f/i,v=h/o;return{path:{"transform-origin":`${at.svgRound(u)} ${at.svgRound(c)}`,transform:`${this.rotationTransform} scale(${b} ${v}) translate(${at.svgRound(s)} ${at.svgRound(a)}) scale(${p} ${m}) translate(${at.svgRound(-s)} ${at.svgRound(-a)})`}}}getPathResizedSVGProperties([t,n,i,o]){let[s,a]=ee(this,In,da).call(this),u=l(this,Zn),[c,f,h,p]=u;if(u[0]=t,u[1]=n,u[2]=i,u[3]=o,Math.abs(h-s)<=at.PRECISION||Math.abs(p-a)<=at.PRECISION){let y=t+i/2-(c+h/2),_=n+o/2-(f+p/2);for(let{line:E,points:S}of l(this,qi))at._translate(E,y,_,E),at._translate(S,y,_,S);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${at.svgRound(t)} ${at.svgRound(n)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}let m=(i-2*s)/(h-2*s),b=(o-2*a)/(p-2*a),v=-m*(c+s)+t+s,w=-b*(f+a)+n+a;if(m!==1||b!==1||v!==0||w!==0)for(let{line:y,points:_}of l(this,qi))at._rescale(y,v,w,m,b,y),at._rescale(_,v,w,m,b,_);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${at.svgRound(t)} ${at.svgRound(n)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}getPathTranslatedSVGProperties([t,n],i){let[o,s]=i,a=l(this,Zn),u=t-a[0],c=n-a[1];if(l(this,ko)===o&&l(this,Lo)===s)for(let{line:f,points:h}of l(this,qi))at._translate(f,u,c,f),at._translate(h,u,c,h);else{let f=l(this,ko)/o,h=l(this,Lo)/s;L(this,ko,o),L(this,Lo,s);for(let{line:p,points:m}of l(this,qi))at._rescale(p,u,c,f,h,p),at._rescale(m,u,c,f,h,m);a[2]*=f,a[3]*=h}return a[0]=t,a[1]=n,{root:{viewBox:this.viewBox},path:{d:this.toSVGPath(),"transform-origin":`${at.svgRound(t)} ${at.svgRound(n)}`}}}get defaultSVGProperties(){let t=l(this,Zn);return{root:{viewBox:this.viewBox},rootClass:{draw:!0},path:{d:this.toSVGPath(),"transform-origin":`${at.svgRound(t[0])} ${at.svgRound(t[1])}`,transform:this.rotationTransform||null},bbox:t}}};Zn=new WeakMap,o0=new WeakMap,a0=new WeakMap,qi=new WeakMap,ko=new WeakMap,Lo=new WeakMap,lp=new WeakMap,up=new WeakMap,_f=new WeakMap,In=new WeakSet,da=function(t=l(this,_f)){let n=l(this,a0)+t/2*l(this,lp);return l(this,up)%180===0?[n/l(this,ko),n/l(this,Lo)]:[n/l(this,Lo),n/l(this,ko)]},a3=function(){let[t,n,i,o]=l(this,Zn),[s,a]=ee(this,In,da).call(this,0);return[t+s,n+a,i-2*s,o-2*a]},l3=function(){let t=L(this,Zn,new Float32Array([1/0,1/0,-1/0,-1/0]));for(let{line:o}of l(this,qi)){if(o.length<=12){for(let u=4,c=o.length;u<c;u+=6)nt.pointBoundingBox(o[u],o[u+1],t);continue}let s=o[4],a=o[5];for(let u=6,c=o.length;u<c;u+=6){let[f,h,p,m,b,v]=o.subarray(u,u+6);nt.bezierBoundingBox(s,a,f,h,p,m,b,v,t),s=b,a=v}}let[n,i]=ee(this,In,da).call(this);t[0]=Wn(t[0]-n,0,1),t[1]=Wn(t[1]-i,0,1),t[2]=Wn(t[2]+n,0,1),t[3]=Wn(t[3]+i,0,1),t[2]-=t[0],t[3]-=t[1]},u3=function(t){let[n,i]=ee(this,In,da).call(this);L(this,_f,t);let[o,s]=ee(this,In,da).call(this),[a,u]=[o-n,s-i],c=l(this,Zn);return c[0]-=a,c[1]-=u,c[2]+=2*a,c[3]+=2*u,c};jv=class r extends Fv{constructor(e){super(),this._viewParameters=e,super.updateProperties({fill:"none",stroke:mr._defaultLineColor,"stroke-opacity":1,"stroke-width":1,"stroke-linecap":"round","stroke-linejoin":"round","stroke-miterlimit":10})}updateSVGProperty(e,t){e==="stroke-width"&&(t??(t=this["stroke-width"]),t*=this._viewParameters.realScale),super.updateSVGProperty(e,t)}clone(){let e=new r(this._viewParameters);return e.updateAll(this),e}},zh=class zh extends Uv{constructor(t){super({...t,name:"inkEditor"});q(this,o_);this._willKeepAspectRatio=!0,this.defaultL10nId="pdfjs-editor-ink-editor"}static initialize(t,n){mr.initialize(t,n),this._defaultDrawingOptions=new jv(n.viewParameters)}static getDefaultDrawingOptions(t){let n=this._defaultDrawingOptions.clone();return n.updateProperties(t),n}static get supportMultipleDrawings(){return!0}static get typesMap(){return wt(this,"typesMap",new Map([[Mt.INK_THICKNESS,"stroke-width"],[Mt.INK_COLOR,"stroke"],[Mt.INK_OPACITY,"stroke-opacity"]]))}static createDrawerInstance(t,n,i,o,s){return new sT(t,n,i,o,s,this._defaultDrawingOptions["stroke-width"])}static deserializeDraw(t,n,i,o,s,a){return Nf.deserialize(t,n,i,o,s,a)}static async deserialize(t,n,i){let o=null;if(t instanceof gm){let{data:{inkLists:a,rect:u,rotation:c,id:f,color:h,opacity:p,borderStyle:{rawWidth:m},popupRef:b,richText:v,contentsObj:w,creationDate:y,modificationDate:_},parent:{page:{pageNumber:E}}}=t;o=t={annotationType:vt.INK,color:Array.from(h),thickness:m,opacity:p,paths:{points:a},boxes:null,pageIndex:E-1,rect:u.slice(0),rotation:c,annotationElementId:f,id:f,deleted:!1,popupRef:b,richText:v,comment:w?.str||null,creationDate:y,modificationDate:_}}let s=await super.deserialize(t,n,i);return s._initialData=o,t.comment&&s.setCommentData(t),s}get toolbarButtons(){return this._colorPicker||(this._colorPicker=new Cv(this)),[["colorPicker",this._colorPicker]]}get colorType(){return Mt.INK_COLOR}get color(){return this._drawingOptions.stroke}get opacity(){return this._drawingOptions["stroke-opacity"]}onScaleChanging(){if(!this.parent)return;super.onScaleChanging();let{_drawId:t,_drawingOptions:n,parent:i}=this;n.updateSVGProperty("stroke-width"),i.drawLayer.updateProperties(t,n.toSVGProperties())}static onScaleChangingWhenDrawing(){let t=this._currentParent;t&&(super.onScaleChangingWhenDrawing(),this._defaultDrawingOptions.updateSVGProperty("stroke-width"),t.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}createDrawingOptions({color:t,thickness:n,opacity:i}){this._drawingOptions=zh.getDefaultDrawingOptions({stroke:nt.makeHexColor(...t),"stroke-width":n,"stroke-opacity":i})}serialize(t=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();let{lines:n,points:i}=this.serializeDraw(t),{_drawingOptions:{stroke:o,"stroke-opacity":s,"stroke-width":a}}=this,u=Object.assign(super.serialize(t),{color:mr._colorManager.convert(o),opacity:s,thickness:a,paths:{lines:n,points:i}});return this.addComment(u),t?(u.isCopy=!0,u):this.annotationElementId&&!ee(this,o_,c3).call(this,u)?null:(u.id=this.annotationElementId,u)}renderAnnotationElement(t){if(this.deleted)return t.hide(),null;let{points:n,rect:i}=this.serializeDraw(!1);return t.updateEdited({rect:i,thickness:this._drawingOptions["stroke-width"],points:n,popup:this.comment}),null}};o_=new WeakSet,c3=function(t){let{color:n,thickness:i,opacity:o,pageIndex:s}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized||t.color.some((a,u)=>a!==n[u])||t.thickness!==i||t.opacity!==o||t.pageIndex!==s},Ke(zh,"_type","ink"),Ke(zh,"_editorType",vt.INK),Ke(zh,"_defaultDrawingOptions",null);oT=zh,bm=class extends Nf{toSVGPath(){let e=super.toSVGPath();return e.endsWith("Z")||(e+="Z"),e}},Sw=8,kg=3,Es=class{static extractContoursFromText(e,{fontFamily:t,fontStyle:n,fontWeight:i},o,s,a,u){let c=new OffscreenCanvas(1,1),f=c.getContext("2d",{alpha:!1}),h=200,p=f.font=`${n} ${i} ${h}px ${t}`,{actualBoundingBoxLeft:m,actualBoundingBoxRight:b,actualBoundingBoxAscent:v,actualBoundingBoxDescent:w,fontBoundingBoxAscent:y,fontBoundingBoxDescent:_,width:E}=f.measureText(e),S=1.5,A=Math.ceil(Math.max(Math.abs(m)+Math.abs(b)||0,E)*S),F=Math.ceil(Math.max(Math.abs(v)+Math.abs(w)||h,Math.abs(y)+Math.abs(_)||h)*S);c=new OffscreenCanvas(A,F),f=c.getContext("2d",{alpha:!0,willReadFrequently:!0}),f.font=p,f.filter="grayscale(1)",f.fillStyle="white",f.fillRect(0,0,A,F),f.fillStyle="black",f.fillText(e,A*(S-1)/2,F*(3-S)/2);let D=ee(this,Vt,uT).call(this,f.getImageData(0,0,A,F).data),H=ee(this,Vt,g3).call(this,D),J=ee(this,Vt,cT).call(this,H),K=ee(this,Vt,lT).call(this,D,A,F,J);return this.processDrawnLines({lines:{curves:K,width:A,height:F},pageWidth:o,pageHeight:s,rotation:a,innerMargin:u,mustSmooth:!0,areContours:!0})}static process(e,t,n,i,o){let[s,a,u]=ee(this,Vt,m3).call(this,e),[c,f]=ee(this,Vt,p3).call(this,s,a,u,Math.hypot(a,u)*l(this,Ef).sigmaSFactor,l(this,Ef).sigmaR,l(this,Ef).kernelSize),h=ee(this,Vt,cT).call(this,f),p=ee(this,Vt,lT).call(this,c,a,u,h);return this.processDrawnLines({lines:{curves:p,width:a,height:u},pageWidth:t,pageHeight:n,rotation:i,innerMargin:o,mustSmooth:!0,areContours:!0})}static processDrawnLines({lines:e,pageWidth:t,pageHeight:n,rotation:i,innerMargin:o,mustSmooth:s,areContours:a}){i%180!==0&&([t,n]=[n,t]);let{curves:u,width:c,height:f}=e,h=e.thickness??0,p=[],m=Math.min(t/c,n/f),b=m/t,v=m/n,w=[];for(let{points:_}of u){let E=s?ee(this,Vt,d3).call(this,_):_;if(!E)continue;w.push(E);let S=E.length,A=new Float32Array(S),F=new Float32Array(3*(S===2?2:S-2));if(p.push({line:F,points:A}),S===2){A[0]=E[0]*b,A[1]=E[1]*v,F.set([NaN,NaN,NaN,NaN,A[0],A[1]],0);continue}let[D,H,J,K]=E;D*=b,H*=v,J*=b,K*=v,A.set([D,H,J,K],0),F.set([NaN,NaN,NaN,NaN,D,H],0);for(let ne=4;ne<S;ne+=2){let k=A[ne]=E[ne]*b,$=A[ne+1]=E[ne+1]*v;F.set(at.createBezierPoints(D,H,J,K,k,$),(ne-2)*3),[D,H,J,K]=[J,K,k,$]}}if(p.length===0)return null;let y=a?new bm:new Nf;return y.build(p,t,n,1,i,a?0:h,o),{outline:y,newCurves:w,areContours:a,thickness:h,width:c,height:f}}static async compressSignature({outlines:e,areContours:t,thickness:n,width:i,height:o}){let s=1/0,a=-1/0,u=0;for(let E of e){u+=E.length;for(let S=2,A=E.length;S<A;S++){let F=E[S]-E[S-2];s=Math.min(s,F),a=Math.max(a,F)}}let c;s>=-128&&a<=127?c=Int8Array:s>=-32768&&a<=32767?c=Int16Array:c=Int32Array;let f=e.length,h=Sw+kg*f,p=new Uint32Array(h),m=0;p[m++]=h*Uint32Array.BYTES_PER_ELEMENT+(u-2*f)*c.BYTES_PER_ELEMENT,p[m++]=0,p[m++]=i,p[m++]=o,p[m++]=t?0:1,p[m++]=Math.max(0,Math.floor(n??0)),p[m++]=f,p[m++]=c.BYTES_PER_ELEMENT;for(let E of e)p[m++]=E.length-2,p[m++]=E[0],p[m++]=E[1];let b=new CompressionStream("deflate-raw"),v=b.writable.getWriter();await v.ready,v.write(p);let w=c.prototype.constructor;for(let E of e){let S=new w(E.length-2);for(let A=2,F=E.length;A<F;A++)S[A-2]=E[A]-E[A-2];v.write(S)}v.close();let y=await new Response(b.readable).arrayBuffer(),_=new Uint8Array(y);return xB(_)}static async decompressSignature(e){try{let t=JG(e),{readable:n,writable:i}=new DecompressionStream("deflate-raw"),o=i.getWriter();await o.ready,o.write(t).then(async()=>{await o.ready,await o.close()}).catch(()=>{});let s=null,a=0;for await(let E of n)s||(s=new Uint8Array(new Uint32Array(E.buffer,0,4)[0])),s.set(E,a),a+=E.length;let u=new Uint32Array(s.buffer,0,s.length>>2),c=u[1];if(c!==0)throw new Error(`Invalid version: ${c}`);let f=u[2],h=u[3],p=u[4]===0,m=u[5],b=u[6],v=u[7],w=[],y=(Sw+kg*b)*Uint32Array.BYTES_PER_ELEMENT,_;switch(v){case Int8Array.BYTES_PER_ELEMENT:_=new Int8Array(s.buffer,y);break;case Int16Array.BYTES_PER_ELEMENT:_=new Int16Array(s.buffer,y);break;case Int32Array.BYTES_PER_ELEMENT:_=new Int32Array(s.buffer,y);break}a=0;for(let E=0;E<b;E++){let S=u[kg*E+Sw],A=new Float32Array(S+2);w.push(A);for(let F=0;F<kg-1;F++)A[F]=u[kg*E+Sw+F+1];for(let F=0;F<S;F++)A[F+2]=A[F]+_[a++]}return{areContours:p,thickness:m,outlines:w,width:f,height:h}}catch(t){return _t(`decompressSignature: ${t}`),null}}};Ef=new WeakMap,Vt=new WeakSet,aT=function(e,t,n,i){return n-=e,i-=t,n===0?i>0?0:4:n===1?i+6:2-i},qs=new WeakMap,f3=function(e,t,n,i,o,s,a){let u=ee(this,Vt,aT).call(this,n,i,o,s);for(let c=0;c<8;c++){let f=(-c+u-a+16)%8,h=l(this,qs)[2*f],p=l(this,qs)[2*f+1];if(e[(n+h)*t+(i+p)]!==0)return f}return-1},h3=function(e,t,n,i,o,s,a){let u=ee(this,Vt,aT).call(this,n,i,o,s);for(let c=0;c<8;c++){let f=(c+u+a+16)%8,h=l(this,qs)[2*f],p=l(this,qs)[2*f+1];if(e[(n+h)*t+(i+p)]!==0)return f}return-1},lT=function(e,t,n,i){let o=e.length,s=new Int32Array(o);for(let f=0;f<o;f++)s[f]=e[f]<=i?1:0;for(let f=1;f<n-1;f++)s[f*t]=s[f*t+t-1]=0;for(let f=0;f<t;f++)s[f]=s[t*n-1-f]=0;let a=1,u,c=[];for(let f=1;f<n-1;f++){u=1;for(let h=1;h<t-1;h++){let p=f*t+h,m=s[p];if(m===0)continue;let b=f,v=h;if(m===1&&s[p-1]===0)a+=1,v-=1;else if(m>=1&&s[p+1]===0)a+=1,v+=1,m>1&&(u=m);else{m!==1&&(u=Math.abs(m));continue}let w=[h,f],y=v===h+1,_={isHole:y,points:w,id:a,parent:0};c.push(_);let E;for(let ne of c)if(ne.id===u){E=ne;break}E?E.isHole?_.parent=y?E.parent:u:_.parent=y?u:E.parent:_.parent=y?u:0;let S=ee(this,Vt,f3).call(this,s,t,f,h,b,v,0);if(S===-1){s[p]=-a,s[p]!==1&&(u=Math.abs(s[p]));continue}let A=l(this,qs)[2*S],F=l(this,qs)[2*S+1],D=f+A,H=h+F;b=D,v=H;let J=f,K=h;for(;;){let ne=ee(this,Vt,h3).call(this,s,t,J,K,b,v,1);A=l(this,qs)[2*ne],F=l(this,qs)[2*ne+1];let k=J+A,$=K+F;w.push($,k);let Y=J*t+K;if(s[Y+1]===0?s[Y]=-a:s[Y]===1&&(s[Y]=a),k===f&&$===h&&J===D&&K===H){s[p]!==1&&(u=Math.abs(s[p]));break}else b=J,v=K,J=k,K=$}}}return c},tv=function(e,t,n,i){if(n-t<=4){for(let D=t;D<n-2;D+=2)i.push(e[D],e[D+1]);return}let o=e[t],s=e[t+1],a=e[n-4]-o,u=e[n-3]-s,c=Math.hypot(a,u),f=a/c,h=u/c,p=f*s-h*o,m=u/a,b=1/c,v=Math.atan(m),w=Math.cos(v),y=Math.sin(v),_=b*(Math.abs(w)+Math.abs(y)),E=b*(1-_+_**2),S=Math.max(Math.atan(Math.abs(y+w)*E),Math.atan(Math.abs(y-w)*E)),A=0,F=t;for(let D=t+2;D<n-2;D+=2){let H=Math.abs(p-f*e[D+1]+h*e[D]);H>A&&(F=D,A=H)}A>(c*S)**2?(ee(this,Vt,tv).call(this,e,t,F+2,i),ee(this,Vt,tv).call(this,e,F,n,i)):i.push(o,s)},d3=function(e){let t=[],n=e.length;return ee(this,Vt,tv).call(this,e,0,n,t),t.push(e[n-2],e[n-1]),t.length<=4?null:t},p3=function(e,t,n,i,o,s){let a=new Float32Array(s**2),u=-2*i**2,c=s>>1;for(let v=0;v<s;v++){let w=(v-c)**2;for(let y=0;y<s;y++)a[v*s+y]=Math.exp((w+(y-c)**2)/u)}let f=new Float32Array(256),h=-2*o**2;for(let v=0;v<256;v++)f[v]=Math.exp(v**2/h);let p=e.length,m=new Uint8Array(p),b=new Uint32Array(256);for(let v=0;v<n;v++)for(let w=0;w<t;w++){let y=v*t+w,_=e[y],E=0,S=0;for(let F=0;F<s;F++){let D=v+F-c;if(!(D<0||D>=n))for(let H=0;H<s;H++){let J=w+H-c;if(J<0||J>=t)continue;let K=e[D*t+J],ne=a[F*s+H]*f[Math.abs(K-_)];E+=K*ne,S+=ne}}let A=m[y]=Math.round(E/S);b[A]++}return[m,b]},g3=function(e){let t=new Uint32Array(256);for(let n of e)t[n]++;return t},uT=function(e){let t=e.length,n=new Uint8ClampedArray(t>>2),i=-1/0,o=1/0;for(let a=0,u=n.length;a<u;a++){let c=n[a]=e[a<<2];i=Math.max(i,c),o=Math.min(o,c)}let s=255/(i-o);for(let a=0,u=n.length;a<u;a++)n[a]=(n[a]-o)*s;return n},cT=function(e){let t,n=-1/0,i=-1/0,o=e.findIndex(u=>u!==0),s=o,a=o;for(t=o;t<256;t++){let u=e[t];u>n&&(t-s>i&&(i=t-s,a=t-1),n=u,s=t)}for(t=a-1;t>=0&&!(e[t]>e[t+1]);t--);return t},m3=function(e){let t=e,{width:n,height:i}=e,{maxDim:o}=l(this,Ef),s=n,a=i;if(n>o||i>o){let p=n,m=i,b=Math.log2(Math.max(n,i)/o),v=Math.floor(b);b=b===v?v-1:v;for(let y=0;y<b;y++){s=Math.ceil(p/2),a=Math.ceil(m/2);let _=new OffscreenCanvas(s,a);_.getContext("2d").drawImage(e,0,0,p,m,0,0,s,a),p=s,m=a,e!==t&&e.close(),e=_.transferToImageBitmap()}let w=Math.min(o/s,o/a);s=Math.round(s*w),a=Math.round(a*w)}let c=new OffscreenCanvas(s,a).getContext("2d",{willReadFrequently:!0});c.fillStyle="white",c.fillRect(0,0,s,a),c.filter="grayscale(1)",c.drawImage(e,0,0,e.width,e.height,0,0,s,a);let f=c.getImageData(0,0,s,a).data;return[ee(this,Vt,uT).call(this,f),s,a]},q(Es,Vt),q(Es,Ef,{maxDim:512,sigmaSFactor:.02,sigmaR:25,kernelSize:16}),q(Es,qs,new Int32Array([0,1,-1,1,-1,0,-1,-1,0,-1,1,-1,1,0,1,1]));fT=class r extends Fv{constructor(){super(),super.updateProperties({fill:mr._defaultLineColor,"stroke-width":0})}clone(){let e=new r;return e.updateAll(this),e}},hT=class r extends jv{constructor(e){super(e),super.updateProperties({stroke:mr._defaultLineColor,"stroke-width":1})}clone(){let e=new r(this._viewParameters);return e.updateAll(this),e}},Ti=class Ti extends Uv{constructor(t){super({...t,mustBeCommitted:!0,name:"signatureEditor"});q(this,uu,!1);q(this,Po,null);q(this,cu,null);q(this,Af,null);this._willKeepAspectRatio=!0,L(this,cu,t.signatureData||null),L(this,Po,null),this.defaultL10nId="pdfjs-editor-signature-editor1"}static initialize(t,n){mr.initialize(t,n),this._defaultDrawingOptions=new fT,this._defaultDrawnSignatureOptions=new hT(n.viewParameters)}static getDefaultDrawingOptions(t){let n=this._defaultDrawingOptions.clone();return n.updateProperties(t),n}static get supportMultipleDrawings(){return!1}static get typesMap(){return wt(this,"typesMap",new Map)}static get isDrawer(){return!1}get telemetryFinalData(){return{type:"signature",hasDescription:!!l(this,Po)}}static computeTelemetryFinalData(t){let n=t.get("hasDescription");return{hasAltText:n.get(!0)??0,hasNoAltText:n.get(!1)??0}}get isResizable(){return!0}onScaleChanging(){this._drawId!==null&&super.onScaleChanging()}render(){if(this.div)return this.div;let t,n,{_isCopy:i}=this;if(i&&(this._isCopy=!1,t=this.x,n=this.y),super.render(),this._drawId===null)if(l(this,cu)){let{lines:o,mustSmooth:s,areContours:a,description:u,uuid:c,heightInPage:f}=l(this,cu),{rawDims:{pageWidth:h,pageHeight:p},rotation:m}=this.parent.viewport,b=Es.processDrawnLines({lines:o,pageWidth:h,pageHeight:p,rotation:m,innerMargin:Ti._INNER_MARGIN,mustSmooth:s,areContours:a});this.addSignature(b,f,u,c)}else this.div.setAttribute("data-l10n-args",JSON.stringify({description:""})),this.div.hidden=!0,this._uiManager.getSignature(this);else this.div.setAttribute("data-l10n-args",JSON.stringify({description:l(this,Po)||""}));return i&&(this._isCopy=!0,this._moveAfterPaste(t,n)),this.div}setUuid(t){L(this,Af,t),this.addEditToolbar()}getUuid(){return l(this,Af)}get description(){return l(this,Po)}set description(t){L(this,Po,t),this.div&&(this.div.setAttribute("data-l10n-args",JSON.stringify({description:t})),super.addEditToolbar().then(n=>{n?.updateEditSignatureButton(t)}))}getSignaturePreview(){let{newCurves:t,areContours:n,thickness:i,width:o,height:s}=l(this,cu),a=Math.max(o,s),u=Es.processDrawnLines({lines:{curves:t.map(c=>({points:c})),thickness:i,width:o,height:s},pageWidth:a,pageHeight:a,rotation:0,innerMargin:0,mustSmooth:!1,areContours:n});return{areContours:n,outline:u.outline}}get toolbarButtons(){return this._uiManager.signatureManager?[["editSignature",this._uiManager.signatureManager]]:super.toolbarButtons}addSignature(t,n,i,o){let{x:s,y:a}=this,{outline:u}=L(this,cu,t);L(this,uu,u instanceof bm),this.description=i;let c;l(this,uu)?c=Ti.getDefaultDrawingOptions():(c=Ti._defaultDrawnSignatureOptions.clone(),c.updateProperties({"stroke-width":u.thickness})),this._addOutlines({drawOutlines:u,drawingOptions:c});let[,f]=this.pageDimensions,h=n/f;h=h>=1?.5:h,this.width*=h/this.height,this.width>=1&&(h*=.9/this.width,this.width=.9),this.height=h,this.setDims(),this.x=s,this.y=a,this.center(),this._onResized(),this.onScaleChanging(),this.rotate(),this._uiManager.addToAnnotationStorage(this),this.setUuid(o),this._reportTelemetry({action:"pdfjs.signature.inserted",data:{hasBeenSaved:!!o,hasDescription:!!i}}),this.div.hidden=!1}getFromImage(t){let{rawDims:{pageWidth:n,pageHeight:i},rotation:o}=this.parent.viewport;return Es.process(t,n,i,o,Ti._INNER_MARGIN)}getFromText(t,n){let{rawDims:{pageWidth:i,pageHeight:o},rotation:s}=this.parent.viewport;return Es.extractContoursFromText(t,n,i,o,s,Ti._INNER_MARGIN)}getDrawnSignature(t){let{rawDims:{pageWidth:n,pageHeight:i},rotation:o}=this.parent.viewport;return Es.processDrawnLines({lines:t,pageWidth:n,pageHeight:i,rotation:o,innerMargin:Ti._INNER_MARGIN,mustSmooth:!1,areContours:!1})}createDrawingOptions({areContours:t,thickness:n}){t?this._drawingOptions=Ti.getDefaultDrawingOptions():(this._drawingOptions=Ti._defaultDrawnSignatureOptions.clone(),this._drawingOptions.updateProperties({"stroke-width":n}))}serialize(t=!1){if(this.isEmpty())return null;let{lines:n,points:i}=this.serializeDraw(t),{_drawingOptions:{"stroke-width":o}}=this,s=Object.assign(super.serialize(t),{isSignature:!0,areContours:l(this,uu),color:[0,0,0],thickness:l(this,uu)?0:o});return this.addComment(s),t?(s.paths={lines:n,points:i},s.uuid=l(this,Af),s.isCopy=!0):s.lines=n,l(this,Po)&&(s.accessibilityData={type:"Figure",alt:l(this,Po)}),s}static deserializeDraw(t,n,i,o,s,a){return a.areContours?bm.deserialize(t,n,i,o,s,a):Nf.deserialize(t,n,i,o,s,a)}static async deserialize(t,n,i){let o=await super.deserialize(t,n,i);return L(o,uu,t.areContours),o.description=t.accessibilityData?.alt||"",L(o,Af,t.uuid),o}};uu=new WeakMap,Po=new WeakMap,cu=new WeakMap,Af=new WeakMap,Ke(Ti,"_type","signature"),Ke(Ti,"_editorType",vt.SIGNATURE),Ke(Ti,"_defaultDrawingOptions",null);dT=Ti,Jg=class extends mr{constructor(t){super({...t,name:"stampEditor"});q(this,$t);q(this,Ar,null);q(this,vn,null);q(this,fu,null);q(this,Ha,null);q(this,hu,null);q(this,cp,"");q(this,Ga,null);q(this,xf,!1);q(this,Mo,null);q(this,Hi,!1);q(this,fp,!1);L(this,Ha,t.bitmapUrl),L(this,hu,t.bitmapFile),this.defaultL10nId="pdfjs-editor-stamp-editor"}static initialize(t,n){mr.initialize(t,n)}static isHandlingMimeForPasting(t){return uv.includes(t)}static paste(t,n){n.pasteEditor({mode:vt.STAMP},{bitmapFile:t.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){return{type:"stamp",hasAltText:!!this.altTextData?.altText}}static computeTelemetryFinalData(t){let n=t.get("hasAltText");return{hasAltText:n.get(!0)??0,hasNoAltText:n.get(!1)??0}}async mlGuessAltText(t=null,n=!0){if(this.hasAltTextData())return null;let{mlManager:i}=this._uiManager;if(!i)throw new Error("No ML.");if(!await i.isEnabledFor("altText"))throw new Error("ML isn't enabled for alt text.");let{data:o,width:s,height:a}=t||this.copyCanvas(null,null,!0).imageData,u=await i.guess({name:"altText",request:{data:o,width:s,height:a,channels:o.length/(s*a)}});if(!u)throw new Error("No response from the AI service.");if(u.error)throw new Error("Error from the AI service.");if(u.cancel)return null;if(!u.output)throw new Error("No valid response from the AI service.");let c=u.output;return await this.setGuessedAltText(c),n&&!this.hasAltTextData()&&(this.altTextData={alt:c,decorative:!1}),c}remove(){l(this,vn)&&(L(this,Ar,null),this._uiManager.imageManager.deleteId(l(this,vn)),l(this,Ga)?.remove(),L(this,Ga,null),l(this,Mo)&&(clearTimeout(l(this,Mo)),L(this,Mo,null))),super.remove()}rebuild(){if(!this.parent){l(this,vn)&&ee(this,$t,rv).call(this);return}super.rebuild(),this.div!==null&&(l(this,vn)&&l(this,Ga)===null&&ee(this,$t,rv).call(this),this.isAttachedToDOM||this.parent.add(this))}onceAdded(t){this._isDraggable=!0,t&&this.div.focus()}isEmpty(){return!(l(this,fu)||l(this,Ar)||l(this,Ha)||l(this,hu)||l(this,vn)||l(this,xf))}get toolbarButtons(){return[["altText",this.createAltText()]]}get isResizable(){return!0}render(){if(this.div)return this.div;let t,n;return this._isCopy&&(t=this.x,n=this.y),super.render(),this.div.hidden=!0,this.createAltText(),l(this,xf)||(l(this,Ar)?ee(this,$t,nv).call(this):ee(this,$t,rv).call(this)),this._isCopy&&this._moveAfterPaste(t,n),this._uiManager.addShouldRescale(this),this.div}setCanvas(t,n){let{id:i,bitmap:o}=this._uiManager.imageManager.getFromCanvas(t,n);n.remove(),i&&this._uiManager.imageManager.isValidId(i)&&(L(this,vn,i),o&&L(this,Ar,o),L(this,xf,!1),ee(this,$t,nv).call(this))}_onResized(){this.onScaleChanging()}onScaleChanging(){if(!this.parent)return;l(this,Mo)!==null&&clearTimeout(l(this,Mo)),L(this,Mo,setTimeout(()=>{L(this,Mo,null),ee(this,$t,pT).call(this)},200))}copyCanvas(t,n,i=!1){t||(t=224);let{width:o,height:s}=l(this,Ar),a=new Bo,u=l(this,Ar),c=o,f=s,h=null;if(n){if(o>n||s>n){let D=Math.min(n/o,n/s);c=Math.floor(o*D),f=Math.floor(s*D)}h=document.createElement("canvas");let m=h.width=Math.ceil(c*a.sx),b=h.height=Math.ceil(f*a.sy);l(this,Hi)||(u=ee(this,$t,iv).call(this,m,b));let v=h.getContext("2d");v.filter=this._uiManager.hcmFilter;let w="white",y="#cfcfd8";this._uiManager.hcmFilter!=="none"?y="black":YA.isDarkMode&&(w="#8f8f9d",y="#42414d");let _=15,E=_*a.sx,S=_*a.sy,A=new OffscreenCanvas(E*2,S*2),F=A.getContext("2d");F.fillStyle=w,F.fillRect(0,0,E*2,S*2),F.fillStyle=y,F.fillRect(0,0,E,S),F.fillRect(E,S,E,S),v.fillStyle=v.createPattern(A,"repeat"),v.fillRect(0,0,m,b),v.drawImage(u,0,0,u.width,u.height,0,0,m,b)}let p=null;if(i){let m,b;if(a.symmetric&&u.width<t&&u.height<t)m=u.width,b=u.height;else if(u=l(this,Ar),o>t||s>t){let y=Math.min(t/o,t/s);m=Math.floor(o*y),b=Math.floor(s*y),l(this,Hi)||(u=ee(this,$t,iv).call(this,m,b))}let w=new OffscreenCanvas(m,b).getContext("2d",{willReadFrequently:!0});w.drawImage(u,0,0,u.width,u.height,0,0,m,b),p={width:m,height:b,data:w.getImageData(0,0,m,b).data}}return{canvas:h,width:c,height:f,imageData:p}}static async deserialize(t,n,i){let o=null,s=!1;if(t instanceof kv){let{data:{rect:w,rotation:y,id:_,structParent:E,popupRef:S,richText:A,contentsObj:F,creationDate:D,modificationDate:H},container:J,parent:{page:{pageNumber:K}},canvas:ne}=t,k,$;ne?(delete t.canvas,{id:k,bitmap:$}=i.imageManager.getFromCanvas(J.id,ne),ne.remove()):(s=!0,t._hasNoCanvas=!0);let Y=(await n._structTree.getAriaAttributes(`${Mh}${_}`))?.get("aria-label")||"";o=t={annotationType:vt.STAMP,bitmapId:k,bitmap:$,pageIndex:K-1,rect:w.slice(0),rotation:y,annotationElementId:_,id:_,deleted:!1,accessibilityData:{decorative:!1,altText:Y},isSvg:!1,structParent:E,popupRef:S,richText:A,comment:F?.str||null,creationDate:D,modificationDate:H}}let a=await super.deserialize(t,n,i),{rect:u,bitmap:c,bitmapUrl:f,bitmapId:h,isSvg:p,accessibilityData:m}=t;s?(i.addMissingCanvas(t.id,a),L(a,xf,!0)):h&&i.imageManager.isValidId(h)?(L(a,vn,h),c&&L(a,Ar,c)):L(a,Ha,f),L(a,Hi,p);let[b,v]=a.pageDimensions;return a.width=(u[2]-u[0])/b,a.height=(u[3]-u[1])/v,m&&(a.altTextData=m),a._initialData=o,t.comment&&a.setCommentData(t),L(a,fp,!!o),a}serialize(t=!1,n=null){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();let i=Object.assign(super.serialize(t),{bitmapId:l(this,vn),isSvg:l(this,Hi)});if(this.addComment(i),t)return i.bitmapUrl=ee(this,$t,sv).call(this,!0),i.accessibilityData=this.serializeAltText(!0),i.isCopy=!0,i;let{decorative:o,altText:s}=this.serializeAltText(!1);if(!o&&s&&(i.accessibilityData={type:"Figure",alt:s}),this.annotationElementId){let u=ee(this,$t,y3).call(this,i);return u.isSame?null:(u.isSameAltText?delete i.accessibilityData:i.accessibilityData.structParent=this._initialData.structParent??-1,i.id=this.annotationElementId,delete i.bitmapId,i)}if(n===null)return i;n.stamps||(n.stamps=new Map);let a=l(this,Hi)?(i.rect[2]-i.rect[0])*(i.rect[3]-i.rect[1]):null;if(!n.stamps.has(l(this,vn)))n.stamps.set(l(this,vn),{area:a,serialized:i}),i.bitmap=ee(this,$t,sv).call(this,!1);else if(l(this,Hi)){let u=n.stamps.get(l(this,vn));a>u.area&&(u.area=a,u.serialized.bitmap.close(),u.serialized.bitmap=ee(this,$t,sv).call(this,!1))}return i}renderAnnotationElement(t){return this.deleted?(t.hide(),null):(t.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}};Ar=new WeakMap,vn=new WeakMap,fu=new WeakMap,Ha=new WeakMap,hu=new WeakMap,cp=new WeakMap,Ga=new WeakMap,xf=new WeakMap,Mo=new WeakMap,Hi=new WeakMap,fp=new WeakMap,$t=new WeakSet,Qg=function(t,n=!1){if(!t){this.remove();return}L(this,Ar,t.bitmap),n||(L(this,vn,t.id),L(this,Hi,t.isSvg)),t.file&&L(this,cp,t.file.name),ee(this,$t,nv).call(this)},em=function(){if(L(this,fu,null),this._uiManager.enableWaiting(!1),!!l(this,Ga)){if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&l(this,Ar)){this.addEditToolbar().then(()=>{this._editToolbar.hide(),this._uiManager.editAltText(this,!0)});return}if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&l(this,Ar)){this._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!1,alt_text_type:"empty"}});try{this.mlGuessAltText()}catch{}}this.div.focus()}},rv=function(){if(l(this,vn)){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(l(this,vn)).then(i=>ee(this,$t,Qg).call(this,i,!0)).finally(()=>ee(this,$t,em).call(this));return}if(l(this,Ha)){let i=l(this,Ha);L(this,Ha,null),this._uiManager.enableWaiting(!0),L(this,fu,this._uiManager.imageManager.getFromUrl(i).then(o=>ee(this,$t,Qg).call(this,o)).finally(()=>ee(this,$t,em).call(this)));return}if(l(this,hu)){let i=l(this,hu);L(this,hu,null),this._uiManager.enableWaiting(!0),L(this,fu,this._uiManager.imageManager.getFromFile(i).then(o=>ee(this,$t,Qg).call(this,o)).finally(()=>ee(this,$t,em).call(this)));return}let t=document.createElement("input");t.type="file",t.accept=uv.join(",");let n=this._uiManager._signal;L(this,fu,new Promise(i=>{t.addEventListener("change",async()=>{if(!t.files||t.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);let o=await this._uiManager.imageManager.getFromFile(t.files[0]);this._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),ee(this,$t,Qg).call(this,o)}i()},{signal:n}),t.addEventListener("cancel",()=>{this.remove(),i()},{signal:n})}).finally(()=>ee(this,$t,em).call(this))),t.click()},nv=function(){let{div:t}=this,{width:n,height:i}=l(this,Ar),[o,s]=this.pageDimensions,a=.75;if(this.width)n=this.width*o,i=this.height*s;else if(n>a*o||i>a*s){let c=Math.min(a*o/n,a*s/i);n*=c,i*=c}this._uiManager.enableWaiting(!1);let u=L(this,Ga,document.createElement("canvas"));u.setAttribute("role","img"),this.addContainer(u),this.width=n/o,this.height=i/s,this.setDims(),this._initialOptions?.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,(!this._uiManager.useNewAltTextWhenAddingImage||!this._uiManager.useNewAltTextFlow||this.annotationElementId)&&(t.hidden=!1),ee(this,$t,pT).call(this),l(this,fp)||(this.parent.addUndoableEditor(this),L(this,fp,!0)),this._reportTelemetry({action:"inserted_image"}),l(this,cp)&&this.div.setAttribute("aria-description",l(this,cp)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-stamp-added-alert")},iv=function(t,n){let{width:i,height:o}=l(this,Ar),s=i,a=o,u=l(this,Ar);for(;s>2*t||a>2*n;){let c=s,f=a;s>2*t&&(s=s>=16384?Math.floor(s/2)-1:Math.ceil(s/2)),a>2*n&&(a=a>=16384?Math.floor(a/2)-1:Math.ceil(a/2));let h=new OffscreenCanvas(s,a);h.getContext("2d").drawImage(u,0,0,c,f,0,0,s,a),u=h.transferToImageBitmap()}return u},pT=function(){let[t,n]=this.parentDimensions,{width:i,height:o}=this,s=new Bo,a=Math.ceil(i*t*s.sx),u=Math.ceil(o*n*s.sy),c=l(this,Ga);if(!c||c.width===a&&c.height===u)return;c.width=a,c.height=u;let f=l(this,Hi)?l(this,Ar):ee(this,$t,iv).call(this,a,u),h=c.getContext("2d");h.filter=this._uiManager.hcmFilter,h.drawImage(f,0,0,f.width,f.height,0,0,a,u)},sv=function(t){if(t){if(l(this,Hi)){let o=this._uiManager.imageManager.getSvgUrl(l(this,vn));if(o)return o}let n=document.createElement("canvas");return{width:n.width,height:n.height}=l(this,Ar),n.getContext("2d").drawImage(l(this,Ar),0,0),n.toDataURL()}if(l(this,Hi)){let[n,i]=this.pageDimensions,o=Math.round(this.width*n*el.PDF_TO_CSS_UNITS),s=Math.round(this.height*i*el.PDF_TO_CSS_UNITS),a=new OffscreenCanvas(o,s);return a.getContext("2d").drawImage(l(this,Ar),0,0,l(this,Ar).width,l(this,Ar).height,0,0,o,s),a.transferToImageBitmap()}return structuredClone(l(this,Ar))},y3=function(t){let{pageIndex:n,accessibilityData:{altText:i}}=this._initialData,o=t.pageIndex===n,s=(t.accessibilityData?.alt||"")===i;return{isSame:!this.hasEditedComment&&!this._hasBeenMoved&&!this._hasBeenResized&&o&&s,isSameAltText:s}},Ke(Jg,"_type","stamp"),Ke(Jg,"_editorType",vt.STAMP);Ls=class Ls{constructor({uiManager:e,pageIndex:t,div:n,structTreeLayer:i,accessibilityManager:o,annotationLayer:s,drawLayer:a,textLayer:u,viewport:c,l10n:f}){q(this,hr);q(this,Sf);q(this,hp,!1);q(this,du,null);q(this,pu,null);q(this,Va,null);q(this,wi,new Map);q(this,gu,!1);q(this,dp,!1);q(this,pp,!1);q(this,Hs,null);q(this,Ya,null);q(this,_n,null);q(this,Xa,null);q(this,mu,null);q(this,gp,-1);q(this,ft);let h=[...l(Ls,yu).values()];if(!Ls._initialized){Ls._initialized=!0;for(let p of h)p.initialize(f,e)}e.registerEditorTypes(h),L(this,ft,e),this.pageIndex=t,this.div=n,L(this,Sf,o),L(this,du,s),this.viewport=c,L(this,_n,u),this.drawLayer=a,this._structTree=i,l(this,ft).addLayer(this)}get isEmpty(){return l(this,wi).size===0}get isInvisible(){return this.isEmpty&&l(this,ft).getMode()===vt.NONE}updateToolbar(e){l(this,ft).updateToolbar(e)}updateMode(e=l(this,ft).getMode()){switch(ee(this,hr,ov).call(this),e){case vt.NONE:this.div.classList.toggle("nonEditing",!0),this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),this.disableClick();return;case vt.INK:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick();break;case vt.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);let{classList:t}=this.div;if(t.toggle("nonEditing",!1),e===vt.POPUP)t.toggle("commentEditing",!0);else{t.toggle("commentEditing",!1);for(let n of l(Ls,yu).values())t.toggle(`${n._type}Editing`,e===n._editorType)}this.div.hidden=!1}hasTextLayer(e){return e===l(this,_n)?.div}setEditingState(e){l(this,ft).setEditingState(e)}addCommands(e){l(this,ft).addCommands(e)}cleanUndoStack(e){l(this,ft).cleanUndoStack(e)}toggleDrawing(e=!1){this.div.classList.toggle("drawing",!e)}togglePointerEvents(e=!1){this.div.classList.toggle("disabled",!e)}toggleAnnotationLayerPointerEvents(e=!1){l(this,du)?.togglePointerEvents(e)}async enable(){L(this,pp,!0),this.div.tabIndex=0,this.togglePointerEvents(!0),this.div.classList.toggle("nonEditing",!1),l(this,mu)?.abort(),L(this,mu,null);let e=new Set;for(let n of l(this,hr,gT))n.enableEditing(),n.show(!0),n.annotationElementId&&(l(this,ft).removeChangedExistingAnnotation(n),e.add(n.annotationElementId));let t=l(this,du);if(t)for(let n of t.getEditableAnnotations()){if(n.hide(),l(this,ft).isDeletedAnnotationElement(n.data.id)||e.has(n.data.id))continue;let i=await this.deserialize(n);i&&(this.addOrRebuild(i),i.enableEditing())}L(this,pp,!1),l(this,ft)._eventBus.dispatch("editorsrendered",{source:this,pageNumber:this.pageIndex+1})}disable(){if(L(this,dp,!0),this.div.tabIndex=-1,this.togglePointerEvents(!1),this.div.classList.toggle("nonEditing",!0),l(this,_n)&&!l(this,mu)){L(this,mu,new AbortController);let i=l(this,ft).combinedSignal(l(this,mu));l(this,_n).div.addEventListener("pointerdown",o=>{let{clientX:a,clientY:u,timeStamp:c}=o,f=l(this,gp);if(c-f>500){L(this,gp,c);return}L(this,gp,-1);let{classList:h}=this.div;h.toggle("getElements",!0);let p=document.elementsFromPoint(a,u);if(h.toggle("getElements",!1),!this.div.contains(p[0]))return;let m,b=new RegExp(`^${im}[0-9]+$`);for(let w of p)if(b.test(w.id)){m=w.id;break}if(!m)return;let v=l(this,wi).get(m);v?.annotationElementId===null&&(o.stopPropagation(),o.preventDefault(),v.dblclick(o))},{signal:i,capture:!0})}let e=l(this,du),t=[];if(e){let i=new Map,o=new Map;for(let a of l(this,hr,gT)){if(a.disableEditing(),!a.annotationElementId){t.push(a);continue}if(a.serialize()!==null){i.set(a.annotationElementId,a);continue}else o.set(a.annotationElementId,a);this.getEditableAnnotation(a.annotationElementId)?.show(),a.remove()}let s=e.getEditableAnnotations();for(let a of s){let{id:u}=a.data;if(l(this,ft).isDeletedAnnotationElement(u)){a.updateEdited({deleted:!0});continue}let c=o.get(u);if(c){c.resetAnnotationElement(a),c.show(!1),a.show();continue}c=i.get(u),c&&(l(this,ft).addChangedExistingAnnotation(c),c.renderAnnotationElement(a)&&c.show(!1)),a.show()}}ee(this,hr,ov).call(this),this.isEmpty&&(this.div.hidden=!0);let{classList:n}=this.div;for(let i of l(Ls,yu).values())n.remove(`${i._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),e?.updateFakeAnnotations(t),L(this,dp,!1)}getEditableAnnotation(e){return l(this,du)?.getEditableAnnotation(e)||null}setActiveEditor(e){l(this,ft).getActive()!==e&&l(this,ft).setActiveEditor(e)}enableTextSelection(){if(this.div.tabIndex=-1,l(this,_n)?.div&&!l(this,Xa)){L(this,Xa,new AbortController);let e=l(this,ft).combinedSignal(l(this,Xa));l(this,_n).div.addEventListener("pointerdown",ee(this,hr,b3).bind(this),{signal:e}),l(this,_n).div.classList.add("highlighting")}}disableTextSelection(){this.div.tabIndex=0,l(this,_n)?.div&&l(this,Xa)&&(l(this,Xa).abort(),L(this,Xa,null),l(this,_n).div.classList.remove("highlighting"))}enableClick(){if(l(this,pu))return;L(this,pu,new AbortController);let e=l(this,ft).combinedSignal(l(this,pu));this.div.addEventListener("pointerdown",this.pointerdown.bind(this),{signal:e});let t=this.pointerup.bind(this);this.div.addEventListener("pointerup",t,{signal:e}),this.div.addEventListener("pointercancel",t,{signal:e})}disableClick(){l(this,pu)?.abort(),L(this,pu,null)}attach(e){l(this,wi).set(e.id,e);let{annotationElementId:t}=e;t&&l(this,ft).isDeletedAnnotationElement(t)&&l(this,ft).removeDeletedAnnotationElement(e)}detach(e){l(this,wi).delete(e.id),l(this,Sf)?.removePointerInTextLayer(e.contentDiv),!l(this,dp)&&e.annotationElementId&&l(this,ft).addDeletedAnnotationElement(e)}remove(e){this.detach(e),l(this,ft).removeEditor(e),e.div.remove(),e.isAttachedToDOM=!1}changeParent(e){e.parent!==this&&(e.parent&&e.annotationElementId&&(l(this,ft).addDeletedAnnotationElement(e),mr.deleteAnnotationElement(e),e.annotationElementId=null),this.attach(e),e.parent?.detach(e),e.setParent(this),e.div&&e.isAttachedToDOM&&(e.div.remove(),this.div.append(e.div)))}add(e){if(!(e.parent===this&&e.isAttachedToDOM)){if(this.changeParent(e),l(this,ft).addEditor(e),this.attach(e),!e.isAttachedToDOM){let t=e.render();this.div.append(t),e.isAttachedToDOM=!0}e.fixAndSetPosition(),e.onceAdded(!l(this,pp)),l(this,ft).addToAnnotationStorage(e),e._reportTelemetry(e.telemetryInitialData)}}moveEditorInDOM(e){if(!e.isAttachedToDOM)return;let{activeElement:t}=document;e.div.contains(t)&&!l(this,Va)&&(e._focusEventsAllowed=!1,L(this,Va,setTimeout(()=>{L(this,Va,null),e.div.contains(document.activeElement)?e._focusEventsAllowed=!0:(e.div.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:l(this,ft)._signal}),t.focus())},0))),e._structTreeParentId=l(this,Sf)?.moveElementInDOM(this.div,e.div,e.contentDiv,!0)}addOrRebuild(e){e.needsToBeRebuilt()?(e.parent||(e.parent=this),e.rebuild(),e.show()):this.add(e)}addUndoableEditor(e){let t=()=>e._uiManager.rebuild(e),n=()=>{e.remove()};this.addCommands({cmd:t,undo:n,mustExec:!1})}getEditorByUID(e){for(let t of l(this,wi).values())if(t.uid===e)return t;return null}getNextId(){return l(this,ft).getId()}combinedSignal(e){return l(this,ft).combinedSignal(e)}canCreateNewEmptyEditor(){return l(this,hr,po)?.canCreateNewEmptyEditor()}async pasteEditor(e,t){this.updateToolbar(e),await l(this,ft).updateMode(e.mode);let{offsetX:n,offsetY:i}=ee(this,hr,yT).call(this),o=this.getNextId(),s=ee(this,hr,mT).call(this,{parent:this,id:o,x:n,y:i,uiManager:l(this,ft),isCentered:!0,...t});s&&this.add(s)}async deserialize(e){return await l(Ls,yu).get(e.annotationType??e.annotationEditorType)?.deserialize(e,this,l(this,ft))||null}createAndAddNewEditor(e,t,n={}){let i=this.getNextId(),o=ee(this,hr,mT).call(this,{parent:this,id:i,x:e.offsetX,y:e.offsetY,uiManager:l(this,ft),isCentered:t,...n});return o&&this.add(o),o}get boundingClientRect(){return this.div.getBoundingClientRect()}addNewEditor(e={}){this.createAndAddNewEditor(ee(this,hr,yT).call(this),!0,e)}setSelected(e){l(this,ft).setSelected(e)}toggleSelected(e){l(this,ft).toggleSelected(e)}unselect(e){l(this,ft).unselect(e)}pointerup(e){let{isMac:t}=Ur.platform;if(e.button!==0||e.ctrlKey&&t||e.target!==this.div||!l(this,gu)||(L(this,gu,!1),l(this,hr,po)?.isDrawer&&l(this,hr,po).supportMultipleDrawings))return;if(!l(this,hp)){L(this,hp,!0);return}let n=l(this,ft).getMode();if(n===vt.STAMP||n===vt.SIGNATURE){l(this,ft).unselectAll();return}this.createAndAddNewEditor(e,!1)}pointerdown(e){if(l(this,ft).getMode()===vt.HIGHLIGHT&&this.enableTextSelection(),l(this,gu)){L(this,gu,!1);return}let{isMac:t}=Ur.platform;if(e.button!==0||e.ctrlKey&&t||e.target!==this.div)return;if(L(this,gu,!0),l(this,hr,po)?.isDrawer){this.startDrawingSession(e);return}let n=l(this,ft).getActive();L(this,hp,!n||n.isEmpty())}startDrawingSession(e){if(this.div.focus({preventScroll:!0}),l(this,Hs)){l(this,hr,po).startDrawing(this,l(this,ft),!1,e);return}l(this,ft).setCurrentDrawingSession(this),L(this,Hs,new AbortController);let t=l(this,ft).combinedSignal(l(this,Hs));this.div.addEventListener("blur",({relatedTarget:n})=>{n&&!this.div.contains(n)&&(L(this,Ya,null),this.commitOrRemove())},{signal:t}),l(this,hr,po).startDrawing(this,l(this,ft),!1,e)}pause(e){if(e){let{activeElement:t}=document;this.div.contains(t)&&L(this,Ya,t);return}l(this,Ya)&&setTimeout(()=>{l(this,Ya)?.focus(),L(this,Ya,null)},0)}endDrawingSession(e=!1){return l(this,Hs)?(l(this,ft).setCurrentDrawingSession(null),l(this,Hs).abort(),L(this,Hs,null),L(this,Ya,null),l(this,hr,po).endDrawing(e)):null}findNewParent(e,t,n){let i=l(this,ft).findParent(t,n);return i===null||i===this?!1:(i.changeParent(e),!0)}commitOrRemove(){return l(this,Hs)?(this.endDrawingSession(),!0):!1}onScaleChanging(){l(this,Hs)&&l(this,hr,po).onScaleChangingWhenDrawing(this)}destroy(){this.commitOrRemove(),l(this,ft).getActive()?.parent===this&&(l(this,ft).commitOrRemove(),l(this,ft).setActiveEditor(null)),l(this,Va)&&(clearTimeout(l(this,Va)),L(this,Va,null));for(let e of l(this,wi).values())l(this,Sf)?.removePointerInTextLayer(e.contentDiv),e.setParent(null),e.isAttachedToDOM=!1,e.div.remove();this.div=null,l(this,wi).clear(),l(this,ft).removeLayer(this)}render({viewport:e}){this.viewport=e,bu(this.div,e);for(let t of l(this,ft).getEditors(this.pageIndex))this.add(t),t.rebuild();this.updateMode()}update({viewport:e}){l(this,ft).commitOrRemove(),ee(this,hr,ov).call(this);let t=this.viewport.rotation,n=e.rotation;if(this.viewport=e,bu(this.div,{rotation:n}),t!==n)for(let i of l(this,wi).values())i.rotate(n)}get pageDimensions(){let{pageWidth:e,pageHeight:t}=this.viewport.rawDims;return[e,t]}get scale(){return l(this,ft).viewParameters.realScale}};Sf=new WeakMap,hp=new WeakMap,du=new WeakMap,pu=new WeakMap,Va=new WeakMap,wi=new WeakMap,gu=new WeakMap,dp=new WeakMap,pp=new WeakMap,Hs=new WeakMap,Ya=new WeakMap,_n=new WeakMap,Xa=new WeakMap,mu=new WeakMap,gp=new WeakMap,ft=new WeakMap,yu=new WeakMap,hr=new WeakSet,gT=function(){return l(this,wi).size!==0?l(this,wi).values():l(this,ft).getEditors(this.pageIndex)},b3=function(e){l(this,ft).unselectAll();let{target:t}=e;if(t===l(this,_n).div||(t.getAttribute("role")==="img"||t.classList.contains("endOfContent"))&&l(this,_n).div.contains(t)){let{isMac:n}=Ur.platform;if(e.button!==0||e.ctrlKey&&n)return;l(this,ft).showAllEditors("highlight",!0,!0),l(this,_n).div.classList.add("free"),this.toggleDrawing(),Bv.startHighlighting(this,l(this,ft).direction==="ltr",{target:l(this,_n).div,x:e.x,y:e.y}),l(this,_n).div.addEventListener("pointerup",()=>{l(this,_n).div.classList.remove("free"),this.toggleDrawing(!0)},{once:!0,signal:l(this,ft)._signal}),e.preventDefault()}},po=function(){return l(Ls,yu).get(l(this,ft).getMode())},mT=function(e){let t=l(this,hr,po);return t?new t.prototype.constructor(e):null},yT=function(){let{x:e,y:t,width:n,height:i}=this.boundingClientRect,o=Math.max(0,e),s=Math.max(0,t),a=Math.min(window.innerWidth,e+n),u=Math.min(window.innerHeight,t+i),c=(o+a)/2-e,f=(s+u)/2-t,[h,p]=this.viewport.rotation%180===0?[c,f]:[f,c];return{offsetX:h,offsetY:p}},ov=function(){for(let e of l(this,wi).values())e.isEmpty()&&e.remove()},Ke(Ls,"_initialized",!1),q(Ls,yu,new Map([XS,oT,Jg,Bv,dT].map(e=>[e._editorType,e])));$v=Ls,an=class an{constructor({pageIndex:e}){q(this,Fo);q(this,Gs,null);q(this,Jn,new Map);q(this,Tf,new Map);this.pageIndex=e}setParent(e){if(!l(this,Gs)){L(this,Gs,e);return}if(l(this,Gs)!==e){if(l(this,Jn).size>0)for(let t of l(this,Jn).values())t.remove(),e.append(t);L(this,Gs,e)}}static get _svgFactory(){return wt(this,"_svgFactory",new If)}draw(e,t=!1,n=!1){let i=tn(an,l0)._++,o=ee(this,Fo,bT).call(this),s=an._svgFactory.createElement("defs");o.append(s);let a=an._svgFactory.createElement("path");s.append(a);let u=`path_p${this.pageIndex}_${i}`;a.setAttribute("id",u),a.setAttribute("vector-effect","non-scaling-stroke"),t&&l(this,Tf).set(i,a);let c=n?ee(this,Fo,v3).call(this,s,u):null,f=an._svgFactory.createElement("use");return o.append(f),f.setAttribute("href",`#${u}`),this.updateProperties(o,e),l(this,Jn).set(i,o),{id:i,clipPathId:`url(#${c})`}}drawOutline(e,t){let n=tn(an,l0)._++,i=ee(this,Fo,bT).call(this),o=an._svgFactory.createElement("defs");i.append(o);let s=an._svgFactory.createElement("path");o.append(s);let a=`path_p${this.pageIndex}_${n}`;s.setAttribute("id",a),s.setAttribute("vector-effect","non-scaling-stroke");let u;if(t){let h=an._svgFactory.createElement("mask");o.append(h),u=`mask_p${this.pageIndex}_${n}`,h.setAttribute("id",u),h.setAttribute("maskUnits","objectBoundingBox");let p=an._svgFactory.createElement("rect");h.append(p),p.setAttribute("width","1"),p.setAttribute("height","1"),p.setAttribute("fill","white");let m=an._svgFactory.createElement("use");h.append(m),m.setAttribute("href",`#${a}`),m.setAttribute("stroke","none"),m.setAttribute("fill","black"),m.setAttribute("fill-rule","nonzero"),m.classList.add("mask")}let c=an._svgFactory.createElement("use");i.append(c),c.setAttribute("href",`#${a}`),u&&c.setAttribute("mask",`url(#${u})`);let f=c.cloneNode();return i.append(f),c.classList.add("mainOutline"),f.classList.add("secondaryOutline"),this.updateProperties(i,e),l(this,Jn).set(n,i),n}finalizeDraw(e,t){l(this,Tf).delete(e),this.updateProperties(e,t)}updateProperties(e,t){var u;if(!t)return;let{root:n,bbox:i,rootClass:o,path:s}=t,a=typeof e=="number"?l(this,Jn).get(e):e;if(a){if(n&&ee(this,Fo,wT).call(this,a,n),i&&ee(u=an,a_,w3).call(u,a,i),o){let{classList:c}=a;for(let[f,h]of Object.entries(o))c.toggle(f,h)}if(s){let f=a.firstElementChild.firstElementChild;ee(this,Fo,wT).call(this,f,s)}}}updateParent(e,t){if(t===this)return;let n=l(this,Jn).get(e);n&&(l(t,Gs).append(n),l(this,Jn).delete(e),l(t,Jn).set(e,n))}remove(e){l(this,Tf).delete(e),l(this,Gs)!==null&&(l(this,Jn).get(e).remove(),l(this,Jn).delete(e))}destroy(){L(this,Gs,null);for(let e of l(this,Jn).values())e.remove();l(this,Jn).clear(),l(this,Tf).clear()}};Gs=new WeakMap,Jn=new WeakMap,Tf=new WeakMap,l0=new WeakMap,a_=new WeakSet,w3=function(e,[t,n,i,o]){let{style:s}=e;s.top=`${100*n}%`,s.left=`${100*t}%`,s.width=`${100*i}%`,s.height=`${100*o}%`},Fo=new WeakSet,bT=function(){let e=an._svgFactory.create(1,1,!0);return l(this,Gs).append(e),e.setAttribute("aria-hidden",!0),e},v3=function(e,t){let n=an._svgFactory.createElement("clipPath");e.append(n);let i=`clip_${t}`;n.setAttribute("id",i),n.setAttribute("clipPathUnits","objectBoundingBox");let o=an._svgFactory.createElement("use");return n.append(o),o.setAttribute("href",`#${t}`),o.classList.add("clip"),i},wT=function(e,t){for(let[n,i]of Object.entries(t))i===null?e.removeAttribute(n):e.setAttribute(n,i)},q(an,a_),q(an,l0,0);zv=an;globalThis._pdfjsTestingUtils={HighlightOutliner:mm};globalThis.pdfjsLib={AbortException:Ys,AnnotationEditorLayer:$v,AnnotationEditorParamsType:Mt,AnnotationEditorType:vt,AnnotationEditorUIManager:wu,AnnotationLayer:Lv,AnnotationMode:Ka,AnnotationType:qr,applyOpacity:RB,build:RF,ColorPicker:hm,createValidAbsoluteUrl:vT,CSSConstants:cv,DOMSVGFactory:If,DrawLayer:zv,FeatureTest:Ur,fetchData:_p,findContrastColor:DB,getDocument:xF,getFilenameFromUrl:SB,getPdfFilenameFromUrl:TB,getRGB:Ep,getUuid:ET,getXfaPageViewport:CB,GlobalWorkerOptions:_s,ImageKind:tm,InvalidPDFException:yp,isDataScheme:f0,isPdfFile:c_,isValidExplicitDest:uF,MathClamp:Wn,noContextMenu:Ki,normalizeUnicode:AB,OPS:mp,OutputScale:Bo,PasswordResponses:_B,PDFDataRangeTransport:fm,PDFDateString:Cf,PDFWorker:vp,PermissionFlag:vB,PixelsPerInch:el,RenderingCancelledException:bp,renderRichText:AT,ResponseException:Rf,setLayerDimensions:bu,shadow:wt,SignatureExtractor:Es,stopEvent:Cr,SupportedImageMimeTypes:uv,TextLayer:wp,TouchManager:lm,updateUrlHash:_T,Util:nt,VerbosityLevel:u0,version:CF,XfaLayer:om}});var LV={};Uo(LV,{OfficeParser:()=>Lf,default:()=>NV,parseOffice:()=>OV});Ce();De();Re();Ce();De();Re();var I3=xu(mN());Hp();Ce();De();Re();Ce();De();Re();Ce();De();Re();var ck=xu(Ib()),Wt=r=>new ck.DOMParser().parseFromString(r,"text/xml"),Le=(r,e)=>Array.from(r.getElementsByTagName(e)),En=(r,e)=>{let t=[];if(!r.childNodes)return t;for(let n=0;n<r.childNodes.length;n++){let i=r.childNodes[n];i.nodeType===1&&i.tagName===e&&t.push(i)}return t},bl=r=>{let e=Wt(r),t={},n=Le(e,"cp:coreProperties")[0];if(n){let o=Le(n,"dc:title")[0];o&&o.textContent&&(t.title=o.textContent);let s=Le(n,"dc:creator")[0];s&&s.textContent&&(t.author=s.textContent);let a=Le(n,"cp:lastModifiedBy")[0];a&&a.textContent&&(t.lastModifiedBy=a.textContent);let u=Le(n,"dcterms:created")[0];u&&u.textContent&&(t.created=new Date(u.textContent));let c=Le(n,"dcterms:modified")[0];return c&&c.textContent&&(t.modified=new Date(c.textContent)),t}let i=Le(e,"office:meta")[0];if(i){let o=Le(i,"dc:title")[0];o&&o.textContent&&(t.title=o.textContent);let s=Le(i,"dc:creator")[0];s&&s.textContent&&(t.author=s.textContent);let a=Le(i,"dc:description")[0];a&&a.textContent&&(t.description=a.textContent);let u=Le(i,"dc:subject")[0];u&&u.textContent&&(t.subject=u.textContent);let c=Le(i,"meta:creation-date")[0];c&&c.textContent&&(t.created=new Date(c.textContent));let f=Le(i,"dc:date")[0];f&&f.textContent&&(t.modified=new Date(f.textContent))}return t};var sg=(r,e)=>{let t=r.localName===e||r.tagName===e?r:r.getElementsByTagName(e)[0];if(!t)return;let n=t.getElementsByTagName("c:rich"),i=t.getElementsByTagName("a:p"),o=n.length>0?Array.from(n):Array.from(i);if(o.length>0){let a="";for(let u of o){let c=u.getElementsByTagName("a:t");for(let f=0;f<c.length;f++)a+=(c[f].textContent||"")+" "}if(a.trim())return a.trim()}let s=t.getElementsByTagName("c:v")[0];if(s&&s.textContent)return s.textContent.trim()||void 0},$9=r=>{let e=r.toString("utf8"),n=Wt(e).documentElement,i=sg(n,"c:title"),o,s,a=n.getElementsByTagName("c:catAx");a.length>0&&(o=sg(a[0],"c:title"));let u=n.getElementsByTagName("c:valAx");u.length>0&&(s=sg(u[0],"c:title"));let c=n.getElementsByTagName("c:ser"),f=[],h=[];for(let m=0;m<c.length;m++){let b=c[m],v=sg(b,"c:tx"),w=[],y=b.getElementsByTagName("c:val")[0]||b.getElementsByTagName("c:yVal")[0];if(y){let A=y.getElementsByTagName("c:v");for(let F=0;F<A.length;F++){let D=A[F].textContent?.trim();D&&w.push(D)}}let _=[],E=b.getElementsByTagName("c:dLbl");for(let A=0;A<E.length;A++){let F=sg(E[A],"c:tx");F&&_.push(F)}let S=b.getElementsByTagName("c:cat")[0]||b.getElementsByTagName("c:xVal")[0];if(S){let A=S.getElementsByTagName("c:v"),F=[];for(let D=0;D<A.length;D++){let H=A[D].textContent?.trim();H&&F.push(H)}F.length>0&&h.length===0&&h.push(...F)}f.push({name:v,values:w,pointLabels:_})}let p=[];for(let m of f)m.name&&p.push(m.name),p.push(...h),p.push(...m.values);return{title:i,xAxisTitle:o,yAxisTitle:s,dataSets:f,labels:h,rawTexts:p}},z9=r=>{let e=r.toString("utf8"),t=Wt(e),n=Le(t,"chart:chart")[0]||t.documentElement,i=Le(n,"chart:title")[0],o=i&&Le(i,"text:p")[0]?.textContent||void 0,s=Le(n,"table:table")[0],a=[],u=[],c=[];if(s){let m=[],b=En(s,"table:table-header-rows")[0];if(b&&m.push(...En(b,"table:table-row")),m.push(...En(s,"table:table-row")),m.length>0){let v=En(m[0],"table:table-cell");for(let w=1;w<v.length;w++){let y=parseInt(v[w].getAttribute("table:number-columns-repeated")||"1"),_=En(v[w],"text:p")[0]?.textContent||void 0;for(let E=0;E<y;E++)a.push({name:_,values:[],pointLabels:[]})}for(let w=1;w<m.length;w++){let y=En(m[w],"table:table-cell");if(y.length>0){let _=En(y[0],"text:p")[0]?.textContent||void 0;_&&u.push(_);let E=0;for(let S=1;S<y.length;S++){let A=parseInt(y[S].getAttribute("table:number-columns-repeated")||"1"),F=y[S].getAttribute("office:value")||En(y[S],"text:p")[0]?.textContent||"";for(let D=0;D<A;D++)a[E]&&a[E].values.push(F),E++}}}}}else{let m=Le(n,"chart:series");for(let v of m){let w=v.getAttribute("chart:label-cell-address"),y=v.getAttribute("chart:values-cell-range-address"),_,E=Le(v,"text:p");E.length>0&&(_=E[0].textContent||void 0),!_&&w&&(_=`Series ${w.split(".").pop()?.replace(/\$/g,"")||w}`);let S={name:_,values:[],pointLabels:[]};y&&S.values.push(`[${y}]`),a.push(S)}let b=Le(n,"chart:categories")[0];if(b){let v=b.getAttribute("table:cell-range-address");v&&u.push(`[${v}]`)}}let f=Le(t,"chart:axis"),h,p;for(let m of f){let b=m.getAttribute("chart:dimension"),v=Le(m,"chart:title")[0],w=v&&Le(v,"text:p")[0]?.textContent||void 0;b==="x"?h=w:b==="y"&&(p=w)}o&&c.push(o);for(let m of a)m.name&&c.push(m.name),c.push(...u),c.push(...m.values);return{title:o,xAxisTitle:h,yAxisTitle:p,dataSets:a,labels:u,rawTexts:c}},Yu=r=>r.toString("utf8",0,500).includes("urn:oasis:names:tc:opendocument:xmlns:chart:1.0")?z9(r):$9(r);Ce();De();Re();var gh="[OfficeParser]: ";var W9={EXTENSION_UNSUPPORTED:r=>`Sorry, OfficeParser currently supports docx, pptx, xlsx, odt, odp, ods, pdf, rtf files only. Create a ticket in Issues on github to add support for ${r} files. Stay tuned for further updates.`,FILE_CORRUPTED:r=>`Your file ${r} seems to be corrupted. If you are sure it is fine, please create a ticket in Issues on github with the file to reproduce error.`,FILE_DOES_NOT_EXIST:r=>`File ${r} could not be found! Check if the file exists or verify if the relative path to the file is correct from your terminal's location.`,LOCATION_NOT_FOUND:r=>`Entered location ${r} is not reachable! Please make sure that the entered directory location exists. Check relative paths and reenter.`,IMPROPER_ARGUMENTS:"Improper arguments",IMPROPER_BUFFERS:"Error occured while reading the file buffers",INVALID_INPUT:"Invalid input type: Expected a Buffer or a valid file path",PDF_WORKER_MISSING:'Missing PDF worker configuration. PDF parsing in browser environments requires a worker source. Please provide "pdfWorkerSrc" in your configuration.'},fk=(r,e)=>{let t=W9[r];return typeof t=="function"?t(e):t},na=(r,e,t)=>{let n=fk(r,t);return e.outputErrorToConsole&&console.error(gh+n),new Error(gh+n)},hk=(r,e,t)=>{let n=r.message||r;return t&&(n.includes("end of central directory record")||n.includes("invalid XML")||n.includes("Failed to open zip file")||n.includes("invalid distance too far back"))&&(n=fk("FILE_CORRUPTED",t)),e.outputErrorToConsole&&console.error(gh+n),new Error(gh+n)},ci=(r,e,t)=>{e.outputErrorToConsole&&(t?console.warn(gh+r,t):console.warn(gh+r))};Ce();De();Re();var q9=r=>{switch(r.toLowerCase()){case"jpg":case"jpeg":return"image/jpeg";case"png":return"image/png";case"gif":return"image/gif";case"bmp":return"image/bmp";case"tiff":return"image/tiff";case"webp":return"image/webp";default:return"application/octet-stream"}},H9=r=>{if(!(r.length<4)){if(r[0]===137&&r[1]===80&&r[2]===78&&r[3]===71)return"image/png";if(r[0]===255&&r[1]===216&&r[2]===255)return"image/jpeg";if(r[0]===71&&r[1]===73&&r[2]===70&&r[3]===56)return"image/gif";if(r[0]===66&&r[1]===77)return"image/bmp";if(r[0]===73&&r[1]===73&&r[2]===42&&r[3]===0||r[0]===77&&r[1]===77&&r[2]===0&&r[3]===42)return"image/tiff";if(r.length>=12&&r[0]===82&&r[1]===73&&r[2]===70&&r[3]===70&&r[8]===87&&r[9]===69&&r[10]===66&&r[11]===80)return"image/webp"}},Is=(r,e)=>{let t=r.split(".").pop()||"",n=H9(e);return n||(n=q9(t)),{type:"image",mimeType:n,data:e.toString("base64"),name:r,extension:t}};Ce();De();Re();var rL=xu(tL()),ns=async(r,e="eng")=>{let t=await(0,rL.createWorker)(e,1,{logger:()=>{}}),n=r;typeof window<"u"&&typeof Blob<"u"&&Buffer.isBuffer(r)&&(n=new Blob([r],{type:"image/bmp"}));let i=await t.recognize(n);return await t.terminate(),i.data.text};Ce();De();Re();var ZM=xu(PP()),JM=xu(KM()),Tl=(r,e)=>new Promise((t,n)=>{ZM.default.fromBuffer(r,{lazyEntries:!0},(i,o)=>{if(i)return n(i);if(!o)return n(new Error("Failed to open zip file"));let s=[];o.readEntry(),o.on("entry",a=>{e(a.fileName)?o.openReadStream(a,(u,c)=>{if(u)return n(u);if(!c)return n(new Error("Failed to open read stream"));c.pipe((0,JM.default)(f=>{s.push({path:a.fileName,content:f}),o.readEntry()}))}):o.readEntry()}),o.on("end",()=>t(s)),o.on("error",n)})});var QM=async(r,e)=>{let t=/xl\/worksheets\/sheet\d+.xml/g,n=/xl\/drawings\/drawing\d+.xml/g,i=/xl\/charts\/chart\d+.xml/g,o="xl/sharedStrings.xml",s=/xl\/media\/.*/,a=/docProps\/core\.xml/,u=/xl\/worksheets\/_rels\/sheet\d+\.xml\.rels/g,c=/xl\/drawings\/_rels\/drawing\d+\.xml\.rels/g,f=await Tl(r,k=>!!k.match(t)||!!k.match(n)||!!k.match(i)||k===o||k==="xl/styles.xml"||k==="xl/workbook.xml"||k==="xl/_rels/workbook.xml.rels"||!!k.match(a)||!!e.extractAttachments&&(!!k.match(s)||!!k.match(u)||!!k.match(c))),h=f.find(k=>k.path===o),p=[];if(h){let k=Wt(h.content.toString()),$=Le(k,"si");for(let Y of $){let ie=Le(Y,"r");if(ie.length>0){let re=[];for(let N of ie){let x=Le(N,"t")[0];if(x){let P=x.textContent||"",C=Le(N,"rPr")[0],j={};if(C){Le(C,"b").length>0&&(j.bold=!0),Le(C,"i").length>0&&(j.italic=!0),Le(C,"u").length>0&&(j.underline=!0),Le(C,"strike").length>0&&(j.strikethrough=!0);let U=Le(C,"sz")[0];U&&(j.size=U.getAttribute("val")+"pt");let B=Le(C,"color")[0];if(B){let _e=B.getAttribute("rgb");_e&&(j.color="#"+_e.substring(2))}let Q=Le(C,"rFont")[0];Q&&(j.font=Q.getAttribute("val")||void 0);let fe=Le(C,"vertAlign")[0];if(fe){let _e=fe.getAttribute("val");_e==="subscript"&&(j.subscript=!0),_e==="superscript"&&(j.superscript=!0)}}re.push({type:"text",text:P,formatting:Object.keys(j).length>0?j:void 0})}}p.push(re)}else{let re=Le(Y,"t"),N="";for(let x of re)N+=x.textContent||"";p.push(N)}}}let m=f.find(k=>k.path==="xl/styles.xml"),b={};if(m){let k=Wt(m.content.toString()),$=Le(k,"fonts")[0],Y=[];if($){let x=Le($,"font");for(let P of x){let C={};Le(P,"b").length>0&&(C.bold=!0),Le(P,"i").length>0&&(C.italic=!0),Le(P,"u").length>0&&(C.underline=!0),Le(P,"strike").length>0&&(C.strikethrough=!0);let j=Le(P,"sz")[0];if(j){let fe=j.getAttribute("val");fe&&(C.size=fe+"pt")}let U=Le(P,"color")[0];if(U){let fe=U.getAttribute("rgb");fe&&(C.color="#"+fe.substring(2))}let B=Le(P,"name")[0];if(B){let fe=B.getAttribute("val");fe&&(C.font=fe)}let Q=Le(P,"vertAlign")[0];if(Q){let fe=Q.getAttribute("val");fe==="subscript"&&(C.subscript=!0),fe==="superscript"&&(C.superscript=!0)}Y.push(C)}}let ie=Le(k,"fills")[0],re=[];if(ie){let x=Le(ie,"fill");for(let P of x){let C={},j=Le(P,"patternFill")[0];if(j){let U=Le(j,"fgColor")[0];if(U){let B=U.getAttribute("rgb"),Q=U.getAttribute("theme");if(B&&B!=="00000000")C.backgroundColor="#"+B.substring(2);else if(Q){let fe=parseInt(Q);fe===0?C.backgroundColor="#FFFFFF":fe===1?C.backgroundColor="#000000":fe===2?C.backgroundColor="#EEECE1":fe===3&&(C.backgroundColor="#1F497D")}}}re.push(C)}}let N=Le(k,"cellXfs")[0];if(N){let x=Le(N,"xf");for(let P=0;P<x.length;P++){let C=x[P],j={},U=C.getAttribute("fontId");if(U){let fe=parseInt(U);Y[fe]&&Object.assign(j,Y[fe])}let B=C.getAttribute("fillId");if(B){let fe=parseInt(B);re[fe]&&re[fe].backgroundColor&&(j.backgroundColor=re[fe].backgroundColor)}let Q=Le(C,"alignment")[0];if(Q){let fe=Q.getAttribute("horizontal");(fe==="center"||fe==="right"||fe==="justify"||fe==="left")&&(j.alignment=fe)}b[P]=j}}}let v=[],w=f.filter(k=>k.path.match(/xl\/media\/.*/)),y=f.filter(k=>k.path.match(i)),_={};if(e.extractAttachments){let k=f.filter(Y=>Y.path.match(c));for(let Y of k){let re=`xl/drawings/${Y.path.split("/").pop()?.replace(".rels","")||""}`,N=Wt(Y.content.toString()),x=Le(N,"Relationship");_[re]||(_[re]={});for(let P of x){let C=P.getAttribute("Id"),j=P.getAttribute("Target");if(C&&j&&j.includes("media/")){let U="xl/"+j.replace("../","");_[re][C]={path:U}}}}let $=f.filter(Y=>Y.path.match(n));for(let Y of $){let ie=Wt(Y.content.toString()),re=Le(ie,"xdr:pic"),N=_[Y.path]||{};for(let x of re){let P=Le(x,"xdr:blipFill")[0],C=P?Le(P,"a:blip")[0]:null,j=C?C.getAttribute("r:embed"):null,U=Le(x,"xdr:nvPicPr")[0],B=U?Le(U,"xdr:cNvPr")[0]:null,Q=B?B.getAttribute("descr")||B.getAttribute("name"):void 0;j&&N[j]&&(N[j].altText=Q||"")}}for(let Y of w){let ie=Is(Y.path.split("/").pop()||"image",Y.content),re="";for(let N in _){for(let x in _[N])if(_[N][x].path===Y.path){re=_[N][x].altText||"";break}if(re)break}if(re&&(ie.altText=re),v.push(ie),e.ocr&&ie.mimeType.startsWith("image/"))try{let N=await ns(Y.content,e.ocrLanguage);N.trim()&&(ie.ocrText=N.trim())}catch(N){ci(`OCR failed for ${ie.name}:`,e,N)}}for(let Y of y){let ie={type:"chart",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",data:Y.content.toString("base64"),name:Y.path.split("/").pop()||"",extension:"xml"};try{let re=Yu(Y.content);ie.chartData=re}catch(re){ci(`Failed to extract chart data from ${Y.path}:`,e,re)}v.push(ie)}}let E={};if(e.extractAttachments){let k=f.filter($=>$.path.match(c));for(let $ of k){let ie=`xl/drawings/${$.path.split("/").pop()?.replace(".rels","")||""}`,re=Wt($.content.toString()),N=Le(re,"Relationship");E[ie]||(E[ie]={});for(let x of N){let P=x.getAttribute("Id"),C=x.getAttribute("Target"),j=x.getAttribute("Type");if(P&&C&&j&&j.includes("chart")){let U=C.split("/").pop()||"";E[ie][P]=U}}}}let S={},A=f.find(k=>k.path==="xl/workbook.xml"),F=f.find(k=>k.path==="xl/_rels/workbook.xml.rels");if(A&&F){let k=Wt(F.content.toString()),$=Le(k,"Relationship"),Y={};for(let N of $){let x=N.getAttribute("Id"),P=N.getAttribute("Target");if(x&&P){let C=P.split("/").pop()||"";Y[x]=C}}let ie=Wt(A.content.toString()),re=Le(ie,"sheet");for(let N of re){let x=N.getAttribute("name"),P=N.getAttribute("r:id");x&&P&&Y[P]&&(S[Y[P]]=x)}}let D=[],H=[];for(let k of f)if(!k.path.match(s)&&k.path!==o&&k.path!=="xl/styles.xml"&&!k.path.match(n)&&!k.path.match(i)&&!k.path.match(u)&&!k.path.match(c)&&k.path.match(t)){e.includeRawContent&&H.push(k.content.toString());let $=[],Y=/<row.*?>[\s\S]*?<\/row>/g,ie=k.content.toString().match(Y);if(ie)for(let x of ie){let P=[],C=/<c.*?>[\s\S]*?<\/c>/g,j=x.match(C),U=x.match(/r="(\d+)"/),B=U?parseInt(U[1])-1:0;if(j)for(let Q of j){let fe=Q.match(/t="([a-z]+)"/),_e=fe?fe[1]:"n",te=Q.match(/<v>(.*?)<\/v>/),W=Q.match(/<t>(.*?)<\/t>/),oe="",be=[];if(_e==="s"&&te){let ae=parseInt(te[1]),ge=p[ae];Array.isArray(ge)?(be=JSON.parse(JSON.stringify(ge)),oe=be.map(Se=>Se.text).join("")):oe=ge||""}else _e==="inlineStr"&&W?oe=W[1]:te&&(oe=te[1]);let xe=Q.match(/r="([A-Z]+)(\d+)"/),M=(xe?xe[1]:"").charCodeAt(0)-65;if(oe||be.length>0){let ae=Q.match(/s="(\d+)"/),ge=ae?parseInt(ae[1]):void 0,Se=ge!==void 0&&b[ge]?b[ge]:{};if(be.length>0)for(let de of be)de.formatting||(de.formatting={}),Se.backgroundColor&&(de.formatting.backgroundColor=Se.backgroundColor),Se.alignment&&(de.formatting.alignment=Se.alignment),!de.formatting.font&&Se.font&&(de.formatting.font=Se.font),!de.formatting.size&&Se.size&&(de.formatting.size=Se.size);else be.push({type:"text",text:oe,formatting:Se});let we={type:"cell",text:oe,children:be,metadata:{row:B,col:M}};e.includeRawContent&&(we.rawContent=Q),P.push(we)}}if(P.length>0){let Q={type:"row",children:P,metadata:void 0};e.includeRawContent&&(Q.rawContent=x),$.push(Q)}}if(e.extractAttachments){let P=`xl/worksheets/_rels/${k.path.split("/").pop()||""}.rels`,C=f.find(B=>B.path===P),j={};if(C){let B=Wt(C.content.toString()),Q=Le(B,"Relationship");for(let fe of Q){let _e=fe.getAttribute("Id"),te=fe.getAttribute("Target"),W=fe.getAttribute("Type");_e&&te&&W&&W.includes("drawing")&&(j[_e]="xl/drawings/"+te.replace("../drawings/",""))}}let U=k.content.toString().match(/<drawing r:id="(.*?)"/g);if(U)for(let B of U){let Q=B.match(/r:id="(.*?)"/),fe=Q?Q[1]:null;if(fe&&j[fe]){let _e=j[fe],te=_[_e];if(te)for(let oe in te){let be=te[oe],xe=v.find(X=>X.name===be.path.split("/").pop());if(xe){let X={type:"image",text:"",children:[],metadata:{attachmentName:xe.name||"unknown",altText:be.altText||void 0}};$.push(X)}}let W=E[_e];if(W)for(let oe in W){let be=W[oe];if(v.find(X=>X.name===be)){let X={type:"chart",text:"",children:[],metadata:{attachmentName:be}};$.push(X)}}}}}let re=k.path.split("/").pop()||"Sheet",N=S[re]||re;D.push({type:"sheet",children:$,metadata:{sheetName:N},rawContent:e.includeRawContent?k.content.toString():void 0})}let J=f.find(k=>k.path.match(a)),K=J?bl(J.content.toString()):{},ne=k=>{for(let $ of k){if("attachmentName"in($.metadata||{})){let Y=$.metadata,ie=v.find(re=>re.name===Y.attachmentName);ie&&($.type==="image"&&(ie.ocrText&&($.text=ie.ocrText),Y.altText&&(ie.altText=Y.altText)),$.type==="chart"&&ie.chartData&&($.text=ie.chartData.rawTexts.join(e.newlineDelimiter||`
105
+ `)))}$.children&&ne($.children)}};return ne(D),{type:"xlsx",metadata:K,content:D,attachments:v,toText:()=>D.map(k=>{let $=Y=>{let ie="";return Y.children?ie+=Y.children.map($).filter(re=>re!="").join(Y.children[0]?.children?e.newlineDelimiter??`
106
+ `:""):ie+=Y.text||"",ie};return $(k)}).filter(k=>k!="").join(e.newlineDelimiter??`
107
+ `)}};Ce();De();Re();var eB=async(r,e)=>{let t=/content\.xml/,n=/Object \d+\/content\.xml/,i=/(Pictures|media)\/.*/,o=/meta\.xml/,s=/styles\.xml/,a=/mimetype/,u=await Tl(r,Y=>!!Y.match(t)||!!Y.match(n)||!!Y.match(o)||!!Y.match(s)||!!Y.match(a)||!!e.extractAttachments&&!!Y.match(i)),c=u.find(Y=>Y.path==="mimetype"),f="odt";if(c){let Y=c.content.toString().trim();Y.includes("spreadsheet")?f="ods":Y.includes("presentation")?f="odp":Y.includes("text")&&(f="odt")}let h=u.find(Y=>Y.path==="content.xml")||u.find(Y=>Y.path.match(t)),p=u.find(Y=>Y.path==="styles.xml"),m=[],b=[],v={},w={},y={};p&&(Y=>{let ie=Wt(Y),re=Le(ie,"style:style");for(let N of re){let x=N.getAttribute("style:name");if(!x)continue;let P={},C=Le(N,"style:paragraph-properties")[0];if(C){let Q=C.getAttribute("fo:text-align");if(Q){let _e={start:"left",left:"left",center:"center",end:"right",right:"right",justify:"justify"};_e[Q]&&(P.alignment=_e[Q])}Le(C,"style:drop-cap")[0]&&(P.dropCap=!0)}Object.keys(P).length>0&&(w[x]=P);let j=Le(N,"style:text-properties")[0],U=Le(N,"style:table-cell-properties")[0],B={};if(U){let Q=U.getAttribute("fo:background-color");Q&&Q!=="transparent"&&(B.backgroundColor=Q)}if(j){(j.getAttribute("fo:font-weight")==="bold"||j.getAttribute("style:font-weight-asian")==="bold")&&(B.bold=!0),(j.getAttribute("fo:font-style")==="italic"||j.getAttribute("style:font-style-asian")==="italic")&&(B.italic=!0),j.getAttribute("style:text-underline-style")==="solid"&&(B.underline=!0),j.getAttribute("style:text-line-through-style")==="solid"&&(B.strikethrough=!0);let Q=j.getAttribute("fo:font-size")||j.getAttribute("style:font-size-asian");Q&&(B.size=Q);let fe=j.getAttribute("fo:color");fe&&(B.color=fe);let _e=j.getAttribute("fo:background-color");_e&&_e!=="transparent"&&(B.backgroundColor=_e);let te=j.getAttribute("style:font-name")||j.getAttribute("fo:font-family");te&&(B.font=te);let W=j.getAttribute("style:text-position");W&&(W.startsWith("sub")&&(B.subscript=!0),W.startsWith("super")&&(B.superscript=!0)),Object.keys(B).length>0&&(v[x]=B)}}})(p.content.toString());let E=(Y,ie,re,N,x,P={},C)=>{let j=[],U="";if(!Y.childNodes)return{text:"",children:[]};for(let B=0;B<Y.childNodes.length;B++){let Q=Y.childNodes[B];if(Q.nodeType===3){let fe=Q.textContent||"";fe&&(U+=fe,j.push({type:"text",text:fe,formatting:P,metadata:C?{...C}:void 0}))}else if(Q.nodeType===1){let fe=Q,_e=fe.tagName;if(_e==="text:s"){let te=parseInt(fe.getAttribute("text:c")||"1"),W=" ".repeat(te);U+=W,j.push({type:"text",text:W,formatting:P,metadata:C?{...C}:void 0})}else if(_e==="text:tab")U+=" ",j.push({type:"text",text:" ",formatting:P,metadata:C?{...C}:void 0});else if(_e==="text:line-break")U+=`
108
+ `,j.push({type:"text",text:`
109
+ `,formatting:P,metadata:C?{...C}:void 0});else if(_e==="text:span"){let te=fe.getAttribute("text:style-name"),W=te?{...P,...ie[te]}:P,oe=E(fe,ie,re,N,x,W,C);U+=oe.text,j.push(...oe.children)}else if(_e==="text:a"){let te=fe.getAttribute("xlink:href")||"",W=te.startsWith("#")?"internal":"external",be=E(fe,ie,re,N,x,P,{link:te,linkType:W});U+=be.text,j.push(...be.children)}else if(_e==="text:note"&&!re.ignoreNotes){let te=fe.getAttribute("text:note-class")||"footnote",W=fe.getAttribute("text:id")||fe.getAttribute("xml:id")||void 0,oe=Le(fe,"text:note-body")[0];if(oe){let be=Le(oe,"text:p"),xe=[],X="";for(let ae of be){let ge=S(ae,x,ie,re);X+=(X?" ":"")+ge.text;let Se={type:"paragraph",text:ge.text,children:ge.children,metadata:ge.alignment?{alignment:ge.alignment}:void 0};xe.push(Se)}let M={type:"note",text:X,children:xe,metadata:{noteType:te,noteId:W}};re.putNotesAtLast?N.push(M):j.push(M)}}else if(_e==="draw:frame"){let te=fe,W="",oe=Le(te,"svg:title")[0],be=Le(te,"svg:desc")[0];oe&&oe.textContent?W=oe.textContent:be&&be.textContent&&(W=be.textContent);let xe="",X=Le(te,"draw:image");if(X.length>0&&(xe=X[0].getAttribute("xlink:href")||"",xe)){let ae=xe.split("/");xe=ae[ae.length-1]}let M={type:"image",text:"",children:[],metadata:{attachmentName:xe,...W?{altText:W}:{}}};re.includeRawContent&&(M.rawContent=te.toString()),j.push(M)}}}return{text:U,children:j}},S=(Y,ie,re,N)=>{let x=Y.getAttribute("text:style-name"),P=x?ie[x]:void 0,C=P?.alignment,j=P?.dropCap,U=E(Y,re,N,b,ie);if(x&&U.children.forEach(B=>{if(B.type==="text"){B.metadata||(B.metadata={});let Q=B.metadata;Q.style||(Q.style=x)}}),U.children.length===0&&Y.textContent){let B=Y.textContent;B.trim()&&(U.text=B,U.children.push({type:"text",text:B}))}if(j&&U.children.length>0){let B=U.children[0];if(B.type==="text"&&B.text)if(B.text.length===1)B.formatting={...B.formatting,size:"58.5pt"};else{let Q=B.text[0],fe=B.text.substring(1),_e={type:"text",text:Q,formatting:{...B.formatting,size:"58.5pt"},metadata:B.metadata};B.text=fe,U.children.unshift(_e)}}return{text:U.text,children:U.children,alignment:C,style:x||void 0}},A=(Y,ie,re,N)=>{let x=[],P=En(Y,"table:table-row"),C=0;for(let j of P){let U=[],B=En(j,"table:table-cell"),Q=parseInt(j.getAttribute("table:number-rows-repeated")||"1"),fe=0;for(let _e of B){let te=[],W={value:""},oe=parseInt(_e.getAttribute("table:number-columns-repeated")||"1"),be=parseInt(_e.getAttribute("table:number-columns-spanned")||"1"),xe=parseInt(_e.getAttribute("table:number-rows-spanned")||"1"),X=ae=>{if(ae.childNodes)for(let ge=0;ge<ae.childNodes.length;ge++){let Se=ae.childNodes[ge];if(Se.nodeType===1){let we=Se;if(we.tagName==="text:p"||we.tagName==="text:h"){let de=S(we,ie,re,N),Ae={type:we.tagName==="text:h"?"heading":"paragraph",text:de.text,children:de.children,metadata:{...de.alignment?{alignment:de.alignment}:{},...de.style?{style:de.style}:{}}};Object.keys(Ae.metadata||{}).length===0&&delete Ae.metadata,we.tagName==="text:h"&&(Ae.metadata||(Ae.metadata={}),Ae.metadata.level=parseInt(we.getAttribute("text:outline-level")||"1")),N.includeRawContent&&(Ae.rawContent=we.toString()),te.push(Ae),W.value+=de.text,W.value&&!W.value.endsWith(`
110
+ `)&&(W.value+=`
111
+ `)}else if(we.tagName==="table:table"){let de=A(we,ie,re,N);te.push(de)}else(we.tagName==="draw:frame"||we.tagName==="draw:text-box")&&X(we)}}};X(_e);let M=W.value;M.endsWith(`
112
+ `)&&(M=M.slice(0,-1));for(let ae=0;ae<oe;ae++){let ge={type:"cell",text:M,children:te.length>0?ae===0?te:JSON.parse(JSON.stringify(te)):[],metadata:{row:C,col:fe}},Se=ge.metadata;be>1&&(Se.colSpan=be),xe>1&&(Se.rowSpan=xe),N.includeRawContent&&(ge.rawContent=_e.toString()),U.push(ge),fe++}}for(let _e=0;_e<Q;_e++){let te={type:"row",children:_e===0?U:JSON.parse(JSON.stringify(U))};_e>0&&te.children?.forEach(W=>{W.metadata&&"row"in W.metadata&&(W.metadata.row=C)}),N.includeRawContent&&(te.rawContent=j.toString()),x.push(te),C++}}return{type:"table",children:x}};h&&(Y=>{let ie=Wt(Y),re=Le(ie,"office:body")[0],N=Le(ie,"office:automatic-styles")[0];if(N){let P=Le(N,"style:style");for(let C of P){let j=C.getAttribute("style:name");if(!j)continue;let U=Le(C,"style:paragraph-properties")[0],B={};if(U){let fe=U.getAttribute("fo:text-align");if(fe){let te={start:"left",left:"left",center:"center",end:"right",right:"right",justify:"justify"};te[fe]&&(B.alignment=te[fe])}Le(U,"style:drop-cap")[0]&&(B.dropCap=!0)}Object.keys(B).length>0&&(w[j]=B);let Q=Le(C,"style:text-properties")[0];if(Q){let fe={};(Q.getAttribute("fo:font-weight")==="bold"||Q.getAttribute("style:font-weight-asian")==="bold")&&(fe.bold=!0),(Q.getAttribute("fo:font-style")==="italic"||Q.getAttribute("style:font-style-asian")==="italic")&&(fe.italic=!0),Q.getAttribute("style:text-underline-style")==="solid"&&(fe.underline=!0),Q.getAttribute("style:text-line-through-style")==="solid"&&(fe.strikethrough=!0);let _e=Q.getAttribute("fo:font-size")||Q.getAttribute("style:font-size-asian");_e&&(fe.size=_e);let te=Q.getAttribute("fo:color");te&&(fe.color=te);let W=Q.getAttribute("fo:background-color");W&&W!=="transparent"&&(fe.backgroundColor=W);let oe=Q.getAttribute("style:font-name")||Q.getAttribute("fo:font-family");oe&&(fe.font=oe);let be=Q.getAttribute("style:text-position");be&&(be.startsWith("sub")&&(fe.subscript=!0),be.startsWith("super")&&(fe.superscript=!0)),Object.keys(fe).length>0&&(v[j]=fe)}}}let x=(P,C,j=!1)=>{if(P.tagName==="text:p"){let U=S(P,w,v,e),B=j||(P.getAttribute("text:style-name")||"").toLowerCase().includes("title")?"heading":"paragraph",Q={type:B,text:U.text,children:U.children,metadata:{...U.alignment?{alignment:U.alignment}:{},...U.style?{style:U.style}:{}}};B==="heading"&&Q.metadata&&(Q.metadata.level=Q.metadata.level||1),Object.keys(Q.metadata||{}).length===0&&delete Q.metadata,e.includeRawContent&&(Q.rawContent=P.toString()),C.push(Q)}else if(P.tagName==="text:h"){let U=parseInt(P.getAttribute("text:outline-level")||"1"),B=S(P,w,v,e),Q={type:"heading",text:B.text,children:B.children,metadata:{level:U,...B.alignment?{alignment:B.alignment}:{},...B.style?{style:B.style}:{}}};e.includeRawContent&&(Q.rawContent=P.toString()),C.push(Q)}else if(P.tagName==="table:table"){let U=A(P,w,v,e);e.includeRawContent&&(U.rawContent=P.toString()),C.push(U)}else if(P.tagName==="text:list"){let U=En(P,"text:list-item"),B=P.getAttribute("text:style-name")||P.getAttribute("xml:id"),Q=B||`list-${C.length}`,fe="unordered",_e=!1,te=B;if(!te){let xe=P.parentNode;for(;xe&&!te&&!(xe.nodeName==="text:list"&&(te=xe.getAttribute("text:style-name"),te));)xe=xe.parentNode}if(te){let xe=Le(Wt(h?.content.toString()||""),"office:automatic-styles")[0];if(xe){let X=Le(xe,"text:list-style");for(let M of X)if(M.getAttribute("style:name")===te){let ae=Le(M,"text:list-level-style-bullet"),ge=Le(M,"text:list-level-style-number"),Se=Le(M,"text:list-level-style-image");ge.length>0?(fe="ordered",_e=ge.some(we=>!!we.getAttribute("style:num-format"))):ae.length>0&&(fe="unordered",_e=ae.some(we=>!!we.getAttribute("text:bullet-char"))),Se.length>0&&(_e=!0);break}}if(p&&!_e){let X=Wt(p.content.toString()),M=Le(X,"text:list-style");for(let ae of M)if(ae.getAttribute("style:name")===te){let ge=Le(ae,"text:list-level-style-bullet"),Se=Le(ae,"text:list-level-style-number"),we=Le(ae,"text:list-level-style-image");Se.length>0?(fe="ordered",_e=Se.some(de=>!!de.getAttribute("style:num-format"))):ge.length>0&&(fe="unordered",_e=ge.some(de=>!!de.getAttribute("text:bullet-char"))),we.length>0&&(_e=!0);break}}}if(!_e){for(let xe=0;xe<U.length;xe++){let X=U[xe];if(X.childNodes)for(let M=0;M<X.childNodes.length;M++){let ae=X.childNodes[M];ae.nodeType===1&&x(ae,C,j)}}return}let W=0,oe=P.parentNode;for(;oe;)oe.nodeName==="text:list"&&W++,oe=oe.parentNode;y[Q]||(y[Q]={});let be=W.toString();y[Q][be]===void 0&&(y[Q][be]=-1);for(let xe=0;xe<U.length;xe++){let X=U[xe];y[Q][be]++;let M=y[Q][be];for(let ae=W+1;ae<10;ae++)y[Q][ae.toString()]!==void 0&&(y[Q][ae.toString()]=-1);if(X.childNodes)for(let ae=0;ae<X.childNodes.length;ae++){let ge=X.childNodes[ae];if(ge.nodeType===1){let Se=ge;if(Se.tagName==="text:p"){let we=S(Se,w,v,e),de={type:"list",text:we.text,children:we.children,metadata:{listType:fe,indentation:W,itemIndex:M,listId:Q,alignment:we.alignment||"left",style:we.style}};e.includeRawContent&&(de.rawContent=Se.toString()),C.push(de)}else if(Se.tagName==="text:h"){let we=parseInt(Se.getAttribute("text:outline-level")||"1"),de=S(Se,w,v,e),Ae={type:"list",text:de.text,children:de.children,metadata:{listType:fe,indentation:W,itemIndex:M,listId:Q,...de.alignment?{alignment:de.alignment}:{},style:de.style}};e.includeRawContent&&(Ae.rawContent=Se.toString()),C.push(Ae)}else Se.tagName==="text:list"&&x(Se,C,j)}}}}else if(P.tagName==="draw:frame"){let U=P.getAttribute("presentation:class"),B=U==="title"||U==="sub-title",Q=Le(P,"draw:text-box")[0],fe=Le(P,"draw:image")[0],_e=Le(P,"table:table")[0],te=Le(P,"draw:object")[0];if(Q)x(Q,C,B||j);else if(_e){let W=A(_e,w,v,e);e.includeRawContent&&(W.rawContent=_e.toString()),C.push(W)}else if(fe){let W="",oe=Le(P,"svg:title")[0],be=Le(P,"svg:desc")[0];oe&&oe.textContent?W=oe.textContent:be&&be.textContent&&(W=be.textContent);let xe=fe.getAttribute("xlink:href")||"";if(xe){let M=xe.split("/");xe=M[M.length-1]}let X={type:"image",text:"",children:[],metadata:{attachmentName:xe,...W?{altText:W}:{}}};e.includeRawContent&&(X.rawContent=P.toString()),C.push(X)}else if(te){let W=te.getAttribute("xlink:href");if(W){let oe=W.split("/")[0],be=`${oe}/content.xml`,xe=u.find(X=>X.path===be||X.path.endsWith(be));if(xe){let X=Yu(xe.content),M={type:"chart",text:X.rawTexts.join(" "),metadata:{attachmentName:oe,chartData:X}};e.includeRawContent&&(M.rawContent=P.toString()),C.push(M)}else{let X={type:"chart",text:"",metadata:{attachmentName:oe}};e.includeRawContent&&(X.rawContent=P.toString()),C.push(X)}}}}else if(P.childNodes)for(let U=0;U<P.childNodes.length;U++){let B=P.childNodes[U];B.nodeType===1&&x(B,C,j)}};if(f==="ods"){let P=Le(re,"office:spreadsheet")[0];if(P){let C=Le(P,"table:table");for(let j=0;j<C.length;j++){let U=C[j],B=U.getAttribute("table:name")||`Sheet${j+1}`,Q=[],fe=Le(U,"table:table-row"),_e=0;for(let W=0;W<fe.length;W++){let oe=fe[W],be=[],xe=Le(oe,"table:table-cell"),X=0,M=parseInt(oe.getAttribute("table:number-rows-repeated")||"1");for(let ae=0;ae<xe.length;ae++){let ge=xe[ae],Se=parseInt(ge.getAttribute("table:number-columns-repeated")||"1"),we="",de=[],Ae=Le(ge,"text:p");for(let ke=0;ke<Ae.length;ke++){let Oe=Ae[ke],Ve=Le(Oe,"text:span");if(Ve.length>0)for(let Je of Ve){let et=Je.getAttribute("text:style-name"),T=et?v[et]:{},d=Je.textContent||"";we+=d;let g={type:"text",text:d,formatting:T};de.push(g)}else{let Je=Oe.textContent||"";if(we+=Je,Je.trim()){let et={type:"text",text:Je,formatting:{}};de.push(et)}}ke<Ae.length-1&&(we+=`
113
+ `)}let je=Le(ge,"draw:frame");for(let ke of je){let Oe="",Ve=Le(ke,"svg:title")[0],Je=Le(ke,"svg:desc")[0];Ve&&Ve.textContent?Oe=Ve.textContent:Je&&Je.textContent&&(Oe=Je.textContent);let et="",T=Le(ke,"draw:image");if(T.length>0){let I=T[0].getAttribute("xlink:href");if(I){let Z=I.split("/");et=Z[Z.length-1]}}let d="",g=Le(ke,"draw:object");if(g.length>0){let I=g[0].getAttribute("xlink:href");I&&(d=I.split("/")[0])}if(T.length>0){let I={type:"image",text:"",children:[],metadata:{attachmentName:et,...Oe?{altText:Oe}:{}}};e.includeRawContent&&(I.rawContent=ke.toString()),de.push(I)}else if(d){let I={type:"chart",text:"",children:[],metadata:{attachmentName:d}};de.push(I)}}for(let ke=0;ke<Se;ke++){if(we||de.length>0||f!=="ods"){let Oe={type:"cell",text:we,children:de,metadata:{row:_e,col:X}};e.includeRawContent&&(Oe.rawContent=ge.toString()),be.push(Oe)}X++}}if(be.length>0)for(let ae=0;ae<M;ae++){let ge={type:"row",children:JSON.parse(JSON.stringify(be)),metadata:void 0};ae>0&&ge.children?.forEach(Se=>{Se.metadata&&"row"in Se.metadata&&(Se.metadata.row=_e)}),e.includeRawContent&&(ge.rawContent=oe.toString()),Q.push(ge),_e++}else _e+=M}let te={type:"sheet",children:Q,metadata:{sheetName:B}};e.includeRawContent&&(te.rawContent=U.toString()),m.push(te)}}}else if(f==="odp"){let P=Le(re,"office:presentation")[0];if(P){let C=En(P,"draw:page"),j=[];for(let U=0;U<C.length;U++){let B=C[U],Q={type:"slide",children:[],metadata:{slideNumber:U+1}},fe,_e=B.childNodes;if(_e)for(let te=0;te<_e.length;te++){let W=_e[te];if(W.nodeType===1){let oe=W;if(oe.tagName==="presentation:notes"){e.ignoreNotes||(fe={type:"note",children:[],metadata:{slideNumber:U+1,noteId:`slide-note-${U+1}`}},x(oe,fe.children));continue}x(oe,Q.children)}}e.includeRawContent&&(Q.rawContent=B.toString()),m.push(Q),fe&&fe.children&&fe.children.length>0&&(e.putNotesAtLast?j.push(fe):m.push(fe))}j.length>0&&m.push(...j)}}else{let P=Le(re,"office:text")[0];P&&x(P,m)}})(h.content.toString());let D=[],H=u.filter(Y=>Y.path.match(/(Pictures|media)\/.*/));if(e.extractAttachments){let Y=u.filter(ie=>ie.path.match(/Object \d+\/content\.xml/));for(let ie of Y){let re=Wt(ie.content.toString());if(Le(re,"chart:chart").length>0){let x=ie.path.split("/")[0],P={type:"chart",mimeType:"application/vnd.oasis.opendocument.chart",data:ie.content.toString("base64"),name:x,extension:"xml"},C=Yu(ie.content);C.rawTexts.length>0&&(P.chartData=C),D.push(P)}}}if(e.extractAttachments)for(let Y of H){let ie=Is(Y.path.split("/").pop()||"image",Y.content);if(D.push(ie),e.ocr&&ie.mimeType.startsWith("image/"))try{ie.ocrText=(await ns(Y.content,e.ocrLanguage)).trim()}catch(re){ci(`OCR failed for ${ie.name}:`,e,re)}}let J=u.find(Y=>Y.path.match(o)),K=J?bl(J.content.toString()):{},ne=(Y,ie)=>{let re=x=>{let P=x.replace(/^\[|\]$/g,""),[C,j]=P.split(":"),U=C.lastIndexOf(".");if(U===-1)return[x];let B=C.substring(0,U).replace(/^'|'$/g,""),Q=C.substring(U+1).replace(/\$/g,""),fe=Q;if(j)if(j.startsWith("."))fe=j.substring(1).replace(/\$/g,"");else{let xe=j.lastIndexOf(".");fe=j.substring(xe+1).replace(/\$/g,"")}let _e=xe=>{let X=xe.match(/[A-Z]+/),M=xe.match(/\d+/);if(!X||!M)return null;let ae=X[0],ge=0;for(let we=0;we<ae.length;we++)ge=ge*26+(ae.charCodeAt(we)-65+1);return ge-=1,{r:parseInt(M[0])-1,c:ge}},te=_e(Q),W=_e(fe);if(!te||!W)return[x];let oe=ie.find(xe=>xe.type==="sheet"&&xe.metadata?.sheetName===B);if(!oe||!oe.children)return[x];let be=[];for(let xe of oe.children)if(xe.children)for(let X of xe.children){let M=X.metadata;M&&M.row>=te.r&&M.row<=W.r&&M.col>=te.c&&M.col<=W.c&&be.push(X.text||"")}return be.length>0?be:[]};for(let x of Y.dataSets){let P=[];for(let C of x.values)C.startsWith("[")?P.push(...re(C)):P.push(C);x.values=P}let N=[];for(let x of Y.labels)x.startsWith("[")?N.push(...re(x)):N.push(x);Y.labels=N,Y.rawTexts=[],Y.title&&Y.rawTexts.push(Y.title);for(let x of Y.dataSets)x.name&&Y.rawTexts.push(x.name),Y.rawTexts.push(...Y.labels),Y.rawTexts.push(...x.values)};for(let Y of D)Y.type==="chart"&&Y.chartData&&ne(Y.chartData,m);(Y=>{let ie=new Set,re=C=>{for(let j of C){if(j.metadata&&"attachmentName"in j.metadata){let U=j.metadata.attachmentName;U&&ie.add(U)}j.children&&re(j.children)}};re(Y);let N=D.filter(C=>C.type==="image"&&C.name&&!ie.has(C.name)),x=0,P=C=>{if((C.type==="image"||C.type==="chart")&&C.metadata&&"attachmentName"in C.metadata){let j=C.metadata.attachmentName;if(!j&&C.type==="image"&&x<N.length&&(j=N[x++].name,C.metadata.attachmentName=j),j){let U=D.find(B=>B.name===j);U&&(U.ocrText&&(C.text=U.ocrText),U.chartData&&C.type==="chart"&&(C.text=U.chartData.rawTexts.join(e.newlineDelimiter??`
114
+ `)))}}C.children&&C.children.forEach(P)};Y.forEach(P)})(m);let $={};for(let Y in v)$[Y]={formatting:v[Y],alignment:w[Y]?.alignment};for(let Y in w)$[Y]||($[Y]={formatting:{},alignment:w[Y]?.alignment});return e.putNotesAtLast&&b.length>0&&m.push(...b),{type:f,metadata:{...K,styleMap:$},content:m,attachments:D,toText:()=>m.map(Y=>{let ie=re=>{let N="";if(re.children&&re.children.length>0){let P=re.children.some(C=>C.children&&C.children.length>0)?e.newlineDelimiter??`
115
+ `:"";N+=re.children.map(ie).filter(C=>C!="").join(P)}else N+=re.text||"";return N};return ie(Y)}).filter(Y=>Y!="").join(e.newlineDelimiter??`
116
+ `)}};Ce();De();Re();function A3(r){if(r)try{let e=r.startsWith("D:")?r.slice(2):r,t=parseInt(e.slice(0,4),10),n=parseInt(e.slice(4,6),10)-1,i=parseInt(e.slice(6,8),10)||1,o=parseInt(e.slice(8,10),10)||0,s=parseInt(e.slice(10,12),10)||0,a=parseInt(e.slice(12,14),10)||0,u=e.slice(14).match(/([+-Z])(\d{2})'?(\d{2})?'?/);if(u){let c=u[1]==="-"?-1:1,f=parseInt(u[2],10)||0,h=parseInt(u[3],10)||0,p=c*(f*60+h),m=Date.UTC(t,n,i,o,s,a);return new Date(m-p*6e4)}return new Date(t,n,i,o,s,a)}catch{try{return new Date(r)}catch{return}}}function _V(r){let e=[];for(let i of r)for(let o of i)o.type==="text"&&o.height>0&&e.push(o.height);if(e.length===0)return{median:12,max:12};e.sort((i,o)=>i-o);let t=e[Math.floor(e.length/2)],n=e[e.length-1];return{median:t,max:n}}function EV(r,e){if(r<=e.median*1.2)return 0;let t=r/e.median;return t>=2?1:t>=1.7?2:t>=1.5?3:t>=1.35?4:t>=1.2?5:0}function AV(r,e){let t=r.x+r.width/2,n=r.y+r.height/2;for(let i of e){let[o,s,a,u]=i.rect,c=Math.min(o,a),f=Math.max(o,a),h=Math.min(s,u),p=Math.max(s,u);if(t>=c&&t<=f&&n>=h&&n<=p)return i}}function xV(r,e,t){let n=Math.floor((24*r+31)/32)*4,i=n-r*3,o=54,s=n*e,a=o+s,u=Buffer.alloc(a);u.write("BM",0),u.writeUInt32LE(a,2),u.writeUInt32LE(0,6),u.writeUInt32LE(o,10),u.writeUInt32LE(40,14),u.writeInt32LE(r,18),u.writeInt32LE(-e,22),u.writeUInt16LE(1,26),u.writeUInt16LE(24,28),u.writeUInt32LE(0,30),u.writeUInt32LE(s,34),u.writeInt32LE(2835,38),u.writeInt32LE(2835,42),u.writeUInt32LE(0,46),u.writeUInt32LE(0,50);let c=o;for(let f=0;f<e;f++){for(let h=0;h<r;h++){let p=(f*r+h)*4,m=t[p+0],b=t[p+1],v=t[p+2],y=t[p+3]/255,_=Math.round(m*y+255*(1-y)),E=Math.round(b*y+255*(1-y)),S=Math.round(v*y+255*(1-y));u[c+0]=S,u[c+1]=E,u[c+2]=_,c+=3}for(let h=0;h<i;h++)u[c]=0,c++}return u}function SV(r,e,t,n){let i;if(n===1){i=new Uint8ClampedArray(e*t*4);for(let o=0;o<e*t;o++){let s=r[o];i[o*4]=s,i[o*4+1]=s,i[o*4+2]=s,i[o*4+3]=255}}else if(n===2||r.length===e*t*3){i=new Uint8ClampedArray(e*t*4);for(let o=0;o<e*t;o++)i[o*4]=r[o*3],i[o*4+1]=r[o*3+1],i[o*4+2]=r[o*3+2],i[o*4+3]=255}else i=r instanceof Uint8ClampedArray?r:new Uint8ClampedArray(r);return Buffer.from(i.buffer,i.byteOffset,i.byteLength)}var x3=async(r,e)=>{let t;if(typeof window>"u"){let b=new Function("specifier","return import(specifier)");try{t=await b("pdfjs-dist/legacy/build/pdf.mjs")}catch{t=await b("pdfjs-dist")}}else t=await Promise.resolve().then(()=>(E3(),_3));if(e.pdfWorkerSrc)t.GlobalWorkerOptions.workerSrc=e.pdfWorkerSrc;else if(typeof window<"u")t.GlobalWorkerOptions.workerSrc="https://unpkg.com/pdfjs-dist@5.4.530/build/pdf.worker.min.mjs";else try{let b=Au.resolve("pdfjs-dist/legacy/build/pdf.worker.mjs");t.GlobalWorkerOptions.workerSrc=b}catch(b){e.outputErrorToConsole&&console.warn("[PdfParser] Could not auto-resolve local worker path:",b)}let n=new Uint8Array(r),i=t.getDocument({data:n,verbosity:0}),o;try{o=await i.promise}catch(b){throw b.message?.includes("workerSrc")||b.message?.includes('No "GlobalWorkerOptions.workerSrc" specified')?na("PDF_WORKER_MISSING",e):b}let s=[],a=[],u=o.numPages,c=[],h=(await o.getMetadata().catch(()=>({info:{}}))).info,p={pages:u,title:h?.Title||void 0,author:h?.Author||void 0,subject:h?.Subject||void 0,description:h?.Keywords||void 0,created:A3(h?.CreationDate),modified:A3(h?.ModDate)};try{let b=await o.getAttachments();if(b&&e.extractAttachments)for(let v in b){let w=b[v],y=Buffer.from(w.content),_=Is(w.filename,y);a.push(_)}}catch(b){e.outputErrorToConsole&&console.error("Error extracting embedded attachments:",b)}for(let b=1;b<=u;b++){let v,w,y=[];try{v=await o.getPage(b),w=await v.getTextContent()}catch(E){e.outputErrorToConsole&&console.warn(`[PdfParser] Error loading page ${b}:`,E),c.push(y);continue}let _=v.commonObjs;for(let E of w.items){let S=E.transform,A=S[4],F=S[5],D=E.width||0,H=E.height||Math.abs(S[3])||12,J={},K;if(E.fontName&&_)try{if(_.has(E.fontName)){let ne=await new Promise(k=>{_.get(E.fontName,$=>k($))});if(ne?.name){K=ne.name.replace(/^[A-Z]{6}\+/,""),J.font=K;let k=ne.name.toLowerCase();k.includes("bold")&&(J.bold=!0),(k.includes("italic")||k.includes("oblique"))&&(J.italic=!0)}}}catch{}H>0&&(J.size=Math.round(H).toString()),y.push({type:"text",x:A,y:F,width:D,height:H,text:E.str,fontName:K,formatting:J})}if(e.extractAttachments||e.ocr)try{let E=await v.getOperatorList(),S=E.fnArray,A=E.argsArray;for(let F=0;F<S.length;F++){let D=S[F];if(D===t.OPS.dependency){let H=A[F];for(let J of H)try{if(v.objs.has(J))continue;await new Promise(K=>{let ne=setTimeout(()=>{K()},500);v.objs.get(J,k=>{clearTimeout(ne),K()})})}catch(K){e.outputErrorToConsole&&console.error(`[PdfParser] Failed to load dependency ${J}:`,K)}}if(D===t.OPS.paintImageXObject||D===t.OPS.paintXObject){let H=A[F][0];try{let J=v.objs.has(H),K=v.objs;if(!J&&v.commonObjs.has(H)&&(J=!0,K=v.commonObjs),J){let k=await new Promise($=>{K.get(H,Y=>$(Y))});if(typeof window<"u"&&!k.data&&k.bitmap)try{let $=document.createElement("canvas");$.width=k.width,$.height=k.height;let Y=$.getContext("2d");Y&&(Y.drawImage(k.bitmap,0,0),k.data=Y.getImageData(0,0,k.width,k.height).data,k.kind=3)}catch($){e.outputErrorToConsole&&console.error("[PdfParser] Failed to extract from ImageBitmap:",$)}if(k?.data&&k.width>0&&k.height>0){let $=0,Y=0;for(let ie=F-1;ie>=0;ie--)if(S[ie]===t.OPS.transform){$=A[ie][4],Y=A[ie][5];break}y.push({type:"image",x:$,y:Y,name:H,data:k.data,width:k.width,height:k.height,kind:k.kind})}}}catch{}}}}catch(E){e.outputErrorToConsole&&console.error(`Error extracting images from page ${b}:`,E)}c.push(y)}let m=_V(c);for(let b=0;b<c.length;b++){let v=b+1,w;try{w=await o.getPage(v)}catch(H){e.outputErrorToConsole&&console.warn(`[PdfParser] Error loading page ${v} in second pass:`,H);continue}let y=c[b],_=[],E=[];try{let H=await w.getAnnotations();for(let J of H)J.subtype==="Link"&&J.rect&&E.push({rect:J.rect,url:J.url,dest:J.dest})}catch(H){e.outputErrorToConsole&&console.error(`Error extracting annotations from page ${v}:`,H)}y.sort((H,J)=>Math.abs(J.y-H.y)>5?J.y-H.y:H.x-J.x);let S=null,A=0,F=-1,D=0;for(let H of y)if(H.type==="text"){let J=H.text;if(!J)continue;if(F!==-1&&Math.abs(H.y-F)>5&&S&&((S.text||"").trim().length>0&&_.push(S),S=null),!S&&J.trim().length===0){F=H.y;continue}let ne=EV(H.height,m);if(S||(ne>0?S={type:"heading",text:"",children:[],metadata:{level:ne}}:S={type:"paragraph",text:"",children:[]},A=H.height),J.trim().length===0){if(S.children&&S.children.length>0){let ie=S.children[S.children.length-1];ie.type==="text"&&ie.text&&(ie.text+=J,S.text+=J)}F=H.y;continue}if(S.text&&S.text.length>0&&!S.text.endsWith(" ")&&(S.text+=" ",S.children&&S.children.length>0)){let ie=S.children[S.children.length-1];ie.type==="text"&&ie.text&&(ie.text+=" ")}S.text+=J;let k=AV(H,E),$;k&&(k.url?$={link:k.url,linkType:k.url.startsWith("#")?"internal":"external"}:k.dest&&($={link:typeof k.dest=="string"?`#${k.dest}`:"#internal",linkType:"internal"}));let Y=!1;if(S.children&&S.children.length>0&&!$){let ie=S.children[S.children.length-1];ie.type==="text"&&TV(ie.formatting,H.formatting)&&!ie.metadata&&(ie.text=(ie.text||"")+J,Y=!0)}if(!Y){let ie={type:"text",text:J,formatting:Object.keys(H.formatting).length>0?H.formatting:void 0};$&&(ie.metadata=$),S.children?.push(ie)}F=H.y}else if(H.type==="image"){S&&((S.text||"").trim().length>0&&_.push(S),S=null),D++;let J=`pdf_image_p${v}_${D}.bmp`;if(e.extractAttachments)try{let K=SV(H.data,H.width,H.height,H.kind),ne=xV(H.width,H.height,new Uint8Array(K)),k=Is(J,ne);if(k.mimeType="image/bmp",e.ocr)try{H.width>=10&&H.height>=10&&(k.ocrText=(await ns(ne,e.ocrLanguage)).trim())}catch(Y){e.outputErrorToConsole&&console.error(`OCR failed for ${J}:`,Y)}a.push(k);let $={attachmentName:J};_.push({type:"image",text:k.ocrText||"",metadata:{...$}})}catch(K){ci(`Failed to process image ${J}:`,e,K)}}S&&(S.text||"").trim().length>0&&_.push(S),s.push({type:"page",children:_,text:_.map(H=>H.text).join(e.newlineDelimiter??`
117
+
118
+ `),metadata:{pageNumber:v}})}return{type:"pdf",metadata:p,content:s,attachments:a,toText:()=>s.map(b=>b.text).join(e.newlineDelimiter??`
119
+
120
+ `)}};function TV(r,e){if(!r&&!e)return!0;if(!r||!e)return!1;let t=Object.keys(r).sort(),n=Object.keys(e).sort();if(t.length!==n.length)return!1;for(let i=0;i<t.length;i++){let o=t[i];if(t[i]!==n[i]||r[o]!==e[o])return!1}return!0}Ce();De();Re();var S3=xu(Ib());var T3=async(r,e)=>{let t=/ppt\/(notesSlides|slides)\/(notesSlide|slide)\d+.xml/g,n=/ppt\/slides\/slide\d+.xml/g,i=/ppt\/slides\/_rels\/slide\d+\.xml\.rels/,o=/lide(\d+)\.xml/,s=/ppt\/media\/.*/,a=/ppt\/charts\/chart\d+\.xml/,u=/docProps\/core\.xml/,c=new S3.XMLSerializer,f=await Tl(r,ie=>!!ie.match(e.ignoreNotes?n:t)||!!ie.match(u)||!!ie.match(i)||!!e.extractAttachments&&(!!ie.match(s)||!!ie.match(a))),h=f.find(ie=>ie.path.match(u)),p=h?bl(h.content.toString()):{};f.sort((ie,re)=>{let N=ie.path.match(o),x=re.path.match(o),P=N?parseInt(N[1]):0,C=x?parseInt(x[1]):0;return P-C});let m=[],b=[],v={},w=0,y=0,_=!1,E=null,S=0,A={},F=ie=>{let re=[],N=Le(ie,"a:tr");for(let x=0;x<N.length;x++){let P=N[x],C=[],j=Le(P,"a:tc");for(let B=0;B<j.length;B++){let Q=j[B],fe=[],_e="",te=Le(Q,"a:txBody")[0];if(te){let oe=Le(te,"a:p");for(let be of oe){let xe={type:"paragraph",text:"",children:[],metadata:{}};e.includeRawContent&&(xe.rawContent=be.toString());let X=Le(be,"a:r");for(let M of X){let ae=Le(M,"a:t")[0];if(ae&&ae.childNodes[0]){let ge=ae.childNodes[0].nodeValue||"";xe.text+=ge;let Se=Le(M,"a:rPr")[0],we={};if(Se){Se.getAttribute("b")==="1"&&(we.bold=!0),Se.getAttribute("i")==="1"&&(we.italic=!0),Se.getAttribute("u")==="sng"&&(we.underline=!0),Se.getAttribute("strike")==="sngStrike"&&(we.strikethrough=!0);let de=Se.getAttribute("sz");de&&(we.size=(parseInt(de)/100).toString()+"pt");let Ae=Le(Se,"a:solidFill")[0];if(Ae){let ke=Le(Ae,"a:srgbClr")[0];if(ke){let Oe=ke.getAttribute("val");Oe&&(we.color="#"+Oe)}}let je=Le(Se,"a:latin")[0];if(je){let ke=je.getAttribute("typeface");ke&&(we.font=ke)}}xe.children?.push({type:"text",text:ge,formatting:we})}}fe.push(xe),_e+=xe.text}}let W={type:"cell",text:_e,children:fe,metadata:{row:x,col:B}};C.push(W)}let U={type:"row",children:C};re.push(U)}return{type:"table",children:re}},D=(ie,re)=>{let N=Le(ie,"a:blip")[0];if(!N)return null;let x=N.getAttribute("r:embed");if(!x)return null;let P=v[re]?.[x];if(!P||P.type!=="image")return null;let C=P.target,j=Le(ie,"p:nvPicPr")[0],B=(j?Le(j,"p:cNvPr")[0]:null)?.getAttribute("descr")||void 0;return{type:"image",text:"",metadata:{attachmentName:C,altText:B}}},H=(ie,re)=>{let N=Le(ie,"a:graphicData")[0];if(!N||!(N.getAttribute("uri")==="http://schemas.openxmlformats.org/drawingml/2006/chart"))return null;let C=Le(N,"c:chart")[0];if(!C)return null;let j=C.getAttribute("r:id");if(!j)return null;let U=v[re]?.[j];if(!U||U.type!=="chart")return null;let Q={type:"chart",text:"",metadata:{attachmentName:U.target}};return e.includeRawContent&&(Q.rawContent=c.serializeToString(ie)),Q},J=(ie,re)=>{let N=Le(ie,"a:tbl")[0];if(N){let x=F(N);if(e.includeRawContent&&(x.rawContent=c.serializeToString(ie)),x.children&&x.children.length>0)return x}if(ie.getElementsByTagName("c:chart").length>0){let x=H(ie,re);if(x)return x}return null},K=(ie,re)=>{let N=[],x=Le(ie,"p:nvSpPr")[0],P=x?Le(x,"p:nvPr")[0]:null,C=P?Le(P,"p:ph")[0]:null,j=C?C.getAttribute("type"):"body",U=j==="title"||j==="ctrTitle",B=Le(ie,"p:txBody")[0];if(B){let Q=Le(B,"a:p");for(let fe=0;fe<Q.length;fe++){let _e=Q[fe],te={type:U?"heading":"paragraph",text:"",children:[],metadata:U?{level:1}:{}},W=Le(_e,"a:pPr")[0],oe=!1,be="unordered",xe=0;if(W){let M=W.getAttribute("lvl");M&&(xe=parseInt(M));let ae=Le(W,"a:buAutoNum")[0],ge=Le(W,"a:buChar")[0],Se=Le(W,"a:buBlip")[0],we=Le(W,"a:bu")[0];ae?(oe=!0,be="ordered"):(ge||Se||we)&&(oe=!0,be="unordered");let de=W.getAttribute("algn");if(de){let Ae={l:"left",ctr:"center",r:"right",just:"justify"};Ae[de]&&(te.metadata.alignment=Ae[de])}}if(oe){te.type="list";let M=xe;if(!_||be!==E){w++;for(let ge in A)delete A[ge];y=0,A[M]=0}else if(M>S)y=0,A[M]=0;else if(M<S){for(let Se in A){let we=parseInt(Se);we>M&&delete A[we]}y=(A[M]||0)+1,A[M]=y}else y=(A[M]||0)+1,A[M]=y;_=!0,E=be,S=M,te.metadata={...te.metadata,listType:be,indentation:M,listId:w.toString(),itemIndex:y,alignment:te.metadata?.alignment||"left"}}else _=!1,E=null,S=0;U&&(te.metadata={...te.metadata,level:1}),e.includeRawContent&&(te.rawContent=_e.toString());let X=Le(_e,"a:r");for(let M=0;M<X.length;M++){let ae=X[M],ge=Le(ae,"a:t")[0];if(ge&&ge.childNodes[0]){let Se=ge.childNodes[0].nodeValue||"";te.text+=Se;let we=Le(ae,"a:rPr")[0],de={};if(we){we.getAttribute("b")==="1"&&(de.bold=!0),we.getAttribute("i")==="1"&&(de.italic=!0),we.getAttribute("u")==="sng"&&(de.underline=!0),we.getAttribute("strike")==="sngStrike"&&(de.strikethrough=!0);let ke=we.getAttribute("sz");ke&&(de.size=(parseInt(ke)/100).toString()+"pt");let Oe=Le(we,"a:solidFill")[0];if(Oe){let T=Le(Oe,"a:srgbClr")[0];if(T){let d=T.getAttribute("val");d&&(de.color="#"+d)}}let Ve=Le(we,"a:highlight")[0];if(Ve){let T=Le(Ve,"a:srgbClr")[0];if(T){let d=T.getAttribute("val");d&&(de.backgroundColor="#"+d)}}let Je=Le(we,"a:latin")[0];if(Je){let T=Je.getAttribute("typeface");T&&(de.font=T)}let et=we.getAttribute("baseline");if(et){let T=parseInt(et);T<0&&(de.subscript=!0),T>0&&(de.superscript=!0)}}let Ae={type:"text",text:Se,formatting:de},je=Le(ae,"a:hlinkClick")[0];if(je){let ke=je.getAttribute("r:id"),Oe=je.getAttribute("action"),Ve,Je;ke&&v[re]&&v[re][ke]&&v[re][ke].type==="hyperlink"?(Ve=v[re][ke].target,Je="external"):ke&&v[re]&&v[re][ke]&&v[re][ke].type==="slide"?(Ve=v[re][ke].target,Je="internal"):Oe&&(Ve=Oe,Je="internal"),Ve&&(Ae.metadata={link:Ve,linkType:Je})}te.children?.push(Ae)}}te.text&&N.push(te)}}return N};function ne(ie,re){let N=[];for(let x of Array.from(ie?.childNodes||[])){if(x.nodeType!==1)continue;let P=x,C=P.tagName;if(C==="p:sp")N.push(...K(P,re));else if(C==="p:pic"){let j=D(P,re);j&&N.push(j)}else if(C==="p:graphicFrame"){let j=J(P,re);j&&N.push(j)}else if(C==="p:grpSp"){let j=P.getElementsByTagName("p:spTree")[0];N.push(...ne(j,re))}}return N}for(let ie of f)if(ie.path.match(i)){let re=ie.path.match(/slide(\d+)\.xml\.rels/);if(re){let N=parseInt(re[1]);v[N]={};let x=Wt(ie.content.toString()),P=Le(x,"Relationship");for(let C=0;C<P.length;C++){let j=P[C].getAttribute("Id"),U=P[C].getAttribute("Type"),B=P[C].getAttribute("Target");if(j&&U&&B){let Q="other";U.includes("relationships/image")?Q="image":U.includes("relationships/hyperlink")?Q="hyperlink":U.includes("relationships/chart")?Q="chart":U.includes("relationships/slide")?Q="slide":U.includes("relationships/notesSlide")&&(Q="notes");let fe=B;B.startsWith("http://")||B.startsWith("https://")||(fe=fe.split("/").pop()||""),v[N][j]={type:Q,target:fe}}}}}for(let ie of f){if(ie.path.match(s)||ie.path.match(a)||ie.path.match(i)||ie.path.match(u))continue;let re=ie.content.toString(),N=Wt(re);e.includeRawContent&&b.push(re);let x=ie.path.match(o),P=x?parseInt(x[1]):0,C=ie.path.includes("notesSlide"),j={type:C?"note":"slide",children:[],metadata:{slideNumber:P,...C?{noteId:`slide-note-${P}`}:{}}};e.includeRawContent&&(j.rawContent=ie.content.toString());let U=Le(N,"p:spTree")[0];U&&j.children?.push(...ne(U,P)),j.children&&j.children.length>0&&m.push(j)}let k=[],$=f.filter(ie=>ie.path.match(/ppt\/media\/.*/)),Y=f.filter(ie=>ie.path.match(/ppt\/charts\/chart\d+\.xml/));if(e.extractAttachments){for(let re of $){let N=Is(re.path.split("/").pop()||"image",re.content);if(k.push(N),e.ocr&&N.mimeType.startsWith("image/"))try{N.ocrText=(await ns(re.content,e.ocrLanguage)).trim()}catch(x){ci(`OCR failed for ${N.name}:`,e,x)}}for(let re of Y){let N={type:"chart",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",data:re.content.toString("base64"),name:re.path.split("/").pop()||"",extension:"xml"};k.push(N);try{let x=await Yu(re.content);N.chartData=x}catch(x){ci(`Failed to extract text from chart ${re.path}:`,e,x)}}let ie=re=>{for(let N of re){if("attachmentName"in(N.metadata||{})){let x=N.metadata,P=k.find(C=>C.name===x.attachmentName);P&&(N.type==="image"&&(P.altText=x.altText,P.ocrText&&(N.text=P.ocrText)),N.type==="chart"&&(N.text=P.chartData?.rawTexts.join(e.newlineDelimiter||`
121
+ `)))}N.children&&ie(N.children)}};ie(m)}return!e.ignoreNotes&&e.putNotesAtLast&&m.sort((ie,re)=>{let N=ie.type==="note"?1:0,x=re.type==="note"?1:0;return N-x}),{type:"pptx",metadata:p,content:m,attachments:k,toText:()=>m.map(ie=>{let re=N=>{let x="";return N.children?x+=N.children.map(re).filter(P=>P!="").join(N.children[0]?.children?e.newlineDelimiter??`
122
+ `:""):x+=N.text||"",x};return re(ie)}).filter(ie=>ie!="").join(e.newlineDelimiter??`
123
+ `)}};Ce();De();Re();var CV={pngblip:"png",jpegblip:"jpeg",gifblip:"gif",tiffblip:"tiff",dibitmap:"bmp",wbitmap:"bmp"},RV={png:"image/png",jpeg:"image/jpeg",gif:"image/gif",tiff:"image/tiff",bmp:"image/bmp"},OT=class{constructor(e){this.index=0;this.buffer=e,this.length=e.length}parse(){let e={type:"group",content:[]},t=[e];for(;this.index<this.length;){let n=this.buffer[this.index],i=t[t.length-1];if(n===123){this.index++;let o={type:"group",content:[]};i.content.push(o),t.push(o)}else n===125?(this.index++,t.length>1&&t.pop()):n===92?(this.index++,this.parseControl(i)):n===13||n===10?this.index++:this.parseText(i)}return e}parseControl(e){if(this.index>=this.length)return;let t=this.buffer[this.index];if(t===123||t===125||t===92){e.content.push({type:"text",value:String.fromCharCode(t)}),this.index++;return}if(t===39){if(this.index++,this.index+1<this.length){let a=this.buffer.toString("utf8",this.index,this.index+2),u=parseInt(a,16);if(!isNaN(u)){let f={128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376}[u]||u;e.content.push({type:"text",value:String.fromCharCode(f)})}this.index+=2}return}if(t===42){e.content.push({type:"control",value:"*"}),this.index++;return}let n="";for(;this.index<this.length;){let a=this.buffer[this.index];if(a>=97&&a<=122||a>=65&&a<=90)n+=String.fromCharCode(a),this.index++;else break}let i,o=!1,s="";for(this.index<this.length&&this.buffer[this.index]===45&&(s+="-",this.index++);this.index<this.length;){let a=this.buffer[this.index];if(a>=48&&a<=57)s+=String.fromCharCode(a),this.index++,o=!0;else break}if(o&&(i=parseInt(s,10)),this.index<this.length&&this.buffer[this.index]===32&&this.index++,n==="bin"&&i!==void 0&&i>0){this.index+=i;return}e.content.push({type:"control",value:n,param:i}),(e.content.length===1&&e.type==="group"||e.content.length===2&&e.content[0].type==="control"&&e.content[0].value==="*")&&(e.destination=n)}parseText(e){let t="";for(;this.index<this.length;){let n=this.buffer[this.index];if(n===123||n===125||n===92||n===13||n===10)break;t+=String.fromCharCode(n),this.index++}t.length>0&&e.content.push({type:"text",value:t})}},C3=async(r,e)=>{try{let n=new OT(r).parse(),i=DV(n),o=IV(n),s=[],a=[],u=[],c="",f=[],h="",p="",m={},b=s,v=0,w="left",y=!1,_,E,S,A,F,D=[],H=0,J=()=>D.length>0?D[D.length-1]:void 0,K=()=>{D.length===0&&D.push({rows:[],currentCells:[],currentCellContent:[],rowIndex:0})},ne=!1,k=!1,$=0,Y=[],ie={isMergedContinuation:!1},re=0,N=0,x={},P=!1,C=!1,j,U,B={},Q=!1,fe,_e,te={},W={},oe,be=(d,g)=>d.bold!==g.bold||d.italic!==g.italic||d.underline!==g.underline||d.strikethrough!==g.strikethrough||d.size!==g.size||d.font!==g.font||d.color!==g.color||d.backgroundColor!==g.backgroundColor||d.subscript!==g.subscript||d.superscript!==g.superscript,xe=()=>{if(p){let d={type:"text",text:p,formatting:{...m}};oe&&(d.metadata={link:oe,linkType:de(oe)}),f.push(d),c+=p,p=""}},X=!1,M=()=>{xe();let d=c||f.length>0;if(ne&&!k&&!X&&d){let g=c,I=[...f],Z=h;c="",f=[],h="",Se(),c=g,f=I,h=Z}if(d){let g="paragraph",I;if(E!==void 0&&E>0)g="heading",I={level:E},A=void 0,F=void 0;else if(y){g="list";let R=S||A,le=_||F||"unordered",pe=0;R&&(W[R]||(W[R]={}),W[R][v]===void 0?W[R][v]=0:W[R][v]++,pe=W[R][v]),I={listType:le,indentation:v,listId:R||"",itemIndex:pe,alignment:w},R&&(A=R),le&&(F=le)}let Z={type:g,text:c,children:f,formatting:void 0,metadata:I};e.includeRawContent&&h&&(Z.rawContent=h),ne&&k?(K(),J().currentCellContent.push(Z)):b.push(Z),c="",f=[],h="",v=0,y=!1,_=void 0,E=void 0,S=void 0}},ae=d=>{M();let g=d||J();if(!g)return;let I={type:"cell",text:g.currentCellContent.map(Z=>Z.text).join(`
124
+ `),children:[...g.currentCellContent],metadata:{row:g.rowIndex,col:g.currentCells.length}};return g.currentCellContent=[],I},ge=d=>{let g=d||J();if(!g)return;let I=ae(g);if(I&&(I.children&&I.children.length>0||I.text)&&g.currentCells.push(I),g.currentCells.length>0){let Z={type:"row",text:g.currentCells.map(R=>R.text).filter(R=>R!=="").join(e.newlineDelimiter??`
125
+ `),children:[...g.currentCells]};g.rows.push(Z),g.currentCells=[],g.rowIndex++}},Se=()=>{if(X)return;X=!0;let d=J();if(!d){X=!1;return}if(ge(d),d.rows.length>0){$++;let g={type:"table",text:d.rows.map(I=>I.text).join(`
126
+ `),children:[...d.rows]};D.length>1?D[D.length-2].currentCellContent.push(g):b.push(g)}D.pop(),D.length===0&&(ne=!1,k=!1),X=!1},we=d=>{let g,I=Z=>{if(Z.type==="text"){let R=Z.value,le=R.match(/HYPERLINK\s+"([^"]+)"/i);if(le)return le[1];let pe=R.match(/"(https?:\/\/[^"]+|mailto:[^"]+|#[^"]+)"/);if(pe)return pe[1]}else if(Z.type==="group"){let R=!1,le;for(let pe of Z.content)if(pe.type==="text"){pe.value.toUpperCase().includes("HYPERLINK")&&(R=!0);let ve=pe.value.match(/"([^"]+)"/);ve&&R&&(le=ve[1])}else if(pe.type==="group"){let Ee=I(pe);Ee&&(le=Ee)}if(le)return le}};for(let Z of d.content)if(Z.type==="group"){let R=I(Z);if(R)return R}return g},de=d=>{let g=d.trim();return g.startsWith("#")||!/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(g)?"internal":"external"},Ae=d=>{let g="",I=Z=>{if(Z.type==="text")g+=Z.value;else if(Z.type==="group")for(let R of Z.content)I(R)};for(let Z of d.content)I(Z);return g},je=d=>{let g,I="";for(let R of d.content)if(R.type==="control"){let le=CV[R.value];le&&(g=le)}else R.type==="text"?I+=R.value.replace(/[^0-9a-fA-F]/g,""):R.type;if(!g||I.length===0)return;let Z=RV[g];if(Z)try{let R=Buffer.from(I,"hex"),le=g,pe=`image_${u.length+1}.${le}`;return{type:"image",mimeType:Z,data:R.toString("base64"),name:pe,extension:le}}catch{return}},ke=d=>{if(!/^[a-zA-Z]/.test(d.value))return`\\${d.value}`;let g=`\\${d.value}`;return d.param!==void 0&&(g+=d.param),g+=" ",g},Oe=d=>d.value.replace(/([\\{}])/g,"\\$1"),Ve=(d,g,I=0)=>{if(d.type==="group"){let Z=["fonttbl","colortbl","stylesheet","info","macpict","pmmetafile","wmetafile","dibitmap","bitmap","object","nextGenerator","header","footer","nonshppict","xml","private","upnp","ud","filetbl","operator","author","creatim","revtim","printim","comment","fldinst","listtext","pntext"],R=!1,le=!1,pe=!1,Ee=!1;if(d.destination){if(d.destination==="footnote")le=!0;else if(d.destination==="field"){let V=we(d);V&&(xe(),pe=!0,oe=V)}else if(d.destination==="listtable")P=!0;else if(P&&d.destination==="list")C=!0,j=void 0,U=void 0;else if(d.destination==="listoverridetable")Q=!0;else if(Q&&d.destination==="listoverride")fe=void 0,_e=void 0;else if(d.destination==="pict")e.extractAttachments?Ee=!0:R=!0;else if(Z.includes(d.destination))R=!0;else if(d.content.length>0&&d.content[0].type==="control"&&d.content[0].value==="*"){let V=["fldinst","nesttableprops"];e.extractAttachments&&V.push("shppict","listpicture"),V.includes(d.destination||"")||(R=!0)}}if(d.destination==="listtext"||d.destination==="pntext"){y||(v=0),y=!0;let V=Ae(d);if(V){let Fe=V.trim();["\xB7","\u2022","o","\xA7","\u25A0","\u25A1","\u25CF","\u25CB","\u25C6","\u25C7","\u25BA","\u25B8","\xB7","\u2022","\u25CF","\u25CB"].some(Pe=>Fe.includes(Pe))||Fe.length===1&&!/[0-9a-zA-Z]/.test(Fe)?_="unordered":(/^[0-9ivxlcdm]+[\.\)]/i.test(Fe)||/^[a-z][\.\)]/i.test(Fe))&&(_="ordered")}R=!0}if(R)return;if(h+="{",Ee){let V=je(d);V&&(u.push(V),!P&&!C&&(M(),b.push({type:"image",text:"",metadata:{attachmentName:V.name||`image_${u.length}`}})));for(let Fe of d.content)if(Fe.type==="control")h+=ke(Fe);else if(Fe.type==="text")h+=Oe(Fe);else if(Fe.type==="group"){let st=O=>{for(let Pe of O.content)Pe.type==="control"?h+=ke(Pe):Pe.type==="text"?h+=Oe(Pe):Pe.type==="group"&&(h+="{",st(Pe),h+="}")};st(d)}h+="}";return}let ve=b;if(le){if(e.ignoreNotes)return;M(),H++;let V={type:"note",children:[],metadata:{noteId:H.toString(),noteType:"footnote"}};a.push(V),b=V.children}let Ie={...g};for(let V of d.content){if(V.type==="group"&&V.destination==="fldinst"){h+="{";let Fe=st=>{for(let O of st.content)O.type==="control"?h+=ke(O):O.type==="text"?h+=Oe(O):O.type==="group"&&(h+="{",Fe(O),h+="}")};Fe(V),h+="}";continue}Ve(V,Ie,I+1)}d.destination==="listtable"?P=!1:d.destination==="list"?(C=!1,j!==void 0&&U!==void 0&&(B[j]=U)):d.destination==="listoverridetable"?Q=!1:Q&&d.destination==="listoverride"&&_e!==void 0&&fe!==void 0&&(te[_e]=fe),le&&(M(),b=ve),pe&&(xe(),oe=void 0),h+="}"}else if(d.type==="text"){if(P||Q){h+=Oe(d);return}be(m,g)&&(xe(),m={...g}),p+=d.value,h+=Oe(d)}else if(d.type==="control"){if(h+=ke(d),P){if(d.value==="listid")j=d.param;else if(d.value==="levelnfc"||d.value==="levelnfcn"){let Z=d.param!==void 0&&(d.param===0||d.param>=0&&d.param<=4);(!U||U==="unordered"&&Z)&&(U=Z?"ordered":"unordered")}return}if(Q){d.value==="listid"?fe=d.param:d.value==="ls"&&(_e=d.param);return}if(d.value==="par")M(),m={...g};else if(d.value==="trowd"){let Z=J();ne&&Z&&Z.currentCellContent.length>0?(K(),D.push({rows:[],currentCells:[],currentCellContent:[],rowIndex:0})):ne||(ne=!0,K()),k=!0,Y=[],ie={isMergedContinuation:!1},re=0}else if(d.value==="clvmrg")ie.isMergedContinuation=!0;else if(d.value==="clmgf")ie.isMergedContinuation=!1;else if(d.value==="cellx")Y.push({...ie}),ie={isMergedContinuation:!1};else if(d.value==="cell"){k=!0;let Z=!1;re<Y.length&&(Z=Y[re].isMergedContinuation),re++;let R=ae();if(R&&!Z){let le=J();le&&le.currentCells.push(R)}m={...g}}else if(d.value==="nestcell"){if(D.length>1){let R=J();R&&(R.rows.length>0||R.currentCells.length>0)&&Se()}k=!0;let Z=ae();if(Z){let R=J();R&&R.currentCells.push(Z)}m={...g}}else if(d.value==="row")ge(),m={...g},re=0,k=!1;else if(d.value==="nestrow")D.length>1&&Se(),ge(),m={...g},re=0;else if(d.value==="intbl")ne=!0,k=!0,K();else if(d.value==="pard")k=!1,v=0,w="left",y=!1,_=void 0,E=void 0,S=void 0,g.backgroundColor=void 0;else if(d.value==="tab")be(m,g)&&(xe(),m={...g}),p+=" ";else if(d.value==="line")be(m,g)&&(xe(),m={...g}),p+=`
127
+ `;else if(d.value==="lquote")be(m,g)&&(xe(),m={...g}),p+="\u2018";else if(d.value==="rquote")be(m,g)&&(xe(),m={...g}),p+="\u2019";else if(d.value==="ldblquote")be(m,g)&&(xe(),m={...g}),p+="\u201C";else if(d.value==="rdblquote")be(m,g)&&(xe(),m={...g}),p+="\u201D";else if(d.value==="u"){if(d.param!==void 0){let Z=d.param;Z<0&&(Z+=65536),be(m,g)&&(xe(),m={...g}),p+=String.fromCharCode(Z)}}else if(d.value==="b")g.bold=d.param!==0;else if(d.value==="i")g.italic=d.param!==0;else if(d.value==="ul")g.underline=d.param!==0;else if(d.value==="ulnone")g.underline=!1;else if(d.value==="strike")g.strikethrough=d.param!==0;else if(d.value==="plain")g.bold=!1,g.italic=!1,g.underline=!1,g.strikethrough=!1,g.subscript=!1,g.superscript=!1,g.size=void 0,g.font=void 0,g.color=void 0,g.backgroundColor=void 0;else if(d.value==="fs")d.param!==void 0&&(g.size=(d.param/2).toString()+"pt");else if(d.value==="f")d.param!==void 0&&i[d.param]&&(g.font=i[d.param]);else if(d.value==="cf")d.param!==void 0&&o[d.param]&&(g.color=o[d.param]);else if(d.value==="cb"||d.value==="highlight"||d.value==="chcbpat"||d.value==="cbpat")d.param!==void 0&&o[d.param]&&(g.backgroundColor=o[d.param]);else if(d.value==="sub")g.subscript=!0,g.superscript=!1;else if(d.value==="super")g.superscript=!0,g.subscript=!1;else if(d.value==="nosupersub")g.subscript=!1,g.superscript=!1;else if(d.value==="li")d.param!==void 0&&(v=Math.floor(d.param/360));else if(d.value==="ls"){if(d.param!==void 0){y||(v=0),y=!0,x[d.param]||(N++,x[d.param]=`rtf-list-${N}`),S=x[d.param];let Z=te[d.param]!==void 0?te[d.param]:d.param;B[Z]&&(_=B[Z])}}else d.value==="ilvl"?d.param!==void 0&&(y=!0,v=d.param):d.value==="pnlvl"?(y=!0,d.param!==void 0&&(v=d.param)):d.value==="levelnfc"||d.value==="pnf"?d.param!==void 0&&(y=!0,d.param===23?_="unordered":_="ordered"):d.value==="pndec"||d.value==="pnord"||d.value==="pnlcltr"||d.value==="pnucltr"?(y||(v=0),y=!0,_="ordered"):d.value==="pnbullet"||d.value==="pncard"?(y||(v=0),y=!0,_="unordered"):d.value==="s"?d.param!==void 0&&d.param>=1&&d.param<=9&&(E=d.param):d.value==="ql"?w="left":d.value==="qc"?w="center":d.value==="qr"?w="right":d.value==="qj"&&(w="justify")}};Ve(n,{});let Je=J();if((ne||Je&&(Je.rows.length>0||Je.currentCells.length>0))&&Se(),M(),!e.putNotesAtLast&&a.length>0&&(s.push(...a),a.length=0),e.ocr&&e.extractAttachments){for(let g of u)if(g.mimeType.startsWith("image/"))try{let I=Buffer.from(g.data,"base64");g.ocrText=(await ns(I,e.ocrLanguage)).trim()}catch(I){ci(`OCR failed for ${g.name}:`,e,I)}let d=g=>{for(let I of g){if(I.type==="image"&&I.metadata&&"attachmentName"in I.metadata){let Z=I.metadata,R=u.find(le=>le.name===Z.attachmentName);R&&(R.ocrText&&(I.text=R.ocrText),R.altText&&(Z.altText=R.altText))}I.children&&d(I.children)}};d(s)}let et=d=>{for(let g of d){if(g.type==="note"&&g.children){let I=Z=>Z.children&&Z.children.length>0?Z.children.map(I).join(""):Z.text||"";g.text=g.children.map(I).join("").trim()}g.children&&et(g.children)}};et(s),et(a);let T={type:"rtf",metadata:{},content:s,attachments:u,toText:()=>{let d=s.map(g=>g.text).join(e.newlineDelimiter??`
128
+ `);return e.putNotesAtLast&&a.length>0&&(d+=(e.newlineDelimiter??`
129
+ `)+a.map(g=>g.text).join(e.newlineDelimiter??`
130
+ `)),d}};return e.putNotesAtLast&&a.length>0&&s.push(...a),T}catch(t){throw t}};function DV(r){let e={},t=n=>{for(let i of n.content)if(i.type==="group"){if(i.destination==="fonttbl"){for(let o of i.content)if(o.type==="group"){let s,a="";for(let u of o.content)u.type==="control"&&u.value==="f"?s=u.param:u.type==="text"&&(a+=u.value);s!==void 0&&a&&(a=a.replace(/;$/,"").trim(),e[s]=a)}return!0}if(t(i))return!0}return!1};return t(r),e}function IV(r){let e={},t=n=>{for(let i of n.content)if(i.type==="group"){if(i.destination==="colortbl"){let o=0,s=0,a=0,u=0;for(let c of i.content)if(c.type==="control")c.value==="red"&&c.param!==void 0?s=c.param:c.value==="green"&&c.param!==void 0?a=c.param:c.value==="blue"&&c.param!==void 0&&(u=c.param);else if(c.type==="text"&&c.value===";"){let f=`#${s.toString(16).padStart(2,"0")}${a.toString(16).padStart(2,"0")}${u.toString(16).padStart(2,"0")}`;e[o]=f,o++,s=0,a=0,u=0}return!0}if(t(i))return!0}return!1};return t(r),e}Ce();De();Re();var R3=xu(Ib());var D3=async(r,e)=>{let t=/word\/document[\d+]?.xml/,n=/word\/footnotes[\d+]?.xml/,i=/word\/endnotes[\d+]?.xml/,o=/word\/numbering[\d+]?.xml/,s=/(word\/)?media\/.*/,a=/docProps\/core[\d+]?.xml/,u=/word\/_rels\/document[\d+]?.xml\.rels/,c=/word\/styles[\d+]?.xml/,f=new R3.XMLSerializer,h=x=>{let P={},C=f.serializeToString(x),j=(M,ae)=>{let ge=new RegExp(`<${ae}(?:\\s+w:val="([^"]+)")?\\s*\\/?>`),Se=M.match(ge);if(Se){let we=Se[1];return we===void 0?!0:we==="1"||we==="true"||we==="on"}return null},U=j(C,"w:b");U!==null&&(P.bold=U);let B=j(C,"w:i");B!==null&&(P.italic=B);let Q=C.match(/<w:u(?: w:val="([^"]+)")?\/?>/);if(Q){let M=Q[1];(!M||M!=="none")&&(P.underline=!0)}let fe=j(C,"w:strike"),_e=j(C,"w:dstrike");fe!==null?P.strikethrough=fe:_e!==null&&(P.strikethrough=_e);let te=C.match(/<w:sz w:val="(\d+)"/);te&&(P.size=(parseInt(te[1])/2).toString()+"pt");let W=C.match(/<w:color w:val="([^"]+)"/);W&&W[1]!=="auto"&&(P.color="#"+W[1]);let oe=C.match(/<w:shd[^>]*w:fill="([^"]+)"/);oe&&oe[1]!=="auto"&&(P.backgroundColor="#"+oe[1]);let be=C.match(/<w:highlight w:val="([^"]+)"/);if(be&&be[1]!=="none"){let M={yellow:"#FFFF00",green:"#00FF00",cyan:"#00FFFF",magenta:"#FF00FF",blue:"#0000FF",red:"#FF0000",darkBlue:"#00008B",darkCyan:"#008B8B",darkGreen:"#006400",darkMagenta:"#8B008B",darkRed:"#8B0000",darkYellow:"#808000",darkGray:"#A9A9A9",lightGray:"#D3D3D3",black:"#000000"};P.backgroundColor=M[be[1]]||be[1]}let xe=C.match(/<w:rFonts[^>]*w:ascii="([^"]+)"/);if(xe)P.font=xe[1];else{let M=C.match(/<w:rFonts[^>]*w:hAnsi="([^"]+)"/);M&&(P.font=M[1])}let X=C.match(/<w:vertAlign w:val="([^"]+)"/);return X&&(X[1]==="subscript"&&(P.subscript=!0),X[1]==="superscript"&&(P.superscript=!0)),P},p=await Tl(r,x=>!!x.match(t)||!!x.match(n)||!!x.match(i)||!!x.match(o)||!!x.match(a)||!!x.match(u)||!!x.match(c)||!!e.extractAttachments&&!!x.match(s)),m=p.find(x=>x.path.match(a)),b=m?bl(m.content.toString()):{},v=new Map,w=new Map,y=[],_=[],E=p.filter(x=>x.path.match(s)),S=p.find(x=>x.path.match(u)),A={};if(S){let x=Wt(S.content.toString()),P=Le(x,"Relationship");for(let C=0;C<P.length;C++){let j=P[C].getAttribute("Id"),U=P[C].getAttribute("Target");j&&U&&(A[j]=U)}}let F=p.find(x=>x.path.match(o)),D={};if(F){let x=Wt(F.content.toString()),P=Le(x,"w:num"),C=Le(x,"w:abstractNum"),j={};for(let U=0;U<C.length;U++){let B=C[U].getAttribute("w:abstractNumId");B&&(j[B]=C[U])}for(let U=0;U<P.length;U++){let B=P[U].getAttribute("w:numId"),fe=Le(P[U],"w:abstractNumId")[0]?.getAttribute("w:val");if(B&&fe&&j[fe]){D[B]={};let _e=Le(j[fe],"w:lvl");for(let te=0;te<_e.length;te++){let W=_e[te].getAttribute("w:ilvl"),oe=Le(_e[te],"w:numFmt")[0],be=Le(_e[te],"w:lvlText")[0];W&&(D[B][W]={numFmt:oe?.getAttribute("w:val")||"decimal",lvlText:be?.getAttribute("w:val")||""})}}}}let H=p.find(x=>x.path.match(c)),J={};if(H){let x=Wt(H.content.toString()),P=Le(x,"w:style");for(let C=0;C<P.length;C++){let j=P[C].getAttribute("w:styleId");if(j){let U=Le(P[C],"w:rPr")[0],B=Le(P[C],"w:pPr")[0],Q=U?h(U):{},fe,_e;if(B){let te=Le(B,"w:jc")[0];if(te){let oe=te.getAttribute("w:val");(oe==="left"||oe==="center"||oe==="right"||oe==="justify")&&(fe=oe)}let W=Le(B,"w:shd")[0];if(W){let oe=W.getAttribute("w:fill");oe&&oe!=="auto"&&(_e="#"+oe)}}J[j]={formatting:Q,alignment:fe,backgroundColor:_e}}}}let K={};if(H){let x=Wt(H.content.toString()),P=Le(x,"w:docDefaults")[0];if(P){let C=Le(P,"w:rPrDefault")[0];if(C){let j=Le(C,"w:rPr")[0];j&&(K=h(j))}}}let ne;if(H){let x=Wt(H.content.toString()),P=Le(x,"w:style");for(let C=0;C<P.length;C++){let j=P[C].getAttribute("w:type"),U=P[C].getAttribute("w:default"),B=P[C].getAttribute("w:styleId");if(j==="paragraph"&&U==="1"&&B){ne=B;break}}!ne&&J.Normal&&(ne="Normal")}let k=[],$=[],Y={},ie={},re=x=>{let P=f.serializeToString(x),C=Le(x,"w:numPr")[0],j=!!C,U=Le(x,"w:pPr")[0],B=U?Le(U,"w:pStyle")[0]:null,Q=B?B.getAttribute("w:val"):null,fe=Q?Q.startsWith("Heading")||Q==="Title":!1,_e=Q&&J[Q]?J[Q]:{formatting:{}},te=_e.alignment;if(U){let ae=Le(U,"w:jc")[0];if(ae){let ge=ae.getAttribute("w:val");(ge==="left"||ge==="center"||ge==="right"||ge==="justify")&&(te=ge)}}let W=_e.backgroundColor;if(U){let ae=Le(U,"w:shd")[0];if(ae){let ge=ae.getAttribute("w:fill");ge&&ge!=="auto"&&(W="#"+ge)}}let oe={..._e.formatting};if(U){let ae=Le(U,"w:rPr")[0];if(ae){let ge=h(ae);for(let Se in ge){let we=ge[Se];we===!1?delete oe[Se]:we!==void 0&&(oe[Se]=we)}}}let be="",xe=[],X=ae=>{if(ae.nodeName==="w:r"){let ge=ae,Se=Le(ge,"w:rPr")[0],we={};for(let ke in oe)we[ke]=oe[ke];let de=Se?Le(Se,"w:rStyle")[0]:null,Ae=de?de.getAttribute("w:val"):Q;if(Ae&&J[Ae])for(let ke in J[Ae].formatting)we[ke]=J[Ae].formatting[ke];if(Se){let ke=h(Se);for(let Oe in ke){let Ve=ke[Oe];Ve===!1?delete we[Oe]:Ve!==void 0&&(we[Oe]=Ve)}}!we.backgroundColor&&W&&(we.backgroundColor=W);let je=Le(ge,"w:t");for(let ke of je){let Oe=ke.textContent||"";be+=Oe;let Ve={type:"text",text:Oe,formatting:we};e.includeRawContent&&(Ve.rawContent=f.serializeToString(ke));let Je=Ae||Q||ne;Je&&(Ve.metadata={style:Je}),xe.push(Ve)}if(e.extractAttachments){let ke=Le(ge,"w:drawing"),Oe=Le(ge,"w:pict"),Ve=[...ke,...Oe];for(let Je of Ve){let et=f.serializeToString(Je),T="",d=Le(Je,"wp:docPr")[0];d&&(T=d.getAttribute("descr")||d.getAttribute("title")||"");let g="",I=Le(Je,"a:blip")[0];if(I)g=I.getAttribute("r:embed")||"";else{let Z=Le(Je,"v:imagedata")[0];Z&&(g=Z.getAttribute("r:id")||"")}if(g&&A[g]){let R=A[g].split("/").pop();if(R){let le={type:"image",text:"",metadata:{attachmentName:R,altText:T}};e.includeRawContent&&(le.rawContent=et),xe.push(le)}}else{let Z={type:"image",text:""};e.includeRawContent&&(Z.rawContent=et),xe.push(Z)}}}if(!e.ignoreNotes){let ke=Le(ge,"w:footnoteReference")[0];if(ke){let Ve=ke.getAttribute("w:id");if(Ve&&v.has(Ve)){let Je=v.get(Ve),et={type:"note",text:Je.map(T=>T.text).join(" "),children:Je,metadata:{noteType:"footnote",noteId:Ve}};e.putNotesAtLast?y.push(et):xe.push(et)}}let Oe=Le(ge,"w:endnoteReference")[0];if(Oe){let Ve=Oe.getAttribute("w:id");if(Ve&&w.has(Ve)){let Je=w.get(Ve),et={type:"note",text:Je.map(T=>T.text).join(" "),children:Je,metadata:{noteType:"endnote",noteId:Ve}};e.putNotesAtLast?y.push(et):xe.push(et)}}}}else if(ae.nodeName==="w:hyperlink"){let ge=ae,Se=ge.getAttribute("r:id"),we=ge.getAttribute("w:anchor"),de;we?de={link:"#"+we,linkType:"internal"}:Se&&A[Se]&&(de={link:A[Se],linkType:"external"});let Ae=Array.from(ge.childNodes);for(let je of Ae){let ke=xe.length;if(X(je),de)for(let Oe=ke;Oe<xe.length;Oe++)xe[Oe].type==="text"&&(xe[Oe].metadata={...xe[Oe].metadata??{},...de})}}},M=Array.from(x.childNodes);for(let ae of M)X(ae);if(j){let ae=Le(C,"w:numId")[0],ge=Le(C,"w:ilvl")[0],Se=ae&&ae.getAttribute("w:val")||"0",we=ge?parseInt(ge.getAttribute("w:val")||"0"):0,de="ordered",Ae=0;if(Se&&D[Se]){let ke=we.toString();Y[Se]||(Y[Se]={}),Y[Se][ke]||(Y[Se][ke]=0),Y[Se][ke]++;for(let Ve=we+1;Ve<10;Ve++)Y[Se][Ve.toString()]&&(Y[Se][Ve.toString()]=0);de=(D[Se][ke]?.numFmt||"decimal")==="bullet"?"unordered":"ordered",ie[Se]||(ie[Se]={}),ie[Se][ke]===void 0?ie[Se][ke]=0:ie[Se][ke]++,Ae=ie[Se][ke]}let je={type:"list",text:be,children:xe,metadata:{listType:de,indentation:we,alignment:te||"left",listId:Se,itemIndex:Ae,style:Q}};return e.includeRawContent&&(je.rawContent=P),je}else if(fe){let ae=Q&&parseInt(Q.replace("Heading",""))||1,ge={type:"heading",text:be,children:xe,metadata:{level:ae,alignment:te,style:Q??void 0}};return e.includeRawContent&&(ge.rawContent=P),ge}else{let ae={type:"paragraph",text:be,children:xe,metadata:{alignment:te,style:Q??void 0}};return e.includeRawContent&&(ae.rawContent=P),ae}},N=x=>{let P=[],C=En(x,"w:tr");for(let j=0;j<C.length;j++){let U=C[j],B=[],Q=En(U,"w:tc");for(let _e=0;_e<Q.length;_e++){let te=Q[_e],W=[],oe="",be=Array.from(te.childNodes);for(let X of be)if(X.nodeName==="w:p"){let M=re(X);W.push(M),oe+=M.text}else if(X.nodeName==="w:tbl"){let M=N(X);W.push(M)}let xe={type:"cell",text:oe,children:W,metadata:{row:j,col:_e}};B.push(xe)}let fe={type:"row",children:B};P.push(fe)}return{type:"table",children:P}};if(!e.ignoreNotes){let x=p.find(C=>C.path.match(n));if(x){let C=Wt(x.content.toString()),j=Le(C,"w:footnote");for(let U of j){let B=U.getAttribute("w:id");if(!B||B==="-1"||B==="0")continue;let Q=Le(U,"w:p");v.set(B,Q.map(fe=>re(fe)))}}let P=p.find(C=>C.path.match(i));if(P){let C=Wt(P.content.toString()),j=Le(C,"w:endnote");for(let U of j){let B=U.getAttribute("w:id");if(!B||B==="-1"||B==="0")continue;let Q=Le(U,"w:p");w.set(B,Q.map(fe=>re(fe)))}}}for(let x of p){if(x.path.match(s)||x.path.match(o)||x.path.match(u)||x.path.match(c)||x.path.match(n)||x.path.match(i))continue;let P=x.content.toString();e.includeRawContent&&$.push(P);let C=Wt(P),j=Le(C,"w:body")[0];if(j){let U=Array.from(j.childNodes);for(let B of U)B.nodeName==="w:p"?k.push(re(B)):B.nodeName==="w:tbl"&&k.push(N(B))}}if(e.extractAttachments){for(let x of E){let P=Is(x.path.split("/").pop()||"image",x.content);if(_.push(P),e.ocr&&P.mimeType.startsWith("image/"))try{P.ocrText=(await ns(x.content,e.ocrLanguage)).trim()}catch(C){ci(`OCR failed for ${P.name}:`,e,C)}}if(e.ocr){let x=P=>{for(let C of P){if(C.type==="image"&&"attachmentName"in(C.metadata||{})){let j=C.metadata,U=_.find(B=>B.name===j.attachmentName);U&&U.ocrText&&(C.text=U.ocrText,U.altText=j.altText)}C.children&&x(C.children)}};x(k)}}return e.putNotesAtLast&&y.length>0&&k.push(...y),{type:"docx",metadata:{...b,formatting:K,styleMap:J},content:k,attachments:_,toText:()=>k.map(x=>{let P=C=>{let j="";return C.children?j+=C.children.map(P).filter(U=>U!="").join(C.children[0]?.children?e.newlineDelimiter??`
131
+ `:""):j+=C.text||"",j};return P(x)}).filter(x=>x!="").join(e.newlineDelimiter??`
132
+ `)}};var Lf=class{static async parseOffice(e,t,n){let i,o={};typeof t=="function"?(i=t,o=n||{}):o=t||{};let s={ignoreNotes:!1,newlineDelimiter:`
133
+ `,putNotesAtLast:!1,outputErrorToConsole:!1,extractAttachments:!1,ocr:!1,ocrLanguage:"eng",includeRawContent:!1,pdfWorkerSrc:"",...o},a=Buffer.alloc(0),u="",c;try{if(!e)throw na("IMPROPER_ARGUMENTS",s);if(e instanceof ArrayBuffer)a=Buffer.from(e);else if(Buffer.isBuffer(e))a=e;else if(typeof e=="string"){if(c=e,!sb(e))throw na("FILE_DOES_NOT_EXIST",s,e);if(x2(e).isDirectory())throw na("LOCATION_NOT_FOUND",s,e);a=S2(e),u=e.split(".").pop()?.toLowerCase()||""}else throw na("INVALID_INPUT",s);if(!u){let h=await I3.fromBuffer(a);if(h)u=h.ext.toLowerCase();else throw na("IMPROPER_BUFFERS",s)}let f;switch(u){case"docx":f=await D3(a,s);break;case"pptx":f=await T3(a,s);break;case"xlsx":f=await QM(a,s);break;case"odt":case"odp":case"ods":f=await eB(a,s);break;case"pdf":f=await x3(a,s);break;case"rtf":f=await C3(a,s);break;default:throw na("EXTENSION_UNSUPPORTED",s,u)}return i&&i(f),f}catch(f){let h=hk(f,s,c);throw i&&i(void 0,h),h}}};var OV=Lf.parseOffice;var NV=Lf;if(typeof Au<"u"&&typeof module<"u"&&Au.main===module){let i=function(o){return o.startsWith("--")&&o.includes("=")};kV=i;let r=process.argv.slice(2),e,t=!1,n=[];if(r.forEach(o=>{i(o)?n.push(o):e||(e=o)}),e){let o={};n.forEach(s=>{let[a,u]=s.split("="),c=a.replace("--","");c==="toText"?u.toLowerCase()==="true"?t=!0:u.toLowerCase()==="false"?t=!1:console.log(`Invalid value for toText: ${u}`):u.toLowerCase()==="true"?o[c]=!0:u.toLowerCase()==="false"?o[c]=!1:o[c]=u}),Lf.parseOffice(e,o).then(s=>{console.log(t?s.toText():JSON.stringify(s,null,2))}).catch(console.error)}else console.log("Usage: node officeparser [file] [--option=value]")}var kV;return Ir(LV);})();
134
+ /*! Bundled license information:
135
+
136
+ @jspm/core/nodelibs/browser/chunk-DtuTasat.js:
137
+ @jspm/core/nodelibs/browser/chunk-B738Er4n.js:
138
+ ieee754/index.js:
139
+ (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
140
+
141
+ @jspm/core/nodelibs/browser/chunk-CjPlbOtt.js:
142
+ (*!
143
+ * The buffer module from node.js, for the browser.
144
+ *
145
+ * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
146
+ * @license MIT
147
+ *)
148
+
149
+ @jspm/core/nodelibs/browser/chunk-CcCWfKp1.js:
150
+ (*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
151
+ */
152
+ //# sourceMappingURL=officeparser.browser.js.map