officeparser 6.0.6 → 6.0.7

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,154 @@
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 q8=Object.create;var lg=Object.defineProperty;var G8=Object.getOwnPropertyDescriptor;var V8=Object.getOwnPropertyNames;var X8=Object.getPrototypeOf,Y8=Object.prototype.hasOwnProperty;var HC=r=>{throw TypeError(r)};var Z8=(r,e,t)=>e in r?lg(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var Zu=(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 bt=(r,e)=>()=>(r&&(e=r(r=0)),e);var dt=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),go=(r,e)=>{for(var t in e)lg(r,t,{get:e[t],enumerable:!0})},qC=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of V8(e))!Y8.call(r,i)&&i!==t&&lg(r,i,{get:()=>e[i],enumerable:!(n=G8(e,i))||n.enumerable});return r};var Rl=(r,e,t)=>(t=r!=null?q8(X8(r)):{},qC(e||!r||!r.__esModule?lg(t,"default",{value:r,enumerable:!0}):t,r)),qr=r=>qC(lg({},"__esModule",{value:!0}),r);var He=(r,e,t)=>Z8(r,typeof e!="symbol"?e+"":e,t),y1=(r,e,t)=>e.has(r)||HC("Cannot "+t);var l=(r,e,t)=>(y1(r,e,"read from private field"),t?t.call(r):e.get(r)),W=(r,e,t)=>e.has(r)?HC("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),N=(r,e,t,n)=>(y1(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t),Y=(r,e,t)=>(y1(r,e,"access private method"),t);var ln=(r,e,t,n)=>({set _(i){N(r,e,i,t)},get _(){return l(r,e,n)}});var Se=bt(()=>{});var $e={};go($e,{_debugEnd:()=>LR,_debugProcess:()=>OR,_events:()=>ZR,_eventsCount:()=>KR,_exiting:()=>pR,_fatalExceptions:()=>DR,_getActiveHandles:()=>bR,_getActiveRequests:()=>yR,_kill:()=>vR,_linkedBinding:()=>hR,_maxListeners:()=>YR,_preload_modules:()=>GR,_rawDebug:()=>cR,_startProfilerIdleNotifier:()=>PR,_stopProfilerIdleNotifier:()=>FR,_tickCallback:()=>NR,abort:()=>jR,addListener:()=>JR,allowedNodeEnvironmentFlags:()=>TR,arch:()=>ZC,argv:()=>QC,argv0:()=>qR,assert:()=>CR,binding:()=>iR,browser:()=>uR,chdir:()=>aR,config:()=>gR,cpuUsage:()=>pb,cwd:()=>oR,debugPort:()=>HR,default:()=>aD,dlopen:()=>mR,domain:()=>dR,emit:()=>nD,emitWarning:()=>nR,env:()=>JC,execArgv:()=>eR,execPath:()=>WR,exit:()=>xR,features:()=>RR,hasUncaughtExceptionCaptureCallback:()=>kR,hrtime:()=>db,kill:()=>AR,listeners:()=>oD,memoryUsage:()=>_R,moduleLoadList:()=>fR,nextTick:()=>VC,off:()=>eD,on:()=>la,once:()=>QR,openStdin:()=>SR,pid:()=>$R,platform:()=>KC,ppid:()=>zR,prependListener:()=>iD,prependOnceListener:()=>sD,reallyExit:()=>wR,release:()=>lR,removeAllListeners:()=>rD,removeListener:()=>tD,resourceUsage:()=>ER,setSourceMapsEnabled:()=>VR,setUncaughtExceptionCaptureCallback:()=>IR,stderr:()=>BR,stdin:()=>UR,stdout:()=>MR,title:()=>YC,umask:()=>sR,uptime:()=>XR,version:()=>tR,versions:()=>rR});function v1(r){throw new Error("Node.js process "+r+" is not supported by JSPM core outside of Node.js")}function K8(){!hh||!Ku||(hh=!1,Ku.length?aa=Ku.concat(aa):hb=-1,aa.length&&GC())}function GC(){if(!hh){var r=setTimeout(K8,0);hh=!0;for(var e=aa.length;e;){for(Ku=aa,aa=[];++hb<e;)Ku&&Ku[hb].run();hb=-1,e=aa.length}Ku=null,hh=!1,clearTimeout(r)}}function VC(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];aa.push(new XC(r,e)),aa.length===1&&!hh&&setTimeout(GC,0)}function XC(r,e){this.fun=r,this.array=e}function Un(){}function hR(r){v1("_linkedBinding")}function mR(r){v1("dlopen")}function yR(){return[]}function bR(){return[]}function CR(r,e){if(!r)throw new Error(e||"assertion error")}function kR(){return!1}function XR(){return Dl.now()/1e3}function db(r){var e=Math.floor((Date.now()-Dl.now())*.001),t=Dl.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+=w1)),[n,i]}function la(){return aD}function oD(r){return[]}var aa,hh,Ku,hb,YC,ZC,KC,JC,QC,eR,tR,rR,nR,iR,sR,oR,aR,lR,uR,cR,fR,dR,pR,gR,wR,vR,pb,ER,_R,AR,xR,SR,TR,RR,DR,IR,NR,OR,LR,PR,FR,MR,BR,UR,jR,$R,zR,WR,HR,qR,GR,VR,Dl,b1,w1,YR,ZR,KR,JR,QR,eD,tD,rD,nD,iD,sD,aD,lD=bt(()=>{Se();Ce();Te();aa=[],hh=!1,hb=-1;XC.prototype.run=function(){this.fun.apply(null,this.array)};YC="browser",ZC="x64",KC="browser",JC={PATH:"/usr/bin",LANG:typeof navigator<"u"?navigator.language+".UTF-8":void 0,PWD:"/",HOME:"/home",TMP:"/tmp"},QC=["/usr/bin/node"],eR=[],tR="v16.8.0",rR={},nR=function(r,e){console.warn((e?e+": ":"")+r)},iR=function(r){v1("binding")},sR=function(r){return 0},oR=function(){return"/"},aR=function(r){},lR={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};uR=!0,cR=Un,fR=[];dR={},pR=!1,gR={};wR=Un,vR=Un,pb=function(){return{}},ER=pb,_R=pb,AR=Un,xR=Un,SR=Un,TR={};RR={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},DR=Un,IR=Un;NR=Un,OR=Un,LR=Un,PR=Un,FR=Un,MR=void 0,BR=void 0,UR=void 0,jR=Un,$R=2,zR=1,WR="/bin/usr/node",HR=9229,qR="node",GR=[],VR=Un,Dl={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};Dl.now===void 0&&(b1=Date.now(),Dl.timing&&Dl.timing.navigationStart&&(b1=Dl.timing.navigationStart),Dl.now=()=>Date.now()-b1);w1=1e9;db.bigint=function(r){var e=db(r);return typeof BigInt>"u"?e[0]*w1+e[1]:BigInt(e[0]*w1)+BigInt(e[1])};YR=10,ZR={},KR=0;JR=la,QR=la,eD=la,tD=la,rD=la,nD=Un,iD=la,sD=la;aD={version:tR,versions:rR,arch:ZC,platform:KC,browser:uR,release:lR,_rawDebug:cR,moduleLoadList:fR,binding:iR,_linkedBinding:hR,_events:ZR,_eventsCount:KR,_maxListeners:YR,on:la,addListener:JR,once:QR,off:eD,removeListener:tD,removeAllListeners:rD,emit:nD,prependListener:iD,prependOnceListener:sD,listeners:oD,domain:dR,_exiting:pR,config:gR,dlopen:mR,uptime:XR,_getActiveRequests:yR,_getActiveHandles:bR,reallyExit:wR,_kill:vR,cpuUsage:pb,resourceUsage:ER,memoryUsage:_R,kill:AR,exit:xR,openStdin:SR,allowedNodeEnvironmentFlags:TR,assert:CR,features:RR,_fatalExceptions:DR,setUncaughtExceptionCaptureCallback:IR,hasUncaughtExceptionCaptureCallback:kR,emitWarning:nR,nextTick:VC,_tickCallback:NR,_debugProcess:OR,_debugEnd:LR,_startProfilerIdleNotifier:PR,_stopProfilerIdleNotifier:FR,stdout:MR,stdin:UR,stderr:BR,abort:jR,umask:sR,chdir:aR,cwd:oR,env:JC,title:YC,argv:QC,execArgv:eR,pid:$R,ppid:zR,execPath:WR,debugPort:HR,hrtime:db,argv0:qR,_preload_modules:GR,setSourceMapsEnabled:VR}});var Te=bt(()=>{lD()});function J8(){if(uD)return ug;uD=!0,ug.byteLength=a,ug.toByteArray=c,ug.fromByteArray=d;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(g){var y=g.length;if(y%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var v=g.indexOf("=");v===-1&&(v=y);var w=v===y?0:4-v%4;return[v,w]}function a(g){var y=s(g),v=y[0],w=y[1];return(v+w)*3/4-w}function u(g,y,v){return(y+v)*3/4-v}function c(g){var y,v=s(g),w=v[0],b=v[1],E=new t(u(g,w,b)),_=0,S=b>0?w-4:w,A;for(A=0;A<S;A+=4)y=e[g.charCodeAt(A)]<<18|e[g.charCodeAt(A+1)]<<12|e[g.charCodeAt(A+2)]<<6|e[g.charCodeAt(A+3)],E[_++]=y>>16&255,E[_++]=y>>8&255,E[_++]=y&255;return b===2&&(y=e[g.charCodeAt(A)]<<2|e[g.charCodeAt(A+1)]>>4,E[_++]=y&255),b===1&&(y=e[g.charCodeAt(A)]<<10|e[g.charCodeAt(A+1)]<<4|e[g.charCodeAt(A+2)]>>2,E[_++]=y>>8&255,E[_++]=y&255),E}function f(g){return r[g>>18&63]+r[g>>12&63]+r[g>>6&63]+r[g&63]}function h(g,y,v){for(var w,b=[],E=y;E<v;E+=3)w=(g[E]<<16&16711680)+(g[E+1]<<8&65280)+(g[E+2]&255),b.push(f(w));return b.join("")}function d(g){for(var y,v=g.length,w=v%3,b=[],E=16383,_=0,S=v-w;_<S;_+=E)b.push(h(g,_,_+E>S?S:_+E));return w===1?(y=g[v-1],b.push(r[y>>2]+r[y<<4&63]+"==")):w===2&&(y=(g[v-2]<<8)+g[v-1],b.push(r[y>>10]+r[y>>4&63]+r[y<<2&63]+"=")),b.join("")}return ug}function Q8(){if(cD)return gb;cD=!0;return gb.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,d=t?-1:1,g=r[e+h];for(h+=d,o=g&(1<<-f)-1,g>>=-f,f+=a;f>0;o=o*256+r[e+h],h+=d,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=s*256+r[e+h],h+=d,f-=8);if(o===0)o=1-c;else{if(o===u)return s?NaN:(g?-1:1)*(1/0);s=s+Math.pow(2,n),o=o-c}return(g?-1:1)*s*Math.pow(2,o-n)},gb.write=function(r,e,t,n,i,o){var s,a,u,c=o*8-i-1,f=(1<<c)-1,h=f>>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:o-1,y=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+=d/u:e+=d*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+g]=a&255,g+=y,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;r[t+g]=s&255,g+=y,s/=256,c-=8);r[t+g-y]|=v*128},gb}function yn(){if(fD)return Ju;fD=!0;let r=J8(),e=Q8(),t=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Ju.Buffer=s,Ju.SlowBuffer=b,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),m={foo:function(){return 42}};return Object.setPrototypeOf(m,Uint8Array.prototype),Object.setPrototypeOf(T,m),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 m=new Uint8Array(T);return Object.setPrototypeOf(m,s.prototype),m}function s(T,m,p){if(typeof T=="number"){if(typeof m=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return f(T)}return a(T,m,p)}s.poolSize=8192;function a(T,m,p){if(typeof T=="string")return h(T,m);if(ArrayBuffer.isView(T))return g(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(Oe(T,ArrayBuffer)||T&&Oe(T.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Oe(T,SharedArrayBuffer)||T&&Oe(T.buffer,SharedArrayBuffer)))return y(T,m,p);if(typeof T=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let R=T.valueOf&&T.valueOf();if(R!=null&&R!==T)return s.from(R,m,p);let J=v(T);if(J)return J;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof T[Symbol.toPrimitive]=="function")return s.from(T[Symbol.toPrimitive]("string"),m,p);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,m,p){return a(T,m,p)},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,m,p){return u(T),T<=0?o(T):m!==void 0?typeof p=="string"?o(T).fill(m,p):o(T).fill(m):o(T)}s.alloc=function(T,m,p){return c(T,m,p)};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,m){if((typeof m!="string"||m==="")&&(m="utf8"),!s.isEncoding(m))throw new TypeError("Unknown encoding: "+m);let p=E(T,m)|0,R=o(p),J=R.write(T,m);return J!==p&&(R=R.slice(0,J)),R}function d(T){let m=T.length<0?0:w(T.length)|0,p=o(m);for(let R=0;R<m;R+=1)p[R]=T[R]&255;return p}function g(T){if(Oe(T,Uint8Array)){let m=new Uint8Array(T);return y(m.buffer,m.byteOffset,m.byteLength)}return d(T)}function y(T,m,p){if(m<0||T.byteLength<m)throw new RangeError('"offset" is outside of buffer bounds');if(T.byteLength<m+(p||0))throw new RangeError('"length" is outside of buffer bounds');let R;return m===void 0&&p===void 0?R=new Uint8Array(T):p===void 0?R=new Uint8Array(T,m):R=new Uint8Array(T,m,p),Object.setPrototypeOf(R,s.prototype),R}function v(T){if(s.isBuffer(T)){let m=w(T.length)|0,p=o(m);return p.length===0||T.copy(p,0,0,m),p}if(T.length!==void 0)return typeof T.length!="number"||ke(T.length)?o(0):d(T);if(T.type==="Buffer"&&Array.isArray(T.data))return d(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 b(T){return+T!=T&&(T=0),s.alloc(+T)}s.isBuffer=function(m){return m!=null&&m._isBuffer===!0&&m!==s.prototype},s.compare=function(m,p){if(Oe(m,Uint8Array)&&(m=s.from(m,m.offset,m.byteLength)),Oe(p,Uint8Array)&&(p=s.from(p,p.offset,p.byteLength)),!s.isBuffer(m)||!s.isBuffer(p))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(m===p)return 0;let R=m.length,J=p.length;for(let D=0,le=Math.min(R,J);D<le;++D)if(m[D]!==p[D]){R=m[D],J=p[D];break}return R<J?-1:J<R?1:0},s.isEncoding=function(m){switch(String(m).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(m,p){if(!Array.isArray(m))throw new TypeError('"list" argument must be an Array of Buffers');if(m.length===0)return s.alloc(0);let R;if(p===void 0)for(p=0,R=0;R<m.length;++R)p+=m[R].length;let J=s.allocUnsafe(p),D=0;for(R=0;R<m.length;++R){let le=m[R];if(Oe(le,Uint8Array))D+le.length>J.length?(s.isBuffer(le)||(le=s.from(le)),le.copy(J,D)):Uint8Array.prototype.set.call(J,le,D);else if(s.isBuffer(le))le.copy(J,D);else throw new TypeError('"list" argument must be an Array of Buffers');D+=le.length}return J};function E(T,m){if(s.isBuffer(T))return T.length;if(ArrayBuffer.isView(T)||Oe(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 p=T.length,R=arguments.length>2&&arguments[2]===!0;if(!R&&p===0)return 0;let J=!1;for(;;)switch(m){case"ascii":case"latin1":case"binary":return p;case"utf8":case"utf-8":return Re(T).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return p*2;case"hex":return p>>>1;case"base64":return Ae(T).length;default:if(J)return R?-1:Re(T).length;m=(""+m).toLowerCase(),J=!0}}s.byteLength=E;function _(T,m,p){let R=!1;if((m===void 0||m<0)&&(m=0),m>this.length||((p===void 0||p>this.length)&&(p=this.length),p<=0)||(p>>>=0,m>>>=0,p<=m))return"";for(T||(T="utf8");;)switch(T){case"hex":return x(this,m,p);case"utf8":case"utf-8":return $(this,m,p);case"ascii":return re(this,m,p);case"latin1":case"binary":return O(this,m,p);case"base64":return L(this,m,p);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,m,p);default:if(R)throw new TypeError("Unknown encoding: "+T);T=(T+"").toLowerCase(),R=!0}}s.prototype._isBuffer=!0;function S(T,m,p){let R=T[m];T[m]=T[p],T[p]=R}s.prototype.swap16=function(){let m=this.length;if(m%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let p=0;p<m;p+=2)S(this,p,p+1);return this},s.prototype.swap32=function(){let m=this.length;if(m%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let p=0;p<m;p+=4)S(this,p,p+3),S(this,p+1,p+2);return this},s.prototype.swap64=function(){let m=this.length;if(m%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let p=0;p<m;p+=8)S(this,p,p+7),S(this,p+1,p+6),S(this,p+2,p+5),S(this,p+3,p+4);return this},s.prototype.toString=function(){let m=this.length;return m===0?"":arguments.length===0?$(this,0,m):_.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(m){if(!s.isBuffer(m))throw new TypeError("Argument must be a Buffer");return this===m?!0:s.compare(this,m)===0},s.prototype.inspect=function(){let m="",p=Ju.INSPECT_MAX_BYTES;return m=this.toString("hex",0,p).replace(/(.{2})/g,"$1 ").trim(),this.length>p&&(m+=" ... "),"<Buffer "+m+">"},t&&(s.prototype[t]=s.prototype.inspect),s.prototype.compare=function(m,p,R,J,D){if(Oe(m,Uint8Array)&&(m=s.from(m,m.offset,m.byteLength)),!s.isBuffer(m))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof m);if(p===void 0&&(p=0),R===void 0&&(R=m?m.length:0),J===void 0&&(J=0),D===void 0&&(D=this.length),p<0||R>m.length||J<0||D>this.length)throw new RangeError("out of range index");if(J>=D&&p>=R)return 0;if(J>=D)return-1;if(p>=R)return 1;if(p>>>=0,R>>>=0,J>>>=0,D>>>=0,this===m)return 0;let le=D-J,he=R-p,_e=Math.min(le,he),ve=this.slice(J,D),Ie=m.slice(p,R);for(let K=0;K<_e;++K)if(ve[K]!==Ie[K]){le=ve[K],he=Ie[K];break}return le<he?-1:he<le?1:0};function A(T,m,p,R,J){if(T.length===0)return-1;if(typeof p=="string"?(R=p,p=0):p>2147483647?p=2147483647:p<-2147483648&&(p=-2147483648),p=+p,ke(p)&&(p=J?0:T.length-1),p<0&&(p=T.length+p),p>=T.length){if(J)return-1;p=T.length-1}else if(p<0)if(J)p=0;else return-1;if(typeof m=="string"&&(m=s.from(m,R)),s.isBuffer(m))return m.length===0?-1:M(T,m,p,R,J);if(typeof m=="number")return m=m&255,typeof Uint8Array.prototype.indexOf=="function"?J?Uint8Array.prototype.indexOf.call(T,m,p):Uint8Array.prototype.lastIndexOf.call(T,m,p):M(T,[m],p,R,J);throw new TypeError("val must be string, number or Buffer")}function M(T,m,p,R,J){let D=1,le=T.length,he=m.length;if(R!==void 0&&(R=String(R).toLowerCase(),R==="ucs2"||R==="ucs-2"||R==="utf16le"||R==="utf-16le")){if(T.length<2||m.length<2)return-1;D=2,le/=2,he/=2,p/=2}function _e(Ie,K){return D===1?Ie[K]:Ie.readUInt16BE(K*D)}let ve;if(J){let Ie=-1;for(ve=p;ve<le;ve++)if(_e(T,ve)===_e(m,Ie===-1?0:ve-Ie)){if(Ie===-1&&(Ie=ve),ve-Ie+1===he)return Ie*D}else Ie!==-1&&(ve-=ve-Ie),Ie=-1}else for(p+he>le&&(p=le-he),ve=p;ve>=0;ve--){let Ie=!0;for(let K=0;K<he;K++)if(_e(T,ve+K)!==_e(m,K)){Ie=!1;break}if(Ie)return ve}return-1}s.prototype.includes=function(m,p,R){return this.indexOf(m,p,R)!==-1},s.prototype.indexOf=function(m,p,R){return A(this,m,p,R,!0)},s.prototype.lastIndexOf=function(m,p,R){return A(this,m,p,R,!1)};function I(T,m,p,R){p=Number(p)||0;let J=T.length-p;R?(R=Number(R),R>J&&(R=J)):R=J;let D=m.length;R>D/2&&(R=D/2);let le;for(le=0;le<R;++le){let he=parseInt(m.substr(le*2,2),16);if(ke(he))return le;T[p+le]=he}return le}function q(T,m,p,R){return ze(Re(m,T.length-p),T,p,R)}function Q(T,m,p,R){return ze(be(m),T,p,R)}function Z(T,m,p,R){return ze(Ae(m),T,p,R)}function ne(T,m,p,R){return ze(pe(m,T.length-p),T,p,R)}s.prototype.write=function(m,p,R,J){if(p===void 0)J="utf8",R=this.length,p=0;else if(R===void 0&&typeof p=="string")J=p,R=this.length,p=0;else if(isFinite(p))p=p>>>0,isFinite(R)?(R=R>>>0,J===void 0&&(J="utf8")):(J=R,R=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let D=this.length-p;if((R===void 0||R>D)&&(R=D),m.length>0&&(R<0||p<0)||p>this.length)throw new RangeError("Attempt to write outside buffer bounds");J||(J="utf8");let le=!1;for(;;)switch(J){case"hex":return I(this,m,p,R);case"utf8":case"utf-8":return q(this,m,p,R);case"ascii":case"latin1":case"binary":return Q(this,m,p,R);case"base64":return Z(this,m,p,R);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ne(this,m,p,R);default:if(le)throw new TypeError("Unknown encoding: "+J);J=(""+J).toLowerCase(),le=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function L(T,m,p){return m===0&&p===T.length?r.fromByteArray(T):r.fromByteArray(T.slice(m,p))}function $(T,m,p){p=Math.min(T.length,p);let R=[],J=m;for(;J<p;){let D=T[J],le=null,he=D>239?4:D>223?3:D>191?2:1;if(J+he<=p){let _e,ve,Ie,K;switch(he){case 1:D<128&&(le=D);break;case 2:_e=T[J+1],(_e&192)===128&&(K=(D&31)<<6|_e&63,K>127&&(le=K));break;case 3:_e=T[J+1],ve=T[J+2],(_e&192)===128&&(ve&192)===128&&(K=(D&15)<<12|(_e&63)<<6|ve&63,K>2047&&(K<55296||K>57343)&&(le=K));break;case 4:_e=T[J+1],ve=T[J+2],Ie=T[J+3],(_e&192)===128&&(ve&192)===128&&(Ie&192)===128&&(K=(D&15)<<18|(_e&63)<<12|(ve&63)<<6|Ie&63,K>65535&&K<1114112&&(le=K))}}le===null?(le=65533,he=1):le>65535&&(le-=65536,R.push(le>>>10&1023|55296),le=56320|le&1023),R.push(le),J+=he}return ie(R)}let X=4096;function ie(T){let m=T.length;if(m<=X)return String.fromCharCode.apply(String,T);let p="",R=0;for(;R<m;)p+=String.fromCharCode.apply(String,T.slice(R,R+=X));return p}function re(T,m,p){let R="";p=Math.min(T.length,p);for(let J=m;J<p;++J)R+=String.fromCharCode(T[J]&127);return R}function O(T,m,p){let R="";p=Math.min(T.length,p);for(let J=m;J<p;++J)R+=String.fromCharCode(T[J]);return R}function x(T,m,p){let R=T.length;(!m||m<0)&&(m=0),(!p||p<0||p>R)&&(p=R);let J="";for(let D=m;D<p;++D)J+=Ke[T[D]];return J}function P(T,m,p){let R=T.slice(m,p),J="";for(let D=0;D<R.length-1;D+=2)J+=String.fromCharCode(R[D]+R[D+1]*256);return J}s.prototype.slice=function(m,p){let R=this.length;m=~~m,p=p===void 0?R:~~p,m<0?(m+=R,m<0&&(m=0)):m>R&&(m=R),p<0?(p+=R,p<0&&(p=0)):p>R&&(p=R),p<m&&(p=m);let J=this.subarray(m,p);return Object.setPrototypeOf(J,s.prototype),J};function C(T,m,p){if(T%1!==0||T<0)throw new RangeError("offset is not uint");if(T+m>p)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(m,p,R){m=m>>>0,p=p>>>0,R||C(m,p,this.length);let J=this[m],D=1,le=0;for(;++le<p&&(D*=256);)J+=this[m+le]*D;return J},s.prototype.readUintBE=s.prototype.readUIntBE=function(m,p,R){m=m>>>0,p=p>>>0,R||C(m,p,this.length);let J=this[m+--p],D=1;for(;p>0&&(D*=256);)J+=this[m+--p]*D;return J},s.prototype.readUint8=s.prototype.readUInt8=function(m,p){return m=m>>>0,p||C(m,1,this.length),this[m]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(m,p){return m=m>>>0,p||C(m,2,this.length),this[m]|this[m+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(m,p){return m=m>>>0,p||C(m,2,this.length),this[m]<<8|this[m+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(m,p){return m=m>>>0,p||C(m,4,this.length),(this[m]|this[m+1]<<8|this[m+2]<<16)+this[m+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(m,p){return m=m>>>0,p||C(m,4,this.length),this[m]*16777216+(this[m+1]<<16|this[m+2]<<8|this[m+3])},s.prototype.readBigUInt64LE=tt(function(m){m=m>>>0,V(m,"offset");let p=this[m],R=this[m+7];(p===void 0||R===void 0)&&F(m,this.length-8);let J=p+this[++m]*2**8+this[++m]*2**16+this[++m]*2**24,D=this[++m]+this[++m]*2**8+this[++m]*2**16+R*2**24;return BigInt(J)+(BigInt(D)<<BigInt(32))}),s.prototype.readBigUInt64BE=tt(function(m){m=m>>>0,V(m,"offset");let p=this[m],R=this[m+7];(p===void 0||R===void 0)&&F(m,this.length-8);let J=p*2**24+this[++m]*2**16+this[++m]*2**8+this[++m],D=this[++m]*2**24+this[++m]*2**16+this[++m]*2**8+R;return(BigInt(J)<<BigInt(32))+BigInt(D)}),s.prototype.readIntLE=function(m,p,R){m=m>>>0,p=p>>>0,R||C(m,p,this.length);let J=this[m],D=1,le=0;for(;++le<p&&(D*=256);)J+=this[m+le]*D;return D*=128,J>=D&&(J-=Math.pow(2,8*p)),J},s.prototype.readIntBE=function(m,p,R){m=m>>>0,p=p>>>0,R||C(m,p,this.length);let J=p,D=1,le=this[m+--J];for(;J>0&&(D*=256);)le+=this[m+--J]*D;return D*=128,le>=D&&(le-=Math.pow(2,8*p)),le},s.prototype.readInt8=function(m,p){return m=m>>>0,p||C(m,1,this.length),this[m]&128?(255-this[m]+1)*-1:this[m]},s.prototype.readInt16LE=function(m,p){m=m>>>0,p||C(m,2,this.length);let R=this[m]|this[m+1]<<8;return R&32768?R|4294901760:R},s.prototype.readInt16BE=function(m,p){m=m>>>0,p||C(m,2,this.length);let R=this[m+1]|this[m]<<8;return R&32768?R|4294901760:R},s.prototype.readInt32LE=function(m,p){return m=m>>>0,p||C(m,4,this.length),this[m]|this[m+1]<<8|this[m+2]<<16|this[m+3]<<24},s.prototype.readInt32BE=function(m,p){return m=m>>>0,p||C(m,4,this.length),this[m]<<24|this[m+1]<<16|this[m+2]<<8|this[m+3]},s.prototype.readBigInt64LE=tt(function(m){m=m>>>0,V(m,"offset");let p=this[m],R=this[m+7];(p===void 0||R===void 0)&&F(m,this.length-8);let J=this[m+4]+this[m+5]*2**8+this[m+6]*2**16+(R<<24);return(BigInt(J)<<BigInt(32))+BigInt(p+this[++m]*2**8+this[++m]*2**16+this[++m]*2**24)}),s.prototype.readBigInt64BE=tt(function(m){m=m>>>0,V(m,"offset");let p=this[m],R=this[m+7];(p===void 0||R===void 0)&&F(m,this.length-8);let J=(p<<24)+this[++m]*2**16+this[++m]*2**8+this[++m];return(BigInt(J)<<BigInt(32))+BigInt(this[++m]*2**24+this[++m]*2**16+this[++m]*2**8+R)}),s.prototype.readFloatLE=function(m,p){return m=m>>>0,p||C(m,4,this.length),e.read(this,m,!0,23,4)},s.prototype.readFloatBE=function(m,p){return m=m>>>0,p||C(m,4,this.length),e.read(this,m,!1,23,4)},s.prototype.readDoubleLE=function(m,p){return m=m>>>0,p||C(m,8,this.length),e.read(this,m,!0,52,8)},s.prototype.readDoubleBE=function(m,p){return m=m>>>0,p||C(m,8,this.length),e.read(this,m,!1,52,8)};function j(T,m,p,R,J,D){if(!s.isBuffer(T))throw new TypeError('"buffer" argument must be a Buffer instance');if(m>J||m<D)throw new RangeError('"value" argument is out of bounds');if(p+R>T.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(m,p,R,J){if(m=+m,p=p>>>0,R=R>>>0,!J){let he=Math.pow(2,8*R)-1;j(this,m,p,R,he,0)}let D=1,le=0;for(this[p]=m&255;++le<R&&(D*=256);)this[p+le]=m/D&255;return p+R},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(m,p,R,J){if(m=+m,p=p>>>0,R=R>>>0,!J){let he=Math.pow(2,8*R)-1;j(this,m,p,R,he,0)}let D=R-1,le=1;for(this[p+D]=m&255;--D>=0&&(le*=256);)this[p+D]=m/le&255;return p+R},s.prototype.writeUint8=s.prototype.writeUInt8=function(m,p,R){return m=+m,p=p>>>0,R||j(this,m,p,1,255,0),this[p]=m&255,p+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(m,p,R){return m=+m,p=p>>>0,R||j(this,m,p,2,65535,0),this[p]=m&255,this[p+1]=m>>>8,p+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(m,p,R){return m=+m,p=p>>>0,R||j(this,m,p,2,65535,0),this[p]=m>>>8,this[p+1]=m&255,p+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(m,p,R){return m=+m,p=p>>>0,R||j(this,m,p,4,4294967295,0),this[p+3]=m>>>24,this[p+2]=m>>>16,this[p+1]=m>>>8,this[p]=m&255,p+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(m,p,R){return m=+m,p=p>>>0,R||j(this,m,p,4,4294967295,0),this[p]=m>>>24,this[p+1]=m>>>16,this[p+2]=m>>>8,this[p+3]=m&255,p+4};function U(T,m,p,R,J){xe(m,R,J,T,p,7);let D=Number(m&BigInt(4294967295));T[p++]=D,D=D>>8,T[p++]=D,D=D>>8,T[p++]=D,D=D>>8,T[p++]=D;let le=Number(m>>BigInt(32)&BigInt(4294967295));return T[p++]=le,le=le>>8,T[p++]=le,le=le>>8,T[p++]=le,le=le>>8,T[p++]=le,p}function B(T,m,p,R,J){xe(m,R,J,T,p,7);let D=Number(m&BigInt(4294967295));T[p+7]=D,D=D>>8,T[p+6]=D,D=D>>8,T[p+5]=D,D=D>>8,T[p+4]=D;let le=Number(m>>BigInt(32)&BigInt(4294967295));return T[p+3]=le,le=le>>8,T[p+2]=le,le=le>>8,T[p+1]=le,le=le>>8,T[p]=le,p+8}s.prototype.writeBigUInt64LE=tt(function(m,p=0){return U(this,m,p,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeBigUInt64BE=tt(function(m,p=0){return B(this,m,p,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeIntLE=function(m,p,R,J){if(m=+m,p=p>>>0,!J){let _e=Math.pow(2,8*R-1);j(this,m,p,R,_e-1,-_e)}let D=0,le=1,he=0;for(this[p]=m&255;++D<R&&(le*=256);)m<0&&he===0&&this[p+D-1]!==0&&(he=1),this[p+D]=(m/le>>0)-he&255;return p+R},s.prototype.writeIntBE=function(m,p,R,J){if(m=+m,p=p>>>0,!J){let _e=Math.pow(2,8*R-1);j(this,m,p,R,_e-1,-_e)}let D=R-1,le=1,he=0;for(this[p+D]=m&255;--D>=0&&(le*=256);)m<0&&he===0&&this[p+D+1]!==0&&(he=1),this[p+D]=(m/le>>0)-he&255;return p+R},s.prototype.writeInt8=function(m,p,R){return m=+m,p=p>>>0,R||j(this,m,p,1,127,-128),m<0&&(m=255+m+1),this[p]=m&255,p+1},s.prototype.writeInt16LE=function(m,p,R){return m=+m,p=p>>>0,R||j(this,m,p,2,32767,-32768),this[p]=m&255,this[p+1]=m>>>8,p+2},s.prototype.writeInt16BE=function(m,p,R){return m=+m,p=p>>>0,R||j(this,m,p,2,32767,-32768),this[p]=m>>>8,this[p+1]=m&255,p+2},s.prototype.writeInt32LE=function(m,p,R){return m=+m,p=p>>>0,R||j(this,m,p,4,2147483647,-2147483648),this[p]=m&255,this[p+1]=m>>>8,this[p+2]=m>>>16,this[p+3]=m>>>24,p+4},s.prototype.writeInt32BE=function(m,p,R){return m=+m,p=p>>>0,R||j(this,m,p,4,2147483647,-2147483648),m<0&&(m=4294967295+m+1),this[p]=m>>>24,this[p+1]=m>>>16,this[p+2]=m>>>8,this[p+3]=m&255,p+4},s.prototype.writeBigInt64LE=tt(function(m,p=0){return U(this,m,p,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeBigInt64BE=tt(function(m,p=0){return B(this,m,p,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ee(T,m,p,R,J,D){if(p+R>T.length)throw new RangeError("Index out of range");if(p<0)throw new RangeError("Index out of range")}function fe(T,m,p,R,J){return m=+m,p=p>>>0,J||ee(T,m,p,4),e.write(T,m,p,R,23,4),p+4}s.prototype.writeFloatLE=function(m,p,R){return fe(this,m,p,!0,R)},s.prototype.writeFloatBE=function(m,p,R){return fe(this,m,p,!1,R)};function Ee(T,m,p,R,J){return m=+m,p=p>>>0,J||ee(T,m,p,8),e.write(T,m,p,R,52,8),p+8}s.prototype.writeDoubleLE=function(m,p,R){return Ee(this,m,p,!0,R)},s.prototype.writeDoubleBE=function(m,p,R){return Ee(this,m,p,!1,R)},s.prototype.copy=function(m,p,R,J){if(!s.isBuffer(m))throw new TypeError("argument should be a Buffer");if(R||(R=0),!J&&J!==0&&(J=this.length),p>=m.length&&(p=m.length),p||(p=0),J>0&&J<R&&(J=R),J===R||m.length===0||this.length===0)return 0;if(p<0)throw new RangeError("targetStart out of bounds");if(R<0||R>=this.length)throw new RangeError("Index out of range");if(J<0)throw new RangeError("sourceEnd out of bounds");J>this.length&&(J=this.length),m.length-p<J-R&&(J=m.length-p+R);let D=J-R;return this===m&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(p,R,J):Uint8Array.prototype.set.call(m,this.subarray(R,J),p),D},s.prototype.fill=function(m,p,R,J){if(typeof m=="string"){if(typeof p=="string"?(J=p,p=0,R=this.length):typeof R=="string"&&(J=R,R=this.length),J!==void 0&&typeof J!="string")throw new TypeError("encoding must be a string");if(typeof J=="string"&&!s.isEncoding(J))throw new TypeError("Unknown encoding: "+J);if(m.length===1){let le=m.charCodeAt(0);(J==="utf8"&&le<128||J==="latin1")&&(m=le)}}else typeof m=="number"?m=m&255:typeof m=="boolean"&&(m=Number(m));if(p<0||this.length<p||this.length<R)throw new RangeError("Out of range index");if(R<=p)return this;p=p>>>0,R=R===void 0?this.length:R>>>0,m||(m=0);let D;if(typeof m=="number")for(D=p;D<R;++D)this[D]=m;else{let le=s.isBuffer(m)?m:s.from(m,J),he=le.length;if(he===0)throw new TypeError('The value "'+m+'" is invalid for argument "value"');for(D=0;D<R-p;++D)this[D+p]=le[D%he]}return this};let te={};function H(T,m,p){te[T]=class extends p{constructor(){super(),Object.defineProperty(this,"message",{value:m.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${T}]`,this.stack,delete this.name}get code(){return T}set code(J){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:J,writable:!0})}toString(){return`${this.name} [${T}]: ${this.message}`}}}H("ERR_BUFFER_OUT_OF_BOUNDS",function(T){return T?`${T} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),H("ERR_INVALID_ARG_TYPE",function(T,m){return`The "${T}" argument must be of type number. Received type ${typeof m}`},TypeError),H("ERR_OUT_OF_RANGE",function(T,m,p){let R=`The value of "${T}" is out of range.`,J=p;return Number.isInteger(p)&&Math.abs(p)>2**32?J=ae(String(p)):typeof p=="bigint"&&(J=String(p),(p>BigInt(2)**BigInt(32)||p<-(BigInt(2)**BigInt(32)))&&(J=ae(J)),J+="n"),R+=` It must be ${m}. Received ${J}`,R},RangeError);function ae(T){let m="",p=T.length,R=T[0]==="-"?1:0;for(;p>=R+4;p-=3)m=`_${T.slice(p-3,p)}${m}`;return`${T.slice(0,p)}${m}`}function we(T,m,p){V(m,"offset"),(T[m]===void 0||T[m+p]===void 0)&&F(m,T.length-(p+1))}function xe(T,m,p,R,J,D){if(T>p||T<m){let le=typeof m=="bigint"?"n":"",he;throw m===0||m===BigInt(0)?he=`>= 0${le} and < 2${le} ** ${(D+1)*8}${le}`:he=`>= -(2${le} ** ${(D+1)*8-1}${le}) and < 2 ** ${(D+1)*8-1}${le}`,new te.ERR_OUT_OF_RANGE("value",he,T)}we(R,J,D)}function V(T,m){if(typeof T!="number")throw new te.ERR_INVALID_ARG_TYPE(m,"number",T)}function F(T,m,p){throw Math.floor(T)!==T?(V(T,p),new te.ERR_OUT_OF_RANGE("offset","an integer",T)):m<0?new te.ERR_BUFFER_OUT_OF_BOUNDS:new te.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${m}`,T)}let oe=/[^+/0-9A-Za-z-_]/g;function ge(T){if(T=T.split("=")[0],T=T.trim().replace(oe,""),T.length<2)return"";for(;T.length%4!==0;)T=T+"=";return T}function Re(T,m){m=m||1/0;let p,R=T.length,J=null,D=[];for(let le=0;le<R;++le){if(p=T.charCodeAt(le),p>55295&&p<57344){if(!J){if(p>56319){(m-=3)>-1&&D.push(239,191,189);continue}else if(le+1===R){(m-=3)>-1&&D.push(239,191,189);continue}J=p;continue}if(p<56320){(m-=3)>-1&&D.push(239,191,189),J=p;continue}p=(J-55296<<10|p-56320)+65536}else J&&(m-=3)>-1&&D.push(239,191,189);if(J=null,p<128){if((m-=1)<0)break;D.push(p)}else if(p<2048){if((m-=2)<0)break;D.push(p>>6|192,p&63|128)}else if(p<65536){if((m-=3)<0)break;D.push(p>>12|224,p>>6&63|128,p&63|128)}else if(p<1114112){if((m-=4)<0)break;D.push(p>>18|240,p>>12&63|128,p>>6&63|128,p&63|128)}else throw new Error("Invalid code point")}return D}function be(T){let m=[];for(let p=0;p<T.length;++p)m.push(T.charCodeAt(p)&255);return m}function pe(T,m){let p,R,J,D=[];for(let le=0;le<T.length&&!((m-=2)<0);++le)p=T.charCodeAt(le),R=p>>8,J=p%256,D.push(J),D.push(R);return D}function Ae(T){return r.toByteArray(ge(T))}function ze(T,m,p,R){let J;for(J=0;J<R&&!(J+p>=m.length||J>=T.length);++J)m[J+p]=T[J];return J}function Oe(T,m){return T instanceof m||T!=null&&T.constructor!=null&&T.constructor.name!=null&&T.constructor.name===m.name}function ke(T){return T!==T}let Ke=(function(){let T="0123456789abcdef",m=new Array(256);for(let p=0;p<16;++p){let R=p*16;for(let J=0;J<16;++J)m[R+J]=T[p]+T[J]}return m})();function tt(T){return typeof BigInt>"u"?it:T}function it(){throw new Error("BigInt not supported")}return Ju}var ug,uD,gb,cD,Ju,fD,dh=bt(()=>{Se();Ce();Te();ug={},uD=!1;gb={},cD=!1;Ju={},fD=!1});var ph={};go(ph,{Buffer:()=>We,INSPECT_MAX_BYTES:()=>e4,default:()=>Il,kMaxLength:()=>t4});var Il,We,e4,t4,kl=bt(()=>{Se();Ce();Te();dh();Il=yn();Il.Buffer;Il.SlowBuffer;Il.INSPECT_MAX_BYTES;Il.kMaxLength;We=Il.Buffer,e4=Il.INSPECT_MAX_BYTES,t4=Il.kMaxLength});var Ce=bt(()=>{kl()});function S1(){throw new Error("setTimeout has not been defined")}function T1(){throw new Error("clearTimeout has not been defined")}function TD(r){if(ca===setTimeout)return setTimeout(r,0);if((ca===S1||!ca)&&setTimeout)return ca=setTimeout,setTimeout(r,0);try{return ca(r,0)}catch{try{return ca.call(null,r,0)}catch{return ca.call(this||mh,r,0)}}}function r4(){gh&&ec&&(gh=!1,ec.length?ha=ec.concat(ha):Eb=-1,ha.length&&CD())}function CD(){if(!gh){var r=TD(r4);gh=!0;for(var e=ha.length;e;){for(ec=ha,ha=[];++Eb<e;)ec&&ec[Eb].run();Eb=-1,e=ha.length}ec=null,gh=!1,(function(t){if(fa===clearTimeout)return clearTimeout(t);if((fa===T1||!fa)&&clearTimeout)return fa=clearTimeout,clearTimeout(t);try{fa(t)}catch{try{return fa.call(null,t)}catch{return fa.call(this||mh,t)}}})(r)}}function hD(r,e){(this||mh).fun=r,(this||mh).array=e}function ua(){}function rc(r){return r.call.bind(r)}function dg(r,e){if(typeof r!="object")return!1;try{return e(r),!0}catch{return!1}}function gD(r){return ui&&Li?Pi(r)!==void 0:PD(r)||FD(r)||MD(r)||BD(r)||UD(r)||jD(r)||$D(r)||zD(r)||WD(r)||HD(r)||qD(r)}function PD(r){return ui&&Li?Pi(r)==="Uint8Array":Rr(r)==="[object Uint8Array]"||h4(r)&&r.buffer!==void 0}function FD(r){return ui&&Li?Pi(r)==="Uint8ClampedArray":Rr(r)==="[object Uint8ClampedArray]"}function MD(r){return ui&&Li?Pi(r)==="Uint16Array":Rr(r)==="[object Uint16Array]"}function BD(r){return ui&&Li?Pi(r)==="Uint32Array":Rr(r)==="[object Uint32Array]"}function UD(r){return ui&&Li?Pi(r)==="Int8Array":Rr(r)==="[object Int8Array]"}function jD(r){return ui&&Li?Pi(r)==="Int16Array":Rr(r)==="[object Int16Array]"}function $D(r){return ui&&Li?Pi(r)==="Int32Array":Rr(r)==="[object Int32Array]"}function zD(r){return ui&&Li?Pi(r)==="Float32Array":Rr(r)==="[object Float32Array]"}function WD(r){return ui&&Li?Pi(r)==="Float64Array":Rr(r)==="[object Float64Array]"}function HD(r){return ui&&Li?Pi(r)==="BigInt64Array":Rr(r)==="[object BigInt64Array]"}function qD(r){return ui&&Li?Pi(r)==="BigUint64Array":Rr(r)==="[object BigUint64Array]"}function mb(r){return Rr(r)==="[object Map]"}function yb(r){return Rr(r)==="[object Set]"}function bb(r){return Rr(r)==="[object WeakMap]"}function E1(r){return Rr(r)==="[object WeakSet]"}function Ab(r){return Rr(r)==="[object ArrayBuffer]"}function mD(r){return typeof ArrayBuffer<"u"&&(Ab.working?Ab(r):r instanceof ArrayBuffer)}function xb(r){return Rr(r)==="[object DataView]"}function yD(r){return typeof DataView<"u"&&(xb.working?xb(r):r instanceof DataView)}function Sb(r){return Rr(r)==="[object SharedArrayBuffer]"}function bD(r){return typeof SharedArrayBuffer<"u"&&(Sb.working?Sb(r):r instanceof SharedArrayBuffer)}function wD(r){return dg(r,m4)}function vD(r){return dg(r,y4)}function ED(r){return dg(r,b4)}function _D(r){return ND&&dg(r,OD)}function AD(r){return R1&&dg(r,LD)}function Nl(r,e){var t={seen:[],stylize:E4};return arguments.length>=3&&(t.depth=arguments[2]),arguments.length>=4&&(t.colors=arguments[3]),D1(e)?t.showHidden=e:e&&qe._extend(t,e),tc(t.showHidden)&&(t.showHidden=!1),tc(t.depth)&&(t.depth=2),tc(t.colors)&&(t.colors=!1),tc(t.customInspect)&&(t.customInspect=!0),t.colors&&(t.stylize=v4),Tb(t,r,t.depth)}function v4(r,e){var t=Nl.styles[e];return t?"\x1B["+Nl.colors[t][0]+"m"+r+"\x1B["+Nl.colors[t][1]+"m":r}function E4(r,e){return r}function Tb(r,e,t){if(r.customInspect&&e&&_b(e.inspect)&&e.inspect!==qe.inspect&&(!e.constructor||e.constructor.prototype!==e)){var n=e.inspect(t,r);return Cb(n)||(n=Tb(r,n,t)),n}var i=(function(d,g){if(tc(g))return d.stylize("undefined","undefined");if(Cb(g)){var y="'"+JSON.stringify(g).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return d.stylize(y,"string")}if(XD(g))return d.stylize(""+g,"number");if(D1(g))return d.stylize(""+g,"boolean");if(Ib(g))return d.stylize("null","null")})(r,e);if(i)return i;var o=Object.keys(e),s=(function(d){var g={};return d.forEach((function(y,v){g[y]=!0})),g})(o);if(r.showHidden&&(o=Object.getOwnPropertyNames(e)),hg(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return _1(e);if(o.length===0){if(_b(e)){var a=e.name?": "+e.name:"";return r.stylize("[Function"+a+"]","special")}if(fg(e))return r.stylize(RegExp.prototype.toString.call(e),"regexp");if(Rb(e))return r.stylize(Date.prototype.toString.call(e),"date");if(hg(e))return _1(e)}var u,c="",f=!1,h=["{","}"];return VD(e)&&(f=!0,h=["[","]"]),_b(e)&&(c=" [Function"+(e.name?": "+e.name:"")+"]"),fg(e)&&(c=" "+RegExp.prototype.toString.call(e)),Rb(e)&&(c=" "+Date.prototype.toUTCString.call(e)),hg(e)&&(c=" "+_1(e)),o.length!==0||f&&e.length!=0?t<0?fg(e)?r.stylize(RegExp.prototype.toString.call(e),"regexp"):r.stylize("[Object]","special"):(r.seen.push(e),u=f?(function(d,g,y,v,w){for(var b=[],E=0,_=g.length;E<_;++E)YD(g,String(E))?b.push(A1(d,g,y,v,String(E),!0)):b.push("");return w.forEach((function(S){S.match(/^\d+$/)||b.push(A1(d,g,y,v,S,!0))})),b})(r,e,t,s,o):o.map((function(d){return A1(r,e,t,s,d,f)})),r.seen.pop(),(function(d,g,y){var v=0;return d.reduce((function(w,b){return v++,b.indexOf(`
11
+ `)>=0&&v++,w+b.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?y[0]+(g===""?"":g+`
12
+ `)+" "+d.join(`,
13
+ `)+" "+y[1]:y[0]+g+" "+d.join(", ")+" "+y[1]})(u,c,h)):h[0]+c+h[1]}function _1(r){return"["+Error.prototype.toString.call(r)+"]"}function A1(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")),YD(n,i)||(s="["+i+"]"),a||(r.seen.indexOf(u.value)<0?(a=Ib(t)?Tb(r,u.value,null):Tb(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")),tc(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 VD(r){return Array.isArray(r)}function D1(r){return typeof r=="boolean"}function Ib(r){return r===null}function XD(r){return typeof r=="number"}function Cb(r){return typeof r=="string"}function tc(r){return r===void 0}function fg(r){return yh(r)&&I1(r)==="[object RegExp]"}function yh(r){return typeof r=="object"&&r!==null}function Rb(r){return yh(r)&&I1(r)==="[object Date]"}function hg(r){return yh(r)&&(I1(r)==="[object Error]"||r instanceof Error)}function _b(r){return typeof r=="function"}function I1(r){return Object.prototype.toString.call(r)}function x1(r){return r<10?"0"+r.toString(10):r.toString(10)}function A4(){var r=new Date,e=[x1(r.getHours()),x1(r.getMinutes()),x1(r.getSeconds())].join(":");return[r.getDate(),_4[r.getMonth()],e].join(" ")}function YD(r,e){return Object.prototype.hasOwnProperty.call(r,e)}function x4(r,e){if(!r){var t=new Error("Promise was rejected with a falsy value");t.reason=r,r=t}return e(r)}var SD,ca,fa,mh,Gr,ec,ha,gh,Eb,dr,n4,C1,Db,RD,i4,s4,o4,a4,l4,DD,ID,dD,u4,c4,f4,kD,Pt,h4,d4,p4,ND,R1,Li,ui,g4,pD,Pi,Rr,m4,y4,b4,OD,LD,cg,qe,mo,xD,w4,wb,GD,vb,_4,Qu,jZ,Ol=bt(()=>{Se();Ce();Te();mh=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window,Gr=SD={};(function(){try{ca=typeof setTimeout=="function"?setTimeout:S1}catch{ca=S1}try{fa=typeof clearTimeout=="function"?clearTimeout:T1}catch{fa=T1}})();ha=[],gh=!1,Eb=-1;Gr.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];ha.push(new hD(r,e)),ha.length!==1||gh||TD(CD)},hD.prototype.run=function(){(this||mh).fun.apply(null,(this||mh).array)},Gr.title="browser",Gr.browser=!0,Gr.env={},Gr.argv=[],Gr.version="",Gr.versions={},Gr.on=ua,Gr.addListener=ua,Gr.once=ua,Gr.off=ua,Gr.removeListener=ua,Gr.removeAllListeners=ua,Gr.emit=ua,Gr.prependListener=ua,Gr.prependOnceListener=ua,Gr.listeners=function(r){return[]},Gr.binding=function(r){throw new Error("process.binding is not supported")},Gr.cwd=function(){return"/"},Gr.chdir=function(r){throw new Error("process.chdir is not supported")},Gr.umask=function(){return 0};dr=SD;dr.addListener;dr.argv;dr.binding;dr.browser;dr.chdir;dr.cwd;dr.emit;dr.env;dr.listeners;dr.nextTick;dr.off;dr.on;dr.once;dr.prependListener;dr.prependOnceListener;dr.removeAllListeners;dr.removeListener;dr.title;dr.umask;dr.version;dr.versions;n4=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",C1=Object.prototype.toString,Db=function(r){return!(n4&&r&&typeof r=="object"&&Symbol.toStringTag in r)&&C1.call(r)==="[object Arguments]"},RD=function(r){return!!Db(r)||r!==null&&typeof r=="object"&&typeof r.length=="number"&&r.length>=0&&C1.call(r)!=="[object Array]"&&C1.call(r.callee)==="[object Function]"},i4=(function(){return Db(arguments)})();Db.isLegacyArguments=RD;s4=i4?Db:RD,o4=Object.prototype.toString,a4=Function.prototype.toString,l4=/^\s*(?:function)?\*/,DD=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",ID=Object.getPrototypeOf,dD=(function(){if(!DD)return!1;try{return Function("return function*() {}")()}catch{}})(),u4=dD?ID(dD):{},c4=function(r){return typeof r=="function"&&(!!l4.test(a4.call(r))||(DD?ID(r)===u4:o4.call(r)==="[object GeneratorFunction]"))},f4=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}},kD=function(r){return r&&typeof r=="object"&&typeof r.copy=="function"&&typeof r.fill=="function"&&typeof r.readUInt8=="function"},Pt={},h4=kD,d4=s4,p4=c4;ND=typeof BigInt<"u",R1=typeof Symbol<"u",Li=R1&&Symbol.toStringTag!==void 0,ui=typeof Uint8Array<"u",g4=typeof ArrayBuffer<"u";ui&&Li&&(pD=Object.getPrototypeOf(Uint8Array.prototype),Pi=rc(Object.getOwnPropertyDescriptor(pD,Symbol.toStringTag).get));Rr=rc(Object.prototype.toString),m4=rc(Number.prototype.valueOf),y4=rc(String.prototype.valueOf),b4=rc(Boolean.prototype.valueOf);ND&&(OD=rc(BigInt.prototype.valueOf));R1&&(LD=rc(Symbol.prototype.valueOf));Pt.isArgumentsObject=d4,Pt.isGeneratorFunction=p4,Pt.isPromise=function(r){return typeof Promise<"u"&&r instanceof Promise||r!==null&&typeof r=="object"&&typeof r.then=="function"&&typeof r.catch=="function"},Pt.isArrayBufferView=function(r){return g4&&ArrayBuffer.isView?ArrayBuffer.isView(r):gD(r)||yD(r)},Pt.isTypedArray=gD,Pt.isUint8Array=PD,Pt.isUint8ClampedArray=FD,Pt.isUint16Array=MD,Pt.isUint32Array=BD,Pt.isInt8Array=UD,Pt.isInt16Array=jD,Pt.isInt32Array=$D,Pt.isFloat32Array=zD,Pt.isFloat64Array=WD,Pt.isBigInt64Array=HD,Pt.isBigUint64Array=qD,mb.working=typeof Map<"u"&&mb(new Map),Pt.isMap=function(r){return typeof Map<"u"&&(mb.working?mb(r):r instanceof Map)},yb.working=typeof Set<"u"&&yb(new Set),Pt.isSet=function(r){return typeof Set<"u"&&(yb.working?yb(r):r instanceof Set)},bb.working=typeof WeakMap<"u"&&bb(new WeakMap),Pt.isWeakMap=function(r){return typeof WeakMap<"u"&&(bb.working?bb(r):r instanceof WeakMap)},E1.working=typeof WeakSet<"u"&&E1(new WeakSet),Pt.isWeakSet=function(r){return E1(r)},Ab.working=typeof ArrayBuffer<"u"&&Ab(new ArrayBuffer),Pt.isArrayBuffer=mD,xb.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&xb(new DataView(new ArrayBuffer(1),0,1)),Pt.isDataView=yD,Sb.working=typeof SharedArrayBuffer<"u"&&Sb(new SharedArrayBuffer),Pt.isSharedArrayBuffer=bD,Pt.isAsyncFunction=function(r){return Rr(r)==="[object AsyncFunction]"},Pt.isMapIterator=function(r){return Rr(r)==="[object Map Iterator]"},Pt.isSetIterator=function(r){return Rr(r)==="[object Set Iterator]"},Pt.isGeneratorObject=function(r){return Rr(r)==="[object Generator]"},Pt.isWebAssemblyCompiledModule=function(r){return Rr(r)==="[object WebAssembly.Module]"},Pt.isNumberObject=wD,Pt.isStringObject=vD,Pt.isBooleanObject=ED,Pt.isBigIntObject=_D,Pt.isSymbolObject=AD,Pt.isBoxedPrimitive=function(r){return wD(r)||vD(r)||ED(r)||_D(r)||AD(r)},Pt.isAnyArrayBuffer=function(r){return ui&&(mD(r)||bD(r))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(r){Object.defineProperty(Pt,r,{enumerable:!1,value:function(){throw new Error(r+" is not supported in userland")}})}));cg=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window,qe={},mo=dr,xD=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},w4=/%[sdj%]/g;qe.format=function(r){if(!Cb(r)){for(var e=[],t=0;t<arguments.length;t++)e.push(Nl(arguments[t]));return e.join(" ")}t=1;for(var n=arguments,i=n.length,o=String(r).replace(w4,(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])Ib(s)||!yh(s)?o+=" "+s:o+=" "+Nl(s);return o},qe.deprecate=function(r,e){if(mo!==void 0&&mo.noDeprecation===!0)return r;if(mo===void 0)return function(){return qe.deprecate(r,e).apply(this||cg,arguments)};var t=!1;return function(){if(!t){if(mo.throwDeprecation)throw new Error(e);mo.traceDeprecation?console.trace(e):console.error(e),t=!0}return r.apply(this||cg,arguments)}};wb={},GD=/^$/;mo.env.NODE_DEBUG&&(vb=mo.env.NODE_DEBUG,vb=vb.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),GD=new RegExp("^"+vb+"$","i"));qe.debuglog=function(r){if(r=r.toUpperCase(),!wb[r])if(GD.test(r)){var e=mo.pid;wb[r]=function(){var t=qe.format.apply(qe,arguments);console.error("%s %d: %s",r,e,t)}}else wb[r]=function(){};return wb[r]},qe.inspect=Nl,Nl.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]},Nl.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},qe.types=Pt,qe.isArray=VD,qe.isBoolean=D1,qe.isNull=Ib,qe.isNullOrUndefined=function(r){return r==null},qe.isNumber=XD,qe.isString=Cb,qe.isSymbol=function(r){return typeof r=="symbol"},qe.isUndefined=tc,qe.isRegExp=fg,qe.types.isRegExp=fg,qe.isObject=yh,qe.isDate=Rb,qe.types.isDate=Rb,qe.isError=hg,qe.types.isNativeError=hg,qe.isFunction=_b,qe.isPrimitive=function(r){return r===null||typeof r=="boolean"||typeof r=="number"||typeof r=="string"||typeof r=="symbol"||r===void 0},qe.isBuffer=kD;_4=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];qe.log=function(){console.log("%s - %s",A4(),qe.format.apply(qe,arguments))},qe.inherits=f4,qe._extend=function(r,e){if(!e||!yh(e))return r;for(var t=Object.keys(e),n=t.length;n--;)r[t[n]]=e[t[n]];return r};Qu=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;qe.promisify=function(r){if(typeof r!="function")throw new TypeError('The "original" argument must be of type Function');if(Qu&&r[Qu]){var e;if(typeof(e=r[Qu])!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,Qu,{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||cg,o)}catch(a){n(a)}return i}return Object.setPrototypeOf(e,Object.getPrototypeOf(r)),Qu&&Object.defineProperty(e,Qu,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,xD(r))},qe.promisify.custom=Qu,qe.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||cg,s=function(){return i.apply(o,arguments)};r.apply(this||cg,t).then((function(a){mo.nextTick(s.bind(null,null,a))}),(function(a){mo.nextTick(x4.bind(null,a,s))}))}return Object.setPrototypeOf(e,Object.getPrototypeOf(r)),Object.defineProperties(e,xD(r)),e};qe._extend;qe.callbackify;qe.debuglog;qe.deprecate;qe.format;qe.inherits;qe.inspect;qe.isArray;qe.isBoolean;qe.isBuffer;qe.isDate;qe.isError;qe.isFunction;qe.isNull;qe.isNullOrUndefined;qe.isNumber;qe.isObject;qe.isPrimitive;qe.isRegExp;qe.isString;qe.isSymbol;qe.isUndefined;qe.log;qe.promisify;qe._extend;qe.callbackify;qe.debuglog;qe.deprecate;qe.format;qe.inherits;qe.inspect;qe.isArray;qe.isBoolean;qe.isBuffer;qe.isDate;qe.isError;qe.isFunction;qe.isNull;qe.isNullOrUndefined;qe.isNumber;qe.isObject;qe.isPrimitive;qe.isRegExp;qe.isString;qe.isSymbol;qe.isUndefined;qe.log;jZ=qe.promisify;qe.types});function ZD(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 jI(){if(uI)return M1;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,d){return h.__proto__=d,h})(c,f)}uI=!0;var i,o,s={};function a(c,f,h){h||(h=Error);var d=(function(g){function y(v,w,b){var E;return(function(_,S){if(!(_ instanceof S))throw new TypeError("Cannot call a class as a function")})(this,y),(E=e(this,t(y).call(this,(function(_,S,A){return typeof f=="string"?f:f(_,S,A)})(v,w,b)))).code=c,E}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)})(y,g),y})(h);s[c]=d}function u(c,f){if(Array.isArray(c)){var h=c.length;return c=c.map((function(d){return String(d)})),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 d,g,y;if(i===void 0&&(i=W1()),i(typeof c=="string","'name' must be a string"),typeof f=="string"&&(g="not ",f.substr(0,g.length)===g)?(d="must not be",f=f.replace(/^not /,"")):d="must be",(function(w,b,E){return(E===void 0||E>w.length)&&(E=w.length),w.substring(E-b.length,E)===b})(c," argument"))y="The ".concat(c," ").concat(d," ").concat(u(f,"type"));else{var v=(function(w,b,E){return typeof E!="number"&&(E=0),!(E+b.length>w.length)&&w.indexOf(b,E)!==-1})(c,".")?"property":"argument";y='The "'.concat(c,'" ').concat(v," ").concat(d," ").concat(u(f,"type"))}return y+=". 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=qe);var d=o.inspect(f);return d.length>128&&(d="".concat(d.slice(0,128),"...")),"The argument '".concat(c,"' ").concat(h,". Received ").concat(d)}),TypeError),a("ERR_INVALID_RETURN_VALUE",(function(c,f,h){var d;return d=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(d,".")}),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=W1()),i(f.length>0,"At least one arg needs to be specified");var d="The ",g=f.length;switch(f=f.map((function(y){return'"'.concat(y,'"')})),g){case 1:d+="".concat(f[0]," argument");break;case 2:d+="".concat(f[0]," and ").concat(f[1]," arguments");break;default:d+=f.slice(0,g-1).join(", "),d+=", and ".concat(f[g-1]," arguments")}return"".concat(d," must be specified")}),TypeError),M1.codes=s,M1}function u5(){if(fI)return cI;fI=!0;var r=dr;function e(I,q,Q){return q in I?Object.defineProperty(I,q,{value:Q,enumerable:!0,configurable:!0,writable:!0}):I[q]=Q,I}function t(I,q){for(var Q=0;Q<q.length;Q++){var Z=q[Q];Z.enumerable=Z.enumerable||!1,Z.configurable=!0,"value"in Z&&(Z.writable=!0),Object.defineProperty(I,Z.key,Z)}}function n(I,q){return!q||f(q)!=="object"&&typeof q!="function"?i(I):q}function i(I){if(I===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I}function o(I){var q=typeof Map=="function"?new Map:void 0;return(o=function(Q){if(Q===null||(Z=Q,Function.toString.call(Z).indexOf("[native code]")===-1))return Q;var Z;if(typeof Q!="function")throw new TypeError("Super expression must either be null or a function");if(q!==void 0){if(q.has(Q))return q.get(Q);q.set(Q,ne)}function ne(){return a(Q,arguments,c(this).constructor)}return ne.prototype=Object.create(Q.prototype,{constructor:{value:ne,enumerable:!1,writable:!0,configurable:!0}}),u(ne,Q)})(I)}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(I,q,Q){return(a=s()?Reflect.construct:function(Z,ne,L){var $=[null];$.push.apply($,ne);var X=new(Function.bind.apply(Z,$));return L&&u(X,L.prototype),X}).apply(null,arguments)}function u(I,q){return(u=Object.setPrototypeOf||function(Q,Z){return Q.__proto__=Z,Q})(I,q)}function c(I){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(q){return q.__proto__||Object.getPrototypeOf(q)})(I)}function f(I){return(f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(q){return typeof q}:function(q){return q&&typeof Symbol=="function"&&q.constructor===Symbol&&q!==Symbol.prototype?"symbol":typeof q})(I)}var h=qe.inspect,d=jI().codes.ERR_INVALID_ARG_TYPE;function g(I,q,Q){return(Q===void 0||Q>I.length)&&(Q=I.length),I.substring(Q-q.length,Q)===q}var y="",v="",w="",b="",E={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 _(I){var q=Object.keys(I),Q=Object.create(Object.getPrototypeOf(I));return q.forEach((function(Z){Q[Z]=I[Z]})),Object.defineProperty(Q,"message",{value:I.message}),Q}function S(I){return h(I,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function A(I,q,Q){var Z="",ne="",L=0,$="",X=!1,ie=S(I),re=ie.split(`
20
+ `),O=S(q).split(`
21
+ `),x=0,P="";if(Q==="strictEqual"&&f(I)==="object"&&f(q)==="object"&&I!==null&&q!==null&&(Q="strictEqualObject"),re.length===1&&O.length===1&&re[0]!==O[0]){var C=re[0].length+O[0].length;if(C<=10){if(!(f(I)==="object"&&I!==null||f(q)==="object"&&q!==null||I===0&&q===0))return"".concat(E[Q],`
22
+
23
+ `)+"".concat(re[0]," !== ").concat(O[0],`
24
+ `)}else if(Q!=="strictEqualObject"&&C<(r.stderr&&r.stderr.isTTY?r.stderr.columns:80)){for(;re[0][x]===O[0][x];)x++;x>2&&(P=`
25
+ `.concat((function(V,F){if(F=Math.floor(F),V.length==0||F==0)return"";var oe=V.length*F;for(F=Math.floor(Math.log(F)/Math.log(2));F;)V+=V,F--;return V+=V.substring(0,oe-V.length)})(" ",x),"^"),x=0)}}for(var j=re[re.length-1],U=O[O.length-1];j===U&&(x++<2?$=`
26
+ `.concat(j).concat($):Z=j,re.pop(),O.pop(),re.length!==0&&O.length!==0);)j=re[re.length-1],U=O[O.length-1];var B=Math.max(re.length,O.length);if(B===0){var ee=ie.split(`
27
+ `);if(ee.length>30)for(ee[26]="".concat(y,"...").concat(b);ee.length>27;)ee.pop();return"".concat(E.notIdentical,`
28
+
29
+ `).concat(ee.join(`
30
+ `),`
31
+ `)}x>3&&($=`
32
+ `.concat(y,"...").concat(b).concat($),X=!0),Z!==""&&($=`
33
+ `.concat(Z).concat($),Z="");var fe=0,Ee=E[Q]+`
34
+ `.concat(v,"+ actual").concat(b," ").concat(w,"- expected").concat(b),te=" ".concat(y,"...").concat(b," Lines skipped");for(x=0;x<B;x++){var H=x-L;if(re.length<x+1)H>1&&x>2&&(H>4?(ne+=`
35
+ `.concat(y,"...").concat(b),X=!0):H>3&&(ne+=`
36
+ `.concat(O[x-2]),fe++),ne+=`
37
+ `.concat(O[x-1]),fe++),L=x,Z+=`
38
+ `.concat(w,"-").concat(b," ").concat(O[x]),fe++;else if(O.length<x+1)H>1&&x>2&&(H>4?(ne+=`
39
+ `.concat(y,"...").concat(b),X=!0):H>3&&(ne+=`
40
+ `.concat(re[x-2]),fe++),ne+=`
41
+ `.concat(re[x-1]),fe++),L=x,ne+=`
42
+ `.concat(v,"+").concat(b," ").concat(re[x]),fe++;else{var ae=O[x],we=re[x],xe=we!==ae&&(!g(we,",")||we.slice(0,-1)!==ae);xe&&g(ae,",")&&ae.slice(0,-1)===we&&(xe=!1,we+=","),xe?(H>1&&x>2&&(H>4?(ne+=`
43
+ `.concat(y,"...").concat(b),X=!0):H>3&&(ne+=`
44
+ `.concat(re[x-2]),fe++),ne+=`
45
+ `.concat(re[x-1]),fe++),L=x,ne+=`
46
+ `.concat(v,"+").concat(b," ").concat(we),Z+=`
47
+ `.concat(w,"-").concat(b," ").concat(ae),fe+=2):(ne+=Z,Z="",H!==1&&x!==0||(ne+=`
48
+ `.concat(we),fe++))}if(fe>20&&x<B-2)return"".concat(Ee).concat(te,`
49
+ `).concat(ne,`
50
+ `).concat(y,"...").concat(b).concat(Z,`
51
+ `)+"".concat(y,"...").concat(b)}return"".concat(Ee).concat(X?te:"",`
52
+ `).concat(ne).concat(Z).concat($).concat(P)}var M=(function(I){function q(ne){var L;if((function(ee,fe){if(!(ee instanceof fe))throw new TypeError("Cannot call a class as a function")})(this,q),f(ne)!=="object"||ne===null)throw new d("options","Object",ne);var $=ne.message,X=ne.operator,ie=ne.stackStartFn,re=ne.actual,O=ne.expected,x=Error.stackTraceLimit;if(Error.stackTraceLimit=0,$!=null)L=n(this,c(q).call(this,String($)));else if(r.stderr&&r.stderr.isTTY&&(r.stderr&&r.stderr.getColorDepth&&r.stderr.getColorDepth()!==1?(y="\x1B[34m",v="\x1B[32m",b="\x1B[39m",w="\x1B[31m"):(y="",v="",b="",w="")),f(re)==="object"&&re!==null&&f(O)==="object"&&O!==null&&"stack"in re&&re instanceof Error&&"stack"in O&&O instanceof Error&&(re=_(re),O=_(O)),X==="deepStrictEqual"||X==="strictEqual")L=n(this,c(q).call(this,A(re,O,X)));else if(X==="notDeepStrictEqual"||X==="notStrictEqual"){var P=E[X],C=S(re).split(`
53
+ `);if(X==="notStrictEqual"&&f(re)==="object"&&re!==null&&(P=E.notStrictEqualObject),C.length>30)for(C[26]="".concat(y,"...").concat(b);C.length>27;)C.pop();L=C.length===1?n(this,c(q).call(this,"".concat(P," ").concat(C[0]))):n(this,c(q).call(this,"".concat(P,`
54
+
55
+ `).concat(C.join(`
56
+ `),`
57
+ `)))}else{var j=S(re),U="",B=E[X];X==="notDeepEqual"||X==="notEqual"?(j="".concat(E[X],`
58
+
59
+ `).concat(j)).length>1024&&(j="".concat(j.slice(0,1021),"...")):(U="".concat(S(O)),j.length>512&&(j="".concat(j.slice(0,509),"...")),U.length>512&&(U="".concat(U.slice(0,509),"...")),X==="deepEqual"||X==="equal"?j="".concat(B,`
60
+
61
+ `).concat(j,`
62
+
63
+ should equal
64
+
65
+ `):U=" ".concat(X," ").concat(U)),L=n(this,c(q).call(this,"".concat(j).concat(U)))}return Error.stackTraceLimit=x,L.generatedMessage=!$,Object.defineProperty(i(L),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),L.code="ERR_ASSERTION",L.actual=re,L.expected=O,L.operator=X,Error.captureStackTrace&&Error.captureStackTrace(i(L),ie),L.stack,L.name="AssertionError",n(L)}var Q,Z;return(function(ne,L){if(typeof L!="function"&&L!==null)throw new TypeError("Super expression must either be null or a function");ne.prototype=Object.create(L&&L.prototype,{constructor:{value:ne,writable:!0,configurable:!0}}),L&&u(ne,L)})(q,I),Q=q,(Z=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:h.custom,value:function(ne,L){return h(this,(function($){for(var X=1;X<arguments.length;X++){var ie=arguments[X]!=null?arguments[X]:{},re=Object.keys(ie);typeof Object.getOwnPropertySymbols=="function"&&(re=re.concat(Object.getOwnPropertySymbols(ie).filter((function(O){return Object.getOwnPropertyDescriptor(ie,O).enumerable})))),re.forEach((function(O){e($,O,ie[O])}))}return $})({},L,{customInspect:!1,depth:0}))}}])&&t(Q.prototype,Z),q})(o(Error));return cI=M}function hI(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 zs(r){return(zs=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 G1(r){return r.call.bind(r)}function b5(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 Lb(r){return Object.keys(r).filter(b5).concat(Fb(r).filter(Object.prototype.propertyIsEnumerable.bind(r)))}function _I(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 ds(r,e,t,n){if(r===e)return r!==0||!t||pI(r,e);if(t){if(zs(r)!=="object")return typeof r=="number"&&z1(r)&&z1(e);if(zs(e)!=="object"||r===null||e===null||Object.getPrototypeOf(r)!==Object.getPrototypeOf(e))return!1}else{if(r===null||zs(r)!=="object")return(e===null||zs(e)!=="object")&&r==e;if(e===null||zs(e)!=="object")return!1}var i,o,s,a,u=gI(r);if(u!==gI(e))return!1;if(Array.isArray(r)){if(r.length!==e.length)return!1;var c=Lb(r),f=Lb(e);return c.length===f.length&&mg(r,e,t,n,1,c)}if(u==="[object Object]"&&(!Nb(r)&&Nb(e)||!Ob(r)&&Ob(e)))return!1;if(mI(r)){if(!mI(e)||Date.prototype.getTime.call(r)!==Date.prototype.getTime.call(e))return!1}else if(yI(r)){if(!yI(e)||(s=r,a=e,!(c5?s.source===a.source&&s.flags===a.flags:RegExp.prototype.toString.call(s)===RegExp.prototype.toString.call(a))))return!1}else if(d5(r)||r instanceof Error){if(r.message!==e.message||r.name!==e.name)return!1}else{if(h5(r)){if(t||!m5(r)&&!y5(r)){if(!(function(g,y){return g.byteLength===y.byteLength&&_I(new Uint8Array(g.buffer,g.byteOffset,g.byteLength),new Uint8Array(y.buffer,y.byteOffset,y.byteLength))===0})(r,e))return!1}else if(!(function(g,y){if(g.byteLength!==y.byteLength)return!1;for(var v=0;v<g.byteLength;v++)if(g[v]!==y[v])return!1;return!0})(r,e))return!1;var h=Lb(r),d=Lb(e);return h.length===d.length&&mg(r,e,t,n,0,h)}if(Ob(r))return!(!Ob(e)||r.size!==e.size)&&mg(r,e,t,n,2);if(Nb(r))return!(!Nb(e)||r.size!==e.size)&&mg(r,e,t,n,3);if(f5(r)){if(o=e,(i=r).byteLength!==o.byteLength||_I(new Uint8Array(i),new Uint8Array(o))!==0)return!1}else if(p5(r)&&!(function(g,y){return bI(g)?bI(y)&&pI(Number.prototype.valueOf.call(g),Number.prototype.valueOf.call(y)):wI(g)?wI(y)&&String.prototype.valueOf.call(g)===String.prototype.valueOf.call(y):vI(g)?vI(y)&&Boolean.prototype.valueOf.call(g)===Boolean.prototype.valueOf.call(y):EI(g)?EI(y)&&BigInt.prototype.valueOf.call(g)===BigInt.prototype.valueOf.call(y):g5(y)&&Symbol.prototype.valueOf.call(g)===Symbol.prototype.valueOf.call(y)})(r,e))return!1}return mg(r,e,t,n,0)}function AI(r,e){return e.filter((function(t){return Mb(r,t)}))}function mg(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(!yg(e,o[a]))return!1;if(t&&arguments.length===5){var u=Fb(r);if(u.length!==0){var c=0;for(a=0;a<u.length;a++){var f=u[a];if(Mb(r,f)){if(!Mb(e,f))return!1;o.push(f),c++}else if(Mb(e,f))return!1}var h=Fb(e);if(u.length!==h.length&&AI(e,h).length!==c)return!1}else{var d=Fb(e);if(d.length!==0&&AI(e,d).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 g=n.val1.get(r);if(g!==void 0){var y=n.val2.get(e);if(y!==void 0)return g===y}n.position++}n.val1.set(r,n.position),n.val2.set(e,n.position);var v=E5(r,e,t,o,n,i);return n.val1.delete(r),n.val2.delete(e),v}function xI(r,e,t,n){for(var i=Bb(r),o=0;o<i.length;o++){var s=i[o];if(ds(e,s,t,n))return r.delete(s),!0}return!1}function $I(r){switch(zs(r)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":r=+r;case"number":if(z1(r))return!1}return!0}function w5(r,e,t){var n=$I(t);return n??(e.has(n)&&!r.has(n))}function v5(r,e,t,n,i){var o=$I(t);if(o!=null)return o;var s=e.get(o);return!(s===void 0&&!e.has(o)||!ds(n,s,!1,i))&&!r.has(o)&&ds(n,s,!1,i)}function SI(r,e,t,n,i,o){for(var s=Bb(r),a=0;a<s.length;a++){var u=s[a];if(ds(t,u,i,o)&&ds(n,e.get(u),i,o))return r.delete(u),!0}return!1}function E5(r,e,t,n,i,o){var s=0;if(o===2){if(!(function(f,h,d,g){for(var y=null,v=Bb(f),w=0;w<v.length;w++){var b=v[w];if(zs(b)==="object"&&b!==null)y===null&&(y=new Set),y.add(b);else if(!h.has(b)){if(d||!w5(f,h,b))return!1;y===null&&(y=new Set),y.add(b)}}if(y!==null){for(var E=Bb(h),_=0;_<E.length;_++){var S=E[_];if(zs(S)==="object"&&S!==null){if(!xI(y,S,d,g))return!1}else if(!d&&!f.has(S)&&!xI(y,S,d,g))return!1}return y.size===0}return!0})(r,e,t,i))return!1}else if(o===3){if(!(function(f,h,d,g){for(var y=null,v=dI(f),w=0;w<v.length;w++){var b=hI(v[w],2),E=b[0],_=b[1];if(zs(E)==="object"&&E!==null)y===null&&(y=new Set),y.add(E);else{var S=h.get(E);if(S===void 0&&!h.has(E)||!ds(_,S,d,g)){if(d||!v5(f,h,E,_,g))return!1;y===null&&(y=new Set),y.add(E)}}}if(y!==null){for(var A=dI(h),M=0;M<A.length;M++){var I=hI(A[M],2),q=(E=I[0],I[1]);if(zs(E)==="object"&&E!==null){if(!SI(y,f,E,q,d,g))return!1}else if(!(d||f.has(E)&&ds(f.get(E),q,!1,g)||SI(y,f,E,q,!1,g)))return!1}return y.size===0}return!0})(r,e,t,i))return!1}else if(o===1)for(;s<r.length;s++){if(!yg(r,s)){if(yg(e,s))return!1;for(var a=Object.keys(r);s<a.length;s++){var u=a[s];if(!yg(e,u)||!ds(r[u],e[u],t,i))return!1}return a.length===Object.keys(e).length}if(!yg(e,s)||!ds(r[s],e[s],t,i))return!1}for(s=0;s<n.length;s++){var c=n[s];if(!ds(r[c],e[c],t,i))return!1}return!0}function W1(){if(CI)return B1;CI=!0;var r=dr;function e(O){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})(O)}var t,n,i=jI().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=u5(),h=qe.inspect,d=qe.types,g=d.isPromise,y=d.isRegExp,v=Object.assign?Object.assign:S4.assign,w=Object.is?Object.is:MI;function b(){t=TI.isDeepEqual,n=TI.isDeepStrictEqual}var E=!1,_=B1=I,S={};function A(O){throw O.message instanceof Error?O.message:new f(O)}function M(O,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:O});throw U.generatedMessage=j,U}}function I(){for(var O=arguments.length,x=new Array(O),P=0;P<O;P++)x[P]=arguments[P];M.apply(void 0,[I,x.length].concat(x))}_.fail=function O(x,P,C,j,U){var B,ee=arguments.length;if(ee===0)B="Failed";else if(ee===1)C=x,x=void 0;else{if(E===!1){E=!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")}ee===2&&(j="!=")}if(C instanceof Error)throw C;var Ee={actual:x,expected:P,operator:j===void 0?"fail":j,stackStartFn:U||O};C!==void 0&&(Ee.message=C);var te=new f(Ee);throw B&&(te.message=B,te.generatedMessage=!0),te},_.AssertionError=f,_.ok=I,_.equal=function O(x,P,C){if(arguments.length<2)throw new c("actual","expected");x!=P&&A({actual:x,expected:P,message:C,operator:"==",stackStartFn:O})},_.notEqual=function O(x,P,C){if(arguments.length<2)throw new c("actual","expected");x==P&&A({actual:x,expected:P,message:C,operator:"!=",stackStartFn:O})},_.deepEqual=function O(x,P,C){if(arguments.length<2)throw new c("actual","expected");t===void 0&&b(),t(x,P)||A({actual:x,expected:P,message:C,operator:"deepEqual",stackStartFn:O})},_.notDeepEqual=function O(x,P,C){if(arguments.length<2)throw new c("actual","expected");t===void 0&&b(),t(x,P)&&A({actual:x,expected:P,message:C,operator:"notDeepEqual",stackStartFn:O})},_.deepStrictEqual=function O(x,P,C){if(arguments.length<2)throw new c("actual","expected");t===void 0&&b(),n(x,P)||A({actual:x,expected:P,message:C,operator:"deepStrictEqual",stackStartFn:O})},_.notDeepStrictEqual=function O(x,P,C){if(arguments.length<2)throw new c("actual","expected");t===void 0&&b(),n(x,P)&&A({actual:x,expected:P,message:C,operator:"notDeepStrictEqual",stackStartFn:O})},_.strictEqual=function O(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:O})},_.notStrictEqual=function O(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:O})};var q=function O(x,P,C){var j=this;(function(U,B){if(!(U instanceof B))throw new TypeError("Cannot call a class as a function")})(this,O),P.forEach((function(U){U in x&&(C!==void 0&&typeof C[U]=="string"&&y(x[U])&&x[U].test(C[U])?j[U]=C[U]:j[U]=x[U])}))};function Q(O,x,P,C,j,U){if(!(P in O)||!n(O[P],x[P])){if(!C){var B=new q(O,j),ee=new q(x,j,O),fe=new f({actual:B,expected:ee,operator:"deepStrictEqual",stackStartFn:U});throw fe.actual=O,fe.expected=x,fe.operator=U.name,fe}A({actual:O,expected:x,message:C,operator:U.name,stackStartFn:U})}}function Z(O,x,P,C){if(typeof x!="function"){if(y(x))return x.test(O);if(arguments.length===2)throw new s("expected",["Function","RegExp"],x);if(e(O)!=="object"||O===null){var j=new f({actual:O,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&&b(),U.forEach((function(B){typeof O[B]=="string"&&y(x[B])&&x[B].test(O[B])||Q(O,x,B,P,U,C)})),!0}return x.prototype!==void 0&&O instanceof x||!Error.isPrototypeOf(x)&&x.call({},O)===!0}function ne(O){if(typeof O!="function")throw new s("fn","Function",O);try{O()}catch(x){return x}return S}function L(O){return g(O)||O!==null&&e(O)==="object"&&typeof O.then=="function"&&typeof O.catch=="function"}function $(O){return Promise.resolve().then((function(){var x;if(typeof O=="function"){if(!L(x=O()))throw new u("instance of Promise","promiseFn",x)}else{if(!L(O))throw new s("promiseFn",["Function","Promise"],O);x=O}return Promise.resolve().then((function(){return x})).then((function(){return S})).catch((function(P){return P}))}))}function X(O,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=O.name==="rejects"?"rejection":"exception";A({actual:void 0,expected:P,operator:O.name,message:"Missing expected ".concat(U).concat(j),stackStartFn:O})}if(P&&!Z(x,P,C,O))throw x}function ie(O,x,P,C){if(x!==S){if(typeof P=="string"&&(C=P,P=void 0),!P||Z(x,P)){var j=C?": ".concat(C):".",U=O.name==="doesNotReject"?"rejection":"exception";A({actual:x,expected:P,operator:O.name,message:"Got unwanted ".concat(U).concat(j,`
66
+ `)+'Actual message: "'.concat(x&&x.message,'"'),stackStartFn:O})}throw x}}function re(){for(var O=arguments.length,x=new Array(O),P=0;P<O;P++)x[P]=arguments[P];M.apply(void 0,[re,x.length].concat(x))}return _.throws=function O(x){for(var P=arguments.length,C=new Array(P>1?P-1:0),j=1;j<P;j++)C[j-1]=arguments[j];X.apply(void 0,[O,ne(x)].concat(C))},_.rejects=function O(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 X.apply(void 0,[O,U].concat(C))}))},_.doesNotThrow=function O(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,[O,ne(x)].concat(C))},_.doesNotReject=function O(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,[O,U].concat(C))}))},_.ifError=function O(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:O}),j=x.stack;if(typeof j=="string"){var U=j.split(`
67
+ `);U.shift();for(var B=C.stack.split(`
68
+ `),ee=0;ee<U.length;ee++){var fe=B.indexOf(U[ee]);if(fe!==-1){B=B.slice(0,fe);break}}C.stack="".concat(B.join(`
69
+ `),`
70
+ `).concat(U.join(`
71
+ `))}throw C}},_.strict=v(re,_,{equal:_.strictEqual,deepEqual:_.deepStrictEqual,notEqual:_.notStrictEqual,notDeepEqual:_.notDeepStrictEqual}),_.strict.strict=_.strict,B1}var S4,RI,KD,DI,pg,k1,JD,N1,QD,eI,gg,kb,tI,rI,T4,C4,R4,nI,Pb,iI,D4,I4,k4,N4,O4,U1,II,L4,kI,Ub,P4,sI,F4,M4,B4,O1,U4,j4,NI,bg,sc,L1,$4,nc,ic,P1,F1,oI,z4,W4,H4,q4,G4,OI,aI,LI,V4,X4,Y4,j1,$1,lI,Z4,K4,J4,Q4,e5,PI,t5,FI,MI,H1,q1,r5,n5,i5,s5,o5,BI,a5,UI,l5,M1,uI,cI,fI,c5,Bb,dI,pI,Fb,z1,yg,Mb,gI,Kn,f5,h5,mI,Nb,yI,Ob,d5,p5,bI,wI,vI,EI,g5,m5,y5,TI,B1,CI,mt,V1=bt(()=>{Se();Ce();Te();Ol();S4={assign:ZD,polyfill:function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:ZD})}},KD=Object.prototype.toString,DI=function(r){var e=KD.call(r),t=e==="[object Arguments]";return t||(t=e!=="[object Array]"&&r!==null&&typeof r=="object"&&typeof r.length=="number"&&r.length>=0&&KD.call(r.callee)==="[object Function]"),t};Object.keys||(pg=Object.prototype.hasOwnProperty,k1=Object.prototype.toString,JD=DI,N1=Object.prototype.propertyIsEnumerable,QD=!N1.call({toString:null},"toString"),eI=N1.call((function(){}),"prototype"),gg=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],kb=function(r){var e=r.constructor;return e&&e.prototype===r},tI={$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},rI=(function(){if(typeof window>"u")return!1;for(var r in window)try{if(!tI["$"+r]&&pg.call(window,r)&&window[r]!==null&&typeof window[r]=="object")try{kb(window[r])}catch{return!0}}catch{return!0}return!1})(),RI=function(r){var e=r!==null&&typeof r=="object",t=k1.call(r)==="[object Function]",n=JD(r),i=e&&k1.call(r)==="[object String]",o=[];if(!e&&!t&&!n)throw new TypeError("Object.keys called on a non-object");var s=eI&&t;if(i&&r.length>0&&!pg.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"||!pg.call(r,c)||o.push(String(c));if(QD)for(var f=(function(d){if(typeof window>"u"||!rI)return kb(d);try{return kb(d)}catch{return!1}})(r),h=0;h<gg.length;++h)f&&gg[h]==="constructor"||!pg.call(r,gg[h])||o.push(gg[h]);return o});T4=RI,C4=Array.prototype.slice,R4=DI,nI=Object.keys,Pb=nI?function(r){return nI(r)}:T4,iI=Object.keys;Pb.shim=function(){return Object.keys?(function(){var r=Object.keys(arguments);return r&&r.length===arguments.length})(1,2)||(Object.keys=function(r){return R4(r)?iI(C4.call(r)):iI(r)}):Object.keys=Pb,Object.keys||Pb};D4=Pb,I4=D4,k4=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",N4=Object.prototype.toString,O4=Array.prototype.concat,U1=Object.defineProperty,II=U1&&(function(){var r={};try{for(var e in U1(r,"x",{enumerable:!1,value:r}),r)return!1;return r.x===r}catch{return!1}})(),L4=function(r,e,t,n){var i;(!(e in r)||typeof(i=n)=="function"&&N4.call(i)==="[object Function]"&&n())&&(II?U1(r,e,{configurable:!0,enumerable:!1,value:t,writable:!0}):r[e]=t)},kI=function(r,e){var t=arguments.length>2?arguments[2]:{},n=I4(e);k4&&(n=O4.call(n,Object.getOwnPropertySymbols(e)));for(var i=0;i<n.length;i+=1)L4(r,n[i],e[n[i]],t[n[i]])};kI.supportsDescriptors=!!II;Ub=kI,P4=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},sI=(typeof globalThis<"u"?globalThis:typeof self<"u"?self:window).Symbol,F4=P4,M4=function(){return typeof sI=="function"&&typeof Symbol=="function"&&typeof sI("foo")=="symbol"&&typeof Symbol("bar")=="symbol"&&F4()},B4="Function.prototype.bind called on incompatible ",O1=Array.prototype.slice,U4=Object.prototype.toString,j4=function(r){var e=this;if(typeof e!="function"||U4.call(e)!=="[object Function]")throw new TypeError(B4+e);for(var t,n=O1.call(arguments,1),i=function(){if(this instanceof t){var c=e.apply(this,n.concat(O1.call(arguments)));return Object(c)===c?c:this}return e.apply(r,n.concat(O1.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},NI=Function.prototype.bind||j4,bg=TypeError,sc=Object.getOwnPropertyDescriptor;if(sc)try{sc({},"")}catch{sc=null}L1=function(){throw new bg},$4=sc?(function(){try{return arguments.callee,L1}catch{try{return sc(arguments,"callee").get}catch{return L1}}})():L1,nc=M4(),ic=Object.getPrototypeOf||function(r){return r.__proto__},P1=typeof Uint8Array>"u"?void 0:ic(Uint8Array),F1={"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?void 0:ArrayBuffer,"%ArrayBufferPrototype%":typeof ArrayBuffer>"u"?void 0:ArrayBuffer.prototype,"%ArrayIteratorPrototype%":nc?ic([][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%":nc?ic(ic([][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"&&nc?ic(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"&&nc?ic(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%":nc?ic(""[Symbol.iterator]()):void 0,"%StringPrototype%":String.prototype,"%Symbol%":nc?Symbol:void 0,"%SymbolPrototype%":nc?Symbol.prototype:void 0,"%SyntaxError%":SyntaxError,"%SyntaxErrorPrototype%":SyntaxError.prototype,"%ThrowTypeError%":$4,"%TypedArray%":P1,"%TypedArrayPrototype%":P1?P1.prototype:void 0,"%TypeError%":bg,"%TypeErrorPrototype%":bg.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},oI=NI.call(Function.call,String.prototype.replace),z4=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,W4=/\\(\\)?/g,H4=function(r){var e=[];return oI(r,z4,(function(t,n,i,o){e[e.length]=i?oI(o,W4,"$1"):n||t})),e},q4=function(r,e){if(!(r in F1))throw new SyntaxError("intrinsic "+r+" does not exist!");if(F1[r]===void 0&&!e)throw new bg("intrinsic "+r+" exists, but is not available. Please file an issue!");return F1[r]},G4=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=H4(r),n=q4("%"+(t.length>0?t[0]:"")+"%",e),i=1;i<t.length;i+=1)if(n!=null)if(sc&&i+1>=t.length){var o=sc(n,t[i]);if(!(t[i]in n))throw new bg("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},aI=NI,LI=G4("%Function%"),V4=LI.apply,X4=LI.call;(OI=function(){return aI.apply(X4,arguments)}).apply=function(){return aI.apply(V4,arguments)};Y4=OI,lI=function(r){return r!=r},Z4=(j1=function(r,e){return r===0&&e===0?1/r==1/e:r===e||!(!lI(r)||!lI(e))},j1),K4=($1=function(){return typeof Object.is=="function"?Object.is:Z4},$1),J4=Ub,Q4=Ub,e5=j1,PI=$1,t5=function(){var r=K4();return J4(Object,{is:r},{is:function(){return Object.is!==r}}),r},FI=Y4(PI(),Object);Q4(FI,{getPolyfill:PI,implementation:e5,shim:t5});MI=FI;H1=function(r){return r!=r};r5=H1,n5=(q1=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:r5},Ub),i5=q1,s5=Ub,o5=H1,BI=q1,a5=function(){var r=i5();return n5(Number,{isNaN:r},{isNaN:function(){return Number.isNaN!==r}}),r},UI=BI();s5(UI,{getPolyfill:BI,implementation:o5,shim:a5});l5=UI,M1={},uI=!1;cI={},fI=!1;c5=/a/g.flags!==void 0,Bb=function(r){var e=[];return r.forEach((function(t){return e.push(t)})),e},dI=function(r){var e=[];return r.forEach((function(t,n){return e.push([n,t])})),e},pI=Object.is?Object.is:MI,Fb=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},z1=Number.isNaN?Number.isNaN:l5;yg=G1(Object.prototype.hasOwnProperty),Mb=G1(Object.prototype.propertyIsEnumerable),gI=G1(Object.prototype.toString),Kn=qe.types,f5=Kn.isAnyArrayBuffer,h5=Kn.isArrayBufferView,mI=Kn.isDate,Nb=Kn.isMap,yI=Kn.isRegExp,Ob=Kn.isSet,d5=Kn.isNativeError,p5=Kn.isBoxedPrimitive,bI=Kn.isNumberObject,wI=Kn.isStringObject,vI=Kn.isBooleanObject,EI=Kn.isBigIntObject,g5=Kn.isSymbolObject,m5=Kn.isFloat32Array,y5=Kn.isFloat64Array;TI={isDeepEqual:function(r,e){return ds(r,e,!1)},isDeepStrictEqual:function(r,e){return ds(r,e,!0)}},B1={},CI=!1;mt=W1();mt.AssertionError;mt.deepEqual;mt.deepStrictEqual;mt.doesNotReject;mt.doesNotThrow;mt.equal;mt.fail;mt.ifError;mt.notDeepEqual;mt.notDeepStrictEqual;mt.notEqual;mt.notStrictEqual;mt.ok;mt.rejects;mt.strict;mt.strictEqual;mt.throws;mt.AssertionError;mt.deepEqual;mt.deepStrictEqual;mt.doesNotReject;mt.doesNotThrow;mt.equal;mt.fail;mt.ifError;mt.notDeepEqual;mt.notDeepStrictEqual;mt.notEqual;mt.notStrictEqual;mt.ok;mt.rejects;mt.strict;mt.strictEqual;mt.throws;mt.AssertionError;mt.deepEqual;mt.deepStrictEqual;mt.doesNotReject;mt.doesNotThrow;mt.equal;mt.fail;mt.ifError;mt.notDeepEqual;mt.notDeepStrictEqual;mt.notEqual;mt.notStrictEqual;mt.ok;mt.rejects;mt.strict;mt.strictEqual;mt.throws});var X1,jb=bt(()=>{Se();Ce();Te();Ol();qe._extend;qe.callbackify;qe.debuglog;qe.deprecate;qe.format;qe.inherits;qe.inspect;qe.isArray;qe.isBoolean;qe.isBuffer;qe.isDate;qe.isError;qe.isFunction;qe.isNull;qe.isNullOrUndefined;qe.isNumber;qe.isObject;qe.isPrimitive;qe.isRegExp;qe.isString;qe.isSymbol;qe.isUndefined;qe.log;X1=qe.promisify;qe.types;qe.TextEncoder=globalThis.TextEncoder;qe.TextDecoder=globalThis.TextDecoder});function _5(){if(zI)return Y1;zI=!0;var r=Y1={},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||bh,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||bh,v)}}}var a=[],u=!1,c,f=-1;function h(){!u||!c||(u=!1,c.length?a=c.concat(a):f=-1,a.length&&d())}function d(){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 b=1;b<arguments.length;b++)w[b-1]=arguments[b];a.push(new g(v,w)),a.length===1&&!u&&o(d)};function g(v,w){(this||bh).fun=v,(this||bh).array=w}g.prototype.run=function(){(this||bh).fun.apply(null,(this||bh).array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={};function y(){}return r.on=y,r.addListener=y,r.once=y,r.off=y,r.removeListener=y,r.removeAllListeners=y,r.emit=y,r.prependListener=y,r.prependOnceListener=y,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},Y1}var Y1,zI,bh,Zt,wh=bt(()=>{Se();Ce();Te();Y1={},zI=!1,bh=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;Zt=_5();Zt.platform="browser";Zt.addListener;Zt.argv;Zt.binding;Zt.browser;Zt.chdir;Zt.cwd;Zt.emit;Zt.env;Zt.listeners;Zt.nextTick;Zt.off;Zt.on;Zt.once;Zt.prependListener;Zt.prependOnceListener;Zt.removeAllListeners;Zt.removeListener;Zt.title;Zt.umask;Zt.version;Zt.versions});function A5(){if(WI)return Z1;WI=!0;var r=Zt;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,d=0;d<=o.length;++d){if(d<o.length)h=o.charCodeAt(d);else{if(h===47)break;h=47}if(h===47){if(!(c===d-1||f===1))if(c!==d-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 g=a.lastIndexOf("/");if(g!==a.length-1){g===-1?(a="",u=0):(a=a.slice(0,g),u=a.length-1-a.lastIndexOf("/")),c=d,f=0;continue}}else if(a.length===2||a.length===1){a="",u=0,c=d,f=0;continue}}s&&(a.length>0?a+="/..":a="..",u=2)}else a.length>0?a+="/"+o.slice(c+1,d):a=o.slice(c+1,d),u=d-c-1;c=d,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 d=a.length,g=d-h,y=f<g?f:g,v=-1,w=0;w<=y;++w){if(w===y){if(g>y){if(a.charCodeAt(h+w)===47)return a.slice(h+w+1);if(w===0)return a.slice(h+w)}else f>y&&(s.charCodeAt(u+w)===47?v=w:w===0&&(v=0));break}var b=s.charCodeAt(u+w),E=a.charCodeAt(h+w);if(b!==E)break;b===47&&(v=w)}var _="";for(w=u+v+1;w<=c;++w)(w===c||s.charCodeAt(w)===47)&&(_.length===0?_+="..":_+="/..");return _.length>0?_+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 d=a.length-1,g=-1;for(h=s.length-1;h>=0;--h){var y=s.charCodeAt(h);if(y===47){if(!f){u=h+1;break}}else g===-1&&(f=!1,g=h+1),d>=0&&(y===a.charCodeAt(d)?--d===-1&&(c=h):(d=-1,c=g))}return u===c?c=g: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,d=s.length-1;d>=0;--d){var g=s.charCodeAt(d);if(g===47){if(!f){u=d+1;break}continue}c===-1&&(f=!1,c=d+1),g===46?a===-1?a=d: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,d=0,g=-1,y=!0,v=s.length-1,w=0;v>=f;--v){if(u=s.charCodeAt(v),u===47){if(!y){d=v+1;break}continue}g===-1&&(y=!1,g=v+1),u===46?h===-1?h=v:w!==1&&(w=1):h!==-1&&(w=-1)}return h===-1||g===-1||w===0||w===1&&h===g-1&&h===d+1?g!==-1&&(d===0&&c?a.base=a.name=s.slice(1,g):a.base=a.name=s.slice(d,g)):(d===0&&c?(a.name=s.slice(1,h),a.base=s.slice(1,g)):(a.name=s.slice(d,h),a.base=s.slice(d,g)),a.ext=s.slice(h,g)),d>0?a.dir=s.slice(0,d-1):c&&(a.dir="/"),a},sep:"/",delimiter:":",win32:null,posix:null};return i.posix=i,Z1=i,Z1}function oc(r){throw new RangeError(C5[r])}function HI(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(T5,".")).split("."),e).join(".");return n+i}function QI(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 D5(r,e){return Object.prototype.hasOwnProperty.call(r,e)}function ps(){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 vg(r,e,t){if(r&&yo.isObject(r)&&r instanceof ps)return r;var n=new ps;return n.parse(r,e,t),n}function U5(){if(KI)return e2;KI=!0;var r=dr;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,d=0;d<=o.length;++d){if(d<o.length)h=o.charCodeAt(d);else{if(h===47)break;h=47}if(h===47){if(!(c===d-1||f===1))if(c!==d-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 g=a.lastIndexOf("/");if(g!==a.length-1){g===-1?(a="",u=0):(a=a.slice(0,g),u=a.length-1-a.lastIndexOf("/")),c=d,f=0;continue}}else if(a.length===2||a.length===1){a="",u=0,c=d,f=0;continue}}s&&(a.length>0?a+="/..":a="..",u=2)}else a.length>0?a+="/"+o.slice(c+1,d):a=o.slice(c+1,d),u=d-c-1;c=d,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 d=a.length,g=d-h,y=f<g?f:g,v=-1,w=0;w<=y;++w){if(w===y){if(g>y){if(a.charCodeAt(h+w)===47)return a.slice(h+w+1);if(w===0)return a.slice(h+w)}else f>y&&(s.charCodeAt(u+w)===47?v=w:w===0&&(v=0));break}var b=s.charCodeAt(u+w),E=a.charCodeAt(h+w);if(b!==E)break;b===47&&(v=w)}var _="";for(w=u+v+1;w<=c;++w)(w===c||s.charCodeAt(w)===47)&&(_.length===0?_+="..":_+="/..");return _.length>0?_+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 d=a.length-1,g=-1;for(h=s.length-1;h>=0;--h){var y=s.charCodeAt(h);if(y===47){if(!f){u=h+1;break}}else g===-1&&(f=!1,g=h+1),d>=0&&(y===a.charCodeAt(d)?--d===-1&&(c=h):(d=-1,c=g))}return u===c?c=g: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,d=s.length-1;d>=0;--d){var g=s.charCodeAt(d);if(g===47){if(!f){u=d+1;break}continue}c===-1&&(f=!1,c=d+1),g===46?a===-1?a=d: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,d=0,g=-1,y=!0,v=s.length-1,w=0;v>=f;--v){if(u=s.charCodeAt(v),u===47){if(!y){d=v+1;break}continue}g===-1&&(y=!1,g=v+1),u===46?h===-1?h=v:w!==1&&(w=1):h!==-1&&(w=-1)}return h===-1||g===-1||w===0||w===1&&h===g-1&&h===d+1?g!==-1&&(d===0&&c?a.base=a.name=s.slice(1,g):a.base=a.name=s.slice(d,g)):(d===0&&c?(a.name=s.slice(1,h),a.base=s.slice(1,g)):(a.name=s.slice(d,h),a.base=s.slice(d,g)),a.ext=s.slice(h,g)),d>0?a.dir=s.slice(0,d-1):c&&(a.dir="/"),a},sep:"/",delimiter:":",win32:null,posix:null};return i.posix=i,e2=i,e2}function K5(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 r2?J5(r):Q5(r)}function J5(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(q5,"\\"),t=decodeURIComponent(t),e!=="")return`\\\\${e}${t}`;{let n=t.codePointAt(1)|32,i=t[2];if(n<W5||n>H5||i!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return t.slice(1)}}function Q5(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 eU(r){let e=JI.resolve(r),t=r.charCodeAt(r.length-1);(t===z5||r2&&t===$5)&&e[e.length-1]!==JI.sep&&(e+="/");let n=new URL("file://");return e.includes("%")&&(e=e.replace(G5,"%25")),!r2&&e.includes("\\")&&(e=e.replace(V5,"%5C")),e.includes(`
72
+ `)&&(e=e.replace(X5,"%0A")),e.includes("\r")&&(e=e.replace(Y5,"%0D")),e.includes(" ")&&(e=e.replace(Z5,"%09")),n.pathname=e,n}function hU(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 n2?dU(r):pU(r)}function dU(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(oU,"\\"),t=decodeURIComponent(t),e!=="")return`\\\\${e}${t}`;{let n=t.codePointAt(1)|32,i=t[2];if(n<iU||n>sU||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 gU(r){let e=un.resolve(r),t=r.charCodeAt(r.length-1);(t===nU||n2&&t===rU)&&e[e.length-1]!==un.sep&&(e+="/");let n=new URL("file://");return e.includes("%")&&(e=e.replace(aU,"%25")),!n2&&e.includes("\\")&&(e=e.replace(lU,"%5C")),e.includes(`
73
+ `)&&(e=e.replace(uU,"%0A")),e.includes("\r")&&(e=e.replace(cU,"%0D")),e.includes(" ")&&(e=e.replace(fU,"%09")),n.pathname=e,n}var Z1,WI,un,Eh,x5,S5,T5,C5,bo,K1,qI,ek,GI,VI,R5,I5,wg,k5,da,ir,N5,yo,O5,L5,P5,F5,t2,XI,YI,ZI,M5,B5,J1,vh,Q1,e2,KI,JI,j5,$5,z5,W5,H5,r2,q5,G5,V5,X5,Y5,Z5,tU,rU,nU,iU,sU,n2,oU,aU,lU,uU,cU,fU,tk=bt(()=>{Se();Ce();Te();Ol();wh();Z1={},WI=!1;un=A5(),Eh=2147483647,x5=/^xn--/,S5=/[^\0-\x7E]/,T5=/[\x2E\u3002\uFF0E\uFF61]/g,C5={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},bo=Math.floor,K1=String.fromCharCode;qI=function(r,e){return r+22+75*(r<26)-((e!=0)<<5)},ek=function(r,e,t){let n=0;for(r=t?bo(r/700):r>>1,r+=bo(r/e);r>455;n+=36)r=bo(r/35);return bo(n+36*r/(r+38))},GI=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&&oc("not-basic"),e.push(r.charCodeAt(u));for(let u=s>0?s+1:0;u<t;){let c=n;for(let h=1,d=36;;d+=36){u>=t&&oc("invalid-input");let g=(a=r.charCodeAt(u++))-48<10?a-22:a-65<26?a-65:a-97<26?a-97:36;(g>=36||g>bo((Eh-n)/h))&&oc("overflow"),n+=g*h;let y=d<=o?1:d>=o+26?26:d-o;if(g<y)break;let v=36-y;h>bo(Eh/v)&&oc("overflow"),h*=v}let f=e.length+1;o=ek(n-c,f,c==0),bo(n/f)>Eh-i&&oc("overflow"),i+=bo(n/f),n%=f,e.splice(n++,0,i)}var a;return String.fromCodePoint(...e)},VI=function(r){let e=[],t=(r=QI(r)).length,n=128,i=0,o=72;for(let u of r)u<128&&e.push(K1(u));let s=e.length,a=s;for(s&&e.push("-");a<t;){let u=Eh;for(let f of r)f>=n&&f<u&&(u=f);let c=a+1;u-n>bo((Eh-i)/c)&&oc("overflow"),i+=(u-n)*c,n=u;for(let f of r)if(f<n&&++i>Eh&&oc("overflow"),f==n){let h=i;for(let d=36;;d+=36){let g=d<=o?1:d>=o+26?26:d-o;if(h<g)break;let y=h-g,v=36-g;e.push(K1(qI(g+y%v,0))),h=bo(y/v)}e.push(K1(qI(h,0))),o=ek(i,c,a==s),i=0,++a}++i,++n}return e.join("")},R5={version:"2.1.0",ucs2:{decode:QI,encode:r=>String.fromCodePoint(...r)},decode:GI,encode:VI,toASCII:function(r){return HI(r,(function(e){return S5.test(e)?"xn--"+VI(e):e}))},toUnicode:function(r){return HI(r,(function(e){return x5.test(e)?GI(e.slice(4).toLowerCase()):e}))}};I5=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,d,g=r[u].replace(o,"%20"),y=g.indexOf(t);y>=0?(c=g.substr(0,y),f=g.substr(y+1)):(c=g,f=""),h=decodeURIComponent(c),d=decodeURIComponent(f),D5(i,h)?Array.isArray(i[h])?i[h].push(d):i[h]=[i[h],d]:i[h]=d}return i},wg=function(r){switch(typeof r){case"string":return r;case"boolean":return r?"true":"false";case"number":return isFinite(r)?r:"";default:return""}},k5=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(wg(i))+t;return Array.isArray(r[i])?r[i].map((function(s){return o+encodeURIComponent(wg(s))})).join(e):o+encodeURIComponent(wg(r[i]))})).join(e):n?encodeURIComponent(wg(n))+t+encodeURIComponent(wg(r)):""},da={};da.decode=da.parse=I5,da.encode=da.stringify=k5;da.decode;da.encode;da.parse;da.stringify;ir={},N5=R5,yo={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}};ir.parse=vg,ir.resolve=function(r,e){return vg(r,!1,!0).resolve(e)},ir.resolveObject=function(r,e){return r?vg(r,!1,!0).resolveObject(e):e},ir.format=function(r){return yo.isString(r)&&(r=vg(r)),r instanceof ps?r.format():ps.prototype.format.call(r)},ir.Url=ps;O5=/^([a-z0-9.+-]+:)/i,L5=/:[0-9]*$/,P5=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,F5=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
74
+ `," "]),t2=["'"].concat(F5),XI=["%","/","?",";","#"].concat(t2),YI=["/","?","#"],ZI=/^[+a-z0-9A-Z_-]{0,63}$/,M5=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,B5={javascript:!0,"javascript:":!0},J1={javascript:!0,"javascript:":!0},vh={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},Q1=da;ps.prototype.parse=function(r,e,t){if(!yo.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=P5.exec(s);if(a)return this.path=s,this.href=s,this.pathname=a[1],a[2]?(this.search=a[2],this.query=e?Q1.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var u=O5.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&&J1[u]||(s=s.substr(2),this.slashes=!0)}if(!J1[u]&&(f||u&&!vh[u])){for(var h,d,g=-1,y=0;y<YI.length;y++)(v=s.indexOf(YI[y]))!==-1&&(g===-1||v<g)&&(g=v);for((d=g===-1?s.lastIndexOf("@"):s.lastIndexOf("@",g))!==-1&&(h=s.slice(0,d),s=s.slice(d+1),this.auth=decodeURIComponent(h)),g=-1,y=0;y<XI.length;y++){var v;(v=s.indexOf(XI[y]))!==-1&&(g===-1||v<g)&&(g=v)}g===-1&&(g=s.length),this.host=s.slice(0,g),s=s.slice(g),this.parseHost(),this.hostname=this.hostname||"";var w=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!w)for(var b=this.hostname.split(/\./),E=(y=0,b.length);y<E;y++){var _=b[y];if(_&&!_.match(ZI)){for(var S="",A=0,M=_.length;A<M;A++)_.charCodeAt(A)>127?S+="x":S+=_[A];if(!S.match(ZI)){var I=b.slice(0,y),q=b.slice(y+1),Q=_.match(M5);Q&&(I.push(Q[1]),q.unshift(Q[2])),q.length&&(s="/"+q.join(".")+s),this.hostname=I.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),w||(this.hostname=N5.toASCII(this.hostname));var Z=this.port?":"+this.port:"",ne=this.hostname||"";this.host=ne+Z,this.href+=this.host,w&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),s[0]!=="/"&&(s="/"+s))}if(!B5[c])for(y=0,E=t2.length;y<E;y++){var L=t2[y];if(s.indexOf(L)!==-1){var $=encodeURIComponent(L);$===L&&($=escape(L)),s=s.split(L).join($)}}var X=s.indexOf("#");X!==-1&&(this.hash=s.substr(X),s=s.slice(0,X));var ie=s.indexOf("?");if(ie!==-1?(this.search=s.substr(ie),this.query=s.substr(ie+1),e&&(this.query=Q1.parse(this.query)),s=s.slice(0,ie)):e&&(this.search="",this.query={}),s&&(this.pathname=s),vh[c]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){Z=this.pathname||"";var re=this.search||"";this.path=Z+re}return this.href=this.format(),this},ps.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&&yo.isObject(this.query)&&Object.keys(this.query).length&&(o=Q1.stringify(this.query));var s=this.search||o&&"?"+o||"";return e&&e.substr(-1)!==":"&&(e+=":"),this.slashes||(!e||vh[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},ps.prototype.resolve=function(r){return this.resolveObject(vg(r,!1,!0)).format()},ps.prototype.resolveObject=function(r){if(yo.isString(r)){var e=new ps;e.parse(r,!1,!0),r=e}for(var t=new ps,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 vh[t.protocol]&&t.hostname&&!t.pathname&&(t.path=t.pathname="/"),t.href=t.format(),t}if(r.protocol&&r.protocol!==t.protocol){if(!vh[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||J1[r.protocol])t.pathname=r.pathname;else{for(var d=(r.pathname||"").split("/");d.length&&!(r.host=d.shift()););r.host||(r.host=""),r.hostname||(r.hostname=""),d[0]!==""&&d.unshift(""),d.length<2&&d.unshift(""),t.pathname=d.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 g=t.pathname||"",y=t.search||"";t.path=g+y}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)==="/",b=w||v||t.host&&r.pathname,E=b,_=t.pathname&&t.pathname.split("/")||[],S=(d=r.pathname&&r.pathname.split("/")||[],t.protocol&&!vh[t.protocol]);if(S&&(t.hostname="",t.port=null,t.host&&(_[0]===""?_[0]=t.host:_.unshift(t.host)),t.host="",r.protocol&&(r.hostname=null,r.port=null,r.host&&(d[0]===""?d[0]=r.host:d.unshift(r.host)),r.host=null),b=b&&(d[0]===""||_[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,_=d;else if(d.length)_||(_=[]),_.pop(),_=_.concat(d),t.search=r.search,t.query=r.query;else if(!yo.isNullOrUndefined(r.search))return S&&(t.hostname=t.host=_.shift(),(Q=!!(t.host&&t.host.indexOf("@")>0)&&t.host.split("@"))&&(t.auth=Q.shift(),t.host=t.hostname=Q.shift())),t.search=r.search,t.query=r.query,yo.isNull(t.pathname)&&yo.isNull(t.search)||(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.href=t.format(),t;if(!_.length)return t.pathname=null,t.search?t.path="/"+t.search:t.path=null,t.href=t.format(),t;for(var A=_.slice(-1)[0],M=(t.host||r.host||_.length>1)&&(A==="."||A==="..")||A==="",I=0,q=_.length;q>=0;q--)(A=_[q])==="."?_.splice(q,1):A===".."?(_.splice(q,1),I++):I&&(_.splice(q,1),I--);if(!b&&!E)for(;I--;I)_.unshift("..");!b||_[0]===""||_[0]&&_[0].charAt(0)==="/"||_.unshift(""),M&&_.join("/").substr(-1)!=="/"&&_.push("");var Q,Z=_[0]===""||_[0]&&_[0].charAt(0)==="/";return S&&(t.hostname=t.host=Z?"":_.length?_.shift():"",(Q=!!(t.host&&t.host.indexOf("@")>0)&&t.host.split("@"))&&(t.auth=Q.shift(),t.host=t.hostname=Q.shift())),(b=b||t.host&&_.length)&&!Z&&_.unshift(""),_.length?t.pathname=_.join("/"):(t.pathname=null,t.path=null),yo.isNull(t.pathname)&&yo.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},ps.prototype.parseHost=function(){var r=this.host,e=L5.exec(r);e&&((e=e[0])!==":"&&(this.port=e.substr(1)),r=r.substr(0,r.length-e.length)),r&&(this.hostname=r)};ir.Url;ir.format;ir.resolve;ir.resolveObject;e2={},KI=!1;JI=U5(),j5=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;ir.URL=typeof URL<"u"?URL:null;ir.pathToFileURL=eU;ir.fileURLToPath=K5;ir.Url;ir.format;ir.resolve;ir.resolveObject;ir.URL;$5=92,z5=47,W5=97,H5=122,r2=j5==="win32",q5=/\//g,G5=/%/g,V5=/\\/g,X5=/\n/g,Y5=/\r/g,Z5=/\t/g;tU=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;ir.URL=typeof URL<"u"?URL:null;ir.pathToFileURL=gU;ir.fileURLToPath=hU;ir.Url;ir.format;ir.resolve;ir.resolveObject;ir.parse;ir.URL;rU=92,nU=47,iU=97,sU=122,n2=tU==="win32",oU=/\//g,aU=/%/g,lU=/\\/g,uU=/\n/g,cU=/\r/g,fU=/\t/g});function a2(r){throw new Error("Node.js process "+r+" is not supported by JSPM core outside of Node.js")}function mU(){!_h||!ac||(_h=!1,ac.length?pa=ac.concat(pa):$b=-1,pa.length&&rk())}function rk(){if(!_h){var r=setTimeout(mU,0);_h=!0;for(var e=pa.length;e;){for(ac=pa,pa=[];++$b<e;)ac&&ac[$b].run();$b=-1,e=pa.length}ac=null,_h=!1,clearTimeout(r)}}function yU(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];pa.push(new nk(r,e)),pa.length===1&&!_h&&setTimeout(rk,0)}function nk(r,e){this.fun=r,this.array=e}function jn(){}function LU(r){a2("_linkedBinding")}function BU(r){a2("dlopen")}function UU(){return[]}function jU(){return[]}function YU(r,e){if(!r)throw new Error(e||"assertion error")}function QU(){return!1}function mj(){return Ll.now()/1e3}function o2(r){var e=Math.floor((Date.now()-Ll.now())*.001),t=Ll.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+=s2)),[n,i]}function Pl(){return Vr}function Rj(r){return[]}var pa,_h,ac,$b,bU,wU,vU,EU,_U,AU,xU,SU,TU,CU,RU,DU,IU,kU,NU,OU,PU,FU,MU,$U,zU,l2,WU,HU,qU,GU,VU,XU,ZU,KU,JU,ej,tj,rj,nj,ij,sj,oj,aj,lj,uj,cj,fj,hj,dj,pj,gj,Ll,i2,s2,yj,bj,wj,vj,Ej,_j,Aj,xj,Sj,Tj,Cj,Vr,lc=bt(()=>{Se();Ce();Te();pa=[],_h=!1,$b=-1;nk.prototype.run=function(){this.fun.apply(null,this.array)};bU="browser",wU="x64",vU="browser",EU={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},_U=["/usr/bin/node"],AU=[],xU="v16.8.0",SU={},TU=function(r,e){console.warn((e?e+": ":"")+r)},CU=function(r){a2("binding")},RU=function(r){return 0},DU=function(){return"/"},IU=function(r){},kU={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};NU=jn,OU=[];PU={},FU=!1,MU={};$U=jn,zU=jn,l2=function(){return{}},WU=l2,HU=l2,qU=jn,GU=jn,VU=jn,XU={};ZU={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},KU=jn,JU=jn;ej=jn,tj=jn,rj=jn,nj=jn,ij=jn,sj=void 0,oj=void 0,aj=void 0,lj=jn,uj=2,cj=1,fj="/bin/usr/node",hj=9229,dj="node",pj=[],gj=jn,Ll={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};Ll.now===void 0&&(i2=Date.now(),Ll.timing&&Ll.timing.navigationStart&&(i2=Ll.timing.navigationStart),Ll.now=()=>Date.now()-i2);s2=1e9;o2.bigint=function(r){var e=o2(r);return typeof BigInt>"u"?e[0]*s2+e[1]:BigInt(e[0]*s2)+BigInt(e[1])};yj=10,bj={},wj=0;vj=Pl,Ej=Pl,_j=Pl,Aj=Pl,xj=Pl,Sj=jn,Tj=Pl,Cj=Pl;Vr={version:xU,versions:SU,arch:wU,platform:vU,release:kU,_rawDebug:NU,moduleLoadList:OU,binding:CU,_linkedBinding:LU,_events:bj,_eventsCount:wj,_maxListeners:yj,on:Pl,addListener:vj,once:Ej,off:_j,removeListener:Aj,removeAllListeners:xj,emit:Sj,prependListener:Tj,prependOnceListener:Cj,listeners:Rj,domain:PU,_exiting:FU,config:MU,dlopen:BU,uptime:mj,_getActiveRequests:UU,_getActiveHandles:jU,reallyExit:$U,_kill:zU,cpuUsage:l2,resourceUsage:WU,memoryUsage:HU,kill:qU,exit:GU,openStdin:VU,allowedNodeEnvironmentFlags:XU,assert:YU,features:ZU,_fatalExceptions:KU,setUncaughtExceptionCaptureCallback:JU,hasUncaughtExceptionCaptureCallback:QU,emitWarning:TU,nextTick:yU,_tickCallback:ej,_debugProcess:tj,_debugEnd:rj,_startProfilerIdleNotifier:nj,_stopProfilerIdleNotifier:ij,stdout:sj,stdin:aj,stderr:oj,abort:lj,umask:RU,chdir:IU,cwd:DU,env:EU,title:bU,argv:_U,execArgv:AU,pid:uj,ppid:cj,execPath:fj,debugPort:hj,hrtime:o2,argv0:dj,_preload_modules:pj,setSourceMapsEnabled:gj}});function sr(){sr.init.call(this)}function zb(r){if(typeof r!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)}function dk(r){return r._maxListeners===void 0?sr.defaultMaxListeners:r._maxListeners}function ak(r,e,t,n){var i,o,s,a;if(zb(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=dk(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 Dj(){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 lk(r,e,t){var n={fired:!1,wrapFn:void 0,target:r,type:e,listener:t},i=Dj.bind(n);return i.listener=t,n.wrapFn=i,i}function uk(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):pk(i,i.length)}function ck(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 pk(r,e){for(var t=new Array(e),n=0;n<e;++n)t[n]=r[n];return t}var fk,hk,Ah,ik,sk,ok,cn,xh=bt(()=>{Se();Ce();Te();Ah=typeof Reflect=="object"?Reflect:null,ik=Ah&&typeof Ah.apply=="function"?Ah.apply:function(r,e,t){return Function.prototype.apply.call(r,e,t)};hk=Ah&&typeof Ah.ownKeys=="function"?Ah.ownKeys:Object.getOwnPropertySymbols?function(r){return Object.getOwnPropertyNames(r).concat(Object.getOwnPropertySymbols(r))}:function(r){return Object.getOwnPropertyNames(r)};sk=Number.isNaN||function(r){return r!=r};fk=sr,sr.EventEmitter=sr,sr.prototype._events=void 0,sr.prototype._eventsCount=0,sr.prototype._maxListeners=void 0;ok=10;Object.defineProperty(sr,"defaultMaxListeners",{enumerable:!0,get:function(){return ok},set:function(r){if(typeof r!="number"||r<0||sk(r))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");ok=r}}),sr.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},sr.prototype.setMaxListeners=function(r){if(typeof r!="number"||r<0||sk(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},sr.prototype.getMaxListeners=function(){return dk(this)},sr.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")ik(a,this,e);else{var u=a.length,c=pk(a,u);for(t=0;t<u;++t)ik(c[t],this,e)}return!0},sr.prototype.addListener=function(r,e){return ak(this,r,e,!1)},sr.prototype.on=sr.prototype.addListener,sr.prototype.prependListener=function(r,e){return ak(this,r,e,!0)},sr.prototype.once=function(r,e){return zb(e),this.on(r,lk(this,r,e)),this},sr.prototype.prependOnceListener=function(r,e){return zb(e),this.prependListener(r,lk(this,r,e)),this},sr.prototype.removeListener=function(r,e){var t,n,i,o,s;if(zb(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},sr.prototype.off=sr.prototype.removeListener,sr.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},sr.prototype.listeners=function(r){return uk(this,r,!0)},sr.prototype.rawListeners=function(r){return uk(this,r,!1)},sr.listenerCount=function(r,e){return typeof r.listenerCount=="function"?r.listenerCount(e):ck.call(r,e)},sr.prototype.listenerCount=ck,sr.prototype.eventNames=function(){return this._eventsCount>0?hk(this._events):[]};cn=fk;cn.EventEmitter;cn.defaultMaxListeners;cn.init;cn.listenerCount;cn.EventEmitter;cn.defaultMaxListeners;cn.init;cn.listenerCount});var Wb=bt(()=>{Se();Ce();Te();xh();cn.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)})};cn.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 yk(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 Ij(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(Ws[(i=n)>>18&63]+Ws[i>>12&63]+Ws[i>>6&63]+Ws[63&i]);return o.join("")}function ga(r){if(r>2147483647)throw new RangeError('The value "'+r+'" is invalid for option "size"');var e=new Uint8Array(r);return Object.setPrototypeOf(e,Ze.prototype),e}function Ze(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 R2(r)}return Gk(r,e,t)}function Gk(r,e,t){if(typeof r=="string")return(function(o,s){if(typeof s=="string"&&s!==""||(s="utf8"),!Ze.isEncoding(s))throw new TypeError("Unknown encoding: "+s);var a=0|Xk(o,s),u=ga(a),c=u.write(o,s);return c!==a&&(u=u.slice(0,c)),u})(r,e);if(ArrayBuffer.isView(r))return u2(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(ma(r,ArrayBuffer)||r&&ma(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ma(r,SharedArrayBuffer)||r&&ma(r.buffer,SharedArrayBuffer)))return wk(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 Ze.from(n,e,t);var i=(function(o){if(Ze.isBuffer(o)){var s=0|N2(o.length),a=ga(s);return a.length===0||o.copy(a,0,0,s),a}if(o.length!==void 0)return typeof o.length!="number"||O2(o.length)?ga(0):u2(o);if(o.type==="Buffer"&&Array.isArray(o.data))return u2(o.data)})(r);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return Ze.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 Vk(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 R2(r){return Vk(r),ga(r<0?0:0|N2(r))}function u2(r){for(var e=r.length<0?0:0|N2(r.length),t=ga(e),n=0;n<e;n+=1)t[n]=255&r[n];return t}function wk(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,Ze.prototype),n}function N2(r){if(r>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|r}function Xk(r,e){if(Ze.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||ma(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 D2(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*t;case"hex":return t>>>1;case"base64":return Jk(r).length;default:if(i)return n?-1:D2(r).length;e=(""+e).toLowerCase(),i=!0}}function Nj(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 $j(this,e,t);case"utf8":case"utf-8":return Zk(this,e,t);case"ascii":return Uj(this,e,t);case"latin1":case"binary":return jj(this,e,t);case"base64":return Bj(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return zj(this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}function cc(r,e,t){var n=r[e];r[e]=r[t],r[t]=n}function vk(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),O2(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=Ze.from(e,n)),Ze.isBuffer(e))return e.length===0?-1:Ek(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):Ek(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}function Ek(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(g,y){return s===1?g[y]:g.readUInt16BE(y*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,d=0;d<u;d++)if(c(r,o+d)!==c(e,d)){h=!1;break}if(h)return o}return-1}function Oj(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(O2(a))return s;r[t+s]=a}return s}function Lj(r,e,t,n){return Yb(D2(e,r.length-t),r,t,n)}function Yk(r,e,t,n){return Yb((function(i){for(var o=[],s=0;s<i.length;++s)o.push(255&i.charCodeAt(s));return o})(e),r,t,n)}function Pj(r,e,t,n){return Yk(r,e,t,n)}function Fj(r,e,t,n){return Yb(Jk(e),r,t,n)}function Mj(r,e,t,n){return Yb((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 Bj(r,e,t){return e===0&&t===r.length?C2.fromByteArray(r):C2.fromByteArray(r.slice(e,t))}function Zk(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(d){var g=d.length;if(g<=4096)return String.fromCharCode.apply(String,d);for(var y="",v=0;v<g;)y+=String.fromCharCode.apply(String,d.slice(v,v+=4096));return y})(n)}function Uj(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 jj(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 $j(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+=Hj[r[o]];return i}function zj(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 bn(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 ci(r,e,t,n,i,o){if(!Ze.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 Kk(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 _k(r,e,t,n,i){return e=+e,t>>>=0,i||Kk(r,0,t,4),Sh.write(r,e,t,n,23,4),t+4}function Ak(r,e,t,n,i){return e=+e,t>>>=0,i||Kk(r,0,t,8),Sh.write(r,e,t,n,52,8),t+8}function D2(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 Jk(r){return C2.toByteArray((function(e){if((e=(e=e.split("=")[0]).trim().replace(Wj,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e})(r))}function Yb(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 ma(r,e){return r instanceof e||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===e.name}function O2(r){return r!=r}function xk(r,e){for(var t in r)e[t]=r[t]}function fc(r,e,t){return wo(r,e,t)}function Eg(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"&&(k2.isEncoding===Sk||!Sk(t)))throw new Error("Unknown encoding: "+t);return n||t})(r),this.encoding){case"utf16le":this.text=Vj,this.end=Xj,e=4;break;case"utf8":this.fillLast=Gj,e=4;break;case"base64":this.text=Yj,this.end=Zj,e=3;break;default:return this.write=Kj,this.end=Jj,void 0}this.lastNeed=0,this.lastTotal=0,this.lastChar=k2.allocUnsafe(e)}function c2(r){return r<=127?0:r>>5==6?2:r>>4==14?3:r>>3==30?4:r>>6==2?-1:-2}function Gj(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 Vj(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 Xj(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 Yj(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 Zj(r){var e=r&&r.length?this.write(r):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function Kj(r){return r.toString(this.encoding)}function Jj(r){return r&&r.length?this.write(r):""}function Qj(){if(Tk)return _g;Tk=!0,_g.byteLength=a,_g.toByteArray=c,_g.fromByteArray=d;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(g){var y=g.length;if(y%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var v=g.indexOf("=");v===-1&&(v=y);var w=v===y?0:4-v%4;return[v,w]}function a(g){var y=s(g),v=y[0],w=y[1];return(v+w)*3/4-w}function u(g,y,v){return(y+v)*3/4-v}function c(g){var y,v=s(g),w=v[0],b=v[1],E=new t(u(g,w,b)),_=0,S=b>0?w-4:w,A;for(A=0;A<S;A+=4)y=e[g.charCodeAt(A)]<<18|e[g.charCodeAt(A+1)]<<12|e[g.charCodeAt(A+2)]<<6|e[g.charCodeAt(A+3)],E[_++]=y>>16&255,E[_++]=y>>8&255,E[_++]=y&255;return b===2&&(y=e[g.charCodeAt(A)]<<2|e[g.charCodeAt(A+1)]>>4,E[_++]=y&255),b===1&&(y=e[g.charCodeAt(A)]<<10|e[g.charCodeAt(A+1)]<<4|e[g.charCodeAt(A+2)]>>2,E[_++]=y>>8&255,E[_++]=y&255),E}function f(g){return r[g>>18&63]+r[g>>12&63]+r[g>>6&63]+r[g&63]}function h(g,y,v){for(var w,b=[],E=y;E<v;E+=3)w=(g[E]<<16&16711680)+(g[E+1]<<8&65280)+(g[E+2]&255),b.push(f(w));return b.join("")}function d(g){for(var y,v=g.length,w=v%3,b=[],E=16383,_=0,S=v-w;_<S;_+=E)b.push(h(g,_,_+E>S?S:_+E));return w===1?(y=g[v-1],b.push(r[y>>2]+r[y<<4&63]+"==")):w===2&&(y=(g[v-2]<<8)+g[v-1],b.push(r[y>>10]+r[y>>4&63]+r[y<<2&63]+"=")),b.join("")}return _g}function e$(){if(Ck)return qb;Ck=!0;return qb.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,d=t?-1:1,g=r[e+h];for(h+=d,o=g&(1<<-f)-1,g>>=-f,f+=a;f>0;o=o*256+r[e+h],h+=d,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=s*256+r[e+h],h+=d,f-=8);if(o===0)o=1-c;else{if(o===u)return s?NaN:(g?-1:1)*(1/0);s=s+Math.pow(2,n),o=o-c}return(g?-1:1)*s*Math.pow(2,o-n)},qb.write=function(r,e,t,n,i,o){var s,a,u,c=o*8-i-1,f=(1<<c)-1,h=f>>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:o-1,y=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+=d/u:e+=d*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+g]=a&255,g+=y,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;r[t+g]=s&255,g+=y,s/=256,c-=8);r[t+g-y]|=v*128},qb}function t$(){if(Rk)return hc;Rk=!0;let r=Qj(),e=e$(),t=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;hc.Buffer=s,hc.SlowBuffer=b,hc.INSPECT_MAX_BYTES=50;let n=2147483647;hc.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),m={foo:function(){return 42}};return Object.setPrototypeOf(m,Uint8Array.prototype),Object.setPrototypeOf(T,m),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 m=new Uint8Array(T);return Object.setPrototypeOf(m,s.prototype),m}function s(T,m,p){if(typeof T=="number"){if(typeof m=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return f(T)}return a(T,m,p)}s.poolSize=8192;function a(T,m,p){if(typeof T=="string")return h(T,m);if(ArrayBuffer.isView(T))return g(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(Oe(T,ArrayBuffer)||T&&Oe(T.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Oe(T,SharedArrayBuffer)||T&&Oe(T.buffer,SharedArrayBuffer)))return y(T,m,p);if(typeof T=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let R=T.valueOf&&T.valueOf();if(R!=null&&R!==T)return s.from(R,m,p);let J=v(T);if(J)return J;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof T[Symbol.toPrimitive]=="function")return s.from(T[Symbol.toPrimitive]("string"),m,p);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,m,p){return a(T,m,p)},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,m,p){return u(T),T<=0?o(T):m!==void 0?typeof p=="string"?o(T).fill(m,p):o(T).fill(m):o(T)}s.alloc=function(T,m,p){return c(T,m,p)};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,m){if((typeof m!="string"||m==="")&&(m="utf8"),!s.isEncoding(m))throw new TypeError("Unknown encoding: "+m);let p=E(T,m)|0,R=o(p),J=R.write(T,m);return J!==p&&(R=R.slice(0,J)),R}function d(T){let m=T.length<0?0:w(T.length)|0,p=o(m);for(let R=0;R<m;R+=1)p[R]=T[R]&255;return p}function g(T){if(Oe(T,Uint8Array)){let m=new Uint8Array(T);return y(m.buffer,m.byteOffset,m.byteLength)}return d(T)}function y(T,m,p){if(m<0||T.byteLength<m)throw new RangeError('"offset" is outside of buffer bounds');if(T.byteLength<m+(p||0))throw new RangeError('"length" is outside of buffer bounds');let R;return m===void 0&&p===void 0?R=new Uint8Array(T):p===void 0?R=new Uint8Array(T,m):R=new Uint8Array(T,m,p),Object.setPrototypeOf(R,s.prototype),R}function v(T){if(s.isBuffer(T)){let m=w(T.length)|0,p=o(m);return p.length===0||T.copy(p,0,0,m),p}if(T.length!==void 0)return typeof T.length!="number"||ke(T.length)?o(0):d(T);if(T.type==="Buffer"&&Array.isArray(T.data))return d(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 b(T){return+T!=T&&(T=0),s.alloc(+T)}s.isBuffer=function(m){return m!=null&&m._isBuffer===!0&&m!==s.prototype},s.compare=function(m,p){if(Oe(m,Uint8Array)&&(m=s.from(m,m.offset,m.byteLength)),Oe(p,Uint8Array)&&(p=s.from(p,p.offset,p.byteLength)),!s.isBuffer(m)||!s.isBuffer(p))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(m===p)return 0;let R=m.length,J=p.length;for(let D=0,le=Math.min(R,J);D<le;++D)if(m[D]!==p[D]){R=m[D],J=p[D];break}return R<J?-1:J<R?1:0},s.isEncoding=function(m){switch(String(m).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(m,p){if(!Array.isArray(m))throw new TypeError('"list" argument must be an Array of Buffers');if(m.length===0)return s.alloc(0);let R;if(p===void 0)for(p=0,R=0;R<m.length;++R)p+=m[R].length;let J=s.allocUnsafe(p),D=0;for(R=0;R<m.length;++R){let le=m[R];if(Oe(le,Uint8Array))D+le.length>J.length?(s.isBuffer(le)||(le=s.from(le)),le.copy(J,D)):Uint8Array.prototype.set.call(J,le,D);else if(s.isBuffer(le))le.copy(J,D);else throw new TypeError('"list" argument must be an Array of Buffers');D+=le.length}return J};function E(T,m){if(s.isBuffer(T))return T.length;if(ArrayBuffer.isView(T)||Oe(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 p=T.length,R=arguments.length>2&&arguments[2]===!0;if(!R&&p===0)return 0;let J=!1;for(;;)switch(m){case"ascii":case"latin1":case"binary":return p;case"utf8":case"utf-8":return Re(T).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return p*2;case"hex":return p>>>1;case"base64":return Ae(T).length;default:if(J)return R?-1:Re(T).length;m=(""+m).toLowerCase(),J=!0}}s.byteLength=E;function _(T,m,p){let R=!1;if((m===void 0||m<0)&&(m=0),m>this.length||((p===void 0||p>this.length)&&(p=this.length),p<=0)||(p>>>=0,m>>>=0,p<=m))return"";for(T||(T="utf8");;)switch(T){case"hex":return x(this,m,p);case"utf8":case"utf-8":return $(this,m,p);case"ascii":return re(this,m,p);case"latin1":case"binary":return O(this,m,p);case"base64":return L(this,m,p);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,m,p);default:if(R)throw new TypeError("Unknown encoding: "+T);T=(T+"").toLowerCase(),R=!0}}s.prototype._isBuffer=!0;function S(T,m,p){let R=T[m];T[m]=T[p],T[p]=R}s.prototype.swap16=function(){let m=this.length;if(m%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let p=0;p<m;p+=2)S(this,p,p+1);return this},s.prototype.swap32=function(){let m=this.length;if(m%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let p=0;p<m;p+=4)S(this,p,p+3),S(this,p+1,p+2);return this},s.prototype.swap64=function(){let m=this.length;if(m%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let p=0;p<m;p+=8)S(this,p,p+7),S(this,p+1,p+6),S(this,p+2,p+5),S(this,p+3,p+4);return this},s.prototype.toString=function(){let m=this.length;return m===0?"":arguments.length===0?$(this,0,m):_.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(m){if(!s.isBuffer(m))throw new TypeError("Argument must be a Buffer");return this===m?!0:s.compare(this,m)===0},s.prototype.inspect=function(){let m="",p=hc.INSPECT_MAX_BYTES;return m=this.toString("hex",0,p).replace(/(.{2})/g,"$1 ").trim(),this.length>p&&(m+=" ... "),"<Buffer "+m+">"},t&&(s.prototype[t]=s.prototype.inspect),s.prototype.compare=function(m,p,R,J,D){if(Oe(m,Uint8Array)&&(m=s.from(m,m.offset,m.byteLength)),!s.isBuffer(m))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof m);if(p===void 0&&(p=0),R===void 0&&(R=m?m.length:0),J===void 0&&(J=0),D===void 0&&(D=this.length),p<0||R>m.length||J<0||D>this.length)throw new RangeError("out of range index");if(J>=D&&p>=R)return 0;if(J>=D)return-1;if(p>=R)return 1;if(p>>>=0,R>>>=0,J>>>=0,D>>>=0,this===m)return 0;let le=D-J,he=R-p,_e=Math.min(le,he),ve=this.slice(J,D),Ie=m.slice(p,R);for(let K=0;K<_e;++K)if(ve[K]!==Ie[K]){le=ve[K],he=Ie[K];break}return le<he?-1:he<le?1:0};function A(T,m,p,R,J){if(T.length===0)return-1;if(typeof p=="string"?(R=p,p=0):p>2147483647?p=2147483647:p<-2147483648&&(p=-2147483648),p=+p,ke(p)&&(p=J?0:T.length-1),p<0&&(p=T.length+p),p>=T.length){if(J)return-1;p=T.length-1}else if(p<0)if(J)p=0;else return-1;if(typeof m=="string"&&(m=s.from(m,R)),s.isBuffer(m))return m.length===0?-1:M(T,m,p,R,J);if(typeof m=="number")return m=m&255,typeof Uint8Array.prototype.indexOf=="function"?J?Uint8Array.prototype.indexOf.call(T,m,p):Uint8Array.prototype.lastIndexOf.call(T,m,p):M(T,[m],p,R,J);throw new TypeError("val must be string, number or Buffer")}function M(T,m,p,R,J){let D=1,le=T.length,he=m.length;if(R!==void 0&&(R=String(R).toLowerCase(),R==="ucs2"||R==="ucs-2"||R==="utf16le"||R==="utf-16le")){if(T.length<2||m.length<2)return-1;D=2,le/=2,he/=2,p/=2}function _e(Ie,K){return D===1?Ie[K]:Ie.readUInt16BE(K*D)}let ve;if(J){let Ie=-1;for(ve=p;ve<le;ve++)if(_e(T,ve)===_e(m,Ie===-1?0:ve-Ie)){if(Ie===-1&&(Ie=ve),ve-Ie+1===he)return Ie*D}else Ie!==-1&&(ve-=ve-Ie),Ie=-1}else for(p+he>le&&(p=le-he),ve=p;ve>=0;ve--){let Ie=!0;for(let K=0;K<he;K++)if(_e(T,ve+K)!==_e(m,K)){Ie=!1;break}if(Ie)return ve}return-1}s.prototype.includes=function(m,p,R){return this.indexOf(m,p,R)!==-1},s.prototype.indexOf=function(m,p,R){return A(this,m,p,R,!0)},s.prototype.lastIndexOf=function(m,p,R){return A(this,m,p,R,!1)};function I(T,m,p,R){p=Number(p)||0;let J=T.length-p;R?(R=Number(R),R>J&&(R=J)):R=J;let D=m.length;R>D/2&&(R=D/2);let le;for(le=0;le<R;++le){let he=parseInt(m.substr(le*2,2),16);if(ke(he))return le;T[p+le]=he}return le}function q(T,m,p,R){return ze(Re(m,T.length-p),T,p,R)}function Q(T,m,p,R){return ze(be(m),T,p,R)}function Z(T,m,p,R){return ze(Ae(m),T,p,R)}function ne(T,m,p,R){return ze(pe(m,T.length-p),T,p,R)}s.prototype.write=function(m,p,R,J){if(p===void 0)J="utf8",R=this.length,p=0;else if(R===void 0&&typeof p=="string")J=p,R=this.length,p=0;else if(isFinite(p))p=p>>>0,isFinite(R)?(R=R>>>0,J===void 0&&(J="utf8")):(J=R,R=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let D=this.length-p;if((R===void 0||R>D)&&(R=D),m.length>0&&(R<0||p<0)||p>this.length)throw new RangeError("Attempt to write outside buffer bounds");J||(J="utf8");let le=!1;for(;;)switch(J){case"hex":return I(this,m,p,R);case"utf8":case"utf-8":return q(this,m,p,R);case"ascii":case"latin1":case"binary":return Q(this,m,p,R);case"base64":return Z(this,m,p,R);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ne(this,m,p,R);default:if(le)throw new TypeError("Unknown encoding: "+J);J=(""+J).toLowerCase(),le=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function L(T,m,p){return m===0&&p===T.length?r.fromByteArray(T):r.fromByteArray(T.slice(m,p))}function $(T,m,p){p=Math.min(T.length,p);let R=[],J=m;for(;J<p;){let D=T[J],le=null,he=D>239?4:D>223?3:D>191?2:1;if(J+he<=p){let _e,ve,Ie,K;switch(he){case 1:D<128&&(le=D);break;case 2:_e=T[J+1],(_e&192)===128&&(K=(D&31)<<6|_e&63,K>127&&(le=K));break;case 3:_e=T[J+1],ve=T[J+2],(_e&192)===128&&(ve&192)===128&&(K=(D&15)<<12|(_e&63)<<6|ve&63,K>2047&&(K<55296||K>57343)&&(le=K));break;case 4:_e=T[J+1],ve=T[J+2],Ie=T[J+3],(_e&192)===128&&(ve&192)===128&&(Ie&192)===128&&(K=(D&15)<<18|(_e&63)<<12|(ve&63)<<6|Ie&63,K>65535&&K<1114112&&(le=K))}}le===null?(le=65533,he=1):le>65535&&(le-=65536,R.push(le>>>10&1023|55296),le=56320|le&1023),R.push(le),J+=he}return ie(R)}let X=4096;function ie(T){let m=T.length;if(m<=X)return String.fromCharCode.apply(String,T);let p="",R=0;for(;R<m;)p+=String.fromCharCode.apply(String,T.slice(R,R+=X));return p}function re(T,m,p){let R="";p=Math.min(T.length,p);for(let J=m;J<p;++J)R+=String.fromCharCode(T[J]&127);return R}function O(T,m,p){let R="";p=Math.min(T.length,p);for(let J=m;J<p;++J)R+=String.fromCharCode(T[J]);return R}function x(T,m,p){let R=T.length;(!m||m<0)&&(m=0),(!p||p<0||p>R)&&(p=R);let J="";for(let D=m;D<p;++D)J+=Ke[T[D]];return J}function P(T,m,p){let R=T.slice(m,p),J="";for(let D=0;D<R.length-1;D+=2)J+=String.fromCharCode(R[D]+R[D+1]*256);return J}s.prototype.slice=function(m,p){let R=this.length;m=~~m,p=p===void 0?R:~~p,m<0?(m+=R,m<0&&(m=0)):m>R&&(m=R),p<0?(p+=R,p<0&&(p=0)):p>R&&(p=R),p<m&&(p=m);let J=this.subarray(m,p);return Object.setPrototypeOf(J,s.prototype),J};function C(T,m,p){if(T%1!==0||T<0)throw new RangeError("offset is not uint");if(T+m>p)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(m,p,R){m=m>>>0,p=p>>>0,R||C(m,p,this.length);let J=this[m],D=1,le=0;for(;++le<p&&(D*=256);)J+=this[m+le]*D;return J},s.prototype.readUintBE=s.prototype.readUIntBE=function(m,p,R){m=m>>>0,p=p>>>0,R||C(m,p,this.length);let J=this[m+--p],D=1;for(;p>0&&(D*=256);)J+=this[m+--p]*D;return J},s.prototype.readUint8=s.prototype.readUInt8=function(m,p){return m=m>>>0,p||C(m,1,this.length),this[m]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(m,p){return m=m>>>0,p||C(m,2,this.length),this[m]|this[m+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(m,p){return m=m>>>0,p||C(m,2,this.length),this[m]<<8|this[m+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(m,p){return m=m>>>0,p||C(m,4,this.length),(this[m]|this[m+1]<<8|this[m+2]<<16)+this[m+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(m,p){return m=m>>>0,p||C(m,4,this.length),this[m]*16777216+(this[m+1]<<16|this[m+2]<<8|this[m+3])},s.prototype.readBigUInt64LE=tt(function(m){m=m>>>0,V(m,"offset");let p=this[m],R=this[m+7];(p===void 0||R===void 0)&&F(m,this.length-8);let J=p+this[++m]*2**8+this[++m]*2**16+this[++m]*2**24,D=this[++m]+this[++m]*2**8+this[++m]*2**16+R*2**24;return BigInt(J)+(BigInt(D)<<BigInt(32))}),s.prototype.readBigUInt64BE=tt(function(m){m=m>>>0,V(m,"offset");let p=this[m],R=this[m+7];(p===void 0||R===void 0)&&F(m,this.length-8);let J=p*2**24+this[++m]*2**16+this[++m]*2**8+this[++m],D=this[++m]*2**24+this[++m]*2**16+this[++m]*2**8+R;return(BigInt(J)<<BigInt(32))+BigInt(D)}),s.prototype.readIntLE=function(m,p,R){m=m>>>0,p=p>>>0,R||C(m,p,this.length);let J=this[m],D=1,le=0;for(;++le<p&&(D*=256);)J+=this[m+le]*D;return D*=128,J>=D&&(J-=Math.pow(2,8*p)),J},s.prototype.readIntBE=function(m,p,R){m=m>>>0,p=p>>>0,R||C(m,p,this.length);let J=p,D=1,le=this[m+--J];for(;J>0&&(D*=256);)le+=this[m+--J]*D;return D*=128,le>=D&&(le-=Math.pow(2,8*p)),le},s.prototype.readInt8=function(m,p){return m=m>>>0,p||C(m,1,this.length),this[m]&128?(255-this[m]+1)*-1:this[m]},s.prototype.readInt16LE=function(m,p){m=m>>>0,p||C(m,2,this.length);let R=this[m]|this[m+1]<<8;return R&32768?R|4294901760:R},s.prototype.readInt16BE=function(m,p){m=m>>>0,p||C(m,2,this.length);let R=this[m+1]|this[m]<<8;return R&32768?R|4294901760:R},s.prototype.readInt32LE=function(m,p){return m=m>>>0,p||C(m,4,this.length),this[m]|this[m+1]<<8|this[m+2]<<16|this[m+3]<<24},s.prototype.readInt32BE=function(m,p){return m=m>>>0,p||C(m,4,this.length),this[m]<<24|this[m+1]<<16|this[m+2]<<8|this[m+3]},s.prototype.readBigInt64LE=tt(function(m){m=m>>>0,V(m,"offset");let p=this[m],R=this[m+7];(p===void 0||R===void 0)&&F(m,this.length-8);let J=this[m+4]+this[m+5]*2**8+this[m+6]*2**16+(R<<24);return(BigInt(J)<<BigInt(32))+BigInt(p+this[++m]*2**8+this[++m]*2**16+this[++m]*2**24)}),s.prototype.readBigInt64BE=tt(function(m){m=m>>>0,V(m,"offset");let p=this[m],R=this[m+7];(p===void 0||R===void 0)&&F(m,this.length-8);let J=(p<<24)+this[++m]*2**16+this[++m]*2**8+this[++m];return(BigInt(J)<<BigInt(32))+BigInt(this[++m]*2**24+this[++m]*2**16+this[++m]*2**8+R)}),s.prototype.readFloatLE=function(m,p){return m=m>>>0,p||C(m,4,this.length),e.read(this,m,!0,23,4)},s.prototype.readFloatBE=function(m,p){return m=m>>>0,p||C(m,4,this.length),e.read(this,m,!1,23,4)},s.prototype.readDoubleLE=function(m,p){return m=m>>>0,p||C(m,8,this.length),e.read(this,m,!0,52,8)},s.prototype.readDoubleBE=function(m,p){return m=m>>>0,p||C(m,8,this.length),e.read(this,m,!1,52,8)};function j(T,m,p,R,J,D){if(!s.isBuffer(T))throw new TypeError('"buffer" argument must be a Buffer instance');if(m>J||m<D)throw new RangeError('"value" argument is out of bounds');if(p+R>T.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(m,p,R,J){if(m=+m,p=p>>>0,R=R>>>0,!J){let he=Math.pow(2,8*R)-1;j(this,m,p,R,he,0)}let D=1,le=0;for(this[p]=m&255;++le<R&&(D*=256);)this[p+le]=m/D&255;return p+R},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(m,p,R,J){if(m=+m,p=p>>>0,R=R>>>0,!J){let he=Math.pow(2,8*R)-1;j(this,m,p,R,he,0)}let D=R-1,le=1;for(this[p+D]=m&255;--D>=0&&(le*=256);)this[p+D]=m/le&255;return p+R},s.prototype.writeUint8=s.prototype.writeUInt8=function(m,p,R){return m=+m,p=p>>>0,R||j(this,m,p,1,255,0),this[p]=m&255,p+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(m,p,R){return m=+m,p=p>>>0,R||j(this,m,p,2,65535,0),this[p]=m&255,this[p+1]=m>>>8,p+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(m,p,R){return m=+m,p=p>>>0,R||j(this,m,p,2,65535,0),this[p]=m>>>8,this[p+1]=m&255,p+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(m,p,R){return m=+m,p=p>>>0,R||j(this,m,p,4,4294967295,0),this[p+3]=m>>>24,this[p+2]=m>>>16,this[p+1]=m>>>8,this[p]=m&255,p+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(m,p,R){return m=+m,p=p>>>0,R||j(this,m,p,4,4294967295,0),this[p]=m>>>24,this[p+1]=m>>>16,this[p+2]=m>>>8,this[p+3]=m&255,p+4};function U(T,m,p,R,J){xe(m,R,J,T,p,7);let D=Number(m&BigInt(4294967295));T[p++]=D,D=D>>8,T[p++]=D,D=D>>8,T[p++]=D,D=D>>8,T[p++]=D;let le=Number(m>>BigInt(32)&BigInt(4294967295));return T[p++]=le,le=le>>8,T[p++]=le,le=le>>8,T[p++]=le,le=le>>8,T[p++]=le,p}function B(T,m,p,R,J){xe(m,R,J,T,p,7);let D=Number(m&BigInt(4294967295));T[p+7]=D,D=D>>8,T[p+6]=D,D=D>>8,T[p+5]=D,D=D>>8,T[p+4]=D;let le=Number(m>>BigInt(32)&BigInt(4294967295));return T[p+3]=le,le=le>>8,T[p+2]=le,le=le>>8,T[p+1]=le,le=le>>8,T[p]=le,p+8}s.prototype.writeBigUInt64LE=tt(function(m,p=0){return U(this,m,p,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeBigUInt64BE=tt(function(m,p=0){return B(this,m,p,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeIntLE=function(m,p,R,J){if(m=+m,p=p>>>0,!J){let _e=Math.pow(2,8*R-1);j(this,m,p,R,_e-1,-_e)}let D=0,le=1,he=0;for(this[p]=m&255;++D<R&&(le*=256);)m<0&&he===0&&this[p+D-1]!==0&&(he=1),this[p+D]=(m/le>>0)-he&255;return p+R},s.prototype.writeIntBE=function(m,p,R,J){if(m=+m,p=p>>>0,!J){let _e=Math.pow(2,8*R-1);j(this,m,p,R,_e-1,-_e)}let D=R-1,le=1,he=0;for(this[p+D]=m&255;--D>=0&&(le*=256);)m<0&&he===0&&this[p+D+1]!==0&&(he=1),this[p+D]=(m/le>>0)-he&255;return p+R},s.prototype.writeInt8=function(m,p,R){return m=+m,p=p>>>0,R||j(this,m,p,1,127,-128),m<0&&(m=255+m+1),this[p]=m&255,p+1},s.prototype.writeInt16LE=function(m,p,R){return m=+m,p=p>>>0,R||j(this,m,p,2,32767,-32768),this[p]=m&255,this[p+1]=m>>>8,p+2},s.prototype.writeInt16BE=function(m,p,R){return m=+m,p=p>>>0,R||j(this,m,p,2,32767,-32768),this[p]=m>>>8,this[p+1]=m&255,p+2},s.prototype.writeInt32LE=function(m,p,R){return m=+m,p=p>>>0,R||j(this,m,p,4,2147483647,-2147483648),this[p]=m&255,this[p+1]=m>>>8,this[p+2]=m>>>16,this[p+3]=m>>>24,p+4},s.prototype.writeInt32BE=function(m,p,R){return m=+m,p=p>>>0,R||j(this,m,p,4,2147483647,-2147483648),m<0&&(m=4294967295+m+1),this[p]=m>>>24,this[p+1]=m>>>16,this[p+2]=m>>>8,this[p+3]=m&255,p+4},s.prototype.writeBigInt64LE=tt(function(m,p=0){return U(this,m,p,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeBigInt64BE=tt(function(m,p=0){return B(this,m,p,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ee(T,m,p,R,J,D){if(p+R>T.length)throw new RangeError("Index out of range");if(p<0)throw new RangeError("Index out of range")}function fe(T,m,p,R,J){return m=+m,p=p>>>0,J||ee(T,m,p,4),e.write(T,m,p,R,23,4),p+4}s.prototype.writeFloatLE=function(m,p,R){return fe(this,m,p,!0,R)},s.prototype.writeFloatBE=function(m,p,R){return fe(this,m,p,!1,R)};function Ee(T,m,p,R,J){return m=+m,p=p>>>0,J||ee(T,m,p,8),e.write(T,m,p,R,52,8),p+8}s.prototype.writeDoubleLE=function(m,p,R){return Ee(this,m,p,!0,R)},s.prototype.writeDoubleBE=function(m,p,R){return Ee(this,m,p,!1,R)},s.prototype.copy=function(m,p,R,J){if(!s.isBuffer(m))throw new TypeError("argument should be a Buffer");if(R||(R=0),!J&&J!==0&&(J=this.length),p>=m.length&&(p=m.length),p||(p=0),J>0&&J<R&&(J=R),J===R||m.length===0||this.length===0)return 0;if(p<0)throw new RangeError("targetStart out of bounds");if(R<0||R>=this.length)throw new RangeError("Index out of range");if(J<0)throw new RangeError("sourceEnd out of bounds");J>this.length&&(J=this.length),m.length-p<J-R&&(J=m.length-p+R);let D=J-R;return this===m&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(p,R,J):Uint8Array.prototype.set.call(m,this.subarray(R,J),p),D},s.prototype.fill=function(m,p,R,J){if(typeof m=="string"){if(typeof p=="string"?(J=p,p=0,R=this.length):typeof R=="string"&&(J=R,R=this.length),J!==void 0&&typeof J!="string")throw new TypeError("encoding must be a string");if(typeof J=="string"&&!s.isEncoding(J))throw new TypeError("Unknown encoding: "+J);if(m.length===1){let le=m.charCodeAt(0);(J==="utf8"&&le<128||J==="latin1")&&(m=le)}}else typeof m=="number"?m=m&255:typeof m=="boolean"&&(m=Number(m));if(p<0||this.length<p||this.length<R)throw new RangeError("Out of range index");if(R<=p)return this;p=p>>>0,R=R===void 0?this.length:R>>>0,m||(m=0);let D;if(typeof m=="number")for(D=p;D<R;++D)this[D]=m;else{let le=s.isBuffer(m)?m:s.from(m,J),he=le.length;if(he===0)throw new TypeError('The value "'+m+'" is invalid for argument "value"');for(D=0;D<R-p;++D)this[D+p]=le[D%he]}return this};let te={};function H(T,m,p){te[T]=class extends p{constructor(){super(),Object.defineProperty(this,"message",{value:m.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${T}]`,this.stack,delete this.name}get code(){return T}set code(J){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:J,writable:!0})}toString(){return`${this.name} [${T}]: ${this.message}`}}}H("ERR_BUFFER_OUT_OF_BOUNDS",function(T){return T?`${T} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),H("ERR_INVALID_ARG_TYPE",function(T,m){return`The "${T}" argument must be of type number. Received type ${typeof m}`},TypeError),H("ERR_OUT_OF_RANGE",function(T,m,p){let R=`The value of "${T}" is out of range.`,J=p;return Number.isInteger(p)&&Math.abs(p)>2**32?J=ae(String(p)):typeof p=="bigint"&&(J=String(p),(p>BigInt(2)**BigInt(32)||p<-(BigInt(2)**BigInt(32)))&&(J=ae(J)),J+="n"),R+=` It must be ${m}. Received ${J}`,R},RangeError);function ae(T){let m="",p=T.length,R=T[0]==="-"?1:0;for(;p>=R+4;p-=3)m=`_${T.slice(p-3,p)}${m}`;return`${T.slice(0,p)}${m}`}function we(T,m,p){V(m,"offset"),(T[m]===void 0||T[m+p]===void 0)&&F(m,T.length-(p+1))}function xe(T,m,p,R,J,D){if(T>p||T<m){let le=typeof m=="bigint"?"n":"",he;throw m===0||m===BigInt(0)?he=`>= 0${le} and < 2${le} ** ${(D+1)*8}${le}`:he=`>= -(2${le} ** ${(D+1)*8-1}${le}) and < 2 ** ${(D+1)*8-1}${le}`,new te.ERR_OUT_OF_RANGE("value",he,T)}we(R,J,D)}function V(T,m){if(typeof T!="number")throw new te.ERR_INVALID_ARG_TYPE(m,"number",T)}function F(T,m,p){throw Math.floor(T)!==T?(V(T,p),new te.ERR_OUT_OF_RANGE("offset","an integer",T)):m<0?new te.ERR_BUFFER_OUT_OF_BOUNDS:new te.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${m}`,T)}let oe=/[^+/0-9A-Za-z-_]/g;function ge(T){if(T=T.split("=")[0],T=T.trim().replace(oe,""),T.length<2)return"";for(;T.length%4!==0;)T=T+"=";return T}function Re(T,m){m=m||1/0;let p,R=T.length,J=null,D=[];for(let le=0;le<R;++le){if(p=T.charCodeAt(le),p>55295&&p<57344){if(!J){if(p>56319){(m-=3)>-1&&D.push(239,191,189);continue}else if(le+1===R){(m-=3)>-1&&D.push(239,191,189);continue}J=p;continue}if(p<56320){(m-=3)>-1&&D.push(239,191,189),J=p;continue}p=(J-55296<<10|p-56320)+65536}else J&&(m-=3)>-1&&D.push(239,191,189);if(J=null,p<128){if((m-=1)<0)break;D.push(p)}else if(p<2048){if((m-=2)<0)break;D.push(p>>6|192,p&63|128)}else if(p<65536){if((m-=3)<0)break;D.push(p>>12|224,p>>6&63|128,p&63|128)}else if(p<1114112){if((m-=4)<0)break;D.push(p>>18|240,p>>12&63|128,p>>6&63|128,p&63|128)}else throw new Error("Invalid code point")}return D}function be(T){let m=[];for(let p=0;p<T.length;++p)m.push(T.charCodeAt(p)&255);return m}function pe(T,m){let p,R,J,D=[];for(let le=0;le<T.length&&!((m-=2)<0);++le)p=T.charCodeAt(le),R=p>>8,J=p%256,D.push(J),D.push(R);return D}function Ae(T){return r.toByteArray(ge(T))}function ze(T,m,p,R){let J;for(J=0;J<R&&!(J+p>=m.length||J>=T.length);++J)m[J+p]=T[J];return J}function Oe(T,m){return T instanceof m||T!=null&&T.constructor!=null&&T.constructor.name!=null&&T.constructor.name===m.name}function ke(T){return T!==T}let Ke=(function(){let T="0123456789abcdef",m=new Array(256);for(let p=0;p<16;++p){let R=p*16;for(let J=0;J<16;++J)m[R+J]=T[p]+T[J]}return m})();function tt(T){return typeof BigInt>"u"?it:T}function it(){throw new Error("BigInt not supported")}return hc}function pc(){return Dk||(Dk=!0,typeof Object.create=="function"?Gb=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Gb=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}),Gb}function Qk(){return Ik||(Ik=!0,f2=cn.EventEmitter),f2}function r$(){if(kk)return h2;kk=!0;function r(d,g){var y=Object.keys(d);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(d);g&&(v=v.filter(function(w){return Object.getOwnPropertyDescriptor(d,w).enumerable})),y.push.apply(y,v)}return y}function e(d){for(var g=1;g<arguments.length;g++){var y=arguments[g]!=null?arguments[g]:{};g%2?r(Object(y),!0).forEach(function(v){t(d,v,y[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(y)):r(Object(y)).forEach(function(v){Object.defineProperty(d,v,Object.getOwnPropertyDescriptor(y,v))})}return d}function t(d,g,y){return g in d?Object.defineProperty(d,g,{value:y,enumerable:!0,configurable:!0,writable:!0}):d[g]=y,d}function n(d,g){if(!(d instanceof g))throw new TypeError("Cannot call a class as a function")}function i(d,g){for(var y=0;y<g.length;y++){var v=g[y];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(d,v.key,v)}}function o(d,g,y){return g&&i(d.prototype,g),d}var s=Th,a=s.Buffer,u=qe,c=u.inspect,f=c&&c.custom||"inspect";function h(d,g,y){a.prototype.copy.call(d,g,y)}return h2=(function(){function d(){n(this,d),this.head=null,this.tail=null,this.length=0}return o(d,[{key:"push",value:function(y){var v={data:y,next:null};this.length>0?this.tail.next=v:this.head=v,this.tail=v,++this.length}},{key:"unshift",value:function(y){var v={data:y,next:this.head};this.length===0&&(this.tail=v),this.head=v,++this.length}},{key:"shift",value:function(){if(this.length!==0){var y=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,y}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(y){if(this.length===0)return"";for(var v=this.head,w=""+v.data;v=v.next;)w+=y+v.data;return w}},{key:"concat",value:function(y){if(this.length===0)return a.alloc(0);for(var v=a.allocUnsafe(y>>>0),w=this.head,b=0;w;)h(w.data,v,b),b+=w.data.length,w=w.next;return v}},{key:"consume",value:function(y,v){var w;return y<this.head.data.length?(w=this.head.data.slice(0,y),this.head.data=this.head.data.slice(y)):y===this.head.data.length?w=this.shift():w=v?this._getString(y):this._getBuffer(y),w}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(y){var v=this.head,w=1,b=v.data;for(y-=b.length;v=v.next;){var E=v.data,_=y>E.length?E.length:y;if(_===E.length?b+=E:b+=E.slice(0,y),y-=_,y===0){_===E.length?(++w,v.next?this.head=v.next:this.head=this.tail=null):(this.head=v,v.data=E.slice(_));break}++w}return this.length-=w,b}},{key:"_getBuffer",value:function(y){var v=a.allocUnsafe(y),w=this.head,b=1;for(w.data.copy(v),y-=w.data.length;w=w.next;){var E=w.data,_=y>E.length?E.length:y;if(E.copy(v,v.length-y,0,_),y-=_,y===0){_===E.length?(++b,w.next?this.head=w.next:this.head=this.tail=null):(this.head=w,w.data=E.slice(_));break}++b}return this.length-=b,v}},{key:f,value:function(y,v){return c(this,e({},v,{depth:0,customInspect:!1}))}}]),d})(),h2}function eN(){if(Nk)return d2;Nk=!0;var r=Zt;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(d){!u&&d?c._writableState?c._writableState.errorEmitted?r.nextTick(n,c):(c._writableState.errorEmitted=!0,r.nextTick(t,c,d)):r.nextTick(t,c,d):u?(r.nextTick(n,c),u(d)):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 d2={destroy:e,undestroy:i,errorOrDestroy:s},d2}function Ch(){if(Ok)return p2;Ok=!0;let r={};function e(s,a,u){u||(u=Error);function c(h,d,g){return typeof a=="string"?a:a(h,d,g)}class f extends u{constructor(d,g,y){super(c(d,g,y))}}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"),p2.codes=r,p2}function tN(){if(Lk)return g2;Lk=!0;var r=Ch().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 g2={getHighWaterMark:t},g2}function n$(){if(Pk)return m2;Pk=!0,m2=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||y2,arguments)}return o}function e(t){try{if(!y2.localStorage)return!1}catch{return!1}var n=y2.localStorage[t];return n==null?!1:String(n).toLowerCase()==="true"}return m2}function L2(){if(Fk)return b2;Fk=!0;var r=Zt;b2=Q;function e(te){var H=this;this.next=null,this.entry=null,this.finish=function(){Ee(H,te)}}var t;Q.WritableState=I;var n={deprecate:n$()},i=Qk(),o=Th.Buffer,s=i$.Uint8Array||function(){};function a(te){return o.from(te)}function u(te){return o.isBuffer(te)||te instanceof s}var c=eN(),f=tN(),h=f.getHighWaterMark,d=Ch().codes,g=d.ERR_INVALID_ARG_TYPE,y=d.ERR_METHOD_NOT_IMPLEMENTED,v=d.ERR_MULTIPLE_CALLBACK,w=d.ERR_STREAM_CANNOT_PIPE,b=d.ERR_STREAM_DESTROYED,E=d.ERR_STREAM_NULL_VALUES,_=d.ERR_STREAM_WRITE_AFTER_END,S=d.ERR_UNKNOWN_ENCODING,A=c.errorOrDestroy;pc()(Q,i);function M(){}function I(te,H,ae){t=t||dc(),te=te||{},typeof ae!="boolean"&&(ae=H instanceof t),this.objectMode=!!te.objectMode,ae&&(this.objectMode=this.objectMode||!!te.writableObjectMode),this.highWaterMark=h(this,te,"writableHighWaterMark",ae),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var we=te.decodeStrings===!1;this.decodeStrings=!we,this.defaultEncoding=te.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(xe){O(H,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)}I.prototype.getBuffer=function(){for(var H=this.bufferedRequest,ae=[];H;)ae.push(H),H=H.next;return ae},(function(){try{Object.defineProperty(I.prototype,"buffer",{get:n.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var q;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(q=Function.prototype[Symbol.hasInstance],Object.defineProperty(Q,Symbol.hasInstance,{value:function(H){return q.call(this,H)?!0:this!==Q?!1:H&&H._writableState instanceof I}})):q=function(H){return H instanceof this};function Q(te){t=t||dc();var H=this instanceof t;if(!H&&!q.call(Q,this))return new Q(te);this._writableState=new I(te,this,H),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)}Q.prototype.pipe=function(){A(this,new w)};function Z(te,H){var ae=new _;A(te,ae),r.nextTick(H,ae)}function ne(te,H,ae,we){var xe;return ae===null?xe=new E:typeof ae!="string"&&!H.objectMode&&(xe=new g("chunk",["string","Buffer"],ae)),xe?(A(te,xe),r.nextTick(we,xe),!1):!0}Q.prototype.write=function(te,H,ae){var we=this._writableState,xe=!1,V=!we.objectMode&&u(te);return V&&!o.isBuffer(te)&&(te=a(te)),typeof H=="function"&&(ae=H,H=null),V?H="buffer":H||(H=we.defaultEncoding),typeof ae!="function"&&(ae=M),we.ending?Z(this,ae):(V||ne(this,we,te,ae))&&(we.pendingcb++,xe=$(this,we,V,te,H,ae)),xe},Q.prototype.cork=function(){this._writableState.corked++},Q.prototype.uncork=function(){var te=this._writableState;te.corked&&(te.corked--,!te.writing&&!te.corked&&!te.bufferProcessing&&te.bufferedRequest&&C(this,te))},Q.prototype.setDefaultEncoding=function(H){if(typeof H=="string"&&(H=H.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((H+"").toLowerCase())>-1))throw new S(H);return this._writableState.defaultEncoding=H,this},Object.defineProperty(Q.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function L(te,H,ae){return!te.objectMode&&te.decodeStrings!==!1&&typeof H=="string"&&(H=o.from(H,ae)),H}Object.defineProperty(Q.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function $(te,H,ae,we,xe,V){if(!ae){var F=L(H,we,xe);we!==F&&(ae=!0,xe="buffer",we=F)}var oe=H.objectMode?1:we.length;H.length+=oe;var ge=H.length<H.highWaterMark;if(ge||(H.needDrain=!0),H.writing||H.corked){var Re=H.lastBufferedRequest;H.lastBufferedRequest={chunk:we,encoding:xe,isBuf:ae,callback:V,next:null},Re?Re.next=H.lastBufferedRequest:H.bufferedRequest=H.lastBufferedRequest,H.bufferedRequestCount+=1}else X(te,H,!1,oe,we,xe,V);return ge}function X(te,H,ae,we,xe,V,F){H.writelen=we,H.writecb=F,H.writing=!0,H.sync=!0,H.destroyed?H.onwrite(new b("write")):ae?te._writev(xe,H.onwrite):te._write(xe,V,H.onwrite),H.sync=!1}function ie(te,H,ae,we,xe){--H.pendingcb,ae?(r.nextTick(xe,we),r.nextTick(ee,te,H),te._writableState.errorEmitted=!0,A(te,we)):(xe(we),te._writableState.errorEmitted=!0,A(te,we),ee(te,H))}function re(te){te.writing=!1,te.writecb=null,te.length-=te.writelen,te.writelen=0}function O(te,H){var ae=te._writableState,we=ae.sync,xe=ae.writecb;if(typeof xe!="function")throw new v;if(re(ae),H)ie(te,ae,we,H,xe);else{var V=j(ae)||te.destroyed;!V&&!ae.corked&&!ae.bufferProcessing&&ae.bufferedRequest&&C(te,ae),we?r.nextTick(x,te,ae,V,xe):x(te,ae,V,xe)}}function x(te,H,ae,we){ae||P(te,H),H.pendingcb--,we(),ee(te,H)}function P(te,H){H.length===0&&H.needDrain&&(H.needDrain=!1,te.emit("drain"))}function C(te,H){H.bufferProcessing=!0;var ae=H.bufferedRequest;if(te._writev&&ae&&ae.next){var we=H.bufferedRequestCount,xe=new Array(we),V=H.corkedRequestsFree;V.entry=ae;for(var F=0,oe=!0;ae;)xe[F]=ae,ae.isBuf||(oe=!1),ae=ae.next,F+=1;xe.allBuffers=oe,X(te,H,!0,H.length,xe,"",V.finish),H.pendingcb++,H.lastBufferedRequest=null,V.next?(H.corkedRequestsFree=V.next,V.next=null):H.corkedRequestsFree=new e(H),H.bufferedRequestCount=0}else{for(;ae;){var ge=ae.chunk,Re=ae.encoding,be=ae.callback,pe=H.objectMode?1:ge.length;if(X(te,H,!1,pe,ge,Re,be),ae=ae.next,H.bufferedRequestCount--,H.writing)break}ae===null&&(H.lastBufferedRequest=null)}H.bufferedRequest=ae,H.bufferProcessing=!1}Q.prototype._write=function(te,H,ae){ae(new y("_write()"))},Q.prototype._writev=null,Q.prototype.end=function(te,H,ae){var we=this._writableState;return typeof te=="function"?(ae=te,te=null,H=null):typeof H=="function"&&(ae=H,H=null),te!=null&&this.write(te,H),we.corked&&(we.corked=1,this.uncork()),we.ending||fe(this,we,ae),this},Object.defineProperty(Q.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,H){te._final(function(ae){H.pendingcb--,ae&&A(te,ae),H.prefinished=!0,te.emit("prefinish"),ee(te,H)})}function B(te,H){!H.prefinished&&!H.finalCalled&&(typeof te._final=="function"&&!H.destroyed?(H.pendingcb++,H.finalCalled=!0,r.nextTick(U,te,H)):(H.prefinished=!0,te.emit("prefinish")))}function ee(te,H){var ae=j(H);if(ae&&(B(te,H),H.pendingcb===0&&(H.finished=!0,te.emit("finish"),H.autoDestroy))){var we=te._readableState;(!we||we.autoDestroy&&we.endEmitted)&&te.destroy()}return ae}function fe(te,H,ae){H.ending=!0,ee(te,H),ae&&(H.finished?r.nextTick(ae):te.once("finish",ae)),H.ended=!0,te.writable=!1}function Ee(te,H,ae){var we=te.entry;for(te.entry=null;we;){var xe=we.callback;H.pendingcb--,xe(ae),we=we.next}H.corkedRequestsFree.next=te}return Object.defineProperty(Q.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(H){this._writableState&&(this._writableState.destroyed=H)}}),Q.prototype.destroy=c.destroy,Q.prototype._undestroy=c.undestroy,Q.prototype._destroy=function(te,H){H(te)},b2}function dc(){if(Mk)return w2;Mk=!0;var r=Zt,e=Object.keys||function(f){var h=[];for(var d in f)h.push(d);return h};w2=a;var t=P2(),n=L2();pc()(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)}}),w2}function Zb(){if(Bk)return v2;Bk=!0;var r=Ch().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||d()},h=o._writableState&&o._writableState.finished,d=function(){c=!1,h=!0,u||a.call(o)},g=o._readableState&&o._readableState.endEmitted,y=function(){u=!1,g=!0,c||a.call(o)},v=function(_){a.call(o,_)},w=function(){var _;if(u&&!g)return(!o._readableState||!o._readableState.ended)&&(_=new r),a.call(o,_);if(c&&!h)return(!o._writableState||!o._writableState.ended)&&(_=new r),a.call(o,_)},b=function(){o.req.on("finish",d)};return n(o)?(o.on("complete",d),o.on("abort",w),o.req?b():o.on("request",b)):c&&!o._writableState&&(o.on("end",f),o.on("close",f)),o.on("end",y),o.on("finish",d),s.error!==!1&&o.on("error",v),o.on("close",w),function(){o.removeListener("complete",d),o.removeListener("abort",w),o.removeListener("request",b),o.req&&o.req.removeListener("finish",d),o.removeListener("end",f),o.removeListener("close",f),o.removeListener("finish",d),o.removeListener("end",y),o.removeListener("error",v),o.removeListener("close",w)}}return v2=i,v2}function s$(){if(Uk)return E2;Uk=!0;var r=Zt,e;function t(E,_,S){return _ in E?Object.defineProperty(E,_,{value:S,enumerable:!0,configurable:!0,writable:!0}):E[_]=S,E}var n=Zb(),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:E,done:_}}function d(E){var _=E[i];if(_!==null){var S=E[f].read();S!==null&&(E[u]=null,E[i]=null,E[o]=null,_(h(S,!1)))}}function g(E){r.nextTick(d,E)}function y(E,_){return function(S,A){E.then(function(){if(_[a]){S(h(void 0,!0));return}_[c](S,A)},A)}}var v=Object.getPrototypeOf(function(){}),w=Object.setPrototypeOf((e={get stream(){return this[f]},next:function(){var _=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(q,Q){r.nextTick(function(){_[s]?Q(_[s]):q(h(void 0,!0))})});var A=this[u],M;if(A)M=new Promise(y(A,this));else{var I=this[f].read();if(I!==null)return Promise.resolve(h(I,!1));M=new Promise(this[c])}return this[u]=M,M}},t(e,Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var _=this;return new Promise(function(S,A){_[f].destroy(null,function(M){if(M){A(M);return}S(h(void 0,!0))})})}),e),v),b=function(_){var S,A=Object.create(w,(S={},t(S,f,{value:_,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:_._readableState.endEmitted,writable:!0}),t(S,c,{value:function(I,q){var Q=A[f].read();Q?(A[u]=null,A[i]=null,A[o]=null,I(h(Q,!1))):(A[i]=I,A[o]=q)},writable:!0}),S));return A[u]=null,n(_,function(M){if(M&&M.code!=="ERR_STREAM_PREMATURE_CLOSE"){var I=A[o];I!==null&&(A[u]=null,A[i]=null,A[o]=null,I(M)),A[s]=M;return}var q=A[i];q!==null&&(A[u]=null,A[i]=null,A[o]=null,q(h(void 0,!0))),A[a]=!0}),_.on("readable",g.bind(null,A)),A};return E2=b,E2}function o$(){return jk||(jk=!0,_2=function(){throw new Error("Readable.from is not available in the browser")}),_2}function P2(){if($k)return A2;$k=!0;var r=Zt;A2=Z;var e;Z.ReadableState=Q,cn.EventEmitter;var t=function(F,oe){return F.listeners(oe).length},n=Qk(),i=Th.Buffer,o=a$.Uint8Array||function(){};function s(V){return i.from(V)}function a(V){return i.isBuffer(V)||V instanceof o}var u=qe,c;u&&u.debuglog?c=u.debuglog("stream"):c=function(){};var f=r$(),h=eN(),d=tN(),g=d.getHighWaterMark,y=Ch().codes,v=y.ERR_INVALID_ARG_TYPE,w=y.ERR_STREAM_PUSH_AFTER_EOF,b=y.ERR_METHOD_NOT_IMPLEMENTED,E=y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,_,S,A;pc()(Z,n);var M=h.errorOrDestroy,I=["error","close","destroy","pause","resume"];function q(V,F,oe){if(typeof V.prependListener=="function")return V.prependListener(F,oe);!V._events||!V._events[F]?V.on(F,oe):Array.isArray(V._events[F])?V._events[F].unshift(oe):V._events[F]=[oe,V._events[F]]}function Q(V,F,oe){e=e||dc(),V=V||{},typeof oe!="boolean"&&(oe=F instanceof e),this.objectMode=!!V.objectMode,oe&&(this.objectMode=this.objectMode||!!V.readableObjectMode),this.highWaterMark=g(this,V,"readableHighWaterMark",oe),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=V.emitClose!==!1,this.autoDestroy=!!V.autoDestroy,this.destroyed=!1,this.defaultEncoding=V.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,V.encoding&&(_||(_=I2.StringDecoder),this.decoder=new _(V.encoding),this.encoding=V.encoding)}function Z(V){if(e=e||dc(),!(this instanceof Z))return new Z(V);var F=this instanceof e;this._readableState=new Q(V,this,F),this.readable=!0,V&&(typeof V.read=="function"&&(this._read=V.read),typeof V.destroy=="function"&&(this._destroy=V.destroy)),n.call(this)}Object.defineProperty(Z.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(F){this._readableState&&(this._readableState.destroyed=F)}}),Z.prototype.destroy=h.destroy,Z.prototype._undestroy=h.undestroy,Z.prototype._destroy=function(V,F){F(V)},Z.prototype.push=function(V,F){var oe=this._readableState,ge;return oe.objectMode?ge=!0:typeof V=="string"&&(F=F||oe.defaultEncoding,F!==oe.encoding&&(V=i.from(V,F),F=""),ge=!0),ne(this,V,F,!1,ge)},Z.prototype.unshift=function(V){return ne(this,V,null,!0,!1)};function ne(V,F,oe,ge,Re){c("readableAddChunk",F);var be=V._readableState;if(F===null)be.reading=!1,O(V,be);else{var pe;if(Re||(pe=$(be,F)),pe)M(V,pe);else if(be.objectMode||F&&F.length>0)if(typeof F!="string"&&!be.objectMode&&Object.getPrototypeOf(F)!==i.prototype&&(F=s(F)),ge)be.endEmitted?M(V,new E):L(V,be,F,!0);else if(be.ended)M(V,new w);else{if(be.destroyed)return!1;be.reading=!1,be.decoder&&!oe?(F=be.decoder.write(F),be.objectMode||F.length!==0?L(V,be,F,!1):C(V,be)):L(V,be,F,!1)}else ge||(be.reading=!1,C(V,be))}return!be.ended&&(be.length<be.highWaterMark||be.length===0)}function L(V,F,oe,ge){F.flowing&&F.length===0&&!F.sync?(F.awaitDrain=0,V.emit("data",oe)):(F.length+=F.objectMode?1:oe.length,ge?F.buffer.unshift(oe):F.buffer.push(oe),F.needReadable&&x(V)),C(V,F)}function $(V,F){var oe;return!a(F)&&typeof F!="string"&&F!==void 0&&!V.objectMode&&(oe=new v("chunk",["string","Buffer","Uint8Array"],F)),oe}Z.prototype.isPaused=function(){return this._readableState.flowing===!1},Z.prototype.setEncoding=function(V){_||(_=I2.StringDecoder);var F=new _(V);this._readableState.decoder=F,this._readableState.encoding=this._readableState.decoder.encoding;for(var oe=this._readableState.buffer.head,ge="";oe!==null;)ge+=F.write(oe.data),oe=oe.next;return this._readableState.buffer.clear(),ge!==""&&this._readableState.buffer.push(ge),this._readableState.length=ge.length,this};var X=1073741824;function ie(V){return V>=X?V=X:(V--,V|=V>>>1,V|=V>>>2,V|=V>>>4,V|=V>>>8,V|=V>>>16,V++),V}function re(V,F){return V<=0||F.length===0&&F.ended?0:F.objectMode?1:V!==V?F.flowing&&F.length?F.buffer.head.data.length:F.length:(V>F.highWaterMark&&(F.highWaterMark=ie(V)),V<=F.length?V:F.ended?F.length:(F.needReadable=!0,0))}Z.prototype.read=function(V){c("read",V),V=parseInt(V,10);var F=this._readableState,oe=V;if(V!==0&&(F.emittedReadable=!1),V===0&&F.needReadable&&((F.highWaterMark!==0?F.length>=F.highWaterMark:F.length>0)||F.ended))return c("read: emitReadable",F.length,F.ended),F.length===0&&F.ended?ae(this):x(this),null;if(V=re(V,F),V===0&&F.ended)return F.length===0&&ae(this),null;var ge=F.needReadable;c("need readable",ge),(F.length===0||F.length-V<F.highWaterMark)&&(ge=!0,c("length less than watermark",ge)),F.ended||F.reading?(ge=!1,c("reading or ended",ge)):ge&&(c("do read"),F.reading=!0,F.sync=!0,F.length===0&&(F.needReadable=!0),this._read(F.highWaterMark),F.sync=!1,F.reading||(V=re(oe,F)));var Re;return V>0?Re=H(V,F):Re=null,Re===null?(F.needReadable=F.length<=F.highWaterMark,V=0):(F.length-=V,F.awaitDrain=0),F.length===0&&(F.ended||(F.needReadable=!0),oe!==V&&F.ended&&ae(this)),Re!==null&&this.emit("data",Re),Re};function O(V,F){if(c("onEofChunk"),!F.ended){if(F.decoder){var oe=F.decoder.end();oe&&oe.length&&(F.buffer.push(oe),F.length+=F.objectMode?1:oe.length)}F.ended=!0,F.sync?x(V):(F.needReadable=!1,F.emittedReadable||(F.emittedReadable=!0,P(V)))}}function x(V){var F=V._readableState;c("emitReadable",F.needReadable,F.emittedReadable),F.needReadable=!1,F.emittedReadable||(c("emitReadable",F.flowing),F.emittedReadable=!0,r.nextTick(P,V))}function P(V){var F=V._readableState;c("emitReadable_",F.destroyed,F.length,F.ended),!F.destroyed&&(F.length||F.ended)&&(V.emit("readable"),F.emittedReadable=!1),F.needReadable=!F.flowing&&!F.ended&&F.length<=F.highWaterMark,te(V)}function C(V,F){F.readingMore||(F.readingMore=!0,r.nextTick(j,V,F))}function j(V,F){for(;!F.reading&&!F.ended&&(F.length<F.highWaterMark||F.flowing&&F.length===0);){var oe=F.length;if(c("maybeReadMore read 0"),V.read(0),oe===F.length)break}F.readingMore=!1}Z.prototype._read=function(V){M(this,new b("_read()"))},Z.prototype.pipe=function(V,F){var oe=this,ge=this._readableState;switch(ge.pipesCount){case 0:ge.pipes=V;break;case 1:ge.pipes=[ge.pipes,V];break;default:ge.pipes.push(V);break}ge.pipesCount+=1,c("pipe count=%d opts=%j",ge.pipesCount,F);var Re=(!F||F.end!==!1)&&V!==r.stdout&&V!==r.stderr,be=Re?Ae:m;ge.endEmitted?r.nextTick(be):oe.once("end",be),V.on("unpipe",pe);function pe(p,R){c("onunpipe"),p===oe&&R&&R.hasUnpiped===!1&&(R.hasUnpiped=!0,ke())}function Ae(){c("onend"),V.end()}var ze=U(oe);V.on("drain",ze);var Oe=!1;function ke(){c("cleanup"),V.removeListener("close",it),V.removeListener("finish",T),V.removeListener("drain",ze),V.removeListener("error",tt),V.removeListener("unpipe",pe),oe.removeListener("end",Ae),oe.removeListener("end",m),oe.removeListener("data",Ke),Oe=!0,ge.awaitDrain&&(!V._writableState||V._writableState.needDrain)&&ze()}oe.on("data",Ke);function Ke(p){c("ondata");var R=V.write(p);c("dest.write",R),R===!1&&((ge.pipesCount===1&&ge.pipes===V||ge.pipesCount>1&&xe(ge.pipes,V)!==-1)&&!Oe&&(c("false write response, pause",ge.awaitDrain),ge.awaitDrain++),oe.pause())}function tt(p){c("onerror",p),m(),V.removeListener("error",tt),t(V,"error")===0&&M(V,p)}q(V,"error",tt);function it(){V.removeListener("finish",T),m()}V.once("close",it);function T(){c("onfinish"),V.removeListener("close",it),m()}V.once("finish",T);function m(){c("unpipe"),oe.unpipe(V)}return V.emit("pipe",oe),ge.flowing||(c("pipe resume"),oe.resume()),V};function U(V){return function(){var oe=V._readableState;c("pipeOnDrain",oe.awaitDrain),oe.awaitDrain&&oe.awaitDrain--,oe.awaitDrain===0&&t(V,"data")&&(oe.flowing=!0,te(V))}}Z.prototype.unpipe=function(V){var F=this._readableState,oe={hasUnpiped:!1};if(F.pipesCount===0)return this;if(F.pipesCount===1)return V&&V!==F.pipes?this:(V||(V=F.pipes),F.pipes=null,F.pipesCount=0,F.flowing=!1,V&&V.emit("unpipe",this,oe),this);if(!V){var ge=F.pipes,Re=F.pipesCount;F.pipes=null,F.pipesCount=0,F.flowing=!1;for(var be=0;be<Re;be++)ge[be].emit("unpipe",this,{hasUnpiped:!1});return this}var pe=xe(F.pipes,V);return pe===-1?this:(F.pipes.splice(pe,1),F.pipesCount-=1,F.pipesCount===1&&(F.pipes=F.pipes[0]),V.emit("unpipe",this,oe),this)},Z.prototype.on=function(V,F){var oe=n.prototype.on.call(this,V,F),ge=this._readableState;return V==="data"?(ge.readableListening=this.listenerCount("readable")>0,ge.flowing!==!1&&this.resume()):V==="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(ee,this)),oe},Z.prototype.addListener=Z.prototype.on,Z.prototype.removeListener=function(V,F){var oe=n.prototype.removeListener.call(this,V,F);return V==="readable"&&r.nextTick(B,this),oe},Z.prototype.removeAllListeners=function(V){var F=n.prototype.removeAllListeners.apply(this,arguments);return(V==="readable"||V===void 0)&&r.nextTick(B,this),F};function B(V){var F=V._readableState;F.readableListening=V.listenerCount("readable")>0,F.resumeScheduled&&!F.paused?F.flowing=!0:V.listenerCount("data")>0&&V.resume()}function ee(V){c("readable nexttick read 0"),V.read(0)}Z.prototype.resume=function(){var V=this._readableState;return V.flowing||(c("resume"),V.flowing=!V.readableListening,fe(this,V)),V.paused=!1,this};function fe(V,F){F.resumeScheduled||(F.resumeScheduled=!0,r.nextTick(Ee,V,F))}function Ee(V,F){c("resume",F.reading),F.reading||V.read(0),F.resumeScheduled=!1,V.emit("resume"),te(V),F.flowing&&!F.reading&&V.read(0)}Z.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(V){var F=V._readableState;for(c("flow",F.flowing);F.flowing&&V.read()!==null;);}Z.prototype.wrap=function(V){var F=this,oe=this._readableState,ge=!1;V.on("end",function(){if(c("wrapped end"),oe.decoder&&!oe.ended){var pe=oe.decoder.end();pe&&pe.length&&F.push(pe)}F.push(null)}),V.on("data",function(pe){if(c("wrapped data"),oe.decoder&&(pe=oe.decoder.write(pe)),!(oe.objectMode&&pe==null)&&!(!oe.objectMode&&(!pe||!pe.length))){var Ae=F.push(pe);Ae||(ge=!0,V.pause())}});for(var Re in V)this[Re]===void 0&&typeof V[Re]=="function"&&(this[Re]=(function(Ae){return function(){return V[Ae].apply(V,arguments)}})(Re));for(var be=0;be<I.length;be++)V.on(I[be],this.emit.bind(this,I[be]));return this._read=function(pe){c("wrapped _read",pe),ge&&(ge=!1,V.resume())},this},typeof Symbol=="function"&&(Z.prototype[Symbol.asyncIterator]=function(){return S===void 0&&(S=s$()),S(this)}),Object.defineProperty(Z.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(Z.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(Z.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(F){this._readableState&&(this._readableState.flowing=F)}}),Z._fromList=H,Object.defineProperty(Z.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function H(V,F){if(F.length===0)return null;var oe;return F.objectMode?oe=F.buffer.shift():!V||V>=F.length?(F.decoder?oe=F.buffer.join(""):F.buffer.length===1?oe=F.buffer.first():oe=F.buffer.concat(F.length),F.buffer.clear()):oe=F.buffer.consume(V,F.decoder),oe}function ae(V){var F=V._readableState;c("endReadable",F.endEmitted),F.endEmitted||(F.ended=!0,r.nextTick(we,F,V))}function we(V,F){if(c("endReadableNT",V.endEmitted,V.length),!V.endEmitted&&V.length===0&&(V.endEmitted=!0,F.readable=!1,F.emit("end"),V.autoDestroy)){var oe=F._writableState;(!oe||oe.autoDestroy&&oe.finished)&&F.destroy()}}typeof Symbol=="function"&&(Z.from=function(V,F){return A===void 0&&(A=o$()),A(Z,V,F)});function xe(V,F){for(var oe=0,ge=V.length;oe<ge;oe++)if(V[oe]===F)return oe;return-1}return A2}function F2(){if(zk)return x2;zk=!0,x2=a;var r=Ch().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=dc();pc()(a,o);function s(f,h){var d=this._transformState;d.transforming=!1;var g=d.writecb;if(g===null)return this.emit("error",new t);d.writechunk=null,d.writecb=null,h!=null&&this.push(h),g(f);var y=this._readableState;y.reading=!1,(y.needReadable||y.length<y.highWaterMark)&&this._read(y.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,d){c(f,h,d)}):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,d){d(new e("_transform()"))},a.prototype._write=function(f,h,d){var g=this._transformState;if(g.writecb=d,g.writechunk=f,g.writeencoding=h,!g.transforming){var y=this._readableState;(g.needTransform||y.needReadable||y.length<y.highWaterMark)&&this._read(y.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(d){h(d)})};function c(f,h,d){if(h)return f.emit("error",h);if(d!=null&&f.push(d),f._writableState.length)throw new i;if(f._transformState.transforming)throw new n;return f.push(null)}return x2}function rN(){if(Wk)return S2;Wk=!0,S2=e;var r=F2();pc()(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)},S2}function nN(){if(Hk)return T2;Hk=!0;var r;function e(d){var g=!1;return function(){g||(g=!0,d.apply(void 0,arguments))}}var t=Ch().codes,n=t.ERR_MISSING_ARGS,i=t.ERR_STREAM_DESTROYED;function o(d){if(d)throw d}function s(d){return d.setHeader&&typeof d.abort=="function"}function a(d,g,y,v){v=e(v);var w=!1;d.on("close",function(){w=!0}),r===void 0&&(r=Zb()),r(d,{readable:g,writable:y},function(E){if(E)return v(E);w=!0,v()});var b=!1;return function(E){if(!w&&!b){if(b=!0,s(d))return d.abort();if(typeof d.destroy=="function")return d.destroy();v(E||new i("pipe"))}}}function u(d){d()}function c(d,g){return d.pipe(g)}function f(d){return!d.length||typeof d[d.length-1]!="function"?o:d.pop()}function h(){for(var d=arguments.length,g=new Array(d),y=0;y<d;y++)g[y]=arguments[y];var v=f(g);if(Array.isArray(g[0])&&(g=g[0]),g.length<2)throw new n("streams");var w,b=g.map(function(E,_){var S=_<g.length-1,A=_>0;return a(E,S,A,function(M){w||(w=M),M&&b.forEach(u),!S&&(b.forEach(u),v(w))})});return g.reduce(c)}return T2=h,T2}var qk,Ws,Fi,gk,Hb,uc,mk,kj,ya,C2,Sh,bk,Wj,Hj,Vb,Xb,wo,qj,I2,k2,Sk,_g,Tk,qb,Ck,hc,Rk,Th,Gb,Dk,f2,Ik,h2,kk,d2,Nk,p2,Ok,g2,Lk,m2,Pk,y2,b2,Fk,i$,w2,Mk,v2,Bk,E2,Uk,_2,jk,A2,$k,a$,x2,zk,S2,Wk,T2,Hk,Kb=bt(()=>{Se();Ce();Te();xh();Ol();wh();for(qk={byteLength:function(r){var e=yk(r),t=e[0],n=e[1];return 3*(t+n)/4-n},toByteArray:function(r){var e,t,n=yk(r),i=n[0],o=n[1],s=new gk((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=Fi[r.charCodeAt(t)]<<18|Fi[r.charCodeAt(t+1)]<<12|Fi[r.charCodeAt(t+2)]<<6|Fi[r.charCodeAt(t+3)],s[a++]=e>>16&255,s[a++]=e>>8&255,s[a++]=255&e;return o===2&&(e=Fi[r.charCodeAt(t)]<<2|Fi[r.charCodeAt(t+1)]>>4,s[a++]=255&e),o===1&&(e=Fi[r.charCodeAt(t)]<<10|Fi[r.charCodeAt(t+1)]<<4|Fi[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(Ij(r,o,o+16383>s?s:o+16383));return n===1?(e=r[t-1],i.push(Ws[e>>2]+Ws[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1],i.push(Ws[e>>10]+Ws[e>>4&63]+Ws[e<<2&63]+"=")),i.join("")}},Ws=[],Fi=[],gk=typeof Uint8Array<"u"?Uint8Array:Array,Hb="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",uc=0,mk=Hb.length;uc<mk;++uc)Ws[uc]=Hb[uc],Fi[Hb.charCodeAt(uc)]=uc;Fi[45]=62,Fi[95]=63;kj={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,d=t?-1:1,g=r[e+h];for(h+=d,o=g&(1<<-f)-1,g>>=-f,f+=a;f>0;o=256*o+r[e+h],h+=d,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=256*s+r[e+h],h+=d,f-=8);if(o===0)o=1-c;else{if(o===u)return s?NaN:1/0*(g?-1:1);s+=Math.pow(2,n),o-=c}return(g?-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,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:o-1,y=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?d/u:d*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+g]=255&a,g+=y,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;r[t+g]=255&s,g+=y,s/=256,c-=8);r[t+g-y]|=128*v}},ya={},C2=qk,Sh=kj,bk=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ya.Buffer=Ze,ya.SlowBuffer=function(r){return+r!=r&&(r=0),Ze.alloc(+r)},ya.INSPECT_MAX_BYTES=50;ya.kMaxLength=2147483647,Ze.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}})(),Ze.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(Ze.prototype,"parent",{enumerable:!0,get:function(){if(Ze.isBuffer(this))return this.buffer}}),Object.defineProperty(Ze.prototype,"offset",{enumerable:!0,get:function(){if(Ze.isBuffer(this))return this.byteOffset}}),Ze.poolSize=8192,Ze.from=function(r,e,t){return Gk(r,e,t)},Object.setPrototypeOf(Ze.prototype,Uint8Array.prototype),Object.setPrototypeOf(Ze,Uint8Array),Ze.alloc=function(r,e,t){return(function(n,i,o){return Vk(n),n<=0?ga(n):i!==void 0?typeof o=="string"?ga(n).fill(i,o):ga(n).fill(i):ga(n)})(r,e,t)},Ze.allocUnsafe=function(r){return R2(r)},Ze.allocUnsafeSlow=function(r){return R2(r)},Ze.isBuffer=function(r){return r!=null&&r._isBuffer===!0&&r!==Ze.prototype},Ze.compare=function(r,e){if(ma(r,Uint8Array)&&(r=Ze.from(r,r.offset,r.byteLength)),ma(e,Uint8Array)&&(e=Ze.from(e,e.offset,e.byteLength)),!Ze.isBuffer(r)||!Ze.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},Ze.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}},Ze.concat=function(r,e){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return Ze.alloc(0);var t;if(e===void 0)for(e=0,t=0;t<r.length;++t)e+=r[t].length;var n=Ze.allocUnsafe(e),i=0;for(t=0;t<r.length;++t){var o=r[t];if(ma(o,Uint8Array)&&(o=Ze.from(o)),!Ze.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},Ze.byteLength=Xk,Ze.prototype._isBuffer=!0,Ze.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)cc(this,e,e+1);return this},Ze.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)cc(this,e,e+3),cc(this,e+1,e+2);return this},Ze.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)cc(this,e,e+7),cc(this,e+1,e+6),cc(this,e+2,e+5),cc(this,e+3,e+4);return this},Ze.prototype.toString=function(){var r=this.length;return r===0?"":arguments.length===0?Zk(this,0,r):Nj.apply(this,arguments)},Ze.prototype.toLocaleString=Ze.prototype.toString,Ze.prototype.equals=function(r){if(!Ze.isBuffer(r))throw new TypeError("Argument must be a Buffer");return this===r||Ze.compare(this,r)===0},Ze.prototype.inspect=function(){var r="",e=ya.INSPECT_MAX_BYTES;return r=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(r+=" ... "),"<Buffer "+r+">"},bk&&(Ze.prototype[bk]=Ze.prototype.inspect),Ze.prototype.compare=function(r,e,t,n,i){if(ma(r,Uint8Array)&&(r=Ze.from(r,r.offset,r.byteLength)),!Ze.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},Ze.prototype.includes=function(r,e,t){return this.indexOf(r,e,t)!==-1},Ze.prototype.indexOf=function(r,e,t){return vk(this,r,e,t,!0)},Ze.prototype.lastIndexOf=function(r,e,t){return vk(this,r,e,t,!1)},Ze.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 Oj(this,r,e,t);case"utf8":case"utf-8":return Lj(this,r,e,t);case"ascii":return Yk(this,r,e,t);case"latin1":case"binary":return Pj(this,r,e,t);case"base64":return Fj(this,r,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Mj(this,r,e,t);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},Ze.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};Ze.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,Ze.prototype),n},Ze.prototype.readUIntLE=function(r,e,t){r>>>=0,e>>>=0,t||bn(r,e,this.length);for(var n=this[r],i=1,o=0;++o<e&&(i*=256);)n+=this[r+o]*i;return n},Ze.prototype.readUIntBE=function(r,e,t){r>>>=0,e>>>=0,t||bn(r,e,this.length);for(var n=this[r+--e],i=1;e>0&&(i*=256);)n+=this[r+--e]*i;return n},Ze.prototype.readUInt8=function(r,e){return r>>>=0,e||bn(r,1,this.length),this[r]},Ze.prototype.readUInt16LE=function(r,e){return r>>>=0,e||bn(r,2,this.length),this[r]|this[r+1]<<8},Ze.prototype.readUInt16BE=function(r,e){return r>>>=0,e||bn(r,2,this.length),this[r]<<8|this[r+1]},Ze.prototype.readUInt32LE=function(r,e){return r>>>=0,e||bn(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+16777216*this[r+3]},Ze.prototype.readUInt32BE=function(r,e){return r>>>=0,e||bn(r,4,this.length),16777216*this[r]+(this[r+1]<<16|this[r+2]<<8|this[r+3])},Ze.prototype.readIntLE=function(r,e,t){r>>>=0,e>>>=0,t||bn(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},Ze.prototype.readIntBE=function(r,e,t){r>>>=0,e>>>=0,t||bn(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},Ze.prototype.readInt8=function(r,e){return r>>>=0,e||bn(r,1,this.length),128&this[r]?-1*(255-this[r]+1):this[r]},Ze.prototype.readInt16LE=function(r,e){r>>>=0,e||bn(r,2,this.length);var t=this[r]|this[r+1]<<8;return 32768&t?4294901760|t:t},Ze.prototype.readInt16BE=function(r,e){r>>>=0,e||bn(r,2,this.length);var t=this[r+1]|this[r]<<8;return 32768&t?4294901760|t:t},Ze.prototype.readInt32LE=function(r,e){return r>>>=0,e||bn(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24},Ze.prototype.readInt32BE=function(r,e){return r>>>=0,e||bn(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]},Ze.prototype.readFloatLE=function(r,e){return r>>>=0,e||bn(r,4,this.length),Sh.read(this,r,!0,23,4)},Ze.prototype.readFloatBE=function(r,e){return r>>>=0,e||bn(r,4,this.length),Sh.read(this,r,!1,23,4)},Ze.prototype.readDoubleLE=function(r,e){return r>>>=0,e||bn(r,8,this.length),Sh.read(this,r,!0,52,8)},Ze.prototype.readDoubleBE=function(r,e){return r>>>=0,e||bn(r,8,this.length),Sh.read(this,r,!1,52,8)},Ze.prototype.writeUIntLE=function(r,e,t,n){r=+r,e>>>=0,t>>>=0,n||ci(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},Ze.prototype.writeUIntBE=function(r,e,t,n){r=+r,e>>>=0,t>>>=0,n||ci(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},Ze.prototype.writeUInt8=function(r,e,t){return r=+r,e>>>=0,t||ci(this,r,e,1,255,0),this[e]=255&r,e+1},Ze.prototype.writeUInt16LE=function(r,e,t){return r=+r,e>>>=0,t||ci(this,r,e,2,65535,0),this[e]=255&r,this[e+1]=r>>>8,e+2},Ze.prototype.writeUInt16BE=function(r,e,t){return r=+r,e>>>=0,t||ci(this,r,e,2,65535,0),this[e]=r>>>8,this[e+1]=255&r,e+2},Ze.prototype.writeUInt32LE=function(r,e,t){return r=+r,e>>>=0,t||ci(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},Ze.prototype.writeUInt32BE=function(r,e,t){return r=+r,e>>>=0,t||ci(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},Ze.prototype.writeIntLE=function(r,e,t,n){if(r=+r,e>>>=0,!n){var i=Math.pow(2,8*t-1);ci(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},Ze.prototype.writeIntBE=function(r,e,t,n){if(r=+r,e>>>=0,!n){var i=Math.pow(2,8*t-1);ci(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},Ze.prototype.writeInt8=function(r,e,t){return r=+r,e>>>=0,t||ci(this,r,e,1,127,-128),r<0&&(r=255+r+1),this[e]=255&r,e+1},Ze.prototype.writeInt16LE=function(r,e,t){return r=+r,e>>>=0,t||ci(this,r,e,2,32767,-32768),this[e]=255&r,this[e+1]=r>>>8,e+2},Ze.prototype.writeInt16BE=function(r,e,t){return r=+r,e>>>=0,t||ci(this,r,e,2,32767,-32768),this[e]=r>>>8,this[e+1]=255&r,e+2},Ze.prototype.writeInt32LE=function(r,e,t){return r=+r,e>>>=0,t||ci(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},Ze.prototype.writeInt32BE=function(r,e,t){return r=+r,e>>>=0,t||ci(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},Ze.prototype.writeFloatLE=function(r,e,t){return _k(this,r,e,!0,t)},Ze.prototype.writeFloatBE=function(r,e,t){return _k(this,r,e,!1,t)},Ze.prototype.writeDoubleLE=function(r,e,t){return Ak(this,r,e,!0,t)},Ze.prototype.writeDoubleBE=function(r,e,t){return Ak(this,r,e,!1,t)},Ze.prototype.copy=function(r,e,t,n){if(!Ze.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},Ze.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"&&!Ze.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=Ze.isBuffer(r)?r:Ze.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};Wj=/[^+/0-9A-Za-z-_]/g;Hj=(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})();ya.Buffer;ya.INSPECT_MAX_BYTES;ya.kMaxLength;Vb={},Xb=ya,wo=Xb.Buffer;wo.from&&wo.alloc&&wo.allocUnsafe&&wo.allocUnsafeSlow?Vb=Xb:(xk(Xb,Vb),Vb.Buffer=fc),fc.prototype=Object.create(wo.prototype),xk(wo,fc),fc.from=function(r,e,t){if(typeof r=="number")throw new TypeError("Argument must not be a number");return wo(r,e,t)},fc.alloc=function(r,e,t){if(typeof r!="number")throw new TypeError("Argument must be a number");var n=wo(r);return e!==void 0?typeof t=="string"?n.fill(e,t):n.fill(e):n.fill(0),n},fc.allocUnsafe=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return wo(r)},fc.allocUnsafeSlow=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return Xb.SlowBuffer(r)};qj=Vb,I2={},k2=qj.Buffer,Sk=k2.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}};I2.StringDecoder=Eg,Eg.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||""},Eg.prototype.end=function(r){var e=r&&r.length?this.write(r):"";return this.lastNeed?e+"\uFFFD":e},Eg.prototype.text=function(r,e){var t=(function(i,o,s){var a=o.length-1;if(a<s)return 0;var u=c2(o[a]);return u>=0?(u>0&&(i.lastNeed=u-1),u):--a<s||u===-2?0:(u=c2(o[a]))>=0?(u>0&&(i.lastNeed=u-2),u):--a<s||u===-2?0:(u=c2(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)},Eg.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};_g={},Tk=!1;qb={},Ck=!1;hc={},Rk=!1;Th=t$();Th.Buffer;Th.INSPECT_MAX_BYTES;Th.kMaxLength;Gb={},Dk=!1;f2={},Ik=!1;h2={},kk=!1;d2={},Nk=!1;p2={},Ok=!1;g2={},Lk=!1;m2={},Pk=!1,y2=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;b2={},Fk=!1,i$=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;w2={},Mk=!1;v2={},Bk=!1;E2={},Uk=!1;_2={},jk=!1;A2={},$k=!1,a$=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;x2={},zk=!1;S2={},Wk=!1;T2={},Hk=!1});function l$(){if(iN)return M2;iN=!0,M2=t;var r=cn.EventEmitter,e=pc();e(t,r),t.Readable=P2(),t.Writable=L2(),t.Duplex=dc(),t.Transform=F2(),t.PassThrough=rN(),t.finished=Zb(),t.pipeline=nN(),t.Stream=t;function t(){r.call(this||B2)}return t.prototype.pipe=function(n,i){var o=this||B2;function s(g){n.writable&&n.write(g)===!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(g){if(d(),r.listenerCount(this||B2,"error")===0)throw g}o.on("error",h),n.on("error",h);function d(){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",d),o.removeListener("close",d),n.removeListener("close",d)}return o.on("end",d),o.on("close",d),n.on("close",d),n.emit("pipe",o),n},M2}var M2,iN,B2,fi,sN,U2=bt(()=>{Se();Ce();Te();Wb();Kb();xh();jb();Ol();wh();M2={},iN=!1,B2=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;fi=l$(),sN=fi.Readable;sN.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 sN(e).wrap(r)};fi.Writable;fi.Duplex;fi.Transform;fi.PassThrough;fi.finished;fi.pipeline;fi.Stream;X1(fi.finished),X1(fi.pipeline)});function u$(){if(oN)return j2;oN=!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,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=e-t,y=Math.floor,v=String.fromCharCode;function w($){throw new RangeError(d[$])}function b($,X){let ie=[],re=$.length;for(;re--;)ie[re]=X($[re]);return ie}function E($,X){let ie=$.split("@"),re="";ie.length>1&&(re=ie[0]+"@",$=ie[1]),$=$.replace(h,".");let O=$.split("."),x=b(O,X).join(".");return re+x}function _($){let X=[],ie=0,re=$.length;for(;ie<re;){let O=$.charCodeAt(ie++);if(O>=55296&&O<=56319&&ie<re){let x=$.charCodeAt(ie++);(x&64512)==56320?X.push(((O&1023)<<10)+(x&1023)+65536):(X.push(O),ie--)}else X.push(O)}return X}let S=$=>String.fromCodePoint(...$),A=function($){return $>=48&&$<58?26+($-48):$>=65&&$<91?$-65:$>=97&&$<123?$-97:e},M=function($,X){return $+22+75*($<26)-((X!=0)<<5)},I=function($,X,ie){let re=0;for($=ie?y($/o):$>>1,$+=y($/X);$>g*n>>1;re+=e)$=y($/g);return y(re+(g+1)*$/($+i))},q=function($){let X=[],ie=$.length,re=0,O=a,x=s,P=$.lastIndexOf(u);P<0&&(P=0);for(let C=0;C<P;++C)$.charCodeAt(C)>=128&&w("not-basic"),X.push($.charCodeAt(C));for(let C=P>0?P+1:0;C<ie;){let j=re;for(let B=1,ee=e;;ee+=e){C>=ie&&w("invalid-input");let fe=A($.charCodeAt(C++));fe>=e&&w("invalid-input"),fe>y((r-re)/B)&&w("overflow"),re+=fe*B;let Ee=ee<=x?t:ee>=x+n?n:ee-x;if(fe<Ee)break;let te=e-Ee;B>y(r/te)&&w("overflow"),B*=te}let U=X.length+1;x=I(re-j,U,j==0),y(re/U)>r-O&&w("overflow"),O+=y(re/U),re%=U,X.splice(re++,0,O)}return String.fromCodePoint(...X)},Q=function($){let X=[];$=_($);let ie=$.length,re=a,O=0,x=s;for(let j of $)j<128&&X.push(v(j));let P=X.length,C=P;for(P&&X.push(u);C<ie;){let j=r;for(let B of $)B>=re&&B<j&&(j=B);let U=C+1;j-re>y((r-O)/U)&&w("overflow"),O+=(j-re)*U,re=j;for(let B of $)if(B<re&&++O>r&&w("overflow"),B===re){let ee=O;for(let fe=e;;fe+=e){let Ee=fe<=x?t:fe>=x+n?n:fe-x;if(ee<Ee)break;let te=ee-Ee,H=e-Ee;X.push(v(M(Ee+te%H,0))),ee=y(te/H)}X.push(v(M(ee,0))),x=I(O,U,C===P),O=0,++C}++O,++re}return X.join("")};return j2={version:"2.3.1",ucs2:{decode:_,encode:S},decode:q,encode:Q,toASCII:function($){return E($,function(X){return f.test(X)?"xn--"+Q(X):X})},toUnicode:function($){return E($,function(X){return c.test(X)?q(X.slice(4).toLowerCase()):X})}},j2}var j2,oN,Fl,$K,zK,WK,HK,qK,GK,$2=bt(()=>{Se();Ce();Te();j2={},oN=!1;Fl=u$(),$K=Fl.decode,zK=Fl.encode,WK=Fl.toASCII,HK=Fl.toUnicode,qK=Fl.ucs2,GK=Fl.version});function l_(){return aN||(aN=!0,z2=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}),z2}function c$(){return lN||(lN=!0,W2=Error),W2}function f$(){return uN||(uN=!0,H2=EvalError),H2}function h$(){return cN||(cN=!0,q2=RangeError),q2}function d$(){return fN||(fN=!0,G2=ReferenceError),G2}function RN(){return hN||(hN=!0,V2=SyntaxError),V2}function Rh(){return dN||(dN=!0,X2=TypeError),X2}function p$(){return pN||(pN=!0,Y2=URIError),Y2}function g$(){if(gN)return Z2;gN=!0;var r=typeof Symbol<"u"&&Symbol,e=l_();return Z2=function(){return typeof r!="function"||typeof Symbol!="function"||typeof r("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},Z2}function m$(){if(mN)return K2;mN=!0;var r={__proto__:null,foo:{}},e=Object;return K2=function(){return{__proto__:r}.foo===r.foo&&!(r instanceof e)},K2}function y$(){if(yN)return J2;yN=!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 d=0;d<c.length;d+=1)f[d+u.length]=c[d];return f},o=function(u,c){for(var f=[],h=c,d=0;h<u.length;h+=1,d+=1)f[d]=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 J2=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,d=function(){if(this instanceof h){var b=c.apply(this,i(f,arguments));return Object(b)===b?b:this}return c.apply(u,i(f,arguments))},g=t(0,c.length-f.length),y=[],v=0;v<g;v++)y[v]="$"+v;if(h=Function("binder","return function ("+s(y,",")+"){ return binder.apply(this,arguments); }")(d),c.prototype){var w=function(){};w.prototype=c.prototype,h.prototype=new w,w.prototype=null}return h},J2}function u_(){if(bN)return Q2;bN=!0;var r=y$();return Q2=Function.prototype.bind||r,Q2}function b$(){if(wN)return e_;wN=!0;var r=Function.prototype.call,e=Object.prototype.hasOwnProperty,t=u_();return e_=t.call(r,e),e_}function gc(){if(vN)return t_;vN=!0;var r,e=c$(),t=f$(),n=h$(),i=d$(),o=RN(),s=Rh(),a=p$(),u=Function,c=function(O){try{return u('"use strict"; return ('+O+").constructor;")()}catch{}},f=Object.getOwnPropertyDescriptor;if(f)try{f({},"")}catch{f=null}var h=function(){throw new s},d=f?(function(){try{return arguments.callee,h}catch{try{return f(arguments,"callee").get}catch{return h}}})():h,g=g$()(),y=m$()(),v=Object.getPrototypeOf||(y?function(O){return O.__proto__}:null),w={},b=typeof Uint8Array>"u"||!v?r:v(Uint8Array),E={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?r:ArrayBuffer,"%ArrayIteratorPrototype%":g&&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%":g&&v?v(v([][Symbol.iterator]())):r,"%JSON%":typeof JSON=="object"?JSON:r,"%Map%":typeof Map>"u"?r:Map,"%MapIteratorPrototype%":typeof Map>"u"||!g||!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"||!g||!v?r:v(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":g&&v?v(""[Symbol.iterator]()):r,"%Symbol%":g?Symbol:r,"%SyntaxError%":o,"%ThrowTypeError%":d,"%TypedArray%":b,"%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(O){var _=v(v(O));E["%Error.prototype%"]=_}var S=function O(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=O("%AsyncGeneratorFunction%");C&&(P=C.prototype)}else if(x==="%AsyncIteratorPrototype%"){var j=O("%AsyncGenerator%");j&&v&&(P=v(j.prototype))}return E[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"]},M=u_(),I=b$(),q=M.call(Function.call,Array.prototype.concat),Q=M.call(Function.apply,Array.prototype.splice),Z=M.call(Function.call,String.prototype.replace),ne=M.call(Function.call,String.prototype.slice),L=M.call(Function.call,RegExp.prototype.exec),$=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,X=/\\(\\)?/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 Z(x,$,function(U,B,ee,fe){j[j.length]=ee?Z(fe,X,"$1"):B||U}),j},re=function(x,P){var C=x,j;if(I(A,C)&&(j=A[C],C="%"+j[0]+"%"),I(E,C)){var U=E[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 t_=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(L(/^%?[^%]*%?$/,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,ee=U.value,fe=!1,Ee=U.alias;Ee&&(j=Ee[0],Q(C,q([0,1],Ee)));for(var te=1,H=!0;te<C.length;te+=1){var ae=C[te],we=ne(ae,0,1),xe=ne(ae,-1);if((we==='"'||we==="'"||we==="`"||xe==='"'||xe==="'"||xe==="`")&&we!==xe)throw new o("property names with quotes must have matching quotes");if((ae==="constructor"||!H)&&(fe=!0),j+="."+ae,B="%"+j+"%",I(E,B))ee=E[B];else if(ee!=null){if(!(ae in ee)){if(!P)throw new s("base intrinsic for "+x+" exists, but the property is not available.");return}if(f&&te+1>=C.length){var V=f(ee,ae);H=!!V,H&&"get"in V&&!("originalValue"in V.get)?ee=V.get:ee=ee[ae]}else H=I(ee,ae),ee=ee[ae];H&&!fe&&(E[B]=ee)}}return ee},t_}function c_(){if(EN)return r_;EN=!0;var r=gc(),e=r("%Object.defineProperty%",!0)||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return r_=e,r_}function Jb(){if(_N)return n_;_N=!0;var r=gc(),e=r("%Object.getOwnPropertyDescriptor%",!0);if(e)try{e([],"length")}catch{e=null}return n_=e,n_}function w$(){if(AN)return i_;AN=!0;var r=c_(),e=RN(),t=Rh(),n=Jb();return i_=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,d=!!n&&n(o,s);if(r)r(o,s,{configurable:f===null&&d?d.configurable:!f,enumerable:u===null&&d?d.enumerable:!u,value:a,writable:c===null&&d?d.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.")},i_}function v$(){if(xN)return s_;xN=!0;var r=c_(),e=function(){return!!r};return e.hasArrayLengthDefineBug=function(){if(!r)return null;try{return r([],"length",{value:1}).length!==1}catch{return!0}},s_=e,s_}function E$(){if(SN)return o_;SN=!0;var r=gc(),e=w$(),t=v$()(),n=Jb(),i=Rh(),o=r("%Math.floor%");return o_=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 d=n(a,"length");d&&!d.configurable&&(f=!1),d&&!d.writable&&(h=!1)}return(f||h||!c)&&(t?e(a,"length",u,!0,!0):e(a,"length",u)),a},o_}function f_(){if(TN)return Ag;TN=!0;var r=u_(),e=gc(),t=E$(),n=Rh(),i=e("%Function.prototype.apply%"),o=e("%Function.prototype.call%"),s=e("%Reflect.apply%",!0)||r.call(o,i),a=c_(),u=e("%Math.max%");Ag=function(h){if(typeof h!="function")throw new n("a function is required");var d=s(r,o,arguments);return t(d,1+u(0,h.length-(arguments.length-1)),!0)};var c=function(){return s(r,i,arguments)};return a?a(Ag,"apply",{value:c}):Ag.apply=c,Ag}function xg(){if(CN)return a_;CN=!0;var r=gc(),e=f_(),t=e(r("String.prototype.indexOf"));return a_=function(i,o){var s=r(i,!!o);return typeof s=="function"&&t(i,".prototype.")>-1?e(s):s},a_}var z2,aN,W2,lN,H2,uN,q2,cN,G2,fN,V2,hN,X2,dN,Y2,pN,Z2,gN,K2,mN,J2,yN,Q2,bN,e_,wN,t_,vN,r_,EN,n_,_N,i_,AN,s_,xN,o_,SN,Ag,TN,a_,CN,Sg=bt(()=>{Se();Ce();Te();z2={},aN=!1;W2={},lN=!1;H2={},uN=!1;q2={},cN=!1;G2={},fN=!1;V2={},hN=!1;X2={},dN=!1;Y2={},pN=!1;Z2={},gN=!1;K2={},mN=!1;J2={},yN=!1;Q2={},bN=!1;e_={},wN=!1;t_={},vN=!1;r_={},EN=!1;n_={},_N=!1;i_={},AN=!1;s_={},xN=!1;o_={},SN=!1;Ag={},TN=!1;a_={},CN=!1});function _$(){if(DN)return h_;DN=!0;var r=Vr;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,d=0;d<=o.length;++d){if(d<o.length)h=o.charCodeAt(d);else{if(h===47)break;h=47}if(h===47){if(!(c===d-1||f===1))if(c!==d-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 g=a.lastIndexOf("/");if(g!==a.length-1){g===-1?(a="",u=0):(a=a.slice(0,g),u=a.length-1-a.lastIndexOf("/")),c=d,f=0;continue}}else if(a.length===2||a.length===1){a="",u=0,c=d,f=0;continue}}s&&(a.length>0?a+="/..":a="..",u=2)}else a.length>0?a+="/"+o.slice(c+1,d):a=o.slice(c+1,d),u=d-c-1;c=d,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 d=a.length,g=d-h,y=f<g?f:g,v=-1,w=0;w<=y;++w){if(w===y){if(g>y){if(a.charCodeAt(h+w)===47)return a.slice(h+w+1);if(w===0)return a.slice(h+w)}else f>y&&(s.charCodeAt(u+w)===47?v=w:w===0&&(v=0));break}var b=s.charCodeAt(u+w),E=a.charCodeAt(h+w);if(b!==E)break;b===47&&(v=w)}var _="";for(w=u+v+1;w<=c;++w)(w===c||s.charCodeAt(w)===47)&&(_.length===0?_+="..":_+="/..");return _.length>0?_+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 d=a.length-1,g=-1;for(h=s.length-1;h>=0;--h){var y=s.charCodeAt(h);if(y===47){if(!f){u=h+1;break}}else g===-1&&(f=!1,g=h+1),d>=0&&(y===a.charCodeAt(d)?--d===-1&&(c=h):(d=-1,c=g))}return u===c?c=g: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,d=s.length-1;d>=0;--d){var g=s.charCodeAt(d);if(g===47){if(!f){u=d+1;break}continue}c===-1&&(f=!1,c=d+1),g===46?a===-1?a=d: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,d=0,g=-1,y=!0,v=s.length-1,w=0;v>=f;--v){if(u=s.charCodeAt(v),u===47){if(!y){d=v+1;break}continue}g===-1&&(y=!1,g=v+1),u===46?h===-1?h=v:w!==1&&(w=1):h!==-1&&(w=-1)}return h===-1||g===-1||w===0||w===1&&h===g-1&&h===d+1?g!==-1&&(d===0&&c?a.base=a.name=s.slice(1,g):a.base=a.name=s.slice(d,g)):(d===0&&c?(a.name=s.slice(1,h),a.base=s.slice(1,g)):(a.name=s.slice(d,h),a.base=s.slice(d,g)),a.ext=s.slice(h,g)),d>0?a.dir=s.slice(0,d-1):c&&(a.dir="/"),a},sep:"/",delimiter:":",win32:null,posix:null};return i.posix=i,h_=i,h_}var h_,DN,d_,p_=bt(()=>{Se();Ce();Te();lc();h_={},DN=!1;d_=_$()});function x$(){if(IN)return g_;IN=!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,d=typeof WeakRef=="function"&&WeakRef.prototype,g=d?WeakRef.prototype.deref:null,y=Boolean.prototype.valueOf,v=Object.prototype.toString,w=Function.prototype.toString,b=String.prototype.match,E=String.prototype.slice,_=String.prototype.replace,S=String.prototype.toUpperCase,A=String.prototype.toLowerCase,M=RegExp.prototype.test,I=Array.prototype.concat,q=Array.prototype.join,Q=Array.prototype.slice,Z=Math.floor,ne=typeof BigInt=="function"?BigInt.prototype.valueOf:null,L=Object.getOwnPropertySymbols,$=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,X=typeof Symbol=="function"&&typeof Symbol.iterator=="object",ie=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===X||!0)?Symbol.toStringTag:null,re=Object.prototype.propertyIsEnumerable,O=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(he){return he.__proto__}:null);function x(he,_e){if(he===1/0||he===-1/0||he!==he||he&&he>-1e3&&he<1e3||M.call(/e/,_e))return _e;var ve=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof he=="number"){var Ie=he<0?-Z(-he):Z(he);if(Ie!==he){var K=String(Ie),Fe=E.call(_e,K.length+1);return _.call(K,ve,"$&_")+"."+_.call(_.call(Fe,/([0-9]{3})/g,"$&_"),/_$/,"")}}return _.call(_e,ve,"$&_")}var P=A$,C=P.custom,j=xe(C)?C:null;g_=function he(_e,ve,Ie,K){var Fe=ve||{};if(oe(Fe,"quoteStyle")&&Fe.quoteStyle!=="single"&&Fe.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(oe(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 nt=oe(Fe,"customInspect")?Fe.customInspect:!0;if(typeof nt!="boolean"&&nt!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(oe(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(oe(Fe,"numericSeparator")&&typeof Fe.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var k=Fe.numericSeparator;if(typeof _e>"u")return"undefined";if(_e===null)return"null";if(typeof _e=="boolean")return _e?"true":"false";if(typeof _e=="string")return tt(_e,Fe);if(typeof _e=="number"){if(_e===0)return 1/0/_e>0?"0":"-0";var Pe=String(_e);return k?x(_e,Pe):Pe}if(typeof _e=="bigint"){var je=String(_e)+"n";return k?x(_e,je):je}var de=typeof Fe.depth>"u"?5:Fe.depth;if(typeof Ie>"u"&&(Ie=0),Ie>=de&&de>0&&typeof _e=="object")return ee(_e)?"[Array]":"[Object]";var De=J(Fe,Ie);if(typeof K>"u")K=[];else if(be(K,_e)>=0)return"[Circular]";function Me(Jt,nn,sn){if(nn&&(K=Q.call(K),K.push(nn)),sn){var on={depth:Fe.depth};return oe(Fe,"quoteStyle")&&(on.quoteStyle=Fe.quoteStyle),he(Jt,on,Ie+1,K)}return he(Jt,Fe,Ie+1,K)}if(typeof _e=="function"&&!Ee(_e)){var ft=Re(_e),ue=le(_e,Me);return"[Function"+(ft?": "+ft:" (anonymous)")+"]"+(ue.length>0?" { "+q.call(ue,", ")+" }":"")}if(xe(_e)){var me=X?_.call(String(_e),/^(Symbol\(.*\))_[^)]*$/,"$1"):$.call(_e);return typeof _e=="object"&&!X?T(me):me}if(Ke(_e)){for(var Ge="<"+A.call(String(_e.nodeName)),Ue=_e.attributes||[],et=0;et<Ue.length;et++)Ge+=" "+Ue[et].name+"="+U(B(Ue[et].value),"double",Fe);return Ge+=">",_e.childNodes&&_e.childNodes.length&&(Ge+="..."),Ge+="</"+A.call(String(_e.nodeName))+">",Ge}if(ee(_e)){if(_e.length===0)return"[]";var gt=le(_e,Me);return De&&!R(gt)?"["+D(gt,De)+"]":"[ "+q.call(gt,", ")+" ]"}if(te(_e)){var It=le(_e,Me);return!("cause"in Error.prototype)&&"cause"in _e&&!re.call(_e,"cause")?"{ ["+String(_e)+"] "+q.call(I.call("[cause]: "+Me(_e.cause),It),", ")+" }":It.length===0?"["+String(_e)+"]":"{ ["+String(_e)+"] "+q.call(It,", ")+" }"}if(typeof _e=="object"&&nt){if(j&&typeof _e[j]=="function"&&P)return P(_e,{depth:de-Ie});if(nt!=="symbol"&&typeof _e.inspect=="function")return _e.inspect()}if(pe(_e)){var xt=[];return n&&n.call(_e,function(Jt,nn){xt.push(Me(nn,_e,!0)+" => "+Me(Jt,_e))}),p("Map",t.call(_e),xt,De)}if(Oe(_e)){var hr=[];return a&&a.call(_e,function(Jt){hr.push(Me(Jt,_e))}),p("Set",s.call(_e),hr,De)}if(Ae(_e))return m("WeakMap");if(ke(_e))return m("WeakSet");if(ze(_e))return m("WeakRef");if(ae(_e))return T(Me(Number(_e)));if(V(_e))return T(Me(ne.call(_e)));if(we(_e))return T(y.call(_e));if(H(_e))return T(Me(String(_e)));if(typeof window<"u"&&_e===window)return"{ [object Window] }";if(typeof globalThis<"u"&&_e===globalThis||typeof m_<"u"&&_e===m_)return"{ [object globalThis] }";if(!fe(_e)&&!Ee(_e)){var Oi=le(_e,Me),Zn=O?O(_e)===Object.prototype:_e instanceof Object||_e.constructor===Object,Yt=_e instanceof Object?"":"null prototype",Lr=!Zn&&ie&&Object(_e)===_e&&ie in _e?E.call(ge(_e),8,-1):Yt?"Object":"",wr=Zn||typeof _e.constructor!="function"?"":_e.constructor.name?_e.constructor.name+" ":"",Ht=wr+(Lr||Yt?"["+q.call(I.call([],Lr||[],Yt||[]),": ")+"] ":"");return Oi.length===0?Ht+"{}":De?Ht+"{"+D(Oi,De)+"}":Ht+"{ "+q.call(Oi,", ")+" }"}return String(_e)};function U(he,_e,ve){var Ie=(ve.quoteStyle||_e)==="double"?'"':"'";return Ie+he+Ie}function B(he){return _.call(String(he),/"/g,"&quot;")}function ee(he){return ge(he)==="[object Array]"&&(!ie||!(typeof he=="object"&&ie in he))}function fe(he){return ge(he)==="[object Date]"&&(!ie||!(typeof he=="object"&&ie in he))}function Ee(he){return ge(he)==="[object RegExp]"&&(!ie||!(typeof he=="object"&&ie in he))}function te(he){return ge(he)==="[object Error]"&&(!ie||!(typeof he=="object"&&ie in he))}function H(he){return ge(he)==="[object String]"&&(!ie||!(typeof he=="object"&&ie in he))}function ae(he){return ge(he)==="[object Number]"&&(!ie||!(typeof he=="object"&&ie in he))}function we(he){return ge(he)==="[object Boolean]"&&(!ie||!(typeof he=="object"&&ie in he))}function xe(he){if(X)return he&&typeof he=="object"&&he instanceof Symbol;if(typeof he=="symbol")return!0;if(!he||typeof he!="object"||!$)return!1;try{return $.call(he),!0}catch{}return!1}function V(he){if(!he||typeof he!="object"||!ne)return!1;try{return ne.call(he),!0}catch{}return!1}var F=Object.prototype.hasOwnProperty||function(he){return he in(this||m_)};function oe(he,_e){return F.call(he,_e)}function ge(he){return v.call(he)}function Re(he){if(he.name)return he.name;var _e=b.call(w.call(he),/^function\s*([\w$]+)/);return _e?_e[1]:null}function be(he,_e){if(he.indexOf)return he.indexOf(_e);for(var ve=0,Ie=he.length;ve<Ie;ve++)if(he[ve]===_e)return ve;return-1}function pe(he){if(!t||!he||typeof he!="object")return!1;try{t.call(he);try{s.call(he)}catch{return!0}return he instanceof Map}catch{}return!1}function Ae(he){if(!c||!he||typeof he!="object")return!1;try{c.call(he,c);try{h.call(he,h)}catch{return!0}return he instanceof WeakMap}catch{}return!1}function ze(he){if(!g||!he||typeof he!="object")return!1;try{return g.call(he),!0}catch{}return!1}function Oe(he){if(!s||!he||typeof he!="object")return!1;try{s.call(he);try{t.call(he)}catch{return!0}return he instanceof Set}catch{}return!1}function ke(he){if(!h||!he||typeof he!="object")return!1;try{h.call(he,h);try{c.call(he,c)}catch{return!0}return he instanceof WeakSet}catch{}return!1}function Ke(he){return!he||typeof he!="object"?!1:typeof HTMLElement<"u"&&he instanceof HTMLElement?!0:typeof he.nodeName=="string"&&typeof he.getAttribute=="function"}function tt(he,_e){if(he.length>_e.maxStringLength){var ve=he.length-_e.maxStringLength,Ie="... "+ve+" more character"+(ve>1?"s":"");return tt(E.call(he,0,_e.maxStringLength),_e)+Ie}var K=_.call(_.call(he,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,it);return U(K,"single",_e)}function it(he){var _e=he.charCodeAt(0),ve={8:"b",9:"t",10:"n",12:"f",13:"r"}[_e];return ve?"\\"+ve:"\\x"+(_e<16?"0":"")+S.call(_e.toString(16))}function T(he){return"Object("+he+")"}function m(he){return he+" { ? }"}function p(he,_e,ve,Ie){var K=Ie?D(ve,Ie):q.call(ve,", ");return he+" ("+_e+") {"+K+"}"}function R(he){for(var _e=0;_e<he.length;_e++)if(be(he[_e],`
75
+ `)>=0)return!1;return!0}function J(he,_e){var ve;if(he.indent===" ")ve=" ";else if(typeof he.indent=="number"&&he.indent>0)ve=q.call(Array(he.indent+1)," ");else return null;return{base:ve,prev:q.call(Array(_e+1),ve)}}function D(he,_e){if(he.length===0)return"";var ve=`
76
+ `+_e.prev+_e.base;return ve+q.call(he,","+ve)+`
77
+ `+_e.prev}function le(he,_e){var ve=ee(he),Ie=[];if(ve){Ie.length=he.length;for(var K=0;K<he.length;K++)Ie[K]=oe(he,K)?_e(he[K],he):""}var Fe=typeof L=="function"?L(he):[],nt;if(X){nt={};for(var k=0;k<Fe.length;k++)nt["$"+Fe[k]]=Fe[k]}for(var Pe in he)oe(he,Pe)&&(ve&&String(Number(Pe))===Pe&&Pe<he.length||X&&nt["$"+Pe]instanceof Symbol||(M.call(/[^\w$]/,Pe)?Ie.push(_e(Pe,he)+": "+_e(he[Pe],he)):Ie.push(Pe+": "+_e(he[Pe],he))));if(typeof L=="function")for(var je=0;je<Fe.length;je++)re.call(he,Fe[je])&&Ie.push("["+_e(Fe[je])+"]: "+_e(he[Fe[je]],he));return Ie}return g_}function S$(){if(kN)return y_;kN=!0;var r=gc(),e=xg(),t=x$(),n=Rh(),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),d=function(w,b){for(var E=w,_;(_=E.next)!==null;E=_)if(_.key===b)return E.next=_.next,_.next=w.next,w.next=_,_},g=function(w,b){var E=d(w,b);return E&&E.value},y=function(w,b,E){var _=d(w,b);_?_.value=E:w.next={key:b,next:w.next,value:E}},v=function(w,b){return!!d(w,b)};return y_=function(){var b,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(b)return s(b,A)}else if(o){if(E)return c(E,A)}else if(_)return g(_,A)},has:function(A){if(i&&A&&(typeof A=="object"||typeof A=="function")){if(b)return u(b,A)}else if(o){if(E)return h(E,A)}else if(_)return v(_,A);return!1},set:function(A,M){i&&A&&(typeof A=="object"||typeof A=="function")?(b||(b=new i),a(b,A,M)):o?(E||(E=new o),f(E,A,M)):(_||(_={key:{},next:null}),y(_,A,M))}};return S},y_}function x_(){if(NN)return b_;NN=!0;var r=String.prototype.replace,e=/%20/g,t={RFC1738:"RFC1738",RFC3986:"RFC3986"};return b_={default:t.RFC3986,formatters:{RFC1738:function(n){return r.call(n,e,"+")},RFC3986:function(n){return String(n)}},RFC1738:t.RFC1738,RFC3986:t.RFC3986},b_}function BN(){if(ON)return w_;ON=!0;var r=x_(),e=Object.prototype.hasOwnProperty,t=Array.isArray,n=(function(){for(var w=[],b=0;b<256;++b)w.push("%"+((b<16?"0":"")+b.toString(16)).toUpperCase());return w})(),i=function(b){for(;b.length>1;){var E=b.pop(),_=E.obj[E.prop];if(t(_)){for(var S=[],A=0;A<_.length;++A)typeof _[A]<"u"&&S.push(_[A]);E.obj[E.prop]=S}}},o=function(b,E){for(var _=E&&E.plainObjects?Object.create(null):{},S=0;S<b.length;++S)typeof b[S]<"u"&&(_[S]=b[S]);return _},s=function w(b,E,_){if(!E)return b;if(typeof E!="object"){if(t(b))b.push(E);else if(b&&typeof b=="object")(_&&(_.plainObjects||_.allowPrototypes)||!e.call(Object.prototype,E))&&(b[E]=!0);else return[b,E];return b}if(!b||typeof b!="object")return[b].concat(E);var S=b;return t(b)&&!t(E)&&(S=o(b,_)),t(b)&&t(E)?(E.forEach(function(A,M){if(e.call(b,M)){var I=b[M];I&&typeof I=="object"&&A&&typeof A=="object"?b[M]=w(I,A,_):b.push(A)}else b[M]=A}),b):Object.keys(E).reduce(function(A,M){var I=E[M];return e.call(A,M)?A[M]=w(A[M],I,_):A[M]=I,A},S)},a=function(b,E){return Object.keys(E).reduce(function(_,S){return _[S]=E[S],_},b)},u=function(w,b,E){var _=w.replace(/\+/g," ");if(E==="iso-8859-1")return _.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(_)}catch{return _}},c=1024,f=function(b,E,_,S,A){if(b.length===0)return b;var M=b;if(typeof b=="symbol"?M=Symbol.prototype.toString.call(b):typeof b!="string"&&(M=String(b)),_==="iso-8859-1")return escape(M).replace(/%u[0-9a-f]{4}/gi,function($){return"%26%23"+parseInt($.slice(2),16)+"%3B"});for(var I="",q=0;q<M.length;q+=c){for(var Q=M.length>=c?M.slice(q,q+c):M,Z=[],ne=0;ne<Q.length;++ne){var L=Q.charCodeAt(ne);if(L===45||L===46||L===95||L===126||L>=48&&L<=57||L>=65&&L<=90||L>=97&&L<=122||A===r.RFC1738&&(L===40||L===41)){Z[Z.length]=Q.charAt(ne);continue}if(L<128){Z[Z.length]=n[L];continue}if(L<2048){Z[Z.length]=n[192|L>>6]+n[128|L&63];continue}if(L<55296||L>=57344){Z[Z.length]=n[224|L>>12]+n[128|L>>6&63]+n[128|L&63];continue}ne+=1,L=65536+((L&1023)<<10|Q.charCodeAt(ne)&1023),Z[Z.length]=n[240|L>>18]+n[128|L>>12&63]+n[128|L>>6&63]+n[128|L&63]}I+=Z.join("")}return I},h=function(b){for(var E=[{obj:{o:b},prop:"o"}],_=[],S=0;S<E.length;++S)for(var A=E[S],M=A.obj[A.prop],I=Object.keys(M),q=0;q<I.length;++q){var Q=I[q],Z=M[Q];typeof Z=="object"&&Z!==null&&_.indexOf(Z)===-1&&(E.push({obj:M,prop:Q}),_.push(Z))}return i(E),b},d=function(b){return Object.prototype.toString.call(b)==="[object RegExp]"},g=function(b){return!b||typeof b!="object"?!1:!!(b.constructor&&b.constructor.isBuffer&&b.constructor.isBuffer(b))},y=function(b,E){return[].concat(b,E)},v=function(b,E){if(t(b)){for(var _=[],S=0;S<b.length;S+=1)_.push(E(b[S]));return _}return E(b)};return w_={arrayToObject:o,assign:a,combine:y,compact:h,decode:u,encode:f,isBuffer:g,isRegExp:d,maybeMap:v,merge:s},w_}function T$(){if(LN)return v_;LN=!0;var r=S$(),e=BN(),t=x_(),n=Object.prototype.hasOwnProperty,i={brackets:function(w){return w+"[]"},comma:"comma",indices:function(w,b){return w+"["+b+"]"},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"},d={},g=function v(w,b,E,_,S,A,M,I,q,Q,Z,ne,L,$,X,ie,re,O){for(var x=w,P=O,C=0,j=!1;(P=P.get(d))!==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(d)>"u"&&(C=0)}if(typeof Q=="function"?x=Q(b,x):x instanceof Date?x=L(x):E==="comma"&&o(x)&&(x=e.maybeMap(x,function(ge){return ge instanceof Date?L(ge):ge})),x===null){if(A)return q&&!ie?q(b,f.encoder,re,"key",$):b;x=""}if(h(x)||e.isBuffer(x)){if(q){var B=ie?b:q(b,f.encoder,re,"key",$);return[X(B)+"="+X(q(x,f.encoder,re,"value",$))]}return[X(b)+"="+X(String(x))]}var ee=[];if(typeof x>"u")return ee;var fe;if(E==="comma"&&o(x))ie&&q&&(x=e.maybeMap(x,q)),fe=[{value:x.length>0?x.join(",")||null:void 0}];else if(o(Q))fe=Q;else{var Ee=Object.keys(x);fe=Z?Ee.sort(Z):Ee}var te=I?b.replace(/\./g,"%2E"):b,H=_&&o(x)&&x.length===1?te+"[]":te;if(S&&o(x)&&x.length===0)return H+"[]";for(var ae=0;ae<fe.length;++ae){var we=fe[ae],xe=typeof we=="object"&&typeof we.value<"u"?we.value:x[we];if(!(M&&xe===null)){var V=ne&&I?we.replace(/\./g,"%2E"):we,F=o(x)?typeof E=="function"?E(H,V):H:H+(ne?"."+V:"["+V+"]");O.set(w,C);var oe=r();oe.set(d,O),a(ee,v(xe,F,E,_,S,A,M,I,E==="comma"&&ie&&o(x)?null:q,Q,Z,ne,L,$,X,ie,re,oe))}}return ee},y=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 b=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 E=t.default;if(typeof w.format<"u"){if(!n.call(t.formatters,w.format))throw new TypeError("Unknown format option provided.");E=w.format}var _=t.formatters[E],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 M=typeof w.allowDots>"u"?w.encodeDotInKeys===!0?!0:f.allowDots:!!w.allowDots;return{addQueryPrefix:typeof w.addQueryPrefix=="boolean"?w.addQueryPrefix:f.addQueryPrefix,allowDots:M,allowEmptyArrays:typeof w.allowEmptyArrays=="boolean"?!!w.allowEmptyArrays:f.allowEmptyArrays,arrayFormat:A,charset:b,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:E,formatter:_,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 v_=function(v,w){var b=v,E=y(w),_,S;typeof E.filter=="function"?(S=E.filter,b=S("",b)):o(E.filter)&&(S=E.filter,_=S);var A=[];if(typeof b!="object"||b===null)return"";var M=i[E.arrayFormat],I=M==="comma"&&E.commaRoundTrip;_||(_=Object.keys(b)),E.sort&&_.sort(E.sort);for(var q=r(),Q=0;Q<_.length;++Q){var Z=_[Q];E.skipNulls&&b[Z]===null||a(A,g(b[Z],Z,M,I,E.allowEmptyArrays,E.strictNullHandling,E.skipNulls,E.encodeDotInKeys,E.encode?E.encoder:null,E.filter,E.sort,E.allowDots,E.serializeDate,E.format,E.formatter,E.encodeValuesOnly,E.charset,q))}var ne=A.join(E.delimiter),L=E.addQueryPrefix===!0?"?":"";return E.charsetSentinel&&(E.charset==="iso-8859-1"?L+="utf8=%26%2310003%3B&":L+="utf8=%E2%9C%93&"),ne.length>0?L+ne:""},v_}function C$(){if(PN)return E_;PN=!0;var r=BN(),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(d){return d.replace(/&#(\d+);/g,function(g,y){return String.fromCharCode(parseInt(y,10))})},o=function(d,g){return d&&typeof d=="string"&&g.comma&&d.indexOf(",")>-1?d.split(","):d},s="utf8=%26%2310003%3B",a="utf8=%E2%9C%93",u=function(g,y){var v={__proto__:null},w=y.ignoreQueryPrefix?g.replace(/^\?/,""):g;w=w.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var b=y.parameterLimit===1/0?void 0:y.parameterLimit,E=w.split(y.delimiter,b),_=-1,S,A=y.charset;if(y.charsetSentinel)for(S=0;S<E.length;++S)E[S].indexOf("utf8=")===0&&(E[S]===a?A="utf-8":E[S]===s&&(A="iso-8859-1"),_=S,S=E.length);for(S=0;S<E.length;++S)if(S!==_){var M=E[S],I=M.indexOf("]="),q=I===-1?M.indexOf("="):I+1,Q,Z;q===-1?(Q=y.decoder(M,n.decoder,A,"key"),Z=y.strictNullHandling?null:""):(Q=y.decoder(M.slice(0,q),n.decoder,A,"key"),Z=r.maybeMap(o(M.slice(q+1),y),function(L){return y.decoder(L,n.decoder,A,"value")})),Z&&y.interpretNumericEntities&&A==="iso-8859-1"&&(Z=i(Z)),M.indexOf("[]=")>-1&&(Z=t(Z)?[Z]:Z);var ne=e.call(v,Q);ne&&y.duplicates==="combine"?v[Q]=r.combine(v[Q],Z):(!ne||y.duplicates==="last")&&(v[Q]=Z)}return v},c=function(d,g,y,v){for(var w=v?g:o(g,y),b=d.length-1;b>=0;--b){var E,_=d[b];if(_==="[]"&&y.parseArrays)E=y.allowEmptyArrays&&(w===""||y.strictNullHandling&&w===null)?[]:[].concat(w);else{E=y.plainObjects?Object.create(null):{};var S=_.charAt(0)==="["&&_.charAt(_.length-1)==="]"?_.slice(1,-1):_,A=y.decodeDotInKeys?S.replace(/%2E/g,"."):S,M=parseInt(A,10);!y.parseArrays&&A===""?E={0:w}:!isNaN(M)&&_!==A&&String(M)===A&&M>=0&&y.parseArrays&&M<=y.arrayLimit?(E=[],E[M]=w):A!=="__proto__"&&(E[A]=w)}w=E}return w},f=function(g,y,v,w){if(g){var b=v.allowDots?g.replace(/\.([^.[]+)/g,"[$1]"):g,E=/(\[[^[\]]*])/,_=/(\[[^[\]]*])/g,S=v.depth>0&&E.exec(b),A=S?b.slice(0,S.index):b,M=[];if(A){if(!v.plainObjects&&e.call(Object.prototype,A)&&!v.allowPrototypes)return;M.push(A)}for(var I=0;v.depth>0&&(S=_.exec(b))!==null&&I<v.depth;){if(I+=1,!v.plainObjects&&e.call(Object.prototype,S[1].slice(1,-1))&&!v.allowPrototypes)return;M.push(S[1])}if(S){if(v.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+v.depth+" and strictDepth is true");M.push("["+b.slice(S.index)+"]")}return c(M,y,v,w)}},h=function(g){if(!g)return n;if(typeof g.allowEmptyArrays<"u"&&typeof g.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof g.decodeDotInKeys<"u"&&typeof g.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(g.decoder!==null&&typeof g.decoder<"u"&&typeof g.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof g.charset<"u"&&g.charset!=="utf-8"&&g.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var y=typeof g.charset>"u"?n.charset:g.charset,v=typeof g.duplicates>"u"?n.duplicates:g.duplicates;if(v!=="combine"&&v!=="first"&&v!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var w=typeof g.allowDots>"u"?g.decodeDotInKeys===!0?!0:n.allowDots:!!g.allowDots;return{allowDots:w,allowEmptyArrays:typeof g.allowEmptyArrays=="boolean"?!!g.allowEmptyArrays:n.allowEmptyArrays,allowPrototypes:typeof g.allowPrototypes=="boolean"?g.allowPrototypes:n.allowPrototypes,allowSparse:typeof g.allowSparse=="boolean"?g.allowSparse:n.allowSparse,arrayLimit:typeof g.arrayLimit=="number"?g.arrayLimit:n.arrayLimit,charset:y,charsetSentinel:typeof g.charsetSentinel=="boolean"?g.charsetSentinel:n.charsetSentinel,comma:typeof g.comma=="boolean"?g.comma:n.comma,decodeDotInKeys:typeof g.decodeDotInKeys=="boolean"?g.decodeDotInKeys:n.decodeDotInKeys,decoder:typeof g.decoder=="function"?g.decoder:n.decoder,delimiter:typeof g.delimiter=="string"||r.isRegExp(g.delimiter)?g.delimiter:n.delimiter,depth:typeof g.depth=="number"||g.depth===!1?+g.depth:n.depth,duplicates:v,ignoreQueryPrefix:g.ignoreQueryPrefix===!0,interpretNumericEntities:typeof g.interpretNumericEntities=="boolean"?g.interpretNumericEntities:n.interpretNumericEntities,parameterLimit:typeof g.parameterLimit=="number"?g.parameterLimit:n.parameterLimit,parseArrays:g.parseArrays!==!1,plainObjects:typeof g.plainObjects=="boolean"?g.plainObjects:n.plainObjects,strictDepth:typeof g.strictDepth=="boolean"?!!g.strictDepth:n.strictDepth,strictNullHandling:typeof g.strictNullHandling=="boolean"?g.strictNullHandling:n.strictNullHandling}};return E_=function(d,g){var y=h(g);if(d===""||d===null||typeof d>"u")return y.plainObjects?Object.create(null):{};for(var v=typeof d=="string"?u(d,y):d,w=y.plainObjects?Object.create(null):{},b=Object.keys(v),E=0;E<b.length;++E){var _=b[E],S=f(_,v[_],y,typeof d=="string");w=r.merge(w,S,y)}return y.allowSparse===!0?w:r.compact(w)},E_}function R$(){if(FN)return __;FN=!0;var r=T$(),e=C$(),t=x_();return __={formats:t,parse:e,stringify:r},__}function D$(){if(MN)return mc;MN=!0;var r=Fl;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}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},y={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=R$();function b(A,M,I){if(A&&typeof A=="object"&&A instanceof e)return A;var q=new e;return q.parse(A,M,I),q}e.prototype.parse=function(A,M,I){if(typeof A!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof A);var q=A.indexOf("?"),Q=q!==-1&&q<A.indexOf("#")?"?":"#",Z=A.split(Q),ne=/\\/g;Z[0]=Z[0].replace(ne,"/"),A=Z.join(Q);var L=A;if(L=L.trim(),!I&&A.split("#").length===1){var $=i.exec(L);if($)return this.path=L,this.href=L,this.pathname=$[1],$[2]?(this.search=$[2],M?this.query=w.parse(this.search.substr(1)):this.query=this.search.substr(1)):M&&(this.search="",this.query={}),this}var X=t.exec(L);if(X){X=X[0];var ie=X.toLowerCase();this.protocol=ie,L=L.substr(X.length)}if(I||X||L.match(/^\/\/[^@/]+@[^@/]+/)){var re=L.substr(0,2)==="//";re&&!(X&&y[X])&&(L=L.substr(2),this.slashes=!0)}if(!y[X]&&(re||X&&!v[X])){for(var O=-1,x=0;x<c.length;x++){var P=L.indexOf(c[x]);P!==-1&&(O===-1||P<O)&&(O=P)}var C,j;O===-1?j=L.lastIndexOf("@"):j=L.lastIndexOf("@",O),j!==-1&&(C=L.slice(0,j),L=L.slice(j+1),this.auth=decodeURIComponent(C)),O=-1;for(var x=0;x<u.length;x++){var P=L.indexOf(u[x]);P!==-1&&(O===-1||P<O)&&(O=P)}O===-1&&(O=L.length),this.host=L.slice(0,O),L=L.slice(O),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,ee=B.length;x<ee;x++){var fe=B[x];if(fe&&!fe.match(h)){for(var Ee="",te=0,H=fe.length;te<H;te++)fe.charCodeAt(te)>127?Ee+="x":Ee+=fe[te];if(!Ee.match(h)){var ae=B.slice(0,x),we=B.slice(x+1),xe=fe.match(d);xe&&(ae.push(xe[1]),we.unshift(xe[2])),we.length&&(L="/"+we.join(".")+L),this.hostname=ae.join(".");break}}}this.hostname.length>f?this.hostname="":this.hostname=this.hostname.toLowerCase(),U||(this.hostname=r.toASCII(this.hostname));var V=this.port?":"+this.port:"",F=this.hostname||"";this.host=F+V,this.href+=this.host,U&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),L[0]!=="/"&&(L="/"+L))}if(!g[ie])for(var x=0,ee=a.length;x<ee;x++){var oe=a[x];if(L.indexOf(oe)!==-1){var ge=encodeURIComponent(oe);ge===oe&&(ge=escape(oe)),L=L.split(oe).join(ge)}}var Re=L.indexOf("#");Re!==-1&&(this.hash=L.substr(Re),L=L.slice(0,Re));var be=L.indexOf("?");if(be!==-1?(this.search=L.substr(be),this.query=L.substr(be+1),M&&(this.query=w.parse(this.query)),L=L.slice(0,be)):M&&(this.search="",this.query={}),L&&(this.pathname=L),v[ie]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var V=this.pathname||"",pe=this.search||"";this.path=V+pe}return this.href=this.format(),this};function E(A){return typeof A=="string"&&(A=b(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 M=this.protocol||"",I=this.pathname||"",q=this.hash||"",Q=!1,Z="";this.host?Q=A+this.host:this.hostname&&(Q=A+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(Q+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(Z=w.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var ne=this.search||Z&&"?"+Z||"";return M&&M.substr(-1)!==":"&&(M+=":"),this.slashes||(!M||v[M])&&Q!==!1?(Q="//"+(Q||""),I&&I.charAt(0)!=="/"&&(I="/"+I)):Q||(Q=""),q&&q.charAt(0)!=="#"&&(q="#"+q),ne&&ne.charAt(0)!=="?"&&(ne="?"+ne),I=I.replace(/[?#]/g,function(L){return encodeURIComponent(L)}),ne=ne.replace("#","%23"),M+Q+I+ne+q};function _(A,M){return b(A,!1,!0).resolve(M)}e.prototype.resolve=function(A){return this.resolveObject(b(A,!1,!0)).format()};function S(A,M){return A?b(A,!1,!0).resolveObject(M):M}return e.prototype.resolveObject=function(A){if(typeof A=="string"){var M=new e;M.parse(A,!1,!0),A=M}for(var I=new e,q=Object.keys(this),Q=0;Q<q.length;Q++){var Z=q[Q];I[Z]=this[Z]}if(I.hash=A.hash,A.href==="")return I.href=I.format(),I;if(A.slashes&&!A.protocol){for(var ne=Object.keys(A),L=0;L<ne.length;L++){var $=ne[L];$!=="protocol"&&(I[$]=A[$])}return v[I.protocol]&&I.hostname&&!I.pathname&&(I.pathname="/",I.path=I.pathname),I.href=I.format(),I}if(A.protocol&&A.protocol!==I.protocol){if(!v[A.protocol]){for(var X=Object.keys(A),ie=0;ie<X.length;ie++){var re=X[ie];I[re]=A[re]}return I.href=I.format(),I}if(I.protocol=A.protocol,!A.host&&!y[A.protocol]){for(var ee=(A.pathname||"").split("/");ee.length&&!(A.host=ee.shift()););A.host||(A.host=""),A.hostname||(A.hostname=""),ee[0]!==""&&ee.unshift(""),ee.length<2&&ee.unshift(""),I.pathname=ee.join("/")}else I.pathname=A.pathname;if(I.search=A.search,I.query=A.query,I.host=A.host||"",I.auth=A.auth,I.hostname=A.hostname||A.host,I.port=A.port,I.pathname||I.search){var O=I.pathname||"",x=I.search||"";I.path=O+x}return I.slashes=I.slashes||A.slashes,I.href=I.format(),I}var P=I.pathname&&I.pathname.charAt(0)==="/",C=A.host||A.pathname&&A.pathname.charAt(0)==="/",j=C||P||I.host&&A.pathname,U=j,B=I.pathname&&I.pathname.split("/")||[],ee=A.pathname&&A.pathname.split("/")||[],fe=I.protocol&&!v[I.protocol];if(fe&&(I.hostname="",I.port=null,I.host&&(B[0]===""?B[0]=I.host:B.unshift(I.host)),I.host="",A.protocol&&(A.hostname=null,A.port=null,A.host&&(ee[0]===""?ee[0]=A.host:ee.unshift(A.host)),A.host=null),j=j&&(ee[0]===""||B[0]==="")),C)I.host=A.host||A.host===""?A.host:I.host,I.hostname=A.hostname||A.hostname===""?A.hostname:I.hostname,I.search=A.search,I.query=A.query,B=ee;else if(ee.length)B||(B=[]),B.pop(),B=B.concat(ee),I.search=A.search,I.query=A.query;else if(A.search!=null){if(fe){I.host=B.shift(),I.hostname=I.host;var Ee=I.host&&I.host.indexOf("@")>0?I.host.split("@"):!1;Ee&&(I.auth=Ee.shift(),I.hostname=Ee.shift(),I.host=I.hostname)}return I.search=A.search,I.query=A.query,(I.pathname!==null||I.search!==null)&&(I.path=(I.pathname?I.pathname:"")+(I.search?I.search:"")),I.href=I.format(),I}if(!B.length)return I.pathname=null,I.search?I.path="/"+I.search:I.path=null,I.href=I.format(),I;for(var te=B.slice(-1)[0],H=(I.host||A.host||B.length>1)&&(te==="."||te==="..")||te==="",ae=0,we=B.length;we>=0;we--)te=B[we],te==="."?B.splice(we,1):te===".."?(B.splice(we,1),ae++):ae&&(B.splice(we,1),ae--);if(!j&&!U)for(;ae--;ae)B.unshift("..");j&&B[0]!==""&&(!B[0]||B[0].charAt(0)!=="/")&&B.unshift(""),H&&B.join("/").substr(-1)!=="/"&&B.push("");var xe=B[0]===""||B[0]&&B[0].charAt(0)==="/";if(fe){I.hostname=xe?"":B.length?B.shift():"",I.host=I.hostname;var Ee=I.host&&I.host.indexOf("@")>0?I.host.split("@"):!1;Ee&&(I.auth=Ee.shift(),I.hostname=Ee.shift(),I.host=I.hostname)}return j=j||I.host&&B.length,j&&!xe&&B.unshift(""),B.length>0?I.pathname=B.join("/"):(I.pathname=null,I.path=null),(I.pathname!==null||I.search!==null)&&(I.path=(I.pathname?I.pathname:"")+(I.search?I.search:"")),I.auth=A.auth||I.auth,I.slashes=I.slashes||A.slashes,I.href=I.format(),I},e.prototype.parseHost=function(){var A=this.host,M=n.exec(A);M&&(M=M[0],M!==":"&&(this.port=M.substr(1)),A=A.substr(0,A.length-M.length)),A&&(this.hostname=A)},mc.parse=b,mc.resolve=_,mc.resolveObject=S,mc.format=E,mc.Url=e,mc}function S_(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 A_?$$(r):z$(r)}function $$(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(P$,"\\"),t=decodeURIComponent(t),e!=="")return`\\\\${e}${t}`;{let n=t.codePointAt(1)|32,i=t[2];if(n<O$||n>L$||i!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return t.slice(1)}}function z$(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 W$(r){let e=d_.resolve(r),t=r.charCodeAt(r.length-1);(t===N$||A_&&t===k$)&&e[e.length-1]!==d_.sep&&(e+="/");let n=new URL("file://");return e.includes("%")&&(e=e.replace(F$,"%25")),!A_&&e.includes("\\")&&(e=e.replace(M$,"%5C")),e.includes(`
79
+ `)&&(e=e.replace(B$,"%0A")),e.includes("\r")&&(e=e.replace(U$,"%0D")),e.includes(" ")&&(e=e.replace(j$,"%09")),n.pathname=e,n}var A$,g_,IN,m_,y_,kN,b_,NN,w_,ON,v_,LN,E_,PN,__,FN,mc,MN,hi,I$,cJ,fJ,hJ,dJ,pJ,gJ,k$,N$,O$,L$,A_,P$,F$,M$,B$,U$,j$,UN=bt(()=>{Se();Ce();Te();$2();Sg();p_();lc();A$=Object.freeze(Object.create(null)),g_={},IN=!1,m_=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;y_={},kN=!1;b_={},NN=!1;w_={},ON=!1;v_={},LN=!1;E_={},PN=!1;__={},FN=!1;mc={},MN=!1;hi=D$();hi.parse;hi.resolve;hi.resolveObject;hi.format;hi.Url;I$=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;hi.URL=typeof URL<"u"?URL:null;hi.pathToFileURL=W$;hi.fileURLToPath=S_;cJ=hi.Url,fJ=hi.format,hJ=hi.resolve,dJ=hi.resolveObject,pJ=hi.parse,gJ=hi.URL,k$=92,N$=47,O$=97,L$=122,A_=I$==="win32",P$=/\//g,F$=/%/g,M$=/\\/g,B$=/\n/g,U$=/\r/g,j$=/\t/g});var nw={};go(nw,{Dir:()=>kz,Dirent:()=>Nz,F_OK:()=>Uz,FileReadStream:()=>Fz,FileWriteStream:()=>Mz,R_OK:()=>jz,ReadStream:()=>Lz,Stats:()=>Oz,W_OK:()=>$z,WriteStream:()=>Pz,X_OK:()=>zz,_toUnixTimestamp:()=>Bz,access:()=>o9,accessSync:()=>a9,appendFile:()=>i9,appendFileSync:()=>s9,chmod:()=>c9,chmodSync:()=>f9,chown:()=>l9,chownSync:()=>u9,close:()=>h9,closeSync:()=>d9,constants:()=>Wz,copyFile:()=>p9,copyFileSync:()=>g9,cp:()=>m9,cpSync:()=>y9,createReadStream:()=>b9,createWriteStream:()=>w9,default:()=>vr,exists:()=>v9,existsSync:()=>rw,fchmod:()=>A9,fchmodSync:()=>x9,fchown:()=>E9,fchownSync:()=>_9,fdatasync:()=>S9,fdatasyncSync:()=>T9,fstat:()=>C9,fstatSync:()=>R9,fsync:()=>D9,fsyncSync:()=>I9,ftruncate:()=>k9,ftruncateSync:()=>N9,futimes:()=>O9,futimesSync:()=>L9,lchmod:()=>M9,lchmodSync:()=>B9,lchown:()=>P9,lchownSync:()=>F9,link:()=>U9,linkSync:()=>j9,lstat:()=>$9,lstatSync:()=>D_,mkdir:()=>z9,mkdirSync:()=>W9,mkdtemp:()=>H9,mkdtempSync:()=>q9,open:()=>G9,openSync:()=>V9,opendir:()=>X9,opendirSync:()=>Y9,promises:()=>Hz,read:()=>J9,readFile:()=>rz,readFileSync:()=>I_,readSync:()=>Q9,readdir:()=>Z9,readdirSync:()=>K9,readlink:()=>nz,readlinkSync:()=>iz,readv:()=>ez,readvSync:()=>tz,realpath:()=>sz,realpathSync:()=>oz,rename:()=>az,renameSync:()=>lz,rm:()=>uz,rmSync:()=>cz,rmdir:()=>fz,rmdirSync:()=>hz,stat:()=>dz,statSync:()=>pz,symlink:()=>gz,symlinkSync:()=>mz,truncate:()=>yz,truncateSync:()=>bz,unlink:()=>vz,unlinkSync:()=>Ez,unwatchFile:()=>wz,utimes:()=>_z,utimesSync:()=>Az,watch:()=>xz,watchFile:()=>Sz,write:()=>Cz,writeFile:()=>Tz,writeFileSync:()=>cO,writeSync:()=>Rz,writev:()=>Dz,writevSync:()=>Iz});function Rg(){return jN||(jN=!0,Object.defineProperty(Tg,"__esModule",{value:!0}),Tg.constants=void 0,Tg.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}),Tg}function H$(){return $N||($N=!0,typeof BigInt=="function"?Qb.default=BigInt:Qb.default=function(){throw new Error("BigInt is not supported in this environment.")}),Qb}function T_(){if(zN)return Dh;zN=!0,Object.defineProperty(Dh,"__esModule",{value:!0}),Dh.Stats=void 0;var r=Rg(),e=H$(),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(d,g){g===void 0&&(g=!1);var y=new h,v=d.uid,w=d.gid,b=d.atime,E=d.mtime,_=d.ctime,S=g?e.default:function(M){return M};y.uid=S(v),y.gid=S(w),y.rdev=S(0),y.blksize=S(4096),y.ino=S(d.ino),y.size=S(d.getSize()),y.blocks=S(1),y.atime=b,y.mtime=E,y.ctime=_,y.birthtime=_,y.atimeMs=S(b.getTime()),y.mtimeMs=S(E.getTime());var A=S(_.getTime());return y.ctimeMs=A,y.birthtimeMs=A,y.dev=S(0),y.mode=S(d.mode),y.nlink=S(d.nlink),y},h.prototype._checkModeProperty=function(d){return(Number(this.mode)&t)===d},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 Dh.Stats=f,Dh.default=f,Dh}function C_(){if(WN)return Hs;WN=!0;var r=Hs&&Hs.__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(Hs,"__esModule",{value:!0}),Hs.bufferFrom=Hs.bufferAllocUnsafe=Hs.Buffer=void 0;var e=yn();Object.defineProperty(Hs,"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;Hs.bufferAllocUnsafe=n;var i=e.Buffer.from||t;return Hs.bufferFrom=i,Hs}function nO(){if(HN)return fn;HN=!0;var r=fn&&fn.__extends||(function(){var y=function(v,w){return y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,E){b.__proto__=E}||function(b,E){for(var _ in E)Object.prototype.hasOwnProperty.call(E,_)&&(b[_]=E[_])},y(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");y(v,w);function b(){this.constructor=v}v.prototype=w===null?Object.create(w):(b.prototype=w.prototype,new b)}})();Object.defineProperty(fn,"__esModule",{value:!0}),fn.E=fn.AssertionError=fn.message=fn.RangeError=fn.TypeError=fn.Error=void 0;var e=mt,t=qe,n=typeof Symbol>"u"?"_kCode":Symbol("code"),i={};function o(y){return(function(v){r(w,v);function w(b){for(var E=[],_=1;_<arguments.length;_++)E[_-1]=arguments[_];var S=v.call(this,u(b,E))||this;return S.code=b,S[n]=b,S.name="".concat(v.prototype.name," [").concat(S[n],"]"),S}return w})(y)}var s=typeof globalThis<"u"?globalThis:q$,a=(function(y){r(v,y);function v(w){var b=this;if(typeof w!="object"||w===null)throw new fn.TypeError("ERR_INVALID_ARG_TYPE","options","object");return w.message?b=y.call(this,w.message)||this:b=y.call(this,"".concat(t.inspect(w.actual).slice(0,128)," ")+"".concat(w.operator," ").concat(t.inspect(w.expected).slice(0,128)))||this,b.generatedMessage=!w.message,b.name="AssertionError [ERR_ASSERTION]",b.code="ERR_ASSERTION",b.actual=w.actual,b.expected=w.expected,b.operator=w.operator,fn.Error.captureStackTrace(b,w.stackStartFunction),b}return v})(s.Error);fn.AssertionError=a;function u(y,v){e.strictEqual(typeof y,"string");var w=i[y];e(w,"An invalid error message key was used: ".concat(y,"."));var b;if(typeof w=="function")b=w;else{if(b=t.format,v===void 0||v.length===0)return w;v.unshift(w)}return String(b.apply(null,v))}fn.message=u;function c(y,v){i[y]=typeof v=="function"?v:String(v)}fn.E=c,fn.Error=o(s.Error),fn.TypeError=o(s.TypeError),fn.RangeError=o(s.RangeError),c("ERR_ARG_NOT_ITERABLE","%s must be iterable"),c("ERR_ASSERTION","%s"),c("ERR_BUFFER_OUT_OF_BOUNDS",g),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(y,v){return'c-ares failed to set servers: "'.concat(y,'" [').concat(v,"]")}),c("ERR_FALSY_VALUE_REJECTION","Promise was rejected with falsy value"),c("ERR_ENCODING_NOT_SUPPORTED",function(y){return'The "'.concat(y,'" encoding is not supported')}),c("ERR_ENCODING_INVALID_ENCODED_DATA",function(y){return"The encoded data was not valid for encoding ".concat(y)}),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(y,v,w){return e.strictEqual(typeof w,"number"),'The array "'.concat(y,'" (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(y,v){return'The value "'.concat(String(v),'" is invalid for option "').concat(y,'"')}),c("ERR_INVALID_OPT_VALUE_ENCODING",function(y){return'The value "'.concat(String(y),'" 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(y){return"The URL must be ".concat(d(y,"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(y){return"DH parameter size ".concat(y," 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(y,v,w){e(y,"name is required");var b;v.includes("not ")?(b="must not be",v=v.split("not ")[1]):b="must be";var E;if(Array.isArray(y)){var _=y.map(function(A){return'"'.concat(A,'"')}).join(", ");E="The ".concat(_," arguments ").concat(b," ").concat(d(v,"type"))}else if(y.includes(" argument"))E="The ".concat(y," ").concat(b," ").concat(d(v,"type"));else{var S=y.includes(".")?"property":"argument";E='The "'.concat(y,'" ').concat(S," ").concat(b," ").concat(d(v,"type"))}return arguments.length>=3&&(E+=". Received type ".concat(w!==null?typeof w:"null")),E}function h(){for(var y=[],v=0;v<arguments.length;v++)y[v]=arguments[v];e(y.length>0,"At least one arg needs to be specified");var w="The ",b=y.length;switch(y=y.map(function(E){return'"'.concat(E,'"')}),b){case 1:w+="".concat(y[0]," argument");break;case 2:w+="".concat(y[0]," and ").concat(y[1]," arguments");break;default:w+=y.slice(0,b-1).join(", "),w+=", and ".concat(y[b-1]," arguments");break}return"".concat(w," must be specified")}function d(y,v){if(e(y,"expected is required"),e(typeof v=="string","thing is required"),Array.isArray(y)){var w=y.length;return e(w>0,"At least one expected value needs to be specified"),y=y.map(function(b){return String(b)}),w>2?"one of ".concat(v," ").concat(y.slice(0,w-1).join(", "),", or ")+y[w-1]:w===2?"one of ".concat(v," ").concat(y[0]," or ").concat(y[1]):"of ".concat(v," ").concat(y[0])}else return"of ".concat(v," ").concat(String(y))}function g(y,v){return v?"Attempt to write outside buffer bounds":'"'.concat(y,'" is outside of buffer bounds')}return fn}function iO(){if(qN)return vo;qN=!0,Object.defineProperty(vo,"__esModule",{value:!0}),vo.strToEncoding=vo.assertEncoding=vo.ENCODING_UTF8=void 0;var r=C_(),e=nO();vo.ENCODING_UTF8="utf8";function t(i){if(i&&!r.Buffer.isEncoding(i))throw new e.TypeError("ERR_INVALID_OPT_VALUE_ENCODING",i)}vo.assertEncoding=t;function n(i,o){return!o||o===vo.ENCODING_UTF8?i:o==="buffer"?new r.Buffer(i):new r.Buffer(i).toString(o)}return vo.strToEncoding=n,vo}function sO(){if(GN)return Ih;GN=!0,Object.defineProperty(Ih,"__esModule",{value:!0}),Ih.Dirent=void 0;var r=Rg(),e=iO(),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(d,g){var y=new h,v=d.getNode().mode;return y.name=(0,e.strToEncoding)(d.getName(),g),y.mode=v,y},h.prototype._checkModeProperty=function(d){return(this.mode&t)===d},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 Ih.Dirent=f,Ih.default=f,Ih}function oO(){if(VN)return ew;VN=!0;var r=Vr;Object.defineProperty(ew,"__esModule",{value:!0});var e;return typeof r.nextTick=="function"?e=r.nextTick.bind(typeof globalThis<"u"?globalThis:XN):e=setTimeout.bind(typeof globalThis<"u"?globalThis:XN),ew.default=e,ew}function aO(){if(YN)return kh;YN=!0;var r=Vr;Object.defineProperty(kh,"__esModule",{value:!0}),kh.createProcess=void 0;var e=function(){if(typeof r<"u")return r;try{return Vr}catch{return}};function t(){var n=e()||{};return n.cwd||(n.cwd=function(){return"/"}),n.nextTick||(n.nextTick=oO().default),n.emitWarning||(n.emitWarning=function(i,o){console.warn("".concat(o).concat(o?": ":"").concat(i))}),n.env||(n.env={}),n}return kh.createProcess=t,kh.default=t(),kh}function G$(){if(ZN)return di;ZN=!0;var r=di&&di.__extends||(function(){var w=function(b,E){return w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,S){_.__proto__=S}||function(_,S){for(var A in S)Object.prototype.hasOwnProperty.call(S,A)&&(_[A]=S[A])},w(b,E)};return function(b,E){if(typeof E!="function"&&E!==null)throw new TypeError("Class extends value "+String(E)+" is not a constructor or null");w(b,E);function _(){this.constructor=b}b.prototype=E===null?Object.create(E):(_.prototype=E.prototype,new _)}})();Object.defineProperty(di,"__esModule",{value:!0}),di.File=di.Link=di.Node=di.SEP=void 0;var e=aO(),t=C_(),n=Rg(),i=cn,o=T_(),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,b;return(b=(w=e.default.getuid)===null||w===void 0?void 0:w.call(e.default))!==null&&b!==void 0?b:0},d=function(){var w,b;return(b=(w=e.default.getgid)===null||w===void 0?void 0:w.call(e.default))!==null&&b!==void 0?b:0};di.SEP="/";var g=(function(w){r(b,w);function b(E,_){_===void 0&&(_=438);var S=w.call(this)||this;return S._uid=h(),S._gid=d(),S._atime=new Date,S._mtime=new Date,S._ctime=new Date,S._perm=438,S.mode=u,S._nlink=1,S._perm=_,S.mode|=_,S.ino=E,S}return Object.defineProperty(b.prototype,"ctime",{get:function(){return this._ctime},set:function(E){this._ctime=E},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"uid",{get:function(){return this._uid},set:function(E){this._uid=E,this.ctime=new Date},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"gid",{get:function(){return this._gid},set:function(E){this._gid=E,this.ctime=new Date},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"atime",{get:function(){return this._atime},set:function(E){this._atime=E,this.ctime=new Date},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"mtime",{get:function(){return this._mtime},set:function(E){this._mtime=E,this.ctime=new Date},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"perm",{get:function(){return this._perm},set:function(E){this._perm=E,this.ctime=new Date},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"nlink",{get:function(){return this._nlink},set:function(E){this._nlink=E,this.ctime=new Date},enumerable:!1,configurable:!0}),b.prototype.getString=function(E){return E===void 0&&(E="utf8"),this.atime=new Date,this.getBuffer().toString(E)},b.prototype.setString=function(E){this.buf=(0,t.bufferFrom)(E,"utf8"),this.touch()},b.prototype.getBuffer=function(){return this.atime=new Date,this.buf||this.setBuffer((0,t.bufferAllocUnsafe)(0)),(0,t.bufferFrom)(this.buf)},b.prototype.setBuffer=function(E){this.buf=(0,t.bufferFrom)(E),this.touch()},b.prototype.getSize=function(){return this.buf?this.buf.length:0},b.prototype.setModeProperty=function(E){this.mode=this.mode&~s|E},b.prototype.setIsFile=function(){this.setModeProperty(u)},b.prototype.setIsDirectory=function(){this.setModeProperty(a)},b.prototype.setIsSymlink=function(){this.setModeProperty(c)},b.prototype.isFile=function(){return(this.mode&s)===u},b.prototype.isDirectory=function(){return(this.mode&s)===a},b.prototype.isSymlink=function(){return(this.mode&s)===c},b.prototype.makeSymlink=function(E){this.symlink=E,this.setIsSymlink()},b.prototype.write=function(E,_,S,A){if(_===void 0&&(_=0),S===void 0&&(S=E.length),A===void 0&&(A=0),this.buf||(this.buf=(0,t.bufferAllocUnsafe)(0)),A+S>this.buf.length){var M=(0,t.bufferAllocUnsafe)(A+S);this.buf.copy(M,0,0,this.buf.length),this.buf=M}return E.copy(this.buf,A,_,_+S),this.touch(),S},b.prototype.read=function(E,_,S,A){_===void 0&&(_=0),S===void 0&&(S=E.byteLength),A===void 0&&(A=0),this.atime=new Date,this.buf||(this.buf=(0,t.bufferAllocUnsafe)(0));var M=S;return M>E.byteLength&&(M=E.byteLength),M+A>this.buf.length&&(M=this.buf.length-A),this.buf.copy(E,_,A,A+M),M},b.prototype.truncate=function(E){if(E===void 0&&(E=0),!E)this.buf=(0,t.bufferAllocUnsafe)(0);else if(this.buf||(this.buf=(0,t.bufferAllocUnsafe)(0)),E<=this.buf.length)this.buf=this.buf.slice(0,E);else{var _=(0,t.bufferAllocUnsafe)(E);this.buf.copy(_),_.fill(0,this.buf.length),this.buf=_}this.touch()},b.prototype.chmod=function(E){this.perm=E,this.mode=this.mode&-512|E,this.touch()},b.prototype.chown=function(E,_){this.uid=E,this.gid=_,this.touch()},b.prototype.touch=function(){this.mtime=new Date,this.emit("change",this)},b.prototype.canRead=function(E,_){return E===void 0&&(E=h()),_===void 0&&(_=d()),!!(this.perm&4||_===this.gid&&this.perm&32||E===this.uid&&this.perm&256)},b.prototype.canWrite=function(E,_){return E===void 0&&(E=h()),_===void 0&&(_=d()),!!(this.perm&2||_===this.gid&&this.perm&16||E===this.uid&&this.perm&128)},b.prototype.del=function(){this.emit("delete",this)},b.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()}},b})(i.EventEmitter);di.Node=g;var y=(function(w){r(b,w);function b(E,_,S){var A=w.call(this)||this;return A.children={},A._steps=[],A.ino=0,A.length=0,A.vol=E,A.parent=_,A.name=S,A.syncSteps(),A}return Object.defineProperty(b.prototype,"steps",{get:function(){return this._steps},set:function(E){this._steps=E;for(var _=0,S=Object.entries(this.children);_<S.length;_++){var A=S[_],M=A[0],I=A[1];M==="."||M===".."||I?.syncSteps()}},enumerable:!1,configurable:!0}),b.prototype.setNode=function(E){this.node=E,this.ino=E.ino},b.prototype.getNode=function(){return this.node},b.prototype.createChild=function(E,_){_===void 0&&(_=this.vol.createNode());var S=new b(this.vol,this,E);return S.setNode(_),_.isDirectory()&&(S.children["."]=S,S.getNode().nlink++),this.setChild(E,S),S},b.prototype.setChild=function(E,_){_===void 0&&(_=new b(this.vol,this,E)),this.children[E]=_,_.parent=this,this.length++;var S=_.getNode();return S.isDirectory()&&(_.children[".."]=this,this.getNode().nlink++),this.getNode().mtime=new Date,this.emit("child:add",_,this),_},b.prototype.deleteChild=function(E){var _=E.getNode();_.isDirectory()&&(delete E.children[".."],this.getNode().nlink--),delete this.children[E.getName()],this.length--,this.getNode().mtime=new Date,this.emit("child:delete",E,this)},b.prototype.getChild=function(E){if(this.getNode().mtime=new Date,Object.hasOwnProperty.call(this.children,E))return this.children[E]},b.prototype.getPath=function(){return this.steps.join(di.SEP)},b.prototype.getName=function(){return this.steps[this.steps.length-1]},b.prototype.walk=function(E,_,S){if(_===void 0&&(_=E.length),S===void 0&&(S=0),S>=E.length)return this;if(S>=_)return this;var A=E[S],M=this.getChild(A);return M?M.walk(E,_,S+1):null},b.prototype.toJSON=function(){return{steps:this.steps,ino:this.ino,children:Object.keys(this.children)}},b.prototype.syncSteps=function(){this.steps=this.parent?this.parent.steps.concat([this.name]):[this.name]},b})(i.EventEmitter);di.Link=y;var v=(function(){function w(b,E,_,S){this.position=0,this.link=b,this.node=E,this.flags=_,this.fd=S}return w.prototype.getString=function(b){return this.node.getString()},w.prototype.setString=function(b){this.node.setString(b)},w.prototype.getBuffer=function(){return this.node.getBuffer()},w.prototype.setBuffer=function(b){this.node.setBuffer(b)},w.prototype.getSize=function(){return this.node.getSize()},w.prototype.truncate=function(b){this.node.truncate(b)},w.prototype.seekTo=function(b){this.position=b},w.prototype.stats=function(){return o.default.build(this.node)},w.prototype.write=function(b,E,_,S){E===void 0&&(E=0),_===void 0&&(_=b.length),typeof S!="number"&&(S=this.position),this.flags&f&&(S=this.getSize());var A=this.node.write(b,E,_,S);return this.position=S+A,A},w.prototype.read=function(b,E,_,S){E===void 0&&(E=0),_===void 0&&(_=b.byteLength),typeof S!="number"&&(S=this.position);var A=this.node.read(b,E,_,S);return this.position=S+A,A},w.prototype.chmod=function(b){this.node.chmod(b)},w.prototype.chown=function(b,E){this.node.chown(b,E)},w})();return di.File=v,di}function X$(){if(KN)return tw;KN=!0,Object.defineProperty(tw,"__esModule",{value:!0});function r(e,t,n){var i=setTimeout.apply(typeof globalThis<"u"?globalThis:V$,arguments);return i&&typeof i=="object"&&typeof i.unref=="function"&&i.unref(),i}return tw.default=r,tw}function Y$(){if(JN)return Ml;JN=!0;var r=Ml&&Ml.__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(Ml,"__esModule",{value:!0}),Ml.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,d){return h?f(h):c(s(d))}],!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})();Ml.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 Ml.default=n,Ml}function Z$(){if(QN)return Cg;QN=!0;var r=Vr;Object.defineProperty(Cg,"__esModule",{value:!0}),Cg.correctPath=s,Cg.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 Cg}function lO(){if(eO)return Ut;eO=!0;var r=Ut&&Ut.__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=Ut&&Ut.__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(Ut,"__esModule",{value:!0}),Ut.FSWatcher=Ut.StatWatcher=Ut.Volume=Ut.toUnixTimestamp=Ut.bufferToEncoding=Ut.dataToBuffer=Ut.dataToStr=Ut.pathToSteps=Ut.filenameToSteps=Ut.pathToFilename=Ut.flagsToNumber=Ut.FLAGS=void 0;var t=un,n=G$(),i=T_(),o=sO(),s=C_(),a=oO(),u=aO(),c=X$(),f=fi,h=Rg(),d=cn,g=iO(),y=nO(),v=qe,w=Y$(),b=t.resolve,E=h.constants.O_RDONLY,_=h.constants.O_WRONLY,S=h.constants.O_RDWR,A=h.constants.O_CREAT,M=h.constants.O_EXCL,I=h.constants.O_TRUNC,q=h.constants.O_APPEND,Q=h.constants.O_SYNC,Z=h.constants.O_DIRECTORY,ne=h.constants.F_OK,L=h.constants.COPYFILE_EXCL,$=h.constants.COPYFILE_FICLONE_FORCE,X=t.posix?t.posix:t,ie=X.sep,re=X.relative,O=X.join,x=X.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",ee="EBADF",fe="EINVAL",Ee="EPERM",te="EPROTO",H="EEXIST",ae="ENOTDIR",we="EMFILE",xe="EACCES",V="EISDIR",F="ENOTEMPTY",oe="ENOSYS",ge="ERR_FS_EISDIR";function Re(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 ee:return"EBADF: bad file descriptor, ".concat(z).concat(ye);case fe:return"EINVAL: invalid argument, ".concat(z).concat(ye);case Ee:return"EPERM: operation not permitted, ".concat(z).concat(ye);case te:return"EPROTO: protocol error, ".concat(z).concat(ye);case H:return"EEXIST: file already exists, ".concat(z).concat(ye);case ae:return"ENOTDIR: not a directory, ".concat(z).concat(ye);case V:return"EISDIR: illegal operation on a directory, ".concat(z).concat(ye);case xe:return"EACCES: permission denied, ".concat(z).concat(ye);case F:return"ENOTEMPTY: directory not empty, ".concat(z).concat(ye);case we:return"EMFILE: too many open files, ".concat(z).concat(ye);case oe: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 be(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(Re(ce,z,G,se));return Ne.code=ce,G&&(Ne.path=G),Ne}var pe;(function(ce){ce[ce.r=E]="r",ce[ce["r+"]=S]="r+",ce[ce.rs=E|Q]="rs",ce[ce.sr=ce.rs]="sr",ce[ce["rs+"]=S|Q]="rs+",ce[ce["sr+"]=ce["rs+"]]="sr+",ce[ce.w=_|A|I]="w",ce[ce.wx=_|A|I|M]="wx",ce[ce.xw=ce.wx]="xw",ce[ce["w+"]=S|A|I]="w+",ce[ce["wx+"]=S|A|I|M]="wx+",ce[ce["xw+"]=ce["wx+"]]="xw+",ce[ce.a=_|q|A]="a",ce[ce.ax=_|q|A|M]="ax",ce[ce.xa=ce.ax]="xa",ce[ce["a+"]=S|q|A]="a+",ce[ce["ax+"]=S|q|A|M]="ax+",ce[ce["xa+"]=ce["ax+"]]="xa+"})(pe=Ut.FLAGS||(Ut.FLAGS={}));function Ae(ce){if(typeof ce=="number")return ce;if(typeof ce=="string"){var z=pe[ce];if(typeof z<"u")return z}throw new y.TypeError("ERR_INVALID_OPT_VALUE","flags",ce)}Ut.flagsToNumber=Ae;function ze(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,g.assertEncoding)(G.encoding),G}function Oe(ce){return function(z){return ze(ce,z)}}function ke(ce){if(typeof ce!="function")throw TypeError(j.CB);return ce}function Ke(ce){return function(z,G){return typeof z=="function"?[ce(),z]:[ce(z),ke(G)]}}var tt={encoding:"utf8"},it=Oe(tt),T=Ke(it),m={flag:"r"},p=Oe(m),R={encoding:"utf8",mode:438,flag:pe[pe.w]},J=Oe(R),D={encoding:"utf8",mode:438,flag:pe[pe.a]},le=Oe(D),he=Ke(le),_e=tt,ve=Oe(_e),Ie=Ke(ve),K={mode:511,recursive:!1},Fe=function(ce){return typeof ce=="number"?Object.assign({},K,{mode:ce}):Object.assign({},K,ce)},nt={recursive:!1},k=function(ce){return Object.assign({},nt,ce)},Pe=Oe(tt),je=Ke(Pe),de={encoding:"utf8",withFileTypes:!1},De=Oe(de),Me=Ke(De),ft={bigint:!1},ue=function(ce){return ce===void 0&&(ce={}),Object.assign({},ft,ce)},me=function(ce,z){return typeof ce=="function"?[ue(),ce]:[ue(ce),ke(z)]};function Ge(ce){if(ce.hostname!=="")throw new y.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 y.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 ir.URL))throw new TypeError(j.PATH_STR)}catch{throw new TypeError(j.PATH_STR)}ce=Ge(ce)}var z=String(ce);return Lr(z),z}Ut.pathToFilename=Ue;var et=function(ce,z){return z===void 0&&(z=u.default.cwd()),b(z,ce)};if(P){var gt=et,It=Z$().unixify;et=function(ce,z){return It(gt(ce,z))}}function xt(ce,z){var G=et(ce,z),se=G.substring(1);return se?se.split(ie):[]}Ut.filenameToSteps=xt;function hr(ce){return xt(Ue(ce))}Ut.pathToSteps=hr;function Oi(ce,z){return z===void 0&&(z=g.ENCODING_UTF8),s.Buffer.isBuffer(ce)?ce.toString(z):ce instanceof Uint8Array?(0,s.bufferFrom)(ce).toString(z):String(ce)}Ut.dataToStr=Oi;function Zn(ce,z){return z===void 0&&(z=g.ENCODING_UTF8),s.Buffer.isBuffer(ce)?ce:ce instanceof Uint8Array?(0,s.bufferFrom)(ce):(0,s.bufferFrom)(String(ce),z)}Ut.dataToBuffer=Zn;function Yt(ce,z){return!z||z==="buffer"?ce:ce.toString(z)}Ut.bufferToEncoding=Yt;function Lr(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 wr(ce,z){if(typeof ce=="number")return ce;if(typeof ce=="string")return parseInt(ce,8);if(z)return Ht(z)}function Ht(ce,z){var G=wr(ce,z);if(typeof G!="number"||isNaN(G))throw new TypeError(j.MODE_INT);return G}function Jt(ce){return ce>>>0===ce}function nn(ce){if(!Jt(ce))throw TypeError(j.FD)}function sn(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)}Ut.toUnixTimestamp=sn;function on(ce){if(typeof ce!="number")throw TypeError(j.UID)}function fh(ce){if(typeof ce!="number")throw TypeError(j.GID)}function $8(ce){var z={};function G(se,ye){for(var Ne in ye){var Be=ye[Ne],Ye=O(se,Ne);typeof Be=="string"?z[Ye]=Be:typeof Be=="object"&&Be!==null&&Object.keys(Be).length>0?G(Ye,Be):z[Ye]=null}}return G("",ce),z}var z8=(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(Ye,Be);function Ye(){return Be.call(this,se)||this}return Ye})(jC);var ye=ho;this.ReadStream=(function(Be){r(Ye,Be);function Ye(){for(var ot=[],lt=0;lt<arguments.length;lt++)ot[lt]=arguments[lt];return Be.apply(this,e([se],ot,!1))||this}return Ye})(ye);var Ne=fs;this.WriteStream=(function(Be){r(Ye,Be);function Ye(){for(var ot=[],lt=0;lt<arguments.length;lt++)ot[lt]=arguments[lt];return Be.apply(this,e([se],ot,!1))||this}return Ye})(Ne),this.FSWatcher=(function(Be){r(Ye,Be);function Ye(){return Be.call(this,se)||this}return Ye})(zC),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=xt(z),ye=this.getLink(se);if(!ye)throw be(B,G,z);return ye},ce.prototype.getResolvedLink=function(z){for(var G=typeof z=="string"?xt(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 be(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 be(ae,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:xt(z),ye=this.getLinkParent(se);if(!ye)throw be(B,G,ie+se.join(ie));if(!ye.getNode().isDirectory())throw be(ae,G,ie+se.join(ie));return ye},ce.prototype.getFileByFd=function(z){return this.fds[String(z)]},ce.prototype.getFileByFdOrThrow=function(z,G){if(!Jt(z))throw TypeError(j.FD);var se=this.getFileByFd(z);if(!se)throw be(ee,G);return se},ce.prototype.wrapAsync=function(z,G,se){var ye=this;ke(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 Ye in Be)if(!(Ye==="."||Ye==="..")){Ne=!1;var ot=z.getChild(Ye);if(!ot)throw new Error("_toJSON: unexpected undefined");var lt=ot.getNode();if(lt.isFile()){var vt=ot.getPath();se&&(vt=re(se,vt)),G[vt]=lt.getString()}else lt.isDirectory()&&this._toJSON(ot,G,se)}var Ft=z.getPath();return se&&(Ft=re(se,Ft)),Ft&&Ne&&(G[Ft]=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 Ye=Be[Ne],ot=Ue(Ye),lt=this.getResolvedLink(ot);lt&&ye.push(lt)}}else ye.push(this.root);if(!ye.length)return G;for(var vt=0,Ft=ye;vt<Ft.length;vt++){var lt=Ft[vt];this._toJSON(lt,G,se?lt.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=et(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($8(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 be(we,"open",z.getPath());var ye=z;if(se&&(ye=this.resolveSymlinks(z)),!ye)throw be(B,"open",z.getPath());var Ne=ye.getNode();if(Ne.isDirectory()){if((G&(E|S|_))!==E)throw be(V,"open",z.getPath())}else if(G&Z)throw be(ae,"open",z.getPath());if(!(G&_)&&!Ne.canRead())throw be(xe,"open",z.getPath());var Be=new this.props.File(z,Ne,G,this.newFdNumber());return this.fds[Be.fd]=Be,this.openFiles++,G&I&&Be.truncate(),Be},ce.prototype.openFile=function(z,G,se,ye){ye===void 0&&(ye=!0);var Ne=xt(z),Be=ye?this.getResolvedLink(Ne):this.getLink(Ne);if(Be&&G&M)throw be(H,"open",z);if(!Be&&G&A){var Ye=this.getResolvedLink(Ne.slice(0,Ne.length-1));if(!Ye)throw be(B,"open",ie+Ne.join(ie));G&A&&typeof se=="number"&&(Be=this.createLink(Ye,Ne[Ne.length-1],!1,se))}if(Be)return this.openLink(Be,G,ye);throw be(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 be(B,"open",z);return Ne.fd},ce.prototype.openSync=function(z,G,se){se===void 0&&(se=438);var ye=Ht(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 Ye=Ht(Ne),ot=Ue(z),lt=Ae(G);this.wrapAsync(this.openBase,[ot,lt,Ye],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){nn(z);var G=this.getFileByFdOrThrow(z,"close");this.closeFile(G)},ce.prototype.close=function(z,G){nn(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 be(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 nn(z),this.readBase(z,G,se,ye,Ne)},ce.prototype.read=function(z,G,se,ye,Ne,Be){var Ye=this;if(ke(Be),ye===0)return u.default.nextTick(function(){Be&&Be(null,0,G)});(0,a.default)(function(){try{var ot=Ye.readBase(z,G,se,ye,Ne);Be(null,ot,G)}catch(lt){Be(lt)}})},ce.prototype.readFileBase=function(z,G,se){var ye,Ne=typeof z=="number",Be=Ne&&Jt(z),Ye;if(Be)Ye=z;else{var ot=Ue(z),lt=xt(ot),vt=this.getResolvedLink(lt);if(vt){var Ft=vt.getNode();if(Ft.isDirectory())throw be(V,"open",vt.getPath())}Ye=this.openSync(z,G)}try{ye=Yt(this.getFileByFdOrThrow(Ye).getBuffer(),se)}finally{Be||this.closeSync(Ye)}return ye},ce.prototype.readFileSync=function(z,G){var se=p(G),ye=Ae(se.flag);return this.readFileBase(z,ye,se.encoding)},ce.prototype.readFile=function(z,G,se){var ye=Ke(p)(G,se),Ne=ye[0],Be=ye[1],Ye=Ae(Ne.flag);this.wrapAsync(this.readFileBase,[z,Ye,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){nn(z);var Be,Ye,ot,lt,vt=typeof G!="string";vt?(Ye=(se||0)|0,ot=ye,lt=Ne):(lt=se,Be=ye);var Ft=Zn(G,Be);return vt?typeof ot>"u"&&(ot=Ft.length):(Ye=0,ot=Ft.length),this.writeBase(z,Ft,Ye,ot,lt)},ce.prototype.write=function(z,G,se,ye,Ne,Be){var Ye=this;nn(z);var ot,lt,vt,Ft,an,Xu=typeof G,po=typeof se,Cl=typeof ye,Yu=typeof Ne;Xu!=="string"?po==="function"?an=se:Cl==="function"?(ot=se|0,an=ye):Yu==="function"?(ot=se|0,lt=ye,an=Ne):(ot=se|0,lt=ye,vt=Ne,an=Be):po==="function"?an=se:Cl==="function"?(vt=se,an=ye):Yu==="function"&&(vt=se,Ft=ye,an=Ne);var Hr=Zn(G,Ft);Xu!=="string"?typeof lt>"u"&&(lt=Hr.length):(ot=0,lt=Hr.length);var hs=ke(an);(0,a.default)(function(){try{var $s=Ye.writeBase(z,Hr,ot,lt,vt);Xu!=="string"?hs(null,$s,Hr):hs(null,$s,G)}catch(cb){hs(cb)}})},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 Ye=0,ot=G.length,lt=se&q?void 0:0;try{for(;ot>0;){var vt=this.writeSync(Be,G,Ye,ot,lt);Ye+=vt,ot-=vt,lt!==void 0&&(lt+=vt)}}finally{Ne||this.closeSync(Be)}},ce.prototype.writeFileSync=function(z,G,se){var ye=J(se),Ne=Ae(ye.flag),Be=Ht(ye.mode),Ye=Zn(G,ye.encoding);this.writeFileBase(z,Ye,Ne,Be)},ce.prototype.writeFile=function(z,G,se,ye){var Ne=se,Be=ye;typeof se=="function"&&(Ne=R,Be=se);var Ye=ke(Be),ot=J(Ne),lt=Ae(ot.flag),vt=Ht(ot.mode),Ft=Zn(G,ot.encoding);this.wrapAsync(this.writeFileBase,[z,Ft,lt,vt],Ye)},ce.prototype.linkBase=function(z,G){var se=xt(z),ye=this.getLink(se);if(!ye)throw be(B,"link",z,G);var Ne=xt(G),Be=this.getLinkParent(Ne);if(!Be)throw be(B,"link",z,G);var Ye=Ne[Ne.length-1];if(Be.getChild(Ye))throw be(H,"link",z,G);var ot=ye.getNode();ot.nlink++,Be.createChild(Ye,ot)},ce.prototype.copyFileBase=function(z,G,se){var ye=this.readFileSync(z);if(se&L&&this.existsSync(G))throw be(H,"copyFile",z,G);if(se&$)throw be(oe,"copyFile",z,G);this.writeFileBase(G,ye,pe.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),Ye,ot;typeof se=="function"?(Ye=0,ot=se):(Ye=se,ot=ye),ke(ot),this.wrapAsync(this.copyFileBase,[Ne,Be,Ye],ot)},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=xt(z),se=this.getLink(G);if(!se)throw be(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=xt(G),ye=this.getLinkParent(se);if(!ye)throw be(B,"symlink",z,G);var Ne=se[se.length-1];if(ye.getChild(Ne))throw be(H,"symlink",z,G);var Be=ye.createChild(Ne);return Be.getNode().makeSymlink(xt(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=ke(typeof se=="function"?se:ye),Be=Ue(z),Ye=Ue(G);this.wrapAsync(this.symlinkBase,[Be,Ye],Ne)},ce.prototype.realpathBase=function(z,G){var se=xt(z),ye=this.getResolvedLink(se);if(!ye)throw be(B,"realpath",z);return(0,g.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],Ye=Ue(z);this.wrapAsync(this.realpathBase,[Ye,Ne.encoding],Be)},ce.prototype.lstatBase=function(z,G,se){G===void 0&&(G=!1),se===void 0&&(se=!1);var ye=this.getLink(xt(z));if(ye)return i.default.build(ye.getNode(),G);if(se)throw be(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,Ye=Be===void 0?!1:Be;return this.lstatBase(Ue(z),Ye,Ne)},ce.prototype.lstat=function(z,G,se){var ye=me(G,se),Ne=ye[0],Be=Ne.throwIfNoEntry,Ye=Be===void 0?!0:Be,ot=Ne.bigint,lt=ot===void 0?!1:ot,vt=ye[1];this.wrapAsync(this.lstatBase,[Ue(z),lt,Ye],vt)},ce.prototype.statBase=function(z,G,se){G===void 0&&(G=!1),se===void 0&&(se=!0);var ye=this.getResolvedLink(xt(z));if(ye)return i.default.build(ye.getNode(),G);if(se)throw be(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,Ye=Be===void 0?!0:Be;return this.statBase(Ue(z),Ne,Ye)},ce.prototype.stat=function(z,G,se){var ye=me(G,se),Ne=ye[0],Be=Ne.bigint,Ye=Be===void 0?!1:Be,ot=Ne.throwIfNoEntry,lt=ot===void 0?!0:ot,vt=ye[1];this.wrapAsync(this.statBase,[Ue(z),Ye,lt],vt)},ce.prototype.fstatBase=function(z,G){G===void 0&&(G=!1);var se=this.getFileByFd(z);if(!se)throw be(ee,"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(xt(z));if(!se)throw be(B,"rename",z,G);var ye=xt(G),Ne=this.getLinkParent(ye);if(!Ne)throw be(B,"rename",z,G);var Be=se.parent;Be&&Be.deleteChild(se);var Ye=ye[ye.length-1];se.name=Ye,se.steps=e(e([],Ne.steps,!0),[Ye],!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=ke(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=D);var ye=le(se);(!ye.flag||Jt(z))&&(ye.flag="a"),this.writeFileSync(z,G,ye)},ce.prototype.appendFile=function(z,G,se,ye){var Ne=he(se,ye),Be=Ne[0],Ye=Ne[1];(!Be.flag||Jt(z))&&(Be.flag="a"),this.writeFile(z,G,Be,Ye)},ce.prototype.readdirBase=function(z,G){var se=xt(z),ye=this.getResolvedLink(se);if(!ye)throw be(B,"readdir",z);var Ne=ye.getNode();if(!Ne.isDirectory())throw be(ae,"scandir",z);if(G.withFileTypes){var Be=[];for(var Ye in ye.children){var ot=ye.getChild(Ye);!ot||Ye==="."||Ye===".."||Be.push(o.default.build(ot,G.encoding))}return!P&&G.encoding!=="buffer"&&Be.sort(function(Ft,an){return Ft.name<an.name?-1:Ft.name>an.name?1:0}),Be}var lt=[];for(var vt in ye.children)vt==="."||vt===".."||lt.push((0,g.strToEncoding)(vt,G.encoding));return!P&&G.encoding!=="buffer"&&lt.sort(),lt},ce.prototype.readdirSync=function(z,G){var se=De(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],Ye=Ue(z);this.wrapAsync(this.readdirBase,[Ye,Ne],Be)},ce.prototype.readlinkBase=function(z,G){var se=this.getLinkOrThrow(z,"readlink"),ye=se.getNode();if(!ye.isSymlink())throw be(fe,"readlink",z);var Ne=ie+ye.symlink.join(ie);return(0,g.strToEncoding)(Ne,G)},ce.prototype.readlinkSync=function(z,G){var se=it(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],Ye=Ue(z);this.wrapAsync(this.readlinkBase,[Ye,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=ke(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(Jt(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=ke(typeof G=="number"?se:G);if(Jt(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,sn(G),sn(se))},ce.prototype.futimes=function(z,G,se,ye){this.wrapAsync(this.futimesBase,[z,sn(G),sn(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),sn(G),sn(se))},ce.prototype.utimes=function(z,G,se,ye){this.wrapAsync(this.utimesBase,[Ue(z),sn(G),sn(se)],ye)},ce.prototype.mkdirBase=function(z,G){var se=xt(z);if(!se.length)throw be(H,"mkdir",z);var ye=this.getLinkParentAsDirOrThrow(z,"mkdir"),Ne=se[se.length-1];if(ye.getChild(Ne))throw be(H,"mkdir",z);ye.createChild(Ne,this.createNode(!0,G))},ce.prototype.mkdirpBase=function(z,G){for(var se=et(z),ye=se.substring(1),Ne=ye?ye.split(ie):[],Be=this.root,Ye=!1,ot=0;ot<Ne.length;ot++){var lt=Ne[ot];if(!Be.getNode().isDirectory())throw be(ae,"mkdir",Be.getPath());var vt=Be.getChild(lt);if(vt)if(vt.getNode().isDirectory())Be=vt;else throw be(ae,"mkdir",vt.getPath());else Be=Be.createChild(lt,this.createNode(!0,G)),Ye=!0}return Ye?se:void 0},ce.prototype.mkdirSync=function(z,G){var se=Fe(G),ye=Ht(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=ke(typeof G=="function"?G:se),Be=Ht(ye.mode,511),Ye=Ue(z);ye.recursive?this.wrapAsync(this.mkdirpBase,[Ye,Be],Ne):this.wrapAsync(this.mkdirBase,[Ye,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=ke(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,g.strToEncoding)(ye,G)}catch(Ne){if(Ne.code===H){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=it(G).encoding;if(!z||typeof z!="string")throw new TypeError("filename prefix is required");return Lr(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");Lr(z)&&this.wrapAsync(this.mkdtempBase,[z,Ne],Be)},ce.prototype.rmdirBase=function(z,G){var se=k(G),ye=this.getLinkAsDirOrThrow(z,"rmdir");if(ye.length&&!se.recursive)throw be(F,"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=k(G),Ne=ke(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 be(B,"stat",z);return}if(se.getNode().isDirectory()&&!G.recursive)throw be(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=je(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,Ht(G))},ce.prototype.fchmod=function(z,G,se){this.wrapAsync(this.fchmodBase,[z,Ht(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=Ht(G),ye=Ue(z);this.chmodBase(ye,se)},ce.prototype.chmod=function(z,G,se){var ye=Ht(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=Ht(G),ye=Ue(z);this.lchmodBase(ye,se)},ce.prototype.lchmod=function(z,G,se){var ye=Ht(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){on(G),fh(se),this.fchownBase(z,G,se)},ce.prototype.fchown=function(z,G,se,ye){on(G),fh(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){on(G),fh(se),this.chownBase(Ue(z),G,se)},ce.prototype.chown=function(z,G,se,ye){on(G),fh(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){on(G),fh(se),this.lchownBase(Ue(z),G,se)},ce.prototype.lchown=function(z,G,se,ye){on(G),fh(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 Ye=5007,ot=!0;Ne&&typeof Ne=="object"&&(typeof Ne.interval=="number"&&(Ye=Ne.interval),typeof Ne.persistent=="boolean"&&(ot=Ne.persistent));var lt=this.statWatchers[ye];return lt||(lt=new this.StatWatcher,lt.start(ye,ot,Ye),this.statWatchers[ye]=lt),lt.addListener("change",Be),lt},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=it(Ne),Ye=Be.persistent,ot=Be.recursive,lt=Be.encoding;Ye===void 0&&(Ye=!0),ot===void 0&&(ot=!1);var vt=new this.FSWatcher;return vt.start(ye,Ye,ot,lt),se&&vt.addListener("change",se),vt},ce.fd=2147483647,ce})();Ut.Volume=z8;function W8(ce){ce.emit("stop")}var jC=(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:K$):c.default,this.interval=ye,this.prev=this.vol.statSync(this.filename),this.loop()},z.prototype.stop=function(){clearTimeout(this.timeoutRef),u.default.nextTick(W8,this)},z})(d.EventEmitter);Ut.StatWatcher=jC;var cs;function H8(ce){cs=(0,s.bufferAllocUnsafe)(ce),cs.used=0}v.inherits(ho,f.Readable),Ut.ReadStream=ho;function ho(ce,z,G){if(!(this instanceof ho))return new ho(ce,z,G);if(this._vol=ce,G=Object.assign({},ze(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()})}ho.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()})},ho.prototype._read=function(ce){if(typeof this.fd!="number")return this.once("open",function(){this._read(ce)});if(this.destroyed)return;(!cs||cs.length-cs.used<C)&&H8(this._readableState.highWaterMark);var z=cs,G=Math.min(cs.length-cs.used,ce),se=cs.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,cs,cs.used,G,this.pos,Ne),this.pos!==void 0&&(this.pos+=G),cs.used+=G;function Ne(Be,Ye){if(Be)ye.autoClose&&ye.destroy&&ye.destroy(),ye.emit("error",Be);else{var ot=null;Ye>0&&(ye.bytesRead+=Ye,ot=z.slice(se,se+Ye)),ye.push(ot)}}},ho.prototype._destroy=function(ce,z){this.close(function(G){z(ce||G)})},ho.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",$C);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 $C(ce){this.close()}v.inherits(fs,f.Writable),Ut.WriteStream=fs;function fs(ce,z,G){if(!(this instanceof fs))return new fs(ce,z,G);if(this._vol=ce,G=Object.assign({},ze(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()})}fs.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))},fs.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)},fs.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 Ye=ce[Be].chunk;ye[Be]=Ye,Ne+=Ye.length}var ot=s.Buffer.concat(ye);this._vol.write(this.fd,ot,0,ot.length,this.pos,function(lt,vt){if(lt)return G.destroy&&G.destroy(),z(lt);G.bytesWritten+=vt,z()}),this.pos!==void 0&&(this.pos+=Ne)},fs.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",$C);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},fs.prototype._destroy=ho.prototype._destroy,fs.prototype.destroySoon=fs.prototype.end;var zC=(function(ce){r(z,ce);function z(G){var se=ce.call(this)||this;return se._filename="",se._filenameEncoded="",se._recursive=!1,se._encoding=g.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=g.ENCODING_UTF8),this._filename=Ue(G),this._steps=xt(this._filename),this._filenameEncoded=(0,g.strToEncoding)(this._filename),this._recursive=ye,this._encoding=Ne;try{this._link=this._vol.getLinkOrThrow(this._filename,"FSWatcher")}catch(Ft){var Ye=new Error("watch ".concat(this._filename," ").concat(Ft.code));throw Ye.code=Ft.code,Ye.errno=Ft.code,Ye}var ot=function(Ft){var an,Xu=Ft.getPath(),po=Ft.getNode(),Cl=function(){var Hr=re(Be._filename,Xu);return Hr||(Hr=Be._getName()),Be.emit("change","change",Hr)};po.on("change",Cl);var Yu=(an=Be._listenerRemovers.get(po.ino))!==null&&an!==void 0?an:[];Yu.push(function(){return po.removeListener("change",Cl)}),Be._listenerRemovers.set(po.ino,Yu)},lt=function(Ft){var an,Xu=Ft.getNode(),po=function(Hr){Be.emit("change","rename",re(Be._filename,Hr.getPath())),setTimeout(function(){ot(Hr),lt(Hr)})},Cl=function(Hr){var hs=function($s){var cb=$s.getNode().ino,WC=Be._listenerRemovers.get(cb);WC&&(WC.forEach(function(fb){return fb()}),Be._listenerRemovers.delete(cb)),Object.values($s.children).forEach(function(fb){fb&&hs(fb)})};hs(Hr),Be.emit("change","rename",re(Be._filename,Hr.getPath()))};Object.entries(Ft.children).forEach(function(Hr){var hs=Hr[0],$s=Hr[1];$s&&hs!=="."&&hs!==".."&&ot($s)}),Ft.on("child:add",po),Ft.on("child:delete",Cl);var Yu=(an=Be._listenerRemovers.get(Xu.ino))!==null&&an!==void 0?an:[];Yu.push(function(){Ft.removeListener("child:add",po),Ft.removeListener("child:delete",Cl)}),ye&&Object.entries(Ft.children).forEach(function(Hr){var hs=Hr[0],$s=Hr[1];$s&&hs!=="."&&hs!==".."&&lt($s)})};ot(this._link),lt(this._link);var vt=this._link.parent;vt&&(vt.setMaxListeners(vt.getMaxListeners()+1),vt.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})(d.EventEmitter);return Ut.FSWatcher=zC,Ut}function J$(){return tO||(tO=!0,Object.defineProperty(ba,"__esModule",{value:!0}),ba.fsSyncMethods=ba.fsProps=ba.fsAsyncMethods=void 0,ba.fsProps=["constants","F_OK","R_OK","W_OK","X_OK","Stats"],ba.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"],ba.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"]),ba}function Q$(){if(rO)return wn;rO=!0;var r=wn&&wn.__assign||function(){return r=Object.assign||function(g){for(var y,v=1,w=arguments.length;v<w;v++){y=arguments[v];for(var b in y)Object.prototype.hasOwnProperty.call(y,b)&&(g[b]=y[b])}return g},r.apply(this,arguments)};Object.defineProperty(wn,"__esModule",{value:!0}),wn.fs=wn.createFsFromVolume=wn.vol=wn.Volume=void 0;var e=T_(),t=sO(),n=lO(),i=J$(),o=i.fsSyncMethods,s=i.fsAsyncMethods,a=Rg(),u=a.constants.F_OK,c=a.constants.R_OK,f=a.constants.W_OK,h=a.constants.X_OK;wn.Volume=n.Volume,wn.vol=new n.Volume;function d(g){for(var y={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 b=w[v];typeof g[b]=="function"&&(y[b]=g[b].bind(g))}for(var E=0,_=s;E<_.length;E++){var b=_[E];typeof g[b]=="function"&&(y[b]=g[b].bind(g))}return y.StatWatcher=g.StatWatcher,y.FSWatcher=g.FSWatcher,y.WriteStream=g.WriteStream,y.ReadStream=g.ReadStream,y.promises=g.promises,y._toUnixTimestamp=n.toUnixTimestamp,y}return wn.createFsFromVolume=d,wn.fs=d(wn.vol),wn=r(r({},wn),wn.fs),wn.semantic=!0,wn}function Mi(r){throw new Error(`Node.js fs ${r} is not supported by JSPM core in the browser`)}function uO(r,e,t){let n=0,i=new TextDecoder;wa.watch(r,"utf8",()=>{let{size:o}=wa.fstatSync(e),s=We.alloc(o-n);wa.readSync(e,s,0,s.length,n),n=o,t(i.decode(s,{stream:!0}))})}function R_(r,e){if(r.protocol==="file:")return S_(r);if(r.protocol==="https:"||r.protocol==="http:"){let t="\\\\url\\"+r.href.replaceAll(/\//g,"\\\\");if(rw(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 cO(t,We.from(i)),t})()}throw new Error("URL "+r+" not supported in JSPM FS implementation.")}function t9(r){return function(e,...t){return e instanceof URL?r(R_(e,!0),...t):r(e,...t)}}function r9(r){return async function(e,...t){return e instanceof URL?r(await R_(e),...t):r(e,...t)}}function n9(r){return function(e,...t){let n=t[t.length-1];e instanceof URL&&typeof n=="function"?R_(e).then(i=>{r(i,...t)},n):r(e,...t)}}var Tg,jN,Qb,$N,Dh,zN,Hs,WN,fn,HN,q$,vo,qN,Ih,GN,ew,VN,XN,kh,YN,di,ZN,tw,KN,V$,Ml,JN,Cg,QN,Ut,eO,K$,ba,tO,wn,rO,yc,Jn,wa,e9,vr,i9,s9,o9,a9,l9,u9,c9,f9,h9,d9,p9,g9,m9,y9,b9,w9,v9,rw,E9,_9,A9,x9,S9,T9,C9,R9,D9,I9,k9,N9,O9,L9,P9,F9,M9,B9,U9,j9,$9,D_,z9,W9,H9,q9,G9,V9,X9,Y9,Z9,K9,J9,Q9,ez,tz,rz,I_,nz,iz,sz,oz,az,lz,uz,cz,fz,hz,dz,pz,gz,mz,yz,bz,wz,vz,Ez,_z,Az,xz,Sz,Tz,cO,Cz,Rz,Dz,Iz,kz,Nz,Oz,Lz,Pz,Fz,Mz,Bz,Uz,jz,$z,zz,Wz,Hz,iw=bt(()=>{Se();Ce();Te();dh();V1();jb();Ol();tk();wh();lc();Wb();xh();U2();kl();UN();Kb();$2();Sg();p_();Tg={},jN=!1;Qb={},$N=!1;Dh={},zN=!1;Hs={},WN=!1;fn={},HN=!1,q$=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;vo={},qN=!1;Ih={},GN=!1;un._makeLong;un.basename;un.delimiter;un.dirname;un.extname;un.format;un.isAbsolute;un.join;un.normalize;un.parse;un.posix;un.relative;un.resolve;un.sep;un.win32;ew={},VN=!1,XN=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;kh={},YN=!1;di={},ZN=!1;tw={},KN=!1,V$=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;Ml={},JN=!1;Cg={},QN=!1;Ut={},eO=!1,K$=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;ba={},tO=!1;wn={},rO=!1;yc=Q$();yc.__esModule;yc.fs;yc.createFsFromVolume;yc.vol;yc.Volume;yc.semantic;Jn=lO();Jn.__esModule;Jn.FSWatcher;Jn.StatWatcher;Jn.Volume;Jn.toUnixTimestamp;Jn.bufferToEncoding;Jn.dataToBuffer;Jn.dataToStr;Jn.pathToSteps;Jn.filenameToSteps;Jn.pathToFilename;Jn.flagsToNumber;Jn.FLAGS;Jn.ReadStream;Jn.WriteStream;({vol:wa,createFsFromVolume:e9}=yc);wa.fromNestedJSON({"/dev":{stdin:"",stdout:"",stderr:""},"/usr/bin":{},"/home":{},"/tmp":{}});wa.releasedFds=[2,1,0];wa.openSync("/dev/stdin","w");wa.openSync("/dev/stdout","r");wa.openSync("/dev/stderr","r");uO("/dev/stdout",1,console.log);uO("/dev/stderr",2,console.error);vr=e9(wa);vr.opendir=()=>Mi("opendir");vr.opendirSync=()=>Mi("opendirSync");vr.promises.opendir=()=>Mi("promises.opendir");vr.cp=()=>Mi("cp");vr.cpSync=()=>Mi("cpSync");vr.promises.cp=()=>Mi("promises.cp");vr.readv=()=>Mi("readv");vr.readvSync=()=>Mi("readvSync");vr.rm=()=>Mi("rm");vr.rmSync=()=>Mi("rmSync");vr.promises.rm=()=>Mi("promises.rm");vr.Dir=()=>Mi("Dir");vr.promises.watch=()=>Mi("promises.watch");vr.FileReadStream=vr.ReadStream;vr.FileWriteStream=vr.WriteStream;vr.promises.readFile=r9(vr.promises.readFile);vr.readFile=n9(vr.readFile);vr.readFileSync=t9(vr.readFileSync);({appendFile:i9,appendFileSync:s9,access:o9,accessSync:a9,chown:l9,chownSync:u9,chmod:c9,chmodSync:f9,close:h9,closeSync:d9,copyFile:p9,copyFileSync:g9,cp:m9,cpSync:y9,createReadStream:b9,createWriteStream:w9,exists:v9,existsSync:rw,fchown:E9,fchownSync:_9,fchmod:A9,fchmodSync:x9,fdatasync:S9,fdatasyncSync:T9,fstat:C9,fstatSync:R9,fsync:D9,fsyncSync:I9,ftruncate:k9,ftruncateSync:N9,futimes:O9,futimesSync:L9,lchown:P9,lchownSync:F9,lchmod:M9,lchmodSync:B9,link:U9,linkSync:j9,lstat:$9,lstatSync:D_,mkdir:z9,mkdirSync:W9,mkdtemp:H9,mkdtempSync:q9,open:G9,openSync:V9,opendir:X9,opendirSync:Y9,readdir:Z9,readdirSync:K9,read:J9,readSync:Q9,readv:ez,readvSync:tz,readFile:rz,readFileSync:I_,readlink:nz,readlinkSync:iz,realpath:sz,realpathSync:oz,rename:az,renameSync:lz,rm:uz,rmSync:cz,rmdir:fz,rmdirSync:hz,stat:dz,statSync:pz,symlink:gz,symlinkSync:mz,truncate:yz,truncateSync:bz,unwatchFile:wz,unlink:vz,unlinkSync:Ez,utimes:_z,utimesSync:Az,watch:xz,watchFile:Sz,writeFile:Tz,writeFileSync:cO,write:Cz,writeSync:Rz,writev:Dz,writevSync:Iz,Dir:kz,Dirent:Nz,Stats:Oz,ReadStream:Lz,WriteStream:Pz,FileReadStream:Fz,FileWriteStream:Mz,_toUnixTimestamp:Bz,constants:{F_OK:Uz,R_OK:jz,W_OK:$z,X_OK:zz},constants:Wz,promises:Hz}=vr)});var Dg=dt(Nh=>{"use strict";Se();Ce();Te();function qz(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 k_(r,e){return e===void 0&&(e=Object),e&&typeof e.freeze=="function"?e.freeze(r):r}function Gz(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 fO=k_({HTML:"text/html",isHTML:function(r){return r===fO.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),hO=k_({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(r){return r===hO.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});Nh.assign=Gz;Nh.find=qz;Nh.freeze=k_;Nh.MIME_TYPE=fO;Nh.NAMESPACE=hO});var z_=dt(Bl=>{Se();Ce();Te();var vO=Dg(),Eo=vO.find,Ig=vO.NAMESPACE;function Vz(r){return r!==""}function Xz(r){return r?r.split(/[\t\n\f\r ]+/).filter(Vz):[]}function Yz(r,e){return r.hasOwnProperty(e)||(r[e]=!0),r}function dO(r){if(!r)return[];var e=Xz(r);return Object.keys(e.reduce(Yz,{}))}function Zz(r){return function(e){return r&&r.indexOf(e)!==-1}}function Og(r,e){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}function gi(r,e){var t=r.prototype;if(!(t instanceof e)){let i=function(){};var n=i;i.prototype=e.prototype,i=new i,Og(t,i),r.prototype=t=i}t.constructor!=r&&(typeof r!="function"&&console.error("unknown Class:"+r),t.constructor=r)}var mi={},gs=mi.ELEMENT_NODE=1,Lh=mi.ATTRIBUTE_NODE=2,sw=mi.TEXT_NODE=3,EO=mi.CDATA_SECTION_NODE=4,_O=mi.ENTITY_REFERENCE_NODE=5,Kz=mi.ENTITY_NODE=6,AO=mi.PROCESSING_INSTRUCTION_NODE=7,xO=mi.COMMENT_NODE=8,SO=mi.DOCUMENT_NODE=9,TO=mi.DOCUMENT_TYPE_NODE=10,Ea=mi.DOCUMENT_FRAGMENT_NODE=11,Jz=mi.NOTATION_NODE=12,$n={},vn={},WJ=$n.INDEX_SIZE_ERR=(vn[1]="Index size error",1),HJ=$n.DOMSTRING_SIZE_ERR=(vn[2]="DOMString size error",2),pi=$n.HIERARCHY_REQUEST_ERR=(vn[3]="Hierarchy request error",3),qJ=$n.WRONG_DOCUMENT_ERR=(vn[4]="Wrong document",4),GJ=$n.INVALID_CHARACTER_ERR=(vn[5]="Invalid character",5),VJ=$n.NO_DATA_ALLOWED_ERR=(vn[6]="No data allowed",6),XJ=$n.NO_MODIFICATION_ALLOWED_ERR=(vn[7]="No modification allowed",7),CO=$n.NOT_FOUND_ERR=(vn[8]="Not found",8),YJ=$n.NOT_SUPPORTED_ERR=(vn[9]="Not supported",9),pO=$n.INUSE_ATTRIBUTE_ERR=(vn[10]="Attribute in use",10),ZJ=$n.INVALID_STATE_ERR=(vn[11]="Invalid state",11),KJ=$n.SYNTAX_ERR=(vn[12]="Syntax error",12),JJ=$n.INVALID_MODIFICATION_ERR=(vn[13]="Invalid modification",13),QJ=$n.NAMESPACE_ERR=(vn[14]="Invalid namespace",14),eQ=$n.INVALID_ACCESS_ERR=(vn[15]="Invalid access",15);function Xr(r,e){if(e instanceof Error)var t=e;else t=this,Error.call(this,vn[r]),this.message=vn[r],Error.captureStackTrace&&Error.captureStackTrace(this,Xr);return t.code=r,e&&(this.message=this.message+": "+e),t}Xr.prototype=Error.prototype;Og($n,Xr);function va(){}va.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++)Oh(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 Ph(r,e){this._node=r,this._refresh=e,L_(this)}function L_(r){var e=r._node._inc||r._node.ownerDocument._inc;if(r._inc!==e){var t=r._refresh(r._node);if(UO(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];Og(t,r),r._inc=e}}Ph.prototype.item=function(r){return L_(this),this[r]||null};gi(Ph,va);function ow(){}function RO(r,e){for(var t=r.length;t--;)if(r[t]===e)return t}function gO(r,e,t,n){if(n?e[RO(e,n)]=t:e[e.length++]=t,r){t.ownerElement=r;var i=r.ownerDocument;i&&(n&&kO(i,r,n),Qz(i,r,t))}}function mO(r,e,t){var n=RO(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&&(kO(o,r,t),t.ownerElement=null)}}else throw new Xr(CO,new Error(r.tagName+"@"+t))}ow.prototype={length:0,item:va.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 Xr(pO);var t=this.getNamedItem(r.nodeName);return gO(this._ownerElement,this,r,t),t},setNamedItemNS:function(r){var e=r.ownerElement,t;if(e&&e!=this._ownerElement)throw new Xr(pO);return t=this.getNamedItemNS(r.namespaceURI,r.localName),gO(this._ownerElement,this,r,t),t},removeNamedItem:function(r){var e=this.getNamedItem(r);return mO(this._ownerElement,this,e),e},removeNamedItemNS:function(r,e){var t=this.getNamedItemNS(r,e);return mO(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 DO(){}DO.prototype={hasFeature:function(r,e){return!0},createDocument:function(r,e,t){var n=new Lg;if(n.implementation=this,n.childNodes=new va,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 uw;return n.name=r,n.nodeName=r,n.publicId=e||"",n.systemId=t||"",n}};function Qt(){}Qt.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 aw(this,r,e)},replaceChild:function(r,e){aw(this,r,e,OO),e&&this.removeChild(e)},removeChild:function(r){return NO(this,r)},appendChild:function(r){return this.insertBefore(r,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(r){return O_(this.ownerDocument||this,this,r)},normalize:function(){for(var r=this.firstChild;r;){var e=r.nextSibling;e&&e.nodeType==sw&&r.nodeType==sw?(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 IO(r){return r=="<"&&"&lt;"||r==">"&&"&gt;"||r=="&"&&"&amp;"||r=='"'&&"&quot;"||"&#"+r.charCodeAt()+";"}Og(mi,Qt);Og(mi,Qt.prototype);function kg(r,e){if(e(r))return!0;if(r=r.firstChild)do if(kg(r,e))return!0;while(r=r.nextSibling)}function Lg(){this.ownerDocument=this}function Qz(r,e,t){r&&r._inc++;var n=t.namespaceURI;n===Ig.XMLNS&&(e._nsMap[t.prefix?t.localName:""]=t.value)}function kO(r,e,t,n){r&&r._inc++;var i=t.namespaceURI;i===Ig.XMLNS&&delete e._nsMap[t.prefix?t.localName:""]}function P_(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 NO(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,P_(r.ownerDocument,r),e}function e7(r){return r&&(r.nodeType===Qt.DOCUMENT_NODE||r.nodeType===Qt.DOCUMENT_FRAGMENT_NODE||r.nodeType===Qt.ELEMENT_NODE)}function t7(r){return r&&(_o(r)||F_(r)||_a(r)||r.nodeType===Qt.DOCUMENT_FRAGMENT_NODE||r.nodeType===Qt.COMMENT_NODE||r.nodeType===Qt.PROCESSING_INSTRUCTION_NODE)}function _a(r){return r&&r.nodeType===Qt.DOCUMENT_TYPE_NODE}function _o(r){return r&&r.nodeType===Qt.ELEMENT_NODE}function F_(r){return r&&r.nodeType===Qt.TEXT_NODE}function yO(r,e){var t=r.childNodes||[];if(Eo(t,_o)||_a(e))return!1;var n=Eo(t,_a);return!(e&&n&&t.indexOf(n)>t.indexOf(e))}function bO(r,e){var t=r.childNodes||[];function n(o){return _o(o)&&o!==e}if(Eo(t,n))return!1;var i=Eo(t,_a);return!(e&&i&&t.indexOf(i)>t.indexOf(e))}function r7(r,e,t){if(!e7(r))throw new Xr(pi,"Unexpected parent node type "+r.nodeType);if(t&&t.parentNode!==r)throw new Xr(CO,"child not in parent");if(!t7(e)||_a(e)&&r.nodeType!==Qt.DOCUMENT_NODE)throw new Xr(pi,"Unexpected node type "+e.nodeType+" for parent node type "+r.nodeType)}function n7(r,e,t){var n=r.childNodes||[],i=e.childNodes||[];if(e.nodeType===Qt.DOCUMENT_FRAGMENT_NODE){var o=i.filter(_o);if(o.length>1||Eo(i,F_))throw new Xr(pi,"More than one element or text in fragment");if(o.length===1&&!yO(r,t))throw new Xr(pi,"Element in fragment can not be inserted before doctype")}if(_o(e)&&!yO(r,t))throw new Xr(pi,"Only one element can be added and only after doctype");if(_a(e)){if(Eo(n,_a))throw new Xr(pi,"Only one doctype is allowed");var s=Eo(n,_o);if(t&&n.indexOf(s)<n.indexOf(t))throw new Xr(pi,"Doctype can only be inserted before an element");if(!t&&s)throw new Xr(pi,"Doctype can not be appended since element is present")}}function OO(r,e,t){var n=r.childNodes||[],i=e.childNodes||[];if(e.nodeType===Qt.DOCUMENT_FRAGMENT_NODE){var o=i.filter(_o);if(o.length>1||Eo(i,F_))throw new Xr(pi,"More than one element or text in fragment");if(o.length===1&&!bO(r,t))throw new Xr(pi,"Element in fragment can not be inserted before doctype")}if(_o(e)&&!bO(r,t))throw new Xr(pi,"Only one element can be added and only after doctype");if(_a(e)){let u=function(c){return _a(c)&&c!==t};var a=u;if(Eo(n,u))throw new Xr(pi,"Only one doctype is allowed");var s=Eo(n,_o);if(t&&n.indexOf(s)<n.indexOf(t))throw new Xr(pi,"Doctype can only be inserted before an element")}}function aw(r,e,t,n){r7(r,e,t),r.nodeType===Qt.DOCUMENT_NODE&&(n||n7)(r,e,t);var i=e.parentNode;if(i&&i.removeChild(e),e.nodeType===Ea){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;var u=r.ownerDocument||r;Ng(o,u)}while(o!==s&&(o=o.nextSibling));return P_(r.ownerDocument||r,r),e.nodeType==Ea&&(e.firstChild=e.lastChild=null),e}function Ng(r,e){if(r.ownerDocument!==e){if(r.ownerDocument=e,r.nodeType===gs&&r.attributes)for(var t=0;t<r.attributes.length;t++){var n=r.attributes.item(t);n&&(n.ownerDocument=e)}for(var i=r.firstChild;i;)Ng(i,e),i=i.nextSibling}}function i7(r,e){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,P_(r.ownerDocument,r,e);var t=r.ownerDocument||r;return Ng(e,t),e}Lg.prototype={nodeName:"#document",nodeType:SO,doctype:null,documentElement:null,_inc:1,insertBefore:function(r,e){if(r.nodeType==Ea){for(var t=r.firstChild;t;){var n=t.nextSibling;this.insertBefore(t,e),t=n}return r}return aw(this,r,e),Ng(r,this),this.documentElement===null&&r.nodeType===gs&&(this.documentElement=r),r},removeChild:function(r){return this.documentElement==r&&(this.documentElement=null),NO(this,r)},replaceChild:function(r,e){aw(this,r,e,OO),Ng(r,this),e&&this.removeChild(e),_o(r)&&(this.documentElement=r)},importNode:function(r,e){return BO(this,r,e)},getElementById:function(r){var e=null;return kg(this.documentElement,function(t){if(t.nodeType==gs&&t.getAttribute("id")==r)return e=t,!0}),e},getElementsByClassName:function(r){var e=dO(r);return new Ph(this,function(t){var n=[];return e.length>0&&kg(t.documentElement,function(i){if(i!==t&&i.nodeType===gs){var o=i.getAttribute("class");if(o){var s=r===o;if(!s){var a=dO(o);s=e.every(Zz(a))}s&&n.push(i)}}}),n})},createElement:function(r){var e=new bc;e.ownerDocument=this,e.nodeName=r,e.tagName=r,e.localName=r,e.childNodes=new va;var t=e.attributes=new ow;return t._ownerElement=e,e},createDocumentFragment:function(){var r=new cw;return r.ownerDocument=this,r.childNodes=new va,r},createTextNode:function(r){var e=new M_;return e.ownerDocument=this,e.appendData(r),e},createComment:function(r){var e=new B_;return e.ownerDocument=this,e.appendData(r),e},createCDATASection:function(r){var e=new U_;return e.ownerDocument=this,e.appendData(r),e},createProcessingInstruction:function(r,e){var t=new $_;return t.ownerDocument=this,t.tagName=t.nodeName=t.target=r,t.nodeValue=t.data=e,t},createAttribute:function(r){var e=new lw;return e.ownerDocument=this,e.name=r,e.nodeName=r,e.localName=r,e.specified=!0,e},createEntityReference:function(r){var e=new j_;return e.ownerDocument=this,e.nodeName=r,e},createElementNS:function(r,e){var t=new bc,n=e.split(":"),i=t.attributes=new ow;return t.childNodes=new va,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 lw,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}};gi(Lg,Qt);function bc(){this._nsMap={}}bc.prototype={nodeType:gs,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===Ea?this.insertBefore(r,null):i7(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 Ph(this,function(e){var t=[];return kg(e,function(n){n!==e&&n.nodeType==gs&&(r==="*"||n.tagName==r)&&t.push(n)}),t})},getElementsByTagNameNS:function(r,e){return new Ph(this,function(t){var n=[];return kg(t,function(i){i!==t&&i.nodeType===gs&&(r==="*"||i.namespaceURI===r)&&(e==="*"||i.localName==e)&&n.push(i)}),n})}};Lg.prototype.getElementsByTagName=bc.prototype.getElementsByTagName;Lg.prototype.getElementsByTagNameNS=bc.prototype.getElementsByTagNameNS;gi(bc,Qt);function lw(){}lw.prototype.nodeType=Lh;gi(lw,Qt);function Pg(){}Pg.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(vn[pi])},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}};gi(Pg,Qt);function M_(){}M_.prototype={nodeName:"#text",nodeType:sw,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}};gi(M_,Pg);function B_(){}B_.prototype={nodeName:"#comment",nodeType:xO};gi(B_,Pg);function U_(){}U_.prototype={nodeName:"#cdata-section",nodeType:EO};gi(U_,Pg);function uw(){}uw.prototype.nodeType=TO;gi(uw,Qt);function LO(){}LO.prototype.nodeType=Jz;gi(LO,Qt);function PO(){}PO.prototype.nodeType=Kz;gi(PO,Qt);function j_(){}j_.prototype.nodeType=_O;gi(j_,Qt);function cw(){}cw.prototype.nodeName="#document-fragment";cw.prototype.nodeType=Ea;gi(cw,Qt);function $_(){}$_.prototype.nodeType=AO;gi($_,Qt);function FO(){}FO.prototype.serializeToString=function(r,e,t){return MO.call(r,e,t)};Qt.prototype.toString=MO;function MO(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 Oh(this,t,r,e,s),t.join("")}function wO(r,e,t){var n=r.prefix||"",i=r.namespaceURI;if(!i||n==="xml"&&i===Ig.XML||i===Ig.XMLNS)return!1;for(var o=t.length;o--;){var s=t[o];if(s.prefix===n)return s.namespace!==i}return!0}function N_(r,e,t){r.push(" ",e,'="',t.replace(/[<>&"\t\n\r]/g,IO),'"')}function Oh(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 gs:var o=r.attributes,s=o.length,b=r.firstChild,a=r.tagName;t=Ig.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 d=i[h];if(d.prefix===""&&d.namespace===r.namespaceURI){c=d.namespace;break}}if(c!==r.namespaceURI)for(var h=i.length-1;h>=0;h--){var d=i[h];if(d.namespace===r.namespaceURI){d.prefix&&(u=d.prefix+":"+a);break}}}e.push("<",u);for(var g=0;g<s;g++){var y=o.item(g);y.prefix=="xmlns"?i.push({prefix:y.localName,namespace:y.value}):y.nodeName=="xmlns"&&i.push({prefix:"",namespace:y.value})}for(var g=0;g<s;g++){var y=o.item(g);if(wO(y,t,i)){var v=y.prefix||"",w=y.namespaceURI;N_(e,v?"xmlns:"+v:"xmlns",w),i.push({prefix:v,namespace:w})}Oh(y,e,t,n,i)}if(a===u&&wO(r,t,i)){var v=r.prefix||"",w=r.namespaceURI;N_(e,v?"xmlns:"+v:"xmlns",w),i.push({prefix:v,namespace:w})}if(b||t&&!/^(?:meta|link|img|br|hr|input)$/i.test(a)){if(e.push(">"),t&&/^script$/i.test(a))for(;b;)b.data?e.push(b.data):Oh(b,e,t,n,i.slice()),b=b.nextSibling;else for(;b;)Oh(b,e,t,n,i.slice()),b=b.nextSibling;e.push("</",u,">")}else e.push("/>");return;case SO:case Ea:for(var b=r.firstChild;b;)Oh(b,e,t,n,i.slice()),b=b.nextSibling;return;case Lh:return N_(e,r.name,r.value);case sw:return e.push(r.data.replace(/[<&>]/g,IO));case EO:return e.push("<![CDATA[",r.data,"]]>");case xO:return e.push("<!--",r.data,"-->");case TO:var E=r.publicId,_=r.systemId;if(e.push("<!DOCTYPE ",r.name),E)e.push(" PUBLIC ",E),_&&_!="."&&e.push(" ",_),e.push(">");else if(_&&_!=".")e.push(" SYSTEM ",_,">");else{var S=r.internalSubset;S&&e.push(" [",S,"]"),e.push(">")}return;case AO:return e.push("<?",r.target," ",r.data,"?>");case _O:return e.push("&",r.nodeName,";");default:e.push("??",r.nodeName)}}function BO(r,e,t){var n;switch(e.nodeType){case gs:n=e.cloneNode(!1),n.ownerDocument=r;case Ea: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(BO(r,i,t)),i=i.nextSibling;return n}function O_(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 va),n.ownerDocument=r,n.nodeType){case gs:var s=e.attributes,a=n.attributes=new ow,u=s.length;a._ownerElement=n;for(var c=0;c<u;c++)n.setAttributeNode(O_(r,s.item(c),!0));break;case Lh:t=!0}if(t)for(var f=e.firstChild;f;)n.appendChild(O_(r,f,t)),f=f.nextSibling;return n}function UO(r,e,t){r[e]=t}try{if(Object.defineProperty){let r=function(e){switch(e.nodeType){case gs:case Ea: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}};s7=r,Object.defineProperty(Ph.prototype,"length",{get:function(){return L_(this),this.$$length}}),Object.defineProperty(Qt.prototype,"textContent",{get:function(){return r(this)},set:function(e){switch(this.nodeType){case gs:case Ea: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}}}),UO=function(e,t,n){e["$$"+t]=n}}}catch{}var s7;Bl.DocumentType=uw;Bl.DOMException=Xr;Bl.DOMImplementation=DO;Bl.Element=bc;Bl.Node=Qt;Bl.NodeList=va;Bl.XMLSerializer=FO});var $O=dt(Fg=>{"use strict";Se();Ce();Te();var jO=Dg().freeze;Fg.XML_ENTITIES=jO({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'});Fg.HTML_ENTITIES=jO({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"});Fg.entityMap=Fg.HTML_ENTITIES});var YO=dt(H_=>{Se();Ce();Te();var jg=Dg().NAMESPACE,W_=/[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]/,zO=new RegExp("[\\-\\.0-9"+W_.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),WO=new RegExp("^"+W_.source+zO.source+"*(?::"+W_.source+zO.source+"*)?$"),Mg=0,Ul=1,Fh=2,Bg=3,Mh=4,Bh=5,Ug=6,fw=7;function Uh(r,e){this.message=r,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,Uh)}Uh.prototype=new Error;Uh.prototype.name=Uh.name;function GO(){}GO.prototype={parse:function(r,e,t){var n=this.domBuilder;n.startDocument(),VO(e,e={}),o7(r,e,t,n,this.errorHandler),n.endDocument()}};function o7(r,e,t,n,i){function o(re){if(re>65535){re-=65536;var O=55296+(re>>10),x=56320+(re&1023);return String.fromCharCode(O,x)}else return String.fromCharCode(re)}function s(re){var O=re.slice(1,-1);return Object.hasOwnProperty.call(t,O)?t[O]:O.charAt(0)==="#"?o(parseInt(O.substr(1).replace("x","0x"))):(i.error("entity not found:"+re),re)}function a(re){if(re>v){var O=r.substring(v,re).replace(/&#?\w+;/g,s);d&&u(v),n.characters(O,0,re-v),v=re}}function u(re,O){for(;re>=f&&(O=h.exec(r));)c=O.index,f=c+O[0].length,d.lineNumber++;d.columnNumber=re-c+1}for(var c=0,f=0,h=/.*(?:\r\n?|\n)|.*$/g,d=n.locator,g=[{currentNSMap:e}],y={},v=0;;){try{var w=r.indexOf("<",v);if(w<0){if(!r.substr(v).match(/^\s*$/)){var b=n.doc,E=b.createTextNode(r.substr(v));b.appendChild(E),n.currentElement=E}return}switch(w>v&&a(w),r.charAt(w+1)){case"/":var ne=r.indexOf(">",w+3),_=r.substring(w+2,ne).replace(/[ \t\n\r]+$/g,""),S=g.pop();ne<0?(_=r.substring(w+2).replace(/[\s<].*/,""),i.error("end tag name: "+_+" is not complete:"+S.tagName),ne=w+1+_.length):_.match(/\s</)&&(_=_.replace(/[\s<].*/,""),i.error("end tag name: "+_+" maybe not complete"),ne=w+1+_.length);var A=S.localNSMap,M=S.tagName==_,I=M||S.tagName&&S.tagName.toLowerCase()==_.toLowerCase();if(I){if(n.endElement(S.uri,S.localName,_),A)for(var q in A)Object.prototype.hasOwnProperty.call(A,q)&&n.endPrefixMapping(q);M||i.fatalError("end tag name: "+_+" is not match the current start tagName:"+S.tagName)}else g.push(S);ne++;break;case"?":d&&u(w),ne=f7(r,w,n);break;case"!":d&&u(w),ne=c7(r,w,n,i);break;default:d&&u(w);var Q=new XO,Z=g[g.length-1].currentNSMap,ne=a7(r,w,Q,Z,s,i),L=Q.length;if(!Q.closed&&u7(r,ne,Q.tagName,y)&&(Q.closed=!0,t.nbsp||i.warning("unclosed xml attribute")),d&&L){for(var $=HO(d,{}),X=0;X<L;X++){var ie=Q[X];u(ie.offset),ie.locator=HO(d,{})}n.locator=$,qO(Q,n,Z)&&g.push(Q),n.locator=d}else qO(Q,n,Z)&&g.push(Q);jg.isHTML(Q.uri)&&!Q.closed?ne=l7(r,ne,Q.tagName,s,n):ne++}}catch(re){if(re instanceof Uh)throw re;i.error("element parse error: "+re),ne=-1}ne>v?v=ne:a(Math.max(w,v)+1)}}function HO(r,e){return e.lineNumber=r.lineNumber,e.columnNumber=r.columnNumber,e}function a7(r,e,t,n,i,o){function s(g,y,v){t.attributeNames.hasOwnProperty(g)&&o.fatalError("Attribute "+g+" redefined"),t.addValue(g,y.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,i),v)}for(var a,u,c=++e,f=Mg;;){var h=r.charAt(c);switch(h){case"=":if(f===Ul)a=r.slice(e,c),f=Bg;else if(f===Fh)f=Bg;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(f===Bg||f===Ul)if(f===Ul&&(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=Bh;else throw new Error("attribute value no end '"+h+"' match");else if(f==Mh)u=r.slice(e,c),s(a,u,e),o.warning('attribute "'+a+'" missed start quot('+h+")!!"),e=c+1,f=Bh;else throw new Error('attribute value must after "="');break;case"/":switch(f){case Mg:t.setTagName(r.slice(e,c));case Bh:case Ug:case fw:f=fw,t.closed=!0;case Mh:case Ul:break;case Fh:t.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return o.error("unexpected end of input"),f==Mg&&t.setTagName(r.slice(e,c)),c;case">":switch(f){case Mg:t.setTagName(r.slice(e,c));case Bh:case Ug:case fw:break;case Mh:case Ul:u=r.slice(e,c),u.slice(-1)==="/"&&(t.closed=!0,u=u.slice(0,-1));case Fh:f===Fh&&(u=a),f==Mh?(o.warning('attribute "'+u+'" missed quot(")!'),s(a,u,e)):((!jg.isHTML(n[""])||!u.match(/^(?:disabled|checked|selected)$/i))&&o.warning('attribute "'+u+'" missed value!! "'+u+'" instead!!'),s(u,u,e));break;case Bg:throw new Error("attribute value missed!!")}return c;case"\x80":h=" ";default:if(h<=" ")switch(f){case Mg:t.setTagName(r.slice(e,c)),f=Ug;break;case Ul:a=r.slice(e,c),f=Fh;break;case Mh:var u=r.slice(e,c);o.warning('attribute "'+u+'" missed quot(")!!'),s(a,u,e);case Bh:f=Ug;break}else switch(f){case Fh:var d=t.tagName;(!jg.isHTML(n[""])||!a.match(/^(?:disabled|checked|selected)$/i))&&o.warning('attribute "'+a+'" missed value!! "'+a+'" instead2!!'),s(a,a,e),e=c,f=Ul;break;case Bh:o.warning('attribute space is required"'+a+'"!!');case Ug:f=Ul,e=c;break;case Bg:f=Mh,e=c;break;case fw:throw new Error("elements closed character '/' and '>' must be connected to")}}c++}}function qO(r,e,t){for(var n=r.tagName,i=null,h=r.length;h--;){var o=r[h],s=o.qName,a=o.value,d=s.indexOf(":");if(d>0)var u=o.prefix=s.slice(0,d),c=s.slice(d+1),f=u==="xmlns"&&c;else c=s,u=null,f=s==="xmlns"&&"";o.localName=c,f!==!1&&(i==null&&(i={},VO(t,t={})),t[f]=i[f]=a,o.uri=jg.XMLNS,e.startPrefixMapping(f,a))}for(var h=r.length;h--;){o=r[h];var u=o.prefix;u&&(u==="xml"&&(o.uri=jg.XML),u!=="xmlns"&&(o.uri=t[u||""]))}var d=n.indexOf(":");d>0?(u=r.prefix=n.slice(0,d),c=r.localName=n.slice(d+1)):(u=null,c=r.localName=n);var g=r.uri=t[u||""];if(e.startElement(g,c,n,r),r.closed){if(e.endElement(g,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 l7(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 u7(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 VO(r,e){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}function c7(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=h7(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 f7(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 XO(){this.attributeNames={}}XO.prototype={setTagName:function(r){if(!WO.test(r))throw new Error("invalid tagName:"+r);this.tagName=r},addValue:function(r,e,t){if(!WO.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 h7(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}H_.XMLReader=GO;H_.ParseError=Uh});var rL=dt(dw=>{Se();Ce();Te();var d7=Dg(),p7=z_(),ZO=$O(),QO=YO(),g7=p7.DOMImplementation,KO=d7.NAMESPACE,m7=QO.ParseError,y7=QO.XMLReader;function eL(r){return r.replace(/\r[\n\u0085]/g,`
81
+ `).replace(/[\r\u0085\u2028]/g,`
82
+ `)}function tL(r){this.options=r||{locator:{}}}tL.prototype.parseFromString=function(r,e){var t=this.options,n=new y7,i=t.domBuilder||new $g,o=t.errorHandler,s=t.locator,a=t.xmlns||{},u=/\/x?html?$/.test(e),c=u?ZO.HTML_ENTITIES:ZO.XML_ENTITIES;s&&i.setDocumentLocator(s),n.errorHandler=b7(o,i,s),n.domBuilder=t.domBuilder||i,u&&(a[""]=KO.HTML),a.xml=a.xml||KO.XML;var f=t.normalizeLineEndings||eL;return r&&typeof r=="string"?n.parse(f(r),a,c):n.errorHandler.error("invalid doc source"),i.doc};function b7(r,e,t){if(!r){if(e instanceof $g)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+q_(t))}||function(){}}return o("warning"),o("error"),o("fatalError"),n}function $g(){this.cdata=!1}function jh(r,e){e.lineNumber=r.lineNumber,e.columnNumber=r.columnNumber}$g.prototype={startDocument:function(){this.doc=new g7().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;hw(this,o),this.currentElement=o,this.locator&&jh(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&&jh(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&&jh(this.locator,t),hw(this,t)},ignorableWhitespace:function(r,e,t){},characters:function(r,e,t){if(r=JO.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&&jh(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=JO.apply(this,arguments);var n=this.doc.createComment(r);this.locator&&jh(this.locator,n),hw(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&&jh(this.locator,i),hw(this,i),this.doc.doctype=i}},warning:function(r){console.warn("[xmldom warning] "+r,q_(this.locator))},error:function(r){console.error("[xmldom error] "+r,q_(this.locator))},fatalError:function(r){throw new m7(r,this.locator)}};function q_(r){if(r)return`
83
+ @`+(r.systemId||"")+"#[line:"+r.lineNumber+",col:"+r.columnNumber+"]"}function JO(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){$g.prototype[r]=function(){return null}});function hw(r,e){r.currentElement?r.currentElement.appendChild(e):r.doc.appendChild(e)}dw.__DOMHandler=$g;dw.normalizeLineEndings=eL;dw.DOMParser=tL});var gw=dt(pw=>{Se();Ce();Te();var nL=z_();pw.DOMImplementation=nL.DOMImplementation;pw.XMLSerializer=nL.XMLSerializer;pw.DOMParser=rL().DOMParser});var aL=dt((BQ,V_)=>{Se();Ce();Te();var G_=(function(r){"use strict";var e=Object.prototype,t=e.hasOwnProperty,n=Object.defineProperty||function(O,x,P){O[x]=P.value},i,o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(O,x,P){return Object.defineProperty(O,x,{value:P,enumerable:!0,configurable:!0,writable:!0}),O[x]}try{c({},"")}catch{c=function(x,P,C){return x[P]=C}}function f(O,x,P,C){var j=x&&x.prototype instanceof b?x:b,U=Object.create(j.prototype),B=new X(C||[]);return n(U,"_invoke",{value:Z(O,P,B)}),U}r.wrap=f;function h(O,x,P){try{return{type:"normal",arg:O.call(x,P)}}catch(C){return{type:"throw",arg:C}}}var d="suspendedStart",g="suspendedYield",y="executing",v="completed",w={};function b(){}function E(){}function _(){}var S={};c(S,s,function(){return this});var A=Object.getPrototypeOf,M=A&&A(A(ie([])));M&&M!==e&&t.call(M,s)&&(S=M);var I=_.prototype=b.prototype=Object.create(S);E.prototype=_,n(I,"constructor",{value:_,configurable:!0}),n(_,"constructor",{value:E,configurable:!0}),E.displayName=c(_,u,"GeneratorFunction");function q(O){["next","throw","return"].forEach(function(x){c(O,x,function(P){return this._invoke(x,P)})})}r.isGeneratorFunction=function(O){var x=typeof O=="function"&&O.constructor;return x?x===E||(x.displayName||x.name)==="GeneratorFunction":!1},r.mark=function(O){return Object.setPrototypeOf?Object.setPrototypeOf(O,_):(O.__proto__=_,c(O,u,"GeneratorFunction")),O.prototype=Object.create(I),O},r.awrap=function(O){return{__await:O}};function Q(O,x){function P(U,B,ee,fe){var Ee=h(O[U],O,B);if(Ee.type==="throw")fe(Ee.arg);else{var te=Ee.arg,H=te.value;return H&&typeof H=="object"&&t.call(H,"__await")?x.resolve(H.__await).then(function(ae){P("next",ae,ee,fe)},function(ae){P("throw",ae,ee,fe)}):x.resolve(H).then(function(ae){te.value=ae,ee(te)},function(ae){return P("throw",ae,ee,fe)})}}var C;function j(U,B){function ee(){return new x(function(fe,Ee){P(U,B,fe,Ee)})}return C=C?C.then(ee,ee):ee()}n(this,"_invoke",{value:j})}q(Q.prototype),c(Q.prototype,a,function(){return this}),r.AsyncIterator=Q,r.async=function(O,x,P,C,j){j===void 0&&(j=Promise);var U=new Q(f(O,x,P,C),j);return r.isGeneratorFunction(x)?U:U.next().then(function(B){return B.done?B.value:U.next()})};function Z(O,x,P){var C=d;return function(U,B){if(C===y)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 ee=P.delegate;if(ee){var fe=ne(ee,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===d)throw C=v,P.arg;P.dispatchException(P.arg)}else P.method==="return"&&P.abrupt("return",P.arg);C=y;var Ee=h(O,x,P);if(Ee.type==="normal"){if(C=P.done?v:g,Ee.arg===w)continue;return{value:Ee.arg,done:P.done}}else Ee.type==="throw"&&(C=v,P.method="throw",P.arg=Ee.arg)}}}function ne(O,x){var P=x.method,C=O.iterator[P];if(C===i)return x.delegate=null,P==="throw"&&O.iterator.return&&(x.method="return",x.arg=i,ne(O,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,O.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[O.resultName]=U.value,x.next=O.nextLoc,x.method!=="return"&&(x.method="next",x.arg=i);else return U;return x.delegate=null,w}q(I),c(I,u,"Generator"),c(I,s,function(){return this}),c(I,"toString",function(){return"[object Generator]"});function L(O){var x={tryLoc:O[0]};1 in O&&(x.catchLoc=O[1]),2 in O&&(x.finallyLoc=O[2],x.afterLoc=O[3]),this.tryEntries.push(x)}function $(O){var x=O.completion||{};x.type="normal",delete x.arg,O.completion=x}function X(O){this.tryEntries=[{tryLoc:"root"}],O.forEach(L,this),this.reset(!0)}r.keys=function(O){var x=Object(O),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(O){if(O){var x=O[s];if(x)return x.call(O);if(typeof O.next=="function")return O;if(!isNaN(O.length)){var P=-1,C=function j(){for(;++P<O.length;)if(t.call(O,P))return j.value=O[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 X.prototype={constructor:X,reset:function(O){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($),!O)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 O=this.tryEntries[0],x=O.completion;if(x.type==="throw")throw x.arg;return this.rval},dispatchException:function(O){if(this.done)throw O;var x=this;function P(fe,Ee){return U.type="throw",U.arg=O,x.next=fe,Ee&&(x.method="next",x.arg=i),!!Ee}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"),ee=t.call(j,"finallyLoc");if(B&&ee){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(ee){if(this.prev<j.finallyLoc)return P(j.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(O,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&&(O==="break"||O==="continue")&&j.tryLoc<=x&&x<=j.finallyLoc&&(j=null);var U=j?j.completion:{};return U.type=O,U.arg=x,j?(this.method="next",this.next=j.finallyLoc,w):this.complete(U)},complete:function(O,x){if(O.type==="throw")throw O.arg;return O.type==="break"||O.type==="continue"?this.next=O.arg:O.type==="return"?(this.rval=this.arg=O.arg,this.method="return",this.next="end"):O.type==="normal"&&x&&(this.next=x),w},finish:function(O){for(var x=this.tryEntries.length-1;x>=0;--x){var P=this.tryEntries[x];if(P.finallyLoc===O)return this.complete(P.completion,P.afterLoc),$(P),w}},catch:function(O){for(var x=this.tryEntries.length-1;x>=0;--x){var P=this.tryEntries[x];if(P.tryLoc===O){var C=P.completion;if(C.type==="throw"){var j=C.arg;$(P)}return j}}throw new Error("illegal catch attempt")},delegateYield:function(O,x,P){return this.delegate={iterator:ie(O),resultName:x,nextLoc:P},this.method==="next"&&(this.arg=i),w}},r})(typeof V_=="object"?V_.exports:{});try{regeneratorRuntime=G_}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=G_:Function("r","regeneratorRuntime = r")(G_)}});var mw=dt((zQ,lL)=>{"use strict";Se();Ce();Te();lL.exports=(r,e)=>`${r}-${e}-${Math.random().toString(16).slice(3,8)}`});var X_=dt((GQ,cL)=>{"use strict";Se();Ce();Te();var x7=mw(),uL=0;cL.exports=({id:r,action:e,payload:t={}})=>{let n=r;return typeof n>"u"&&(n=x7("Job",uL),uL+=1),{id:n,action:e,payload:t}}});var yw=dt(Wg=>{"use strict";Se();Ce();Te();var Y_=!1;Wg.logging=Y_;Wg.setLogging=r=>{Y_=r};Wg.log=(...r)=>Y_?console.log.apply(Wg,r):null});var pL=dt((hL,dL)=>{"use strict";Se();Ce();Te();var S7=X_(),{log:bw}=yw(),T7=mw(),fL=0;dL.exports=()=>{let r=T7("Scheduler",fL),e={},t={},n=[];fL+=1;let i=()=>n.length,o=()=>Object.keys(e).length,s=()=>{if(n.length!==0){let h=Object.keys(e);for(let d=0;d<h.length;d+=1)if(typeof t[h[d]]>"u"){n[0](e[h[d]]);break}}},a=(h,d)=>new Promise((g,y)=>{let v=S7({action:h,payload:d});n.push(async w=>{n.shift(),t[w.id]=v;try{g(await w[h].apply(hL,[...d,v.id]))}catch(b){y(b)}finally{delete t[w.id],s()}}),bw(`[${r}]: Add ${v.id} to JobQueue`),bw(`[${r}]: JobQueue length=${n.length}`),s()});return{addWorker:h=>(e[h.id]=h,bw(`[${r}]: Add ${h.id}`),bw(`[${r}]: Number of workers=${o()}`),s(),h.id),addJob:async(h,...d)=>{if(o()===0)throw Error(`[${r}]: You need to have at least one worker before adding jobs`);return a(h,d)},terminate:async()=>{Object.keys(e).forEach(async h=>{await e[h].terminate()}),n=[]},getQueueLen:i,getNumWorkers:o}}});var mL=dt((nee,gL)=>{"use strict";Se();Ce();Te();gL.exports=r=>{let e={};return typeof WorkerGlobalScope<"u"?e.type="webworker":typeof document=="object"?e.type="browser":typeof $e=="object"&&typeof Zu=="function"&&(e.type="node"),typeof r>"u"?e:e[r]}});var bL=dt((lee,yL)=>{"use strict";Se();Ce();Te();var C7=mL()("type")==="browser",R7=C7?r=>new URL(r,window.location.href).href:r=>r;yL.exports=r=>{let e={...r};return["corePath","workerPath","langPath"].forEach(t=>{r[t]&&(e[t]=R7(e[t]))}),e}});var Z_=dt((hee,wL)=>{"use strict";Se();Ce();Te();wL.exports={TESSERACT_ONLY:0,LSTM_ONLY:1,TESSERACT_LSTM_COMBINED:2,DEFAULT:3}});var vL=dt((mee,D7)=>{D7.exports={name:"tesseract.js",version:"7.0.0",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":"^7.0.0","wasm-feature-detect":"^1.8.0",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 _L=dt((yee,EL)=>{"use strict";Se();Ce();Te();EL.exports={workerBlobURL:!0,logger:()=>{}}});var xL=dt((Eee,AL)=>{"use strict";Se();Ce();Te();var I7=vL().version,k7=_L();AL.exports={...k7,workerPath:`https://cdn.jsdelivr.net/npm/tesseract.js@v${I7}/dist/worker.min.js`}});var TL=dt((See,SL)=>{"use strict";Se();Ce();Te();SL.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 RL=dt((Dee,CL)=>{"use strict";Se();Ce();Te();CL.exports=r=>{r.terminate()}});var IL=dt((Oee,DL)=>{"use strict";Se();Ce();Te();DL.exports=(r,e)=>{r.onmessage=({data:t})=>{e(t)}}});var NL=dt((Mee,kL)=>{"use strict";Se();Ce();Te();kL.exports=async(r,e)=>{r.postMessage(e)}});var LL=dt(($ee,OL)=>{"use strict";Se();Ce();Te();var K_=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)}),J_=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 J_(r.src)),r.tagName==="VIDEO"&&(e=await J_(r.poster)),r.tagName==="CANVAS"&&await new Promise(t=>{r.toBlob(async n=>{e=await K_(n),t()})});else if(typeof OffscreenCanvas<"u"&&r instanceof OffscreenCanvas){let t=await r.convertToBlob();e=await K_(t)}else(r instanceof File||r instanceof Blob)&&(e=await K_(r));return new Uint8Array(e)};OL.exports=J_});var FL=dt((qee,PL)=>{"use strict";Se();Ce();Te();var N7=xL(),O7=TL(),L7=RL(),P7=IL(),F7=NL(),M7=LL();PL.exports={defaultOptions:N7,spawnWorker:O7,terminateWorker:L7,onMessage:P7,send:F7,loadImage:M7}});var Q_=dt((Yee,jL)=>{"use strict";Se();Ce();Te();var B7=bL(),Ao=X_(),{log:ML}=yw(),U7=mw(),vc=Z_(),{defaultOptions:j7,spawnWorker:$7,terminateWorker:z7,onMessage:W7,loadImage:BL,send:H7}=FL(),UL=0;jL.exports=async(r="eng",e=vc.LSTM_ONLY,t={},n={})=>{let i=U7("Worker",UL),{logger:o,errorHandler:s,...a}=B7({...j7,...t}),u={},c=typeof r=="string"?r.split("+"):r,f=e,h=n,d=[vc.DEFAULT,vc.LSTM_ONLY].includes(e)&&!a.legacyCore,g,y,v=new Promise((O,x)=>{y=O,g=x}),w=O=>{g(O.message)},b=$7(a);b.onerror=w,UL+=1;let E=({id:O,action:x,payload:P})=>new Promise((C,j)=>{ML(`[${i}]: Start ${O}, action=${x}`);let U=`${x}-${O}`;u[U]={resolve:C,reject:j},H7(b,{workerId:i,jobId:O,action:x,payload:P})}),_=()=>console.warn("`load` is depreciated and should be removed from code (workers now come pre-loaded)"),S=O=>E(Ao({id:O,action:"load",payload:{options:{lstmOnly:d,corePath:a.corePath,logging:a.logging}}})),A=(O,x,P)=>E(Ao({id:P,action:"FS",payload:{method:"writeFile",args:[O,x]}})),M=(O,x)=>E(Ao({id:x,action:"FS",payload:{method:"readFile",args:[O,{encoding:"utf8"}]}})),I=(O,x)=>E(Ao({id:x,action:"FS",payload:{method:"unlink",args:[O]}})),q=(O,x,P)=>E(Ao({id:P,action:"FS",payload:{method:O,args:x}})),Q=(O,x)=>E(Ao({id:x,action:"loadLanguage",payload:{langs:O,options:{langPath:a.langPath,dataPath:a.dataPath,cachePath:a.cachePath,cacheMethod:a.cacheMethod,gzip:a.gzip,lstmOnly:[vc.DEFAULT,vc.LSTM_ONLY].includes(f)&&!a.legacyLang}}})),Z=(O,x,P,C)=>E(Ao({id:C,action:"initialize",payload:{langs:O,oem:x,config:P}})),ne=(O="eng",x,P,C)=>{if(d&&[vc.TESSERACT_ONLY,vc.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 ee=(typeof O=="string"?O.split("+"):O).filter(fe=>!c.includes(fe));return c.push(...ee),ee.length>0?Q(ee,C).then(()=>Z(O,j,U,C)):Z(O,j,U,C)},L=(O={},x)=>E(Ao({id:x,action:"setParameters",payload:{params:O}})),$=async(O,x={},P={text:!0},C)=>E(Ao({id:C,action:"recognize",payload:{image:await BL(O),options:x,output:P}})),X=async(O,x)=>{if(d)throw Error("`worker.detect` requires Legacy model, which was not loaded.");return E(Ao({id:x,action:"detect",payload:{image:await BL(O)}}))},ie=async()=>(b!==null&&(z7(b),b=null),Promise.resolve());W7(b,({workerId:O,jobId:x,status:P,action:C,data:j})=>{let U=`${C}-${x}`;if(P==="resolve")ML(`[${O}]: 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"&&g(j),s)s(j);else throw Error(j);else P==="progress"&&o({...j,userJobId:x})});let re={id:i,worker:b,load:_,writeText:A,readText:M,removeFile:I,FS:q,reinitialize:ne,setParameters:L,recognize:$,detect:X,terminate:ie};return S().then(()=>Q(r)).then(()=>Z(r,e,n)).then(()=>y(re)).catch(()=>{}),v}});var WL=dt((Qee,zL)=>{"use strict";Se();Ce();Te();var $L=Q_(),q7=async(r,e,t)=>{let n=await $L(e,1,t);return n.recognize(r).finally(async()=>{await n.terminate()})},G7=async(r,e)=>{let t=await $L("osd",0,e);return t.detect(r).finally(async()=>{await t.terminate()})};zL.exports={recognize:q7,detect:G7}});var qL=dt((nte,HL)=>{"use strict";Se();Ce();Te();HL.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 VL=dt((ate,GL)=>{"use strict";Se();Ce();Te();GL.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 YL=dt((fte,XL)=>{"use strict";Se();Ce();Te();aL();var V7=pL(),X7=Q_(),Y7=WL(),Z7=qL(),K7=Z_(),J7=VL(),{setLogging:Q7}=yw();XL.exports={languages:Z7,OEM:K7,PSM:J7,createScheduler:V7,createWorker:X7,setLogging:Q7,...Y7}});var hP={};go(hP,{Deflate:()=>cW,DeflateRaw:()=>fW,Gunzip:()=>hW,Gzip:()=>dW,Inflate:()=>pW,InflateRaw:()=>gW,Unzip:()=>mW,Z_BEST_COMPRESSION:()=>yW,Z_BEST_SPEED:()=>bW,Z_BINARY:()=>wW,Z_BLOCK:()=>vW,Z_BUF_ERROR:()=>EW,Z_DATA_ERROR:()=>_W,Z_DEFAULT_CHUNK:()=>AW,Z_DEFAULT_COMPRESSION:()=>xW,Z_DEFAULT_LEVEL:()=>SW,Z_DEFAULT_MEMLEVEL:()=>TW,Z_DEFAULT_STRATEGY:()=>CW,Z_DEFAULT_WINDOWBITS:()=>RW,Z_DEFLATED:()=>DW,Z_ERRNO:()=>IW,Z_FILTERED:()=>kW,Z_FINISH:()=>NW,Z_FIXED:()=>OW,Z_FULL_FLUSH:()=>LW,Z_HUFFMAN_ONLY:()=>PW,Z_MAX_CHUNK:()=>FW,Z_MAX_LEVEL:()=>MW,Z_MAX_MEMLEVEL:()=>BW,Z_MAX_WINDOWBITS:()=>UW,Z_MIN_CHUNK:()=>jW,Z_MIN_LEVEL:()=>$W,Z_MIN_MEMLEVEL:()=>zW,Z_MIN_WINDOWBITS:()=>WW,Z_NEED_DICT:()=>HW,Z_NO_COMPRESSION:()=>qW,Z_NO_FLUSH:()=>GW,Z_OK:()=>VW,Z_PARTIAL_FLUSH:()=>XW,Z_RLE:()=>YW,Z_STREAM_END:()=>ZW,Z_STREAM_ERROR:()=>KW,Z_SYNC_FLUSH:()=>JW,Z_TEXT:()=>QW,Z_TREES:()=>eH,Z_UNKNOWN:()=>tH,Zlib:()=>rH,codes:()=>nH,createDeflate:()=>iH,createDeflateRaw:()=>sH,createGunzip:()=>oH,createGzip:()=>aH,createInflate:()=>lH,createInflateRaw:()=>uH,createUnzip:()=>cH,default:()=>Je,deflate:()=>fH,deflateRaw:()=>hH,deflateRawSync:()=>dH,deflateSync:()=>pH,gunzip:()=>gH,gunzipSync:()=>mH,gzip:()=>yH,gzipSync:()=>bH,inflate:()=>wH,inflateRaw:()=>vH,inflateRawSync:()=>EH,inflateSync:()=>_H,unzip:()=>AH,unzipSync:()=>xH});function eW(){if(KL)return eA;KL=!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 eA=r,eA}function ww(){if(JL)return zn;JL=!0;var r=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function e(i,o){return Object.prototype.hasOwnProperty.call(i,o)}zn.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},zn.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 zn.setTyped=function(i){i?(zn.Buf8=Uint8Array,zn.Buf16=Uint16Array,zn.Buf32=Int32Array,zn.assign(zn,t)):(zn.Buf8=Array,zn.Buf16=Array,zn.Buf32=Array,zn.assign(zn,n))},zn.setTyped(r),zn}function tW(){if(QL)return Ec;QL=!0;var r=ww(),e=4,t=0,n=1,i=2;function o(D){for(var le=D.length;--le>=0;)D[le]=0}var s=0,a=1,u=2,c=3,f=258,h=29,d=256,g=d+1+h,y=30,v=19,w=2*g+1,b=15,E=16,_=7,S=256,A=16,M=17,I=18,q=[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],Q=[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],Z=[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],L=512,$=new Array((g+2)*2);o($);var X=new Array(y*2);o(X);var ie=new Array(L);o(ie);var re=new Array(f-c+1);o(re);var O=new Array(h);o(O);var x=new Array(y);o(x);function P(D,le,he,_e,ve){this.static_tree=D,this.extra_bits=le,this.extra_base=he,this.elems=_e,this.max_length=ve,this.has_stree=D&&D.length}var C,j,U;function B(D,le){this.dyn_tree=D,this.max_code=0,this.stat_desc=le}function ee(D){return D<256?ie[D]:ie[256+(D>>>7)]}function fe(D,le){D.pending_buf[D.pending++]=le&255,D.pending_buf[D.pending++]=le>>>8&255}function Ee(D,le,he){D.bi_valid>E-he?(D.bi_buf|=le<<D.bi_valid&65535,fe(D,D.bi_buf),D.bi_buf=le>>E-D.bi_valid,D.bi_valid+=he-E):(D.bi_buf|=le<<D.bi_valid&65535,D.bi_valid+=he)}function te(D,le,he){Ee(D,he[le*2],he[le*2+1])}function H(D,le){var he=0;do he|=D&1,D>>>=1,he<<=1;while(--le>0);return he>>>1}function ae(D){D.bi_valid===16?(fe(D,D.bi_buf),D.bi_buf=0,D.bi_valid=0):D.bi_valid>=8&&(D.pending_buf[D.pending++]=D.bi_buf&255,D.bi_buf>>=8,D.bi_valid-=8)}function we(D,le){var he=le.dyn_tree,_e=le.max_code,ve=le.stat_desc.static_tree,Ie=le.stat_desc.has_stree,K=le.stat_desc.extra_bits,Fe=le.stat_desc.extra_base,nt=le.stat_desc.max_length,k,Pe,je,de,De,Me,ft=0;for(de=0;de<=b;de++)D.bl_count[de]=0;for(he[D.heap[D.heap_max]*2+1]=0,k=D.heap_max+1;k<w;k++)Pe=D.heap[k],de=he[he[Pe*2+1]*2+1]+1,de>nt&&(de=nt,ft++),he[Pe*2+1]=de,!(Pe>_e)&&(D.bl_count[de]++,De=0,Pe>=Fe&&(De=K[Pe-Fe]),Me=he[Pe*2],D.opt_len+=Me*(de+De),Ie&&(D.static_len+=Me*(ve[Pe*2+1]+De)));if(ft!==0){do{for(de=nt-1;D.bl_count[de]===0;)de--;D.bl_count[de]--,D.bl_count[de+1]+=2,D.bl_count[nt]--,ft-=2}while(ft>0);for(de=nt;de!==0;de--)for(Pe=D.bl_count[de];Pe!==0;)je=D.heap[--k],!(je>_e)&&(he[je*2+1]!==de&&(D.opt_len+=(de-he[je*2+1])*he[je*2],he[je*2+1]=de),Pe--)}}function xe(D,le,he){var _e=new Array(b+1),ve=0,Ie,K;for(Ie=1;Ie<=b;Ie++)_e[Ie]=ve=ve+he[Ie-1]<<1;for(K=0;K<=le;K++){var Fe=D[K*2+1];Fe!==0&&(D[K*2]=H(_e[Fe]++,Fe))}}function V(){var D,le,he,_e,ve,Ie=new Array(b+1);for(he=0,_e=0;_e<h-1;_e++)for(O[_e]=he,D=0;D<1<<q[_e];D++)re[he++]=_e;for(re[he-1]=_e,ve=0,_e=0;_e<16;_e++)for(x[_e]=ve,D=0;D<1<<Q[_e];D++)ie[ve++]=_e;for(ve>>=7;_e<y;_e++)for(x[_e]=ve<<7,D=0;D<1<<Q[_e]-7;D++)ie[256+ve++]=_e;for(le=0;le<=b;le++)Ie[le]=0;for(D=0;D<=143;)$[D*2+1]=8,D++,Ie[8]++;for(;D<=255;)$[D*2+1]=9,D++,Ie[9]++;for(;D<=279;)$[D*2+1]=7,D++,Ie[7]++;for(;D<=287;)$[D*2+1]=8,D++,Ie[8]++;for(xe($,g+1,Ie),D=0;D<y;D++)X[D*2+1]=5,X[D*2]=H(D,5);C=new P($,q,d+1,g,b),j=new P(X,Q,0,y,b),U=new P(new Array(0),Z,0,v,_)}function F(D){var le;for(le=0;le<g;le++)D.dyn_ltree[le*2]=0;for(le=0;le<y;le++)D.dyn_dtree[le*2]=0;for(le=0;le<v;le++)D.bl_tree[le*2]=0;D.dyn_ltree[S*2]=1,D.opt_len=D.static_len=0,D.last_lit=D.matches=0}function oe(D){D.bi_valid>8?fe(D,D.bi_buf):D.bi_valid>0&&(D.pending_buf[D.pending++]=D.bi_buf),D.bi_buf=0,D.bi_valid=0}function ge(D,le,he,_e){oe(D),fe(D,he),fe(D,~he),r.arraySet(D.pending_buf,D.window,le,he,D.pending),D.pending+=he}function Re(D,le,he,_e){var ve=le*2,Ie=he*2;return D[ve]<D[Ie]||D[ve]===D[Ie]&&_e[le]<=_e[he]}function be(D,le,he){for(var _e=D.heap[he],ve=he<<1;ve<=D.heap_len&&(ve<D.heap_len&&Re(le,D.heap[ve+1],D.heap[ve],D.depth)&&ve++,!Re(le,_e,D.heap[ve],D.depth));)D.heap[he]=D.heap[ve],he=ve,ve<<=1;D.heap[he]=_e}function pe(D,le,he){var _e,ve,Ie=0,K,Fe;if(D.last_lit!==0)do _e=D.pending_buf[D.d_buf+Ie*2]<<8|D.pending_buf[D.d_buf+Ie*2+1],ve=D.pending_buf[D.l_buf+Ie],Ie++,_e===0?te(D,ve,le):(K=re[ve],te(D,K+d+1,le),Fe=q[K],Fe!==0&&(ve-=O[K],Ee(D,ve,Fe)),_e--,K=ee(_e),te(D,K,he),Fe=Q[K],Fe!==0&&(_e-=x[K],Ee(D,_e,Fe)));while(Ie<D.last_lit);te(D,S,le)}function Ae(D,le){var he=le.dyn_tree,_e=le.stat_desc.static_tree,ve=le.stat_desc.has_stree,Ie=le.stat_desc.elems,K,Fe,nt=-1,k;for(D.heap_len=0,D.heap_max=w,K=0;K<Ie;K++)he[K*2]!==0?(D.heap[++D.heap_len]=nt=K,D.depth[K]=0):he[K*2+1]=0;for(;D.heap_len<2;)k=D.heap[++D.heap_len]=nt<2?++nt:0,he[k*2]=1,D.depth[k]=0,D.opt_len--,ve&&(D.static_len-=_e[k*2+1]);for(le.max_code=nt,K=D.heap_len>>1;K>=1;K--)be(D,he,K);k=Ie;do K=D.heap[1],D.heap[1]=D.heap[D.heap_len--],be(D,he,1),Fe=D.heap[1],D.heap[--D.heap_max]=K,D.heap[--D.heap_max]=Fe,he[k*2]=he[K*2]+he[Fe*2],D.depth[k]=(D.depth[K]>=D.depth[Fe]?D.depth[K]:D.depth[Fe])+1,he[K*2+1]=he[Fe*2+1]=k,D.heap[1]=k++,be(D,he,1);while(D.heap_len>=2);D.heap[--D.heap_max]=D.heap[1],we(D,le),xe(he,nt,D.bl_count)}function ze(D,le,he){var _e,ve=-1,Ie,K=le[1],Fe=0,nt=7,k=4;for(K===0&&(nt=138,k=3),le[(he+1)*2+1]=65535,_e=0;_e<=he;_e++)Ie=K,K=le[(_e+1)*2+1],!(++Fe<nt&&Ie===K)&&(Fe<k?D.bl_tree[Ie*2]+=Fe:Ie!==0?(Ie!==ve&&D.bl_tree[Ie*2]++,D.bl_tree[A*2]++):Fe<=10?D.bl_tree[M*2]++:D.bl_tree[I*2]++,Fe=0,ve=Ie,K===0?(nt=138,k=3):Ie===K?(nt=6,k=3):(nt=7,k=4))}function Oe(D,le,he){var _e,ve=-1,Ie,K=le[1],Fe=0,nt=7,k=4;for(K===0&&(nt=138,k=3),_e=0;_e<=he;_e++)if(Ie=K,K=le[(_e+1)*2+1],!(++Fe<nt&&Ie===K)){if(Fe<k)do te(D,Ie,D.bl_tree);while(--Fe!==0);else Ie!==0?(Ie!==ve&&(te(D,Ie,D.bl_tree),Fe--),te(D,A,D.bl_tree),Ee(D,Fe-3,2)):Fe<=10?(te(D,M,D.bl_tree),Ee(D,Fe-3,3)):(te(D,I,D.bl_tree),Ee(D,Fe-11,7));Fe=0,ve=Ie,K===0?(nt=138,k=3):Ie===K?(nt=6,k=3):(nt=7,k=4)}}function ke(D){var le;for(ze(D,D.dyn_ltree,D.l_desc.max_code),ze(D,D.dyn_dtree,D.d_desc.max_code),Ae(D,D.bl_desc),le=v-1;le>=3&&D.bl_tree[ne[le]*2+1]===0;le--);return D.opt_len+=3*(le+1)+5+5+4,le}function Ke(D,le,he,_e){var ve;for(Ee(D,le-257,5),Ee(D,he-1,5),Ee(D,_e-4,4),ve=0;ve<_e;ve++)Ee(D,D.bl_tree[ne[ve]*2+1],3);Oe(D,D.dyn_ltree,le-1),Oe(D,D.dyn_dtree,he-1)}function tt(D){var le=4093624447,he;for(he=0;he<=31;he++,le>>>=1)if(le&1&&D.dyn_ltree[he*2]!==0)return t;if(D.dyn_ltree[18]!==0||D.dyn_ltree[20]!==0||D.dyn_ltree[26]!==0)return n;for(he=32;he<d;he++)if(D.dyn_ltree[he*2]!==0)return n;return t}var it=!1;function T(D){it||(V(),it=!0),D.l_desc=new B(D.dyn_ltree,C),D.d_desc=new B(D.dyn_dtree,j),D.bl_desc=new B(D.bl_tree,U),D.bi_buf=0,D.bi_valid=0,F(D)}function m(D,le,he,_e){Ee(D,(s<<1)+(_e?1:0),3),ge(D,le,he)}function p(D){Ee(D,a<<1,3),te(D,S,$),ae(D)}function R(D,le,he,_e){var ve,Ie,K=0;D.level>0?(D.strm.data_type===i&&(D.strm.data_type=tt(D)),Ae(D,D.l_desc),Ae(D,D.d_desc),K=ke(D),ve=D.opt_len+3+7>>>3,Ie=D.static_len+3+7>>>3,Ie<=ve&&(ve=Ie)):ve=Ie=he+5,he+4<=ve&&le!==-1?m(D,le,he,_e):D.strategy===e||Ie===ve?(Ee(D,(a<<1)+(_e?1:0),3),pe(D,$,X)):(Ee(D,(u<<1)+(_e?1:0),3),Ke(D,D.l_desc.max_code+1,D.d_desc.max_code+1,K+1),pe(D,D.dyn_ltree,D.dyn_dtree)),F(D),_e&&oe(D)}function J(D,le,he){return D.pending_buf[D.d_buf+D.last_lit*2]=le>>>8&255,D.pending_buf[D.d_buf+D.last_lit*2+1]=le&255,D.pending_buf[D.l_buf+D.last_lit]=he&255,D.last_lit++,le===0?D.dyn_ltree[he*2]++:(D.matches++,le--,D.dyn_ltree[(re[he]+d+1)*2]++,D.dyn_dtree[ee(le)*2]++),D.last_lit===D.lit_bufsize-1}return Ec._tr_init=T,Ec._tr_stored_block=m,Ec._tr_flush_block=R,Ec._tr_tally=J,Ec._tr_align=p,Ec}function cP(){if(eP)return tA;eP=!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 tA=r,tA}function fP(){if(tP)return rA;tP=!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 rA=t,rA}function rW(){return rP||(rP=!0,nA={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"}),nA}function nW(){if(nP)return Gs;nP=!0;var r=ww(),e=tW(),t=cP(),n=fP(),i=rW(),o=0,s=1,a=3,u=4,c=5,f=0,h=1,d=-2,g=-3,y=-5,v=-1,w=1,b=2,E=3,_=4,S=0,A=2,M=8,I=9,q=15,Q=8,Z=29,ne=256,L=ne+1+Z,$=30,X=19,ie=2*L+1,re=15,O=3,x=258,P=x+O+1,C=32,j=42,U=69,B=73,ee=91,fe=103,Ee=113,te=666,H=1,ae=2,we=3,xe=4,V=3;function F(k,Pe){return k.msg=i[Pe],Pe}function oe(k){return(k<<1)-(k>4?9:0)}function ge(k){for(var Pe=k.length;--Pe>=0;)k[Pe]=0}function Re(k){var Pe=k.state,je=Pe.pending;je>k.avail_out&&(je=k.avail_out),je!==0&&(r.arraySet(k.output,Pe.pending_buf,Pe.pending_out,je,k.next_out),k.next_out+=je,Pe.pending_out+=je,k.total_out+=je,k.avail_out-=je,Pe.pending-=je,Pe.pending===0&&(Pe.pending_out=0))}function be(k,Pe){e._tr_flush_block(k,k.block_start>=0?k.block_start:-1,k.strstart-k.block_start,Pe),k.block_start=k.strstart,Re(k.strm)}function pe(k,Pe){k.pending_buf[k.pending++]=Pe}function Ae(k,Pe){k.pending_buf[k.pending++]=Pe>>>8&255,k.pending_buf[k.pending++]=Pe&255}function ze(k,Pe,je,de){var De=k.avail_in;return De>de&&(De=de),De===0?0:(k.avail_in-=De,r.arraySet(Pe,k.input,k.next_in,De,je),k.state.wrap===1?k.adler=t(k.adler,Pe,De,je):k.state.wrap===2&&(k.adler=n(k.adler,Pe,De,je)),k.next_in+=De,k.total_in+=De,De)}function Oe(k,Pe){var je=k.max_chain_length,de=k.strstart,De,Me,ft=k.prev_length,ue=k.nice_match,me=k.strstart>k.w_size-P?k.strstart-(k.w_size-P):0,Ge=k.window,Ue=k.w_mask,et=k.prev,gt=k.strstart+x,It=Ge[de+ft-1],xt=Ge[de+ft];k.prev_length>=k.good_match&&(je>>=2),ue>k.lookahead&&(ue=k.lookahead);do if(De=Pe,!(Ge[De+ft]!==xt||Ge[De+ft-1]!==It||Ge[De]!==Ge[de]||Ge[++De]!==Ge[de+1])){de+=2,De++;do;while(Ge[++de]===Ge[++De]&&Ge[++de]===Ge[++De]&&Ge[++de]===Ge[++De]&&Ge[++de]===Ge[++De]&&Ge[++de]===Ge[++De]&&Ge[++de]===Ge[++De]&&Ge[++de]===Ge[++De]&&Ge[++de]===Ge[++De]&&de<gt);if(Me=x-(gt-de),de=gt-x,Me>ft){if(k.match_start=Pe,ft=Me,Me>=ue)break;It=Ge[de+ft-1],xt=Ge[de+ft]}}while((Pe=et[Pe&Ue])>me&&--je!==0);return ft<=k.lookahead?ft:k.lookahead}function ke(k){var Pe=k.w_size,je,de,De,Me,ft;do{if(Me=k.window_size-k.lookahead-k.strstart,k.strstart>=Pe+(Pe-P)){r.arraySet(k.window,k.window,Pe,Pe,0),k.match_start-=Pe,k.strstart-=Pe,k.block_start-=Pe,de=k.hash_size,je=de;do De=k.head[--je],k.head[je]=De>=Pe?De-Pe:0;while(--de);de=Pe,je=de;do De=k.prev[--je],k.prev[je]=De>=Pe?De-Pe:0;while(--de);Me+=Pe}if(k.strm.avail_in===0)break;if(de=ze(k.strm,k.window,k.strstart+k.lookahead,Me),k.lookahead+=de,k.lookahead+k.insert>=O)for(ft=k.strstart-k.insert,k.ins_h=k.window[ft],k.ins_h=(k.ins_h<<k.hash_shift^k.window[ft+1])&k.hash_mask;k.insert&&(k.ins_h=(k.ins_h<<k.hash_shift^k.window[ft+O-1])&k.hash_mask,k.prev[ft&k.w_mask]=k.head[k.ins_h],k.head[k.ins_h]=ft,ft++,k.insert--,!(k.lookahead+k.insert<O)););}while(k.lookahead<P&&k.strm.avail_in!==0)}function Ke(k,Pe){var je=65535;for(je>k.pending_buf_size-5&&(je=k.pending_buf_size-5);;){if(k.lookahead<=1){if(ke(k),k.lookahead===0&&Pe===o)return H;if(k.lookahead===0)break}k.strstart+=k.lookahead,k.lookahead=0;var de=k.block_start+je;if((k.strstart===0||k.strstart>=de)&&(k.lookahead=k.strstart-de,k.strstart=de,be(k,!1),k.strm.avail_out===0)||k.strstart-k.block_start>=k.w_size-P&&(be(k,!1),k.strm.avail_out===0))return H}return k.insert=0,Pe===u?(be(k,!0),k.strm.avail_out===0?we:xe):(k.strstart>k.block_start&&(be(k,!1),k.strm.avail_out===0),H)}function tt(k,Pe){for(var je,de;;){if(k.lookahead<P){if(ke(k),k.lookahead<P&&Pe===o)return H;if(k.lookahead===0)break}if(je=0,k.lookahead>=O&&(k.ins_h=(k.ins_h<<k.hash_shift^k.window[k.strstart+O-1])&k.hash_mask,je=k.prev[k.strstart&k.w_mask]=k.head[k.ins_h],k.head[k.ins_h]=k.strstart),je!==0&&k.strstart-je<=k.w_size-P&&(k.match_length=Oe(k,je)),k.match_length>=O)if(de=e._tr_tally(k,k.strstart-k.match_start,k.match_length-O),k.lookahead-=k.match_length,k.match_length<=k.max_lazy_match&&k.lookahead>=O){k.match_length--;do k.strstart++,k.ins_h=(k.ins_h<<k.hash_shift^k.window[k.strstart+O-1])&k.hash_mask,je=k.prev[k.strstart&k.w_mask]=k.head[k.ins_h],k.head[k.ins_h]=k.strstart;while(--k.match_length!==0);k.strstart++}else k.strstart+=k.match_length,k.match_length=0,k.ins_h=k.window[k.strstart],k.ins_h=(k.ins_h<<k.hash_shift^k.window[k.strstart+1])&k.hash_mask;else de=e._tr_tally(k,0,k.window[k.strstart]),k.lookahead--,k.strstart++;if(de&&(be(k,!1),k.strm.avail_out===0))return H}return k.insert=k.strstart<O-1?k.strstart:O-1,Pe===u?(be(k,!0),k.strm.avail_out===0?we:xe):k.last_lit&&(be(k,!1),k.strm.avail_out===0)?H:ae}function it(k,Pe){for(var je,de,De;;){if(k.lookahead<P){if(ke(k),k.lookahead<P&&Pe===o)return H;if(k.lookahead===0)break}if(je=0,k.lookahead>=O&&(k.ins_h=(k.ins_h<<k.hash_shift^k.window[k.strstart+O-1])&k.hash_mask,je=k.prev[k.strstart&k.w_mask]=k.head[k.ins_h],k.head[k.ins_h]=k.strstart),k.prev_length=k.match_length,k.prev_match=k.match_start,k.match_length=O-1,je!==0&&k.prev_length<k.max_lazy_match&&k.strstart-je<=k.w_size-P&&(k.match_length=Oe(k,je),k.match_length<=5&&(k.strategy===w||k.match_length===O&&k.strstart-k.match_start>4096)&&(k.match_length=O-1)),k.prev_length>=O&&k.match_length<=k.prev_length){De=k.strstart+k.lookahead-O,de=e._tr_tally(k,k.strstart-1-k.prev_match,k.prev_length-O),k.lookahead-=k.prev_length-1,k.prev_length-=2;do++k.strstart<=De&&(k.ins_h=(k.ins_h<<k.hash_shift^k.window[k.strstart+O-1])&k.hash_mask,je=k.prev[k.strstart&k.w_mask]=k.head[k.ins_h],k.head[k.ins_h]=k.strstart);while(--k.prev_length!==0);if(k.match_available=0,k.match_length=O-1,k.strstart++,de&&(be(k,!1),k.strm.avail_out===0))return H}else if(k.match_available){if(de=e._tr_tally(k,0,k.window[k.strstart-1]),de&&be(k,!1),k.strstart++,k.lookahead--,k.strm.avail_out===0)return H}else k.match_available=1,k.strstart++,k.lookahead--}return k.match_available&&(de=e._tr_tally(k,0,k.window[k.strstart-1]),k.match_available=0),k.insert=k.strstart<O-1?k.strstart:O-1,Pe===u?(be(k,!0),k.strm.avail_out===0?we:xe):k.last_lit&&(be(k,!1),k.strm.avail_out===0)?H:ae}function T(k,Pe){for(var je,de,De,Me,ft=k.window;;){if(k.lookahead<=x){if(ke(k),k.lookahead<=x&&Pe===o)return H;if(k.lookahead===0)break}if(k.match_length=0,k.lookahead>=O&&k.strstart>0&&(De=k.strstart-1,de=ft[De],de===ft[++De]&&de===ft[++De]&&de===ft[++De])){Me=k.strstart+x;do;while(de===ft[++De]&&de===ft[++De]&&de===ft[++De]&&de===ft[++De]&&de===ft[++De]&&de===ft[++De]&&de===ft[++De]&&de===ft[++De]&&De<Me);k.match_length=x-(Me-De),k.match_length>k.lookahead&&(k.match_length=k.lookahead)}if(k.match_length>=O?(je=e._tr_tally(k,1,k.match_length-O),k.lookahead-=k.match_length,k.strstart+=k.match_length,k.match_length=0):(je=e._tr_tally(k,0,k.window[k.strstart]),k.lookahead--,k.strstart++),je&&(be(k,!1),k.strm.avail_out===0))return H}return k.insert=0,Pe===u?(be(k,!0),k.strm.avail_out===0?we:xe):k.last_lit&&(be(k,!1),k.strm.avail_out===0)?H:ae}function m(k,Pe){for(var je;;){if(k.lookahead===0&&(ke(k),k.lookahead===0)){if(Pe===o)return H;break}if(k.match_length=0,je=e._tr_tally(k,0,k.window[k.strstart]),k.lookahead--,k.strstart++,je&&(be(k,!1),k.strm.avail_out===0))return H}return k.insert=0,Pe===u?(be(k,!0),k.strm.avail_out===0?we:xe):k.last_lit&&(be(k,!1),k.strm.avail_out===0)?H:ae}function p(k,Pe,je,de,De){this.good_length=k,this.max_lazy=Pe,this.nice_length=je,this.max_chain=de,this.func=De}var R;R=[new p(0,0,0,0,Ke),new p(4,4,8,4,tt),new p(4,5,16,8,tt),new p(4,6,32,32,tt),new p(4,4,16,16,it),new p(8,16,32,32,it),new p(8,16,128,128,it),new p(8,32,128,256,it),new p(32,128,258,1024,it),new p(32,258,258,4096,it)];function J(k){k.window_size=2*k.w_size,ge(k.head),k.max_lazy_match=R[k.level].max_lazy,k.good_match=R[k.level].good_length,k.nice_match=R[k.level].nice_length,k.max_chain_length=R[k.level].max_chain,k.strstart=0,k.block_start=0,k.lookahead=0,k.insert=0,k.match_length=k.prev_length=O-1,k.match_available=0,k.ins_h=0}function D(){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=M,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*X+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*L+1),ge(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new r.Buf16(2*L+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(k){var Pe;return!k||!k.state?F(k,d):(k.total_in=k.total_out=0,k.data_type=A,Pe=k.state,Pe.pending=0,Pe.pending_out=0,Pe.wrap<0&&(Pe.wrap=-Pe.wrap),Pe.status=Pe.wrap?j:Ee,k.adler=Pe.wrap===2?0:1,Pe.last_flush=o,e._tr_init(Pe),f)}function he(k){var Pe=le(k);return Pe===f&&J(k.state),Pe}function _e(k,Pe){return!k||!k.state||k.state.wrap!==2?d:(k.state.gzhead=Pe,f)}function ve(k,Pe,je,de,De,Me){if(!k)return d;var ft=1;if(Pe===v&&(Pe=6),de<0?(ft=0,de=-de):de>15&&(ft=2,de-=16),De<1||De>I||je!==M||de<8||de>15||Pe<0||Pe>9||Me<0||Me>_)return F(k,d);de===8&&(de=9);var ue=new D;return k.state=ue,ue.strm=k,ue.wrap=ft,ue.gzhead=null,ue.w_bits=de,ue.w_size=1<<ue.w_bits,ue.w_mask=ue.w_size-1,ue.hash_bits=De+7,ue.hash_size=1<<ue.hash_bits,ue.hash_mask=ue.hash_size-1,ue.hash_shift=~~((ue.hash_bits+O-1)/O),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<<De+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=je,he(k)}function Ie(k,Pe){return ve(k,Pe,M,q,Q,S)}function K(k,Pe){var je,de,De,Me;if(!k||!k.state||Pe>c||Pe<0)return k?F(k,d):d;if(de=k.state,!k.output||!k.input&&k.avail_in!==0||de.status===te&&Pe!==u)return F(k,k.avail_out===0?y:d);if(de.strm=k,je=de.last_flush,de.last_flush=Pe,de.status===j)if(de.wrap===2)k.adler=0,pe(de,31),pe(de,139),pe(de,8),de.gzhead?(pe(de,(de.gzhead.text?1:0)+(de.gzhead.hcrc?2:0)+(de.gzhead.extra?4:0)+(de.gzhead.name?8:0)+(de.gzhead.comment?16:0)),pe(de,de.gzhead.time&255),pe(de,de.gzhead.time>>8&255),pe(de,de.gzhead.time>>16&255),pe(de,de.gzhead.time>>24&255),pe(de,de.level===9?2:de.strategy>=b||de.level<2?4:0),pe(de,de.gzhead.os&255),de.gzhead.extra&&de.gzhead.extra.length&&(pe(de,de.gzhead.extra.length&255),pe(de,de.gzhead.extra.length>>8&255)),de.gzhead.hcrc&&(k.adler=n(k.adler,de.pending_buf,de.pending,0)),de.gzindex=0,de.status=U):(pe(de,0),pe(de,0),pe(de,0),pe(de,0),pe(de,0),pe(de,de.level===9?2:de.strategy>=b||de.level<2?4:0),pe(de,V),de.status=Ee);else{var ft=M+(de.w_bits-8<<4)<<8,ue=-1;de.strategy>=b||de.level<2?ue=0:de.level<6?ue=1:de.level===6?ue=2:ue=3,ft|=ue<<6,de.strstart!==0&&(ft|=C),ft+=31-ft%31,de.status=Ee,Ae(de,ft),de.strstart!==0&&(Ae(de,k.adler>>>16),Ae(de,k.adler&65535)),k.adler=1}if(de.status===U)if(de.gzhead.extra){for(De=de.pending;de.gzindex<(de.gzhead.extra.length&65535)&&!(de.pending===de.pending_buf_size&&(de.gzhead.hcrc&&de.pending>De&&(k.adler=n(k.adler,de.pending_buf,de.pending-De,De)),Re(k),De=de.pending,de.pending===de.pending_buf_size));)pe(de,de.gzhead.extra[de.gzindex]&255),de.gzindex++;de.gzhead.hcrc&&de.pending>De&&(k.adler=n(k.adler,de.pending_buf,de.pending-De,De)),de.gzindex===de.gzhead.extra.length&&(de.gzindex=0,de.status=B)}else de.status=B;if(de.status===B)if(de.gzhead.name){De=de.pending;do{if(de.pending===de.pending_buf_size&&(de.gzhead.hcrc&&de.pending>De&&(k.adler=n(k.adler,de.pending_buf,de.pending-De,De)),Re(k),De=de.pending,de.pending===de.pending_buf_size)){Me=1;break}de.gzindex<de.gzhead.name.length?Me=de.gzhead.name.charCodeAt(de.gzindex++)&255:Me=0,pe(de,Me)}while(Me!==0);de.gzhead.hcrc&&de.pending>De&&(k.adler=n(k.adler,de.pending_buf,de.pending-De,De)),Me===0&&(de.gzindex=0,de.status=ee)}else de.status=ee;if(de.status===ee)if(de.gzhead.comment){De=de.pending;do{if(de.pending===de.pending_buf_size&&(de.gzhead.hcrc&&de.pending>De&&(k.adler=n(k.adler,de.pending_buf,de.pending-De,De)),Re(k),De=de.pending,de.pending===de.pending_buf_size)){Me=1;break}de.gzindex<de.gzhead.comment.length?Me=de.gzhead.comment.charCodeAt(de.gzindex++)&255:Me=0,pe(de,Me)}while(Me!==0);de.gzhead.hcrc&&de.pending>De&&(k.adler=n(k.adler,de.pending_buf,de.pending-De,De)),Me===0&&(de.status=fe)}else de.status=fe;if(de.status===fe&&(de.gzhead.hcrc?(de.pending+2>de.pending_buf_size&&Re(k),de.pending+2<=de.pending_buf_size&&(pe(de,k.adler&255),pe(de,k.adler>>8&255),k.adler=0,de.status=Ee)):de.status=Ee),de.pending!==0){if(Re(k),k.avail_out===0)return de.last_flush=-1,f}else if(k.avail_in===0&&oe(Pe)<=oe(je)&&Pe!==u)return F(k,y);if(de.status===te&&k.avail_in!==0)return F(k,y);if(k.avail_in!==0||de.lookahead!==0||Pe!==o&&de.status!==te){var me=de.strategy===b?m(de,Pe):de.strategy===E?T(de,Pe):R[de.level].func(de,Pe);if((me===we||me===xe)&&(de.status=te),me===H||me===we)return k.avail_out===0&&(de.last_flush=-1),f;if(me===ae&&(Pe===s?e._tr_align(de):Pe!==c&&(e._tr_stored_block(de,0,0,!1),Pe===a&&(ge(de.head),de.lookahead===0&&(de.strstart=0,de.block_start=0,de.insert=0))),Re(k),k.avail_out===0))return de.last_flush=-1,f}return Pe!==u?f:de.wrap<=0?h:(de.wrap===2?(pe(de,k.adler&255),pe(de,k.adler>>8&255),pe(de,k.adler>>16&255),pe(de,k.adler>>24&255),pe(de,k.total_in&255),pe(de,k.total_in>>8&255),pe(de,k.total_in>>16&255),pe(de,k.total_in>>24&255)):(Ae(de,k.adler>>>16),Ae(de,k.adler&65535)),Re(k),de.wrap>0&&(de.wrap=-de.wrap),de.pending!==0?f:h)}function Fe(k){var Pe;return!k||!k.state?d:(Pe=k.state.status,Pe!==j&&Pe!==U&&Pe!==B&&Pe!==ee&&Pe!==fe&&Pe!==Ee&&Pe!==te?F(k,d):(k.state=null,Pe===Ee?F(k,g):f))}function nt(k,Pe){var je=Pe.length,de,De,Me,ft,ue,me,Ge,Ue;if(!k||!k.state||(de=k.state,ft=de.wrap,ft===2||ft===1&&de.status!==j||de.lookahead))return d;for(ft===1&&(k.adler=t(k.adler,Pe,je,0)),de.wrap=0,je>=de.w_size&&(ft===0&&(ge(de.head),de.strstart=0,de.block_start=0,de.insert=0),Ue=new r.Buf8(de.w_size),r.arraySet(Ue,Pe,je-de.w_size,de.w_size,0),Pe=Ue,je=de.w_size),ue=k.avail_in,me=k.next_in,Ge=k.input,k.avail_in=je,k.next_in=0,k.input=Pe,ke(de);de.lookahead>=O;){De=de.strstart,Me=de.lookahead-(O-1);do de.ins_h=(de.ins_h<<de.hash_shift^de.window[De+O-1])&de.hash_mask,de.prev[De&de.w_mask]=de.head[de.ins_h],de.head[de.ins_h]=De,De++;while(--Me);de.strstart=De,de.lookahead=O-1,ke(de)}return de.strstart+=de.lookahead,de.block_start=de.strstart,de.insert=de.lookahead,de.lookahead=0,de.match_length=de.prev_length=O-1,de.match_available=0,k.next_in=me,k.input=Ge,k.avail_in=ue,de.wrap=ft,f}return Gs.deflateInit=Ie,Gs.deflateInit2=ve,Gs.deflateReset=he,Gs.deflateResetKeep=le,Gs.deflateSetHeader=_e,Gs.deflate=K,Gs.deflateEnd=Fe,Gs.deflateSetDictionary=nt,Gs.deflateInfo="pako deflate (from Nodeca project)",Gs}function iW(){if(iP)return iA;iP=!0;var r=30,e=12;return iA=function(n,i){var o,s,a,u,c,f,h,d,g,y,v,w,b,E,_,S,A,M,I,q,Q,Z,ne,L,$;o=n.state,s=n.next_in,L=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,d=o.wsize,g=o.whave,y=o.wnext,v=o.window,w=o.hold,b=o.bits,E=o.lencode,_=o.distcode,S=(1<<o.lenbits)-1,A=(1<<o.distbits)-1;e:do{b<15&&(w+=L[s++]<<b,b+=8,w+=L[s++]<<b,b+=8),M=E[w&S];t:for(;;){if(I=M>>>24,w>>>=I,b-=I,I=M>>>16&255,I===0)$[u++]=M&65535;else if(I&16){q=M&65535,I&=15,I&&(b<I&&(w+=L[s++]<<b,b+=8),q+=w&(1<<I)-1,w>>>=I,b-=I),b<15&&(w+=L[s++]<<b,b+=8,w+=L[s++]<<b,b+=8),M=_[w&A];r:for(;;){if(I=M>>>24,w>>>=I,b-=I,I=M>>>16&255,I&16){if(Q=M&65535,I&=15,b<I&&(w+=L[s++]<<b,b+=8,b<I&&(w+=L[s++]<<b,b+=8)),Q+=w&(1<<I)-1,Q>h){n.msg="invalid distance too far back",o.mode=r;break e}if(w>>>=I,b-=I,I=u-c,Q>I){if(I=Q-I,I>g&&o.sane){n.msg="invalid distance too far back",o.mode=r;break e}if(Z=0,ne=v,y===0){if(Z+=d-I,I<q){q-=I;do $[u++]=v[Z++];while(--I);Z=u-Q,ne=$}}else if(y<I){if(Z+=d+y-I,I-=y,I<q){q-=I;do $[u++]=v[Z++];while(--I);if(Z=0,y<q){I=y,q-=I;do $[u++]=v[Z++];while(--I);Z=u-Q,ne=$}}}else if(Z+=y-I,I<q){q-=I;do $[u++]=v[Z++];while(--I);Z=u-Q,ne=$}for(;q>2;)$[u++]=ne[Z++],$[u++]=ne[Z++],$[u++]=ne[Z++],q-=3;q&&($[u++]=ne[Z++],q>1&&($[u++]=ne[Z++]))}else{Z=u-Q;do $[u++]=$[Z++],$[u++]=$[Z++],$[u++]=$[Z++],q-=3;while(q>2);q&&($[u++]=$[Z++],q>1&&($[u++]=$[Z++]))}}else if((I&64)===0){M=_[(M&65535)+(w&(1<<I)-1)];continue r}else{n.msg="invalid distance code",o.mode=r;break e}break}}else if((I&64)===0){M=E[(M&65535)+(w&(1<<I)-1)];continue t}else if(I&32){o.mode=e;break e}else{n.msg="invalid literal/length code",o.mode=r;break e}break}}while(s<a&&u<f);q=b>>3,s-=q,b-=q<<3,w&=(1<<b)-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=b},iA}function sW(){if(sP)return sA;sP=!0;var r=ww(),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 sA=function(d,g,y,v,w,b,E,_){var S=_.bits,A=0,M=0,I=0,q=0,Q=0,Z=0,ne=0,L=0,$=0,X=0,ie,re,O,x,P,C=null,j=0,U,B=new r.Buf16(e+1),ee=new r.Buf16(e+1),fe=null,Ee=0,te,H,ae;for(A=0;A<=e;A++)B[A]=0;for(M=0;M<v;M++)B[g[y+M]]++;for(Q=S,q=e;q>=1&&B[q]===0;q--);if(Q>q&&(Q=q),q===0)return w[b++]=1<<24|64<<16|0,w[b++]=1<<24|64<<16|0,_.bits=1,0;for(I=1;I<q&&B[I]===0;I++);for(Q<I&&(Q=I),L=1,A=1;A<=e;A++)if(L<<=1,L-=B[A],L<0)return-1;if(L>0&&(d===i||q!==1))return-1;for(ee[1]=0,A=1;A<e;A++)ee[A+1]=ee[A]+B[A];for(M=0;M<v;M++)g[y+M]!==0&&(E[ee[g[y+M]]++]=M);if(d===i?(C=fe=E,U=19):d===o?(C=a,j-=257,fe=u,Ee-=257,U=256):(C=c,fe=f,U=-1),X=0,M=0,A=I,P=b,Z=Q,ne=0,O=-1,$=1<<Q,x=$-1,d===o&&$>t||d===s&&$>n)return 1;for(;;){te=A-ne,E[M]<U?(H=0,ae=E[M]):E[M]>U?(H=fe[Ee+E[M]],ae=C[j+E[M]]):(H=96,ae=0),ie=1<<A-ne,re=1<<Z,I=re;do re-=ie,w[P+(X>>ne)+re]=te<<24|H<<16|ae|0;while(re!==0);for(ie=1<<A-1;X&ie;)ie>>=1;if(ie!==0?(X&=ie-1,X+=ie):X=0,M++,--B[A]===0){if(A===q)break;A=g[y+E[M]]}if(A>Q&&(X&x)!==O){for(ne===0&&(ne=Q),P+=I,Z=A-ne,L=1<<Z;Z+ne<q&&(L-=B[Z+ne],!(L<=0));)Z++,L<<=1;if($+=1<<Z,d===o&&$>t||d===s&&$>n)return 1;O=X&x,w[O]=Q<<24|Z<<16|P-b|0}}return X!==0&&(w[P+X]=A-ne<<24|64<<16|0),_.bits=Q,0},sA}function oW(){if(oP)return ys;oP=!0;var r=ww(),e=cP(),t=fP(),n=iW(),i=sW(),o=0,s=1,a=2,u=4,c=5,f=6,h=0,d=1,g=2,y=-2,v=-3,w=-4,b=-5,E=8,_=1,S=2,A=3,M=4,I=5,q=6,Q=7,Z=8,ne=9,L=10,$=11,X=12,ie=13,re=14,O=15,x=16,P=17,C=18,j=19,U=20,B=21,ee=22,fe=23,Ee=24,te=25,H=26,ae=27,we=28,xe=29,V=30,F=31,oe=32,ge=852,Re=592,be=15,pe=be;function Ae(ve){return(ve>>>24&255)+(ve>>>8&65280)+((ve&65280)<<8)+((ve&255)<<24)}function ze(){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 Oe(ve){var Ie;return!ve||!ve.state?y:(Ie=ve.state,ve.total_in=ve.total_out=Ie.total=0,ve.msg="",Ie.wrap&&(ve.adler=Ie.wrap&1),Ie.mode=_,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(Re),Ie.sane=1,Ie.back=-1,h)}function ke(ve){var Ie;return!ve||!ve.state?y:(Ie=ve.state,Ie.wsize=0,Ie.whave=0,Ie.wnext=0,Oe(ve))}function Ke(ve,Ie){var K,Fe;return!ve||!ve.state||(Fe=ve.state,Ie<0?(K=0,Ie=-Ie):(K=(Ie>>4)+1,Ie<48&&(Ie&=15)),Ie&&(Ie<8||Ie>15))?y:(Fe.window!==null&&Fe.wbits!==Ie&&(Fe.window=null),Fe.wrap=K,Fe.wbits=Ie,ke(ve))}function tt(ve,Ie){var K,Fe;return ve?(Fe=new ze,ve.state=Fe,Fe.window=null,K=Ke(ve,Ie),K!==h&&(ve.state=null),K):y}function it(ve){return tt(ve,pe)}var T=!0,m,p;function R(ve){if(T){var Ie;for(m=new r.Buf32(512),p=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,m,0,ve.work,{bits:9}),Ie=0;Ie<32;)ve.lens[Ie++]=5;i(a,ve.lens,0,32,p,0,ve.work,{bits:5}),T=!1}ve.lencode=m,ve.lenbits=9,ve.distcode=p,ve.distbits=5}function J(ve,Ie,K,Fe){var nt,k=ve.state;return k.window===null&&(k.wsize=1<<k.wbits,k.wnext=0,k.whave=0,k.window=new r.Buf8(k.wsize)),Fe>=k.wsize?(r.arraySet(k.window,Ie,K-k.wsize,k.wsize,0),k.wnext=0,k.whave=k.wsize):(nt=k.wsize-k.wnext,nt>Fe&&(nt=Fe),r.arraySet(k.window,Ie,K-Fe,nt,k.wnext),Fe-=nt,Fe?(r.arraySet(k.window,Ie,K-Fe,Fe,0),k.wnext=Fe,k.whave=k.wsize):(k.wnext+=nt,k.wnext===k.wsize&&(k.wnext=0),k.whave<k.wsize&&(k.whave+=nt))),0}function D(ve,Ie){var K,Fe,nt,k,Pe,je,de,De,Me,ft,ue,me,Ge,Ue,et=0,gt,It,xt,hr,Oi,Zn,Yt,Lr,wr=new r.Buf8(4),Ht,Jt,nn=[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 y;K=ve.state,K.mode===X&&(K.mode=ie),Pe=ve.next_out,nt=ve.output,de=ve.avail_out,k=ve.next_in,Fe=ve.input,je=ve.avail_in,De=K.hold,Me=K.bits,ft=je,ue=de,Lr=h;e:for(;;)switch(K.mode){case _:if(K.wrap===0){K.mode=ie;break}for(;Me<16;){if(je===0)break e;je--,De+=Fe[k++]<<Me,Me+=8}if(K.wrap&2&&De===35615){K.check=0,wr[0]=De&255,wr[1]=De>>>8&255,K.check=t(K.check,wr,2,0),De=0,Me=0,K.mode=S;break}if(K.flags=0,K.head&&(K.head.done=!1),!(K.wrap&1)||(((De&255)<<8)+(De>>8))%31){ve.msg="incorrect header check",K.mode=V;break}if((De&15)!==E){ve.msg="unknown compression method",K.mode=V;break}if(De>>>=4,Me-=4,Yt=(De&15)+8,K.wbits===0)K.wbits=Yt;else if(Yt>K.wbits){ve.msg="invalid window size",K.mode=V;break}K.dmax=1<<Yt,ve.adler=K.check=1,K.mode=De&512?L:X,De=0,Me=0;break;case S:for(;Me<16;){if(je===0)break e;je--,De+=Fe[k++]<<Me,Me+=8}if(K.flags=De,(K.flags&255)!==E){ve.msg="unknown compression method",K.mode=V;break}if(K.flags&57344){ve.msg="unknown header flags set",K.mode=V;break}K.head&&(K.head.text=De>>8&1),K.flags&512&&(wr[0]=De&255,wr[1]=De>>>8&255,K.check=t(K.check,wr,2,0)),De=0,Me=0,K.mode=A;case A:for(;Me<32;){if(je===0)break e;je--,De+=Fe[k++]<<Me,Me+=8}K.head&&(K.head.time=De),K.flags&512&&(wr[0]=De&255,wr[1]=De>>>8&255,wr[2]=De>>>16&255,wr[3]=De>>>24&255,K.check=t(K.check,wr,4,0)),De=0,Me=0,K.mode=M;case M:for(;Me<16;){if(je===0)break e;je--,De+=Fe[k++]<<Me,Me+=8}K.head&&(K.head.xflags=De&255,K.head.os=De>>8),K.flags&512&&(wr[0]=De&255,wr[1]=De>>>8&255,K.check=t(K.check,wr,2,0)),De=0,Me=0,K.mode=I;case I:if(K.flags&1024){for(;Me<16;){if(je===0)break e;je--,De+=Fe[k++]<<Me,Me+=8}K.length=De,K.head&&(K.head.extra_len=De),K.flags&512&&(wr[0]=De&255,wr[1]=De>>>8&255,K.check=t(K.check,wr,2,0)),De=0,Me=0}else K.head&&(K.head.extra=null);K.mode=q;case q:if(K.flags&1024&&(me=K.length,me>je&&(me=je),me&&(K.head&&(Yt=K.head.extra_len-K.length,K.head.extra||(K.head.extra=new Array(K.head.extra_len)),r.arraySet(K.head.extra,Fe,k,me,Yt)),K.flags&512&&(K.check=t(K.check,Fe,me,k)),je-=me,k+=me,K.length-=me),K.length))break e;K.length=0,K.mode=Q;case Q:if(K.flags&2048){if(je===0)break e;me=0;do Yt=Fe[k+me++],K.head&&Yt&&K.length<65536&&(K.head.name+=String.fromCharCode(Yt));while(Yt&&me<je);if(K.flags&512&&(K.check=t(K.check,Fe,me,k)),je-=me,k+=me,Yt)break e}else K.head&&(K.head.name=null);K.length=0,K.mode=Z;case Z:if(K.flags&4096){if(je===0)break e;me=0;do Yt=Fe[k+me++],K.head&&Yt&&K.length<65536&&(K.head.comment+=String.fromCharCode(Yt));while(Yt&&me<je);if(K.flags&512&&(K.check=t(K.check,Fe,me,k)),je-=me,k+=me,Yt)break e}else K.head&&(K.head.comment=null);K.mode=ne;case ne:if(K.flags&512){for(;Me<16;){if(je===0)break e;je--,De+=Fe[k++]<<Me,Me+=8}if(De!==(K.check&65535)){ve.msg="header crc mismatch",K.mode=V;break}De=0,Me=0}K.head&&(K.head.hcrc=K.flags>>9&1,K.head.done=!0),ve.adler=K.check=0,K.mode=X;break;case L:for(;Me<32;){if(je===0)break e;je--,De+=Fe[k++]<<Me,Me+=8}ve.adler=K.check=Ae(De),De=0,Me=0,K.mode=$;case $:if(K.havedict===0)return ve.next_out=Pe,ve.avail_out=de,ve.next_in=k,ve.avail_in=je,K.hold=De,K.bits=Me,g;ve.adler=K.check=1,K.mode=X;case X:if(Ie===c||Ie===f)break e;case ie:if(K.last){De>>>=Me&7,Me-=Me&7,K.mode=ae;break}for(;Me<3;){if(je===0)break e;je--,De+=Fe[k++]<<Me,Me+=8}switch(K.last=De&1,De>>>=1,Me-=1,De&3){case 0:K.mode=re;break;case 1:if(R(K),K.mode=U,Ie===f){De>>>=2,Me-=2;break e}break;case 2:K.mode=P;break;case 3:ve.msg="invalid block type",K.mode=V}De>>>=2,Me-=2;break;case re:for(De>>>=Me&7,Me-=Me&7;Me<32;){if(je===0)break e;je--,De+=Fe[k++]<<Me,Me+=8}if((De&65535)!==(De>>>16^65535)){ve.msg="invalid stored block lengths",K.mode=V;break}if(K.length=De&65535,De=0,Me=0,K.mode=O,Ie===f)break e;case O:K.mode=x;case x:if(me=K.length,me){if(me>je&&(me=je),me>de&&(me=de),me===0)break e;r.arraySet(nt,Fe,k,me,Pe),je-=me,k+=me,de-=me,Pe+=me,K.length-=me;break}K.mode=X;break;case P:for(;Me<14;){if(je===0)break e;je--,De+=Fe[k++]<<Me,Me+=8}if(K.nlen=(De&31)+257,De>>>=5,Me-=5,K.ndist=(De&31)+1,De>>>=5,Me-=5,K.ncode=(De&15)+4,De>>>=4,Me-=4,K.nlen>286||K.ndist>30){ve.msg="too many length or distance symbols",K.mode=V;break}K.have=0,K.mode=C;case C:for(;K.have<K.ncode;){for(;Me<3;){if(je===0)break e;je--,De+=Fe[k++]<<Me,Me+=8}K.lens[nn[K.have++]]=De&7,De>>>=3,Me-=3}for(;K.have<19;)K.lens[nn[K.have++]]=0;if(K.lencode=K.lendyn,K.lenbits=7,Ht={bits:K.lenbits},Lr=i(o,K.lens,0,19,K.lencode,0,K.work,Ht),K.lenbits=Ht.bits,Lr){ve.msg="invalid code lengths set",K.mode=V;break}K.have=0,K.mode=j;case j:for(;K.have<K.nlen+K.ndist;){for(;et=K.lencode[De&(1<<K.lenbits)-1],gt=et>>>24,It=et>>>16&255,xt=et&65535,!(gt<=Me);){if(je===0)break e;je--,De+=Fe[k++]<<Me,Me+=8}if(xt<16)De>>>=gt,Me-=gt,K.lens[K.have++]=xt;else{if(xt===16){for(Jt=gt+2;Me<Jt;){if(je===0)break e;je--,De+=Fe[k++]<<Me,Me+=8}if(De>>>=gt,Me-=gt,K.have===0){ve.msg="invalid bit length repeat",K.mode=V;break}Yt=K.lens[K.have-1],me=3+(De&3),De>>>=2,Me-=2}else if(xt===17){for(Jt=gt+3;Me<Jt;){if(je===0)break e;je--,De+=Fe[k++]<<Me,Me+=8}De>>>=gt,Me-=gt,Yt=0,me=3+(De&7),De>>>=3,Me-=3}else{for(Jt=gt+7;Me<Jt;){if(je===0)break e;je--,De+=Fe[k++]<<Me,Me+=8}De>>>=gt,Me-=gt,Yt=0,me=11+(De&127),De>>>=7,Me-=7}if(K.have+me>K.nlen+K.ndist){ve.msg="invalid bit length repeat",K.mode=V;break}for(;me--;)K.lens[K.have++]=Yt}}if(K.mode===V)break;if(K.lens[256]===0){ve.msg="invalid code -- missing end-of-block",K.mode=V;break}if(K.lenbits=9,Ht={bits:K.lenbits},Lr=i(s,K.lens,0,K.nlen,K.lencode,0,K.work,Ht),K.lenbits=Ht.bits,Lr){ve.msg="invalid literal/lengths set",K.mode=V;break}if(K.distbits=6,K.distcode=K.distdyn,Ht={bits:K.distbits},Lr=i(a,K.lens,K.nlen,K.ndist,K.distcode,0,K.work,Ht),K.distbits=Ht.bits,Lr){ve.msg="invalid distances set",K.mode=V;break}if(K.mode=U,Ie===f)break e;case U:K.mode=B;case B:if(je>=6&&de>=258){ve.next_out=Pe,ve.avail_out=de,ve.next_in=k,ve.avail_in=je,K.hold=De,K.bits=Me,n(ve,ue),Pe=ve.next_out,nt=ve.output,de=ve.avail_out,k=ve.next_in,Fe=ve.input,je=ve.avail_in,De=K.hold,Me=K.bits,K.mode===X&&(K.back=-1);break}for(K.back=0;et=K.lencode[De&(1<<K.lenbits)-1],gt=et>>>24,It=et>>>16&255,xt=et&65535,!(gt<=Me);){if(je===0)break e;je--,De+=Fe[k++]<<Me,Me+=8}if(It&&(It&240)===0){for(hr=gt,Oi=It,Zn=xt;et=K.lencode[Zn+((De&(1<<hr+Oi)-1)>>hr)],gt=et>>>24,It=et>>>16&255,xt=et&65535,!(hr+gt<=Me);){if(je===0)break e;je--,De+=Fe[k++]<<Me,Me+=8}De>>>=hr,Me-=hr,K.back+=hr}if(De>>>=gt,Me-=gt,K.back+=gt,K.length=xt,It===0){K.mode=H;break}if(It&32){K.back=-1,K.mode=X;break}if(It&64){ve.msg="invalid literal/length code",K.mode=V;break}K.extra=It&15,K.mode=ee;case ee:if(K.extra){for(Jt=K.extra;Me<Jt;){if(je===0)break e;je--,De+=Fe[k++]<<Me,Me+=8}K.length+=De&(1<<K.extra)-1,De>>>=K.extra,Me-=K.extra,K.back+=K.extra}K.was=K.length,K.mode=fe;case fe:for(;et=K.distcode[De&(1<<K.distbits)-1],gt=et>>>24,It=et>>>16&255,xt=et&65535,!(gt<=Me);){if(je===0)break e;je--,De+=Fe[k++]<<Me,Me+=8}if((It&240)===0){for(hr=gt,Oi=It,Zn=xt;et=K.distcode[Zn+((De&(1<<hr+Oi)-1)>>hr)],gt=et>>>24,It=et>>>16&255,xt=et&65535,!(hr+gt<=Me);){if(je===0)break e;je--,De+=Fe[k++]<<Me,Me+=8}De>>>=hr,Me-=hr,K.back+=hr}if(De>>>=gt,Me-=gt,K.back+=gt,It&64){ve.msg="invalid distance code",K.mode=V;break}K.offset=xt,K.extra=It&15,K.mode=Ee;case Ee:if(K.extra){for(Jt=K.extra;Me<Jt;){if(je===0)break e;je--,De+=Fe[k++]<<Me,Me+=8}K.offset+=De&(1<<K.extra)-1,De>>>=K.extra,Me-=K.extra,K.back+=K.extra}if(K.offset>K.dmax){ve.msg="invalid distance too far back",K.mode=V;break}K.mode=te;case te:if(de===0)break e;if(me=ue-de,K.offset>me){if(me=K.offset-me,me>K.whave&&K.sane){ve.msg="invalid distance too far back",K.mode=V;break}me>K.wnext?(me-=K.wnext,Ge=K.wsize-me):Ge=K.wnext-me,me>K.length&&(me=K.length),Ue=K.window}else Ue=nt,Ge=Pe-K.offset,me=K.length;me>de&&(me=de),de-=me,K.length-=me;do nt[Pe++]=Ue[Ge++];while(--me);K.length===0&&(K.mode=B);break;case H:if(de===0)break e;nt[Pe++]=K.length,de--,K.mode=B;break;case ae:if(K.wrap){for(;Me<32;){if(je===0)break e;je--,De|=Fe[k++]<<Me,Me+=8}if(ue-=de,ve.total_out+=ue,K.total+=ue,ue&&(ve.adler=K.check=K.flags?t(K.check,nt,ue,Pe-ue):e(K.check,nt,ue,Pe-ue)),ue=de,(K.flags?De:Ae(De))!==K.check){ve.msg="incorrect data check",K.mode=V;break}De=0,Me=0}K.mode=we;case we:if(K.wrap&&K.flags){for(;Me<32;){if(je===0)break e;je--,De+=Fe[k++]<<Me,Me+=8}if(De!==(K.total&4294967295)){ve.msg="incorrect length check",K.mode=V;break}De=0,Me=0}K.mode=xe;case xe:Lr=d;break e;case V:Lr=v;break e;case F:return w;case oe:default:return y}return ve.next_out=Pe,ve.avail_out=de,ve.next_in=k,ve.avail_in=je,K.hold=De,K.bits=Me,(K.wsize||ue!==ve.avail_out&&K.mode<V&&(K.mode<ae||Ie!==u))&&J(ve,ve.output,ve.next_out,ue-ve.avail_out),ft-=ve.avail_in,ue-=ve.avail_out,ve.total_in+=ft,ve.total_out+=ue,K.total+=ue,K.wrap&&ue&&(ve.adler=K.check=K.flags?t(K.check,nt,ue,ve.next_out-ue):e(K.check,nt,ue,ve.next_out-ue)),ve.data_type=K.bits+(K.last?64:0)+(K.mode===X?128:0)+(K.mode===U||K.mode===O?256:0),(ft===0&&ue===0||Ie===u)&&Lr===h&&(Lr=b),Lr}function le(ve){if(!ve||!ve.state)return y;var Ie=ve.state;return Ie.window&&(Ie.window=null),ve.state=null,h}function he(ve,Ie){var K;return!ve||!ve.state||(K=ve.state,(K.wrap&2)===0)?y:(K.head=Ie,Ie.done=!1,h)}function _e(ve,Ie){var K=Ie.length,Fe,nt,k;return!ve||!ve.state||(Fe=ve.state,Fe.wrap!==0&&Fe.mode!==$)?y:Fe.mode===$&&(nt=1,nt=e(nt,Ie,K,0),nt!==Fe.check)?v:(k=J(ve,Ie,K,K),k?(Fe.mode=F,w):(Fe.havedict=1,h))}return ys.inflateReset=ke,ys.inflateReset2=Ke,ys.inflateResetKeep=Oe,ys.inflateInit=it,ys.inflateInit2=tt,ys.inflate=D,ys.inflateEnd=le,ys.inflateGetHeader=he,ys.inflateSetDictionary=_e,ys.inflateInfo="pako inflate (from Nodeca project)",ys}function aW(){return aP||(aP=!0,oA={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}),oA}function lW(){if(lP)return rt;lP=!0;var r=yn().Buffer,e=Vr,t=mt,n=eW(),i=nW(),o=oW(),s=aW();for(var a in s)rt[a]=s[a];rt.NONE=0,rt.DEFLATE=1,rt.INFLATE=2,rt.GZIP=3,rt.GUNZIP=4,rt.DEFLATERAW=5,rt.INFLATERAW=6,rt.UNZIP=7;var u=31,c=139;function f(h){if(typeof h!="number"||h<rt.DEFLATE||h>rt.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<=rt.UNZIP),this.mode===rt.DEFLATE||this.mode===rt.GZIP||this.mode===rt.DEFLATERAW?i.deflateEnd(this.strm):(this.mode===rt.INFLATE||this.mode===rt.GUNZIP||this.mode===rt.INFLATERAW||this.mode===rt.UNZIP)&&o.inflateEnd(this.strm),this.mode=rt.NONE,this.dictionary=null},f.prototype.write=function(h,d,g,y,v,w,b){return this._write(!0,h,d,g,y,v,w,b)},f.prototype.writeSync=function(h,d,g,y,v,w,b){return this._write(!1,h,d,g,y,v,w,b)},f.prototype._write=function(h,d,g,y,v,w,b,E){if(t.equal(arguments.length,8),t(this.init_done,"write before init"),t(this.mode!==rt.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,d===void 0,"must provide flush value"),this.write_in_progress=!0,d!==rt.Z_NO_FLUSH&&d!==rt.Z_PARTIAL_FLUSH&&d!==rt.Z_SYNC_FLUSH&&d!==rt.Z_FULL_FLUSH&&d!==rt.Z_FINISH&&d!==rt.Z_BLOCK)throw new Error("Invalid flush value");if(g==null&&(g=r.alloc(0),v=0,y=0),this.strm.avail_in=v,this.strm.input=g,this.strm.next_in=y,this.strm.avail_out=E,this.strm.output=w,this.strm.next_out=b,this.flush=d,!h)return this._process(),this._checkError()?this._afterSync():void 0;var _=this;return e.nextTick(function(){_._process(),_._after()}),this},f.prototype._afterSync=function(){var h=this.strm.avail_out,d=this.strm.avail_in;return this.write_in_progress=!1,[d,h]},f.prototype._process=function(){var h=null;switch(this.mode){case rt.DEFLATE:case rt.GZIP:case rt.DEFLATERAW:this.err=i.deflate(this.strm,this.flush);break;case rt.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=rt.INFLATE;break}case 1:if(h===null)break;this.strm.input[h]===c?(this.gzip_id_bytes_read=2,this.mode=rt.GUNZIP):this.mode=rt.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case rt.INFLATE:case rt.GUNZIP:case rt.INFLATERAW:for(this.err=o.inflate(this.strm,this.flush),this.err===rt.Z_NEED_DICT&&this.dictionary&&(this.err=o.inflateSetDictionary(this.strm,this.dictionary),this.err===rt.Z_OK?this.err=o.inflate(this.strm,this.flush):this.err===rt.Z_DATA_ERROR&&(this.err=rt.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===rt.GUNZIP&&this.err===rt.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 rt.Z_OK:case rt.Z_BUF_ERROR:if(this.strm.avail_out!==0&&this.flush===rt.Z_FINISH)return this._error("unexpected end of file"),!1;break;case rt.Z_STREAM_END:break;case rt.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,d=this.strm.avail_in;this.write_in_progress=!1,this.callback(d,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,d,g,y,v){t(arguments.length===4||arguments.length===5,"init(windowBits, level, memLevel, strategy, [dictionary])"),t(h>=8&&h<=15,"invalid windowBits"),t(d>=-1&&d<=9,"invalid compression level"),t(g>=1&&g<=9,"invalid memlevel"),t(y===rt.Z_FILTERED||y===rt.Z_HUFFMAN_ONLY||y===rt.Z_RLE||y===rt.Z_FIXED||y===rt.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(d,h,g,y,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,d,g,y,v){switch(this.level=h,this.windowBits=d,this.memLevel=g,this.strategy=y,this.flush=rt.Z_NO_FLUSH,this.err=rt.Z_OK,(this.mode===rt.GZIP||this.mode===rt.GUNZIP)&&(this.windowBits+=16),this.mode===rt.UNZIP&&(this.windowBits+=32),(this.mode===rt.DEFLATERAW||this.mode===rt.INFLATERAW)&&(this.windowBits=-1*this.windowBits),this.strm=new n,this.mode){case rt.DEFLATE:case rt.GZIP:case rt.DEFLATERAW:this.err=i.deflateInit2(this.strm,this.level,rt.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case rt.INFLATE:case rt.GUNZIP:case rt.INFLATERAW:case rt.UNZIP:this.err=o.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==rt.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=rt.Z_OK,this.mode){case rt.DEFLATE:case rt.DEFLATERAW:this.err=i.deflateSetDictionary(this.strm,this.dictionary);break}this.err!==rt.Z_OK&&this._error("Failed to set dictionary")}},f.prototype._reset=function(){switch(this.err=rt.Z_OK,this.mode){case rt.DEFLATE:case rt.DEFLATERAW:case rt.GZIP:this.err=i.deflateReset(this.strm);break;case rt.INFLATE:case rt.INFLATERAW:case rt.GUNZIP:this.err=o.inflateReset(this.strm);break}this.err!==rt.Z_OK&&this._error("Failed to reset stream")},rt.Zlib=f,rt}function uW(){if(uP)return pt;uP=!0;var r=Vr,e=yn().Buffer,t=fi.Transform,n=lW(),i=qe,o=mt.ok,s=yn().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(pt,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},d=Object.keys(h),g=0;g<d.length;g++){var y=d[g];h[h[y]]=y}Object.defineProperty(pt,"codes",{enumerable:!0,value:Object.freeze(h),writable:!1}),pt.Deflate=b,pt.Inflate=E,pt.Gzip=_,pt.Gunzip=S,pt.DeflateRaw=A,pt.InflateRaw=M,pt.Unzip=I,pt.createDeflate=function(L){return new b(L)},pt.createInflate=function(L){return new E(L)},pt.createDeflateRaw=function(L){return new A(L)},pt.createInflateRaw=function(L){return new M(L)},pt.createGzip=function(L){return new _(L)},pt.createGunzip=function(L){return new S(L)},pt.createUnzip=function(L){return new I(L)},pt.deflate=function(L,$,X){return typeof $=="function"&&(X=$,$={}),v(new b($),L,X)},pt.deflateSync=function(L,$){return w(new b($),L)},pt.gzip=function(L,$,X){return typeof $=="function"&&(X=$,$={}),v(new _($),L,X)},pt.gzipSync=function(L,$){return w(new _($),L)},pt.deflateRaw=function(L,$,X){return typeof $=="function"&&(X=$,$={}),v(new A($),L,X)},pt.deflateRawSync=function(L,$){return w(new A($),L)},pt.unzip=function(L,$,X){return typeof $=="function"&&(X=$,$={}),v(new I($),L,X)},pt.unzipSync=function(L,$){return w(new I($),L)},pt.inflate=function(L,$,X){return typeof $=="function"&&(X=$,$={}),v(new E($),L,X)},pt.inflateSync=function(L,$){return w(new E($),L)},pt.gunzip=function(L,$,X){return typeof $=="function"&&(X=$,$={}),v(new S($),L,X)},pt.gunzipSync=function(L,$){return w(new S($),L)},pt.inflateRaw=function(L,$,X){return typeof $=="function"&&(X=$,$={}),v(new M($),L,X)},pt.inflateRawSync=function(L,$){return w(new M($),L)};function v(L,$,X){var ie=[],re=0;L.on("error",x),L.on("end",P),L.end($),O();function O(){for(var C;(C=L.read())!==null;)ie.push(C),re+=C.length;L.once("readable",O)}function x(C){L.removeListener("end",P),L.removeListener("readable",O),X(C)}function P(){var C,j=null;re>=s?j=new RangeError(a):C=e.concat(ie,re),ie=[],L.close(),X(j,C)}}function w(L,$){if(typeof $=="string"&&($=e.from($)),!e.isBuffer($))throw new TypeError("Not a string or buffer");var X=L._finishFlushFlag;return L._processChunk($,X)}function b(L){if(!(this instanceof b))return new b(L);Q.call(this,L,n.DEFLATE)}function E(L){if(!(this instanceof E))return new E(L);Q.call(this,L,n.INFLATE)}function _(L){if(!(this instanceof _))return new _(L);Q.call(this,L,n.GZIP)}function S(L){if(!(this instanceof S))return new S(L);Q.call(this,L,n.GUNZIP)}function A(L){if(!(this instanceof A))return new A(L);Q.call(this,L,n.DEFLATERAW)}function M(L){if(!(this instanceof M))return new M(L);Q.call(this,L,n.INFLATERAW)}function I(L){if(!(this instanceof I))return new I(L);Q.call(this,L,n.UNZIP)}function q(L){return L===n.Z_NO_FLUSH||L===n.Z_PARTIAL_FLUSH||L===n.Z_SYNC_FLUSH||L===n.Z_FULL_FLUSH||L===n.Z_FINISH||L===n.Z_BLOCK}function Q(L,$){var X=this;if(this._opts=L=L||{},this._chunkSize=L.chunkSize||pt.Z_DEFAULT_CHUNK,t.call(this,L),L.flush&&!q(L.flush))throw new Error("Invalid flush flag: "+L.flush);if(L.finishFlush&&!q(L.finishFlush))throw new Error("Invalid flush flag: "+L.finishFlush);if(this._flushFlag=L.flush||n.Z_NO_FLUSH,this._finishFlushFlag=typeof L.finishFlush<"u"?L.finishFlush:n.Z_FINISH,L.chunkSize&&(L.chunkSize<pt.Z_MIN_CHUNK||L.chunkSize>pt.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+L.chunkSize);if(L.windowBits&&(L.windowBits<pt.Z_MIN_WINDOWBITS||L.windowBits>pt.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+L.windowBits);if(L.level&&(L.level<pt.Z_MIN_LEVEL||L.level>pt.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+L.level);if(L.memLevel&&(L.memLevel<pt.Z_MIN_MEMLEVEL||L.memLevel>pt.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+L.memLevel);if(L.strategy&&L.strategy!=pt.Z_FILTERED&&L.strategy!=pt.Z_HUFFMAN_ONLY&&L.strategy!=pt.Z_RLE&&L.strategy!=pt.Z_FIXED&&L.strategy!=pt.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+L.strategy);if(L.dictionary&&!e.isBuffer(L.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){Z(ie),ie._hadError=!0;var C=new Error(x);C.errno=P,C.code=pt.codes[P],ie.emit("error",C)};var re=pt.Z_DEFAULT_COMPRESSION;typeof L.level=="number"&&(re=L.level);var O=pt.Z_DEFAULT_STRATEGY;typeof L.strategy=="number"&&(O=L.strategy),this._handle.init(L.windowBits||pt.Z_DEFAULT_WINDOWBITS,re,L.memLevel||pt.Z_DEFAULT_MEMLEVEL,O,L.dictionary),this._buffer=e.allocUnsafe(this._chunkSize),this._offset=0,this._level=re,this._strategy=O,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!X._handle},configurable:!0,enumerable:!0})}i.inherits(Q,t),Q.prototype.params=function(L,$,X){if(L<pt.Z_MIN_LEVEL||L>pt.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+L);if($!=pt.Z_FILTERED&&$!=pt.Z_HUFFMAN_ONLY&&$!=pt.Z_RLE&&$!=pt.Z_FIXED&&$!=pt.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+$);if(this._level!==L||this._strategy!==$){var ie=this;this.flush(n.Z_SYNC_FLUSH,function(){o(ie._handle,"zlib binding closed"),ie._handle.params(L,$),ie._hadError||(ie._level=L,ie._strategy=$,X&&X())})}else r.nextTick(X)},Q.prototype.reset=function(){return o(this._handle,"zlib binding closed"),this._handle.reset()},Q.prototype._flush=function(L){this._transform(e.alloc(0),"",L)},Q.prototype.flush=function(L,$){var X=this,ie=this._writableState;(typeof L=="function"||L===void 0&&!$)&&($=L,L=n.Z_FULL_FLUSH),ie.ended?$&&r.nextTick($):ie.ending?$&&this.once("end",$):ie.needDrain?$&&this.once("drain",function(){return X.flush(L,$)}):(this._flushFlag=L,this.write(e.alloc(0),"",$))},Q.prototype.close=function(L){Z(this,L),r.nextTick(ne,this)};function Z(L,$){$&&r.nextTick($),L._handle&&(L._handle.close(),L._handle=null)}function ne(L){L.emit("close")}return Q.prototype._transform=function(L,$,X){var ie,re=this._writableState,O=re.ending||re.ended,x=O&&(!L||re.length===L.length);if(L!==null&&!e.isBuffer(L))return X(new Error("invalid input"));if(!this._handle)return X(new Error("zlib binding closed"));x?ie=this._finishFlushFlag:(ie=this._flushFlag,L.length>=re.length&&(this._flushFlag=this._opts.flush||n.Z_NO_FLUSH)),this._processChunk(L,ie,X)},Q.prototype._processChunk=function(L,$,X){var ie=L&&L.length,re=this._chunkSize-this._offset,O=0,x=this,P=typeof X=="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($,L,O,ie,this._buffer,this._offset,re);while(!this._hadError&&Ee(B[0],B[1]));if(this._hadError)throw U;if(j>=s)throw Z(this),new RangeError(a);var ee=e.concat(C,j);return Z(this),ee}o(this._handle,"zlib binding closed");var fe=this._handle.write($,L,O,ie,this._buffer,this._offset,re);fe.buffer=L,fe.callback=Ee;function Ee(te,H){if(this&&(this.buffer=null,this.callback=null),!x._hadError){var ae=re-H;if(o(ae>=0,"have should not go down"),ae>0){var we=x._buffer.slice(x._offset,x._offset+ae);x._offset+=ae,P?x.push(we):(C.push(we),j+=we.length)}if((H===0||x._offset>=x._chunkSize)&&(re=x._chunkSize,x._offset=0,x._buffer=e.allocUnsafe(x._chunkSize)),H===0){if(O+=ie-te,ie=te,!P)return!0;var xe=x._handle.write($,L,O,ie,x._buffer,x._offset,x._chunkSize);xe.callback=Ee,xe.buffer=L;return}if(!P)return!1;X()}}},i.inherits(b,Q),i.inherits(E,Q),i.inherits(_,Q),i.inherits(S,Q),i.inherits(A,Q),i.inherits(M,Q),i.inherits(I,Q),pt}var eA,KL,zn,JL,Ec,QL,tA,eP,rA,tP,nA,rP,Gs,nP,iA,iP,sA,sP,ys,oP,oA,aP,rt,lP,pt,uP,Je,cW,fW,hW,dW,pW,gW,mW,yW,bW,wW,vW,EW,_W,AW,xW,SW,TW,CW,RW,DW,IW,kW,NW,OW,LW,PW,FW,MW,BW,UW,jW,$W,zW,WW,HW,qW,GW,VW,XW,YW,ZW,KW,JW,QW,eH,tH,rH,nH,iH,sH,oH,aH,lH,uH,cH,fH,hH,dH,pH,gH,mH,yH,bH,wH,vH,EH,_H,AH,xH,dP=bt(()=>{Se();Ce();Te();dh();U2();V1();lc();jb();Ol();Wb();xh();Kb();wh();eA={},KL=!1;zn={},JL=!1;Ec={},QL=!1;tA={},eP=!1;rA={},tP=!1;nA={},rP=!1;Gs={},nP=!1;iA={},iP=!1;sA={},sP=!1;ys={},oP=!1;oA={},aP=!1;rt={},lP=!1;pt={},uP=!1;Je=uW();Je.codes;Je.Deflate;Je.Inflate;Je.Gzip;Je.Gunzip;Je.DeflateRaw;Je.InflateRaw;Je.Unzip;Je.createDeflate;Je.createInflate;Je.createDeflateRaw;Je.createInflateRaw;Je.createGzip;Je.createGunzip;Je.createUnzip;Je.deflate;Je.deflateSync;Je.gzip;Je.gzipSync;Je.deflateRaw;Je.deflateRawSync;Je.unzip;Je.unzipSync;Je.inflate;Je.inflateSync;Je.gunzip;Je.gunzipSync;Je.inflateRaw;Je.inflateRawSync;cW=Je.Deflate,fW=Je.DeflateRaw,hW=Je.Gunzip,dW=Je.Gzip,pW=Je.Inflate,gW=Je.InflateRaw,mW=Je.Unzip,yW=Je.Z_BEST_COMPRESSION,bW=Je.Z_BEST_SPEED,wW=Je.Z_BINARY,vW=Je.Z_BLOCK,EW=Je.Z_BUF_ERROR,_W=Je.Z_DATA_ERROR,AW=Je.Z_DEFAULT_CHUNK,xW=Je.Z_DEFAULT_COMPRESSION,SW=Je.Z_DEFAULT_LEVEL,TW=Je.Z_DEFAULT_MEMLEVEL,CW=Je.Z_DEFAULT_STRATEGY,RW=Je.Z_DEFAULT_WINDOWBITS,DW=Je.Z_DEFLATED,IW=Je.Z_ERRNO,kW=Je.Z_FILTERED,NW=Je.Z_FINISH,OW=Je.Z_FIXED,LW=Je.Z_FULL_FLUSH,PW=Je.Z_HUFFMAN_ONLY,FW=Je.Z_MAX_CHUNK,MW=Je.Z_MAX_LEVEL,BW=Je.Z_MAX_MEMLEVEL,UW=Je.Z_MAX_WINDOWBITS,jW=Je.Z_MIN_CHUNK,$W=Je.Z_MIN_LEVEL,zW=Je.Z_MIN_MEMLEVEL,WW=Je.Z_MIN_WINDOWBITS,HW=Je.Z_NEED_DICT,qW=Je.Z_NO_COMPRESSION,GW=Je.Z_NO_FLUSH,VW=Je.Z_OK,XW=Je.Z_PARTIAL_FLUSH,YW=Je.Z_RLE,ZW=Je.Z_STREAM_END,KW=Je.Z_STREAM_ERROR,JW=Je.Z_SYNC_FLUSH,QW=Je.Z_TEXT,eH=Je.Z_TREES,tH=Je.Z_UNKNOWN,rH=Je.Zlib,nH=Je.codes,iH=Je.createDeflate,sH=Je.createDeflateRaw,oH=Je.createGunzip,aH=Je.createGzip,lH=Je.createInflate,uH=Je.createInflateRaw,cH=Je.createUnzip,fH=Je.deflate,hH=Je.deflateRaw,dH=Je.deflateRawSync,pH=Je.deflateSync,gH=Je.gunzip,mH=Je.gunzipSync,yH=Je.gzip,bH=Je.gzipSync,wH=Je.inflate,vH=Je.inflateRaw,EH=Je.inflateRawSync,_H=Je.inflateSync,AH=Je.unzip,xH=Je.unzipSync});function gP(){return pP||(pP=!0,typeof Object.create=="function"?vw=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:vw=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}),vw}var vw,pP,aA=bt(()=>{Se();Ce();Te();vw={},pP=!1});var qg={};go(qg,{TextDecoder:()=>lq,TextEncoder:()=>aq,_extend:()=>MH,callbackify:()=>BH,debuglog:()=>UH,default:()=>yt,deprecate:()=>jH,format:()=>$H,inherits:()=>zH,inspect:()=>WH,isArray:()=>HH,isBoolean:()=>qH,isBuffer:()=>GH,isDate:()=>VH,isError:()=>XH,isFunction:()=>YH,isNull:()=>ZH,isNullOrUndefined:()=>KH,isNumber:()=>JH,isObject:()=>QH,isPrimitive:()=>eq,isRegExp:()=>tq,isString:()=>rq,isSymbol:()=>nq,isUndefined:()=>iq,log:()=>sq,promisify:()=>Ew,types:()=>oq});function bA(){if(mP)return lA;mP=!0;var r=l_();return lA=function(){return r()&&!!Symbol.toStringTag},lA}function SH(){if(yP)return uA;yP=!0;var r=bA()(),e=xg(),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,uA=o?n:i,uA}function TH(){if(bP)return cA;bP=!0;var r=Object.prototype.toString,e=Function.prototype.toString,t=/^\s*(?:function)?\*/,n=bA()(),i=Object.getPrototypeOf,o=function(){if(!n)return!1;try{return Function("return function*() {}")()}catch{}},s;return cA=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},cA}function CH(){if(wP)return fA;wP=!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(E){E!==n&&(e=null)}else e=null;var i=/^\s*class\b/,o=function(_){try{var S=r.call(_);return i.test(S)}catch{return!1}},s=function(_){try{return o(_)?!1:(r.call(_),!0)}catch{return!1}},a=Object.prototype.toString,u="[object Object]",c="[object Function]",f="[object GeneratorFunction]",h="[object HTMLAllCollection]",d="[object HTML document.all class]",g="[object HTMLCollection]",y=typeof Symbol=="function"&&!!Symbol.toStringTag,v=!(0 in[,]),w=function(){return!1};if(typeof document=="object"){var b=document.all;a.call(b)===a.call(document.all)&&(w=function(_){if((v||!_)&&(typeof _>"u"||typeof _=="object"))try{var S=a.call(_);return(S===h||S===d||S===g||S===u)&&_("")==null}catch{}return!1})}return fA=e?function(_){if(w(_))return!0;if(!_||typeof _!="function"&&typeof _!="object")return!1;try{e(_,null,t)}catch(S){if(S!==n)return!1}return!o(_)&&s(_)}:function(_){if(w(_))return!0;if(!_||typeof _!="function"&&typeof _!="object")return!1;if(y)return s(_);if(o(_))return!1;var S=a.call(_);return S!==c&&S!==f&&!/^\[object HTML/.test(S)?!1:s(_)},fA}function RH(){if(vP)return hA;vP=!0;var r=CH(),e=Object.prototype.toString,t=Object.prototype.hasOwnProperty,n=function(u,c,f){for(var h=0,d=u.length;h<d;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,d=u.length;h<d;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 hA=s,hA}function DH(){return EP||(EP=!0,dA=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),dA}function kH(){if(_P)return pA;_P=!0;var r=DH(),e=typeof globalThis>"u"?IH:globalThis;return pA=function(){for(var n=[],i=0;i<r.length;i++)typeof e[r[i]]=="function"&&(n[n.length]=r[i]);return n},pA}function RP(){if(AP)return gA;AP=!0;var r=RH(),e=kH(),t=f_(),n=xg(),i=Jb(),o=n("Object.prototype.toString"),s=bA()(),a=typeof globalThis>"u"?NH:globalThis,u=e(),c=n("String.prototype.slice"),f=Object.getPrototypeOf,h=n("Array.prototype.indexOf",!0)||function(w,b){for(var E=0;E<w.length;E+=1)if(w[E]===b)return E;return-1},d={__proto__:null};s&&i&&f?r(u,function(v){var w=new a[v];if(Symbol.toStringTag in w){var b=f(w),E=i(b,Symbol.toStringTag);if(!E){var _=f(b);E=i(_,Symbol.toStringTag)}d["$"+v]=t(E.get)}}):r(u,function(v){var w=new a[v],b=w.slice||w.set;b&&(d["$"+v]=t(b))});var g=function(w){var b=!1;return r(d,function(E,_){if(!b)try{"$"+E(w)===_&&(b=c(_,1))}catch{}}),b},y=function(w){var b=!1;return r(d,function(E,_){if(!b)try{E(w),b=c(_,1)}catch{}}),b};return gA=function(w){if(!w||typeof w!="object")return!1;if(!s){var b=c(o(w),8,-1);return h(u,b)>-1?b:b!=="Object"?!1:y(w)}return i?g(w):null},gA}function OH(){if(xP)return mA;xP=!0;var r=RP();return mA=function(t){return!!r(t)},mA}function LH(){if(SP)return kt;SP=!0;var r=SH(),e=TH(),t=RP(),n=OH();function i(pe){return pe.call.bind(pe)}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 d=i(Symbol.prototype.valueOf);function g(pe,Ae){if(typeof pe!="object")return!1;try{return Ae(pe),!0}catch{return!1}}kt.isArgumentsObject=r,kt.isGeneratorFunction=e,kt.isTypedArray=n;function y(pe){return typeof Promise<"u"&&pe instanceof Promise||pe!==null&&typeof pe=="object"&&typeof pe.then=="function"&&typeof pe.catch=="function"}kt.isPromise=y;function v(pe){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(pe):n(pe)||U(pe)}kt.isArrayBufferView=v;function w(pe){return t(pe)==="Uint8Array"}kt.isUint8Array=w;function b(pe){return t(pe)==="Uint8ClampedArray"}kt.isUint8ClampedArray=b;function E(pe){return t(pe)==="Uint16Array"}kt.isUint16Array=E;function _(pe){return t(pe)==="Uint32Array"}kt.isUint32Array=_;function S(pe){return t(pe)==="Int8Array"}kt.isInt8Array=S;function A(pe){return t(pe)==="Int16Array"}kt.isInt16Array=A;function M(pe){return t(pe)==="Int32Array"}kt.isInt32Array=M;function I(pe){return t(pe)==="Float32Array"}kt.isFloat32Array=I;function q(pe){return t(pe)==="Float64Array"}kt.isFloat64Array=q;function Q(pe){return t(pe)==="BigInt64Array"}kt.isBigInt64Array=Q;function Z(pe){return t(pe)==="BigUint64Array"}kt.isBigUint64Array=Z;function ne(pe){return a(pe)==="[object Map]"}ne.working=typeof Map<"u"&&ne(new Map);function L(pe){return typeof Map>"u"?!1:ne.working?ne(pe):pe instanceof Map}kt.isMap=L;function $(pe){return a(pe)==="[object Set]"}$.working=typeof Set<"u"&&$(new Set);function X(pe){return typeof Set>"u"?!1:$.working?$(pe):pe instanceof Set}kt.isSet=X;function ie(pe){return a(pe)==="[object WeakMap]"}ie.working=typeof WeakMap<"u"&&ie(new WeakMap);function re(pe){return typeof WeakMap>"u"?!1:ie.working?ie(pe):pe instanceof WeakMap}kt.isWeakMap=re;function O(pe){return a(pe)==="[object WeakSet]"}O.working=typeof WeakSet<"u"&&O(new WeakSet);function x(pe){return O(pe)}kt.isWeakSet=x;function P(pe){return a(pe)==="[object ArrayBuffer]"}P.working=typeof ArrayBuffer<"u"&&P(new ArrayBuffer);function C(pe){return typeof ArrayBuffer>"u"?!1:P.working?P(pe):pe instanceof ArrayBuffer}kt.isArrayBuffer=C;function j(pe){return a(pe)==="[object DataView]"}j.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&j(new DataView(new ArrayBuffer(1),0,1));function U(pe){return typeof DataView>"u"?!1:j.working?j(pe):pe instanceof DataView}kt.isDataView=U;var B=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function ee(pe){return a(pe)==="[object SharedArrayBuffer]"}function fe(pe){return typeof B>"u"?!1:(typeof ee.working>"u"&&(ee.working=ee(new B)),ee.working?ee(pe):pe instanceof B)}kt.isSharedArrayBuffer=fe;function Ee(pe){return a(pe)==="[object AsyncFunction]"}kt.isAsyncFunction=Ee;function te(pe){return a(pe)==="[object Map Iterator]"}kt.isMapIterator=te;function H(pe){return a(pe)==="[object Set Iterator]"}kt.isSetIterator=H;function ae(pe){return a(pe)==="[object Generator]"}kt.isGeneratorObject=ae;function we(pe){return a(pe)==="[object WebAssembly.Module]"}kt.isWebAssemblyCompiledModule=we;function xe(pe){return g(pe,u)}kt.isNumberObject=xe;function V(pe){return g(pe,c)}kt.isStringObject=V;function F(pe){return g(pe,f)}kt.isBooleanObject=F;function oe(pe){return o&&g(pe,h)}kt.isBigIntObject=oe;function ge(pe){return s&&g(pe,d)}kt.isSymbolObject=ge;function Re(pe){return xe(pe)||V(pe)||F(pe)||oe(pe)||ge(pe)}kt.isBoxedPrimitive=Re;function be(pe){return typeof Uint8Array<"u"&&(C(pe)||fe(pe))}return kt.isAnyArrayBuffer=be,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(pe){Object.defineProperty(kt,pe,{enumerable:!1,value:function(){throw new Error(pe+" is not supported in userland")}})}),kt}function PH(){return TP||(TP=!0,yA=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"}),yA}function FH(){if(CP)return Nt;CP=!0;var r=Vr,e=Object.getOwnPropertyDescriptors||function(B){for(var ee=Object.keys(B),fe={},Ee=0;Ee<ee.length;Ee++)fe[ee[Ee]]=Object.getOwnPropertyDescriptor(B,ee[Ee]);return fe},t=/%[sdj%]/g;Nt.format=function(U){if(!A(U)){for(var B=[],ee=0;ee<arguments.length;ee++)B.push(s(arguments[ee]));return B.join(" ")}for(var ee=1,fe=arguments,Ee=fe.length,te=String(U).replace(t,function(ae){if(ae==="%%")return"%";if(ee>=Ee)return ae;switch(ae){case"%s":return String(fe[ee++]);case"%d":return Number(fe[ee++]);case"%j":try{return JSON.stringify(fe[ee++])}catch{return"[Circular]"}default:return ae}}),H=fe[ee];ee<Ee;H=fe[++ee])E(H)||!Q(H)?te+=" "+H:te+=" "+s(H);return te},Nt.deprecate=function(U,B){if(typeof r<"u"&&r.noDeprecation===!0)return U;if(typeof r>"u")return function(){return Nt.deprecate(U,B).apply(this||Hg,arguments)};var ee=!1;function fe(){if(!ee){if(r.throwDeprecation)throw new Error(B);r.traceDeprecation?console.trace(B):console.error(B),ee=!0}return U.apply(this||Hg,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")}Nt.debuglog=function(U){if(U=U.toUpperCase(),!n[U])if(i.test(U)){var B=r.pid;n[U]=function(){var ee=Nt.format.apply(Nt,arguments);console.error("%s %d: %s",U,B,ee)}}else n[U]=function(){};return n[U]};function s(U,B){var ee={seen:[],stylize:u};return arguments.length>=3&&(ee.depth=arguments[2]),arguments.length>=4&&(ee.colors=arguments[3]),b(B)?ee.showHidden=B:B&&Nt._extend(ee,B),I(ee.showHidden)&&(ee.showHidden=!1),I(ee.depth)&&(ee.depth=2),I(ee.colors)&&(ee.colors=!1),I(ee.customInspect)&&(ee.customInspect=!0),ee.colors&&(ee.stylize=a),f(ee,U,ee.depth)}Nt.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 ee=s.styles[B];return ee?"\x1B["+s.colors[ee][0]+"m"+U+"\x1B["+s.colors[ee][1]+"m":U}function u(U,B){return U}function c(U){var B={};return U.forEach(function(ee,fe){B[ee]=!0}),B}function f(U,B,ee){if(U.customInspect&&B&&L(B.inspect)&&B.inspect!==Nt.inspect&&!(B.constructor&&B.constructor.prototype===B)){var fe=B.inspect(ee,U);return A(fe)||(fe=f(U,fe,ee)),fe}var Ee=h(U,B);if(Ee)return Ee;var te=Object.keys(B),H=c(te);if(U.showHidden&&(te=Object.getOwnPropertyNames(B)),ne(B)&&(te.indexOf("message")>=0||te.indexOf("description")>=0))return d(B);if(te.length===0){if(L(B)){var ae=B.name?": "+B.name:"";return U.stylize("[Function"+ae+"]","special")}if(q(B))return U.stylize(RegExp.prototype.toString.call(B),"regexp");if(Z(B))return U.stylize(Date.prototype.toString.call(B),"date");if(ne(B))return d(B)}var we="",xe=!1,V=["{","}"];if(w(B)&&(xe=!0,V=["[","]"]),L(B)){var F=B.name?": "+B.name:"";we=" [Function"+F+"]"}if(q(B)&&(we=" "+RegExp.prototype.toString.call(B)),Z(B)&&(we=" "+Date.prototype.toUTCString.call(B)),ne(B)&&(we=" "+d(B)),te.length===0&&(!xe||B.length==0))return V[0]+we+V[1];if(ee<0)return q(B)?U.stylize(RegExp.prototype.toString.call(B),"regexp"):U.stylize("[Object]","special");U.seen.push(B);var oe;return xe?oe=g(U,B,ee,H,te):oe=te.map(function(ge){return y(U,B,ee,H,ge,xe)}),U.seen.pop(),v(oe,we,V)}function h(U,B){if(I(B))return U.stylize("undefined","undefined");if(A(B)){var ee="'"+JSON.stringify(B).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return U.stylize(ee,"string")}if(S(B))return U.stylize(""+B,"number");if(b(B))return U.stylize(""+B,"boolean");if(E(B))return U.stylize("null","null")}function d(U){return"["+Error.prototype.toString.call(U)+"]"}function g(U,B,ee,fe,Ee){for(var te=[],H=0,ae=B.length;H<ae;++H)x(B,String(H))?te.push(y(U,B,ee,fe,String(H),!0)):te.push("");return Ee.forEach(function(we){we.match(/^\d+$/)||te.push(y(U,B,ee,fe,we,!0))}),te}function y(U,B,ee,fe,Ee,te){var H,ae,we;if(we=Object.getOwnPropertyDescriptor(B,Ee)||{value:B[Ee]},we.get?we.set?ae=U.stylize("[Getter/Setter]","special"):ae=U.stylize("[Getter]","special"):we.set&&(ae=U.stylize("[Setter]","special")),x(fe,Ee)||(H="["+Ee+"]"),ae||(U.seen.indexOf(we.value)<0?(E(ee)?ae=f(U,we.value,null):ae=f(U,we.value,ee-1),ae.indexOf(`
84
+ `)>-1&&(te?ae=ae.split(`
85
+ `).map(function(xe){return" "+xe}).join(`
86
+ `).slice(2):ae=`
87
+ `+ae.split(`
88
+ `).map(function(xe){return" "+xe}).join(`
89
+ `))):ae=U.stylize("[Circular]","special")),I(H)){if(te&&Ee.match(/^\d+$/))return ae;H=JSON.stringify(""+Ee),H.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(H=H.slice(1,-1),H=U.stylize(H,"name")):(H=H.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),H=U.stylize(H,"string"))}return H+": "+ae}function v(U,B,ee){var fe=U.reduce(function(Ee,te){return te.indexOf(`
90
+ `)>=0,Ee+te.replace(/\u001b\[\d\d?m/g,"").length+1},0);return fe>60?ee[0]+(B===""?"":B+`
91
+ `)+" "+U.join(`,
92
+ `)+" "+ee[1]:ee[0]+B+" "+U.join(", ")+" "+ee[1]}Nt.types=LH();function w(U){return Array.isArray(U)}Nt.isArray=w;function b(U){return typeof U=="boolean"}Nt.isBoolean=b;function E(U){return U===null}Nt.isNull=E;function _(U){return U==null}Nt.isNullOrUndefined=_;function S(U){return typeof U=="number"}Nt.isNumber=S;function A(U){return typeof U=="string"}Nt.isString=A;function M(U){return typeof U=="symbol"}Nt.isSymbol=M;function I(U){return U===void 0}Nt.isUndefined=I;function q(U){return Q(U)&&X(U)==="[object RegExp]"}Nt.isRegExp=q,Nt.types.isRegExp=q;function Q(U){return typeof U=="object"&&U!==null}Nt.isObject=Q;function Z(U){return Q(U)&&X(U)==="[object Date]"}Nt.isDate=Z,Nt.types.isDate=Z;function ne(U){return Q(U)&&(X(U)==="[object Error]"||U instanceof Error)}Nt.isError=ne,Nt.types.isNativeError=ne;function L(U){return typeof U=="function"}Nt.isFunction=L;function $(U){return U===null||typeof U=="boolean"||typeof U=="number"||typeof U=="string"||typeof U=="symbol"||typeof U>"u"}Nt.isPrimitive=$,Nt.isBuffer=PH();function X(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 O(){var U=new Date,B=[ie(U.getHours()),ie(U.getMinutes()),ie(U.getSeconds())].join(":");return[U.getDate(),re[U.getMonth()],B].join(" ")}Nt.log=function(){console.log("%s - %s",O(),Nt.format.apply(Nt,arguments))},Nt.inherits=gP(),Nt._extend=function(U,B){if(!B||!Q(B))return U;for(var ee=Object.keys(B),fe=ee.length;fe--;)U[ee[fe]]=B[ee[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;Nt.promisify=function(B){if(typeof B!="function")throw new TypeError('The "original" argument must be of type Function');if(P&&B[P]){if(ee=B[P],typeof ee!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(ee,P,{value:ee,enumerable:!1,writable:!1,configurable:!0}),ee}function ee(){for(var fe,Ee,te=new Promise(function(we,xe){fe=we,Ee=xe}),H=[],ae=0;ae<arguments.length;ae++)H.push(arguments[ae]);H.push(function(we,xe){we?Ee(we):fe(xe)});try{B.apply(this||Hg,H)}catch(we){Ee(we)}return te}return Object.setPrototypeOf(ee,Object.getPrototypeOf(B)),P&&Object.defineProperty(ee,P,{value:ee,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(ee,e(B))},Nt.promisify.custom=P;function C(U,B){if(!U){var ee=new Error("Promise was rejected with a falsy value");ee.reason=U,U=ee}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 ee=[],fe=0;fe<arguments.length;fe++)ee.push(arguments[fe]);var Ee=ee.pop();if(typeof Ee!="function")throw new TypeError("The last argument must be of type Function");var te=this||Hg,H=function(){return Ee.apply(te,arguments)};U.apply(this||Hg,ee).then(function(ae){r.nextTick(H.bind(null,null,ae))},function(ae){r.nextTick(C.bind(null,ae,H))})}return Object.setPrototypeOf(B,Object.getPrototypeOf(U)),Object.defineProperties(B,e(U)),B}return Nt.callbackify=j,Nt}var lA,mP,uA,yP,cA,bP,fA,wP,hA,vP,dA,EP,pA,_P,IH,gA,AP,NH,mA,xP,kt,SP,yA,TP,Nt,CP,Hg,yt,MH,BH,UH,jH,$H,zH,WH,HH,qH,GH,VH,XH,YH,ZH,KH,JH,QH,eq,tq,rq,nq,iq,sq,Ew,oq,aq,lq,zh=bt(()=>{Se();Ce();Te();Sg();aA();lc();lA={},mP=!1;uA={},yP=!1;cA={},bP=!1;fA={},wP=!1;hA={},vP=!1;dA={},EP=!1;pA={},_P=!1,IH=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;gA={},AP=!1,NH=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;mA={},xP=!1;kt={},SP=!1;yA={},TP=!1;Nt={},CP=!1,Hg=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;yt=FH();yt.format;yt.deprecate;yt.debuglog;yt.inspect;yt.types;yt.isArray;yt.isBoolean;yt.isNull;yt.isNullOrUndefined;yt.isNumber;yt.isString;yt.isSymbol;yt.isUndefined;yt.isRegExp;yt.isObject;yt.isDate;yt.isError;yt.isFunction;yt.isPrimitive;yt.isBuffer;yt.log;yt.inherits;yt._extend;yt.promisify;yt.callbackify;MH=yt._extend,BH=yt.callbackify,UH=yt.debuglog,jH=yt.deprecate,$H=yt.format,zH=yt.inherits,WH=yt.inspect,HH=yt.isArray,qH=yt.isBoolean,GH=yt.isBuffer,VH=yt.isDate,XH=yt.isError,YH=yt.isFunction,ZH=yt.isNull,KH=yt.isNullOrUndefined,JH=yt.isNumber,QH=yt.isObject,eq=yt.isPrimitive,tq=yt.isRegExp,rq=yt.isString,nq=yt.isSymbol,iq=yt.isUndefined,sq=yt.log,Ew=yt.promisify,oq=yt.types,aq=yt.TextEncoder=globalThis.TextEncoder,lq=yt.TextDecoder=globalThis.TextDecoder});var Gg={};go(Gg,{EventEmitter:()=>cq,default:()=>xo,defaultMaxListeners:()=>fq,init:()=>hq,listenerCount:()=>dq,on:()=>pq,once:()=>gq});function uq(){if(DP)return _w;DP=!0;var r=typeof Reflect=="object"?Reflect:null,e=r&&typeof r.apply=="function"?r.apply:function(A,M,I){return Function.prototype.apply.call(A,M,I)},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)}_w=o,_w.once=b,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 M=[],I=1;I<arguments.length;I++)M.push(arguments[I]);var q=A==="error",Q=this._events;if(Q!==void 0)q=q&&Q.error===void 0;else if(!q)return!1;if(q){var Z;if(M.length>0&&(Z=M[0]),Z instanceof Error)throw Z;var ne=new Error("Unhandled error."+(Z?" ("+Z.message+")":""));throw ne.context=Z,ne}var L=Q[A];if(L===void 0)return!1;if(typeof L=="function")e(L,this,M);else for(var $=L.length,X=y(L,$),I=0;I<$;++I)e(X[I],this,M);return!0};function c(S,A,M,I){var q,Q,Z;if(a(M),Q=S._events,Q===void 0?(Q=S._events=Object.create(null),S._eventsCount=0):(Q.newListener!==void 0&&(S.emit("newListener",A,M.listener?M.listener:M),Q=S._events),Z=Q[A]),Z===void 0)Z=Q[A]=M,++S._eventsCount;else if(typeof Z=="function"?Z=Q[A]=I?[M,Z]:[Z,M]:I?Z.unshift(M):Z.push(M),q=u(S),q>0&&Z.length>q&&!Z.warned){Z.warned=!0;var ne=new Error("Possible EventEmitter memory leak detected. "+Z.length+" "+String(A)+" listeners added. Use emitter.setMaxListeners() to increase limit");ne.name="MaxListenersExceededWarning",ne.emitter=S,ne.type=A,ne.count=Z.length,n(ne)}return S}o.prototype.addListener=function(A,M){return c(this,A,M,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(A,M){return c(this,A,M,!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,M){var I={fired:!1,wrapFn:void 0,target:S,type:A,listener:M},q=f.bind(I);return q.listener=M,I.wrapFn=q,q}o.prototype.once=function(A,M){return a(M),this.on(A,h(this,A,M)),this},o.prototype.prependOnceListener=function(A,M){return a(M),this.prependListener(A,h(this,A,M)),this},o.prototype.removeListener=function(A,M){var I,q,Q,Z,ne;if(a(M),q=this._events,q===void 0)return this;if(I=q[A],I===void 0)return this;if(I===M||I.listener===M)--this._eventsCount===0?this._events=Object.create(null):(delete q[A],q.removeListener&&this.emit("removeListener",A,I.listener||M));else if(typeof I!="function"){for(Q=-1,Z=I.length-1;Z>=0;Z--)if(I[Z]===M||I[Z].listener===M){ne=I[Z].listener,Q=Z;break}if(Q<0)return this;Q===0?I.shift():v(I,Q),I.length===1&&(q[A]=I[0]),q.removeListener!==void 0&&this.emit("removeListener",A,ne||M)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(A){var M,I,q;if(I=this._events,I===void 0)return this;if(I.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):I[A]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete I[A]),this;if(arguments.length===0){var Q=Object.keys(I),Z;for(q=0;q<Q.length;++q)Z=Q[q],Z!=="removeListener"&&this.removeAllListeners(Z);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(M=I[A],typeof M=="function")this.removeListener(A,M);else if(M!==void 0)for(q=M.length-1;q>=0;q--)this.removeListener(A,M[q]);return this};function d(S,A,M){var I=S._events;if(I===void 0)return[];var q=I[A];return q===void 0?[]:typeof q=="function"?M?[q.listener||q]:[q]:M?w(q):y(q,q.length)}o.prototype.listeners=function(A){return d(this,A,!0)},o.prototype.rawListeners=function(A){return d(this,A,!1)},o.listenerCount=function(S,A){return typeof S.listenerCount=="function"?S.listenerCount(A):g.call(S,A)},o.prototype.listenerCount=g;function g(S){var A=this._events;if(A!==void 0){var M=A[S];if(typeof M=="function")return 1;if(M!==void 0)return M.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function y(S,A){for(var M=new Array(A),I=0;I<A;++I)M[I]=S[I];return M}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),M=0;M<A.length;++M)A[M]=S[M].listener||S[M];return A}function b(S,A){return new Promise(function(M,I){function q(Z){S.removeListener(A,Q),I(Z)}function Q(){typeof S.removeListener=="function"&&S.removeListener("error",q),M([].slice.call(arguments))}_(S,A,Q,{once:!0}),A!=="error"&&E(S,q,{once:!0})})}function E(S,A,M){typeof S.on=="function"&&_(S,"error",A,M)}function _(S,A,M,I){if(typeof S.on=="function")I.once?S.once(A,M):S.on(A,M);else if(typeof S.addEventListener=="function")S.addEventListener(A,function q(Q){I.once&&S.removeEventListener(A,q),M(Q)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof S)}return _w}var _w,DP,xo,cq,fq,hq,dq,pq,gq,Wh=bt(()=>{Se();Ce();Te();_w={},DP=!1;xo=uq();xo.once;xo.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)})};xo.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:cq,defaultMaxListeners:fq,init:hq,listenerCount:dq,on:pq,once:gq}=xo)});function mq(){if(IP)return Vg;IP=!0;var r=yn(),e=r.Buffer;function t(i,o){for(var s in i)o[s]=i[s]}e.from&&e.alloc&&e.allocUnsafe&&e.allocUnsafeSlow?Vg=r:(t(r,Vg),Vg.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)},Vg}function yq(){if(kP)return wA;kP=!0;var r=mq().Buffer,e=r.isEncoding||function(b){switch(b=""+b,b&&b.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(b){if(!b)return"utf8";for(var E;;)switch(b){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 b;default:if(E)return;b=(""+b).toLowerCase(),E=!0}}function n(b){var E=t(b);if(typeof E!="string"&&(r.isEncoding===e||!e(b)))throw new Error("Unknown encoding: "+b);return E||b}wA.StringDecoder=i;function i(b){this.encoding=n(b);var E;switch(this.encoding){case"utf16le":this.text=h,this.end=d,E=4;break;case"utf8":this.fillLast=u,E=4;break;case"base64":this.text=g,this.end=y,E=3;break;default:this.write=v,this.end=w;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(E)}i.prototype.write=function(b){if(b.length===0)return"";var E,_;if(this.lastNeed){if(E=this.fillLast(b),E===void 0)return"";_=this.lastNeed,this.lastNeed=0}else _=0;return _<b.length?E?E+this.text(b,_):this.text(b,_):E||""},i.prototype.end=f,i.prototype.text=c,i.prototype.fillLast=function(b){if(this.lastNeed<=b.length)return b.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);b.copy(this.lastChar,this.lastTotal-this.lastNeed,0,b.length),this.lastNeed-=b.length};function o(b){return b<=127?0:b>>5===6?2:b>>4===14?3:b>>3===30?4:b>>6===2?-1:-2}function s(b,E,_){var S=E.length-1;if(S<_)return 0;var A=o(E[S]);return A>=0?(A>0&&(b.lastNeed=A-1),A):--S<_||A===-2?0:(A=o(E[S]),A>=0?(A>0&&(b.lastNeed=A-2),A):--S<_||A===-2?0:(A=o(E[S]),A>=0?(A>0&&(A===2?A=0:b.lastNeed=A-3),A):0))}function a(b,E,_){if((E[0]&192)!==128)return b.lastNeed=0,"\uFFFD";if(b.lastNeed>1&&E.length>1){if((E[1]&192)!==128)return b.lastNeed=1,"\uFFFD";if(b.lastNeed>2&&E.length>2&&(E[2]&192)!==128)return b.lastNeed=2,"\uFFFD"}}function u(b){var E=this.lastTotal-this.lastNeed,_=a(this,b);if(_!==void 0)return _;if(this.lastNeed<=b.length)return b.copy(this.lastChar,E,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);b.copy(this.lastChar,E,0,b.length),this.lastNeed-=b.length}function c(b,E){var _=s(this,b,E);if(!this.lastNeed)return b.toString("utf8",E);this.lastTotal=_;var S=b.length-(_-this.lastNeed);return b.copy(this.lastChar,0,S),b.toString("utf8",E,S)}function f(b){var E=b&&b.length?this.write(b):"";return this.lastNeed?E+"\uFFFD":E}function h(b,E){if((b.length-E)%2===0){var _=b.toString("utf16le",E);if(_){var S=_.charCodeAt(_.length-1);if(S>=55296&&S<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=b[b.length-2],this.lastChar[1]=b[b.length-1],_.slice(0,-1)}return _}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=b[b.length-1],b.toString("utf16le",E,b.length-1)}function d(b){var E=b&&b.length?this.write(b):"";if(this.lastNeed){var _=this.lastTotal-this.lastNeed;return E+this.lastChar.toString("utf16le",0,_)}return E}function g(b,E){var _=(b.length-E)%3;return _===0?b.toString("base64",E):(this.lastNeed=3-_,this.lastTotal=3,_===1?this.lastChar[0]=b[b.length-1]:(this.lastChar[0]=b[b.length-2],this.lastChar[1]=b[b.length-1]),b.toString("base64",E,b.length-_))}function y(b){var E=b&&b.length?this.write(b):"";return this.lastNeed?E+this.lastChar.toString("base64",0,3-this.lastNeed):E}function v(b){return b.toString(this.encoding)}function w(b){return b&&b.length?this.write(b):""}return wA}var Vg,IP,wA,kP,Aw,Gte,NP=bt(()=>{Se();Ce();Te();dh();Vg={},IP=!1;wA={},kP=!1;Aw=yq();Aw.StringDecoder;Gte=Aw.StringDecoder});var Jg={};go(Jg,{Duplex:()=>Aq,PassThrough:()=>Sq,Readable:()=>UA,Stream:()=>Rq,Transform:()=>xq,Writable:()=>_q,default:()=>pr,finished:()=>Tq,pipeline:()=>Cq,promises:()=>Dq});function Fr(){return OP||(OP=!0,vA={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}),vA}function Zg(){if(LP)return Xg;LP=!0;let{AbortController:r,AbortSignal:e}=typeof self<"u"?self:typeof window<"u"?window:void 0;return Xg=r,Xg.AbortSignal=e,Xg.default=r,Xg}function Qn(){if(PP)return xw;PP=!0;let r=yn(),{kResistStopPropagation:e,SymbolDispose:t}=Fr(),n=globalThis.AbortSignal||Zg().AbortSignal,i=globalThis.AbortController||Zg().AbortController,o=Object.getPrototypeOf(async function(){}).constructor,s=globalThis.Blob||r.Blob,a=typeof s<"u"?function(d){return d instanceof s}:function(d){return!1},u=(h,d)=>{if(h!==void 0&&(h===null||typeof h!="object"||!("aborted"in h)))throw new ERR_INVALID_ARG_TYPE(d,"AbortSignal",h)},c=(h,d)=>{if(typeof h!="function")throw new ERR_INVALID_ARG_TYPE(d,"Function",h)};class f extends Error{constructor(d){if(!Array.isArray(d))throw new TypeError(`Expected input to be an Array, got ${typeof d}`);let g="";for(let y=0;y<d.length;y++)g+=` ${d[y].stack}
93
+ `;super(g),this.name="AggregateError",this.errors=d}}return xw={AggregateError:f,kEmptyObject:Object.freeze({}),once(h){let d=!1;return function(...g){d||(d=!0,h.apply(this,g))}},createDeferredPromise:function(){let h,d;return{promise:new Promise((y,v)=>{h=y,d=v}),resolve:h,reject:d}},promisify(h){return new Promise((d,g)=>{h((y,...v)=>y?g(y):d(...v))})},debuglog(){return function(){}},format(h,...d){return h.replace(/%([sdifj])/g,function(...[g,y]){let v=d.shift();return y==="f"?v.toFixed(6):y==="j"?JSON.stringify(v):y==="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,d){return h},addAbortListener:xo.addAbortListener||function(d,g){if(d===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",d);u(d,"signal"),c(g,"listener");let y;return d.aborted?queueMicrotask(()=>g()):(d.addEventListener("abort",g,{__proto__:null,once:!0,[e]:!0}),y=()=>{d.removeEventListener("abort",g)}),{__proto__:null,[t](){var v;(v=y)===null||v===void 0||v()}}},AbortSignalAny:n.any||function(d){if(d.length===1)return d[0];let g=new i,y=()=>g.abort();return d.forEach(v=>{u(v,"signals"),v.addEventListener("abort",y,{once:!0})}),g.signal.addEventListener("abort",()=>{d.forEach(v=>v.removeEventListener("abort",y))},{once:!0}),g.signal}},xw.promisify.custom=Symbol.for("nodejs.util.promisify.custom"),xw}function bi(){if(FP)return EA;FP=!0;let{format:r,inspect:e,AggregateError:t}=Qn(),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,b){if(!w)throw new u.ERR_INTERNAL_ASSERTION(b)}function f(w){let b="",E=w.length,_=w[0]==="-"?1:0;for(;E>=_+4;E-=3)b=`_${w.slice(E-3,E)}${b}`;return`${w.slice(0,E)}${b}`}function h(w,b,E){if(typeof b=="function")return c(b.length<=E.length,`Code: ${w}; The provided arguments length (${E.length}) does not match the required ones (${b.length}).`),b(...E);let _=(b.match(/%[dfijoOs]/g)||[]).length;return c(_===E.length,`Code: ${w}; The provided arguments length (${E.length}) does not match the required ones (${_}).`),E.length===0?b:r(b,...E)}function d(w,b,E){E||(E=Error);class _ extends E{constructor(...A){super(h(w,b,A))}toString(){return`${this.name} [${w}]: ${this.message}`}}Object.defineProperties(_.prototype,{name:{value:E.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${w}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),_.prototype.code=w,_.prototype[i]=!0,u[w]=_}function g(w){let b=a+w.name;return Object.defineProperty(w,"name",{value:b}),w}function y(w,b){if(w&&b&&w!==b){if(Array.isArray(b.errors))return b.errors.push(w),b;let E=new n([b,w],b.message);return E.code=b.code,E}return w||b}class v extends Error{constructor(b="The operation was aborted",E=void 0){if(E!==void 0&&typeof E!="object")throw new u.ERR_INVALID_ARG_TYPE("options","Object",E);super(b,E),this.code="ABORT_ERR",this.name="AbortError"}}return d("ERR_ASSERTION","%s",Error),d("ERR_INVALID_ARG_TYPE",(w,b,E)=>{c(typeof w=="string","'name' must be a string"),Array.isArray(b)||(b=[b]);let _="The ";w.endsWith(" argument")?_+=`${w} `:_+=`"${w}" ${w.includes(".")?"property":"argument"} `,_+="must be ";let S=[],A=[],M=[];for(let q of b)c(typeof q=="string","All expected entries have to be of type string"),o.includes(q)?S.push(q.toLowerCase()):s.test(q)?A.push(q):(c(q!=="object",'The value "object" should be written as "Object"'),M.push(q));if(A.length>0){let q=S.indexOf("object");q!==-1&&(S.splice(S,q,1),A.push("Object"))}if(S.length>0){switch(S.length){case 1:_+=`of type ${S[0]}`;break;case 2:_+=`one of type ${S[0]} or ${S[1]}`;break;default:{let q=S.pop();_+=`one of type ${S.join(", ")}, or ${q}`}}(A.length>0||M.length>0)&&(_+=" or ")}if(A.length>0){switch(A.length){case 1:_+=`an instance of ${A[0]}`;break;case 2:_+=`an instance of ${A[0]} or ${A[1]}`;break;default:{let q=A.pop();_+=`an instance of ${A.join(", ")}, or ${q}`}}M.length>0&&(_+=" or ")}switch(M.length){case 0:break;case 1:M[0].toLowerCase()!==M[0]&&(_+="an "),_+=`${M[0]}`;break;case 2:_+=`one of ${M[0]} or ${M[1]}`;break;default:{let q=M.pop();_+=`one of ${M.join(", ")}, or ${q}`}}if(E==null)_+=`. Received ${E}`;else if(typeof E=="function"&&E.name)_+=`. Received function ${E.name}`;else if(typeof E=="object"){var I;if((I=E.constructor)!==null&&I!==void 0&&I.name)_+=`. Received an instance of ${E.constructor.name}`;else{let q=e(E,{depth:-1});_+=`. Received ${q}`}}else{let q=e(E,{colors:!1});q.length>25&&(q=`${q.slice(0,25)}...`),_+=`. Received type ${typeof E} (${q})`}return _},TypeError),d("ERR_INVALID_ARG_VALUE",(w,b,E="is invalid")=>{let _=e(b);return _.length>128&&(_=_.slice(0,128)+"..."),`The ${w.includes(".")?"property":"argument"} '${w}' ${E}. Received ${_}`},TypeError),d("ERR_INVALID_RETURN_VALUE",(w,b,E)=>{var _;let S=E!=null&&(_=E.constructor)!==null&&_!==void 0&&_.name?`instance of ${E.constructor.name}`:`type ${typeof E}`;return`Expected ${w} to be returned from the "${b}" function but got ${S}.`},TypeError),d("ERR_MISSING_ARGS",(...w)=>{c(w.length>0,"At least one arg needs to be specified");let b,E=w.length;switch(w=(Array.isArray(w)?w:[w]).map(_=>`"${_}"`).join(" or "),E){case 1:b+=`The ${w[0]} argument`;break;case 2:b+=`The ${w[0]} and ${w[1]} arguments`;break;default:{let _=w.pop();b+=`The ${w.join(", ")}, and ${_} arguments`}break}return`${b} must be specified`},TypeError),d("ERR_OUT_OF_RANGE",(w,b,E)=>{c(b,'Missing "range" argument');let _;return Number.isInteger(E)&&Math.abs(E)>2**32?_=f(String(E)):typeof E=="bigint"?(_=String(E),(E>2n**32n||E<-(2n**32n))&&(_=f(_)),_+="n"):_=e(E),`The value of "${w}" is out of range. It must be ${b}. Received ${_}`},RangeError),d("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),d("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),d("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),d("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),d("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),d("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),d("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),d("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),d("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),d("ERR_STREAM_WRITE_AFTER_END","write after end",Error),d("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),EA={AbortError:v,aggregateTwoErrors:g(y),hideStackFrames:g,codes:u},EA}function Kg(){if(MP)return _A;MP=!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:d,StringPrototypeTrim:g}=Fr(),{hideStackFrames:y,codes:{ERR_SOCKET_BAD_PORT:v,ERR_INVALID_ARG_TYPE:w,ERR_INVALID_ARG_VALUE:b,ERR_OUT_OF_RANGE:E,ERR_UNKNOWN_SIGNAL:_}}=bi(),{normalizeEncoding:S}=Qn(),{isAsyncFunction:A,isArrayBufferView:M}=Qn().types,I={};function q(Ae){return Ae===(Ae|0)}function Q(Ae){return Ae===Ae>>>0}let Z=/^[0-7]+$/,ne="must be a 32-bit unsigned integer or an octal string";function L(Ae,ze,Oe){if(typeof Ae>"u"&&(Ae=Oe),typeof Ae=="string"){if(f(Z,Ae)===null)throw new b(ze,Ae,ne);Ae=u(Ae,8)}return ie(Ae,ze),Ae}let $=y((Ae,ze,Oe=a,ke=s)=>{if(typeof Ae!="number")throw new w(ze,"number",Ae);if(!i(Ae))throw new E(ze,"an integer",Ae);if(Ae<Oe||Ae>ke)throw new E(ze,`>= ${Oe} && <= ${ke}`,Ae)}),X=y((Ae,ze,Oe=-2147483648,ke=2147483647)=>{if(typeof Ae!="number")throw new w(ze,"number",Ae);if(!i(Ae))throw new E(ze,"an integer",Ae);if(Ae<Oe||Ae>ke)throw new E(ze,`>= ${Oe} && <= ${ke}`,Ae)}),ie=y((Ae,ze,Oe=!1)=>{if(typeof Ae!="number")throw new w(ze,"number",Ae);if(!i(Ae))throw new E(ze,"an integer",Ae);let ke=Oe?1:0,Ke=4294967295;if(Ae<ke||Ae>Ke)throw new E(ze,`>= ${ke} && <= ${Ke}`,Ae)});function re(Ae,ze){if(typeof Ae!="string")throw new w(ze,"string",Ae)}function O(Ae,ze,Oe=void 0,ke){if(typeof Ae!="number")throw new w(ze,"number",Ae);if(Oe!=null&&Ae<Oe||ke!=null&&Ae>ke||(Oe!=null||ke!=null)&&o(Ae))throw new E(ze,`${Oe!=null?`>= ${Oe}`:""}${Oe!=null&&ke!=null?" && ":""}${ke!=null?`<= ${ke}`:""}`,Ae)}let x=y((Ae,ze,Oe)=>{if(!e(Oe,Ae)){let Ke="must be one of: "+t(n(Oe,tt=>typeof tt=="string"?`'${tt}'`:h(tt)),", ");throw new b(ze,Ae,Ke)}});function P(Ae,ze){if(typeof Ae!="boolean")throw new w(ze,"boolean",Ae)}function C(Ae,ze,Oe){return Ae==null||!c(Ae,ze)?Oe:Ae[ze]}let j=y((Ae,ze,Oe=null)=>{let ke=C(Oe,"allowArray",!1),Ke=C(Oe,"allowFunction",!1);if(!C(Oe,"nullable",!1)&&Ae===null||!ke&&r(Ae)||typeof Ae!="object"&&(!Ke||typeof Ae!="function"))throw new w(ze,"Object",Ae)}),U=y((Ae,ze)=>{if(Ae!=null&&typeof Ae!="object"&&typeof Ae!="function")throw new w(ze,"a dictionary",Ae)}),B=y((Ae,ze,Oe=0)=>{if(!r(Ae))throw new w(ze,"Array",Ae);if(Ae.length<Oe){let ke=`must be longer than ${Oe}`;throw new b(ze,Ae,ke)}});function ee(Ae,ze){B(Ae,ze);for(let Oe=0;Oe<Ae.length;Oe++)re(Ae[Oe],`${ze}[${Oe}]`)}function fe(Ae,ze){B(Ae,ze);for(let Oe=0;Oe<Ae.length;Oe++)P(Ae[Oe],`${ze}[${Oe}]`)}function Ee(Ae,ze){B(Ae,ze);for(let Oe=0;Oe<Ae.length;Oe++){let ke=Ae[Oe],Ke=`${ze}[${Oe}]`;if(ke==null)throw new w(Ke,"AbortSignal",ke);xe(ke,Ke)}}function te(Ae,ze="signal"){if(re(Ae,ze),I[Ae]===void 0)throw I[d(Ae)]!==void 0?new _(Ae+" (signals must use all capital letters)"):new _(Ae)}let H=y((Ae,ze="buffer")=>{if(!M(Ae))throw new w(ze,["Buffer","TypedArray","DataView"],Ae)});function ae(Ae,ze){let Oe=S(ze),ke=Ae.length;if(Oe==="hex"&&ke%2!==0)throw new b("encoding",ze,`is invalid for data of length ${ke}`)}function we(Ae,ze="Port",Oe=!0){if(typeof Ae!="number"&&typeof Ae!="string"||typeof Ae=="string"&&g(Ae).length===0||+Ae!==+Ae>>>0||Ae>65535||Ae===0&&!Oe)throw new v(ze,Ae,Oe);return Ae|0}let xe=y((Ae,ze)=>{if(Ae!==void 0&&(Ae===null||typeof Ae!="object"||!("aborted"in Ae)))throw new w(ze,"AbortSignal",Ae)}),V=y((Ae,ze)=>{if(typeof Ae!="function")throw new w(ze,"Function",Ae)}),F=y((Ae,ze)=>{if(typeof Ae!="function"||A(Ae))throw new w(ze,"Function",Ae)}),oe=y((Ae,ze)=>{if(Ae!==void 0)throw new w(ze,"undefined",Ae)});function ge(Ae,ze,Oe){if(!e(Oe,Ae))throw new w(ze,`('${t(Oe,"|")}')`,Ae)}let Re=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function be(Ae,ze){if(typeof Ae>"u"||!f(Re,Ae))throw new b(ze,Ae,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function pe(Ae){if(typeof Ae=="string")return be(Ae,"hints"),Ae;if(r(Ae)){let ze=Ae.length,Oe="";if(ze===0)return Oe;for(let ke=0;ke<ze;ke++){let Ke=Ae[ke];be(Ke,"hints"),Oe+=Ke,ke!==ze-1&&(Oe+=", ")}return Oe}throw new b("hints",Ae,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}return _A={isInt32:q,isUint32:Q,parseFileMode:L,validateArray:B,validateStringArray:ee,validateBooleanArray:fe,validateAbortSignalArray:Ee,validateBoolean:P,validateBuffer:H,validateDictionary:U,validateEncoding:ae,validateFunction:V,validateInt32:X,validateInteger:$,validateNumber:O,validateObject:j,validateOneOf:x,validatePlainFunction:F,validatePort:we,validateSignalName:te,validateString:re,validateUint32:ie,validateUndefined:oe,validateUnion:ge,validateAbortSignal:xe,validateLinkHeaderValue:pe},_A}function Sa(){if(BP)return AA;BP=!0;let{SymbolAsyncIterator:r,SymbolIterator:e,SymbolFor:t}=Fr(),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 d(C){return!!(C&&typeof C.pipe=="function"&&C._readableState&&typeof C.on=="function"&&typeof C.write=="function")}function g(C){return C&&(C._readableState||C._writableState||typeof C.write=="function"&&typeof C.on=="function"||typeof C.pipe=="function"&&typeof C.on=="function")}function y(C){return!!(C&&!g(C)&&typeof C.pipeThrough=="function"&&typeof C.getReader=="function"&&typeof C.cancel=="function")}function v(C){return!!(C&&!g(C)&&typeof C.getWriter=="function"&&typeof C.abort=="function")}function w(C){return!!(C&&!g(C)&&typeof C.readable=="object"&&typeof C.writable=="object")}function b(C){return y(C)||v(C)||w(C)}function E(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 _(C){if(!g(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 M(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 I(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 q(C){return C&&C[o]!=null?C[o]:typeof C?.readable!="boolean"?null:_(C)?!1:f(C)&&C.readable&&!I(C)}function Q(C){return C&&C[s]!=null?C[s]:typeof C?.writable!="boolean"?null:_(C)?!1:h(C)&&C.writable&&!S(C)}function Z(C,j){return g(C)?_(C)?!0:!(j?.readable!==!1&&q(C)||j?.writable!==!1&&Q(C)):null}function ne(C){var j,U;return g(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 L(C){var j,U;return g(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(!g(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"&&X(C)?C._closed:null}function X(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"&&X(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 O(C){if(!g(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,ee,fe,Ee,te,H,ae,we;return!!(C&&((j=(U=(B=(ee=(fe=(Ee=C[i])!==null&&Ee!==void 0?Ee:C.readableErrored)!==null&&fe!==void 0?fe:C.writableErrored)!==null&&ee!==void 0?ee:(te=C._readableState)===null||te===void 0?void 0:te.errorEmitted)!==null&&B!==void 0?B:(H=C._writableState)===null||H===void 0?void 0:H.errorEmitted)!==null&&U!==void 0?U:(ae=C._readableState)===null||ae===void 0?void 0:ae.errored)!==null&&j!==void 0?j:!((we=C._writableState)===null||we===void 0)&&we.errored))}return AA={isDestroyed:_,kIsDestroyed:n,isDisturbed:x,kIsDisturbed:a,isErrored:P,kIsErrored:i,isReadable:q,kIsReadable:o,kIsClosedPromise:u,kControllerErrorFunction:c,kIsWritable:s,isClosed:$,isDuplexNodeStream:d,isFinished:Z,isIterable:E,isReadableNodeStream:f,isReadableStream:y,isReadableEnded:M,isReadableFinished:I,isReadableErrored:L,isNodeStream:g,isWebStream:b,isWritable:Q,isWritableNodeStream:h,isWritableStream:v,isWritableEnded:S,isWritableFinished:A,isWritableErrored:ne,isServerRequest:re,isServerResponse:ie,willEmitClose:O,isTransformStream:w},AA}function $l(){if(UP)return Sw;UP=!0;let r=Vr,{AbortError:e,codes:t}=bi(),{ERR_INVALID_ARG_TYPE:n,ERR_STREAM_PREMATURE_CLOSE:i}=t,{kEmptyObject:o,once:s}=Qn(),{validateAbortSignal:a,validateFunction:u,validateObject:c,validateBoolean:f}=Kg(),{Promise:h,PromisePrototypeThen:d,SymbolDispose:g}=Fr(),{isClosed:y,isReadable:v,isReadableNodeStream:w,isReadableStream:b,isReadableFinished:E,isReadableErrored:_,isWritable:S,isWritableNodeStream:A,isWritableStream:M,isWritableFinished:I,isWritableErrored:q,isNodeStream:Q,willEmitClose:Z,kIsClosedPromise:ne}=Sa(),L;function $(x){return x.setHeader&&typeof x.abort=="function"}let X=()=>{};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),b(x)||M(x))return re(x,P,C);if(!Q(x))throw new n("stream",["ReadableStream","WritableStream","Stream"],x);let B=(j=P.readable)!==null&&j!==void 0?j:w(x),ee=(U=P.writable)!==null&&U!==void 0?U:A(x),fe=x._writableState,Ee=x._readableState,te=()=>{x.writable||we()},H=Z(x)&&w(x)===B&&A(x)===ee,ae=I(x,!1),we=()=>{ae=!0,x.destroyed&&(H=!1),!(H&&(!x.readable||B))&&(!B||xe)&&C.call(x)},xe=E(x,!1),V=()=>{xe=!0,x.destroyed&&(H=!1),!(H&&(!x.writable||ee))&&(!ee||ae)&&C.call(x)},F=Ae=>{C.call(x,Ae)},oe=y(x),ge=()=>{oe=!0;let Ae=q(x)||_(x);if(Ae&&typeof Ae!="boolean")return C.call(x,Ae);if(B&&!xe&&w(x,!0)&&!E(x,!1))return C.call(x,new i);if(ee&&!ae&&!I(x,!1))return C.call(x,new i);C.call(x)},Re=()=>{oe=!0;let Ae=q(x)||_(x);if(Ae&&typeof Ae!="boolean")return C.call(x,Ae);C.call(x)},be=()=>{x.req.on("finish",we)};$(x)?(x.on("complete",we),H||x.on("abort",ge),x.req?be():x.on("request",be)):ee&&!fe&&(x.on("end",te),x.on("close",te)),!H&&typeof x.aborted=="boolean"&&x.on("aborted",ge),x.on("end",V),x.on("finish",we),P.error!==!1&&x.on("error",F),x.on("close",ge),oe?r.nextTick(ge):fe!=null&&fe.errorEmitted||Ee!=null&&Ee.errorEmitted?H||r.nextTick(Re):(!B&&(!H||v(x))&&(ae||S(x)===!1)||!ee&&(!H||S(x))&&(xe||v(x)===!1)||Ee&&x.req&&x.aborted)&&r.nextTick(Re);let pe=()=>{C=X,x.removeListener("aborted",ge),x.removeListener("complete",we),x.removeListener("abort",ge),x.removeListener("request",be),x.req&&x.req.removeListener("finish",we),x.removeListener("end",te),x.removeListener("close",te),x.removeListener("finish",we),x.removeListener("end",V),x.removeListener("error",F),x.removeListener("close",ge)};if(P.signal&&!oe){let Ae=()=>{let ze=C;pe(),ze.call(x,new e(void 0,{cause:P.signal.reason}))};if(P.signal.aborted)r.nextTick(Ae);else{L=L||Qn().addAbortListener;let ze=L(P.signal,Ae),Oe=C;C=s((...ke)=>{ze[g](),Oe.apply(x,ke)})}}return pe}function re(x,P,C){let j=!1,U=X;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{L=L||Qn().addAbortListener;let ee=L(P.signal,U),fe=C;C=s((...Ee)=>{ee[g](),fe.apply(x,Ee)})}let B=(...ee)=>{j||r.nextTick(()=>C.apply(x,ee))};return d(x[ne].promise,B,B),X}function O(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 ee=ie(x,P,fe=>{j&&ee(),fe?B(fe):U()})})}return Sw=ie,Sw.finished=O,Sw}function Hh(){if(jP)return xA;jP=!0;let r=Vr,{aggregateTwoErrors:e,codes:{ERR_MULTIPLE_CALLBACK:t},AbortError:n}=bi(),{Symbol:i}=Fr(),{kIsDestroyed:o,isDestroyed:s,isFinished:a,isServerRequest:u}=Sa(),c=i("kDestroy"),f=i("kConstruct");function h(Z,ne,L){Z&&(Z.stack,ne&&!ne.errored&&(ne.errored=Z),L&&!L.errored&&(L.errored=Z))}function d(Z,ne){let L=this._readableState,$=this._writableState,X=$||L;return $!=null&&$.destroyed||L!=null&&L.destroyed?(typeof ne=="function"&&ne(),this):(h(Z,$,L),$&&($.destroyed=!0),L&&(L.destroyed=!0),X.constructed?g(this,Z,ne):this.once(c,function(ie){g(this,e(ie,Z),ne)}),this)}function g(Z,ne,L){let $=!1;function X(ie){if($)return;$=!0;let re=Z._readableState,O=Z._writableState;h(ie,O,re),O&&(O.closed=!0),re&&(re.closed=!0),typeof L=="function"&&L(ie),ie?r.nextTick(y,Z,ie):r.nextTick(v,Z)}try{Z._destroy(ne||null,X)}catch(ie){X(ie)}}function y(Z,ne){w(Z,ne),v(Z)}function v(Z){let ne=Z._readableState,L=Z._writableState;L&&(L.closeEmitted=!0),ne&&(ne.closeEmitted=!0),(L!=null&&L.emitClose||ne!=null&&ne.emitClose)&&Z.emit("close")}function w(Z,ne){let L=Z._readableState,$=Z._writableState;$!=null&&$.errorEmitted||L!=null&&L.errorEmitted||($&&($.errorEmitted=!0),L&&(L.errorEmitted=!0),Z.emit("error",ne))}function b(){let Z=this._readableState,ne=this._writableState;Z&&(Z.constructed=!0,Z.closed=!1,Z.closeEmitted=!1,Z.destroyed=!1,Z.errored=null,Z.errorEmitted=!1,Z.reading=!1,Z.ended=Z.readable===!1,Z.endEmitted=Z.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 E(Z,ne,L){let $=Z._readableState,X=Z._writableState;if(X!=null&&X.destroyed||$!=null&&$.destroyed)return this;$!=null&&$.autoDestroy||X!=null&&X.autoDestroy?Z.destroy(ne):ne&&(ne.stack,X&&!X.errored&&(X.errored=ne),$&&!$.errored&&($.errored=ne),L?r.nextTick(w,Z,ne):w(Z,ne))}function _(Z,ne){if(typeof Z._construct!="function")return;let L=Z._readableState,$=Z._writableState;L&&(L.constructed=!1),$&&($.constructed=!1),Z.once(f,ne),!(Z.listenerCount(f)>1)&&r.nextTick(S,Z)}function S(Z){let ne=!1;function L($){if(ne){E(Z,$??new t);return}ne=!0;let X=Z._readableState,ie=Z._writableState,re=ie||X;X&&(X.constructed=!0),ie&&(ie.constructed=!0),re.destroyed?Z.emit(c,$):$?E(Z,$,!0):r.nextTick(A,Z)}try{Z._construct($=>{r.nextTick(L,$)})}catch($){r.nextTick(L,$)}}function A(Z){Z.emit(f)}function M(Z){return Z?.setHeader&&typeof Z.abort=="function"}function I(Z){Z.emit("close")}function q(Z,ne){Z.emit("error",ne),r.nextTick(I,Z)}function Q(Z,ne){!Z||s(Z)||(!ne&&!a(Z)&&(ne=new n),u(Z)?(Z.socket=null,Z.destroy(ne)):M(Z)?Z.abort():M(Z.req)?Z.req.abort():typeof Z.destroy=="function"?Z.destroy(ne):typeof Z.close=="function"?Z.close():ne?r.nextTick(q,Z,ne):r.nextTick(I,Z),Z.destroyed||(Z[o]=!0))}return xA={construct:_,destroyer:Q,destroy:d,undestroy:b,errorOrDestroy:E},xA}function jA(){if($P)return SA;$P=!0;let{ArrayIsArray:r,ObjectSetPrototypeOf:e}=Fr(),{EventEmitter:t}=xo;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",d));let f=!1;function h(){f||(f=!0,o.end())}function d(){f||(f=!0,typeof o.destroy=="function"&&o.destroy())}function g(v){y(),t.listenerCount(this,"error")===0&&this.emit("error",v)}i(a,"error",g),i(o,"error",g);function y(){a.removeListener("data",u),o.removeListener("drain",c),a.removeListener("end",h),a.removeListener("close",d),a.removeListener("error",g),o.removeListener("error",g),a.removeListener("end",y),a.removeListener("close",y),o.removeListener("close",y)}return a.on("end",y),a.on("close",y),o.on("close",y),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 SA={Stream:n,prependListener:i},SA}function Cw(){if(zP)return Yg;zP=!0;let{SymbolDispose:r}=Fr(),{AbortError:e,codes:t}=bi(),{isNodeStream:n,isWebStream:i,kControllerErrorFunction:o}=Sa(),s=$l(),{ERR_INVALID_ARG_TYPE:a}=t,u,c=(f,h)=>{if(typeof f!="object"||!("aborted"in f))throw new a(h,"AbortSignal",f)};return Yg.addAbortSignal=function(h,d){if(c(h,"signal"),!n(d)&&!i(d))throw new a("stream",["ReadableStream","WritableStream","Stream"],d);return Yg.addAbortSignalNoValidate(h,d)},Yg.addAbortSignalNoValidate=function(f,h){if(typeof f!="object"||!("aborted"in f))return h;let d=n(h)?()=>{h.destroy(new e(void 0,{cause:f.reason}))}:()=>{h[o](new e(void 0,{cause:f.reason}))};if(f.aborted)d();else{u=u||Qn().addAbortListener;let g=u(f,d);s(h,g[r])}return h},Yg}function bq(){if(WP)return TA;WP=!0;let{StringPrototypeSlice:r,SymbolIterator:e,TypedArrayPrototypeSet:t,Uint8Array:n}=Fr(),{Buffer:i}=yn(),{inspect:o}=Qn();return TA=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 d=f.data;if(a>d.length)t(u,d,c-a),a-=d.length;else{a===d.length?(t(u,d,c-a),++h,f.next?this.head=f.next:this.head=this.tail=null):(t(u,new n(d.buffer,d.byteOffset,a),c-a),this.head=f,f.data=d.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})}},TA}function Rw(){if(HP)return CA;HP=!0;let{MathFloor:r,NumberIsInteger:e}=Fr(),{validateInteger:t}=Kg(),{ERR_INVALID_ARG_VALUE:n}=bi().codes,i=16*1024,o=16;function s(f,h,d){return f.highWaterMark!=null?f.highWaterMark:h?f[d]: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,d,g){let y=s(h,g,d);if(y!=null){if(!e(y)||y<0){let v=g?`options.${d}`:"options.highWaterMark";throw new n(v,y)}return r(y)}return a(f.objectMode)}return CA={getHighWaterMark:c,getDefaultHighWaterMark:a,setDefaultHighWaterMark:u},CA}function sF(){if(qP)return RA;qP=!0;let r=Vr,{PromisePrototypeThen:e,SymbolAsyncIterator:t,SymbolIterator:n}=Fr(),{Buffer:i}=yn(),{ERR_INVALID_ARG_TYPE:o,ERR_STREAM_NULL_VALUES:s}=bi().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 d;if(c&&c[t])d=!0,h=c[t]();else if(c&&c[n])d=!1,h=c[n]();else throw new o("iterable",["Iterable"],c);let g=new u({objectMode:!0,highWaterMark:1,...f}),y=!1;g._read=function(){y||(y=!0,w())},g._destroy=function(b,E){e(v(b),()=>r.nextTick(E,b),_=>r.nextTick(E,_||b))};async function v(b){let E=b!=null,_=typeof h.throw=="function";if(E&&_){let{value:S,done:A}=await h.throw(b);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:b,done:E}=d?await h.next():h.next();if(E)g.push(null);else{let _=b&&typeof b.then=="function"?await b:b;if(_===null)throw y=!1,new s;if(g.push(_))continue;y=!1}}catch(b){g.destroy(b)}break}}return g}return RA=a,RA}function Dw(){if(GP)return DA;GP=!0;let r=Vr,{ArrayPrototypeIndexOf:e,NumberIsInteger:t,NumberIsNaN:n,NumberParseInt:i,ObjectDefineProperties:o,ObjectKeys:s,ObjectSetPrototypeOf:a,Promise:u,SafeSet:c,SymbolAsyncDispose:f,SymbolAsyncIterator:h,Symbol:d}=Fr();DA=ke,ke.ReadableState=Oe;let{EventEmitter:g}=xo,{Stream:y,prependListener:v}=jA(),{Buffer:w}=yn(),{addAbortSignal:b}=Cw(),E=$l(),_=Qn().debuglog("stream",ue=>{_=ue}),S=bq(),A=Hh(),{getHighWaterMark:M,getDefaultHighWaterMark:I}=Rw(),{aggregateTwoErrors:q,codes:{ERR_INVALID_ARG_TYPE:Q,ERR_METHOD_NOT_IMPLEMENTED:Z,ERR_OUT_OF_RANGE:ne,ERR_STREAM_PUSH_AFTER_EOF:L,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:$},AbortError:X}=bi(),{validateObject:ie}=Kg(),re=d("kPaused"),{StringDecoder:O}=Aw,x=sF();a(ke.prototype,y.prototype),a(ke,y);let P=()=>{},{errorOrDestroy:C}=A,j=1,U=2,B=4,ee=8,fe=16,Ee=32,te=64,H=128,ae=256,we=512,xe=1024,V=2048,F=4096,oe=8192,ge=16384,Re=32768,be=65536,pe=1<<17,Ae=1<<18;function ze(ue){return{enumerable:!1,get(){return((this||Xe).state&ue)!==0},set(me){me?(this||Xe).state|=ue:(this||Xe).state&=~ue}}}o(Oe.prototype,{objectMode:ze(j),ended:ze(U),endEmitted:ze(B),reading:ze(ee),constructed:ze(fe),sync:ze(Ee),needReadable:ze(te),emittedReadable:ze(H),readableListening:ze(ae),resumeScheduled:ze(we),errorEmitted:ze(xe),emitClose:ze(V),autoDestroy:ze(F),destroyed:ze(oe),closed:ze(ge),closeEmitted:ze(Re),multiAwaitDrain:ze(be),readingMore:ze(pe),dataEmitted:ze(Ae)});function Oe(ue,me,Ge){typeof Ge!="boolean"&&(Ge=me instanceof xa()),(this||Xe).state=V|F|fe|Ee,ue&&ue.objectMode&&((this||Xe).state|=j),Ge&&ue&&ue.readableObjectMode&&((this||Xe).state|=j),(this||Xe).highWaterMark=ue?M(this||Xe,ue,"readableHighWaterMark",Ge):I(!1),(this||Xe).buffer=new S,(this||Xe).length=0,(this||Xe).pipes=[],(this||Xe).flowing=null,(this||Xe)[re]=null,ue&&ue.emitClose===!1&&((this||Xe).state&=~V),ue&&ue.autoDestroy===!1&&((this||Xe).state&=~F),(this||Xe).errored=null,(this||Xe).defaultEncoding=ue&&ue.defaultEncoding||"utf8",(this||Xe).awaitDrainWriters=null,(this||Xe).decoder=null,(this||Xe).encoding=null,ue&&ue.encoding&&((this||Xe).decoder=new O(ue.encoding),(this||Xe).encoding=ue.encoding)}function ke(ue){if(!((this||Xe)instanceof ke))return new ke(ue);let me=(this||Xe)instanceof xa();(this||Xe)._readableState=new Oe(ue,this||Xe,me),ue&&(typeof ue.read=="function"&&((this||Xe)._read=ue.read),typeof ue.destroy=="function"&&((this||Xe)._destroy=ue.destroy),typeof ue.construct=="function"&&((this||Xe)._construct=ue.construct),ue.signal&&!me&&b(ue.signal,this||Xe)),y.call(this||Xe,ue),A.construct(this||Xe,()=>{(this||Xe)._readableState.needReadable&&D(this||Xe,(this||Xe)._readableState)})}ke.prototype.destroy=A.destroy,ke.prototype._undestroy=A.undestroy,ke.prototype._destroy=function(ue,me){me(ue)},ke.prototype[g.captureRejectionSymbol]=function(ue){this.destroy(ue)},ke.prototype[f]=function(){let ue;return(this||Xe).destroyed||(ue=(this||Xe).readableEnded?null:new X,this.destroy(ue)),new u((me,Ge)=>E(this||Xe,Ue=>Ue&&Ue!==ue?Ge(Ue):me(null)))},ke.prototype.push=function(ue,me){return Ke(this||Xe,ue,me,!1)},ke.prototype.unshift=function(ue,me){return Ke(this||Xe,ue,me,!0)};function Ke(ue,me,Ge,Ue){_("readableAddChunk",me);let et=ue._readableState,gt;if((et.state&j)===0&&(typeof me=="string"?(Ge=Ge||et.defaultEncoding,et.encoding!==Ge&&(Ue&&et.encoding?me=w.from(me,Ge).toString(et.encoding):(me=w.from(me,Ge),Ge=""))):me instanceof w?Ge="":y._isUint8Array(me)?(me=y._uint8ArrayToBuffer(me),Ge=""):me!=null&&(gt=new Q("chunk",["string","Buffer","Uint8Array"],me))),gt)C(ue,gt);else if(me===null)et.state&=~ee,p(ue,et);else if((et.state&j)!==0||me&&me.length>0)if(Ue)if((et.state&B)!==0)C(ue,new $);else{if(et.destroyed||et.errored)return!1;tt(ue,et,me,!0)}else if(et.ended)C(ue,new L);else{if(et.destroyed||et.errored)return!1;et.state&=~ee,et.decoder&&!Ge?(me=et.decoder.write(me),et.objectMode||me.length!==0?tt(ue,et,me,!1):D(ue,et)):tt(ue,et,me,!1)}else Ue||(et.state&=~ee,D(ue,et));return!et.ended&&(et.length<et.highWaterMark||et.length===0)}function tt(ue,me,Ge,Ue){me.flowing&&me.length===0&&!me.sync&&ue.listenerCount("data")>0?((me.state&be)!==0?me.awaitDrainWriters.clear():me.awaitDrainWriters=null,me.dataEmitted=!0,ue.emit("data",Ge)):(me.length+=me.objectMode?1:Ge.length,Ue?me.buffer.unshift(Ge):me.buffer.push(Ge),(me.state&te)!==0&&R(ue)),D(ue,me)}ke.prototype.isPaused=function(){let ue=(this||Xe)._readableState;return ue[re]===!0||ue.flowing===!1},ke.prototype.setEncoding=function(ue){let me=new O(ue);(this||Xe)._readableState.decoder=me,(this||Xe)._readableState.encoding=(this||Xe)._readableState.decoder.encoding;let Ge=(this||Xe)._readableState.buffer,Ue="";for(let et of Ge)Ue+=me.write(et);return Ge.clear(),Ue!==""&&Ge.push(Ue),(this||Xe)._readableState.length=Ue.length,this||Xe};let it=1073741824;function T(ue){if(ue>it)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 m(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}ke.prototype.read=function(ue){_("read",ue),ue===void 0?ue=NaN:t(ue)||(ue=i(ue,10));let me=(this||Xe)._readableState,Ge=ue;if(ue>me.highWaterMark&&(me.highWaterMark=T(ue)),ue!==0&&(me.state&=~H),ue===0&&me.needReadable&&((me.highWaterMark!==0?me.length>=me.highWaterMark:me.length>0)||me.ended))return _("read: emitReadable",me.length,me.ended),me.length===0&&me.ended?je(this||Xe):R(this||Xe),null;if(ue=m(ue,me),ue===0&&me.ended)return me.length===0&&je(this||Xe),null;let Ue=(me.state&te)!==0;if(_("need readable",Ue),(me.length===0||me.length-ue<me.highWaterMark)&&(Ue=!0,_("length less than watermark",Ue)),me.ended||me.reading||me.destroyed||me.errored||!me.constructed)Ue=!1,_("reading, ended or constructing",Ue);else if(Ue){_("do read"),me.state|=ee|Ee,me.length===0&&(me.state|=te);try{this._read(me.highWaterMark)}catch(gt){C(this||Xe,gt)}me.state&=~Ee,me.reading||(ue=m(Ge,me))}let et;return ue>0?et=Pe(ue,me):et=null,et===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),Ge!==ue&&me.ended&&je(this||Xe)),et!==null&&!me.errorEmitted&&!me.closeEmitted&&(me.dataEmitted=!0,this.emit("data",et)),et};function p(ue,me){if(_("onEofChunk"),!me.ended){if(me.decoder){let Ge=me.decoder.end();Ge&&Ge.length&&(me.buffer.push(Ge),me.length+=me.objectMode?1:Ge.length)}me.ended=!0,me.sync?R(ue):(me.needReadable=!1,me.emittedReadable=!0,J(ue))}}function R(ue){let me=ue._readableState;_("emitReadable",me.needReadable,me.emittedReadable),me.needReadable=!1,me.emittedReadable||(_("emitReadable",me.flowing),me.emittedReadable=!0,r.nextTick(J,ue))}function J(ue){let me=ue._readableState;_("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 D(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 Ge=me.length;if(_("maybeReadMore read 0"),ue.read(0),Ge===me.length)break}me.readingMore=!1}ke.prototype._read=function(ue){throw new Z("_read()")},ke.prototype.pipe=function(ue,me){let Ge=this||Xe,Ue=(this||Xe)._readableState;Ue.pipes.length===1&&(Ue.multiAwaitDrain||(Ue.multiAwaitDrain=!0,Ue.awaitDrainWriters=new c(Ue.awaitDrainWriters?[Ue.awaitDrainWriters]:[]))),Ue.pipes.push(ue),_("pipe count=%d opts=%j",Ue.pipes.length,me);let gt=(!me||me.end!==!1)&&ue!==r.stdout&&ue!==r.stderr?xt:nn;Ue.endEmitted?r.nextTick(gt):Ge.once("end",gt),ue.on("unpipe",It);function It(sn,on){_("onunpipe"),sn===Ge&&on&&on.hasUnpiped===!1&&(on.hasUnpiped=!0,Zn())}function xt(){_("onend"),ue.end()}let hr,Oi=!1;function Zn(){_("cleanup"),ue.removeListener("close",Ht),ue.removeListener("finish",Jt),hr&&ue.removeListener("drain",hr),ue.removeListener("error",wr),ue.removeListener("unpipe",It),Ge.removeListener("end",xt),Ge.removeListener("end",nn),Ge.removeListener("data",Lr),Oi=!0,hr&&Ue.awaitDrainWriters&&(!ue._writableState||ue._writableState.needDrain)&&hr()}function Yt(){Oi||(Ue.pipes.length===1&&Ue.pipes[0]===ue?(_("false write response, pause",0),Ue.awaitDrainWriters=ue,Ue.multiAwaitDrain=!1):Ue.pipes.length>1&&Ue.pipes.includes(ue)&&(_("false write response, pause",Ue.awaitDrainWriters.size),Ue.awaitDrainWriters.add(ue)),Ge.pause()),hr||(hr=he(Ge,ue),ue.on("drain",hr))}Ge.on("data",Lr);function Lr(sn){_("ondata");let on=ue.write(sn);_("dest.write",on),on===!1&&Yt()}function wr(sn){if(_("onerror",sn),nn(),ue.removeListener("error",wr),ue.listenerCount("error")===0){let on=ue._writableState||ue._readableState;on&&!on.errorEmitted?C(ue,sn):ue.emit("error",sn)}}v(ue,"error",wr);function Ht(){ue.removeListener("finish",Jt),nn()}ue.once("close",Ht);function Jt(){_("onfinish"),ue.removeListener("close",Ht),nn()}ue.once("finish",Jt);function nn(){_("unpipe"),Ge.unpipe(ue)}return ue.emit("pipe",Ge),ue.writableNeedDrain===!0?Yt():Ue.flowing||(_("pipe resume"),Ge.resume()),ue};function he(ue,me){return function(){let Ue=ue._readableState;Ue.awaitDrainWriters===me?(_("pipeOnDrain",1),Ue.awaitDrainWriters=null):Ue.multiAwaitDrain&&(_("pipeOnDrain",Ue.awaitDrainWriters.size),Ue.awaitDrainWriters.delete(me)),(!Ue.awaitDrainWriters||Ue.awaitDrainWriters.size===0)&&ue.listenerCount("data")&&ue.resume()}}ke.prototype.unpipe=function(ue){let me=(this||Xe)._readableState,Ge={hasUnpiped:!1};if(me.pipes.length===0)return this||Xe;if(!ue){let et=me.pipes;me.pipes=[],this.pause();for(let gt=0;gt<et.length;gt++)et[gt].emit("unpipe",this||Xe,{hasUnpiped:!1});return this||Xe}let Ue=e(me.pipes,ue);return Ue===-1?this||Xe:(me.pipes.splice(Ue,1),me.pipes.length===0&&this.pause(),ue.emit("unpipe",this||Xe,Ge),this||Xe)},ke.prototype.on=function(ue,me){let Ge=y.prototype.on.call(this||Xe,ue,me),Ue=(this||Xe)._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,_("on readable",Ue.length,Ue.reading),Ue.length?R(this||Xe):Ue.reading||r.nextTick(ve,this||Xe)),Ge},ke.prototype.addListener=ke.prototype.on,ke.prototype.removeListener=function(ue,me){let Ge=y.prototype.removeListener.call(this||Xe,ue,me);return ue==="readable"&&r.nextTick(_e,this||Xe),Ge},ke.prototype.off=ke.prototype.removeListener,ke.prototype.removeAllListeners=function(ue){let me=y.prototype.removeAllListeners.apply(this||Xe,arguments);return(ue==="readable"||ue===void 0)&&r.nextTick(_e,this||Xe),me};function _e(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){_("readable nexttick read 0"),ue.read(0)}ke.prototype.resume=function(){let ue=(this||Xe)._readableState;return ue.flowing||(_("resume"),ue.flowing=!ue.readableListening,Ie(this||Xe,ue)),ue[re]=!1,this||Xe};function Ie(ue,me){me.resumeScheduled||(me.resumeScheduled=!0,r.nextTick(K,ue,me))}function K(ue,me){_("resume",me.reading),me.reading||ue.read(0),me.resumeScheduled=!1,ue.emit("resume"),Fe(ue),me.flowing&&!me.reading&&ue.read(0)}ke.prototype.pause=function(){return _("call pause flowing=%j",(this||Xe)._readableState.flowing),(this||Xe)._readableState.flowing!==!1&&(_("pause"),(this||Xe)._readableState.flowing=!1,this.emit("pause")),(this||Xe)._readableState[re]=!0,this||Xe};function Fe(ue){let me=ue._readableState;for(_("flow",me.flowing);me.flowing&&ue.read()!==null;);}ke.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||Xe,Ue)}),ue.on("close",()=>{this.destroy()}),ue.on("destroy",()=>{this.destroy()}),(this||Xe)._read=()=>{me&&ue.resume&&(me=!1,ue.resume())};let Ge=s(ue);for(let Ue=1;Ue<Ge.length;Ue++){let et=Ge[Ue];(this||Xe)[et]===void 0&&typeof ue[et]=="function"&&((this||Xe)[et]=ue[et].bind(ue))}return this||Xe},ke.prototype[h]=function(){return nt(this||Xe)},ke.prototype.iterator=function(ue){return ue!==void 0&&ie(ue,"options"),nt(this||Xe,ue)};function nt(ue,me){typeof ue.read!="function"&&(ue=ke.wrap(ue,{objectMode:!0}));let Ge=k(ue,me);return Ge.stream=ue,Ge}async function*k(ue,me){let Ge=P;function Ue(It){(this||Xe)===ue?(Ge(),Ge=P):Ge=It}ue.on("readable",Ue);let et,gt=E(ue,{writable:!1},It=>{et=It?q(et,It):null,Ge(),Ge=P});try{for(;;){let It=ue.destroyed?null:ue.read();if(It!==null)yield It;else{if(et)throw et;if(et===null)return;await new u(Ue)}}}catch(It){throw et=q(et,It),et}finally{(et||me?.destroyOnReturn!==!1)&&(et===void 0||ue._readableState.autoDestroy)?A.destroyer(ue,null):(ue.off("readable",Ue),gt())}}o(ke.prototype,{readable:{__proto__:null,get(){let ue=(this||Xe)._readableState;return!!ue&&ue.readable!==!1&&!ue.destroyed&&!ue.errorEmitted&&!ue.endEmitted},set(ue){(this||Xe)._readableState&&((this||Xe)._readableState.readable=!!ue)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return(this||Xe)._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!((this||Xe)._readableState.readable!==!1&&((this||Xe)._readableState.destroyed||(this||Xe)._readableState.errored)&&!(this||Xe)._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return(this||Xe)._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return(this||Xe)._readableState&&(this||Xe)._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return(this||Xe)._readableState.flowing},set:function(ue){(this||Xe)._readableState&&((this||Xe)._readableState.flowing=ue)}},readableLength:{__proto__:null,enumerable:!1,get(){return(this||Xe)._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return(this||Xe)._readableState?(this||Xe)._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return(this||Xe)._readableState?(this||Xe)._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return(this||Xe)._readableState?(this||Xe)._readableState.errored:null}},closed:{__proto__:null,get(){return(this||Xe)._readableState?(this||Xe)._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return(this||Xe)._readableState?(this||Xe)._readableState.destroyed:!1},set(ue){(this||Xe)._readableState&&((this||Xe)._readableState.destroyed=ue)}},readableEnded:{__proto__:null,enumerable:!1,get(){return(this||Xe)._readableState?(this||Xe)._readableState.endEmitted:!1}}}),o(Oe.prototype,{pipesCount:{__proto__:null,get(){return(this||Xe).pipes.length}},paused:{__proto__:null,get(){return(this||Xe)[re]!==!1},set(ue){(this||Xe)[re]=!!ue}}}),ke._fromList=Pe;function Pe(ue,me){if(me.length===0)return null;let Ge;return me.objectMode?Ge=me.buffer.shift():!ue||ue>=me.length?(me.decoder?Ge=me.buffer.join(""):me.buffer.length===1?Ge=me.buffer.first():Ge=me.buffer.concat(me.length),me.buffer.clear()):Ge=me.buffer.consume(ue,me.decoder),Ge}function je(ue){let me=ue._readableState;_("endReadable",me.endEmitted),me.endEmitted||(me.ended=!0,r.nextTick(de,me,ue))}function de(ue,me){if(_("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(De,me);else if(ue.autoDestroy){let Ge=me._writableState;(!Ge||Ge.autoDestroy&&(Ge.finished||Ge.writable===!1))&&me.destroy()}}}function De(ue){ue.writable&&!ue.writableEnded&&!ue.destroyed&&ue.end()}ke.from=function(ue,me){return x(ke,ue,me)};let Me;function ft(){return Me===void 0&&(Me={}),Me}return ke.fromWeb=function(ue,me){return ft().newStreamReadableFromReadableStream(ue,me)},ke.toWeb=function(ue,me){return ft().newReadableStreamFromStreamReadable(ue,me)},ke.wrap=function(ue,me){var Ge,Ue;return new ke({objectMode:(Ge=(Ue=ue.readableObjectMode)!==null&&Ue!==void 0?Ue:ue.objectMode)!==null&&Ge!==void 0?Ge:!0,...me,destroy(et,gt){A.destroyer(ue,et),gt(et)}}).wrap(ue)},DA}function $A(){if(VP)return IA;VP=!0;let r=Vr,{ArrayPrototypeSlice:e,Error:t,FunctionPrototypeSymbolHasInstance:n,ObjectDefineProperty:i,ObjectDefineProperties:o,ObjectSetPrototypeOf:s,StringPrototypeToLowerCase:a,Symbol:u,SymbolHasInstance:c}=Fr();IA=ie,ie.WritableState=$;let{EventEmitter:f}=xo,h=jA().Stream,{Buffer:d}=yn(),g=Hh(),{addAbortSignal:y}=Cw(),{getHighWaterMark:v,getDefaultHighWaterMark:w}=Rw(),{ERR_INVALID_ARG_TYPE:b,ERR_METHOD_NOT_IMPLEMENTED:E,ERR_MULTIPLE_CALLBACK:_,ERR_STREAM_CANNOT_PIPE:S,ERR_STREAM_DESTROYED:A,ERR_STREAM_ALREADY_FINISHED:M,ERR_STREAM_NULL_VALUES:I,ERR_STREAM_WRITE_AFTER_END:q,ERR_UNKNOWN_ENCODING:Q}=bi().codes,{errorOrDestroy:Z}=g;s(ie.prototype,h.prototype),s(ie,h);function ne(){}let L=u("kOnFinished");function $(F,oe,ge){typeof ge!="boolean"&&(ge=oe instanceof xa()),(this||Qe).objectMode=!!(F&&F.objectMode),ge&&((this||Qe).objectMode=(this||Qe).objectMode||!!(F&&F.writableObjectMode)),(this||Qe).highWaterMark=F?v(this||Qe,F,"writableHighWaterMark",ge):w(!1),(this||Qe).finalCalled=!1,(this||Qe).needDrain=!1,(this||Qe).ending=!1,(this||Qe).ended=!1,(this||Qe).finished=!1,(this||Qe).destroyed=!1;let Re=!!(F&&F.decodeStrings===!1);(this||Qe).decodeStrings=!Re,(this||Qe).defaultEncoding=F&&F.defaultEncoding||"utf8",(this||Qe).length=0,(this||Qe).writing=!1,(this||Qe).corked=0,(this||Qe).sync=!0,(this||Qe).bufferProcessing=!1,(this||Qe).onwrite=C.bind(void 0,oe),(this||Qe).writecb=null,(this||Qe).writelen=0,(this||Qe).afterWriteTickInfo=null,X(this||Qe),(this||Qe).pendingcb=0,(this||Qe).constructed=!0,(this||Qe).prefinished=!1,(this||Qe).errorEmitted=!1,(this||Qe).emitClose=!F||F.emitClose!==!1,(this||Qe).autoDestroy=!F||F.autoDestroy!==!1,(this||Qe).errored=null,(this||Qe).closed=!1,(this||Qe).closeEmitted=!1,(this||Qe)[L]=[]}function X(F){F.buffered=[],F.bufferedIndex=0,F.allBuffers=!0,F.allNoop=!0}$.prototype.getBuffer=function(){return e((this||Qe).buffered,(this||Qe).bufferedIndex)},i($.prototype,"bufferedRequestCount",{__proto__:null,get(){return(this||Qe).buffered.length-(this||Qe).bufferedIndex}});function ie(F){let oe=(this||Qe)instanceof xa();if(!oe&&!n(ie,this||Qe))return new ie(F);(this||Qe)._writableState=new $(F,this||Qe,oe),F&&(typeof F.write=="function"&&((this||Qe)._write=F.write),typeof F.writev=="function"&&((this||Qe)._writev=F.writev),typeof F.destroy=="function"&&((this||Qe)._destroy=F.destroy),typeof F.final=="function"&&((this||Qe)._final=F.final),typeof F.construct=="function"&&((this||Qe)._construct=F.construct),F.signal&&y(F.signal,this||Qe)),h.call(this||Qe,F),g.construct(this||Qe,()=>{let ge=(this||Qe)._writableState;ge.writing||ee(this||Qe,ge),H(this||Qe,ge)})}i(ie,c,{__proto__:null,value:function(F){return n(this||Qe,F)?!0:(this||Qe)!==ie?!1:F&&F._writableState instanceof $}}),ie.prototype.pipe=function(){Z(this||Qe,new S)};function re(F,oe,ge,Re){let be=F._writableState;if(typeof ge=="function")Re=ge,ge=be.defaultEncoding;else{if(!ge)ge=be.defaultEncoding;else if(ge!=="buffer"&&!d.isEncoding(ge))throw new Q(ge);typeof Re!="function"&&(Re=ne)}if(oe===null)throw new I;if(!be.objectMode)if(typeof oe=="string")be.decodeStrings!==!1&&(oe=d.from(oe,ge),ge="buffer");else if(oe instanceof d)ge="buffer";else if(h._isUint8Array(oe))oe=h._uint8ArrayToBuffer(oe),ge="buffer";else throw new b("chunk",["string","Buffer","Uint8Array"],oe);let pe;return be.ending?pe=new q:be.destroyed&&(pe=new A("write")),pe?(r.nextTick(Re,pe),Z(F,pe,!0),pe):(be.pendingcb++,O(F,be,oe,ge,Re))}ie.prototype.write=function(F,oe,ge){return re(this||Qe,F,oe,ge)===!0},ie.prototype.cork=function(){(this||Qe)._writableState.corked++},ie.prototype.uncork=function(){let F=(this||Qe)._writableState;F.corked&&(F.corked--,F.writing||ee(this||Qe,F))},ie.prototype.setDefaultEncoding=function(oe){if(typeof oe=="string"&&(oe=a(oe)),!d.isEncoding(oe))throw new Q(oe);return(this||Qe)._writableState.defaultEncoding=oe,this||Qe};function O(F,oe,ge,Re,be){let pe=oe.objectMode?1:ge.length;oe.length+=pe;let Ae=oe.length<oe.highWaterMark;return Ae||(oe.needDrain=!0),oe.writing||oe.corked||oe.errored||!oe.constructed?(oe.buffered.push({chunk:ge,encoding:Re,callback:be}),oe.allBuffers&&Re!=="buffer"&&(oe.allBuffers=!1),oe.allNoop&&be!==ne&&(oe.allNoop=!1)):(oe.writelen=pe,oe.writecb=be,oe.writing=!0,oe.sync=!0,F._write(ge,Re,oe.onwrite),oe.sync=!1),Ae&&!oe.errored&&!oe.destroyed}function x(F,oe,ge,Re,be,pe,Ae){oe.writelen=Re,oe.writecb=Ae,oe.writing=!0,oe.sync=!0,oe.destroyed?oe.onwrite(new A("write")):ge?F._writev(be,oe.onwrite):F._write(be,pe,oe.onwrite),oe.sync=!1}function P(F,oe,ge,Re){--oe.pendingcb,Re(ge),B(oe),Z(F,ge)}function C(F,oe){let ge=F._writableState,Re=ge.sync,be=ge.writecb;if(typeof be!="function"){Z(F,new _);return}ge.writing=!1,ge.writecb=null,ge.length-=ge.writelen,ge.writelen=0,oe?(oe.stack,ge.errored||(ge.errored=oe),F._readableState&&!F._readableState.errored&&(F._readableState.errored=oe),Re?r.nextTick(P,F,ge,oe,be):P(F,ge,oe,be)):(ge.buffered.length>ge.bufferedIndex&&ee(F,ge),Re?ge.afterWriteTickInfo!==null&&ge.afterWriteTickInfo.cb===be?ge.afterWriteTickInfo.count++:(ge.afterWriteTickInfo={count:1,cb:be,stream:F,state:ge},r.nextTick(j,ge.afterWriteTickInfo)):U(F,ge,1,be))}function j({stream:F,state:oe,count:ge,cb:Re}){return oe.afterWriteTickInfo=null,U(F,oe,ge,Re)}function U(F,oe,ge,Re){for(!oe.ending&&!F.destroyed&&oe.length===0&&oe.needDrain&&(oe.needDrain=!1,F.emit("drain"));ge-- >0;)oe.pendingcb--,Re();oe.destroyed&&B(oe),H(F,oe)}function B(F){if(F.writing)return;for(let be=F.bufferedIndex;be<F.buffered.length;++be){var oe;let{chunk:pe,callback:Ae}=F.buffered[be],ze=F.objectMode?1:pe.length;F.length-=ze,Ae((oe=F.errored)!==null&&oe!==void 0?oe:new A("write"))}let ge=F[L].splice(0);for(let be=0;be<ge.length;be++){var Re;ge[be]((Re=F.errored)!==null&&Re!==void 0?Re:new A("end"))}X(F)}function ee(F,oe){if(oe.corked||oe.bufferProcessing||oe.destroyed||!oe.constructed)return;let{buffered:ge,bufferedIndex:Re,objectMode:be}=oe,pe=ge.length-Re;if(!pe)return;let Ae=Re;if(oe.bufferProcessing=!0,pe>1&&F._writev){oe.pendingcb-=pe-1;let ze=oe.allNoop?ne:ke=>{for(let Ke=Ae;Ke<ge.length;++Ke)ge[Ke].callback(ke)},Oe=oe.allNoop&&Ae===0?ge:e(ge,Ae);Oe.allBuffers=oe.allBuffers,x(F,oe,!0,oe.length,Oe,"",ze),X(oe)}else{do{let{chunk:ze,encoding:Oe,callback:ke}=ge[Ae];ge[Ae++]=null;let Ke=be?1:ze.length;x(F,oe,!1,Ke,ze,Oe,ke)}while(Ae<ge.length&&!oe.writing);Ae===ge.length?X(oe):Ae>256?(ge.splice(0,Ae),oe.bufferedIndex=0):oe.bufferedIndex=Ae}oe.bufferProcessing=!1}ie.prototype._write=function(F,oe,ge){if((this||Qe)._writev)this._writev([{chunk:F,encoding:oe}],ge);else throw new E("_write()")},ie.prototype._writev=null,ie.prototype.end=function(F,oe,ge){let Re=(this||Qe)._writableState;typeof F=="function"?(ge=F,F=null,oe=null):typeof oe=="function"&&(ge=oe,oe=null);let be;if(F!=null){let pe=re(this||Qe,F,oe);pe instanceof t&&(be=pe)}return Re.corked&&(Re.corked=1,this.uncork()),be||(!Re.errored&&!Re.ending?(Re.ending=!0,H(this||Qe,Re,!0),Re.ended=!0):Re.finished?be=new M("end"):Re.destroyed&&(be=new A("end"))),typeof ge=="function"&&(be||Re.finished?r.nextTick(ge,be):Re[L].push(ge)),this||Qe};function fe(F){return F.ending&&!F.destroyed&&F.constructed&&F.length===0&&!F.errored&&F.buffered.length===0&&!F.finished&&!F.writing&&!F.errorEmitted&&!F.closeEmitted}function Ee(F,oe){let ge=!1;function Re(be){if(ge){Z(F,be??_());return}if(ge=!0,oe.pendingcb--,be){let pe=oe[L].splice(0);for(let Ae=0;Ae<pe.length;Ae++)pe[Ae](be);Z(F,be,oe.sync)}else fe(oe)&&(oe.prefinished=!0,F.emit("prefinish"),oe.pendingcb++,r.nextTick(ae,F,oe))}oe.sync=!0,oe.pendingcb++;try{F._final(Re)}catch(be){Re(be)}oe.sync=!1}function te(F,oe){!oe.prefinished&&!oe.finalCalled&&(typeof F._final=="function"&&!oe.destroyed?(oe.finalCalled=!0,Ee(F,oe)):(oe.prefinished=!0,F.emit("prefinish")))}function H(F,oe,ge){fe(oe)&&(te(F,oe),oe.pendingcb===0&&(ge?(oe.pendingcb++,r.nextTick((Re,be)=>{fe(be)?ae(Re,be):be.pendingcb--},F,oe)):fe(oe)&&(oe.pendingcb++,ae(F,oe))))}function ae(F,oe){oe.pendingcb--,oe.finished=!0;let ge=oe[L].splice(0);for(let Re=0;Re<ge.length;Re++)ge[Re]();if(F.emit("finish"),oe.autoDestroy){let Re=F._readableState;(!Re||Re.autoDestroy&&(Re.endEmitted||Re.readable===!1))&&F.destroy()}}o(ie.prototype,{closed:{__proto__:null,get(){return(this||Qe)._writableState?(this||Qe)._writableState.closed:!1}},destroyed:{__proto__:null,get(){return(this||Qe)._writableState?(this||Qe)._writableState.destroyed:!1},set(F){(this||Qe)._writableState&&((this||Qe)._writableState.destroyed=F)}},writable:{__proto__:null,get(){let F=(this||Qe)._writableState;return!!F&&F.writable!==!1&&!F.destroyed&&!F.errored&&!F.ending&&!F.ended},set(F){(this||Qe)._writableState&&((this||Qe)._writableState.writable=!!F)}},writableFinished:{__proto__:null,get(){return(this||Qe)._writableState?(this||Qe)._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return(this||Qe)._writableState?(this||Qe)._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return(this||Qe)._writableState&&(this||Qe)._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return(this||Qe)._writableState?(this||Qe)._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let F=(this||Qe)._writableState;return F?!F.destroyed&&!F.ending&&F.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return(this||Qe)._writableState&&(this||Qe)._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return(this||Qe)._writableState?(this||Qe)._writableState.corked:0}},writableLength:{__proto__:null,get(){return(this||Qe)._writableState&&(this||Qe)._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return(this||Qe)._writableState?(this||Qe)._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!((this||Qe)._writableState.writable!==!1&&((this||Qe)._writableState.destroyed||(this||Qe)._writableState.errored)&&!(this||Qe)._writableState.finished)}}});let we=g.destroy;ie.prototype.destroy=function(F,oe){let ge=(this||Qe)._writableState;return!ge.destroyed&&(ge.bufferedIndex<ge.buffered.length||ge[L].length)&&r.nextTick(B,ge),we.call(this||Qe,F,oe),this||Qe},ie.prototype._undestroy=g.undestroy,ie.prototype._destroy=function(F,oe){oe(F)},ie.prototype[f.captureRejectionSymbol]=function(F){this.destroy(F)};let xe;function V(){return xe===void 0&&(xe={}),xe}return ie.fromWeb=function(F,oe){return V().newStreamWritableFromWritableStream(F,oe)},ie.toWeb=function(F){return V().newWritableStreamFromStreamWritable(F)},IA}function wq(){if(XP)return kA;XP=!0;let r=Vr,e=yn(),{isReadable:t,isWritable:n,isIterable:i,isNodeStream:o,isReadableNodeStream:s,isWritableNodeStream:a,isDuplexNodeStream:u,isReadableStream:c,isWritableStream:f}=Sa(),h=$l(),{AbortError:d,codes:{ERR_INVALID_ARG_TYPE:g,ERR_INVALID_RETURN_VALUE:y}}=bi(),{destroyer:v}=Hh(),w=xa(),b=Dw(),E=$A(),{createDeferredPromise:_}=Qn(),S=sF(),A=globalThis.Blob||e.Blob,M=typeof A<"u"?function($){return $ instanceof A}:function($){return!1},I=globalThis.AbortController||Zg().AbortController,{FunctionPrototypeCall:q}=Fr();class Q 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)}}kA=function L($,X){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:b.fromWeb($)});if(f($))return ne({writable:E.fromWeb($)});if(typeof $=="function"){let{value:re,write:O,final:x,destroy:P}=Z($);if(i(re))return S(Q,re,{objectMode:!0,write:O,final:x,destroy:P});let C=re?.then;if(typeof C=="function"){let j,U=q(C,re,B=>{if(B!=null)throw new y("nully","body",B)},B=>{v(j,B)});return j=new Q({objectMode:!0,readable:!1,write:O,final(B){x(async()=>{try{await U,r.nextTick(B,null)}catch(ee){r.nextTick(B,ee)}})},destroy:P})}throw new y("Iterable, AsyncIterable or AsyncFunction",X,re)}if(M($))return L($.arrayBuffer());if(i($))return S(Q,$,{objectMode:!0,writable:!1});if(c($?.readable)&&f($?.writable))return Q.fromWeb($);if(typeof $?.writable=="object"||typeof $?.readable=="object"){let re=$!=null&&$.readable?s($?.readable)?$?.readable:L($.readable):void 0,O=$!=null&&$.writable?a($?.writable)?$?.writable:L($.writable):void 0;return ne({readable:re,writable:O})}let ie=$?.then;if(typeof ie=="function"){let re;return q(ie,$,O=>{O!=null&&re.push(O),re.push(null)},O=>{v(re,O)}),re=new Q({objectMode:!0,writable:!1,read(){}})}throw new g(X,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],$)};function Z(L){let{promise:$,resolve:X}=_(),ie=new I,re=ie.signal;return{value:L((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 d(void 0,{cause:re.reason});({promise:$,resolve:X}=_()),yield P}})(),{signal:re}),write(x,P,C){let j=X;X=null,j({chunk:x,done:!1,cb:C})},final(x){let P=X;X=null,P({done:!0,cb:x})},destroy(x,P){ie.abort(),P(x)}}}function ne(L){let $=L.readable&&typeof L.readable.read!="function"?b.wrap(L.readable):L.readable,X=L.writable,ie=!!t($),re=!!n(X),O,x,P,C,j;function U(B){let ee=C;C=null,ee?ee(B):B&&j.destroy(B)}return j=new Q({readableObjectMode:!!($!=null&&$.readableObjectMode),writableObjectMode:!!(X!=null&&X.writableObjectMode),readable:ie,writable:re}),re&&(h(X,B=>{re=!1,B&&v($,B),U(B)}),j._write=function(B,ee,fe){X.write(B,ee)?fe():O=fe},j._final=function(B){X.end(),x=B},X.on("drain",function(){if(O){let B=O;O=null,B()}}),X.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,ee){!B&&C!==null&&(B=new d),P=null,O=null,x=null,C===null?ee(B):(C=ee,v(X,B),v($,B))},j}return kA}function xa(){if(YP)return NA;YP=!0;let{ObjectDefineProperties:r,ObjectGetOwnPropertyDescriptor:e,ObjectKeys:t,ObjectSetPrototypeOf:n}=Fr();NA=s;let i=Dw(),o=$A();n(s.prototype,i.prototype),n(s,i);{let f=t(o.prototype);for(let h=0;h<f.length;h++){let d=f[h];s.prototype[d]||(s.prototype[d]=o.prototype[d])}}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=wq()),c(f,"body")},NA}function oF(){if(ZP)return OA;ZP=!0;let{ObjectSetPrototypeOf:r,Symbol:e}=Fr();OA=s;let{ERR_METHOD_NOT_IMPLEMENTED:t}=bi().codes,n=xa(),{getHighWaterMark:i}=Rw();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 d=this._readableState,g=this._writableState,y=d.length;this._transform(c,f,(v,w)=>{if(v){h(v);return}w!=null&&this.push(w),g.ended||y===d.length||d.length<d.highWaterMark?h():this[o]=h})},s.prototype._read=function(){if(this[o]){let c=this[o];this[o]=null,c()}},OA}function aF(){if(KP)return LA;KP=!0;let{ObjectSetPrototypeOf:r}=Fr();LA=t;let e=oF();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)},LA}function zA(){if(JP)return PA;JP=!0;let r=Vr,{ArrayIsArray:e,Promise:t,SymbolAsyncIterator:n,SymbolDispose:i}=Fr(),o=$l(),{once:s}=Qn(),a=Hh(),u=xa(),{aggregateTwoErrors:c,codes:{ERR_INVALID_ARG_TYPE:f,ERR_INVALID_RETURN_VALUE:h,ERR_MISSING_ARGS:d,ERR_STREAM_DESTROYED:g,ERR_STREAM_PREMATURE_CLOSE:y},AbortError:v}=bi(),{validateFunction:w,validateAbortSignal:b}=Kg(),{isIterable:E,isReadable:_,isReadableNodeStream:S,isNodeStream:A,isTransformStream:M,isWebStream:I,isReadableStream:q,isReadableFinished:Q}=Sa(),Z=globalThis.AbortController||Zg().AbortController,ne,L,$;function X(B,ee,fe){let Ee=!1;B.on("close",()=>{Ee=!0});let te=o(B,{readable:ee,writable:fe},H=>{Ee=!H});return{destroy:H=>{Ee||(Ee=!0,a.destroyer(B,H||new g("pipe")))},cleanup:te}}function ie(B){return w(B[B.length-1],"streams[stream.length - 1]"),B.pop()}function re(B){if(E(B))return B;if(S(B))return O(B);throw new f("val",["Readable","Iterable","AsyncIterable"],B)}async function*O(B){L||(L=Dw()),yield*L.prototype[n].call(B)}async function x(B,ee,fe,{end:Ee}){let te,H=null,ae=V=>{if(V&&(te=V),H){let F=H;H=null,F()}},we=()=>new t((V,F)=>{te?F(te):H=()=>{te?F(te):V()}});ee.on("drain",ae);let xe=o(ee,{readable:!1},ae);try{ee.writableNeedDrain&&await we();for await(let V of B)ee.write(V)||await we();Ee&&(ee.end(),await we()),fe()}catch(V){fe(te!==V?c(te,V):V)}finally{xe(),ee.off("drain",ae)}}async function P(B,ee,fe,{end:Ee}){M(ee)&&(ee=ee.writable);let te=ee.getWriter();try{for await(let H of B)await te.ready,te.write(H).catch(()=>{});await te.ready,Ee&&await te.close(),fe()}catch(H){try{await te.abort(H),fe(H)}catch(ae){fe(ae)}}}function C(...B){return j(B,s(ie(B)))}function j(B,ee,fe){if(B.length===1&&e(B[0])&&(B=B[0]),B.length<2)throw new d("streams");let Ee=new Z,te=Ee.signal,H=fe?.signal,ae=[];b(H,"options.signal");function we(){be(new v)}$=$||Qn().addAbortListener;let xe;H&&(xe=$(H,we));let V,F,oe=[],ge=0;function Re(Oe){be(Oe,--ge===0)}function be(Oe,ke){var Ke;if(Oe&&(!V||V.code==="ERR_STREAM_PREMATURE_CLOSE")&&(V=Oe),!(!V&&!ke)){for(;oe.length;)oe.shift()(V);(Ke=xe)===null||Ke===void 0||Ke[i](),Ee.abort(),ke&&(V||ae.forEach(tt=>tt()),r.nextTick(ee,V,F))}}let pe;for(let Oe=0;Oe<B.length;Oe++){let ke=B[Oe],Ke=Oe<B.length-1,tt=Oe>0,it=Ke||fe?.end!==!1,T=Oe===B.length-1;if(A(ke)){let m=function(p){p&&p.name!=="AbortError"&&p.code!=="ERR_STREAM_PREMATURE_CLOSE"&&Re(p)};if(it){let{destroy:p,cleanup:R}=X(ke,Ke,tt);oe.push(p),_(ke)&&T&&ae.push(R)}ke.on("error",m),_(ke)&&T&&ae.push(()=>{ke.removeListener("error",m)})}if(Oe===0)if(typeof ke=="function"){if(pe=ke({signal:te}),!E(pe))throw new h("Iterable, AsyncIterable or Stream","source",pe)}else E(ke)||S(ke)||M(ke)?pe=ke:pe=u.from(ke);else if(typeof ke=="function"){if(M(pe)){var Ae;pe=re((Ae=pe)===null||Ae===void 0?void 0:Ae.readable)}else pe=re(pe);if(pe=ke(pe,{signal:te}),Ke){if(!E(pe,!0))throw new h("AsyncIterable",`transform[${Oe-1}]`,pe)}else{var ze;ne||(ne=aF());let m=new ne({objectMode:!0}),p=(ze=pe)===null||ze===void 0?void 0:ze.then;if(typeof p=="function")ge++,p.call(pe,D=>{F=D,D!=null&&m.write(D),it&&m.end(),r.nextTick(Re)},D=>{m.destroy(D),r.nextTick(Re,D)});else if(E(pe,!0))ge++,x(pe,m,Re,{end:it});else if(q(pe)||M(pe)){let D=pe.readable||pe;ge++,x(D,m,Re,{end:it})}else throw new h("AsyncIterable or Promise","destination",pe);pe=m;let{destroy:R,cleanup:J}=X(pe,!1,!0);oe.push(R),T&&ae.push(J)}}else if(A(ke)){if(S(pe)){ge+=2;let m=U(pe,ke,Re,{end:it});_(ke)&&T&&ae.push(m)}else if(M(pe)||q(pe)){let m=pe.readable||pe;ge++,x(m,ke,Re,{end:it})}else if(E(pe))ge++,x(pe,ke,Re,{end:it});else throw new f("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],pe);pe=ke}else if(I(ke)){if(S(pe))ge++,P(re(pe),ke,Re,{end:it});else if(q(pe)||E(pe))ge++,P(pe,ke,Re,{end:it});else if(M(pe))ge++,P(pe.readable,ke,Re,{end:it});else throw new f("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],pe);pe=ke}else pe=u.from(ke)}return(te!=null&&te.aborted||H!=null&&H.aborted)&&r.nextTick(we),pe}function U(B,ee,fe,{end:Ee}){let te=!1;if(ee.on("close",()=>{te||fe(new y)}),B.pipe(ee,{end:!1}),Ee){let H=function(){te=!0,ee.end()};Q(B)?r.nextTick(H):B.once("end",H)}else fe();return o(B,{readable:!0,writable:!1},H=>{let ae=B._readableState;H&&H.code==="ERR_STREAM_PREMATURE_CLOSE"&&ae&&ae.ended&&!ae.errored&&!ae.errorEmitted?B.once("end",fe).once("error",fe):fe(H)}),o(ee,{readable:!1,writable:!0},fe)}return PA={pipelineImpl:j,pipeline:C},PA}function lF(){if(QP)return FA;QP=!0;let{pipeline:r}=zA(),e=xa(),{destroyer:t}=Hh(),{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:d}}=bi(),g=$l();return FA=function(...v){if(v.length===0)throw new d("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 b,E,_,S,A;function M(ne){let L=S;S=null,L?L(ne):ne?A.destroy(ne):!Z&&!Q&&A.destroy()}let I=v[0],q=r(v,M),Q=!!(o(I)||u(I)||a(I)),Z=!!(i(q)||c(q)||a(q));if(A=new e({writableObjectMode:!!(I!=null&&I.writableObjectMode),readableObjectMode:!!(q!=null&&q.readableObjectMode),writable:Q,readable:Z}),Q){if(n(I))A._write=function(L,$,X){I.write(L,$)?X():b=X},A._final=function(L){I.end(),E=L},I.on("drain",function(){if(b){let L=b;b=null,L()}});else if(s(I)){let $=(a(I)?I.writable:I).getWriter();A._write=async function(X,ie,re){try{await $.ready,$.write(X).catch(()=>{}),re()}catch(O){re(O)}},A._final=async function(X){try{await $.ready,$.close().catch(()=>{}),E=X}catch(ie){X(ie)}}}let ne=a(q)?q.readable:q;g(ne,()=>{if(E){let L=E;E=null,L()}})}if(Z){if(n(q))q.on("readable",function(){if(_){let ne=_;_=null,ne()}}),q.on("end",function(){A.push(null)}),A._read=function(){for(;;){let ne=q.read();if(ne===null){_=A._read;return}if(!A.push(ne))return}};else if(s(q)){let L=(a(q)?q.readable:q).getReader();A._read=async function(){for(;;)try{let{value:$,done:X}=await L.read();if(!A.push($))return;if(X){A.push(null);return}}catch{return}}}}return A._destroy=function(ne,L){!ne&&S!==null&&(ne=new f),_=null,b=null,E=null,S===null?L(ne):(S=L,n(q)&&t(q,ne))},A},FA}function vq(){if(eF)return Tw;eF=!0;let r=globalThis.AbortController||Zg().AbortController,{codes:{ERR_INVALID_ARG_VALUE:e,ERR_INVALID_ARG_TYPE:t,ERR_MISSING_ARGS:n,ERR_OUT_OF_RANGE:i},AbortError:o}=bi(),{validateAbortSignal:s,validateInteger:a,validateObject:u}=Kg(),c=Fr().Symbol("kWeak"),f=Fr().Symbol("kResistStopPropagation"),{finished:h}=$l(),d=lF(),{addAbortSignalNoValidate:g}=Cw(),{isWritable:y,isNodeStream:v}=Sa(),{deprecate:w}=Qn(),{ArrayPrototypePush:b,Boolean:E,MathFloor:_,Number:S,NumberIsNaN:A,Promise:M,PromiseReject:I,PromiseResolve:q,PromisePrototypeThen:Q,Symbol:Z}=Fr(),ne=Z("kEmpty"),L=Z("kEof");function $(H,ae){if(ae!=null&&u(ae,"options"),ae?.signal!=null&&s(ae.signal,"options.signal"),v(H)&&!y(H))throw new e("stream",H,"must be writable");let we=d(this,H);return ae!=null&&ae.signal&&g(ae.signal,we),we}function X(H,ae){if(typeof H!="function")throw new t("fn",["Function","AsyncFunction"],H);ae!=null&&u(ae,"options"),ae?.signal!=null&&s(ae.signal,"options.signal");let we=1;ae?.concurrency!=null&&(we=_(ae.concurrency));let xe=we-1;return ae?.highWaterMark!=null&&(xe=_(ae.highWaterMark)),a(we,"options.concurrency",1),a(xe,"options.highWaterMark",0),xe+=we,async function*(){let F=Qn().AbortSignalAny([ae?.signal].filter(E)),oe=this,ge=[],Re={signal:F},be,pe,Ae=!1,ze=0;function Oe(){Ae=!0,ke()}function ke(){ze-=1,Ke()}function Ke(){pe&&!Ae&&ze<we&&ge.length<xe&&(pe(),pe=null)}async function tt(){try{for await(let it of oe){if(Ae)return;if(F.aborted)throw new o;try{if(it=H(it,Re),it===ne)continue;it=q(it)}catch(T){it=I(T)}ze+=1,Q(it,ke,Oe),ge.push(it),be&&(be(),be=null),!Ae&&(ge.length>=xe||ze>=we)&&await new M(T=>{pe=T})}ge.push(L)}catch(it){let T=I(it);Q(T,ke,Oe),ge.push(T)}finally{Ae=!0,be&&(be(),be=null)}}tt();try{for(;;){for(;ge.length>0;){let it=await ge[0];if(it===L)return;if(F.aborted)throw new o;it!==ne&&(yield it),ge.shift(),Ke()}await new M(it=>{be=it})}}finally{Ae=!0,pe&&(pe(),pe=null)}}.call(this)}function ie(H=void 0){return H!=null&&u(H,"options"),H?.signal!=null&&s(H.signal,"options.signal"),async function*(){let we=0;for await(let V of this){var xe;if(H!=null&&(xe=H.signal)!==null&&xe!==void 0&&xe.aborted)throw new o({cause:H.signal.reason});yield[we++,V]}}.call(this)}async function re(H,ae=void 0){for await(let we of C.call(this,H,ae))return!0;return!1}async function O(H,ae=void 0){if(typeof H!="function")throw new t("fn",["Function","AsyncFunction"],H);return!await re.call(this,async(...we)=>!await H(...we),ae)}async function x(H,ae){for await(let we of C.call(this,H,ae))return we}async function P(H,ae){if(typeof H!="function")throw new t("fn",["Function","AsyncFunction"],H);async function we(xe,V){return await H(xe,V),ne}for await(let xe of X.call(this,we,ae));}function C(H,ae){if(typeof H!="function")throw new t("fn",["Function","AsyncFunction"],H);async function we(xe,V){return await H(xe,V)?xe:ne}return X.call(this,we,ae)}class j extends n{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function U(H,ae,we){var xe;if(typeof H!="function")throw new t("reducer",["Function","AsyncFunction"],H);we!=null&&u(we,"options"),we?.signal!=null&&s(we.signal,"options.signal");let V=arguments.length>1;if(we!=null&&(xe=we.signal)!==null&&xe!==void 0&&xe.aborted){let be=new o(void 0,{cause:we.signal.reason});throw this.once("error",()=>{}),await h(this.destroy(be)),be}let F=new r,oe=F.signal;if(we!=null&&we.signal){let be={once:!0,[c]:this,[f]:!0};we.signal.addEventListener("abort",()=>F.abort(),be)}let ge=!1;try{for await(let be of this){var Re;if(ge=!0,we!=null&&(Re=we.signal)!==null&&Re!==void 0&&Re.aborted)throw new o;V?ae=await H(ae,be,{signal:oe}):(ae=be,V=!0)}if(!ge&&!V)throw new j}finally{F.abort()}return ae}async function B(H){H!=null&&u(H,"options"),H?.signal!=null&&s(H.signal,"options.signal");let ae=[];for await(let xe of this){var we;if(H!=null&&(we=H.signal)!==null&&we!==void 0&&we.aborted)throw new o(void 0,{cause:H.signal.reason});b(ae,xe)}return ae}function ee(H,ae){let we=X.call(this,H,ae);return async function*(){for await(let V of we)yield*V}.call(this)}function fe(H){if(H=S(H),A(H))return 0;if(H<0)throw new i("number",">= 0",H);return H}function Ee(H,ae=void 0){return ae!=null&&u(ae,"options"),ae?.signal!=null&&s(ae.signal,"options.signal"),H=fe(H),async function*(){var xe;if(ae!=null&&(xe=ae.signal)!==null&&xe!==void 0&&xe.aborted)throw new o;for await(let F of this){var V;if(ae!=null&&(V=ae.signal)!==null&&V!==void 0&&V.aborted)throw new o;H--<=0&&(yield F)}}.call(this)}function te(H,ae=void 0){return ae!=null&&u(ae,"options"),ae?.signal!=null&&s(ae.signal,"options.signal"),H=fe(H),async function*(){var xe;if(ae!=null&&(xe=ae.signal)!==null&&xe!==void 0&&xe.aborted)throw new o;for await(let F of this){var V;if(ae!=null&&(V=ae.signal)!==null&&V!==void 0&&V.aborted)throw new o;if(H-- >0&&(yield F),H<=0)return}}.call(this)}return Tw.streamReturningOperators={asIndexedPairs:w(ie,"readable.asIndexedPairs will be removed in a future version."),drop:Ee,filter:C,flatMap:ee,map:X,take:te,compose:$},Tw.promiseReturningOperators={every:O,forEach:P,reduce:U,toArray:B,some:re,find:x},Tw}function uF(){if(tF)return MA;tF=!0;let{ArrayPrototypePop:r,Promise:e}=Fr(),{isIterable:t,isNodeStream:n,isWebStream:i}=Sa(),{pipelineImpl:o}=zA(),{finished:s}=$l();cF();function a(...u){return new e((c,f)=>{let h,d,g=u[u.length-1];if(g&&typeof g=="object"&&!n(g)&&!t(g)&&!i(g)){let y=r(u);h=y.signal,d=y.end}o(u,(y,v)=>{y?f(y):c(v)},{signal:h,end:d})})}return MA={finished:s,pipeline:a},MA}function cF(){if(rF)return BA;rF=!0;let{Buffer:r}=yn(),{ObjectDefineProperty:e,ObjectKeys:t,ReflectApply:n}=Fr(),{promisify:{custom:i}}=Qn(),{streamReturningOperators:o,promiseReturningOperators:s}=vq(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:a}}=bi(),u=lF(),{setDefaultHighWaterMark:c,getDefaultHighWaterMark:f}=Rw(),{pipeline:h}=zA(),{destroyer:d}=Hh(),g=$l(),y=uF(),v=Sa(),w=BA=jA().Stream;w.isDestroyed=v.isDestroyed,w.isDisturbed=v.isDisturbed,w.isErrored=v.isErrored,w.isReadable=v.isReadable,w.isWritable=v.isWritable,w.Readable=Dw();for(let E of t(o)){let S=function(...A){if(new.target)throw a();return w.Readable.from(n(_,this||nF,A))},_=o[E];e(S,"name",{__proto__:null,value:_.name}),e(S,"length",{__proto__:null,value:_.length}),e(w.Readable.prototype,E,{__proto__:null,value:S,enumerable:!1,configurable:!0,writable:!0})}for(let E of t(s)){let S=function(...A){if(new.target)throw a();return n(_,this||nF,A)},_=s[E];e(S,"name",{__proto__:null,value:_.name}),e(S,"length",{__proto__:null,value:_.length}),e(w.Readable.prototype,E,{__proto__:null,value:S,enumerable:!1,configurable:!0,writable:!0})}w.Writable=$A(),w.Duplex=xa(),w.Transform=oF(),w.PassThrough=aF(),w.pipeline=h;let{addAbortSignal:b}=Cw();return w.addAbortSignal=b,w.finished=g,w.destroy=d,w.compose=u,w.setDefaultHighWaterMark=c,w.getDefaultHighWaterMark=f,e(w,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return y}}),e(h,i,{__proto__:null,enumerable:!0,get(){return y.pipeline}}),e(g,i,{__proto__:null,enumerable:!0,get(){return y.finished}}),w.Stream=w,w._isUint8Array=function(_){return _ instanceof Uint8Array},w._uint8ArrayToBuffer=function(_){return r.from(_.buffer,_.byteOffset,_.byteLength)},BA}function Eq(){if(iF)return Pr;iF=!0;let r=cF(),e=uF(),t=r.Readable.destroy;return Pr=r.Readable,Pr._uint8ArrayToBuffer=r._uint8ArrayToBuffer,Pr._isUint8Array=r._isUint8Array,Pr.isDisturbed=r.isDisturbed,Pr.isErrored=r.isErrored,Pr.isReadable=r.isReadable,Pr.Readable=r.Readable,Pr.Writable=r.Writable,Pr.Duplex=r.Duplex,Pr.Transform=r.Transform,Pr.PassThrough=r.PassThrough,Pr.addAbortSignal=r.addAbortSignal,Pr.finished=r.finished,Pr.destroy=r.destroy,Pr.destroy=t,Pr.pipeline=r.pipeline,Pr.compose=r.compose,Object.defineProperty(r,"promises",{configurable:!0,enumerable:!0,get(){return e}}),Pr.Stream=r.Stream,Pr.default=Pr,Pr}var vA,OP,Xg,LP,xw,PP,EA,FP,_A,MP,AA,BP,Sw,UP,xA,jP,SA,$P,Yg,zP,TA,WP,CA,HP,RA,qP,DA,GP,Xe,IA,VP,Qe,kA,XP,NA,YP,OA,ZP,LA,KP,PA,JP,FA,QP,Tw,eF,MA,tF,BA,rF,nF,Pr,iF,pr,UA,_q,Aq,xq,Sq,Tq,Cq,Rq,Dq,Qg=bt(()=>{Se();Ce();Te();dh();Wh();lc();NP();zh();Sg();aA();vA={},OP=!1;Xg={},LP=!1;xw={},PP=!1;EA={},FP=!1;_A={},MP=!1;AA={},BP=!1;Sw={},UP=!1;xA={},jP=!1;SA={},$P=!1;Yg={},zP=!1;TA={},WP=!1;CA={},HP=!1;RA={},qP=!1;DA={},GP=!1,Xe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;IA={},VP=!1,Qe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;kA={},XP=!1;NA={},YP=!1;OA={},ZP=!1;LA={},KP=!1;PA={},JP=!1;FA={},QP=!1;Tw={},eF=!1;MA={},tF=!1;BA={},rF=!1,nF=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window;Pr={},iF=!1;pr=Eq();pr._uint8ArrayToBuffer;pr._isUint8Array;pr.isDisturbed;pr.isErrored;pr.isReadable;pr.Readable;pr.Writable;pr.Duplex;pr.Transform;pr.PassThrough;pr.addAbortSignal;pr.finished;pr.destroy;pr.pipeline;pr.compose;pr.Stream;UA=pr.Readable;UA.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 UA(e).wrap(r)};_q=pr.Writable,Aq=pr.Duplex,xq=pr.Transform,Sq=pr.PassThrough,Tq=pr.finished,Cq=pr.pipeline,Rq=pr.Stream,Dq={finished:Ew(pr.finished),pipeline:Ew(pr.pipeline)}});var pF=dt((lre,dF)=>{Se();Ce();Te();dF.exports=Iw;function Iw(){this.pending=0,this.max=1/0,this.listeners=[],this.waiting=[],this.error=null}Iw.prototype.go=function(r){this.pending<this.max?hF(this,r):this.waiting.push(r)};Iw.prototype.wait=function(r){this.pending===0?r(this.error):this.listeners.push(r)};Iw.prototype.hold=function(){return fF(this)};function fF(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)hF(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 hF(r,e){e(fF(r))}});var mF=dt(tm=>{Se();Ce();Te();var em=(iw(),qr(nw)),kw=(zh(),qr(qg)),WA=(Qg(),qr(Jg)),gF=WA.Readable,HA=WA.Writable,Iq=WA.PassThrough,kq=pF(),Nw=(Wh(),qr(Gg)).EventEmitter;tm.createFromBuffer=Nq;tm.createFromFd=Oq;tm.BufferSlicer=Ca;tm.FdSlicer=Ta;kw.inherits(Ta,Nw);function Ta(r,e){e=e||{},Nw.call(this),this.fd=r,this.pend=new kq,this.pend.max=1,this.refCount=0,this.autoClose=!!e.autoClose}Ta.prototype.read=function(r,e,t,n,i){var o=this;o.pend.go(function(s){em.read(o.fd,r,e,t,n,function(a,u,c){s(),i(a,u,c)})})};Ta.prototype.write=function(r,e,t,n,i){var o=this;o.pend.go(function(s){em.write(o.fd,r,e,t,n,function(a,u,c){s(),i(a,u,c)})})};Ta.prototype.createReadStream=function(r){return new Ow(this,r)};Ta.prototype.createWriteStream=function(r){return new Lw(this,r)};Ta.prototype.ref=function(){this.refCount+=1};Ta.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&&em.close(r.fd,e);function e(t){t?r.emit("error",t):r.emit("close")}};kw.inherits(Ow,gF);function Ow(r,e){e=e||{},gF.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}Ow.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=We.allocUnsafe(t);em.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()})})}};Ow.prototype.destroy=function(r){this.destroyed||(r=r||new Error("stream destroyed"),this.destroyed=!0,this.emit("error",r),this.context.unref())};kw.inherits(Lw,HA);function Lw(r,e){e=e||{},HA.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))}Lw.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();em.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())})})}};Lw.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.context.unref())};kw.inherits(Ca,Nw);function Ca(r,e){Nw.call(this),e=e||{},this.refCount=0,this.buffer=r,this.maxChunkSize=e.maxChunkSize||Number.MAX_SAFE_INTEGER}Ca.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)})};Ca.prototype.write=function(r,e,t,n,i){r.copy(this.buffer,n,e,e+t),setImmediate(function(){i(null,t,r)})};Ca.prototype.createReadStream=function(r){r=r||{};var e=new Iq(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};Ca.prototype.createWriteStream=function(r){var e=this;r=r||{};var t=new HA(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};Ca.prototype.ref=function(){this.refCount+=1};Ca.prototype.unref=function(){if(this.refCount-=1,this.refCount<0)throw new Error("invalid unref")};function Nq(r,e){return new Ca(r,e)}function Oq(r,e){return new Ta(r,e)}});var wF=dt((mre,bF)=>{Se();Ce();Te();var zl=(kl(),qr(ph)).Buffer,qA=[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"&&(qA=new Int32Array(qA));function yF(r){if(zl.isBuffer(r))return r;var e=typeof zl.alloc=="function"&&typeof zl.from=="function";if(typeof r=="number")return e?zl.alloc(r):new zl(r);if(typeof r=="string")return e?zl.from(r):new zl(r);throw new Error("input must be buffer, number, or string, received "+typeof r)}function Lq(r){var e=yF(4);return e.writeInt32BE(r,0),e}function GA(r,e){r=yF(r),zl.isBuffer(e)&&(e=e.readUInt32BE(0));for(var t=~~e^-1,n=0;n<r.length;n++)t=qA[(t^r[n])&255]^t>>>8;return t^-1}function VA(){return Lq(GA.apply(null,arguments))}VA.signed=function(){return GA.apply(null,arguments)};VA.unsigned=function(){return GA.apply(null,arguments)>>>0};bF.exports=VA});var DF=dt(Bi=>{Se();Ce();Te();var XA=(iw(),qr(nw)),Pq=(dP(),qr(hP)),vF=mF(),Fq=wF(),Mw=(zh(),qr(qg)),Bw=(Wh(),qr(Gg)).EventEmitter,EF=(Qg(),qr(Jg)).Transform,ZA=(Qg(),qr(Jg)).PassThrough,Mq=(Qg(),qr(Jg)).Writable;Bi.open=Bq;Bi.fromFd=_F;Bi.fromBuffer=Uq;Bi.fromRandomAccessReader=KA;Bi.dosDateTimeToDate=SF;Bi.getFileNameLowLevel=TF;Bi.validateFileName=CF;Bi.parseExtraFields=RF;Bi.ZipFile=To;Bi.Entry=rm;Bi.LocalFileHeader=xF;Bi.RandomAccessReader=Wl;function Bq(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=Fw),XA.open(r,"r",function(n,i){if(n)return t(n);_F(i,e,function(o,s){o&&XA.close(i,Fw),t(o,s)})})}function _F(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=Fw),XA.fstat(r,function(n,i){if(n)return t(n);var o=vF.createFromFd(r,{autoClose:!0});KA(o,i.size,e,t)})}function Uq(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=vF.createFromBuffer(r,{maxChunkSize:65536});KA(n,r.length,e,t)}function KA(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=Fw),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=Ra(u),f=e-c.length;Gh(r,c,0,u,f,function(h){if(h)return n(h);for(var d=u-o;d>=0;d-=1)if(c.readUInt32LE(d)===101010256){var g=c.subarray(d),y=g.readUInt16LE(4),v=g.readUInt16LE(10),w=g.readUInt32LE(16),b=g.readUInt16LE(20),E=g.length-o;if(b!==E)return n(new Error("Invalid comment length. Expected: "+E+". Found: "+b+". 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 _=i?Pw(g.subarray(22),!1):g.subarray(22);if(d-s>=0&&c.readUInt32LE(d-s)===117853008){var S=c.subarray(d-s,d-s+s),A=qh(S,8),M=Ra(56);return Gh(r,M,0,M.length,A,function(I){return I?n(I):M.readUInt32LE(0)!==101075792?n(new Error("invalid zip64 end of central directory record signature")):(y=M.readUInt32LE(16),y!==0?n(new Error("multi-disk zip files are not supported: found disk number: "+y)):(v=qh(M,32),w=qh(M,48),n(null,new To(r,w,e,v,_,t.autoClose,t.lazyEntries,i,t.validateEntrySizes,t.strictFileNames))))})}return y!==0?n(new Error("multi-disk zip files are not supported: found disk number: "+y)):n(null,new To(r,w,e,v,_,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."))})}Mw.inherits(To,Bw);function To(r,e,t,n,i,o,s,a,u,c){var f=this;Bw.call(f),f.reader=r,f.reader.on("error",function(h){AF(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()}To.prototype.close=function(){this.isOpen&&(this.isOpen=!1,this.reader.unref())};function So(r,e){r.autoClose&&r.close(),AF(r,e)}function AF(r,e){r.emittedError||(r.emittedError=!0,r.emit("error",e))}To.prototype.readEntry=function(){if(!this.lazyEntries)throw new Error("readEntry() called without lazyEntries:true");this._readEntry()};To.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=Ra(46);Gh(r.reader,e,0,e.length,r.readEntryCursor,function(t){if(t)return So(r,t);if(!r.emittedError){var n=new rm,i=e.readUInt32LE(0);if(i!==33639248)return So(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 So(r,new Error("strong encryption is not supported"));r.readEntryCursor+=46,e=Ra(n.fileNameLength+n.extraFieldLength+n.fileCommentLength),Gh(r.reader,e,0,e.length,r.readEntryCursor,function(o){if(o)return So(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=RF(n.extraFieldRaw)}catch(v){return So(r,v)}if(r.decodeStrings){var a=(n.generalPurposeBitFlag&2048)!==0;n.fileComment=Pw(n.fileCommentRaw,a),n.fileName=TF(n.generalPurposeBitFlag,n.fileNameRaw,n.extraFields,r.strictFileNames);var u=CF(n.fileName);if(u!=null)return So(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,d=0;if(n.uncompressedSize===4294967295){if(d+8>h.length)return So(r,new Error("zip64 extended information extra field does not include uncompressed size"));n.uncompressedSize=qh(h,d),d+=8}if(n.compressedSize===4294967295){if(d+8>h.length)return So(r,new Error("zip64 extended information extra field does not include compressed size"));n.compressedSize=qh(h,d),d+=8}if(n.relativeOffsetOfLocalHeader===4294967295){if(d+8>h.length)return So(r,new Error("zip64 extended information extra field does not include relative header offset"));n.relativeOffsetOfLocalHeader=qh(h,d),d+=8}break}}if(r.validateEntrySizes&&n.compressionMethod===0){var g=n.uncompressedSize;if(n.isEncrypted()&&(g+=12),n.compressedSize!==g){var y="compressed/uncompressed size mismatch for stored file: "+n.compressedSize+" != "+n.uncompressedSize;return So(r,new Error(y))}}r.emit("entry",n),r.lazyEntries||r._readEntry()}})}})}};To.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)})};To.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,d=Pq.createInflateRaw();c.on("error",function(g){setImmediate(function(){h||d.emit("error",g)})}),c.pipe(d),a.validateEntrySizes?(f=new nm(o),d.on("error",function(g){setImmediate(function(){h||f.emit("error",g)})}),d.pipe(f)):f=d,YA(f,function(){h=!0,d!==f&&d.unpipe(f),c.unpipe(d),c.destroy()})}s(null,f)};To.prototype.readLocalFileHeader=function(r,e,t){var n=this;t==null&&(t=e,e=null),e==null&&(e={}),n.reader.ref();var i=Ra(30);Gh(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 xF;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=Ra(a+u),n.reader.ref(),Gh(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 rm(){}rm.prototype.getLastModDate=function(r){if(r==null&&(r={}),!r.forceDosFormat)for(var e=0;e<this.extraFields.length;e++){var t=this.extraFields[e];if(t.id===21589){var n=t.data;if(n.length<5)continue;var i=n[0],o=1;if(!(i&o))continue;var s=n.readInt32LE(1);return new Date(s*1e3)}else if(t.id===10){var n=t.data;if(n.length!==32||n.readUInt16LE(4)!==1||n.readUInt16LE(6)!==24)continue;var a=n.readUInt32LE(8)+4294967296*n.readInt32LE(12),u=a/1e4-116444736e5;return new Date(u)}}return SF(this.lastModFileDate,this.lastModFileTime,r.timezone)};rm.prototype.isEncrypted=function(){return(this.generalPurposeBitFlag&1)!==0};rm.prototype.isCompressed=function(){return this.compressionMethod===8};function xF(){}function SF(r,e,t){var n=r&31,i=(r>>5&15)-1,o=(r>>9&127)+1980,s=0,a=(e&31)*2,u=e>>5&63,c=e>>11&31;if(t==null||t==="local")return new Date(o,i,n,c,u,a,s);if(t==="UTC")return new Date(Date.UTC(o,i,n,c,u,a,s));throw new Error("unrecognized options.timezone: "+options.timezone)}function TF(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(Fq.unsigned(e)!==a)continue;i=Pw(s.data.subarray(5),!0);break}}if(i==null){var u=(r&2048)!==0;i=Pw(e,u)}return n||(i=i.replace(/\\/g,"/")),i}function CF(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 RF(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 Gh(r,e,t,n,i,o){if(n===0)return setImmediate(function(){o(null,Ra(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()})}Mw.inherits(nm,EF);function nm(r){EF.call(this),this.actualByteCount=0,this.expectedByteCount=r}nm.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)};nm.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()};Mw.inherits(Wl,Bw);function Wl(){Bw.call(this),this.refCount=0}Wl.prototype.ref=function(){this.refCount+=1};Wl.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")}};Wl.prototype.createReadStream=function(r){r==null&&(r={});var e=r.start,t=r.end;if(e===t){var n=new ZA;return setImmediate(function(){n.end()}),n}var i=this._readStreamForRange(e,t),o=!1,s=new Uw(this);i.on("error",function(u){setImmediate(function(){o||s.emit("error",u)})}),YA(s,function(){i.unpipe(s),s.unref(),i.destroy()});var a=new nm(t-e);return s.on("error",function(u){setImmediate(function(){o||a.emit("error",u)})}),YA(a,function(){o=!0,s.unpipe(a),s.destroy()}),i.pipe(s).pipe(a)};Wl.prototype._readStreamForRange=function(r,e){throw new Error("not implemented")};Wl.prototype.read=function(r,e,t,n,i){var o=this.createReadStream({start:n,end:n+t}),s=new Mq,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)};Wl.prototype.close=function(r){setImmediate(r)};Mw.inherits(Uw,ZA);function Uw(r){ZA.call(this),this.context=r,this.context.ref(),this.unreffedYet=!1}Uw.prototype._flush=function(r){this.unref(),r()};Uw.prototype.unref=function(r){this.unreffedYet||(this.unreffedYet=!0,this.context.unref())};var jq="\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 Pw(r,e){if(e)return r.toString("utf8");for(var t="",n=0;n<r.length;n++)t+=jq[r[n]];return t}function qh(r,e){var t=r.readUInt32LE(e),n=r.readUInt32LE(e+4);return n*4294967296+t}var Ra;typeof We.allocUnsafe=="function"?Ra=function(r){return We.allocUnsafe(r)}:Ra=function(r){return new We(r)};function YA(r,e){typeof r.destroy=="function"?r._destroy=function(t,n){e(),n?.(t)}:r.destroy=e}function Fw(r){if(r)throw r}});var JA=dt((xre,IF)=>{Se();Ce();Te();IF.exports=(Wh(),qr(Gg)).EventEmitter});var FF=dt((Rre,PF)=>{"use strict";Se();Ce();Te();function kF(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 NF(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?kF(Object(t),!0).forEach(function(n){$q(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):kF(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function $q(r,e,t){return e=LF(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function zq(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function OF(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,LF(n.key),n)}}function Wq(r,e,t){return e&&OF(r.prototype,e),t&&OF(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}function LF(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 qq=(kl(),qr(ph)),jw=qq.Buffer,Gq=(zh(),qr(qg)),QA=Gq.inspect,Vq=QA&&QA.custom||"inspect";function Xq(r,e,t){jw.prototype.copy.call(r,e,t)}PF.exports=(function(){function r(){zq(this,r),this.head=null,this.tail=null,this.length=0}return Wq(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 jw.alloc(0);for(var n=jw.allocUnsafe(t>>>0),i=this.head,o=0;i;)Xq(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=jw.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:Vq,value:function(t,n){return QA(this,NF(NF({},n),{},{depth:0,customInspect:!1}))}}]),r})()});var tx=dt((Nre,BF)=>{"use strict";Se();Ce();Te();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,$e.nextTick(ex,this,r)):$e.nextTick(ex,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?$e.nextTick($w,t):(t._writableState.errorEmitted=!0,$e.nextTick(MF,t,o)):$e.nextTick(MF,t,o):e?($e.nextTick($w,t),e(o)):$e.nextTick($w,t)}),this)}function MF(r,e){ex(r,e),$w(r)}function $w(r){r._writableState&&!r._writableState.emitClose||r._readableState&&!r._readableState.emitClose||r.emit("close")}function Zq(){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 ex(r,e){r.emit("error",e)}function Kq(r,e){var t=r._readableState,n=r._writableState;t&&t.autoDestroy||n&&n.autoDestroy?r.destroy(e):r.emit("error",e)}BF.exports={destroy:Yq,undestroy:Zq,errorOrDestroy:Kq}});var _c=dt((Fre,$F)=>{"use strict";Se();Ce();Te();function Jq(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,r.__proto__=e}var jF={};function bs(r,e,t){t||(t=Error);function n(o,s,a){return typeof e=="string"?e:e(o,s,a)}var i=(function(o){Jq(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,jF[r]=i}function UF(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 Qq(r,e,t){return r.substr(!t||t<0?0:+t,e.length)===e}function eG(r,e,t){return(t===void 0||t>r.length)&&(t=r.length),r.substring(t-e.length,t)===e}function tG(r,e,t){return typeof t!="number"&&(t=0),t+e.length>r.length?!1:r.indexOf(e,t)!==-1}bs("ERR_INVALID_OPT_VALUE",function(r,e){return'The value "'+e+'" is invalid for option "'+r+'"'},TypeError);bs("ERR_INVALID_ARG_TYPE",function(r,e,t){var n;typeof e=="string"&&Qq(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be";var i;if(eG(r," argument"))i="The ".concat(r," ").concat(n," ").concat(UF(e,"type"));else{var o=tG(r,".")?"property":"argument";i='The "'.concat(r,'" ').concat(o," ").concat(n," ").concat(UF(e,"type"))}return i+=". Received type ".concat(typeof t),i},TypeError);bs("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");bs("ERR_METHOD_NOT_IMPLEMENTED",function(r){return"The "+r+" method is not implemented"});bs("ERR_STREAM_PREMATURE_CLOSE","Premature close");bs("ERR_STREAM_DESTROYED",function(r){return"Cannot call "+r+" after a stream was destroyed"});bs("ERR_MULTIPLE_CALLBACK","Callback called multiple times");bs("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");bs("ERR_STREAM_WRITE_AFTER_END","write after end");bs("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);bs("ERR_UNKNOWN_ENCODING",function(r){return"Unknown encoding: "+r},TypeError);bs("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");$F.exports.codes=jF});var rx=dt((jre,zF)=>{"use strict";Se();Ce();Te();var rG=_c().codes.ERR_INVALID_OPT_VALUE;function nG(r,e,t){return r.highWaterMark!=null?r.highWaterMark:e?r[t]:null}function iG(r,e,t,n){var i=nG(e,n,t);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var o=n?t:"highWaterMark";throw new rG(o,i)}return Math.floor(i)}return r.objectMode?16:16*1024}zF.exports={getHighWaterMark:iG}});var Ac=dt((Hre,nx)=>{Se();Ce();Te();typeof Object.create=="function"?nx.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:nx.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}});var HF=dt((Xre,WF)=>{Se();Ce();Te();WF.exports=sG;function sG(r,e){if(ix("noDeprecation"))return r;var t=!1;function n(){if(!t){if(ix("throwDeprecation"))throw new Error(e);ix("traceDeprecation")?console.trace(e):console.warn(e),t=!0}return r.apply(this,arguments)}return n}function ix(r){try{if(!window.localStorage)return!1}catch{return!1}var e=window.localStorage[r];return e==null?!1:String(e).toLowerCase()==="true"}});var ax=dt((Jre,ZF)=>{"use strict";Se();Ce();Te();ZF.exports=Mr;function GF(r){var e=this;this.next=null,this.entry=null,this.finish=function(){NG(e,r)}}var Vh;Mr.WritableState=sm;var oG={deprecate:HF()},VF=JA(),Ww=(kl(),qr(ph)).Buffer,aG=(typeof window<"u"||typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function lG(r){return Ww.from(r)}function uG(r){return Ww.isBuffer(r)||r instanceof aG}var ox=tx(),cG=rx(),fG=cG.getHighWaterMark,Hl=_c().codes,hG=Hl.ERR_INVALID_ARG_TYPE,dG=Hl.ERR_METHOD_NOT_IMPLEMENTED,pG=Hl.ERR_MULTIPLE_CALLBACK,gG=Hl.ERR_STREAM_CANNOT_PIPE,mG=Hl.ERR_STREAM_DESTROYED,yG=Hl.ERR_STREAM_NULL_VALUES,bG=Hl.ERR_STREAM_WRITE_AFTER_END,wG=Hl.ERR_UNKNOWN_ENCODING,Xh=ox.errorOrDestroy;Ac()(Mr,VF);function vG(){}function sm(r,e,t){Vh=Vh||xc(),r=r||{},typeof t!="boolean"&&(t=e instanceof Vh),this.objectMode=!!r.objectMode,t&&(this.objectMode=this.objectMode||!!r.writableObjectMode),this.highWaterMark=fG(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){CG(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 GF(this)}sm.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t};(function(){try{Object.defineProperty(sm.prototype,"buffer",{get:oG.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var zw;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(zw=Function.prototype[Symbol.hasInstance],Object.defineProperty(Mr,Symbol.hasInstance,{value:function(e){return zw.call(this,e)?!0:this!==Mr?!1:e&&e._writableState instanceof sm}})):zw=function(e){return e instanceof this};function Mr(r){Vh=Vh||xc();var e=this instanceof Vh;if(!e&&!zw.call(Mr,this))return new Mr(r);this._writableState=new sm(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)),VF.call(this)}Mr.prototype.pipe=function(){Xh(this,new gG)};function EG(r,e){var t=new bG;Xh(r,t),$e.nextTick(e,t)}function _G(r,e,t,n){var i;return t===null?i=new yG:typeof t!="string"&&!e.objectMode&&(i=new hG("chunk",["string","Buffer"],t)),i?(Xh(r,i),$e.nextTick(n,i),!1):!0}Mr.prototype.write=function(r,e,t){var n=this._writableState,i=!1,o=!n.objectMode&&uG(r);return o&&!Ww.isBuffer(r)&&(r=lG(r)),typeof e=="function"&&(t=e,e=null),o?e="buffer":e||(e=n.defaultEncoding),typeof t!="function"&&(t=vG),n.ending?EG(this,t):(o||_G(this,n,r,t))&&(n.pendingcb++,i=xG(this,n,o,r,e,t)),i};Mr.prototype.cork=function(){this._writableState.corked++};Mr.prototype.uncork=function(){var r=this._writableState;r.corked&&(r.corked--,!r.writing&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&XF(this,r))};Mr.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 wG(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(Mr.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function AG(r,e,t){return!r.objectMode&&r.decodeStrings!==!1&&typeof e=="string"&&(e=Ww.from(e,t)),e}Object.defineProperty(Mr.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function xG(r,e,t,n,i,o){if(!t){var s=AG(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 sx(r,e,!1,a,n,i,o);return u}function sx(r,e,t,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new mG("write")):t?r._writev(i,e.onwrite):r._write(i,o,e.onwrite),e.sync=!1}function SG(r,e,t,n,i){--e.pendingcb,t?($e.nextTick(i,n),$e.nextTick(im,r,e),r._writableState.errorEmitted=!0,Xh(r,n)):(i(n),r._writableState.errorEmitted=!0,Xh(r,n),im(r,e))}function TG(r){r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0}function CG(r,e){var t=r._writableState,n=t.sync,i=t.writecb;if(typeof i!="function")throw new pG;if(TG(t),e)SG(r,t,n,e,i);else{var o=YF(t)||r.destroyed;!o&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&XF(r,t),n?$e.nextTick(qF,r,t,o,i):qF(r,t,o,i)}}function qF(r,e,t,n){t||RG(r,e),e.pendingcb--,n(),im(r,e)}function RG(r,e){e.length===0&&e.needDrain&&(e.needDrain=!1,r.emit("drain"))}function XF(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,sx(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 GF(e),e.bufferedRequestCount=0}else{for(;t;){var u=t.chunk,c=t.encoding,f=t.callback,h=e.objectMode?1:u.length;if(sx(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}Mr.prototype._write=function(r,e,t){t(new dG("_write()"))};Mr.prototype._writev=null;Mr.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||kG(this,n,t),this};Object.defineProperty(Mr.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function YF(r){return r.ending&&r.length===0&&r.bufferedRequest===null&&!r.finished&&!r.writing}function DG(r,e){r._final(function(t){e.pendingcb--,t&&Xh(r,t),e.prefinished=!0,r.emit("prefinish"),im(r,e)})}function IG(r,e){!e.prefinished&&!e.finalCalled&&(typeof r._final=="function"&&!e.destroyed?(e.pendingcb++,e.finalCalled=!0,$e.nextTick(DG,r,e)):(e.prefinished=!0,r.emit("prefinish")))}function im(r,e){var t=YF(e);if(t&&(IG(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 kG(r,e,t){e.ending=!0,im(r,e),t&&(e.finished?$e.nextTick(t):r.once("finish",t)),e.ended=!0,r.writable=!1}function NG(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(Mr.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}});Mr.prototype.destroy=ox.destroy;Mr.prototype._undestroy=ox.undestroy;Mr.prototype._destroy=function(r,e){e(r)}});var xc=dt((rne,JF)=>{"use strict";Se();Ce();Te();var OG=Object.keys||function(r){var e=[];for(var t in r)e.push(t);return e};JF.exports=Co;var KF=cx(),ux=ax();Ac()(Co,KF);for(lx=OG(ux.prototype),Hw=0;Hw<lx.length;Hw++)qw=lx[Hw],Co.prototype[qw]||(Co.prototype[qw]=ux.prototype[qw]);var lx,qw,Hw;function Co(r){if(!(this instanceof Co))return new Co(r);KF.call(this,r),ux.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",LG)))}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 LG(){this._writableState.ended||$e.nextTick(PG,this)}function PG(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 tM=dt((fx,eM)=>{Se();Ce();Te();var Gw=(kl(),qr(ph)),Da=Gw.Buffer;function QF(r,e){for(var t in r)e[t]=r[t]}Da.from&&Da.alloc&&Da.allocUnsafe&&Da.allocUnsafeSlow?eM.exports=Gw:(QF(Gw,fx),fx.Buffer=Yh);function Yh(r,e,t){return Da(r,e,t)}QF(Da,Yh);Yh.from=function(r,e,t){if(typeof r=="number")throw new TypeError("Argument must not be a number");return Da(r,e,t)};Yh.alloc=function(r,e,t){if(typeof r!="number")throw new TypeError("Argument must be a number");var n=Da(r);return e!==void 0?typeof t=="string"?n.fill(e,t):n.fill(e):n.fill(0),n};Yh.allocUnsafe=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return Da(r)};Yh.allocUnsafeSlow=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return Gw.SlowBuffer(r)}});var px=dt(nM=>{"use strict";Se();Ce();Te();var dx=tM().Buffer,rM=dx.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 FG(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 MG(r){var e=FG(r);if(typeof e!="string"&&(dx.isEncoding===rM||!rM(r)))throw new Error("Unknown encoding: "+r);return e||r}nM.StringDecoder=om;function om(r){this.encoding=MG(r);var e;switch(this.encoding){case"utf16le":this.text=WG,this.end=HG,e=4;break;case"utf8":this.fillLast=jG,e=4;break;case"base64":this.text=qG,this.end=GG,e=3;break;default:this.write=VG,this.end=XG;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=dx.allocUnsafe(e)}om.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||""};om.prototype.end=zG;om.prototype.text=$G;om.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 hx(r){return r<=127?0:r>>5===6?2:r>>4===14?3:r>>3===30?4:r>>6===2?-1:-2}function BG(r,e,t){var n=e.length-1;if(n<t)return 0;var i=hx(e[n]);return i>=0?(i>0&&(r.lastNeed=i-1),i):--n<t||i===-2?0:(i=hx(e[n]),i>=0?(i>0&&(r.lastNeed=i-2),i):--n<t||i===-2?0:(i=hx(e[n]),i>=0?(i>0&&(i===2?i=0:r.lastNeed=i-3),i):0))}function UG(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 jG(r){var e=this.lastTotal-this.lastNeed,t=UG(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 $G(r,e){var t=BG(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 zG(r){var e=r&&r.length?this.write(r):"";return this.lastNeed?e+"\uFFFD":e}function WG(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 HG(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 qG(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 GG(r){var e=r&&r.length?this.write(r):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function VG(r){return r.toString(this.encoding)}function XG(r){return r&&r.length?this.write(r):""}});var Vw=dt((dne,oM)=>{"use strict";Se();Ce();Te();var iM=_c().codes.ERR_STREAM_PREMATURE_CLOSE;function YG(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 ZG(){}function KG(r){return r.setHeader&&typeof r.abort=="function"}function sM(r,e,t){if(typeof e=="function")return sM(r,null,e);e||(e={}),t=YG(t||ZG);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(y){t.call(r,y)},h=function(){var y;if(n&&!u)return(!r._readableState||!r._readableState.ended)&&(y=new iM),t.call(r,y);if(i&&!s)return(!r._writableState||!r._writableState.ended)&&(y=new iM),t.call(r,y)},d=function(){r.req.on("finish",a)};return KG(r)?(r.on("complete",a),r.on("abort",h),r.req?d():r.on("request",d)):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",d),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)}}oM.exports=sM});var lM=dt((yne,aM)=>{"use strict";Se();Ce();Te();var Xw;function ql(r,e,t){return e=JG(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function JG(r){var e=QG(r,"string");return typeof e=="symbol"?e:String(e)}function QG(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 eV=Vw(),Gl=Symbol("lastResolve"),Sc=Symbol("lastReject"),am=Symbol("error"),Yw=Symbol("ended"),Tc=Symbol("lastPromise"),gx=Symbol("handlePromise"),Cc=Symbol("stream");function Vl(r,e){return{value:r,done:e}}function tV(r){var e=r[Gl];if(e!==null){var t=r[Cc].read();t!==null&&(r[Tc]=null,r[Gl]=null,r[Sc]=null,e(Vl(t,!1)))}}function rV(r){$e.nextTick(tV,r)}function nV(r,e){return function(t,n){r.then(function(){if(e[Yw]){t(Vl(void 0,!0));return}e[gx](t,n)},n)}}var iV=Object.getPrototypeOf(function(){}),sV=Object.setPrototypeOf((Xw={get stream(){return this[Cc]},next:function(){var e=this,t=this[am];if(t!==null)return Promise.reject(t);if(this[Yw])return Promise.resolve(Vl(void 0,!0));if(this[Cc].destroyed)return new Promise(function(s,a){$e.nextTick(function(){e[am]?a(e[am]):s(Vl(void 0,!0))})});var n=this[Tc],i;if(n)i=new Promise(nV(n,this));else{var o=this[Cc].read();if(o!==null)return Promise.resolve(Vl(o,!1));i=new Promise(this[gx])}return this[Tc]=i,i}},ql(Xw,Symbol.asyncIterator,function(){return this}),ql(Xw,"return",function(){var e=this;return new Promise(function(t,n){e[Cc].destroy(null,function(i){if(i){n(i);return}t(Vl(void 0,!0))})})}),Xw),iV),oV=function(e){var t,n=Object.create(sV,(t={},ql(t,Cc,{value:e,writable:!0}),ql(t,Gl,{value:null,writable:!0}),ql(t,Sc,{value:null,writable:!0}),ql(t,am,{value:null,writable:!0}),ql(t,Yw,{value:e._readableState.endEmitted,writable:!0}),ql(t,gx,{value:function(o,s){var a=n[Cc].read();a?(n[Tc]=null,n[Gl]=null,n[Sc]=null,o(Vl(a,!1))):(n[Gl]=o,n[Sc]=s)},writable:!0}),t));return n[Tc]=null,eV(e,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=n[Sc];o!==null&&(n[Tc]=null,n[Gl]=null,n[Sc]=null,o(i)),n[am]=i;return}var s=n[Gl];s!==null&&(n[Tc]=null,n[Gl]=null,n[Sc]=null,s(Vl(void 0,!0))),n[Yw]=!0}),e.on("readable",rV.bind(null,n)),n};aM.exports=oV});var cM=dt((Ene,uM)=>{Se();Ce();Te();uM.exports=function(){throw new Error("Readable.from is not available in the browser")}});var cx=dt((Tne,vM)=>{"use strict";Se();Ce();Te();vM.exports=jt;var Zh;jt.ReadableState=pM;var Sne=(Wh(),qr(Gg)).EventEmitter,dM=function(e,t){return e.listeners(t).length},um=JA(),Zw=(kl(),qr(ph)).Buffer,aV=(typeof window<"u"||typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function lV(r){return Zw.from(r)}function uV(r){return Zw.isBuffer(r)||r instanceof aV}var mx=(zh(),qr(qg)),Ot;mx&&mx.debuglog?Ot=mx.debuglog("stream"):Ot=function(){};var cV=FF(),Ax=tx(),fV=rx(),hV=fV.getHighWaterMark,Kw=_c().codes,dV=Kw.ERR_INVALID_ARG_TYPE,pV=Kw.ERR_STREAM_PUSH_AFTER_EOF,gV=Kw.ERR_METHOD_NOT_IMPLEMENTED,mV=Kw.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Kh,yx,bx;Ac()(jt,um);var lm=Ax.errorOrDestroy,wx=["error","close","destroy","pause","resume"];function yV(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 pM(r,e,t){Zh=Zh||xc(),r=r||{},typeof t!="boolean"&&(t=e instanceof Zh),this.objectMode=!!r.objectMode,t&&(this.objectMode=this.objectMode||!!r.readableObjectMode),this.highWaterMark=hV(this,r,"readableHighWaterMark",t),this.buffer=new cV,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&&(Kh||(Kh=px().StringDecoder),this.decoder=new Kh(r.encoding),this.encoding=r.encoding)}function jt(r){if(Zh=Zh||xc(),!(this instanceof jt))return new jt(r);var e=this instanceof Zh;this._readableState=new pM(r,this,e),this.readable=!0,r&&(typeof r.read=="function"&&(this._read=r.read),typeof r.destroy=="function"&&(this._destroy=r.destroy)),um.call(this)}Object.defineProperty(jt.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}});jt.prototype.destroy=Ax.destroy;jt.prototype._undestroy=Ax.undestroy;jt.prototype._destroy=function(r,e){e(r)};jt.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=Zw.from(r,e),e=""),n=!0),gM(this,r,e,!1,n)};jt.prototype.unshift=function(r){return gM(this,r,null,!0,!1)};function gM(r,e,t,n,i){Ot("readableAddChunk",e);var o=r._readableState;if(e===null)o.reading=!1,vV(r,o);else{var s;if(i||(s=bV(o,e)),s)lm(r,s);else if(o.objectMode||e&&e.length>0)if(typeof e!="string"&&!o.objectMode&&Object.getPrototypeOf(e)!==Zw.prototype&&(e=lV(e)),n)o.endEmitted?lm(r,new mV):vx(r,o,e,!0);else if(o.ended)lm(r,new pV);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!t?(e=o.decoder.write(e),o.objectMode||e.length!==0?vx(r,o,e,!1):_x(r,o)):vx(r,o,e,!1)}else n||(o.reading=!1,_x(r,o))}return!o.ended&&(o.length<o.highWaterMark||o.length===0)}function vx(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&&Jw(r)),_x(r,e)}function bV(r,e){var t;return!uV(e)&&typeof e!="string"&&e!==void 0&&!r.objectMode&&(t=new dV("chunk",["string","Buffer","Uint8Array"],e)),t}jt.prototype.isPaused=function(){return this._readableState.flowing===!1};jt.prototype.setEncoding=function(r){Kh||(Kh=px().StringDecoder);var e=new Kh(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 fM=1073741824;function wV(r){return r>=fM?r=fM:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),r}function hM(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=wV(r)),r<=e.length?r:e.ended?e.length:(e.needReadable=!0,0))}jt.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?Ex(this):Jw(this),null;if(r=hM(r,e),r===0&&e.ended)return e.length===0&&Ex(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=hM(t,e)));var i;return r>0?i=bM(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&&Ex(this)),i!==null&&this.emit("data",i),i};function vV(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?Jw(r):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,mM(r)))}}function Jw(r){var e=r._readableState;Ot("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(Ot("emitReadable",e.flowing),e.emittedReadable=!0,$e.nextTick(mM,r))}function mM(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,xx(r)}function _x(r,e){e.readingMore||(e.readingMore=!0,$e.nextTick(EV,r,e))}function EV(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}jt.prototype._read=function(r){lm(this,new gV("_read()"))};jt.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!==$e.stdout&&r!==$e.stderr,o=i?a:v;n.endEmitted?$e.nextTick(o):t.once("end",o),r.on("unpipe",s);function s(w,b){Ot("onunpipe"),w===t&&b&&b.hasUnpiped===!1&&(b.hasUnpiped=!0,f())}function a(){Ot("onend"),r.end()}var u=_V(t);r.on("drain",u);var c=!1;function f(){Ot("cleanup"),r.removeListener("close",g),r.removeListener("finish",y),r.removeListener("drain",u),r.removeListener("error",d),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 b=r.write(w);Ot("dest.write",b),b===!1&&((n.pipesCount===1&&n.pipes===r||n.pipesCount>1&&wM(n.pipes,r)!==-1)&&!c&&(Ot("false write response, pause",n.awaitDrain),n.awaitDrain++),t.pause())}function d(w){Ot("onerror",w),v(),r.removeListener("error",d),dM(r,"error")===0&&lm(r,w)}yV(r,"error",d);function g(){r.removeListener("finish",y),v()}r.once("close",g);function y(){Ot("onfinish"),r.removeListener("close",g),v()}r.once("finish",y);function v(){Ot("unpipe"),t.unpipe(r)}return r.emit("pipe",t),n.flowing||(Ot("pipe resume"),t.resume()),r};function _V(r){return function(){var t=r._readableState;Ot("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&dM(r,"data")&&(t.flowing=!0,xx(r))}}jt.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=wM(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)};jt.prototype.on=function(r,e){var t=um.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?Jw(this):n.reading||$e.nextTick(AV,this)),t};jt.prototype.addListener=jt.prototype.on;jt.prototype.removeListener=function(r,e){var t=um.prototype.removeListener.call(this,r,e);return r==="readable"&&$e.nextTick(yM,this),t};jt.prototype.removeAllListeners=function(r){var e=um.prototype.removeAllListeners.apply(this,arguments);return(r==="readable"||r===void 0)&&$e.nextTick(yM,this),e};function yM(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 AV(r){Ot("readable nexttick read 0"),r.read(0)}jt.prototype.resume=function(){var r=this._readableState;return r.flowing||(Ot("resume"),r.flowing=!r.readableListening,xV(this,r)),r.paused=!1,this};function xV(r,e){e.resumeScheduled||(e.resumeScheduled=!0,$e.nextTick(SV,r,e))}function SV(r,e){Ot("resume",e.reading),e.reading||r.read(0),e.resumeScheduled=!1,r.emit("resume"),xx(r),e.flowing&&!e.reading&&r.read(0)}jt.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 xx(r){var e=r._readableState;for(Ot("flow",e.flowing);e.flowing&&r.read()!==null;);}jt.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<wx.length;o++)r.on(wx[o],this.emit.bind(this,wx[o]));return this._read=function(s){Ot("wrapped _read",s),n&&(n=!1,r.resume())},this};typeof Symbol=="function"&&(jt.prototype[Symbol.asyncIterator]=function(){return yx===void 0&&(yx=lM()),yx(this)});Object.defineProperty(jt.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(jt.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(jt.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}});jt._fromList=bM;Object.defineProperty(jt.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function bM(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 Ex(r){var e=r._readableState;Ot("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,$e.nextTick(TV,e,r))}function TV(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"&&(jt.from=function(r,e){return bx===void 0&&(bx=cM()),bx(jt,r,e)});function wM(r,e){for(var t=0,n=r.length;t<n;t++)if(r[t]===e)return t;return-1}});var Sx=dt((Ine,_M)=>{"use strict";Se();Ce();Te();_M.exports=Ia;var Qw=_c().codes,CV=Qw.ERR_METHOD_NOT_IMPLEMENTED,RV=Qw.ERR_MULTIPLE_CALLBACK,DV=Qw.ERR_TRANSFORM_ALREADY_TRANSFORMING,IV=Qw.ERR_TRANSFORM_WITH_LENGTH_0,ev=xc();Ac()(Ia,ev);function kV(r,e){var t=this._transformState;t.transforming=!1;var n=t.writecb;if(n===null)return this.emit("error",new RV);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 Ia(r){if(!(this instanceof Ia))return new Ia(r);ev.call(this,r),this._transformState={afterTransform:kV.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",NV)}function NV(){var r=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,t){EM(r,e,t)}):EM(this,null,null)}Ia.prototype.push=function(r,e){return this._transformState.needTransform=!1,ev.prototype.push.call(this,r,e)};Ia.prototype._transform=function(r,e,t){t(new CV("_transform()"))};Ia.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)}};Ia.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};Ia.prototype._destroy=function(r,e){ev.prototype._destroy.call(this,r,function(t){e(t)})};function EM(r,e,t){if(e)return r.emit("error",e);if(t!=null&&r.push(t),r._writableState.length)throw new IV;if(r._transformState.transforming)throw new DV;return r.push(null)}});var SM=dt((Lne,xM)=>{"use strict";Se();Ce();Te();xM.exports=cm;var AM=Sx();Ac()(cm,AM);function cm(r){if(!(this instanceof cm))return new cm(r);AM.call(this,r)}cm.prototype._transform=function(r,e,t){t(null,r)}});var IM=dt((Bne,DM)=>{"use strict";Se();Ce();Te();var Tx;function OV(r){var e=!1;return function(){e||(e=!0,r.apply(void 0,arguments))}}var RM=_c().codes,LV=RM.ERR_MISSING_ARGS,PV=RM.ERR_STREAM_DESTROYED;function TM(r){if(r)throw r}function FV(r){return r.setHeader&&typeof r.abort=="function"}function MV(r,e,t,n){n=OV(n);var i=!1;r.on("close",function(){i=!0}),Tx===void 0&&(Tx=Vw()),Tx(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,FV(r))return r.abort();if(typeof r.destroy=="function")return r.destroy();n(s||new PV("pipe"))}}}function CM(r){r()}function BV(r,e){return r.pipe(e)}function UV(r){return!r.length||typeof r[r.length-1]!="function"?TM:r.pop()}function jV(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];var n=UV(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new LV("streams");var i,o=e.map(function(s,a){var u=a<e.length-1,c=a>0;return MV(s,u,c,function(f){i||(i=f),f&&o.forEach(CM),!u&&(o.forEach(CM),n(i))})});return e.reduce(BV)}DM.exports=jV});var NM=dt((ws,kM)=>{Se();Ce();Te();ws=kM.exports=cx();ws.Stream=ws;ws.Readable=ws;ws.Writable=ax();ws.Duplex=xc();ws.Transform=Sx();ws.PassThrough=SM();ws.finished=Vw();ws.pipeline=IM()});var LM=dt((qne,OM)=>{Se();Ce();Te();var $V=Object.prototype.toString,Cx=typeof We<"u"&&typeof We.alloc=="function"&&typeof We.allocUnsafe=="function"&&typeof We.from=="function";function zV(r){return $V.call(r).slice(8,-1)==="ArrayBuffer"}function WV(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 Cx?We.from(r.slice(e,e+t)):new We(new Uint8Array(r.slice(e,e+t)))}function HV(r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!We.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');return Cx?We.from(r,e):new We(r,e)}function qV(r,e,t){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return zV(r)?WV(r,e,t):typeof r=="string"?HV(r,e):Cx?We.from(r):new We(r)}OM.exports=qV});var jM=dt(Et=>{Se();Ce();Te();var PM=void 0,GV=1e5,Ar=(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}}})(),VV=Math.LN2,XV=Math.abs,tv=Math.floor,YV=Math.log,ZV=Math.min,Vs=Math.pow,KV=Math.round;function Rx(r){if(FM&&Jh){var e=FM(r),t;for(t=0;t<e.length;t+=1)Jh(r,e[t],{value:r[e[t]],writable:!1,enumerable:!1,configurable:!1})}}var Jh;Object.defineProperty&&(function(){try{return Object.defineProperty({},"x",{}),!0}catch{return!1}})()?Jh=Object.defineProperty:Jh=function(r,e,t){if(!r===Object(r))throw new TypeError("Object.defineProperty called on non-object");return Ar.HasProperty(t,"get")&&Object.prototype.__defineGetter__&&Object.prototype.__defineGetter__.call(r,e,t.get),Ar.HasProperty(t,"set")&&Object.prototype.__defineSetter__&&Object.prototype.__defineSetter__.call(r,e,t.set),Ar.HasProperty(t,"value")&&(r[e]=t.value),r};var FM=Object.getOwnPropertyNames||function(r){if(r!==Object(r))throw new TypeError("Object.getOwnPropertyNames called on non-object");var e=[],t;for(t in r)Ar.HasOwnProperty(r,t)&&e.push(t);return e};function JV(r){if(!Jh)return;if(r.length>GV)throw new RangeError("Array too large for polyfill");function e(n){Jh(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 Dx(r,e){var t=32-e;return r<<t>>t}function Ix(r,e){var t=32-e;return r<<t>>>t}function QV(r){return[r&255]}function eX(r){return Dx(r[0],8)}function tX(r){return[r&255]}function MM(r){return Ix(r[0],8)}function rX(r){return r=KV(Number(r)),[r<0?0:r>255?255:r&255]}function nX(r){return[r>>8&255,r&255]}function iX(r){return Dx(r[0]<<8|r[1],16)}function sX(r){return[r>>8&255,r&255]}function oX(r){return Ix(r[0]<<8|r[1],16)}function aX(r){return[r>>24&255,r>>16&255,r>>8&255,r&255]}function lX(r){return Dx(r[0]<<24|r[1]<<16|r[2]<<8|r[3],32)}function uX(r){return[r>>24&255,r>>16&255,r>>8&255,r&255]}function cX(r){return Ix(r[0]<<24|r[1]<<16|r[2]<<8|r[3],32)}function BM(r,e,t){var n=(1<<e-1)-1,i,o,s,a,u,c,f,h;function d(g){var y=tv(g),v=g-y;return v<.5?y:v>.5||y%2?y+1:y}for(r!==r?(o=(1<<e)-1,s=Vs(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=XV(r),r>=Vs(2,1-n)?(o=ZV(tv(YV(r)/VV),1023),s=d(r/Vs(2,o)*Vs(2,t)),s/Vs(2,t)>=2&&(o=o+1,s=1),o>n?(o=(1<<e)-1,s=0):(o=o+n,s=s-Vs(2,t))):(o=0,s=d(r/Vs(2,1-n-t)))),c=[],u=t;u;u-=1)c.push(s%2?1:0),s=tv(s/2);for(u=e;u;u-=1)c.push(o%2?1:0),o=tv(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 UM(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*Vs(2,f-u)*(1+h/Vs(2,t)):h!==0?c*Vs(2,-(u-1))*(h/Vs(2,t)):c<0?-0:0}function fX(r){return UM(r,11,52)}function hX(r){return BM(r,11,52)}function dX(r){return UM(r,8,23)}function pX(r){return BM(r,8,23)}(function(){var r=function(g){if(g=Ar.ToInt32(g),g<0)throw new RangeError("ArrayBuffer size is not a small enough positive integer");this.byteLength=g,this._bytes=[],this._bytes.length=g;var y;for(y=0;y<this.byteLength;y+=1)this._bytes[y]=0;Rx(this)};Et.ArrayBuffer=Et.ArrayBuffer||r;var e=function(){};function t(d,g,y){var v;return v=function(w,b,E){var _,S,A,M;if(!arguments.length||typeof arguments[0]=="number"){if(this.length=Ar.ToInt32(arguments[0]),E<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(_=arguments[0],this.length=_.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,_._getter(A));else if(typeof arguments[0]=="object"&&!(arguments[0]instanceof r||Ar.Class(arguments[0])==="ArrayBuffer"))for(S=arguments[0],this.length=Ar.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)M=S[A],this._setter(A,Number(M));else if(typeof arguments[0]=="object"&&(arguments[0]instanceof r||Ar.Class(arguments[0])==="ArrayBuffer")){if(this.buffer=w,this.byteOffset=Ar.ToUint32(b),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=Ar.ToUint32(E),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,Rx(this),JV(this)},v.prototype=new e,v.prototype.BYTES_PER_ELEMENT=d,v.prototype._pack=g,v.prototype._unpack=y,v.BYTES_PER_ELEMENT=d,v.prototype._getter=function(w){if(arguments.length<1)throw new SyntaxError("Not enough arguments");if(w=Ar.ToUint32(w),w>=this.length)return PM;var b=[],E,_;for(E=0,_=this.byteOffset+w*this.BYTES_PER_ELEMENT;E<this.BYTES_PER_ELEMENT;E+=1,_+=1)b.push(this.buffer._bytes[_]);return this._unpack(b)},v.prototype.get=v.prototype._getter,v.prototype._setter=function(w,b){if(arguments.length<2)throw new SyntaxError("Not enough arguments");if(w=Ar.ToUint32(w),w>=this.length)return PM;var E=this._pack(b),_,S;for(_=0,S=this.byteOffset+w*this.BYTES_PER_ELEMENT;_<this.BYTES_PER_ELEMENT;_+=1,S+=1)this.buffer._bytes[S]=E[_]},v.prototype.set=function(w,b){if(arguments.length<1)throw new SyntaxError("Not enough arguments");var E,_,S,A,M,I,q,Q,Z,ne;if(typeof arguments[0]=="object"&&arguments[0].constructor===this.constructor){if(E=arguments[0],S=Ar.ToUint32(arguments[1]),S+E.length>this.length)throw new RangeError("Offset plus length of array is out of range");if(Q=this.byteOffset+S*this.BYTES_PER_ELEMENT,Z=E.length*this.BYTES_PER_ELEMENT,E.buffer===this.buffer){for(ne=[],M=0,I=E.byteOffset;M<Z;M+=1,I+=1)ne[M]=E.buffer._bytes[I];for(M=0,q=Q;M<Z;M+=1,q+=1)this.buffer._bytes[q]=ne[M]}else for(M=0,I=E.byteOffset,q=Q;M<Z;M+=1,I+=1,q+=1)this.buffer._bytes[q]=E.buffer._bytes[I]}else if(typeof arguments[0]=="object"&&typeof arguments[0].length<"u"){if(_=arguments[0],A=Ar.ToUint32(_.length),S=Ar.ToUint32(arguments[1]),S+A>this.length)throw new RangeError("Offset plus length of array is out of range");for(M=0;M<A;M+=1)I=_[M],this._setter(S+M,Number(I))}else throw new TypeError("Unexpected argument type(s)")},v.prototype.subarray=function(w,b){function E(S,A,M){return S<A?A:S>M?M:S}w=Ar.ToInt32(w),b=Ar.ToInt32(b),arguments.length<1&&(w=0),arguments.length<2&&(b=this.length),w<0&&(w=this.length+w),b<0&&(b=this.length+b),w=E(w,0,this.length),b=E(b,0,this.length);var _=b-w;return _<0&&(_=0),new this.constructor(this.buffer,this.byteOffset+w*this.BYTES_PER_ELEMENT,_)},v}var n=t(1,QV,eX),i=t(1,tX,MM),o=t(1,rX,MM),s=t(2,nX,iX),a=t(2,sX,oX),u=t(4,aX,lX),c=t(4,uX,cX),f=t(4,pX,dX),h=t(8,hX,fX);Et.Int8Array=Et.Int8Array||n,Et.Uint8Array=Et.Uint8Array||i,Et.Uint8ClampedArray=Et.Uint8ClampedArray||o,Et.Int16Array=Et.Int16Array||s,Et.Uint16Array=Et.Uint16Array||a,Et.Int32Array=Et.Int32Array||u,Et.Uint32Array=Et.Uint32Array||c,Et.Float32Array=Et.Float32Array||f,Et.Float64Array=Et.Float64Array||h})();(function(){function r(o,s){return Ar.IsCallable(o.get)?o.get(s):o[s]}var e=(function(){var o=new Et.Uint16Array([4660]),s=new Et.Uint8Array(o.buffer);return r(s,0)===18})(),t=function(s,a,u){if(arguments.length===0)s=new Et.ArrayBuffer(0);else if(!(s instanceof Et.ArrayBuffer||Ar.Class(s)==="ArrayBuffer"))throw new TypeError("TypeError");if(this.buffer=s||new Et.ArrayBuffer(0),this.byteOffset=Ar.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=Ar.ToUint32(u),this.byteOffset+this.byteLength>this.buffer.byteLength)throw new RangeError("byteOffset and length reference an area beyond the end of the buffer");Rx(this)};function n(o){return function(s,a){if(s=Ar.ToUint32(s),s+o.BYTES_PER_ELEMENT>this.byteLength)throw new RangeError("Array index out of range");s+=this.byteOffset;var u=new Et.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 Et.Uint8Array(c).buffer),0)}}t.prototype.getUint8=n(Et.Uint8Array),t.prototype.getInt8=n(Et.Int8Array),t.prototype.getUint16=n(Et.Uint16Array),t.prototype.getInt16=n(Et.Int16Array),t.prototype.getUint32=n(Et.Uint32Array),t.prototype.getInt32=n(Et.Int32Array),t.prototype.getFloat32=n(Et.Float32Array),t.prototype.getFloat64=n(Et.Float64Array);function i(o){return function(s,a,u){if(s=Ar.ToUint32(s),s+o.BYTES_PER_ELEMENT>this.byteLength)throw new RangeError("Array index out of range");var c=new o([a]),f=new Et.Uint8Array(c.buffer),h=[],d,g;for(d=0;d<o.BYTES_PER_ELEMENT;d+=1)h.push(r(f,d));!!u==!!e&&h.reverse(),g=new Et.Uint8Array(this.buffer,s,o.BYTES_PER_ELEMENT),g.set(h)}}t.prototype.setUint8=i(Et.Uint8Array),t.prototype.setInt8=i(Et.Int8Array),t.prototype.setUint16=i(Et.Uint16Array),t.prototype.setInt16=i(Et.Int16Array),t.prototype.setUint32=i(Et.Uint32Array),t.prototype.setInt32=i(Et.Int32Array),t.prototype.setFloat32=i(Et.Float32Array),t.prototype.setFloat64=i(Et.Float64Array),Et.DataView=Et.DataView||t})()});var HM=dt((Qne,WM)=>{Se();Ce();Te();var $M=NM().Writable,gX=Ac(),fm=LM();typeof Uint8Array>"u"?rv=jM().Uint8Array:rv=Uint8Array;var rv;function Rc(r,e){if(!(this instanceof Rc))return new Rc(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,$M.call(this,{objectMode:!0}),this.encoding=t,this.shouldInferEncoding=n,e&&this.on("finish",function(){e(this.getBody())}),this.body=[]}WM.exports=Rc;gX(Rc,$M);Rc.prototype._write=function(r,e,t){this.body.push(r),t()};Rc.prototype.inferEncoding=function(r){var e=r===void 0?this.body[0]:r;return We.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"};Rc.prototype.getBody=function(){return!this.encoding&&this.body.length===0?[]:(this.shouldInferEncoding&&(this.encoding=this.inferEncoding()),this.encoding==="array"?wX(this.body):this.encoding==="string"?yX(this.body):this.encoding==="buffer"?bX(this.body):this.encoding==="uint8array"?vX(this.body):this.body)};function mX(r){return/Array\]$/.test(Object.prototype.toString.call(r))}function zM(r){return typeof r=="string"||mX(r)||r&&typeof r.subarray=="function"}function yX(r){for(var e=[],t=!1,n=0;n<r.length;n++){var i=r[n];typeof i=="string"||We.isBuffer(i)?e.push(i):zM(i)?e.push(fm(i)):e.push(fm(String(i)))}return We.isBuffer(r[0])?(e=We.concat(e),e=e.toString("utf8")):e=e.join(""),e}function bX(r){for(var e=[],t=0;t<r.length;t++){var n=r[t];We.isBuffer(n)?e.push(n):zM(n)?e.push(fm(n)):e.push(fm(String(n)))}return We.concat(e)}function wX(r){for(var e=[],t=0;t<r.length;t++)e.push.apply(e,r[t]);return e}function vX(r){for(var e=0,t=0;t<r.length;t++)typeof r[t]=="string"&&(r[t]=fm(r[t])),e+=r[t].length;for(var n=new rv(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 YM=dt(kx=>{Se();Ce();Te();kx.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,d=t?-1:1,g=r[e+h];for(h+=d,o=g&(1<<-f)-1,g>>=-f,f+=a;f>0;o=o*256+r[e+h],h+=d,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=s*256+r[e+h],h+=d,f-=8);if(o===0)o=1-c;else{if(o===u)return s?NaN:(g?-1:1)*(1/0);s=s+Math.pow(2,n),o=o-c}return(g?-1:1)*s*Math.pow(2,o-n)};kx.write=function(r,e,t,n,i,o){var s,a,u,c=o*8-i-1,f=(1<<c)-1,h=f>>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:o-1,y=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+=d/u:e+=d*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+g]=a&255,g+=y,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;r[t+g]=s&255,g+=y,s/=256,c-=8);r[t+g-y]|=v*128}});function _X(){if(!(typeof globalThis.TextDecoder>"u"))return nv??(nv=new globalThis.TextDecoder("utf-8"))}function KM(r,e="utf-8"){switch(e.toLowerCase()){case"utf-8":case"utf8":{let t=_X();return t?t.decode(r):xX(r)}case"utf-16le":return SX(r);case"us-ascii":case"ascii":return TX(r);case"latin1":case"iso-8859-1":return CX(r);case"windows-1252":return RX(r);default:throw new RangeError(`Encoding '${e}' not supported`)}}function Nx(r,e){e.length!==0&&(r.push(String.fromCharCode.apply(null,e)),e.length=0)}function Jr(r,e,t){e.push(t),e.length>=Qh&&Nx(r,e)}function AX(r,e,t){if(t<=65535){Jr(r,e,t);return}t-=65536,Jr(r,e,55296+(t>>10)),Jr(r,e,56320+(t&1023))}function xX(r){let e=[],t=[],n=0;for(r.length>=3&&r[0]===239&&r[1]===187&&r[2]===191&&(n=3);n<r.length;){let i=r[n];if(i<=127){Jr(e,t,i),n++;continue}if(i<194||i>244){Jr(e,t,Xs),n++;continue}if(i<=223){if(n+1>=r.length){Jr(e,t,Xs),n++;continue}let f=r[n+1];if((f&192)!==128){Jr(e,t,Xs),n++;continue}let h=(i&31)<<6|f&63;Jr(e,t,h),n+=2;continue}if(i<=239){if(n+2>=r.length){Jr(e,t,Xs),n++;continue}let f=r[n+1],h=r[n+2];if(!((f&192)===128&&(h&192)===128&&!(i===224&&f<160)&&!(i===237&&f>=160))){Jr(e,t,Xs),n++;continue}let g=(i&15)<<12|(f&63)<<6|h&63;Jr(e,t,g),n+=3;continue}if(n+3>=r.length){Jr(e,t,Xs),n++;continue}let o=r[n+1],s=r[n+2],a=r[n+3];if(!((o&192)===128&&(s&192)===128&&(a&192)===128&&!(i===240&&o<144)&&!(i===244&&o>143))){Jr(e,t,Xs),n++;continue}let c=(i&7)<<18|(o&63)<<12|(s&63)<<6|a&63;AX(e,t,c),n+=4}return Nx(e,t),e.join("")}function SX(r){let e=[],t=[],n=r.length,i=0;for(;i+1<n;){let o=r[i]|r[i+1]<<8;if(i+=2,o>=55296&&o<=56319){if(i+1<n){let s=r[i]|r[i+1]<<8;s>=56320&&s<=57343?(Jr(e,t,o),Jr(e,t,s),i+=2):Jr(e,t,Xs)}else Jr(e,t,Xs);continue}if(o>=56320&&o<=57343){Jr(e,t,Xs);continue}Jr(e,t,o)}return i<n&&Jr(e,t,Xs),Nx(e,t),e.join("")}function TX(r){let e=[];for(let t=0;t<r.length;t+=Qh){let n=Math.min(r.length,t+Qh),i=new Array(n-t);for(let o=t,s=0;o<n;o++,s++)i[s]=r[o]&127;e.push(String.fromCharCode.apply(null,i))}return e.join("")}function CX(r){let e=[];for(let t=0;t<r.length;t+=Qh){let n=Math.min(r.length,t+Qh),i=new Array(n-t);for(let o=t,s=0;o<n;o++,s++)i[s]=r[o];e.push(String.fromCharCode.apply(null,i))}return e.join("")}function RX(r){let e=[],t="";for(let n=0;n<r.length;n++){let i=r[n],o=i>=128&&i<=159?ZM[i]:void 0;t+=o??String.fromCharCode(i),t.length>=Qh&&(e.push(t),t="")}return t&&e.push(t),e.join("")}var ZM,EX,nv,Qh,Xs,JM=bt(()=>{Se();Ce();Te();ZM={128:"\u20AC",130:"\u201A",131:"\u0192",132:"\u201E",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02C6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017D",145:"\u2018",146:"\u2019",147:"\u201C",148:"\u201D",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02DC",153:"\u2122",154:"\u0161",155:"\u203A",156:"\u0153",158:"\u017E",159:"\u0178"},EX={};for(let[r,e]of Object.entries(ZM))EX[e]=Number.parseInt(r,10);Qh=32*1024,Xs=65533});function wi(r){return new DataView(r.buffer,r.byteOffset)}var QM,eB,Dr,Dc,xr,Ox,tB,rB,vi,hm=bt(()=>{Se();Ce();Te();QM=Rl(YM(),1);JM();eB={len:1,get(r,e){return wi(r).getUint8(e)},put(r,e,t){return wi(r).setUint8(e,t),e+1}},Dr={len:2,get(r,e){return wi(r).getUint16(e,!0)},put(r,e,t){return wi(r).setUint16(e,t,!0),e+2}},Dc={len:2,get(r,e){return wi(r).getUint16(e)},put(r,e,t){return wi(r).setUint16(e,t),e+2}},xr={len:4,get(r,e){return wi(r).getUint32(e,!0)},put(r,e,t){return wi(r).setUint32(e,t,!0),e+4}},Ox={len:4,get(r,e){return wi(r).getUint32(e)},put(r,e,t){return wi(r).setUint32(e,t),e+4}},tB={len:4,get(r,e){return wi(r).getInt32(e)},put(r,e,t){return wi(r).setInt32(e,t),e+4}},rB={len:8,get(r,e){return wi(r).getBigUint64(e,!0)},put(r,e,t){return wi(r).setBigUint64(e,t,!0),e+8}},vi=class{constructor(e,t){this.len=e,this.encoding=t}get(e,t=0){let n=e.subarray(t,t+this.len);return KM(n,this.encoding)}}});var IX,Gt,Ic,dm=bt(()=>{Se();Ce();Te();IX="End-Of-Stream",Gt=class extends Error{constructor(){super(IX),this.name="EndOfStreamError"}},Ic=class extends Error{constructor(e="The operation was aborted"){super(e),this.name="AbortError"}}});var nB=bt(()=>{Se();Ce();Te()});var kc,iv=bt(()=>{Se();Ce();Te();dm();kc=class{constructor(){this.endOfStream=!1,this.interrupted=!1,this.peekQueue=[]}async peek(e,t=!1){let n=await this.read(e,t);return this.peekQueue.push(e.subarray(0,n)),n}async read(e,t=!1){if(e.length===0)return 0;let n=this.readFromPeekBuffer(e);if(this.endOfStream||(n+=await this.readRemainderFromStream(e.subarray(n),t)),n===0&&!t)throw new Gt;return n}readFromPeekBuffer(e){let t=e.length,n=0;for(;this.peekQueue.length>0&&t>0;){let i=this.peekQueue.pop();if(!i)throw new Error("peekData should be defined");let o=Math.min(i.length,t);e.set(i.subarray(0,o),n),n+=o,t-=o,o<i.length&&this.peekQueue.push(i.subarray(o))}return n}async readRemainderFromStream(e,t){let n=0;for(;n<e.length&&!this.endOfStream;){if(this.interrupted)throw new Ic;let i=await this.readFromStream(e.subarray(n),t);if(i===0)break;n+=i}if(!t&&n<e.length)throw new Gt;return n}}});var iB=bt(()=>{Se();Ce();Te();dm();nB();iv()});var sv,sB=bt(()=>{Se();Ce();Te();iv();sv=class extends kc{constructor(e){super(),this.reader=e}async abort(){return this.close()}async close(){this.reader.releaseLock()}}});var pm,Lx=bt(()=>{Se();Ce();Te();sB();pm=class extends sv{async readFromStream(e,t){if(e.length===0)return 0;let n=await this.reader.read(new Uint8Array(e.length),{min:t?void 0:e.length});return n.done&&(this.endOfStream=n.done),n.value?(e.set(n.value),n.value.length):0}}});var ed,Px=bt(()=>{Se();Ce();Te();dm();iv();ed=class extends kc{constructor(e){super(),this.reader=e,this.buffer=null}writeChunk(e,t){let n=Math.min(t.length,e.length);return e.set(t.subarray(0,n)),n<t.length?this.buffer=t.subarray(n):this.buffer=null,n}async readFromStream(e,t){if(e.length===0)return 0;let n=0;for(this.buffer&&(n+=this.writeChunk(e,this.buffer));n<e.length&&!this.endOfStream;){let i=await this.reader.read();if(i.done){this.endOfStream=!0;break}i.value&&(n+=this.writeChunk(e.subarray(n),i.value))}if(!t&&n===0&&this.endOfStream)throw new Gt;return n}abort(){return this.interrupted=!0,this.reader.cancel()}async close(){await this.abort(),this.reader.releaseLock()}}});function Fx(r){try{let e=r.getReader({mode:"byob"});return e instanceof ReadableStreamDefaultReader?new ed(e):new pm(e)}catch(e){if(e instanceof TypeError)return new ed(r.getReader());throw e}}var oB=bt(()=>{Se();Ce();Te();Lx();Px()});var Nc=bt(()=>{Se();Ce();Te();dm();iB();Lx();Px();oB()});var ka,gm=bt(()=>{Se();Ce();Te();Nc();ka=class{constructor(e){this.numBuffer=new Uint8Array(8),this.position=0,this.onClose=e?.onClose,e?.abortSignal&&e.abortSignal.addEventListener("abort",()=>{this.abort()})}async readToken(e,t=this.position){let n=new Uint8Array(e.len);if(await this.readBuffer(n,{position:t})<e.len)throw new Gt;return e.get(n,0)}async peekToken(e,t=this.position){let n=new Uint8Array(e.len);if(await this.peekBuffer(n,{position:t})<e.len)throw new Gt;return e.get(n,0)}async readNumber(e){if(await this.readBuffer(this.numBuffer,{length:e.len})<e.len)throw new Gt;return e.get(this.numBuffer,0)}async peekNumber(e){if(await this.peekBuffer(this.numBuffer,{length:e.len})<e.len)throw new Gt;return e.get(this.numBuffer,0)}async ignore(e){if(e<0)throw new RangeError("ignore length must be \u2265 0 bytes");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(){await this.abort(),await this.onClose?.()}normalizeOptions(e,t){if(!this.supportsRandomAccess()&&t&&t.position!==void 0&&t.position<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");return{mayBeLess:!1,offset:0,length:e.length,position:this.position,...t}}abort(){return Promise.resolve()}}});var NX,ov,aB=bt(()=>{Se();Ce();Te();gm();Nc();NX=256e3,ov=class extends ka{constructor(e,t){super(t),this.streamReader=e,this.fileInfo=t?.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.subarray(0,n.length),n.mayBeLess);if(this.position+=o,(!t||!t.mayBeLess)&&o<n.length)throw new Gt;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)),i-o}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.subarray(0,n.length),n.mayBeLess)}catch(o){if(t?.mayBeLess&&o instanceof Gt)return 0;throw o}if(!n.mayBeLess&&i<n.length)throw new Gt}return i}async ignore(e){if(e<0)throw new RangeError("ignore length must be \u2265 0 bytes");let t=Math.min(NX,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}abort(){return this.streamReader.abort()}async close(){return this.streamReader.close()}supportsRandomAccess(){return!1}}});var av,lB=bt(()=>{Se();Ce();Te();Nc();gm();av=class extends ka{constructor(e,t){super(t),this.uint8Array=e,this.fileInfo={...t?.fileInfo??{},size:e.length}}async readBuffer(e,t){t?.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 Gt;return e.set(this.uint8Array.subarray(n.position,n.position+i)),i}close(){return super.close()}supportsRandomAccess(){return!0}setPosition(e){this.position=e}}});var lv,uB=bt(()=>{Se();Ce();Te();Nc();gm();lv=class extends ka{constructor(e,t){super(t),this.blob=e,this.fileInfo={...t?.fileInfo??{},size:e.size,mimeType:e.type}}async readBuffer(e,t){t?.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.blob.size-n.position,n.length);if(!n.mayBeLess&&i<n.length)throw new Gt;let o=await this.blob.slice(n.position,n.position+i).arrayBuffer();return e.set(new Uint8Array(o)),i}close(){return super.close()}supportsRandomAccess(){return!0}setPosition(e){this.position=e}}});function cB(r,e){let t=Fx(r),n=e??{},i=n.onClose;return n.onClose=async()=>{if(await t.close(),i)return i()},new ov(t,n)}function fB(r,e){return new av(r,e)}function hB(r,e){return new lv(r,e)}var dB=bt(()=>{Se();Ce();Te();Nc();aB();lB();uB();Nc();gm()});var gB=dt((goe,pB)=>{Se();Ce();Te();var td=1e3,rd=td*60,nd=rd*60,Oc=nd*24,LX=Oc*7,PX=Oc*365.25;pB.exports=function(r,e){e=e||{};var t=typeof r;if(t==="string"&&r.length>0)return FX(r);if(t==="number"&&isFinite(r))return e.long?BX(r):MX(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function FX(r){if(r=String(r),!(r.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(r);if(e){var t=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return t*PX;case"weeks":case"week":case"w":return t*LX;case"days":case"day":case"d":return t*Oc;case"hours":case"hour":case"hrs":case"hr":case"h":return t*nd;case"minutes":case"minute":case"mins":case"min":case"m":return t*rd;case"seconds":case"second":case"secs":case"sec":case"s":return t*td;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function MX(r){var e=Math.abs(r);return e>=Oc?Math.round(r/Oc)+"d":e>=nd?Math.round(r/nd)+"h":e>=rd?Math.round(r/rd)+"m":e>=td?Math.round(r/td)+"s":r+"ms"}function BX(r){var e=Math.abs(r);return e>=Oc?uv(r,e,Oc,"day"):e>=nd?uv(r,e,nd,"hour"):e>=rd?uv(r,e,rd,"minute"):e>=td?uv(r,e,td,"second"):r+" ms"}function uv(r,e,t,n){var i=e>=t*1.5;return Math.round(r/t)+" "+n+(i?"s":"")}});var yB=dt((woe,mB)=>{Se();Ce();Te();function UX(r){t.debug=t,t.default=t,t.coerce=u,t.disable=s,t.enable=i,t.enabled=a,t.humanize=gB(),t.destroy=c,Object.keys(r).forEach(f=>{t[f]=r[f]}),t.names=[],t.skips=[],t.formatters={};function e(f){let h=0;for(let d=0;d<f.length;d++)h=(h<<5)-h+f.charCodeAt(d),h|=0;return t.colors[Math.abs(h)%t.colors.length]}t.selectColor=e;function t(f){let h,d=null,g,y;function v(...w){if(!v.enabled)return;let b=v,E=Number(new Date),_=E-(h||E);b.diff=_,b.prev=h,b.curr=E,h=E,w[0]=t.coerce(w[0]),typeof w[0]!="string"&&w.unshift("%O");let S=0;w[0]=w[0].replace(/%([a-zA-Z%])/g,(M,I)=>{if(M==="%%")return"%";S++;let q=t.formatters[I];if(typeof q=="function"){let Q=w[S];M=q.call(b,Q),w.splice(S,1),S--}return M}),t.formatArgs.call(b,w),(b.log||t.log).apply(b,w)}return v.namespace=f,v.useColors=t.useColors(),v.color=t.selectColor(f),v.extend=n,v.destroy=t.destroy,Object.defineProperty(v,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(g!==t.namespaces&&(g=t.namespaces,y=t.enabled(f)),y),set:w=>{d=w}}),typeof t.init=="function"&&t.init(v),v}function n(f,h){let d=t(this.namespace+(typeof h>"u"?":":h)+f);return d.log=this.log,d}function i(f){t.save(f),t.namespaces=f,t.names=[],t.skips=[];let h=(typeof f=="string"?f:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let d of h)d[0]==="-"?t.skips.push(d.slice(1)):t.names.push(d)}function o(f,h){let d=0,g=0,y=-1,v=0;for(;d<f.length;)if(g<h.length&&(h[g]===f[d]||h[g]==="*"))h[g]==="*"?(y=g,v=d,g++):(d++,g++);else if(y!==-1)g=y+1,v++,d=v;else return!1;for(;g<h.length&&h[g]==="*";)g++;return g===h.length}function s(){let f=[...t.names,...t.skips.map(h=>"-"+h)].join(",");return t.enable(""),f}function a(f){for(let h of t.skips)if(o(f,h))return!1;for(let h of t.names)if(o(f,h))return!0;return!1}function u(f){return f instanceof Error?f.stack||f.message:f}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return t.enable(t.load()),t}mB.exports=UX});var bB=dt((Ei,cv)=>{Se();Ce();Te();Ei.formatArgs=$X;Ei.save=zX;Ei.load=WX;Ei.useColors=jX;Ei.storage=HX();Ei.destroy=(()=>{let r=!1;return()=>{r||(r=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Ei.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function jX(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let r;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(r=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(r[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function $X(r){if(r[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+r[0]+(this.useColors?"%c ":" ")+"+"+cv.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;r.splice(1,0,e,"color: inherit");let t=0,n=0;r[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(t++,i==="%c"&&(n=t))}),r.splice(n,0,e)}Ei.log=console.debug||console.log||(()=>{});function zX(r){try{r?Ei.storage.setItem("debug",r):Ei.storage.removeItem("debug")}catch{}}function WX(){let r;try{r=Ei.storage.getItem("debug")||Ei.storage.getItem("DEBUG")}catch{}return!r&&typeof $e<"u"&&"env"in $e&&(r=$e.env.DEBUG),r}function HX(){try{return localStorage}catch{}}cv.exports=yB()(Ei);var{formatters:qX}=cv.exports;qX.j=function(r){try{return JSON.stringify(r)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Lc,Mx,wB,vB,EB,_B=bt(()=>{Se();Ce();Te();hm();Lc={LocalFileHeader:67324752,DataDescriptor:134695760,CentralFileHeader:33639248,EndOfCentralDirectory:101010256},Mx={get(r){return{signature:xr.get(r,0),compressedSize:xr.get(r,8),uncompressedSize:xr.get(r,12)}},len:16},wB={get(r){let e=Dr.get(r,6);return{signature:xr.get(r,0),minVersion:Dr.get(r,4),dataDescriptor:!!(e&8),compressedMethod:Dr.get(r,8),compressedSize:xr.get(r,18),uncompressedSize:xr.get(r,22),filenameLength:Dr.get(r,26),extraFieldLength:Dr.get(r,28),filename:null}},len:30},vB={get(r){return{signature:xr.get(r,0),nrOfThisDisk:Dr.get(r,4),nrOfThisDiskWithTheStart:Dr.get(r,6),nrOfEntriesOnThisDisk:Dr.get(r,8),nrOfEntriesOfSize:Dr.get(r,10),sizeOfCd:xr.get(r,12),offsetOfStartOfCd:xr.get(r,16),zipFileCommentLength:Dr.get(r,20)}},len:22},EB={get(r){let e=Dr.get(r,8);return{signature:xr.get(r,0),minVersion:Dr.get(r,6),dataDescriptor:!!(e&8),compressedMethod:Dr.get(r,10),compressedSize:xr.get(r,20),uncompressedSize:xr.get(r,24),filenameLength:Dr.get(r,28),extraFieldLength:Dr.get(r,30),fileCommentLength:Dr.get(r,32),relativeOffsetOfLocalHeader:xr.get(r,42),filename:null}},len:46}});function xB(r){let e=new Uint8Array(xr.len);return xr.put(e,0,r),e}function VX(r,e){let t=r.length,n=e.length;if(n>t)return-1;for(let i=0;i<=t-n;i++){let o=!0;for(let s=0;s<n;s++)if(r[i+s]!==e[s]){o=!1;break}if(o)return i}return-1}function XX(r){let e=r.reduce((i,o)=>i+o.length,0),t=new Uint8Array(e),n=0;for(let i of r)t.set(i,n),n+=i.length;return t}var AB,Ro,Bx,GX,fv,Pc,SB=bt(()=>{Se();Ce();Te();hm();AB=Rl(bB(),1);_B();Ro=(0,AB.default)("tokenizer:inflate"),Bx=256*1024,GX=xB(Lc.DataDescriptor),fv=xB(Lc.EndOfCentralDirectory),Pc=class r{constructor(e){this.tokenizer=e,this.syncBuffer=new Uint8Array(Bx)}async isZip(){return await this.peekSignature()===Lc.LocalFileHeader}peekSignature(){return this.tokenizer.peekToken(xr)}async findEndOfCentralDirectoryLocator(){let e=this.tokenizer,t=Math.min(16*1024,e.fileInfo.size),n=this.syncBuffer.subarray(0,t);await this.tokenizer.readBuffer(n,{position:e.fileInfo.size-t});for(let i=n.length-4;i>=0;i--)if(n[i]===fv[0]&&n[i+1]===fv[1]&&n[i+2]===fv[2]&&n[i+3]===fv[3])return e.fileInfo.size-t+i;return-1}async readCentralDirectory(){if(!this.tokenizer.supportsRandomAccess()){Ro("Cannot reading central-directory without random-read support");return}Ro("Reading central-directory...");let e=this.tokenizer.position,t=await this.findEndOfCentralDirectoryLocator();if(t>0){Ro("Central-directory 32-bit signature found");let n=await this.tokenizer.readToken(vB,t),i=[];this.tokenizer.setPosition(n.offsetOfStartOfCd);for(let o=0;o<n.nrOfEntriesOfSize;++o){let s=await this.tokenizer.readToken(EB);if(s.signature!==Lc.CentralFileHeader)throw new Error("Expected Central-File-Header signature");s.filename=await this.tokenizer.readToken(new vi(s.filenameLength,"utf-8")),await this.tokenizer.ignore(s.extraFieldLength),await this.tokenizer.ignore(s.fileCommentLength),i.push(s),Ro(`Add central-directory file-entry: n=${o+1}/${i.length}: filename=${i[o].filename}`)}return this.tokenizer.setPosition(e),i}this.tokenizer.setPosition(e)}async unzip(e){let t=await this.readCentralDirectory();if(t)return this.iterateOverCentralDirectory(t,e);let n=!1;do{let i=await this.readLocalFileHeader();if(!i)break;let o=e(i);n=!!o.stop;let s;if(await this.tokenizer.ignore(i.extraFieldLength),i.dataDescriptor&&i.compressedSize===0){let a=[],u=Bx;Ro("Compressed-file-size unknown, scanning for next data-descriptor-signature....");let c=-1;for(;c<0&&u===Bx;){u=await this.tokenizer.peekBuffer(this.syncBuffer,{mayBeLess:!0}),c=VX(this.syncBuffer.subarray(0,u),GX);let f=c>=0?c:u;if(o.handler){let h=new Uint8Array(f);await this.tokenizer.readBuffer(h),a.push(h)}else await this.tokenizer.ignore(f)}Ro(`Found data-descriptor-signature at pos=${this.tokenizer.position}`),o.handler&&await this.inflate(i,XX(a),o.handler)}else o.handler?(Ro(`Reading compressed-file-data: ${i.compressedSize} bytes`),s=new Uint8Array(i.compressedSize),await this.tokenizer.readBuffer(s),await this.inflate(i,s,o.handler)):(Ro(`Ignoring compressed-file-data: ${i.compressedSize} bytes`),await this.tokenizer.ignore(i.compressedSize));if(Ro(`Reading data-descriptor at pos=${this.tokenizer.position}`),i.dataDescriptor&&(await this.tokenizer.readToken(Mx)).signature!==134695760)throw new Error(`Expected data-descriptor-signature at position ${this.tokenizer.position-Mx.len}`)}while(!n)}async iterateOverCentralDirectory(e,t){for(let n of e){let i=t(n);if(i.handler){this.tokenizer.setPosition(n.relativeOffsetOfLocalHeader);let o=await this.readLocalFileHeader();if(o){await this.tokenizer.ignore(o.extraFieldLength);let s=new Uint8Array(n.compressedSize);await this.tokenizer.readBuffer(s),await this.inflate(o,s,i.handler)}}if(i.stop)break}}async inflate(e,t,n){if(e.compressedMethod===0)return n(t);if(e.compressedMethod!==8)throw new Error(`Unsupported ZIP compression method: ${e.compressedMethod}`);Ro(`Decompress filename=${e.filename}, compressed-size=${t.length}`);let i=await r.decompressDeflateRaw(t);return n(i)}static async decompressDeflateRaw(e){let t=new ReadableStream({start(o){o.enqueue(e),o.close()}}),n=new DecompressionStream("deflate-raw"),i=t.pipeThrough(n);try{let s=await new Response(i).arrayBuffer();return new Uint8Array(s)}catch(o){let s=o instanceof Error?`Failed to deflate ZIP entry: ${o.message}`:"Unknown decompression error in ZIP entry";throw new TypeError(s)}}async readLocalFileHeader(){let e=await this.tokenizer.peekToken(xr);if(e===Lc.LocalFileHeader){let t=await this.tokenizer.readToken(wB);return t.filename=await this.tokenizer.readToken(new vi(t.filenameLength,"utf-8")),t}if(e===Lc.CentralFileHeader)return!1;throw e===3759263696?new Error("Encrypted ZIP"):new Error("Unexpected signature")}}});var mm,TB=bt(()=>{Se();Ce();Te();mm=class{constructor(e){this.tokenizer=e}inflate(){let e=this.tokenizer;return new ReadableStream({async pull(t){let n=new Uint8Array(1024),i=await e.readBuffer(n,{mayBeLess:!0});if(i===0){t.close();return}t.enqueue(n.subarray(0,i))}}).pipeThrough(new DecompressionStream("gzip"))}}});var CB=bt(()=>{Se();Ce();Te();SB();TB()});function Ux(r){let{byteLength:e}=r;if(e===6)return r.getUint16(0)*2**32+r.getUint32(2);if(e===5)return r.getUint8(0)*2**32+r.getUint32(1);if(e===4)return r.getUint32(0);if(e===3)return r.getUint8(0)*2**16+r.getUint16(1);if(e===2)return r.getUint16(0);if(e===1)return r.getUint8(0)}var Voe,Xoe,Yoe,RB=bt(()=>{Se();Ce();Te();Voe={utf8:new globalThis.TextDecoder("utf8")},Xoe=new globalThis.TextEncoder,Yoe=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"))});function DB(r,e){if(e==="utf-16le"){let t=[];for(let n=0;n<r.length;n++){let i=r.charCodeAt(n);t.push(i&255,i>>8&255)}return t}if(e==="utf-16be"){let t=[];for(let n=0;n<r.length;n++){let i=r.charCodeAt(n);t.push(i>>8&255,i&255)}return t}return[...r].map(t=>t.charCodeAt(0))}function IB(r,e=0){let t=Number.parseInt(new vi(6).get(r,148).replace(/\0.*$/,"").trim(),8);if(Number.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}var kB,NB=bt(()=>{Se();Ce();Te();hm();kB={get:(r,e)=>r[e+3]&127|r[e+2]<<7|r[e+1]<<14|r[e]<<21,len:4}});var OB,LB,PB=bt(()=>{Se();Ce();Te();OB=["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","elf","macho","exe","swf","rtf","wasm","woff","woff2","eot","ttf","otf","ttc","ico","flv","ps","xz","sqlite","nes","crx","xpi","cab","deb","ar","rpm","Z","lz","cfb","mxf","mts","blend","bpg","docx","pptx","xlsx","3gp","3g2","j2c","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","skp","avif","eps","lzh","pgp","asar","stl","chm","3mf","zst","jxl","vcf","jls","pst","dwg","parquet","class","arj","cpio","ace","avro","icc","fbx","vsdx","vtt","apk","drc","lz4","potx","xltx","dotx","xltm","ott","ots","otp","odg","otg","xlsm","docm","dotm","potm","pptm","jar","jmp","rm","sav","ppsm","ppsx","tar.gz","reg","dat"],LB=["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.ms-powerpoint.slideshow.macroenabled.12","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/vnd.openxmlformats-officedocument.presentationml.slideshow","application/zip","application/x-tar","application/x-rar-compressed","application/gzip","application/x-bzip2","application/x-7z-compressed","application/x-apple-diskimage","application/vnd.apache.arrow.file","video/mp4","audio/midi","video/matroska","video/webm","video/quicktime","video/vnd.avi","audio/wav","audio/qcelp","audio/x-ms-asf","video/x-ms-asf","application/vnd.ms-asf","video/mpeg","video/3gpp","audio/mpeg","audio/mp4","video/ogg","audio/ogg","audio/ogg; codecs=opus","application/ogg","audio/flac","audio/ape","audio/wavpack","audio/amr","application/pdf","application/x-elf","application/x-mach-binary","application/x-msdownload","application/x-shockwave-flash","application/rtf","application/wasm","font/woff","font/woff2","application/vnd.ms-fontobject","font/ttf","font/otf","font/collection","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/j2c","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","text/vtt","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","image/jls","application/vnd.ms-outlook","image/vnd.dwg","application/vnd.apache.parquet","application/java-vm","application/x-arj","application/x-cpio","application/x-ace-compressed","application/avro","application/vnd.iccprofile","application/x.autodesk.fbx","application/vnd.visio","application/vnd.android.package-archive","application/vnd.google.draco","application/x-lz4","application/vnd.openxmlformats-officedocument.presentationml.template","application/vnd.openxmlformats-officedocument.spreadsheetml.template","application/vnd.openxmlformats-officedocument.wordprocessingml.template","application/vnd.ms-excel.template.macroenabled.12","application/vnd.oasis.opendocument.text-template","application/vnd.oasis.opendocument.spreadsheet-template","application/vnd.oasis.opendocument.presentation-template","application/vnd.oasis.opendocument.graphics","application/vnd.oasis.opendocument.graphics-template","application/vnd.ms-excel.sheet.macroenabled.12","application/vnd.ms-word.document.macroenabled.12","application/vnd.ms-word.template.macroenabled.12","application/vnd.ms-powerpoint.template.macroenabled.12","application/vnd.ms-powerpoint.presentation.macroenabled.12","application/java-archive","application/vnd.rn-realmedia","application/x-spss-sav","application/x-ms-regedit","application/x-ft-windows-registry-hive","application/x-jmp-data"]});var ZB={};go(ZB,{FileTypeParser:()=>Zl,fileTypeFromBlob:()=>vY,fileTypeFromBuffer:()=>wY,fileTypeFromStream:()=>bY,fileTypeFromTokenizer:()=>DY,fileTypeStream:()=>IY,normalizeSampleSize:()=>YB,reasonableDetectionSizeInBytes:()=>id,supportedExtensions:()=>kY,supportedMimeTypes:()=>NY});function lY(r){let e=r?.streamReader;if(e?.constructor?.name!=="WebStreamByobReader")return r;let{reader:t}=e,n=async()=>{await t.cancel(),t.releaseLock()};return e.close=n,e.abort=async()=>{e.interrupted=!0,await n()},r}function zx(r,e,t){if(!Number.isFinite(r)||r<0||r>e)throw new Na(`${t} has invalid size ${r} (maximum ${e} bytes)`);return r}async function Yl(r,e,{maximumLength:t=vs,reason:n="skip"}={}){let i=zx(e,t,n);await r.ignore(i)}async function $x(r,e,t,{maximumLength:n=e.length,reason:i="read"}={}){let o=t?.length??e.length,s=zx(o,n,i);return r.readBuffer(e,{...t,length:s})}async function uY(r,{maximumLength:e=Io}={}){let i=new ReadableStream({start(c){c.enqueue(r),c.close()}}).pipeThrough(new DecompressionStream("deflate-raw")).getReader(),o=[],s=0;try{for(;;){let{done:c,value:f}=await i.read();if(c)break;if(s+=f.length,s>e)throw await i.cancel(),new Error(`ZIP entry decompressed data exceeds ${e} bytes`);o.push(f)}}finally{i.releaseLock()}let a=new Uint8Array(s),u=0;for(let c of o)a.set(c,u),u+=c.length;return a}function fY(r,e){if(r.length<hv)return-1;let t=r.length-hv;for(let n=0;n<=t;n++)if(xr.get(r,n)===XB&&xr.get(r,n+8)===e+n)return n;return-1}function hY(r){return(r.codePointAt(0)&32)!==0}function dY(r,e){let t=new Uint8Array(e),n=0;for(let i of r)t.set(i,n),n+=i.length;return t}async function pY(r,{shouldBuffer:e,maximumLength:t=Io}={}){let{syncBuffer:n}=r,{length:i}=n,o=[],s=0;for(;;){let a=await r.tokenizer.peekBuffer(n,{mayBeLess:!0}),u=fY(n.subarray(0,a),s),c=u>=0?0:a===i?Math.min(cY,a-1):0,f=u>=0?u:a-c;if(f===0)break;if(s+=f,s>t)throw new Error(`ZIP entry compressed data exceeds ${t} bytes`);if(e){let h=new Uint8Array(f);await r.tokenizer.readBuffer(h),o.push(h)}else await r.tokenizer.ignore(f);if(u>=0)break}if(ei(r.tokenizer)||(r.knownSizeDescriptorScannedBytes+=s),!!e)return dY(o,s)}function gY(r,e){return ei(r.tokenizer)?Math.max(0,vs-(r.tokenizer.position-e)):Math.max(0,Io-r.knownSizeDescriptorScannedBytes)}async function mY(r,e,{shouldBuffer:t,maximumDescriptorLength:n=Io}={}){if(e.dataDescriptor&&e.compressedSize===0)return pY(r,{shouldBuffer:t,maximumLength:n});if(!t){await Yl(r.tokenizer,e.compressedSize,{maximumLength:ei(r.tokenizer)?Io:r.tokenizer.fileInfo.size,reason:"ZIP entry compressed data"});return}let i=xY(r.tokenizer);if(!Number.isFinite(e.compressedSize)||e.compressedSize<0||e.compressedSize>i)throw new Error(`ZIP entry compressed data exceeds ${i} bytes`);let o=new Uint8Array(e.compressedSize);return await r.tokenizer.readBuffer(o),o}function yY(r,e){let t=r.getReader(),n=0,i=!1,o=!1,s=async a=>{i||o||(o=!0,await t.cancel(a))};return new ReadableStream({async pull(a){if(n>=e){a.close(),await s();return}let{done:u,value:c}=await t.read();if(u||!c){i=!0,a.close();return}let f=e-n;if(c.length>f){a.enqueue(c.subarray(0,f)),n+=f,a.close(),await s();return}a.enqueue(c),n+=c.length},async cancel(a){await s(a)}})}async function bY(r,e){return new Zl(e).fromStream(r)}async function wY(r,e){return new Zl(e).fromBuffer(r)}async function vY(r,e){return new Zl(e).fromBlob(r)}function qB(r){switch(r=r.toLowerCase(),r){case"application/epub+zip":return{ext:"epub",mime:r};case"application/vnd.oasis.opendocument.text":return{ext:"odt",mime:r};case"application/vnd.oasis.opendocument.text-template":return{ext:"ott",mime:r};case"application/vnd.oasis.opendocument.spreadsheet":return{ext:"ods",mime:r};case"application/vnd.oasis.opendocument.spreadsheet-template":return{ext:"ots",mime:r};case"application/vnd.oasis.opendocument.presentation":return{ext:"odp",mime:r};case"application/vnd.oasis.opendocument.presentation-template":return{ext:"otp",mime:r};case"application/vnd.oasis.opendocument.graphics":return{ext:"odg",mime:r};case"application/vnd.oasis.opendocument.graphics-template":return{ext:"otg",mime:r};case"application/vnd.openxmlformats-officedocument.presentationml.slideshow":return{ext:"ppsx",mime:r};case"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":return{ext:"xlsx",mime:r};case"application/vnd.ms-excel.sheet.macroenabled":return{ext:"xlsm",mime:"application/vnd.ms-excel.sheet.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.spreadsheetml.template":return{ext:"xltx",mime:r};case"application/vnd.ms-excel.template.macroenabled":return{ext:"xltm",mime:"application/vnd.ms-excel.template.macroenabled.12"};case"application/vnd.ms-powerpoint.slideshow.macroenabled":return{ext:"ppsm",mime:"application/vnd.ms-powerpoint.slideshow.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return{ext:"docx",mime:r};case"application/vnd.ms-word.document.macroenabled":return{ext:"docm",mime:"application/vnd.ms-word.document.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.wordprocessingml.template":return{ext:"dotx",mime:r};case"application/vnd.ms-word.template.macroenabledtemplate":return{ext:"dotm",mime:"application/vnd.ms-word.template.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.presentationml.template":return{ext:"potx",mime:r};case"application/vnd.ms-powerpoint.template.macroenabled":return{ext:"potm",mime:"application/vnd.ms-powerpoint.template.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.presentationml.presentation":return{ext:"pptx",mime:r};case"application/vnd.ms-powerpoint.presentation.macroenabled":return{ext:"pptm",mime:"application/vnd.ms-powerpoint.presentation.macroenabled.12"};case"application/vnd.ms-visio.drawing":return{ext:"vsdx",mime:"application/vnd.visio"};case"application/vnd.ms-package.3dmanufacturing-3dmodel+xml":return{ext:"3mf",mime:"model/3mf"};default:}}function Do(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}function YB(r){return Number.isFinite(r)?Math.max(1,Math.trunc(r)):id}function EY(r,e,t){return t===void 0?r.read(e):(t.throwIfAborted(),new Promise((n,i)=>{let o=()=>{t.removeEventListener("abort",s)},s=()=>{let a=t.reason;o(),(async()=>{try{await r.cancel(a)}catch{}})(),i(a)};t.addEventListener("abort",s,{once:!0}),(async()=>{try{let a=await r.read(e);o(),n(a)}catch(a){o(),i(a)}})()}))}function _Y(r){return Number.isFinite(r)?Math.max(0,Math.min(YX,Math.trunc(r))):0}function AY(r){return Number.isFinite(r)?Math.max(0,r):Number.MAX_SAFE_INTEGER}function ei(r){let e=r.fileInfo.size;return!Number.isFinite(e)||e===Number.MAX_SAFE_INTEGER}function ym(r,e,t){return ei(r)&&r.position-e>t}function xY(r){let e=r.fileInfo.size,t=Number.isFinite(e)?Math.max(0,e-r.position):Number.MAX_SAFE_INTEGER;return Math.min(t,ZX)}function SY(r){if(r instanceof Gt||r instanceof Na)return!0;if(!(r instanceof Error))return!1;if(sY.has(r.message)||aY.has(r.code))return!0;for(let e of oY)if(r.message.startsWith(e))return!0;return!1}function GB(r,e=Io){let t=[r.compressedSize,r.uncompressedSize];for(let n of t)if(!Number.isFinite(n)||n<0||n>e)return!1;return!0}function TY(){return{hasContentTypesEntry:!1,hasParsedContentTypesEntry:!1,isParsingContentTypes:!1,hasUnparseableContentTypes:!1,hasWordDirectory:!1,hasPresentationDirectory:!1,hasSpreadsheetDirectory:!1,hasThreeDimensionalModelEntry:!1}}function CY(r,e){e.startsWith("word/")&&(r.hasWordDirectory=!0),e.startsWith("ppt/")&&(r.hasPresentationDirectory=!0),e.startsWith("xl/")&&(r.hasSpreadsheetDirectory=!0),e.startsWith("3D/")&&e.endsWith(".model")&&(r.hasThreeDimensionalModelEntry=!0)}function VB(r){if(!(!r.hasContentTypesEntry||r.hasUnparseableContentTypes||r.isParsingContentTypes||r.hasParsedContentTypesEntry)){if(r.hasWordDirectory)return{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"};if(r.hasPresentationDirectory)return{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"};if(r.hasSpreadsheetDirectory)return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};if(r.hasThreeDimensionalModelEntry)return{ext:"3mf",mime:"model/3mf"}}}function RY(r){let e=r.indexOf('.main+xml"');if(e===-1){let i="application/vnd.ms-package.3dmanufacturing-3dmodel+xml";return r.includes(`ContentType="${i}"`)?i:void 0}let t=r.slice(0,e),n=t.lastIndexOf('"');return t.slice(n+1)}async function DY(r,e){return new Zl(e).fromTokenizer(r)}async function IY(r,e){return new Zl(e).toDetectionStream(r,e)}var id,YX,Io,FB,ZX,vs,dv,MB,KX,JX,BB,jx,UB,jB,QX,eY,tY,rY,nY,$B,zB,WB,iY,HB,sY,oY,aY,Na,XB,hv,cY,Zl,kY,NY,KB=bt(()=>{Se();Ce();Te();hm();dB();CB();RB();NB();PB();id=4100,YX=id-2,Io=1024*1024,FB=1024,ZX=2**31-1,vs=16*1024*1024,dv=Io,MB=Io,KX=vs,JX=1,BB=100,jx=vs,UB=64,jB=dv,QX=256,eY=512,tY=vs,rY=512,nY=512,$B=256,zB=dv,WB=dv,iY=dv,HB=vs,sY=new Set(["Unexpected signature","Encrypted ZIP","Expected Central-File-Header signature"]),oY=["ZIP entry count exceeds ","Unsupported ZIP compression method:","ZIP entry compressed data exceeds ","ZIP entry decompressed data exceeds ","Expected data-descriptor-signature at position "],aY=new Set(["Z_BUF_ERROR","Z_DATA_ERROR","ERR_INVALID_STATE"]),Na=class extends Error{};XB=134695760,hv=16,cY=hv-1;Pc.prototype.inflate=async function(r,e,t){if(r.compressedMethod===0)return t(e);if(r.compressedMethod!==8)throw new Error(`Unsupported ZIP compression method: ${r.compressedMethod}`);let n=await uY(e,{maximumLength:Io});return t(n)};Pc.prototype.unzip=async function(r){let e=!1,t=0,n=this.tokenizer.position;this.knownSizeDescriptorScannedBytes=0;do{if(ym(this.tokenizer,n,vs))throw new Na(`ZIP stream probing exceeds ${vs} bytes`);let i=await this.readLocalFileHeader();if(!i)break;if(t++,t>FB)throw new Error(`ZIP entry count exceeds ${FB}`);let o=r(i);e=!!o.stop,await this.tokenizer.ignore(i.extraFieldLength);let s=await mY(this,i,{shouldBuffer:!!o.handler,maximumDescriptorLength:Math.min(Io,gY(this,n))});if(o.handler&&await this.inflate(i,s,o.handler),i.dataDescriptor){let a=new Uint8Array(hv);if(await this.tokenizer.readBuffer(a),xr.get(a,0)!==XB)throw new Error(`Expected data-descriptor-signature at position ${this.tokenizer.position-a.length}`)}if(ym(this.tokenizer,n,vs))throw new Na(`ZIP stream probing exceeds ${vs} bytes`)}while(!e)};Zl=class r{constructor(e){He(this,"detectConfident",async e=>{if(this.buffer=new Uint8Array(id),e.fileInfo.size===void 0&&(e.fileInfo.size=Number.MAX_SAFE_INTEGER),this.tokenizer=e,ei(e)&&(await e.peekBuffer(this.buffer,{length:3,mayBeLess:!0}),this.check([31,139,8])))return this.detectGzip(e);if(await e.peekBuffer(this.buffer,{length:32,mayBeLess:!0}),this.check([66,77]))return{ext:"bmp",mime:"image/bmp"};if(this.check([11,119]))return{ext:"ac3",mime:"audio/vnd.dolby.dd-raw"};if(this.check([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(this.check([77,90]))return{ext:"exe",mime:"application/x-msdownload"};if(this.check([37,33]))return await e.peekBuffer(this.buffer,{length:24,mayBeLess:!0}),this.checkString("PS-Adobe-",{offset:2})&&this.checkString(" EPSF-",{offset:14})?{ext:"eps",mime:"application/eps"}:{ext:"ps",mime:"application/postscript"};if(this.check([31,160])||this.check([31,157]))return{ext:"Z",mime:"application/x-compress"};if(this.check([199,113]))return{ext:"cpio",mime:"application/x-cpio"};if(this.check([96,234]))return{ext:"arj",mime:"application/x-arj"};if(this.check([239,187,191]))return this.detectionReentryCount>=$B?void 0:(this.detectionReentryCount++,await this.tokenizer.ignore(3),this.detectConfident(e));if(this.check([71,73,70]))return{ext:"gif",mime:"image/gif"};if(this.check([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(this.check([31,139,8]))return this.detectGzip(e);if(this.check([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(this.checkString("ID3")){await Yl(e,6,{maximumLength:6,reason:"ID3 header prefix"});let t=await e.readToken(kB),n=ei(e);if(!Number.isFinite(t)||t<0||n&&(t>jx||e.position+t>jx))return;if(e.position+t>e.fileInfo.size)return n?void 0:{ext:"mp3",mime:"audio/mpeg"};try{await Yl(e,t,{maximumLength:n?jx:e.fileInfo.size,reason:"ID3 payload"})}catch(i){if(i instanceof Gt)return;throw i}return this.detectionReentryCount>=$B?void 0:(this.detectionReentryCount++,this.parseTokenizer(e,this.detectionReentryCount))}if(this.checkString("MP+"))return{ext:"mpc",mime:"audio/x-musepack"};if((this.buffer[0]===67||this.buffer[0]===70)&&this.check([87,83],{offset:1}))return{ext:"swf",mime:"application/x-shockwave-flash"};if(this.check([255,216,255]))return this.check([247],{offset:3})?{ext:"jls",mime:"image/jls"}:{ext:"jpg",mime:"image/jpeg"};if(this.check([79,98,106,1]))return{ext:"avro",mime:"application/avro"};if(this.checkString("FLIF"))return{ext:"flif",mime:"image/flif"};if(this.checkString("8BPS"))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(this.checkString("MPCK"))return{ext:"mpc",mime:"audio/x-musepack"};if(this.checkString("FORM"))return{ext:"aif",mime:"audio/aiff"};if(this.checkString("icns",{offset:0}))return{ext:"icns",mime:"image/icns"};if(this.check([80,75,3,4])){let t,n=TY();try{await new Pc(e).unzip(i=>{CY(n,i.filename);let o=i.filename==="[Content_Types].xml",s=VB(n);if(!o&&s)return t=s,{stop:!0};switch(i.filename){case"META-INF/mozilla.rsa":return t={ext:"xpi",mime:"application/x-xpinstall"},{stop:!0};case"META-INF/MANIFEST.MF":return t={ext:"jar",mime:"application/java-archive"},{stop:!0};case"mimetype":return GB(i,MB)?{async handler(a){let u=new TextDecoder("utf-8").decode(a).trim();t=qB(u)},stop:!0}:{};case"[Content_Types].xml":return n.hasContentTypesEntry=!0,GB(i,MB)?(n.isParsingContentTypes=!0,{async handler(a){let u=new TextDecoder("utf-8").decode(a),c=RY(u);c&&(t=qB(c)),n.hasParsedContentTypesEntry=!0,n.isParsingContentTypes=!1},stop:!0}):(n.hasUnparseableContentTypes=!0,{});default:return/classes\d*\.dex/.test(i.filename)?(t={ext:"apk",mime:"application/vnd.android.package-archive"},{stop:!0}):{}}})}catch(i){if(!SY(i))throw i;n.isParsingContentTypes&&(n.isParsingContentTypes=!1,n.hasUnparseableContentTypes=!0)}return t??VB(n)??{ext:"zip",mime:"application/zip"}}if(this.checkString("OggS")){await e.ignore(28);let t=new Uint8Array(8);return await e.readBuffer(t),Do(t,[79,112,117,115,72,101,97,100])?{ext:"opus",mime:"audio/ogg; codecs=opus"}:Do(t,[128,116,104,101,111,114,97])?{ext:"ogv",mime:"video/ogg"}:Do(t,[1,118,105,100,101,111,0])?{ext:"ogm",mime:"video/ogg"}:Do(t,[127,70,76,65,67])?{ext:"oga",mime:"audio/ogg"}:Do(t,[83,112,101,101,120,32,32])?{ext:"spx",mime:"audio/ogg"}:Do(t,[1,118,111,114,98,105,115])?{ext:"ogg",mime:"audio/ogg"}:{ext:"ogx",mime:"application/ogg"}}if(this.check([80,75])&&(this.buffer[2]===3||this.buffer[2]===5||this.buffer[2]===7)&&(this.buffer[3]===4||this.buffer[3]===6||this.buffer[3]===8))return{ext:"zip",mime:"application/zip"};if(this.checkString("MThd"))return{ext:"mid",mime:"audio/midi"};if(this.checkString("wOFF")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff",mime:"font/woff"};if(this.checkString("wOF2")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff2",mime:"font/woff2"};if(this.check([212,195,178,161])||this.check([161,178,195,212]))return{ext:"pcap",mime:"application/vnd.tcpdump.pcap"};if(this.checkString("DSD "))return{ext:"dsf",mime:"audio/x-dsf"};if(this.checkString("LZIP"))return{ext:"lz",mime:"application/x-lzip"};if(this.checkString("fLaC"))return{ext:"flac",mime:"audio/flac"};if(this.check([66,80,71,251]))return{ext:"bpg",mime:"image/bpg"};if(this.checkString("wvpk"))return{ext:"wv",mime:"audio/wavpack"};if(this.checkString("%PDF"))return{ext:"pdf",mime:"application/pdf"};if(this.check([0,97,115,109]))return{ext:"wasm",mime:"application/wasm"};if(this.check([73,73])){let t=await this.readTiffHeader(!1);if(t)return t}if(this.check([77,77])){let t=await this.readTiffHeader(!0);if(t)return t}if(this.checkString("MAC "))return{ext:"ape",mime:"audio/ape"};if(this.check([26,69,223,163])){async function t(){let u=await e.peekNumber(eB),c=128,f=0;for(;(u&c)===0&&c!==0;)++f,c>>=1;let h=new Uint8Array(f+1);return await $x(e,h,void 0,{maximumLength:h.length,reason:"EBML field"}),h}async function n(){let u=await t(),c=await t();c[0]^=128>>c.length-1;let f=Math.min(6,c.length),h=new DataView(u.buffer),d=new DataView(c.buffer,c.length-f,f);return{id:Ux(h),len:Ux(d)}}async function i(u){let c=0;for(;u>0;){if(c++,c>QX||ym(e,s,vs))return;let f=e.position,h=await n();if(h.id===17026){if(h.len>UB)return;let d=zx(h.len,UB,"EBML DocType");return(await e.readToken(new vi(d))).replaceAll(/\00.*$/g,"")}if(ei(e)&&(!Number.isFinite(h.len)||h.len<0||h.len>jB)||(await Yl(e,h.len,{maximumLength:ei(e)?jB:e.fileInfo.size,reason:"EBML payload"}),--u,e.position<=f))return}}let o=await n(),s=e.position;switch(await i(o.len)){case"webm":return{ext:"webm",mime:"video/webm"};case"matroska":return{ext:"mkv",mime:"video/matroska"};default:return}}if(this.checkString("SQLi"))return{ext:"sqlite",mime:"application/x-sqlite3"};if(this.check([78,69,83,26]))return{ext:"nes",mime:"application/x-nintendo-nes-rom"};if(this.checkString("Cr24"))return{ext:"crx",mime:"application/x-google-chrome-extension"};if(this.checkString("MSCF")||this.checkString("ISc("))return{ext:"cab",mime:"application/vnd.ms-cab-compressed"};if(this.check([237,171,238,219]))return{ext:"rpm",mime:"application/x-rpm"};if(this.check([197,208,211,198]))return{ext:"eps",mime:"application/eps"};if(this.check([40,181,47,253]))return{ext:"zst",mime:"application/zstd"};if(this.check([127,69,76,70]))return{ext:"elf",mime:"application/x-elf"};if(this.check([33,66,68,78]))return{ext:"pst",mime:"application/vnd.ms-outlook"};if(this.checkString("PAR1")||this.checkString("PARE"))return{ext:"parquet",mime:"application/vnd.apache.parquet"};if(this.checkString("ttcf"))return{ext:"ttc",mime:"font/collection"};if(this.check([254,237,250,206])||this.check([254,237,250,207])||this.check([206,250,237,254])||this.check([207,250,237,254]))return{ext:"macho",mime:"application/x-mach-binary"};if(this.check([4,34,77,24]))return{ext:"lz4",mime:"application/x-lz4"};if(this.checkString("regf"))return{ext:"dat",mime:"application/x-ft-windows-registry-hive"};if(this.checkString("$FL2")||this.checkString("$FL3"))return{ext:"sav",mime:"application/x-spss-sav"};if(this.check([79,84,84,79,0]))return{ext:"otf",mime:"font/otf"};if(this.checkString("#!AMR"))return{ext:"amr",mime:"audio/amr"};if(this.checkString("{\\rtf"))return{ext:"rtf",mime:"application/rtf"};if(this.check([70,76,86,1]))return{ext:"flv",mime:"video/x-flv"};if(this.checkString("IMPM"))return{ext:"it",mime:"audio/x-it"};if(this.checkString("-lh0-",{offset:2})||this.checkString("-lh1-",{offset:2})||this.checkString("-lh2-",{offset:2})||this.checkString("-lh3-",{offset:2})||this.checkString("-lh4-",{offset:2})||this.checkString("-lh5-",{offset:2})||this.checkString("-lh6-",{offset:2})||this.checkString("-lh7-",{offset:2})||this.checkString("-lzs-",{offset:2})||this.checkString("-lz4-",{offset:2})||this.checkString("-lz5-",{offset:2})||this.checkString("-lhd-",{offset:2}))return{ext:"lzh",mime:"application/x-lzh-compressed"};if(this.check([0,0,1,186])){if(this.check([33],{offset:4,mask:[241]}))return{ext:"mpg",mime:"video/MP1S"};if(this.check([68],{offset:4,mask:[196]}))return{ext:"mpg",mime:"video/MP2P"}}if(this.checkString("ITSF"))return{ext:"chm",mime:"application/vnd.ms-htmlhelp"};if(this.check([202,254,186,190])){let t=Ox.get(this.buffer,4),n=Dc.get(this.buffer,6);if(t>0&&t<=30)return{ext:"macho",mime:"application/x-mach-binary"};if(n>30)return{ext:"class",mime:"application/java-vm"}}if(this.checkString(".RMF"))return{ext:"rm",mime:"application/vnd.rn-realmedia"};if(this.checkString("DRACO"))return{ext:"drc",mime:"application/vnd.google.draco"};if(this.check([253,55,122,88,90,0]))return{ext:"xz",mime:"application/x-xz"};if(this.checkString("<?xml "))return{ext:"xml",mime:"application/xml"};if(this.check([55,122,188,175,39,28]))return{ext:"7z",mime:"application/x-7z-compressed"};if(this.check([82,97,114,33,26,7])&&(this.buffer[6]===0||this.buffer[6]===1))return{ext:"rar",mime:"application/x-rar-compressed"};if(this.checkString("solid "))return{ext:"stl",mime:"model/stl"};if(this.checkString("AC")){let t=new vi(4,"latin1").get(this.buffer,2);if(t.match("^d*")&&t>=1e3&&t<=1050)return{ext:"dwg",mime:"image/vnd.dwg"}}if(this.checkString("070707"))return{ext:"cpio",mime:"application/x-cpio"};if(this.checkString("BLENDER"))return{ext:"blend",mime:"application/x-blender"};if(this.checkString("!<arch>"))return await e.ignore(8),await e.readToken(new vi(13,"ascii"))==="debian-binary"?{ext:"deb",mime:"application/x-deb"}:{ext:"ar",mime:"application/x-unix-archive"};if(this.checkString("WEBVTT")&&[`
94
+ `,"\r"," "," ","\0"].some(t=>this.checkString(t,{offset:6})))return{ext:"vtt",mime:"text/vtt"};if(this.check([137,80,78,71,13,10,26,10])){let t={ext:"png",mime:"image/png"},n={ext:"apng",mime:"image/apng"};await e.ignore(8);async function i(){return{length:await e.readToken(tB),type:await e.readToken(new vi(4,"latin1"))}}let o=ei(e),s=e.position,a=0,u=!1;do{if(a++,a>eY||ym(e,s,tY))break;let c=e.position,f=await i();if(f.length<0)return;if(f.type==="IHDR"){if(f.length!==13)return;u=!0}switch(f.type){case"IDAT":return t;case"acTL":return n;default:if(!u&&f.type!=="CgBI")return;if(o&&f.length>zB)return u&&hY(f.type)?t:void 0;try{await Yl(e,f.length+4,{maximumLength:o?zB+4:e.fileInfo.size,reason:"PNG chunk payload"})}catch(h){if(!o&&(h instanceof Na||h instanceof Gt))return t;throw h}}if(e.position<=c)break}while(e.position+8<e.fileInfo.size);return t}if(this.check([65,82,82,79,87,49,0,0]))return{ext:"arrow",mime:"application/vnd.apache.arrow.file"};if(this.check([103,108,84,70,2,0,0,0]))return{ext:"glb",mime:"model/gltf-binary"};if(this.check([102,114,101,101],{offset:4})||this.check([109,100,97,116],{offset:4})||this.check([109,111,111,118],{offset:4})||this.check([119,105,100,101],{offset:4}))return{ext:"mov",mime:"video/quicktime"};if(this.check([73,73,82,79,8,0,0,0,24]))return{ext:"orf",mime:"image/x-olympus-orf"};if(this.checkString("gimp xcf "))return{ext:"xcf",mime:"image/x-xcf"};if(this.checkString("ftyp",{offset:4})&&(this.buffer[8]&96)!==0){let t=new vi(4,"latin1").get(this.buffer,8).replace("\0"," ").trim();switch(t){case"avif":case"avis":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 t.startsWith("3g")?t.startsWith("3g2")?{ext:"3g2",mime:"video/3gpp2"}:{ext:"3gp",mime:"video/3gpp"}:{ext:"mp4",mime:"video/mp4"}}}if(this.checkString(`REGEDIT4\r
95
+ `))return{ext:"reg",mime:"application/x-ms-regedit"};if(this.check([82,73,70,70])){if(this.checkString("WEBP",{offset:8}))return{ext:"webp",mime:"image/webp"};if(this.check([65,86,73],{offset:8}))return{ext:"avi",mime:"video/vnd.avi"};if(this.check([87,65,86,69],{offset:8}))return{ext:"wav",mime:"audio/wav"};if(this.check([81,76,67,77],{offset:8}))return{ext:"qcp",mime:"audio/qcelp"}}if(this.check([73,73,85,0,24,0,0,0,136,231,116,216]))return{ext:"rw2",mime:"image/x-panasonic-rw2"};if(this.check([48,38,178,117,142,102,207,17,166,217])){let t=!1;try{async function n(){let a=new Uint8Array(16);return await $x(e,a,void 0,{maximumLength:a.length,reason:"ASF header GUID"}),{id:a,size:Number(await e.readToken(rB))}}await Yl(e,30,{maximumLength:30,reason:"ASF header prelude"});let i=ei(e),o=e.position,s=0;for(;e.position+24<e.fileInfo.size&&(s++,!(s>rY||ym(e,o,vs)));){let a=e.position,u=await n(),c=u.size-24;if(!Number.isFinite(c)||c<0){t=!0;break}if(Do(u.id,[145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101])){let f=new Uint8Array(16);if(c-=await $x(e,f,void 0,{maximumLength:f.length,reason:"ASF stream type GUID"}),Do(f,[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(Do(f,[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}if(i&&c>WB){t=!0;break}if(await Yl(e,c,{maximumLength:i?WB:e.fileInfo.size,reason:"ASF header payload"}),e.position<=a){t=!0;break}}}catch(n){if(n instanceof Gt||n instanceof Na)ei(e)&&(t=!0);else throw n}return t?void 0:{ext:"asf",mime:"application/vnd.ms-asf"}}if(this.check([171,75,84,88,32,49,49,187,13,10,26,10]))return{ext:"ktx",mime:"image/ktx"};if((this.check([126,16,4])||this.check([126,24,4]))&&this.check([48,77,73,69],{offset:4}))return{ext:"mie",mime:"application/x-mie"};if(this.check([39,10,0,0,0,0,0,0,0,0,0,0],{offset:2}))return{ext:"shp",mime:"application/x-esri-shape"};if(this.check([255,79,255,81]))return{ext:"j2c",mime:"image/j2c"};if(this.check([0,0,0,12,106,80,32,32,13,10,135,10]))switch(await e.ignore(20),await e.readToken(new vi(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(this.check([255,10])||this.check([0,0,0,12,74,88,76,32,13,10,135,10]))return{ext:"jxl",mime:"image/jxl"};if(this.check([254,255]))return this.checkString("<?xml ",{offset:2,encoding:"utf-16be"})?{ext:"xml",mime:"application/xml"}:void 0;if(this.check([208,207,17,224,161,177,26,225]))return{ext:"cfb",mime:"application/x-cfb"};if(await e.peekBuffer(this.buffer,{length:Math.min(256,e.fileInfo.size),mayBeLess:!0}),this.check([97,99,115,112],{offset:36}))return{ext:"icc",mime:"application/vnd.iccprofile"};if(this.checkString("**ACE",{offset:7})&&this.checkString("**",{offset:12}))return{ext:"ace",mime:"application/x-ace-compressed"};if(this.checkString("BEGIN:")){if(this.checkString("VCARD",{offset:6}))return{ext:"vcf",mime:"text/vcard"};if(this.checkString("VCALENDAR",{offset:6}))return{ext:"ics",mime:"text/calendar"}}if(this.checkString("FUJIFILMCCD-RAW"))return{ext:"raf",mime:"image/x-fujifilm-raf"};if(this.checkString("Extended Module:"))return{ext:"xm",mime:"audio/x-xm"};if(this.checkString("Creative Voice File"))return{ext:"voc",mime:"audio/x-voc"};if(this.check([4,0,0,0])&&this.buffer.length>=16){let t=new DataView(this.buffer.buffer).getUint32(12,!0);if(t>12&&this.buffer.length>=t+16)try{let n=new TextDecoder().decode(this.buffer.subarray(16,t+16));if(JSON.parse(n).files)return{ext:"asar",mime:"application/x-asar"}}catch{}}if(this.check([6,14,43,52,2,5,1,1,13,1,2,1,1,2]))return{ext:"mxf",mime:"application/mxf"};if(this.checkString("SCRM",{offset:44}))return{ext:"s3m",mime:"audio/x-s3m"};if(this.check([71])&&this.check([71],{offset:188}))return{ext:"mts",mime:"video/mp2t"};if(this.check([71],{offset:4})&&this.check([71],{offset:196}))return{ext:"mts",mime:"video/mp2t"};if(this.check([66,79,79,75,77,79,66,73],{offset:60}))return{ext:"mobi",mime:"application/x-mobipocket-ebook"};if(this.check([68,73,67,77],{offset:128}))return{ext:"dcm",mime:"application/dicom"};if(this.check([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(this.check([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(this.checkString("Kaydara FBX Binary \0"))return{ext:"fbx",mime:"application/x.autodesk.fbx"};if(this.check([76,80],{offset:34})&&(this.check([0,0,1],{offset:8})||this.check([1,0,2],{offset:8})||this.check([2,0,2],{offset:8})))return{ext:"eot",mime:"application/vnd.ms-fontobject"};if(this.check([6,6,237,245,216,29,70,229,189,49,239,231,254,116,183,29]))return{ext:"indd",mime:"application/x-indesign"};if(this.check([255,255,0,0,7,0,0,0,4,0,0,0,1,0,1,0])||this.check([0,0,255,255,0,0,0,7,0,0,0,4,0,1,0,1]))return{ext:"jmp",mime:"application/x-jmp-data"};if(await e.peekBuffer(this.buffer,{length:Math.min(512,e.fileInfo.size),mayBeLess:!0}),this.checkString("ustar",{offset:257})&&(this.checkString("\0",{offset:262})||this.checkString(" ",{offset:262}))||this.check([0,0,0,0,0,0],{offset:257})&&IB(this.buffer))return{ext:"tar",mime:"application/x-tar"};if(this.check([255,254])){let t="utf-16le";return this.checkString("<?xml ",{offset:2,encoding:t})?{ext:"xml",mime:"application/xml"}:this.check([255,14],{offset:2})&&this.checkString("SketchUp Model",{offset:4,encoding:t})?{ext:"skp",mime:"application/vnd.sketchup.skp"}:this.checkString(`Windows Registry Editor Version 5.00\r
96
+ `,{offset:2,encoding:t})?{ext:"reg",mime:"application/x-ms-regedit"}:void 0}if(this.checkString("-----BEGIN PGP MESSAGE-----"))return{ext:"pgp",mime:"application/pgp-encrypted"}});He(this,"detectImprecise",async e=>{this.buffer=new Uint8Array(id);let t=AY(e.fileInfo.size);if(await e.peekBuffer(this.buffer,{length:Math.min(8,t),mayBeLess:!0}),this.check([0,0,1,186])||this.check([0,0,1,179]))return{ext:"mpg",mime:"video/mpeg"};if(this.check([0,1,0,0,0]))return{ext:"ttf",mime:"font/ttf"};if(this.check([0,0,1,0]))return{ext:"ico",mime:"image/x-icon"};if(this.check([0,0,2,0]))return{ext:"cur",mime:"image/x-icon"};if(await e.peekBuffer(this.buffer,{length:Math.min(2+this.options.mpegOffsetTolerance,t),mayBeLess:!0}),this.buffer.length>=2+this.options.mpegOffsetTolerance)for(let n=0;n<=this.options.mpegOffsetTolerance;++n){let i=this.scanMpeg(n);if(i)return i}});let t=_Y(e?.mpegOffsetTolerance);this.options={...e,mpegOffsetTolerance:t},this.detectors=[...this.options.customDetectors??[],{id:"core",detect:this.detectConfident},{id:"core.imprecise",detect:this.detectImprecise}],this.tokenizerOptions={abortSignal:this.options.signal},this.gzipProbeDepth=0}getTokenizerOptions(){return{...this.tokenizerOptions}}createTokenizerFromWebStream(e){return lY(cB(e,this.getTokenizerOptions()))}async parseTokenizer(e,t=0){this.detectionReentryCount=t;let n=e.position;for(let i of this.detectors){let o;try{o=await i.detect(e)}catch(s){if(s instanceof Gt||s instanceof Na)return;throw s}if(o)return o;if(n!==e.position)return}}async fromTokenizer(e){try{return await this.parseTokenizer(e)}finally{await e.close()}}async fromBuffer(e){if(!(e instanceof Uint8Array||e instanceof ArrayBuffer))throw new TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``);let t=e instanceof Uint8Array?e:new Uint8Array(e);if(t?.length>1)return this.fromTokenizer(fB(t,this.getTokenizerOptions()))}async fromBlob(e){this.options.signal?.throwIfAborted();let t=hB(e,this.getTokenizerOptions());return this.fromTokenizer(t)}async fromStream(e){this.options.signal?.throwIfAborted();let t=this.createTokenizerFromWebStream(e);return this.fromTokenizer(t)}async toDetectionStream(e,t){let n=YB(t?.sampleSize??id),i,o,s=e.getReader({mode:"byob"});try{let{value:c,done:f}=await EY(s,new Uint8Array(n),this.options.signal);if(o=c,!f&&c)try{i=await this.fromBuffer(c.subarray(0,n))}catch(h){if(!(h instanceof Gt))throw h;i=void 0}o=c}finally{s.releaseLock()}let a=new TransformStream({async start(c){c.enqueue(o)},transform(c,f){f.enqueue(c)}}),u=e.pipeThrough(a);return u.fileType=i,u}async detectGzip(e){if(this.gzipProbeDepth>=JX)return{ext:"gz",mime:"application/gzip"};let t=new mm(e),n=yY(t.inflate(),KX),i=ei(e),o,s,a,u;if(i){let c=new AbortController;o=setTimeout(()=>{c.abort(new DOMException(`Operation timed out after ${BB} ms`,"TimeoutError"))},BB),s=this.options.signal===void 0?c.signal:AbortSignal.any([this.options.signal,c.signal]),a=new r({...this.options,signal:s}),a.gzipProbeDepth=this.gzipProbeDepth+1}else this.gzipProbeDepth++;try{u=await(a??this).fromStream(n)}catch(c){if(c?.name==="AbortError"&&s?.reason?.name!=="TimeoutError")throw c}finally{clearTimeout(o),i||this.gzipProbeDepth--}return u?.ext==="tar"?{ext:"tar.gz",mime:"application/gzip"}:{ext:"gz",mime:"application/gzip"}}check(e,t){return Do(this.buffer,e,t)}checkString(e,t){return this.check(DB(e,t?.encoding),t)}async readTiffTag(e){let t=await this.tokenizer.readToken(e?Dc:Dr);switch(await this.tokenizer.ignore(10),t){case 50341:return{ext:"arw",mime:"image/x-sony-arw"};case 50706:return{ext:"dng",mime:"image/x-adobe-dng"};default:}}async readTiffIFD(e){let t=await this.tokenizer.readToken(e?Dc:Dr);if(!(t>nY)&&!(ei(this.tokenizer)&&2+t*12>HB))for(let n=0;n<t;++n){let i=await this.readTiffTag(e);if(i)return i}}async readTiffHeader(e){let t={ext:"tif",mime:"image/tiff"},n=(e?Dc:Dr).get(this.buffer,2),i=(e?Ox:xr).get(this.buffer,4);if(n===42){if(i>=6){if(this.checkString("CR",{offset:8}))return{ext:"cr2",mime:"image/x-canon-cr2"};if(i>=8){let a=(e?Dc:Dr).get(this.buffer,8),u=(e?Dc:Dr).get(this.buffer,10);if(a===28&&u===254||a===31&&u===11)return{ext:"nef",mime:"image/x-nikon-nef"}}}if(ei(this.tokenizer)&&i>iY)return t;let o=ei(this.tokenizer)?HB:this.tokenizer.fileInfo.size;try{await Yl(this.tokenizer,i,{maximumLength:o,reason:"TIFF IFD offset"})}catch(a){if(a instanceof Gt)return;throw a}let s;try{s=await this.readTiffIFD(e)}catch(a){if(a instanceof Gt)return;throw a}return s??t}if(n===43)return t}scanMpeg(e){if(this.check([255,224],{offset:e,mask:[255,224]})){if(this.check([16],{offset:e+1,mask:[22]}))return this.check([8],{offset:e+1,mask:[8]})?{ext:"aac",mime:"audio/aac"}:{ext:"aac",mime:"audio/aac"};if(this.check([2],{offset:e+1,mask:[6]}))return{ext:"mp3",mime:"audio/mpeg"};if(this.check([4],{offset:e+1,mask:[6]}))return{ext:"mp2",mime:"audio/mpeg"};if(this.check([6],{offset:e+1,mask:[6]}))return{ext:"mp1",mime:"audio/mpeg"}}}},kY=new Set(OB),NY=new Set(LB)});var I8={};go(I8,{AbortException:()=>co,AnnotationEditorLayer:()=>$E,AnnotationEditorParamsType:()=>Bt,AnnotationEditorType:()=>At,AnnotationEditorUIManager:()=>Gu,AnnotationLayer:()=>LE,AnnotationMode:()=>bl,AnnotationType:()=>Yr,CSSConstants:()=>cE,ColorPicker:()=>i0,DOMSVGFactory:()=>oh,DrawLayer:()=>zE,FeatureTest:()=>Wr,GlobalWorkerOptions:()=>Ms,ImageKind:()=>Gm,InvalidPDFException:()=>Jp,MathClamp:()=>gn,OPS:()=>Kp,OutputScale:()=>ia,PDFDataRangeTransport:()=>n0,PDFDateString:()=>nh,PDFWorker:()=>ig,PasswordResponses:()=>v3,PermissionFlag:()=>w3,PixelsPerInch:()=>_l,RenderingCancelledException:()=>Qp,ResponseException:()=>ih,SignatureExtractor:()=>Bs,SupportedImageMimeTypes:()=>uE,TextLayer:()=>ng,TouchManager:()=>Qm,Util:()=>at,VerbosityLevel:()=>lb,XfaLayer:()=>Km,applyOpacity:()=>T3,build:()=>M6,createValidAbsoluteUrl:()=>TC,fetchData:()=>og,findContrastColor:()=>C3,getDocument:()=>N6,getFilenameFromUrl:()=>_3,getPdfFilenameFromUrl:()=>A3,getRGB:()=>ag,getUuid:()=>RC,getXfaPageViewport:()=>S3,isDataScheme:()=>ub,isPdfFile:()=>h1,isValidExplicitDest:()=>l6,makeArr:()=>DC,makeMap:()=>f1,makeObj:()=>aE,noContextMenu:()=>us,normalizeUnicode:()=>E3,renderRichText:()=>IC,setLayerDimensions:()=>qu,shadow:()=>_t,stopEvent:()=>Nr,updateUrlHash:()=>CC,version:()=>F6});function LY(r){Number.isInteger(r)&&(l1=r)}function PY(){return l1}function u1(r){l1>=lb.INFOS&&console.info(`Info: ${r}`)}function Tt(r){l1>=lb.WARNINGS&&console.warn(`Warning: ${r}`)}function Xt(r){throw new Error(r)}function Wt(r,e){r||Xt(e)}function FY(r){switch(r?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function TC(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=$Y(r)}catch{}let n=e?URL.parse(r,e):URL.parse(r);return FY(n)?n:null}function CC(r,e,t=!1){let n=URL.parse(r);return n?(n.hash=e,n.href):t&&TC(r,"http://example.com")?r.split("#",1)[0]+`${e?`#${e}`:""}`:""}function Zx(r){return r.substring(r.lastIndexOf("/")+1)}function _t(r,e,t,n=!1){return Object.defineProperty(r,e,{value:t,enumerable:!n,configurable:!0,writable:!1}),t}function MY(r){(typeof r!="object"||r?.length===void 0)&&Xt("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 c1(r){typeof r!="string"&&Xt("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 BY(r){return String.fromCharCode(r>>24&255,r>>16&255,r>>8&255,r&255)}function UY(){let r=new Uint8Array(4);return r[0]=1,new Uint32Array(r.buffer,0,1)[0]===1}function jY(){try{return new Function(""),!0}catch{return!1}}function $Y(r){return decodeURIComponent(escape(r))}function E3(r){return Hx||(Hx=/([\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,JB=new Map([["\uFB05","\u017Ft"]])),r.replaceAll(Hx,(e,t,n)=>t?t.normalize("NFKC"):JB.get(n))}function RC(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();let r=new Uint8Array(32);return crypto.getRandomValues(r),MY(r)}function zY(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 gn(r,e,t){return Math.min(Math.max(r,e),t)}async function og(r,e="text"){if(_m(r,document.baseURI)){let t=await fetch(r);if(!t.ok)throw new Error(t.statusText);switch(e){case"blob":return t.blob();case"bytes":return t.bytes();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==="bytes"?"arraybuffer":e,i.onreadystatechange=()=>{if(i.readyState===XMLHttpRequest.DONE){if(i.status===200||i.status===0){switch(e){case"bytes":t(new Uint8Array(i.response));return;case"blob":case"json":t(i.response);return}t(i.responseText);return}n(new Error(i.statusText))}},i.send(null)})}function ub(r){let e=r.length,t=0;for(;t<e&&r[t].trim()==="";)t++;return r.substring(t,t+5).toLowerCase()==="data:"}function h1(r){return typeof r=="string"&&/\.pdf$/i.test(r)}function _3(r){return[r]=r.split(/[#?]/,1),Zx(r)}function A3(r,e="document.pdf"){if(typeof r!="string")return e;if(ub(r))return Tt('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=Zx(u),/^\.pdf$/i.test(u))?a:u}catch{return a}},o=/\.pdf$/i,s=Zx(n.pathname);if(o.test(s))return i(s);if(n.searchParams.size>0){let a=c=>[...c].findLast(f=>o.test(f)),u=a(n.searchParams.values())??a(n.searchParams.keys());if(u)return i(u)}if(n.hash){let u=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i.exec(n.hash);if(u)return i(u[0])}return e}function _m(r,e){let t=e?URL.parse(r,e):URL.parse(r);return/https?:/.test(t?.protocol??"")}function us(r){r.preventDefault()}function Nr(r){r.preventDefault(),r.stopPropagation()}function x3(r){console.log("Deprecated API usage: "+r)}function S3(r,{scale:e=1,rotation:t=0}){let{width:n,height:i}=r.attributes.style,o=[0,0,parseInt(n),parseInt(i)];return new Jm({viewBox:o,userUnit:1,scale:e,rotation:t})}function ag(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):(Tt(`Not a valid color format: "${r}"`),[0,0,0])}function WY(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,ag(n))}e.remove()}function kr(r){let{a:e,b:t,c:n,d:i,e:o,f:s}=r.getTransform();return[e,t,n,i,o,s]}function ko(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 qu(r,e,t=!1,n=!0){if(e instanceof Jm){let{pageWidth:i,pageHeight:o}=e.rawDims,{style:s}=r,a=Wr.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 T3(r,e,t,n){n=gn(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 QB(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 eS(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 e3(r){return r<=.03928?r/12.92:((r+.055)/1.055)**2.4}function t3(r,e,t){eS(r,t),t.map(e3);let n=.2126*t[0]+.7152*t[1]+.0722*t[2];eS(e,t),t.map(e3);let i=.2126*t[0]+.7152*t[1]+.0722*t[2];return n>i?(n+.05)/(i+.05):(i+.05)/(n+.05)}function C3(r,e){let t=r[0]+r[1]*256+r[2]*65536+e[0]*16777216+e[1]*4294967296+e[2]*1099511627776,n=r3.get(t);if(n)return n;let i=new Float32Array(9),o=i.subarray(0,3),s=i.subarray(3,6);QB(r,s);let a=i.subarray(6,9);QB(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]),t3(s,a,o)<c){let f,h;u?(f=s[2],h=1):(f=0,h=s[2]);let d=.005;for(;h-f>d;){let g=s[2]=(f+h)/2;u===t3(s,a,o)<c?f=g:h=g}s[2]=u?h:f}return eS(s,o),n=at.makeHexColor(Math.round(o[0]*255),Math.round(o[1]*255),Math.round(o[2]*255)),r3.set(t,n),n}function IC({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 Km.render({xfaHtml:r,div:i,intent:"richText"});i.firstElementChild.classList.add("richText",t),n.append(i)}function R3(r){let e=new Path2D;if(!r)return e;for(let t=0,n=r.length;t<n;)switch(r[t++]){case bm.moveTo:e.moveTo(r[t++],r[t++]);break;case bm.lineTo:e.lineTo(r[t++],r[t++]);break;case bm.curveTo:e.bezierCurveTo(r[t++],r[t++],r[t++],r[t++],r[t++],r[t++]);break;case bm.quadraticCurveTo:e.quadraticCurveTo(r[t++],r[t++],r[t++],r[t++]);break;case bm.closePath:e.closePath();break;default:Tt(`Unrecognized drawing path operator: ${r[t-1]}`);break}return e}function L3(r,e,t){for(let n of t)e.addEventListener(n,r[n].bind(r))}function HY(r){if(r instanceof URL)return r;if(typeof r=="string"){if(oi){if(/^[a-z][a-z0-9\-+.]+:/i.test(r))return new URL(r);let t=$e.getBuiltinModule("url");return new URL(t.pathToFileURL(r))}let e=URL.parse(r,window.location);if(e)return e}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function qY(r){if(oi&&typeof We<"u"&&r instanceof We)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 c1(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 pv(r){if(typeof r!="string")return null;if(r.endsWith("/"))return r;throw new Error(`Invalid factory url: "${r}" must include trailing slash.`)}function i3(){}function _i(r){if(r instanceof co||r instanceof Jp||r instanceof oE||r instanceof ih||r instanceof Vm)return r;switch(r instanceof Error||typeof r=="object"&&r!==null||Xt('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),r.name){case"AbortException":return new co(r.message);case"InvalidPDFException":return new Jp(r.message);case"PasswordException":return new oE(r.message,r.code);case"ResponseException":return new ih(r.message,r.status,r.missing);case"UnknownErrorException":return new Vm(r.message,r.details)}return new Vm(r.message,r.toString())}async function kC(r){let t=await $e.getBuiltinModule("fs").promises.readFile(r);return new Uint8Array(t)}function mv(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 WS(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 qx(r,e,t,n,i,o,s,a){let u=e.coords,c=e.colors,f=r.data,h=r.width*4,d;u[t+1]>u[n+1]&&(d=t,t=n,n=d,d=o,o=s,s=d),u[n+1]>u[i+1]&&(d=n,n=i,i=d,d=s,s=a,a=d),u[t+1]>u[n+1]&&(d=t,t=n,n=d,d=o,o=s,s=d);let g=(u[t]+e.offsetX)*e.scaleX,y=(u[t+1]+e.offsetY)*e.scaleY,v=(u[n]+e.offsetX)*e.scaleX,w=(u[n+1]+e.offsetY)*e.scaleY,b=(u[i]+e.offsetX)*e.scaleX,E=(u[i+1]+e.offsetY)*e.scaleY;if(y>=E)return;let _=c[o],S=c[o+1],A=c[o+2],M=c[s],I=c[s+1],q=c[s+2],Q=c[a],Z=c[a+1],ne=c[a+2],L=Math.round(y),$=Math.round(E),X,ie,re,O,x,P,C,j;for(let U=L;U<=$;U++){if(U<w){let te=U<y?0:(y-U)/(y-w);X=g-(g-v)*te,ie=_-(_-M)*te,re=S-(S-I)*te,O=A-(A-q)*te}else{let te;U>E?te=1:w===E?te=0:te=(w-U)/(w-E),X=v-(v-b)*te,ie=M-(M-Q)*te,re=I-(I-Z)*te,O=q-(q-ne)*te}let B;U<y?B=0:U>E?B=1:B=(y-U)/(y-E),x=g-(g-b)*B,P=_-(_-Q)*B,C=S-(S-Z)*B,j=A-(A-ne)*B;let ee=Math.round(Math.min(X,x)),fe=Math.round(Math.max(X,x)),Ee=h*U+ee*4;for(let te=ee;te<=fe;te++)B=(X-te)/(X-x),B<0?B=0:B>1&&(B=1),f[Ee++]=ie-(ie-P)*B|0,f[Ee++]=re-(re-C)*B|0,f[Ee++]=O-(O-j)*B|0,f[Ee++]=255}}function VY(r,e,t){let n=e.coords,i=e.colors,o,s;switch(e.type){case Yx.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++)qx(r,t,n[f],n[f+1],n[f+a],i[f],i[f+1],i[f+a]),qx(r,t,n[f+a+1],n[f+1],n[f+a],i[f+a+1],i[f+1],i[f+a])}break;case Yx.TRIANGLES:for(o=0,s=n.length;o<s;o+=3)qx(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 XY(r){switch(r[0]){case"RadialAxial":return new HS(r);case"Mesh":return new qS(r);case"Dummy":return new GS}throw new Error(`Unknown IR type: ${r[0]}`)}function YY({src:r,srcPos:e=0,dest:t,width:n,height:i,nonBlackColor:o=4294967295,inverseDecode:s=!1}){let a=Wr.isLittleEndian?4278190080:255,[u,c]=s?[o,a]:[a,o],f=n>>3,h=n&7,d=u^c,g=r.length;t=new Uint32Array(t.buffer);let y=0;for(let v=0;v<i;++v){for(let b=e+f;e<b;++e,y+=8){let E=r[e];t[y]=u^-(E>>7&1)&d,t[y+1]=u^-(E>>6&1)&d,t[y+2]=u^-(E>>5&1)&d,t[y+3]=u^-(E>>4&1)&d,t[y+4]=u^-(E>>3&1)&d,t[y+5]=u^-(E>>2&1)&d,t[y+6]=u^-(E>>1&1)&d,t[y+7]=u^-(E&1)&d}if(h===0)continue;let w=e<g?r[e++]:255;for(let b=0;b<h;++b,++y)t[y]=u^-(w>>7-b&1)&d}return{srcPos:e,destPos:y}}function KY(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 bv(r,e,t,n,i,o,s,a,u,c){let[f,h,d,g,y,v]=kr(r);if(h===0&&d===0){let E=s*f+y,_=Math.round(E),S=a*g+v,A=Math.round(S),M=(s+u)*f+y,I=Math.abs(Math.round(M)-_)||1,q=(a+c)*g+v,Q=Math.abs(Math.round(q)-A)||1;return r.setTransform(Math.sign(f),0,0,Math.sign(g),_,A),r.drawImage(e,t,n,i,o,0,0,I,Q),r.setTransform(f,h,d,g,y,v),[I,Q]}if(f===0&&g===0){let E=a*d+y,_=Math.round(E),S=s*h+v,A=Math.round(S),M=(a+c)*d+y,I=Math.abs(Math.round(M)-_)||1,q=(s+u)*h+v,Q=Math.abs(Math.round(q)-A)||1;return r.setTransform(0,Math.sign(h),Math.sign(d),0,_,A),r.drawImage(e,t,n,i,o,0,0,Q,I),r.setTransform(f,h,d,g,y,v),[Q,I]}r.drawImage(e,t,n,i,o,s,a,u,c);let w=Math.hypot(f,h),b=Math.hypot(d,g);return[w*u,b*c]}function f3(r,e){if(e instanceof ImageData){r.putImageData(e,0,0);return}let t=e.height,n=e.width,i=t%Ni,o=(t-i)/Ni,s=i===0?o:o+1,a=r.createImageData(n,Ni),u=0,c,f=e.data,h=a.data,d,g,y,v;if(e.kind===Gm.GRAYSCALE_1BPP){let w=f.byteLength,b=new Uint32Array(h.buffer,0,h.byteLength>>2),E=b.length,_=n+7>>3,S=4294967295,A=Wr.isLittleEndian?4278190080:255;for(d=0;d<s;d++){for(y=d<o?Ni:i,c=0,g=0;g<y;g++){let M=w-u,I=0,q=M>_?n:M*8-7,Q=q&-8,Z=0,ne=0;for(;I<Q;I+=8)ne=f[u++],b[c++]=ne&128?S:A,b[c++]=ne&64?S:A,b[c++]=ne&32?S:A,b[c++]=ne&16?S:A,b[c++]=ne&8?S:A,b[c++]=ne&4?S:A,b[c++]=ne&2?S:A,b[c++]=ne&1?S:A;for(;I<q;I++)Z===0&&(ne=f[u++],Z=128),b[c++]=ne&Z?S:A,Z>>=1}for(;c<E;)b[c++]=0;r.putImageData(a,0,d*Ni)}}else if(e.kind===Gm.RGBA_32BPP){for(g=0,v=n*Ni*4,d=0;d<o;d++)h.set(f.subarray(u,u+v)),u+=v,r.putImageData(a,0,g),g+=Ni;d<s&&(v=n*i*4,h.set(f.subarray(u,u+v)),r.putImageData(a,0,g))}else if(e.kind===Gm.RGB_24BPP)for(y=Ni,v=n*y,d=0;d<s;d++){for(d>=o&&(y=i,v=n*y),c=0,g=v;g--;)h[c++]=f[u++],h[c++]=f[u++],h[c++]=f[u++],h[c++]=255;r.putImageData(a,0,d*Ni)}else throw new Error(`bad image kind: ${e.kind}`)}function h3(r,e){if(e.bitmap){r.drawImage(e.bitmap,0,0);return}let t=e.height,n=e.width,i=t%Ni,o=(t-i)/Ni,s=i===0?o:o+1,a=r.createImageData(n,Ni),u=0,c=e.data,f=a.data;for(let h=0;h<s;h++){let d=h<o?Ni:i;({srcPos:u}=YY({src:c,srcPos:u,dest:f,width:n,height:d,nonBlackColor:0})),r.putImageData(a,0,h*Ni)}}function wm(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 wv(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 d3(r,e){if(e)return!0;at.singularValueDecompose2dScale(r,ss);let t=Math.fround(ia.pixelRatio*_l.PDF_TO_CSS_UNITS);return ss[0]<=t&&ss[1]<=t}function g3(r){return r instanceof Uint8Array&&r.byteLength===r.buffer.byteLength?r.buffer:new Uint8Array(r).buffer}function d1(){for(let r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0}function tZ(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 d=new TextDecoder(f,{fatal:!0}),g=c1(h);h=d.decode(g),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=[],d,g=n("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(d=g.exec(f))!==null;){let[,v,w,b]=d;if(v=parseInt(v,10),v in h){if(v===0)break;continue}h[v]=[w,b]}let y=[];for(let v=0;v<h.length&&v in h;++v){let[w,b]=h[v];b=a(b),w&&(b=unescape(b),v===0&&(b=u(b))),y.push(b)}return y.join("")}function a(f){if(f.startsWith('"')){let h=f.slice(1).split('\\"');for(let d=0;d<h.length;++d){let g=h[d].indexOf('"');g!==-1&&(h[d]=h[d].slice(0,g),h.length=d+1),h[d]=h[d].replaceAll(/\\(.)/g,"$1")}f=h.join('"')}return f}function u(f){let h=f.indexOf("'");if(h===-1)return f;let d=f.slice(0,h),y=f.slice(h+1).replace(/^[^']*'/,"");return i(d,y)}function c(f){return!f.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(f)?f:f.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(h,d,g,y){if(g==="q"||g==="Q")return y=y.replaceAll("_"," "),y=y.replaceAll(/=([0-9a-fA-F]{2})/g,function(v,w){return String.fromCharCode(parseInt(w,16))}),i(d,y);try{y=atob(y)}catch{}return i(d,y)})}return""}function d6(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 p1(r){return URL.parse(r)?.origin??null}function p6({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 g6(r){let e=r.get("Content-Disposition");if(e){let t=tZ(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch{}if(h1(t))return t}return null}function g1(r,e){return new ih(`Unexpected server response (${r}) while retrieving PDF "${e.href}".`,r,r===404||r===0&&e.protocol==="file:")}function m6(r,e){if(r!==e)throw new Error(`Expected range response-origin "${r}" to match "${e}".`)}function y6(r,e,t,n){return fetch(r,{method:"GET",headers:e,signal:n.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"})}function b6(r,e){if(r!==200&&r!==206)throw g1(r,e)}function m1(r){if(r instanceof Uint8Array)return r.buffer;if(r instanceof ArrayBuffer)return r;throw new Error(`getArrayBuffer - unexpected data: ${r}`)}function rZ(r){return typeof r!="string"?r:c1(r).buffer}function C6(r){let{Readable:e}=$e.getBuiltinModule("stream");return typeof e.toWeb=="function"?e.toWeb(r):$e.getBuiltinModule("module").createRequire("")("node-readable-to-web-readable-stream").makeDefaultReadableStreamFromNodeReadable(r)}function N6(r={}){typeof r=="string"||r instanceof URL?r={url:r}:(r instanceof ArrayBuffer||ArrayBuffer.isView(r))&&(r={data:r});let e=new wT,{docId:t}=e,n=r.url?HY(r.url):null,i=r.data?qY(r.data):null,o=r.httpHeaders||null,s=r.withCredentials===!0,a=r.password??null,u=r.range instanceof n0?r.range:null,c=Number.isInteger(r.rangeChunkSize)&&r.rangeChunkSize>0?r.rangeChunkSize:2**16,f=r.worker instanceof ig?r.worker:null,h=r.verbosity,d=typeof r.docBaseUrl=="string"&&!ub(r.docBaseUrl)?r.docBaseUrl:null,g=pv(r.cMapUrl),y=r.cMapPacked!==!1,v=r.CMapReaderFactory||(oi?FS:bE),w=pv(r.iccUrl),b=pv(r.standardFontDataUrl),E=r.StandardFontDataFactory||(oi?MS:EE),_=pv(r.wasmUrl),S=r.WasmFactory||(oi?BS:AE),A=r.stopAtErrors!==!0,M=Number.isInteger(r.maxImageSize)&&r.maxImageSize>-1?r.maxImageSize:-1,I=r.isEvalSupported!==!1,q=typeof r.isOffscreenCanvasSupported=="boolean"?r.isOffscreenCanvasSupported:!oi,Q=typeof r.isImageDecoderSupported=="boolean"?r.isImageDecoderSupported:!oi&&(Wr.platform.isFirefox||!globalThis.chrome),Z=Number.isInteger(r.canvasMaxAreaInBytes)?r.canvasMaxAreaInBytes:-1,ne=typeof r.disableFontFace=="boolean"?r.disableFontFace:oi,L=r.fontExtraProperties===!0,$=r.enableXfa===!0,X=r.ownerDocument||globalThis.document,ie=r.disableRange===!0,re=r.disableStream===!0,O=r.disableAutoFetch===!0,x=r.pdfBug===!0,P=r.CanvasFactory||(oi?PS:IS),C=r.FilterFactory||(oi?LS:kS),j=r.enableHWA===!0,U=r.useWasm!==!1,B=r.pagesMapper||new tS,ee=u?u.length:r.length??NaN,fe=typeof r.useSystemFonts=="boolean"?r.useSystemFonts:!oi&&!ne,Ee=typeof r.useWorkerFetch=="boolean"?r.useWorkerFetch:!!(v===bE&&E===EE&&S===AE&&g&&b&&_&&_m(g,document.baseURI)&&_m(b,document.baseURI)&&_m(_,document.baseURI)),te=null;LY(h);let H={canvasFactory:new P({ownerDocument:X,enableHWA:j}),filterFactory:new C({docId:t,ownerDocument:X}),cMapReaderFactory:Ee?null:new v({baseUrl:g,isCompressed:y}),standardFontDataFactory:Ee?null:new E({baseUrl:b}),wasmFactory:Ee?null:new S({baseUrl:_})};f||(f=ig.create({verbosity:h,port:Ms.workerPort}),e._worker=f);let ae={docId:t,apiVersion:"5.5.207",data:i,password:a,disableAutoFetch:O,rangeChunkSize:c,length:ee,docBaseUrl:d,enableXfa:$,evaluatorOptions:{maxImageSize:M,disableFontFace:ne,ignoreErrors:A,isEvalSupported:I,isOffscreenCanvasSupported:q,isImageDecoderSupported:Q,canvasMaxAreaInBytes:Z,fontExtraProperties:L,useSystemFonts:fe,useWasm:U,useWorkerFetch:Ee,cMapUrl:g,iccUrl:w,standardFontDataUrl:b,wasmUrl:_}},we={ownerDocument:X,pdfBug:x,styleElement:te,enableHWA:j,loadingParams:{disableAutoFetch:O,enableXfa:$}};return f.promise.then(function(){if(e.destroyed)throw new Error("Loading aborted");if(f.destroyed)throw new Error("Worker was destroyed");let xe=f.messageHandler.sendWithPromise("GetDocRequest",ae,i?[i.buffer]:null),V;if(u)V=new rT({pdfDataRangeTransport:u,disableRange:ie,disableStream:re});else if(!i){if(!n)throw new Error("getDocument - no `url` parameter provided.");let F=_m(n)?oT:oi?dT:uT;V=new F({url:n,length:ee,httpHeaders:o,withCredentials:s,rangeChunkSize:c,disableRange:ie,disableStream:re})}return xe.then(F=>{if(e.destroyed)throw new Error("Loading aborted");if(f.destroyed)throw new Error("Worker was destroyed");let oe=new Wc(t,F,f.port),ge=new _T(oe,e,V,we,H,B);e._transport=ge,oe.send("Ready",null)})}).catch(e._capability.reject),e}function b3(r){return Math.floor(Math.max(0,Math.min(1,r))*255).toString(16).padStart(2,"0")}function vm(r){return Math.max(0,Math.min(255,255*r))}var _v,oi,Xx,Av,OY,yae,is,bl,Ym,At,Bt,w3,Yx,hn,Gm,Yr,od,lb,Kp,bm,v3,l1,uh,oE,Vm,Jp,ih,Kx,co,Wr,Wx,wl,xv,Jx,at,Hx,JB,pd,DC,f1,aE,Zm,Km,Oa,jc,_l,Jm,Qp,lE,f0,nh,ia,uE,Qx,cE,r3,As,In,_d,Lo,Hc,Ad,h0,_r,rS,Am,Fc,Sv,Tv,tS,Jl,Ql,xs,Ss,d0,eu,xd,Sd,p0,WE,D3,Bn,I3,k3,ad,xm,Fa,nS,g0,qc,Ba,xl,N3,O3,sS,iS,Gc,Vc,Td,Xc,or,Hn,HE,oS,Cd,m0,qn,Rd,Cv,NC,aS,Zr,tu,y0,Ir,lS,qE,P3,sh,GE,uS,Dd,ji,Id,Br,en,kd,Ts,Nd,Cs,Gn,ru,nu,iu,su,Po,Rs,Yc,b0,w0,Od,v0,Fo,ou,Ld,au,Mo,VE,lu,Pd,E0,uu,Zc,Fd,cu,_0,tn,er,Ua,fu,hu,A0,Md,x0,du,Bo,ja,S0,T0,Ds,st,Rv,cS,F3,M3,B3,Sm,U3,j3,$3,fS,z3,W3,H3,q3,ti,La,G3,V3,hS,X3,Tm,dS,yd,Gu,En,Uo,Ks,Bd,jo,$i,Ud,$o,xi,$a,Kc,zo,pu,uo,Cm,Dv,ri,fE,kn,Is,Jc,yr,C0,gu,ks,mu,yu,Qc,R0,pS,gd,jd,ef,D0,I0,k0,N0,O0,za,tf,Wa,rf,Ha,Vu,Y3,Z3,K3,OC,Qm,nf,Js,Tr,tr,qa,$d,bu,L0,Nn,sf,Ga,Ns,wu,P0,of,zi,F0,af,Va,Wo,zd,Wd,Os,lf,M0,XE,wt,gS,B0,mS,Iv,J3,Q3,yS,kv,bS,e6,t6,r6,wS,n6,vS,i6,s6,o6,ES,Rm,St,br,_S,n3,Es,No,hE,e0,uf,cf,Xa,On,YE,a6,t0,U0,dE,Hd,AS,ar,xS,qd,Gd,j0,Vd,Nv,bd,pE,vu,Ho,ff,hf,Dm,wd,gE,Xd,Yd,Zd,Kd,Wi,qo,$0,lr,zr,Ys,Ov,Im,Ct,SS,z0,W0,H0,q0,G0,V0,X0,Y0,mr,TS,Jd,CS,RS,GY,l6,Ya,ZE,DS,gv,Qr,Qd,js,u6,c6,f6,Lv,Wc,Z0,mE,IS,yE,bE,wE,df,ep,Za,Ka,Vn,pf,gf,ct,Wn,km,ld,Pv,ud,h6,NS,cd,Nm,Om,OS,Lm,kS,vE,EE,_E,AE,LS,PS,FS,MS,BS,sd,s3,o3,US,tp,Eu,jS,yv,Si,Ti,mf,Qs,yf,Ja,rr,ur,Qa,Ci,K0,rp,bf,wf,el,Xn,Go,J0,zS,$S,gr,Ur,eo,np,ip,LC,xE,_s,Fn,r0,HS,qS,GS,a3,KE,VS,l3,u3,ZY,c3,Ni,Gx,ss,md,XS,SE,JY,QY,eZ,p3,fo,YS,ZS,KS,PC,Ed,Q0,ey,Ms,sp,ty,JS,fd,ry,ny,iy,op,QS,_u,cr,ap,lp,sy,tT,eT,oy,ay,eg,tg,rg,ly,nT,rT,uy,iT,cy,sT,oT,aT,lT,Vx,m3,Vo,sg,w6,v6,uT,fy,sa,E6,_6,A6,x6,cT,hy,Sl,S6,T6,hT,fT,dT,pT,gT,Pm,nZ,to,dy,mT,TE,iZ,y3,Au,Ri,py,gy,vf,tl,my,yy,Ef,by,up,xu,cp,wy,fp,_f,vy,Ey,hp,Af,_y,dp,pp,Tl,R6,D6,yT,ls,Fv,bT,I6,k6,Dn,ng,sZ,JE,QE,wT,gp,Ay,xy,Sy,n0,vT,rl,mp,xf,Fm,ET,Su,ro,nl,Sf,e1,Tf,Cf,ai,Mv,O6,L6,Mm,yp,Bv,Sr,ig,Hi,Rf,il,Di,Xo,bp,sl,wp,as,P6,Bm,Uv,_T,AT,Tu,Df,$c,xT,F6,M6,qi,If,vp,pn,Ty,Ep,ol,Cy,Cu,no,Ry,fr,ST,TT,CT,Mc,B6,Kl,Ai,i0,Yo,Dy,_p,Iy,zc,CE,RE,RT,oh,oZ,ah,aZ,Xm,kf,Ap,Ls,ky,DT,FC,Or,IT,os,Bc,U6,j6,s0,kT,Al,NT,OT,LT,DE,PT,FT,Ny,MT,o0,Gi,Ru,t1,r1,xp,Sp,jr,Zo,Du,Nf,Tp,Cp,Ko,Vi,al,ll,$r,ul,Iu,Oy,cl,Rp,Of,ku,_n,Nu,Dt,jv,UT,jT,$T,$v,zT,$6,z6,W6,H6,zv,Wv,WT,BT,IE,Ly,HT,Py,qT,Fy,GT,My,kE,VT,XT,By,Lf,Uy,YT,a0,NE,ZT,KT,JT,OE,jy,$y,eC,QT,Pf,Ff,Dp,Ou,zy,Mf,Xi,Wy,vl,Hv,tC,MC,LE,vv,Yi,Hy,Bf,Zi,rn,q6,G6,V6,qv,El,Gv,Vv,X6,nC,Y6,Er,rC,ut,Ki,io,Ip,kp,Jo,Lt,Uf,jf,qy,Gy,Np,Op,Lu,Vy,n1,i1,mn,Um,Z6,K6,J6,Q6,e8,t8,Ma,PE,Lp,$f,fl,Xy,Ji,Yy,Kr,s1,r8,FE,Zy,Ky,Jy,Pu,so,li,n8,Xv,i8,s8,iC,l0,Qy,Pp,sC,u0,oC,Fp,eb,hl,zf,tb,Ii,rb,nb,Wf,Qi,es,Ln,Mp,Bp,Yn,Up,Ps,ib,Rt,aC,Yv,o8,a8,l8,lC,Uc,Us,hd,u8,Zv,Kv,c8,f8,h8,d8,p8,Vt,ME,Hf,BE,ts,jp,An,qf,Gf,$t,uC,cC,fC,jm,g8,Jv,$m,dd,Mt,UE,Qo,xn,Sn,Vf,$p,ni,Pn,Fs,Xf,Yf,Zf,zp,Qv,hC,ii,sb,ob,rs,ea,ta,Wp,Hp,Kf,Mn,Pa,m8,y8,b8,lh,jE,o1,w8,vd,dC,c0,Ev,Em,Jf,Kt,pC,oo,v8,E8,gC,eE,_8,A8,x8,mC,yC,S8,Bs,bC,wC,Fu,ra,Mu,Qf,Ui,vC,Cr,Tn,Bu,dl,Uu,qp,pl,eh,na,ns,Gp,zt,Wm,Hm,tE,rE,nE,EC,iE,T8,zm,th,Vp,ju,$u,gl,ki,zu,Xp,Yp,ao,ml,Cn,yl,Wu,Zp,ht,Hu,nr,qm,C8,Oo,_C,AC,sE,Zs,$E,lo,si,rh,ab,a1,R8,oa,xC,D8,SC,dn,zE,k8=bt(()=>{Se();Ce();Te();_v={};_v.d=(r,e)=>{for(var t in e)_v.o(e,t)&&!_v.o(r,t)&&Object.defineProperty(r,t,{enumerable:!0,get:e[t]})};_v.o=(r,e)=>Object.prototype.hasOwnProperty.call(r,e);oi=typeof $e=="object"&&$e+""=="[object process]"&&!$e.versions.nw&&!($e.versions.electron&&$e.type&&$e.type!=="browser"),Xx=[.001,0,0,.001,0,0],Av=1.35,OY=.35,yae=OY/Av,is={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},bl={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},Ym="pdfjs_internal_editor_",At={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,POPUP:16,SIGNATURE:101,COMMENT:102},Bt={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},w3={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},Yx={TRIANGLES:1,LATTICE:2,PATCH:3},hn={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},Gm={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},Yr={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},od={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},lb={ERRORS:0,WARNINGS:1,INFOS:5},Kp={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},bm={moveTo:0,lineTo:1,curveTo:2,quadraticCurveTo:3,closePath:4},v3={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},l1=lb.WARNINGS;uh=(function(){function e(t,n){this.message=t,this.name=n}return e.prototype=new Error,e.constructor=e,e})(),oE=class extends uh{constructor(e,t){super(e,"PasswordException"),this.code=t}},Vm=class extends uh{constructor(e,t){super(e,"UnknownErrorException"),this.details=t}},Jp=class extends uh{constructor(e){super(e,"InvalidPDFException")}},ih=class extends uh{constructor(e,t,n){super(e,"ResponseException"),this.status=t,this.missing=n}},Kx=class extends uh{constructor(e){super(e,"FormatError")}},co=class extends uh{constructor(e){super(e,"AbortException")}};Wr=class{static get isLittleEndian(){return _t(this,"isLittleEndian",UY())}static get isEvalSupported(){return _t(this,"isEvalSupported",jY())}static get isOffscreenCanvasSupported(){return _t(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get isImageDecoderSupported(){return _t(this,"isImageDecoderSupported",typeof ImageDecoder<"u")}static get isFloat16ArraySupported(){return _t(this,"isFloat16ArraySupported",typeof Float16Array<"u")}static get isSanitizerSupported(){return _t(this,"isSanitizerSupported",typeof Sanitizer<"u")}static get platform(){let{platform:e,userAgent:t}=navigator;return _t(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 _t(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}},Wx=Array.from(Array(256).keys(),r=>r.toString(16).padStart(2,"0")),at=class{static makeHexColor(e,t,n){return`#${Wx[e]}${Wx[t]}${Wx[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],d=e[n+f+1];e[n+f]=h*i+d*s+u,e[n+f+1]=h*o+d*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],d=e[2],g=e[3],y=i*f+u,v=y,w=i*d+u,b=w,E=a*h+c,_=E,S=a*g+c,A=S;if(o!==0||s!==0){let M=o*f,I=o*d,q=s*h,Q=s*g;y+=q,b+=q,w+=Q,v+=Q,E+=M,A+=M,S+=I,_+=I}n[0]=Math.min(n[0],y,w,v,b),n[1]=Math.min(n[1],E,S,_,A),n[2]=Math.max(n[2],y,w,v,b),n[3]=Math.max(n[3],E,S,_,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),Y(this,wl,Jx).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),Y(this,wl,Jx).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)}};wl=new WeakSet,xv=function(e,t,n,i,o,s,a,u,c,f){if(c<=0||c>=1)return;let h=1-c,d=c*c,g=d*c,y=h*(h*(h*e+3*c*t)+3*d*n)+g*i,v=h*(h*(h*o+3*c*s)+3*d*a)+g*u;f[0]=Math.min(f[0],y),f[1]=Math.min(f[1],v),f[2]=Math.max(f[2],y),f[3]=Math.max(f[3],v)},Jx=function(e,t,n,i,o,s,a,u,c,f,h,d){if(Math.abs(c)<1e-12){Math.abs(f)>=1e-12&&Y(this,wl,xv).call(this,e,t,n,i,o,s,a,u,-h/f,d);return}let g=f**2-4*h*c;if(g<0)return;let y=Math.sqrt(g),v=2*c;Y(this,wl,xv).call(this,e,t,n,i,o,s,a,u,(-f+y)/v,d),Y(this,wl,xv).call(this,e,t,n,i,o,s,a,u,(-f-y)/v,d)},W(at,wl);Hx=null,JB=null;pd="pdfjs_internal_id_";DC=()=>[],f1=()=>new Map,aE=()=>Object.create(null);typeof Math.sumPrecise!="function"&&(Math.sumPrecise=function(r){return r.reduce((e,t)=>e+t,0)});Zm=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")}},Km=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&&Zm.shouldBuildText(i.name)&&c.push(h)}return{textDivs:c}}let f=[[i,-1,s]];for(;f.length>0;){let[h,d,g]=f.at(-1);if(d+1===h.children.length){f.pop();continue}let y=h.children[++f.at(-1)[1]];if(y===null)continue;let{name:v}=y;if(v==="#text"){let b=document.createTextNode(y.value);c.push(b),g.append(b);continue}let w=y?.attributes?.xmlns?document.createElementNS(y.attributes.xmlns,v):document.createElement(v);if(g.append(w),y.attributes&&this.setAttributes({html:w,element:y,storage:t,intent:o,linkService:n}),y.children?.length>0)f.push([y,-1,w]);else if(y.value){let b=document.createTextNode(y.value);a&&Zm.shouldBuildText(v)&&c.push(b),w.append(b)}}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}},Oa="http://www.w3.org/2000/svg",jc=class jc{};He(jc,"CSS",96),He(jc,"PDF",72),He(jc,"PDF_TO_CSS_UNITS",jc.CSS/jc.PDF);_l=jc;Jm=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,d,g;switch(i%=360,i<0&&(i+=360),i){case 180:f=-1,h=0,d=0,g=1;break;case 90:f=0,h=1,d=1,g=0;break;case 270:f=0,h=-1,d=-1,g=0;break;case 0:f=1,h=0,d=0,g=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}a&&(d=-d,g=-g);let y,v,w,b;f===0?(y=Math.abs(c-e[1])*n+o,v=Math.abs(u-e[0])*n+s,w=(e[3]-e[1])*n,b=(e[2]-e[0])*n):(y=Math.abs(u-e[0])*n+o,v=Math.abs(c-e[1])*n+s,w=(e[2]-e[0])*n,b=(e[3]-e[1])*n),this.transform=[f*n,h*n,d*n,g*n,y-f*n*u-d*n*c,v-h*n*u-g*n*c],this.width=w,this.height=b}get rawDims(){let e=this.viewBox;return _t(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 at.applyTransform(n,this.transform),n}convertToViewportRectangle(e){let t=[e[0],e[1]];at.applyTransform(t,this.transform);let n=[e[2],e[3]];return at.applyTransform(n,this.transform),[t[0],t[1],n[0],n[1]]}convertToPdfPoint(e,t){let n=[e,t];return at.applyInverseTransform(n,this.transform),n}},Qp=class extends uh{constructor(e,t=0){super(e,"RenderingCancelledException"),this.extraDelay=t}};lE=class{constructor(){He(this,"started",Object.create(null));He(this,"times",[])}time(e){e in this.started&&Tt(`Timer is already running for ${e}`),this.started[e]=Date.now()}timeEnd(e){e in this.started||Tt(`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
97
+ `);return e.join("")}};nh=class{static toDateObject(e){if(e instanceof Date)return e;if(!e||typeof e!="string")return null;l(this,f0)||N(this,f0,new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));let t=l(this,f0).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))}};f0=new WeakMap,W(nh,f0);ia=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}},uE=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"],Qx=class{static get isDarkMode(){return _t(this,"isDarkMode",!!window?.matchMedia?.("(prefers-color-scheme: dark)").matches)}},cE=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(),_t(this,"commentForegroundColor",ag(n))}};r3=new Map;tS=class{constructor(){W(this,_r);W(this,As,null);W(this,In,null);W(this,_d,null);W(this,Lo,0);W(this,Hc,[]);W(this,Ad,null);W(this,h0,null)}get pagesNumber(){return l(this,Lo)}set pagesNumber(e){l(this,Lo)!==e&&(N(this,Lo,e),Y(this,_r,rS).call(this))}addListener(e){l(this,Hc).push(e)}removeListener(e){let t=l(this,Hc).indexOf(e);t>=0&&l(this,Hc).splice(t,1)}movePages(e,t,n){Y(this,_r,Fc).call(this,!0);let i=l(this,In),o=l(this,As),s=t.length,a=new Uint32Array(s),u=0;for(let d=0;d<s;d++){let g=t[d]-1;a[d]=i[g],g<n&&(u+=1)}let c=l(this,Lo),f=n-u,h=c-s;f=gn(f,0,h);for(let d=0,g=0;d<c;d++)e.has(d+1)||(i[g++]=i[d]);i.copyWithin(f+s,f,h),i.set(a,f),Y(this,_r,Tv).call(this,o,null),Y(this,_r,Sv).call(this),Y(this,_r,Am).call(this,{type:"move"}),i.every((d,g)=>d===g+1)&&Y(this,_r,rS).call(this)}deletePages(e){Y(this,_r,Fc).call(this,!0);let t=l(this,In),n=l(this,As);this.pagesNumber-=e.length,Y(this,_r,Fc).call(this,!1);let i=l(this,In),o=0,s=0;for(let a of e){let u=a-1;u!==o&&(i.set(t.subarray(o,u),s),s+=u-o),o=u+1}o<t.length&&i.set(t.subarray(o),s),Y(this,_r,Tv).call(this,n,null),Y(this,_r,Sv).call(this),Y(this,_r,Am).call(this,{type:"delete",pageNumbers:e})}copyPages(e){Y(this,_r,Fc).call(this,!0),N(this,h0,e),N(this,Ad,e.map(t=>l(this,In)[t-1])),Y(this,_r,Am).call(this,{type:"copy",pageNumbers:e})}pastePages(e){Y(this,_r,Fc).call(this,!0);let t=l(this,In),n=l(this,As),i=l(this,h0),o=new Map,s=e;for(let u of i)o.set(++s,u);this.pagesNumber+=i.length,Y(this,_r,Fc).call(this,!1);let a=l(this,In);a.set(t.subarray(0,e),0),a.set(l(this,Ad),e),a.set(t.subarray(e),e+i.length),Y(this,_r,Tv).call(this,n,o),Y(this,_r,Sv).call(this),Y(this,_r,Am).call(this,{type:"paste"}),N(this,Ad,null)}hasBeenAltered(){return l(this,In)!==null}getPageMappingForSaving(){let e=l(this,As),t=0;for(let i of e.values())t=Math.max(t,i.length);let n=new Array(t);for(let i=0;i<t;i++)n[i]={document:null,pageIndices:[],includePages:[]};for(let[i,o]of e)for(let s=0,a=o.length;s<a;s++)n[s].includePages.push([i-1,o[s]-1]);for(let{includePages:i,pageIndices:o}of n){i.sort((s,a)=>s[0]-a[0]);for(let s=0,a=i.length;s<a;s++)o.push(i[s][1]),i[s]=i[s][0]}return n}getPrevPageNumber(e){return l(this,_d)[e-1]??0}getPageNumber(e){return l(this,As)?l(this,As).get(e)?.[0]??0:e}getPageId(e){return l(this,In)?.[e-1]??e}getMapping(){return l(this,In).subarray(0,this.pagesNumber)}};As=new WeakMap,In=new WeakMap,_d=new WeakMap,Lo=new WeakMap,Hc=new WeakMap,Ad=new WeakMap,h0=new WeakMap,_r=new WeakSet,rS=function(){N(this,In,null),N(this,As,null)},Am=function(e){for(let t of l(this,Hc))t(e)},Fc=function(e){if(l(this,In))return;let t=l(this,Lo),n=N(this,In,new Uint32Array(t));N(this,_d,new Int32Array(n));let i=N(this,As,new Map);if(e)for(let o=1;o<=t;o++)n[o-1]=o,i.set(o,[o])},Sv=function(){let e=l(this,As),t=l(this,In);e.clear();for(let n=0,i=l(this,Lo);n<i;n++){let o=t[n],s=e.get(o);s?s.push(n+1):e.set(o,[n+1])}},Tv=function(e,t){let n=l(this,_d),i=l(this,In),o=new Map;for(let s=0,a=l(this,Lo);s<a;s++){let u=t?.get(s+1);if(u){n[s]=-u;continue}let c=i[s],f=o.get(c)||0;n[s]=e.get(c)?.[f],o.set(c,f+1)}};Fa=class Fa{constructor(e){W(this,Bn);W(this,Jl,null);W(this,Ql,null);W(this,xs);W(this,Ss,null);W(this,d0,null);W(this,eu,null);W(this,xd,null);W(this,Sd,null);N(this,xs,e),l(Fa,p0)||N(Fa,p0,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=N(this,Jl,document.createElement("div"));e.classList.add("editToolbar","hidden"),e.setAttribute("role","toolbar");let t=l(this,xs)._uiManager._signal;t instanceof AbortSignal&&!t.aborted&&(e.addEventListener("contextmenu",us,{signal:t}),e.addEventListener("pointerdown",Y(Fa,WE,D3),{signal:t}));let n=N(this,Ss,document.createElement("div"));n.className="buttons",e.append(n);let i=l(this,xs).toolbarPosition;if(i){let{style:o}=e,s=l(this,xs)._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,Jl)}hide(){l(this,Jl).classList.add("hidden"),l(this,Ql)?.hideDropdown()}show(){l(this,Jl).classList.remove("hidden"),l(this,d0)?.shown(),l(this,eu)?.shown()}addDeleteButton(){let{editorType:e,_uiManager:t}=l(this,xs),n=document.createElement("button");n.classList.add("basic","deleteButton"),n.tabIndex=0,n.setAttribute("data-l10n-id",l(Fa,p0)[e]),Y(this,Bn,ad).call(this,n)&&n.addEventListener("click",i=>{t.delete()},{signal:t._signal}),l(this,Ss).append(n)}async addAltText(e){let t=await e.render();Y(this,Bn,ad).call(this,t),l(this,Ss).append(t,l(this,Bn,xm)),N(this,d0,e)}addComment(e,t=null){if(l(this,eu))return;let n=e.renderForToolbar();if(!n)return;Y(this,Bn,ad).call(this,n);let i=N(this,xd,l(this,Bn,xm));t?(l(this,Ss).insertBefore(n,t),l(this,Ss).insertBefore(i,t)):l(this,Ss).append(n,i),N(this,eu,e),e.toolbar=this}addColorPicker(e){if(l(this,Ql))return;N(this,Ql,e);let t=e.renderButton();Y(this,Bn,ad).call(this,t),l(this,Ss).append(t,l(this,Bn,xm))}async addEditSignatureButton(e){let t=N(this,Sd,await e.renderEditButton(l(this,xs)));Y(this,Bn,ad).call(this,t),l(this,Ss).append(t,l(this,Bn,xm))}removeButton(e){e==="comment"&&(l(this,eu)?.removeToolbarCommentButton(),N(this,eu,null),l(this,xd)?.remove(),N(this,xd,null))}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,Ss).querySelector(n);i&&e==="comment"&&this.addComment(t,i)}updateEditSignatureButton(e){l(this,Sd)&&(l(this,Sd).title=e)}remove(){l(this,Jl).remove(),l(this,Ql)?.destroy(),N(this,Ql,null)}};Jl=new WeakMap,Ql=new WeakMap,xs=new WeakMap,Ss=new WeakMap,d0=new WeakMap,eu=new WeakMap,xd=new WeakMap,Sd=new WeakMap,p0=new WeakMap,WE=new WeakSet,D3=function(e){e.stopPropagation()},Bn=new WeakSet,I3=function(e){l(this,xs)._focusEventsAllowed=!1,Nr(e)},k3=function(e){l(this,xs)._focusEventsAllowed=!0,Nr(e)},ad=function(e){let t=l(this,xs)._uiManager._signal;return!(t instanceof AbortSignal)||t.aborted?!1:(e.addEventListener("focusin",Y(this,Bn,I3).bind(this),{capture:!0,signal:t}),e.addEventListener("focusout",Y(this,Bn,k3).bind(this),{capture:!0,signal:t}),e.addEventListener("contextmenu",us,{signal:t}),!0)},xm=function(){let e=document.createElement("div");return e.className="divider",e},W(Fa,WE),W(Fa,p0,null);nS=Fa,iS=class{constructor(e){W(this,xl);W(this,g0,null);W(this,qc,null);W(this,Ba);N(this,Ba,e)}show(e,t,n){let[i,o]=Y(this,xl,O3).call(this,t,n),{style:s}=l(this,qc)||N(this,qc,Y(this,xl,N3).call(this));e.append(l(this,qc)),s.insetInlineEnd=`${100*i}%`,s.top=`calc(${100*o}% + var(--editor-toolbar-vert-offset))`}hide(){l(this,qc).remove()}};g0=new WeakMap,qc=new WeakMap,Ba=new WeakMap,xl=new WeakSet,N3=function(){let e=N(this,qc,document.createElement("div"));e.className="editToolbar",e.setAttribute("role","toolbar");let t=l(this,Ba)._signal;t instanceof AbortSignal&&!t.aborted&&e.addEventListener("contextmenu",us,{signal:t});let n=N(this,g0,document.createElement("div"));return n.className="buttons",e.append(n),l(this,Ba).hasCommentManager()&&Y(this,xl,sS).call(this,"commentButton","pdfjs-comment-floating-button","pdfjs-comment-floating-button-label",()=>{l(this,Ba).commentSelection("floating_button")}),Y(this,xl,sS).call(this,"highlightButton","pdfjs-highlight-floating-button1","pdfjs-highlight-floating-button-label",()=>{l(this,Ba).highlightSelection("floating_button")}),e},O3=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]},sS=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,Ba)._signal;a instanceof AbortSignal&&!a.aborted&&(o.addEventListener("contextmenu",us,{signal:a}),o.addEventListener("click",i,{signal:a})),l(this,g0).append(o)};or=class or{static initializeAndAddPointerId(e){(l(or,Vc)||N(or,Vc,new Set)).add(e)}static setPointer(e,t){l(or,Gc)||N(or,Gc,t),l(or,Xc)??N(or,Xc,e)}static setTimeStamp(e){N(or,Td,e)}static isSamePointerId(e){return l(or,Gc)===e}static isSamePointerIdOrRemove(e){return l(or,Gc)===e?!0:(l(or,Vc)?.delete(e),!1)}static isSamePointerType(e){return l(or,Xc)===e}static isInitializedAndDifferentPointerType(e){return l(or,Xc)!==null&&!or.isSamePointerType(e)}static isSameTimeStamp(e){return l(or,Td)===e}static isUsingMultiplePointers(){return l(or,Vc)?.size>=1}static clearPointerType(){N(or,Xc,null)}static clearPointerIds(){N(or,Gc,NaN),N(or,Vc,null)}static clearTimeStamp(){N(or,Td,NaN)}};Gc=new WeakMap,Vc=new WeakMap,Td=new WeakMap,Xc=new WeakMap,W(or,Gc,NaN),W(or,Vc,null),W(or,Td,NaN),W(or,Xc,null);Hn=or,oS=class{constructor(){W(this,HE,0)}get id(){return`${Ym}${ln(this,HE)._++}`}};HE=new WeakMap;NC=class NC{constructor(){W(this,Rd);W(this,Cd,RC());W(this,m0,0);W(this,qn,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 _t(this,"_isSVGFittingCanvas",o)}async getFromFile(e){let{lastModified:t,name:n,size:i,type:o}=e;return Y(this,Rd,Cv).call(this,`${t}_${n}_${i}_${o}`,e)}async getFromUrl(e){return Y(this,Rd,Cv).call(this,e,e)}async getFromBlob(e,t){let n=await t;return Y(this,Rd,Cv).call(this,e,n)}async getFromId(e){l(this,qn)||N(this,qn,new Map);let t=l(this,qn).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,qn)||N(this,qn,new Map);let n=l(this,qn).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,Cd)}_${ln(this,m0)._++}`,refCounter:1,isSvg:!1},l(this,qn).set(e,n),l(this,qn).set(n.id,n),n}getSvgUrl(e){let t=l(this,qn).get(e);return t?.isSvg?t.svgUrl:null}deleteId(e){l(this,qn)||N(this,qn,new Map);let t=l(this,qn).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,Cd)}_`)}};Cd=new WeakMap,m0=new WeakMap,qn=new WeakMap,Rd=new WeakSet,Cv=async function(e,t){l(this,qn)||N(this,qn,new Map);let n=l(this,qn).get(e);if(n===null)return null;if(n?.bitmap)return n.refCounter+=1,n;try{n||(n={bitmap:null,id:`image_${l(this,Cd)}_${ln(this,m0)._++}`,refCounter:0,isSvg:!1});let i;if(typeof t=="string"?(n.url=t,i=await og(t,"blob")):t instanceof File?i=n.file=t:t instanceof Blob&&(i=t),i.type==="image/svg+xml"){let o=NC._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){Tt(i),n=null}return l(this,qn).set(e,n),n&&l(this,qn).set(n.id,n),n};aS=NC,lS=class{constructor(e=128){W(this,Zr,[]);W(this,tu,!1);W(this,y0);W(this,Ir,-1);N(this,y0,e)}add({cmd:e,undo:t,post:n,mustExec:i,type:o=NaN,overwriteIfSameType:s=!1,keepUndo:a=!1}){if(i&&e(),l(this,tu))return;let u={cmd:e,undo:t,post:n,type:o};if(l(this,Ir)===-1){l(this,Zr).length>0&&(l(this,Zr).length=0),N(this,Ir,0),l(this,Zr).push(u);return}if(s&&l(this,Zr)[l(this,Ir)].type===o){a&&(u.undo=l(this,Zr)[l(this,Ir)].undo),l(this,Zr)[l(this,Ir)]=u;return}let c=l(this,Ir)+1;c===l(this,y0)?l(this,Zr).splice(0,1):(N(this,Ir,c),c<l(this,Zr).length&&l(this,Zr).splice(c)),l(this,Zr).push(u)}undo(){if(l(this,Ir)===-1)return;N(this,tu,!0);let{undo:e,post:t}=l(this,Zr)[l(this,Ir)];e(),t?.(),N(this,tu,!1),N(this,Ir,l(this,Ir)-1)}redo(){if(l(this,Ir)<l(this,Zr).length-1){N(this,Ir,l(this,Ir)+1),N(this,tu,!0);let{cmd:e,post:t}=l(this,Zr)[l(this,Ir)];e(),t?.(),N(this,tu,!1)}}hasSomethingToUndo(){return l(this,Ir)!==-1}hasSomethingToRedo(){return l(this,Ir)<l(this,Zr).length-1}cleanType(e){if(l(this,Ir)!==-1){for(let t=l(this,Ir);t>=0;t--)if(l(this,Zr)[t].type!==e){l(this,Zr).splice(t+1,l(this,Ir)-t),N(this,Ir,t);return}l(this,Zr).length=0,N(this,Ir,-1)}}destroy(){N(this,Zr,null)}};Zr=new WeakMap,tu=new WeakMap,y0=new WeakMap,Ir=new WeakMap;sh=class{constructor(e){W(this,qE);this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;let{isMac:t}=Wr.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(Y(this,qE,P3).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||Nr(t))}};qE=new WeakSet,P3=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};GE=class GE{get _colors(){let e=new Map([["CanvasText",null],["Canvas",null]]);return WY(e),_t(this,"_colors",e)}convert(e){let t=ag(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 GE._colorsMapping.get(n);return t}getHexCode(e){let t=this._colors.get(e);return t?at.makeHexColor(...t):e}};He(GE,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));uS=GE,yd=class yd{constructor(e,t,n,i,o,s,a,u,c,f,h,d,g,y,v,w){W(this,st);W(this,Dd,new AbortController);W(this,ji,null);W(this,Id,null);W(this,Br,new Map);W(this,en,new Map);W(this,kd,null);W(this,Ts,null);W(this,Nd,null);W(this,Cs,new lS);W(this,Gn,null);W(this,ru,null);W(this,nu,null);W(this,iu,0);W(this,su,new Set);W(this,Po,null);W(this,Rs,null);W(this,Yc,new Set);He(this,"_editorUndoBar",null);W(this,b0,!1);W(this,w0,!1);W(this,Od,!1);W(this,v0,null);W(this,Fo,null);W(this,ou,null);W(this,Ld,null);W(this,au,!1);W(this,Mo,null);W(this,VE,new oS);W(this,lu,!1);W(this,Pd,!1);W(this,E0,!1);W(this,uu,null);W(this,Zc,null);W(this,Fd,null);W(this,cu,null);W(this,_0,null);W(this,tn,At.NONE);W(this,er,new Set);W(this,Ua,null);W(this,fu,null);W(this,hu,null);W(this,A0,null);W(this,Md,null);W(this,x0,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1});W(this,du,[0,0]);W(this,Bo,null);W(this,ja,null);W(this,S0,null);W(this,T0,null);W(this,Ds,null);let b=this._signal=l(this,Dd).signal;N(this,ja,e),N(this,S0,t),N(this,T0,n),N(this,kd,i),N(this,Gn,o),N(this,fu,s),N(this,Md,u),this._eventBus=a,a._on("editingaction",this.onEditingAction.bind(this),{signal:b}),a._on("pagechanging",this.onPageChanging.bind(this),{signal:b}),a._on("scalechanging",this.onScaleChanging.bind(this),{signal:b}),a._on("rotationchanging",this.onRotationChanging.bind(this),{signal:b}),a._on("setpreference",this.onSetPreference.bind(this),{signal:b}),a._on("switchannotationeditorparams",E=>this.updateParams(E.type,E.value),{signal:b}),window.addEventListener("pointerdown",()=>{N(this,Pd,!0)},{capture:!0,signal:b}),window.addEventListener("pointerup",()=>{N(this,Pd,!1)},{capture:!0,signal:b}),window.addEventListener("beforeunload",Y(this,st,F3).bind(this),{capture:!0,signal:b}),Y(this,st,U3).call(this),Y(this,st,q3).call(this),Y(this,st,fS).call(this),N(this,Ts,u.annotationStorage),N(this,v0,u.filterFactory),N(this,hu,c),N(this,Ld,f||null),N(this,b0,h),N(this,w0,d),N(this,Od,g),N(this,_0,y||null),this.viewParameters={realScale:_l.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=yd.prototype,t=s=>l(s,ja).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 _t(this,"_keyboardManager",new sh([[["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,ja).contains(a)&&!s.isEnterHandled}],[[" ","mac+ "],e.addNewEditorFromKeyboard,{checker:(s,{target:a})=>!(a instanceof HTMLButtonElement)&&l(s,ja).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,Ds)?.resolve(),N(this,Ds,null),l(this,Dd)?.abort(),N(this,Dd,null),this._signal=null;for(let e of l(this,en).values())e.destroy();l(this,en).clear(),l(this,Br).clear(),l(this,Yc).clear(),l(this,cu)?.clear(),N(this,ji,null),l(this,er).clear(),l(this,Cs).destroy(),l(this,kd)?.destroy(),l(this,Gn)?.destroy(),l(this,fu)?.destroy(),l(this,Mo)?.hide(),N(this,Mo,null),l(this,Fd)?.destroy(),N(this,Fd,null),N(this,Id,null),l(this,Fo)&&(clearTimeout(l(this,Fo)),N(this,Fo,null)),l(this,Bo)&&(clearTimeout(l(this,Bo)),N(this,Bo,null)),this._editorUndoBar?.destroy(),N(this,Md,null)}combinedSignal(e){return AbortSignal.any([this._signal,e.signal])}get mlManager(){return l(this,_0)}get useNewAltTextFlow(){return l(this,w0)}get useNewAltTextWhenAddingImage(){return l(this,Od)}get hcmFilter(){return _t(this,"hcmFilter",l(this,hu)?l(this,v0).addHCMFilter(l(this,hu).foreground,l(this,hu).background):"none")}get direction(){return _t(this,"direction",getComputedStyle(l(this,ja)).direction)}get _highlightColors(){return _t(this,"_highlightColors",l(this,Ld)?new Map(l(this,Ld).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 _t(this,"highlightColors",null);let t=new Map,n=!!l(this,hu);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 _t(this,"highlightColors",t)}get highlightColorNames(){return _t(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),N(this,nu,e)}setMainHighlightColorPicker(e){N(this,Fd,e)}editAltText(e,t=!1){l(this,kd)?.editAltText(this,e,t)}hasCommentManager(){return!!l(this,Gn)}editComment(e,t,n,i){l(this,Gn)?.showDialog(this,e,t,n,i)}selectComment(e,t){l(this,en).get(e)?.getEditorByUID(t)?.toggleComment(!0,!0)}updateComment(e){l(this,Gn)?.updateComment(e.getData())}updatePopupColor(e){l(this,Gn)?.updatePopupColor(e)}removeComment(e){l(this,Gn)?.removeComments([e.uid])}deleteComment(e,t){let n=()=>{e.comment=t},i=()=>{this._editorUndoBar?.show(n,"comment"),this.toggleComment(null),e.comment=null};this.addCommands({cmd:i,undo:n,mustExec:!0})}toggleComment(e,t,n=void 0){l(this,Gn)?.toggleCommentPopup(e,t,n)}makeCommentColor(e,t){return e&&l(this,Gn)?.makeCommentColor(e,t)||null}getCommentDialogElement(){return l(this,Gn)?.dialogElement||null}async waitForEditorsRendered(e){if(l(this,en).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,fu)?.getSignature({uiManager:this,editor:e})}get signatureManager(){return l(this,fu)}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}){e==="enableNewAltTextWhenAddingImage"&&N(this,Od,t)}onPageChanging({pageNumber:e}){N(this,iu,e-1)}deletePage(e){for(let t of this.getEditors(e))t.remove();l(this,en).delete(e),l(this,iu)===e&&N(this,iu,0)}focusMainContainer(){l(this,ja).focus()}findParent(e,t){for(let n of l(this,en).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,S0).classList.toggle("noUserSelect",e)}addShouldRescale(e){l(this,Yc).add(e)}removeShouldRescale(e){l(this,Yc).delete(e)}onScaleChanging({scale:e}){this.commitOrRemove(),this.viewParameters.realScale=e*_l.PDF_TO_CSS_UNITS;for(let t of l(this,Yc))t.onScaleChanging();l(this,nu)?.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=Y(this,st,Rv).call(this,n).closest(".textLayer"),h=this.getSelectionBoxes(f);if(!h)return;n.empty();let d=Y(this,st,cS).call(this,f),g=l(this,tn)===At.NONE,y=()=>{let v=d?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:e,boxes:h,anchorNode:i,anchorOffset:o,focusNode:s,focusOffset:a,text:u});g&&this.showAllEditors("highlight",!0,!0),t&&v?.editComment()};if(g){this.switchToMode(At.HIGHLIGHT,y);return}y()}commentSelection(e=""){this.highlightSelection(e,!0)}getAndRemoveDataFromAnnotationStorage(e){if(!l(this,Ts))return null;let t=`${Ym}${e}`,n=l(this,Ts).getRawValue(t);return n&&l(this,Ts).remove(t),n}addToAnnotationStorage(e){!e.isEmpty()&&l(this,Ts)&&!l(this,Ts).has(e.id)&&l(this,Ts).setValue(e.id,e)}a11yAlert(e,t=null){let n=l(this,T0);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,au)&&(N(this,au,!1),Y(this,st,Sm).call(this,"main_toolbar")),!this.hasSelection)return;let{activeElement:e}=document;for(let t of l(this,er))if(t.div.contains(e)){N(this,Zc,[t,e]),t._focusEventsAllowed=!1;break}}focus(){if(!l(this,Zc))return;let[e,t]=l(this,Zc);N(this,Zc,null),t.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:this._signal}),t.focus()}addEditListeners(){Y(this,st,fS).call(this),this.setEditingState(!0)}removeEditListeners(){Y(this,st,z3).call(this),this.setEditingState(!1)}dragOver(e){for(let{type:t}of e.dataTransfer.items)for(let n of l(this,Rs))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,Rs))if(n.isHandlingMimeForPasting(t.type)){n.paste(t,this.currentLayer),e.preventDefault();return}}copy(e){if(e.preventDefault(),l(this,ji)?.commitOrRemove(),!this.hasSelection)return;let t=[];for(let n of l(this,er)){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,Rs))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){Tt(`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)Y(this,st,hS).call(this,u);Y(this,st,dS).call(this,o)},a=()=>{for(let u of o)u.remove()};this.addCommands({cmd:s,undo:a,mustExec:!0})}catch(o){Tt(`paste: "${o.message}".`)}}keydown(e){!this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!0),l(this,tn)!==At.NONE&&!this.isEditorHandlingKeyboard&&yd._keyboardManager.exec(this,e)}keyup(e){this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!1,l(this,au)&&(N(this,au,!1),Y(this,st,Sm).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?(Y(this,st,j3).call(this),Y(this,st,W3).call(this),Y(this,st,ti).call(this,{isEditing:l(this,tn)!==At.NONE,isEmpty:Y(this,st,Tm).call(this),hasSomethingToUndo:l(this,Cs).hasSomethingToUndo(),hasSomethingToRedo:l(this,Cs).hasSomethingToRedo(),hasSelectedEditor:!1})):(Y(this,st,$3).call(this),Y(this,st,H3).call(this),Y(this,st,ti).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(e){if(!l(this,Rs)){N(this,Rs,e);for(let t of l(this,Rs))Y(this,st,La).call(this,t.defaultPropertiesToUpdate)}}getId(){return l(this,VE).id}get currentLayer(){return l(this,en).get(l(this,iu))}getLayer(e){return l(this,en).get(e)}get currentPageIndex(){return l(this,iu)}addLayer(e){l(this,en).set(e.pageIndex,e),l(this,lu)?e.enable():e.disable()}removeLayer(e){l(this,en).delete(e.pageIndex)}async updateMode(e,t=null,n=!1,i=!1,o=!1,s=!1){if(l(this,tn)!==e&&!(l(this,Ds)&&(await l(this,Ds).promise,!l(this,Ds)))){if(N(this,Ds,Promise.withResolvers()),l(this,nu)?.commitOrRemove(),l(this,tn)===At.POPUP&&l(this,Gn)?.hideSidebar(),l(this,Gn)?.destroyPopup(),N(this,tn,e),e===At.NONE){this.setEditingState(!1),Y(this,st,V3).call(this);for(let a of l(this,Br).values())a.hideStandaloneCommentButton();this._editorUndoBar?.hide(),this.toggleComment(null),l(this,Ds).resolve();return}for(let a of l(this,Br).values())a.addStandaloneCommentButton();e===At.SIGNATURE&&await l(this,fu)?.loadSignatures(),n&&Hn.clearPointerType(),this.setEditingState(!0),await Y(this,st,G3).call(this),this.unselectAll();for(let a of l(this,en).values())a.updateMode(e);if(e===At.POPUP){l(this,Id)||N(this,Id,await l(this,Md).getAnnotationsByType(new Set(l(this,Rs).map(c=>c._editorType))));let a=new Set,u=[];for(let c of l(this,Br).values()){let{annotationElementId:f,hasComment:h,deleted:d}=c;f&&a.add(f),h&&!d&&u.push(c.getData())}for(let c of l(this,Id)){let{id:f,popupRef:h,contentsObj:d}=c;h&&d?.str&&!a.has(f)&&!l(this,su).has(f)&&u.push(c)}l(this,Gn)?.showSidebar(u)}if(!t){i&&this.addNewEditorFromKeyboard(),l(this,Ds).resolve();return}for(let a of l(this,Br).values())a.uid===t?(this.setSelected(a),s?a.editComment():o?a.enterInEditMode():a.focus()):a.unselect();l(this,Ds).resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(e){e.mode!==l(this,tn)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,...e})}updateParams(e,t){if(l(this,Rs)){switch(e){case Bt.CREATE:this.currentLayer.addNewEditor(t);return;case Bt.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(l(this,A0)||N(this,A0,new Map)).set(e,t),this.showAllEditors("highlight",t);break}if(this.hasSelection)for(let n of l(this,er))n.updateParams(e,t);else for(let n of l(this,Rs))n.updateDefaultParams(e,t)}}showAllEditors(e,t,n=!1){for(let o of l(this,Br).values())o.editorType===e&&o.show(t);(l(this,A0)?.get(Bt.HIGHLIGHT_SHOW_ALL)??!0)!==t&&Y(this,st,La).call(this,[[Bt.HIGHLIGHT_SHOW_ALL,t]])}enableWaiting(e=!1){if(l(this,E0)!==e){N(this,E0,e);for(let t of l(this,en).values())e?t.disableClick():t.enableClick(),t.div.classList.toggle("waiting",e)}}*getEditors(e){for(let t of l(this,Br).values())t.pageIndex===e&&(yield t)}getEditor(e){return l(this,Br).get(e)}addEditor(e){l(this,Br).set(e.id,e)}removeEditor(e){e.div.contains(document.activeElement)&&(l(this,Fo)&&clearTimeout(l(this,Fo)),N(this,Fo,setTimeout(()=>{this.focusMainContainer(),N(this,Fo,null)},0))),l(this,Br).delete(e.id),e.annotationElementId&&l(this,cu)?.delete(e.annotationElementId),this.unselect(e),(!e.annotationElementId||!l(this,su).has(e.annotationElementId))&&l(this,Ts)?.remove(e.id)}addDeletedAnnotationElement(e){l(this,su).add(e.annotationElementId),this.addChangedExistingAnnotation(e),e.deleted=!0}isDeletedAnnotationElement(e){return l(this,su).has(e)}removeDeletedAnnotationElement(e){l(this,su).delete(e.annotationElementId),this.removeChangedExistingAnnotation(e),e.deleted=!1}setActiveEditor(e){l(this,ji)!==e&&(N(this,ji,e),e&&Y(this,st,La).call(this,e.propertiesToUpdate))}updateUI(e){l(this,st,X3)===e&&Y(this,st,La).call(this,e.propertiesToUpdate)}updateUIForDefaultProperties(e){Y(this,st,La).call(this,e.defaultPropertiesToUpdate)}toggleSelected(e){if(l(this,er).has(e)){l(this,er).delete(e),e.unselect(),Y(this,st,ti).call(this,{hasSelectedEditor:this.hasSelection});return}l(this,er).add(e),e.select(),Y(this,st,La).call(this,e.propertiesToUpdate),Y(this,st,ti).call(this,{hasSelectedEditor:!0})}setSelected(e){this.updateToolbar({mode:e.mode,editId:e.uid}),l(this,nu)?.commitOrRemove();for(let t of l(this,er))t!==e&&t.unselect();l(this,er).clear(),l(this,er).add(e),e.select(),Y(this,st,La).call(this,e.propertiesToUpdate),Y(this,st,ti).call(this,{hasSelectedEditor:!0})}isSelected(e){return l(this,er).has(e)}get firstSelectedEditor(){return l(this,er).values().next().value}unselect(e){e.unselect(),l(this,er).delete(e),Y(this,st,ti).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return l(this,er).size!==0}get isEnterHandled(){return l(this,er).size===1&&this.firstSelectedEditor.isEnterHandled}undo(){l(this,Cs).undo(),Y(this,st,ti).call(this,{hasSomethingToUndo:l(this,Cs).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:Y(this,st,Tm).call(this)}),this._editorUndoBar?.hide()}redo(){l(this,Cs).redo(),Y(this,st,ti).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:l(this,Cs).hasSomethingToRedo(),isEmpty:Y(this,st,Tm).call(this)})}addCommands(e){l(this,Cs).add(e),Y(this,st,ti).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:Y(this,st,Tm).call(this)})}cleanUndoStack(e){l(this,Cs).cleanType(e)}delete(){this.commitOrRemove();let e=this.currentLayer?.endDrawingSession(!0);if(!this.hasSelection&&!e)return;let t=e?[e]:[...l(this,er)],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)Y(this,st,hS).call(this,o)};this.addCommands({cmd:n,undo:i,mustExec:!0})}commitOrRemove(){l(this,ji)?.commitOrRemove()}hasSomethingToControl(){return l(this,ji)||this.hasSelection}selectAll(){for(let e of l(this,er))e.commit();Y(this,st,dS).call(this,l(this,Br).values())}unselectAll(){if(!(l(this,ji)&&(l(this,ji).commitOrRemove(),l(this,tn)!==At.NONE))&&!l(this,nu)?.commitOrRemove()&&this.hasSelection){for(let e of l(this,er))e.unselect();l(this,er).clear(),Y(this,st,ti).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(e,t,n=!1){if(n||this.commitOrRemove(),!this.hasSelection)return;l(this,du)[0]+=e,l(this,du)[1]+=t;let[i,o]=l(this,du),s=[...l(this,er)],a=1e3;l(this,Bo)&&clearTimeout(l(this,Bo)),N(this,Bo,setTimeout(()=>{N(this,Bo,null),l(this,du)[0]=l(this,du)[1]=0,this.addCommands({cmd:()=>{for(let u of s)l(this,Br).has(u.id)&&(u.translateInPage(i,o),u.translationDone())},undo:()=>{for(let u of s)l(this,Br).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),N(this,Po,new Map);for(let e of l(this,er))l(this,Po).set(e,{savedX:e.x,savedY:e.y,savedPageIndex:e.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!l(this,Po))return!1;this.disableUserSelect(!1);let e=l(this,Po);N(this,Po,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,Br).has(i.id)){let u=l(this,en).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,Po))for(let n of l(this,Po).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,er).size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(e){return l(this,ji)===e}getActive(){return l(this,ji)}getMode(){return l(this,tn)}isEditingMode(){return l(this,tn)!==At.NONE}get imageManager(){return _t(this,"imageManager",new aS)}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,d)=>({x:(f-i)/s,y:1-(c+h-n)/o,width:d/s,height:h/o});break;case"180":a=(c,f,h,d)=>({x:1-(c+h-n)/o,y:1-(f+d-i)/s,width:h/o,height:d/s});break;case"270":a=(c,f,h,d)=>({x:1-(f+d-i)/s,y:(c-n)/o,width:d/s,height:h/o});break;default:a=(c,f,h,d)=>({x:(c-n)/o,y:(f-i)/s,width:h/o,height:d/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:d,y:g,width:y,height:v}of h.getClientRects())y===0||v===0||u.push(a(d,g,y,v))}return u.length===0?null:u}addChangedExistingAnnotation({annotationElementId:e,id:t}){(l(this,Nd)||N(this,Nd,new Map)).set(e,t)}removeChangedExistingAnnotation({annotationElementId:e}){l(this,Nd)?.delete(e)}renderAnnotationElement(e){let t=l(this,Nd)?.get(e.data.id);if(!t)return;let n=l(this,Ts).getRawValue(t);n&&(l(this,tn)===At.NONE&&!n.hasBeenModified||n.renderAnnotationElement(e))}setMissingCanvas(e,t,n){let i=l(this,cu)?.get(e);i&&(i.setCanvas(t,n),l(this,cu).delete(e))}addMissingCanvas(e,t){(l(this,cu)||N(this,cu,new Map)).set(e,t)}};Dd=new WeakMap,ji=new WeakMap,Id=new WeakMap,Br=new WeakMap,en=new WeakMap,kd=new WeakMap,Ts=new WeakMap,Nd=new WeakMap,Cs=new WeakMap,Gn=new WeakMap,ru=new WeakMap,nu=new WeakMap,iu=new WeakMap,su=new WeakMap,Po=new WeakMap,Rs=new WeakMap,Yc=new WeakMap,b0=new WeakMap,w0=new WeakMap,Od=new WeakMap,v0=new WeakMap,Fo=new WeakMap,ou=new WeakMap,Ld=new WeakMap,au=new WeakMap,Mo=new WeakMap,VE=new WeakMap,lu=new WeakMap,Pd=new WeakMap,E0=new WeakMap,uu=new WeakMap,Zc=new WeakMap,Fd=new WeakMap,cu=new WeakMap,_0=new WeakMap,tn=new WeakMap,er=new WeakMap,Ua=new WeakMap,fu=new WeakMap,hu=new WeakMap,A0=new WeakMap,Md=new WeakMap,x0=new WeakMap,du=new WeakMap,Bo=new WeakMap,ja=new WeakMap,S0=new WeakMap,T0=new WeakMap,Ds=new WeakMap,st=new WeakSet,Rv=function({anchorNode:e}){return e.nodeType===Node.TEXT_NODE?e.parentElement:e},cS=function(e){let{currentLayer:t}=this;if(t.hasTextLayer(e))return t;for(let n of l(this,en).values())if(n.hasTextLayer(e))return n;return null},F3=function(e){this.commitOrRemove(),this.currentLayer?.endDrawingSession(!1)},M3=function(){let e=document.getSelection();if(!e||e.isCollapsed)return;let n=Y(this,st,Rv).call(this,e).closest(".textLayer"),i=this.getSelectionBoxes(n);i&&(l(this,Mo)||N(this,Mo,new iS(this)),l(this,Mo).show(n,i,this.direction==="ltr"))},B3=function(){let e=document.getSelection();if(!e||e.isCollapsed){l(this,Ua)&&(l(this,Mo)?.hide(),N(this,Ua,null),Y(this,st,ti).call(this,{hasSelectedText:!1}));return}let{anchorNode:t}=e;if(t===l(this,Ua))return;let i=Y(this,st,Rv).call(this,e).closest(".textLayer");if(!i){l(this,Ua)&&(l(this,Mo)?.hide(),N(this,Ua,null),Y(this,st,ti).call(this,{hasSelectedText:!1}));return}if(l(this,Mo)?.hide(),N(this,Ua,t),Y(this,st,ti).call(this,{hasSelectedText:!0}),!(l(this,tn)!==At.HIGHLIGHT&&l(this,tn)!==At.NONE)&&(l(this,tn)===At.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),N(this,au,this.isShiftKeyDown),!this.isShiftKeyDown)){let o=l(this,tn)===At.HIGHLIGHT?Y(this,st,cS).call(this,i):null;if(o?.toggleDrawing(),l(this,Pd)){let s=new AbortController,a=this.combinedSignal(s),u=c=>{c.type==="pointerup"&&c.button!==0||(s.abort(),o?.toggleDrawing(!0),c.type==="pointerup"&&Y(this,st,Sm).call(this,"main_toolbar"))};window.addEventListener("pointerup",u,{signal:a}),window.addEventListener("blur",u,{signal:a})}else o?.toggleDrawing(!0),Y(this,st,Sm).call(this,"main_toolbar")}},Sm=function(e=""){l(this,tn)===At.HIGHLIGHT?this.highlightSelection(e):l(this,b0)&&Y(this,st,M3).call(this)},U3=function(){document.addEventListener("selectionchange",Y(this,st,B3).bind(this),{signal:this._signal})},j3=function(){if(l(this,ou))return;N(this,ou,new AbortController);let e=this.combinedSignal(l(this,ou));window.addEventListener("focus",this.focus.bind(this),{signal:e}),window.addEventListener("blur",this.blur.bind(this),{signal:e})},$3=function(){l(this,ou)?.abort(),N(this,ou,null)},fS=function(){if(l(this,uu))return;N(this,uu,new AbortController);let e=this.combinedSignal(l(this,uu));window.addEventListener("keydown",this.keydown.bind(this),{signal:e}),window.addEventListener("keyup",this.keyup.bind(this),{signal:e})},z3=function(){l(this,uu)?.abort(),N(this,uu,null)},W3=function(){if(l(this,ru))return;N(this,ru,new AbortController);let e=this.combinedSignal(l(this,ru));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})},H3=function(){l(this,ru)?.abort(),N(this,ru,null)},q3=function(){let e=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:e}),document.addEventListener("drop",this.drop.bind(this),{signal:e})},ti=function(e){Object.entries(e).some(([n,i])=>l(this,x0)[n]!==i)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(l(this,x0),e)}),l(this,tn)===At.HIGHLIGHT&&e.hasSelectedEditor===!1&&Y(this,st,La).call(this,[[Bt.HIGHLIGHT_FREE,!0]]))},La=function(e){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:e})},G3=async function(){if(!l(this,lu)){N(this,lu,!0);let e=[];for(let t of l(this,en).values())e.push(t.enable());await Promise.all(e);for(let t of l(this,Br).values())t.enable()}},V3=function(){if(this.unselectAll(),l(this,lu)){N(this,lu,!1);for(let e of l(this,en).values())e.disable();for(let e of l(this,Br).values())e.disable()}},hS=function(e){let t=l(this,en).get(e.pageIndex);t?t.addOrRebuild(e):(this.addEditor(e),this.addToAnnotationStorage(e))},X3=function(){let e=null;for(e of l(this,er));return e},Tm=function(){if(l(this,Br).size===0)return!0;if(l(this,Br).size===1)for(let e of l(this,Br).values())return e.isEmpty();return!1},dS=function(e){for(let t of l(this,er))t.unselect();l(this,er).clear();for(let t of e)t.isEmpty()||(l(this,er).add(t),t.select());Y(this,st,ti).call(this,{hasSelectedEditor:this.hasSelection})},He(yd,"TRANSLATE_SMALL",1),He(yd,"TRANSLATE_BIG",10);Gu=yd,ri=class ri{constructor(e){W(this,uo);W(this,En,null);W(this,Uo,!1);W(this,Ks,null);W(this,Bd,null);W(this,jo,null);W(this,$i,null);W(this,Ud,!1);W(this,$o,null);W(this,xi,null);W(this,$a,null);W(this,Kc,null);W(this,zo,!1);N(this,xi,e),N(this,zo,e._uiManager.useNewAltTextFlow),l(ri,pu)||N(ri,pu,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){ri._l10n??(ri._l10n=e)}async render(){let e=N(this,Ks,document.createElement("button"));e.className="altText",e.tabIndex="0";let t=N(this,Bd,document.createElement("span"));e.append(t),l(this,zo)?(e.classList.add("new"),e.setAttribute("data-l10n-id",l(ri,pu).missing),t.setAttribute("data-l10n-id",l(ri,pu)["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,xi)._uiManager._signal;e.addEventListener("contextmenu",us,{signal:n}),e.addEventListener("pointerdown",o=>o.stopPropagation(),{signal:n});let i=o=>{o.preventDefault(),l(this,xi)._uiManager.editAltText(l(this,xi)),l(this,zo)&&l(this,xi)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:l(this,uo,Cm)}})};return e.addEventListener("click",i,{capture:!0,signal:n}),e.addEventListener("keydown",o=>{o.target===e&&o.key==="Enter"&&(N(this,Ud,!0),i(o))},{signal:n}),await Y(this,uo,Dv).call(this),e}finish(){l(this,Ks)&&(l(this,Ks).focus({focusVisible:l(this,Ud)}),N(this,Ud,!1))}isEmpty(){return l(this,zo)?l(this,En)===null:!l(this,En)&&!l(this,Uo)}hasData(){return l(this,zo)?l(this,En)!==null||!!l(this,$a):this.isEmpty()}get guessedText(){return l(this,$a)}async setGuessedText(e){l(this,En)===null&&(N(this,$a,e),N(this,Kc,await ri._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:e})),Y(this,uo,Dv).call(this))}toggleAltTextBadge(e=!1){if(!l(this,zo)||l(this,En)){l(this,$o)?.remove(),N(this,$o,null);return}if(!l(this,$o)){let t=N(this,$o,document.createElement("div"));t.className="noAltTextBadge",l(this,xi).div.append(t)}l(this,$o).classList.toggle("hidden",!e)}serialize(e){let t=l(this,En);return!e&&l(this,$a)===t&&(t=l(this,Kc)),{altText:t,decorative:l(this,Uo),guessedText:l(this,$a),textWithDisclaimer:l(this,Kc)}}get data(){return{altText:l(this,En),decorative:l(this,Uo)}}set data({altText:e,decorative:t,guessedText:n,textWithDisclaimer:i,cancel:o=!1}){n&&(N(this,$a,n),N(this,Kc,i)),!(l(this,En)===e&&l(this,Uo)===t)&&(o||(N(this,En,e),N(this,Uo,t)),Y(this,uo,Dv).call(this))}toggle(e=!1){l(this,Ks)&&(!e&&l(this,$i)&&(clearTimeout(l(this,$i)),N(this,$i,null)),l(this,Ks).disabled=!e)}shown(){l(this,xi)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:l(this,uo,Cm)}})}destroy(){l(this,Ks)?.remove(),N(this,Ks,null),N(this,Bd,null),N(this,jo,null),l(this,$o)?.remove(),N(this,$o,null)}};En=new WeakMap,Uo=new WeakMap,Ks=new WeakMap,Bd=new WeakMap,jo=new WeakMap,$i=new WeakMap,Ud=new WeakMap,$o=new WeakMap,xi=new WeakMap,$a=new WeakMap,Kc=new WeakMap,zo=new WeakMap,pu=new WeakMap,uo=new WeakSet,Cm=function(){return l(this,En)&&"added"||l(this,En)===null&&this.guessedText&&"review"||"missing"},Dv=async function(){let e=l(this,Ks);if(!e)return;if(l(this,zo)){if(e.classList.toggle("done",!!l(this,En)),e.setAttribute("data-l10n-id",l(ri,pu)[l(this,uo,Cm)]),l(this,Bd)?.setAttribute("data-l10n-id",l(ri,pu)[`${l(this,uo,Cm)}-label`]),!l(this,En)){l(this,jo)?.remove();return}}else{if(!l(this,En)&&!l(this,Uo)){e.classList.remove("done"),l(this,jo)?.remove();return}e.classList.add("done"),e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let t=l(this,jo);if(!t){N(this,jo,t=document.createElement("span")),t.className="tooltip",t.setAttribute("role","tooltip"),t.id=`alt-text-tooltip-${l(this,xi).id}`;let i=100,o=l(this,xi)._uiManager._signal;o.addEventListener("abort",()=>{clearTimeout(l(this,$i)),N(this,$i,null)},{once:!0}),e.addEventListener("mouseenter",()=>{N(this,$i,setTimeout(()=>{N(this,$i,null),l(this,jo).classList.add("show"),l(this,xi)._reportTelemetry({action:"alt_text_tooltip"})},i))},{signal:o}),e.addEventListener("mouseleave",()=>{l(this,$i)&&(clearTimeout(l(this,$i)),N(this,$i,null)),l(this,jo)?.classList.remove("show")},{signal:o})}l(this,Uo)?t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(t.removeAttribute("data-l10n-id"),t.textContent=l(this,En)),t.parentNode||e.append(t),l(this,xi).getElementForAltText()?.setAttribute("aria-describedby",t.id)},W(ri,pu,null),He(ri,"_l10n",null);fE=ri,gd=class{constructor(e){W(this,R0);W(this,kn,null);W(this,Is,null);W(this,Jc,!1);W(this,yr,null);W(this,C0,null);W(this,gu,null);W(this,ks,null);W(this,mu,null);W(this,yu,!1);W(this,Qc,null);N(this,yr,e)}renderForToolbar(){let e=N(this,Is,document.createElement("button"));return e.className="comment",Y(this,R0,pS).call(this,e,!1)}renderForStandalone(){let e=N(this,kn,document.createElement("button"));e.className="annotationCommentButton";let t=l(this,yr).commentButtonPosition;if(t){let{style:n}=e;n.insetInlineEnd=`calc(${100*(l(this,yr)._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,yr).commentButtonColor;i&&(n.backgroundColor=i)}return Y(this,R0,pS).call(this,e,!0)}focusButton(){setTimeout(()=>{(l(this,kn)??l(this,Is))?.focus()},0)}onUpdatedColor(){if(!l(this,kn))return;let e=l(this,yr).commentButtonColor;e&&(l(this,kn).style.backgroundColor=e),l(this,yr)._uiManager.updatePopupColor(l(this,yr))}get commentButtonWidth(){return(l(this,kn)?.getBoundingClientRect().width??0)/l(this,yr).parent.boundingClientRect.width}get commentPopupPositionInLayer(){if(l(this,Qc))return l(this,Qc);if(!l(this,kn))return null;let{x:e,y:t,height:n}=l(this,kn).getBoundingClientRect(),{x:i,y:o,width:s,height:a}=l(this,yr).parent.boundingClientRect;return[(e-i)/s,(t+n-o)/a]}set commentPopupPositionInLayer(e){N(this,Qc,e)}hasDefaultPopupPosition(){return l(this,Qc)===null}removeStandaloneCommentButton(){l(this,kn)?.remove(),N(this,kn,null)}removeToolbarCommentButton(){l(this,Is)?.remove(),N(this,Is,null)}setCommentButtonStates({selected:e,hasPopup:t}){l(this,kn)&&(l(this,kn).classList.toggle("selected",e),l(this,kn).ariaExpanded=t)}edit(e){let t=this.commentPopupPositionInLayer,n,i;if(t)[n,i]=t;else{[n,i]=l(this,yr).commentButtonPosition;let{width:f,height:h,x:d,y:g}=l(this,yr);n=d+n*f,i=g+i*h}let o=l(this,yr).parent.boundingClientRect,{x:s,y:a,width:u,height:c}=o;l(this,yr)._uiManager.editComment(l(this,yr),s+n*u,a+i*c,{...e,parentDimensions:o})}finish(){l(this,Is)&&(l(this,Is).focus({focusVisible:l(this,Jc)}),N(this,Jc,!1))}isDeleted(){return l(this,yu)||l(this,ks)===""}isEmpty(){return l(this,ks)===null}hasBeenEdited(){return this.isDeleted()||l(this,ks)!==l(this,C0)}serialize(){return this.data}get data(){return{text:l(this,ks),richText:l(this,gu),date:l(this,mu),deleted:this.isDeleted()}}set data(e){if(e!==l(this,ks)&&N(this,gu,null),e===null){N(this,ks,""),N(this,yu,!0);return}N(this,ks,e),N(this,mu,new Date),N(this,yu,!1)}restoreData({text:e,richText:t,date:n}){N(this,ks,e),N(this,gu,t),N(this,mu,n),N(this,yu,!1)}setInitialText(e,t=null){N(this,C0,e),this.data=e,N(this,mu,null),N(this,gu,t)}shown(){}destroy(){l(this,Is)?.remove(),N(this,Is,null),l(this,kn)?.remove(),N(this,kn,null),N(this,ks,""),N(this,gu,null),N(this,mu,null),N(this,yr,null),N(this,Jc,!1),N(this,yu,!1)}};kn=new WeakMap,Is=new WeakMap,Jc=new WeakMap,yr=new WeakMap,C0=new WeakMap,gu=new WeakMap,ks=new WeakMap,mu=new WeakMap,yu=new WeakMap,Qc=new WeakMap,R0=new WeakSet,pS=function(e,t){if(!l(this,yr)._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,yr)._uiManager.getCommentDialogElement()],e.setAttribute("data-l10n-id","pdfjs-editor-add-comment-button"));let n=l(this,yr)._uiManager._signal;if(!(n instanceof AbortSignal)||n.aborted)return e;e.addEventListener("contextmenu",us,{signal:n}),t&&(e.addEventListener("focusin",o=>{l(this,yr)._focusEventsAllowed=!1,Nr(o)},{capture:!0,signal:n}),e.addEventListener("focusout",o=>{l(this,yr)._focusEventsAllowed=!0,Nr(o)},{capture:!0,signal:n})),e.addEventListener("pointerdown",o=>o.stopPropagation(),{signal:n});let i=o=>{o.preventDefault(),e===l(this,Is)?this.edit():l(this,yr).toggleComment(!0)};return e.addEventListener("click",i,{capture:!0,signal:n}),e.addEventListener("keydown",o=>{o.target===e&&o.key==="Enter"&&(N(this,Jc,!0),i(o))},{signal:n}),e.addEventListener("pointerenter",()=>{l(this,yr).toggleComment(!1,!0)},{signal:n}),e.addEventListener("pointerleave",()=>{l(this,yr).toggleComment(!1,!1)},{signal:n}),e};OC=class OC{constructor({container:e,isPinchingDisabled:t=null,isPinchingStopped:n=null,onPinchStart:i=null,onPinching:o=null,onPinchEnd:s=null,signal:a}){W(this,Vu);W(this,jd);W(this,ef,!1);W(this,D0,null);W(this,I0);W(this,k0);W(this,N0);W(this,O0);W(this,za,null);W(this,tf);W(this,Wa,null);W(this,rf);W(this,Ha,null);N(this,jd,e),N(this,D0,n),N(this,I0,t),N(this,k0,i),N(this,N0,o),N(this,O0,s),N(this,rf,new AbortController),N(this,tf,AbortSignal.any([a,l(this,rf).signal])),e.addEventListener("touchstart",Y(this,Vu,Y3).bind(this),{passive:!1,signal:l(this,tf)})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/ia.pixelRatio}destroy(){l(this,rf)?.abort(),N(this,rf,null),l(this,za)?.abort(),N(this,za,null)}};jd=new WeakMap,ef=new WeakMap,D0=new WeakMap,I0=new WeakMap,k0=new WeakMap,N0=new WeakMap,O0=new WeakMap,za=new WeakMap,tf=new WeakMap,Wa=new WeakMap,rf=new WeakMap,Ha=new WeakMap,Vu=new WeakSet,Y3=function(e){var i,o,s;if((i=l(this,I0))!=null&&i.call(this))return;if(e.touches.length===1){if(l(this,za))return;let a=N(this,za,new AbortController),u=AbortSignal.any([l(this,tf),a.signal]),c=l(this,jd),f={capture:!0,signal:u,passive:!1},h=d=>{d.pointerType==="touch"&&(l(this,za)?.abort(),N(this,za,null))};c.addEventListener("pointerdown",d=>{d.pointerType==="touch"&&(Nr(d),h(d))},f),c.addEventListener("pointerup",h,f),c.addEventListener("pointercancel",h,f);return}if(!l(this,Ha)){N(this,Ha,new AbortController);let a=AbortSignal.any([l(this,tf),l(this,Ha).signal]),u=l(this,jd),c={signal:a,capture:!1,passive:!1};u.addEventListener("touchmove",Y(this,Vu,Z3).bind(this),c);let f=Y(this,Vu,K3).bind(this);u.addEventListener("touchend",f,c),u.addEventListener("touchcancel",f,c),c.capture=!0,u.addEventListener("pointerdown",Nr,c),u.addEventListener("pointermove",Nr,c),u.addEventListener("pointercancel",Nr,c),u.addEventListener("pointerup",Nr,c),(o=l(this,k0))==null||o.call(this)}if(Nr(e),e.touches.length!==2||(s=l(this,D0))!=null&&s.call(this)){N(this,Wa,null);return}let[t,n]=e.touches;t.identifier>n.identifier&&([t,n]=[n,t]),N(this,Wa,{touch0X:t.screenX,touch0Y:t.screenY,touch1X:n.screenX,touch1Y:n.screenY})},Z3=function(e){var S;if(!l(this,Wa)||e.touches.length!==2)return;Nr(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,Wa),{touch0X:c,touch0Y:f,touch1X:h,touch1Y:d}=u,g=h-c,y=d-f,v=s-i,w=a-o,b=Math.hypot(v,w)||1,E=Math.hypot(g,y)||1;if(!l(this,ef)&&Math.abs(E-b)<=OC.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(u.touch0X=i,u.touch0Y=o,u.touch1X=s,u.touch1Y=a,!l(this,ef)){N(this,ef,!0);return}let _=[(i+s)/2,(o+a)/2];(S=l(this,N0))==null||S.call(this,_,E,b)},K3=function(e){var t;e.touches.length>=2||(l(this,Ha)&&(l(this,Ha).abort(),N(this,Ha,null),(t=l(this,O0))==null||t.call(this)),l(this,Wa)&&(Nr(e),N(this,Wa,null),N(this,ef,!1)))};Qm=OC,St=class St{constructor(e){W(this,wt);W(this,nf,null);W(this,Js,null);W(this,Tr,null);W(this,tr,null);W(this,qa,null);W(this,$d,!1);W(this,bu,null);W(this,L0,"");W(this,Nn,null);W(this,sf,null);W(this,Ga,null);W(this,Ns,null);W(this,wu,null);W(this,P0,"");W(this,of,!1);W(this,zi,null);W(this,F0,!1);W(this,af,!1);W(this,Va,!1);W(this,Wo,null);W(this,zd,0);W(this,Wd,0);W(this,Os,null);W(this,lf,null);He(this,"isSelected",!1);He(this,"_isCopy",!1);He(this,"_editToolbar",null);He(this,"_initialOptions",Object.create(null));He(this,"_initialData",null);He(this,"_isVisible",!0);He(this,"_uiManager",null);He(this,"_focusEventsAllowed",!0);W(this,M0,!1);W(this,XE,St._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=St.prototype._resizeWithKeyboard,t=Gu.TRANSLATE_SMALL,n=Gu.TRANSLATE_BIG;return _t(this,"_resizerKeyboardManager",new sh([[["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"],St.prototype._stopResizingWithKeyboard]]))}updatePageIndex(e){this.pageIndex=e}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 _t(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(e){let t=new _S({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(St._l10n??(St._l10n=e),St._l10nResizer||(St._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"})),St._borderLineWidth!==-1)return;let n=getComputedStyle(document.documentElement);St._borderLineWidth=parseFloat(n.getPropertyValue("--outline-width"))||0}static updateDefaultParams(e,t){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(e){return!1}static paste(e,t){Xt("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return l(this,M0)}set _isDraggable(e){N(this,M0,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,XE)}setParent(e){e!==null?(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions):(Y(this,wt,Rm).call(this),l(this,Ns)?.remove(),N(this,Ns,null)),this.parent=e}focusin(e){this._focusEventsAllowed&&(l(this,of)?N(this,of,!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){Y(this,wt,gS).call(this,this.parentDimensions,e,t)}translateInPage(e,t){l(this,zi)||N(this,zi,[this.x,this.y,this.width,this.height]),Y(this,wt,gS).call(this,this.pageDimensions,e,t),this.div.scrollIntoView({block:"nearest"})}translationDone(){this._onTranslated(this.x,this.y)}drag(e,t){l(this,zi)||N(this,zi,[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:d}=this.div.getBoundingClientRect();this.parent.findNewParent(this,h,d)&&(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,zi)&&(l(this,zi)[0]!==this.x||l(this,zi)[1]!==this.y)}get _hasBeenResized(){return!!l(this,zi)&&(l(this,zi)[2]!==this.width||l(this,zi)[3]!==this.height)}getBaseTranslation(){let[e,t]=this.parentDimensions,{_borderLineWidth:n}=St,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=gn(o,0,n-a),s=gn(s,0,i-u);break;case 90:o=gn(o,0,n-u),s=gn(s,a,i);break;case 180:o=gn(o,a,n),s=gn(s,u,i);break;case 270:o=gn(o,u,n),s=gn(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 Y(n=St,B0,mS).call(n,e,t,this.parentRotation)}pageTranslationToScreen(e,t){var n;return Y(n=St,B0,mS).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,Tr)?.finish()}get toolbarButtons(){return null}async addEditToolbar(){if(this._editToolbar||l(this,af))return this._editToolbar;this._editToolbar=new nS(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,Tr)?.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,Tr)||(fE.initialize(St._l10n),N(this,Tr,new fE(this)),l(this,nf)&&(l(this,Tr).data=l(this,nf),N(this,nf,null))),l(this,Tr)}get altTextData(){return l(this,Tr)?.data}set altTextData(e){l(this,Tr)&&(l(this,Tr).data=e)}get guessedAltText(){return l(this,Tr)?.guessedText}async setGuessedAltText(e){await l(this,Tr)?.setGuessedText(e)}serializeAltText(e){return l(this,Tr)?.serialize(e)}hasAltText(){return!!l(this,Tr)&&!l(this,Tr).isEmpty()}hasAltTextData(){return l(this,Tr)?.hasData()??!1}focusCommentButton(){l(this,tr)?.focusButton()}addCommentButton(){return this.canAddComment?l(this,tr)||N(this,tr,new gd(this)):null}addStandaloneCommentButton(){if(this._uiManager.hasCommentManager()){if(l(this,qa)){this._uiManager.isEditingMode()&&l(this,qa).classList.remove("hidden");return}this.hasComment&&(N(this,qa,l(this,tr).renderForStandalone()),this.div.append(l(this,qa)))}}removeStandaloneCommentButton(){l(this,tr).removeStandaloneCommentButton(),N(this,qa,null)}hideStandaloneCommentButton(){l(this,qa)?.classList.add("hidden")}get comment(){if(!l(this,tr))return null;let{data:{richText:e,text:t,date:n,deleted:i}}=l(this,tr);return{text:t,richText:e,date:n,deleted:i,color:this.getNonHCMColor(),opacity:this.opacity??1}}set comment(e){l(this,tr)||N(this,tr,new gd(this)),typeof e=="object"&&e!==null?l(this,tr).restoreData(e):l(this,tr).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,tr)||N(this,tr,new gd(this)),l(this,tr).setInitialText(e,n),!this.annotationElementId))return;let i=this._uiManager.getAndRemoveDataFromAnnotationStorage(this.annotationElementId);i&&this.updateFromAnnotationLayer(i)}get hasEditedComment(){return l(this,tr)?.hasBeenEdited()}get hasDeletedComment(){return l(this,tr)?.isDeleted()}get hasComment(){return!!l(this,tr)&&!l(this,tr).isEmpty()&&!l(this,tr).isDeleted()}async editComment(e){l(this,tr)||N(this,tr,new gd(this)),l(this,tr).edit(e)}toggleComment(e,t=void 0){this.hasComment&&this._uiManager.toggleComment(this,e,t)}setSelectedCommentButton(e){l(this,tr).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,tr).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,$d)?-1:0,e.setAttribute("role","application"),this.defaultL10nId&&e.setAttribute("data-l10n-id",this.defaultL10nId),this._isVisible||e.classList.add("hidden"),this.setInForeground(),Y(this,wt,vS).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),L3(this,e,["keydown","pointerdown","dblclick"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(l(this,lf)||N(this,lf,new Qm({container:e,isPinchingDisabled:()=>!this.isSelected,onPinchStart:Y(this,wt,e6).bind(this),onPinching:Y(this,wt,t6).bind(this),onPinchEnd:Y(this,wt,r6).bind(this),signal:this._uiManager._signal}))),this.addStandaloneCommentButton(),this._uiManager._editorUndoBar?.hide(),e}pointerdown(e){let{isMac:t}=Wr.platform;if(e.button!==0||e.ctrlKey&&t){e.preventDefault();return}if(N(this,of,!0),this._isDraggable){Y(this,wt,n6).call(this,e);return}Y(this,wt,wS).call(this,e)}_onStartDragging(){}_onStopDragging(){}moveInDOM(){l(this,Wo)&&clearTimeout(l(this,Wo)),N(this,Wo,setTimeout(()=>{N(this,Wo,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,d=this.y*s,g=this.width*o,y=this.height*s;switch(n){case 0:return[h+c+a,s-d-f-y+u,h+c+g+a,s-d-f+u];case 90:return[h+f+a,s-d+c+u,h+f+y+a,s-d+c+g+u];case 180:return[h-c-g+a,s-d+f+u,h-c+a,s-d+f+y+u];case 270:return[h-f-y+a,s-d-c-g+u,h-f+a,s-d-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&&St._colorManager.convert(this._uiManager.getNonHCMColor(this.color))}onUpdatedColor(){l(this,tr)?.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),N(this,af,!0),!0)}disableEditMode(){return this.isInEditMode()?(this.parent.setEditingState(!0),N(this,af,!1),!0):!1}isInEditMode(){return l(this,af)}shouldGetKeyboardEvents(){return l(this,Va)}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(){Y(this,wt,vS).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,N(i,nf,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,wu)?.abort(),N(this,wu,null),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.hideCommentPopup(),l(this,Wo)&&(clearTimeout(l(this,Wo)),N(this,Wo,null)),Y(this,wt,Rm).call(this),this.removeEditToolbar(),l(this,Os)){for(let e of l(this,Os).values())clearTimeout(e);N(this,Os,null)}this.parent=null,l(this,lf)?.destroy(),N(this,lf,null),l(this,Ns)?.remove(),N(this,Ns,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(Y(this,wt,J3).call(this),l(this,Nn).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[St._round(n+(o-n)*e),St._round(i+(s-i)*(1-t))]}get commentButtonColor(){return this._uiManager.makeCommentColor(this.getNonHCMColor(),this.opacity)}get commentPopupPosition(){return l(this,tr).commentPopupPositionInLayer}set commentPopupPosition(e){l(this,tr).commentPopupPositionInLayer=e}hasDefaultPopupPosition(){return l(this,tr).hasDefaultPopupPosition()}get commentButtonWidth(){return l(this,tr).commentButtonWidth}get elementBeforePopup(){return this.div}setCommentButtonStates(e){l(this,tr)?.setCommentButtonStates(e)}keydown(e){if(!this.isResizable||e.target!==this.div||e.key!=="Enter")return;this._uiManager.setSelected(this),N(this,Ga,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});let t=l(this,Nn).children;if(!l(this,Js)){N(this,Js,Array.from(t));let s=Y(this,wt,i6).bind(this),a=Y(this,wt,s6).bind(this),u=this._uiManager._signal;for(let c of l(this,Js)){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",Y(this,wt,o6).bind(this,f),{signal:u}),c.setAttribute("data-l10n-id",St._l10nResizer[f])}}let n=l(this,Js)[0],i=0;for(let s of t){if(s===n)break;i++}let o=(360-this.rotation+this.parentRotation)%360/90*(l(this,Js).length/4);if(o!==i){if(o<i)for(let a=0;a<i-o;a++)l(this,Nn).append(l(this,Nn).firstElementChild);else if(o>i)for(let a=0;a<o-i;a++)l(this,Nn).firstElementChild.before(l(this,Nn).lastElementChild);let s=0;for(let a of t){let c=l(this,Js)[s++].getAttribute("data-resizer-name");a.setAttribute("data-l10n-id",St._l10nResizer[c])}}Y(this,wt,ES).call(this,0),N(this,Va,!0),l(this,Nn).firstElementChild.focus({focusVisible:!0}),e.preventDefault(),e.stopImmediatePropagation()}_resizeWithKeyboard(e,t){l(this,Va)&&Y(this,wt,bS).call(this,l(this,P0),{deltaX:e,deltaY:t,fromKeyboard:!0})}_stopResizingWithKeyboard(){Y(this,wt,Rm).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,Tr)?.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,Nn)?.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,Tr)?.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,F0)}set isEditing(e){N(this,F0,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,Os)||N(this,Os,new Map);let{action:n}=e,i=l(this,Os).get(n);i&&clearTimeout(i),i=setTimeout(()=>{this._reportTelemetry(e),l(this,Os).delete(n),l(this,Os).size===0&&N(this,Os,null)},St._telemetryTimeout),l(this,Os).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),N(this,$d,!1)}disable(){this.div&&(this.div.tabIndex=-1),N(this,$d,!0)}updateFakeAnnotationElement(e){if(!l(this,Ns)&&!this.deleted){N(this,Ns,e.addFakeAnnotation(this));return}if(this.deleted){l(this,Ns).remove(),N(this,Ns,null);return}(this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized)&&l(this,Ns).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()}};nf=new WeakMap,Js=new WeakMap,Tr=new WeakMap,tr=new WeakMap,qa=new WeakMap,$d=new WeakMap,bu=new WeakMap,L0=new WeakMap,Nn=new WeakMap,sf=new WeakMap,Ga=new WeakMap,Ns=new WeakMap,wu=new WeakMap,P0=new WeakMap,of=new WeakMap,zi=new WeakMap,F0=new WeakMap,af=new WeakMap,Va=new WeakMap,Wo=new WeakMap,zd=new WeakMap,Wd=new WeakMap,Os=new WeakMap,lf=new WeakMap,M0=new WeakMap,XE=new WeakMap,wt=new WeakSet,gS=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()},B0=new WeakSet,mS=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]}},Iv=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]}},J3=function(){if(l(this,Nn))return;N(this,Nn,document.createElement("div")),l(this,Nn).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,Nn).append(i),i.classList.add("resizer",n),i.setAttribute("data-resizer-name",n),i.addEventListener("pointerdown",Y(this,wt,Q3).bind(this,n),{signal:t}),i.addEventListener("contextmenu",us,{signal:t}),i.tabIndex=-1}this.div.prepend(l(this,Nn))},Q3=function(e,t){t.preventDefault();let{isMac:n}=Wr.platform;if(t.button!==0||t.ctrlKey&&n)return;l(this,Tr)?.toggle(!1);let i=this._isDraggable;this._isDraggable=!1,N(this,sf,[t.screenX,t.screenY]);let o=new AbortController,s=this._uiManager.combinedSignal(o);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",Y(this,wt,bS).bind(this,e),{passive:!0,capture:!0,signal:s}),window.addEventListener("touchmove",Nr,{passive:!1,signal:s}),window.addEventListener("contextmenu",us,{signal:s}),N(this,Ga,{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,Tr)?.toggle(!0),this._isDraggable=i,this.parent.div.style.cursor=a,this.div.style.cursor=u,Y(this,wt,kv).call(this)};window.addEventListener("pointerup",c,{signal:s}),window.addEventListener("blur",c,{signal:s})},yS=function(e,t,n,i){this.width=n,this.height=i,this.x=e,this.y=t,this.setDims(),this.fixAndSetPosition(),this._onResized()},kv=function(){if(!l(this,Ga))return;let{savedX:e,savedY:t,savedWidth:n,savedHeight:i}=l(this,Ga);N(this,Ga,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:Y(this,wt,yS).bind(this,o,s,a,u),undo:Y(this,wt,yS).bind(this,e,t,n,i),mustExec:!0})},bS=function(e,t){let[n,i]=this.parentDimensions,o=this.x,s=this.y,a=this.width,u=this.height,c=St.MIN_SIZE/n,f=St.MIN_SIZE/i,h=Y(this,wt,Iv).call(this,this.rotation),d=(re,O)=>[h[0]*re+h[2]*O,h[1]*re+h[3]*O],g=Y(this,wt,Iv).call(this,360-this.rotation),y=(re,O)=>[g[0]*re+g[2]*O,g[1]*re+g[3]*O],v,w,b=!1,E=!1;switch(e){case"topLeft":b=!0,v=(re,O)=>[0,0],w=(re,O)=>[re,O];break;case"topMiddle":v=(re,O)=>[re/2,0],w=(re,O)=>[re/2,O];break;case"topRight":b=!0,v=(re,O)=>[re,0],w=(re,O)=>[0,O];break;case"middleRight":E=!0,v=(re,O)=>[re,O/2],w=(re,O)=>[0,O/2];break;case"bottomRight":b=!0,v=(re,O)=>[re,O],w=(re,O)=>[0,0];break;case"bottomMiddle":v=(re,O)=>[re/2,O],w=(re,O)=>[re/2,0];break;case"bottomLeft":b=!0,v=(re,O)=>[0,O],w=(re,O)=>[re,0];break;case"middleLeft":E=!0,v=(re,O)=>[0,O/2],w=(re,O)=>[re,O/2];break}let _=v(a,u),S=w(a,u),A=d(...S),M=St._round(o+A[0]),I=St._round(s+A[1]),q=1,Q=1,Z,ne;if(t.fromKeyboard)({deltaX:Z,deltaY:ne}=t);else{let{screenX:re,screenY:O}=t,[x,P]=l(this,sf);[Z,ne]=this.screenToPageTranslation(re-x,O-P),l(this,sf)[0]=re,l(this,sf)[1]=O}if([Z,ne]=y(Z/n,ne/i),b){let re=Math.hypot(a,u);q=Q=Math.max(Math.min(Math.hypot(S[0]-_[0]-Z,S[1]-_[1]-ne)/re,1/a,1/u),c/a,f/u)}else E?q=gn(Math.abs(S[0]-_[0]-Z),c,1)/a:Q=gn(Math.abs(S[1]-_[1]-ne),f,1)/u;let L=St._round(a*q),$=St._round(u*Q);A=d(...w(L,$));let X=M-A[0],ie=I-A[1];l(this,zi)||N(this,zi,[this.x,this.y,this.width,this.height]),this.width=L,this.height=$,this.x=X,this.y=ie,this.setDims(),this.fixAndSetPosition(),this._onResizing()},e6=function(){N(this,Ga,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height}),l(this,Tr)?.toggle(!1),this.parent.togglePointerEvents(!1)},t6=function(e,t,n){let o=.7*(n/t)+1-.7;if(o===1)return;let s=Y(this,wt,Iv).call(this,this.rotation),a=(M,I)=>[s[0]*M+s[2]*I,s[1]*M+s[3]*I],[u,c]=this.parentDimensions,f=this.x,h=this.y,d=this.width,g=this.height,y=St.MIN_SIZE/u,v=St.MIN_SIZE/c;o=Math.max(Math.min(o,1/d,1/g),y/d,v/g);let w=St._round(d*o),b=St._round(g*o);if(w===d&&b===g)return;l(this,zi)||N(this,zi,[f,h,d,g]);let E=a(d/2,g/2),_=St._round(f+E[0]),S=St._round(h+E[1]),A=a(w/2,b/2);this.x=_-A[0],this.y=S-A[1],this.width=w,this.height=b,this.setDims(),this.fixAndSetPosition(),this._onResizing()},r6=function(){l(this,Tr)?.toggle(!0),this.parent.togglePointerEvents(!0),Y(this,wt,kv).call(this)},wS=function(e){let{isMac:t}=Wr.platform;e.ctrlKey&&!t||e.shiftKey||e.metaKey&&t?this.parent.toggleSelected(this):this.parent.setSelected(this)},n6=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(),N(this,bu,null),N(this,of,!1),this._uiManager.endDragSession()||Y(this,wt,wS).call(this,c),n&&this._onStopDragging()};t&&(N(this,zd,e.clientX),N(this,Wd,e.clientY),N(this,bu,e.pointerId),N(this,L0,e.pointerType),window.addEventListener("pointermove",c=>{n||(n=!0,this._uiManager.toggleComment(this,!0,!1),this._onStartDragging());let{clientX:f,clientY:h,pointerId:d}=c;if(d!==l(this,bu)){Nr(c);return}let[g,y]=this.screenToPageTranslation(f-l(this,zd),h-l(this,Wd));N(this,zd,f),N(this,Wd,h),this._uiManager.dragSelectedEditors(g,y)},s),window.addEventListener("touchmove",Nr,s),window.addEventListener("pointerdown",c=>{c.pointerType===l(this,L0)&&(l(this,lf)||c.isPrimary)&&a(c),Nr(c)},s));let u=c=>{if(!l(this,bu)||l(this,bu)===c.pointerId){a(c);return}Nr(c)};window.addEventListener("pointerup",u,{signal:o}),window.addEventListener("blur",u,{signal:o})},vS=function(){if(l(this,wu)||!this.div)return;N(this,wu,new AbortController);let e=this._uiManager.combinedSignal(l(this,wu));this.div.addEventListener("focusin",this.focusin.bind(this),{signal:e}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:e})},i6=function(e){St._resizerKeyboardManager.exec(this,e)},s6=function(e){l(this,Va)&&e.relatedTarget?.parentNode!==l(this,Nn)&&Y(this,wt,Rm).call(this)},o6=function(e){N(this,P0,l(this,Va)?e:"")},ES=function(e){if(l(this,Js))for(let t of l(this,Js))t.tabIndex=e},Rm=function(){N(this,Va,!1),Y(this,wt,ES).call(this,-1),Y(this,wt,kv).call(this)},W(St,B0),He(St,"_l10n",null),He(St,"_l10nResizer",null),He(St,"_borderLineWidth",-1),He(St,"_colorManager",new uS),He(St,"_zIndex",1),He(St,"_telemetryTimeout",1e3);br=St,_S=class extends br{constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}},n3=3285377520,Es=4294901760,No=65535,hE=class{constructor(e){this.h1=e?e&4294967295:n3,this.h2=e?e&4294967295:n3}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 b=e.charCodeAt(v);b<=255?t[n++]=b:(t[n++]=b>>>8,t[n++]=b&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,d=461845907,g=h&No,y=d&No;for(let v=0;v<i;v++)v&1?(a=s[v],a=a*h&Es|a*g&No,a=a<<15|a>>>17,a=a*d&Es|a*y&No,c^=a,c=c<<13|c>>>19,c=c*5+3864292196):(u=s[v],u=u*h&Es|u*g&No,u=u<<15|u>>>17,u=u*d&Es|u*y&No,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&Es|a*g&No,a=a<<15|a>>>17,a=a*d&Es|a*y&No,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&Es|e*36045&No,t=t*4283543511&Es|((t<<16|e>>>16)*2950163797&Es)>>>16,e^=t>>>1,e=e*444984403&Es|e*60499&No,t=t*3301882366&Es|((t<<16|e>>>16)*3120437893&Es)>>>16,e^=t>>>1,(e>>>0).toString(16).padStart(8,"0")+(t>>>0).toString(16).padStart(8,"0")}},e0=Object.freeze({map:null,hash:"",transfer:void 0}),t0=class{constructor(){W(this,YE);W(this,uf,!1);W(this,cf,null);W(this,Xa,null);W(this,On,new Map);He(this,"onSetModified",null);He(this,"onResetModified",null);He(this,"onAnnotationEditor",null)}getValue(e,t){let n=l(this,On).get(e);return n===void 0?t:Object.assign(t,n)}getRawValue(e){return l(this,On).get(e)}remove(e){let t=l(this,On).get(e);if(t!==void 0&&(t instanceof br&&l(this,Xa).delete(t.annotationElementId),l(this,On).delete(e),l(this,On).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function")){for(let n of l(this,On).values())if(n instanceof br)return;this.onAnnotationEditor(null)}}setValue(e,t){let n=l(this,On).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,On).set(e,t);i&&Y(this,YE,a6).call(this),t instanceof br&&((l(this,Xa)||N(this,Xa,new Map)).set(t.annotationElementId,t),typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(t.constructor._type))}has(e){return l(this,On).has(e)}get size(){return l(this,On).size}resetModified(){l(this,uf)&&(N(this,uf,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new dE(this)}get serializable(){if(l(this,On).size===0)return e0;let e=new Map,t=new hE,n=[],i=Object.create(null),o=!1;for(let[s,a]of l(this,On)){let u=a instanceof br?a.serialize(!1,i):a;a.page&&(a.pageIndex=a.page._pageIndex,delete a.page),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}:e0}get editorStats(){let e=null,t=new Map,n=0,i=0;for(let o of l(this,On).values()){if(!(o instanceof br)){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.getOrInsertComputed(c,f1);h.set(f,(h.get(f)??0)+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(){N(this,cf,null)}updateEditor(e,t){let n=l(this,Xa)?.get(e);return n?(n.updateFromAnnotationLayer(t),!0):!1}getEditor(e){return l(this,Xa)?.get(e)||null}get modifiedIds(){if(l(this,cf))return l(this,cf);let e=[];if(l(this,Xa))for(let t of l(this,Xa).values())t.serialize()&&e.push(t.annotationElementId);return N(this,cf,{ids:new Set(e),hash:e.join(",")})}[Symbol.iterator](){return l(this,On).entries()}};uf=new WeakMap,cf=new WeakMap,Xa=new WeakMap,On=new WeakMap,YE=new WeakSet,a6=function(){l(this,uf)||(N(this,uf,!0),typeof this.onSetModified=="function"&&this.onSetModified())};dE=class extends t0{constructor(t){super();W(this,U0,e0);let{serializable:n}=t;if(n===e0)return;let{map:i,hash:o,transfer:s}=n,a=structuredClone(i,s?{transfer:s}:null);N(this,U0,{map:a,hash:o,transfer:[]})}get print(){Xt("Should not call PrintAnnotationStorage.print")}get serializable(){return l(this,U0)}get modifiedIds(){return _t(this,"modifiedIds",{ids:new Set,hash:""})}};U0=new WeakMap;AS=class{constructor({ownerDocument:e=globalThis.document,styleElement:t=null}){W(this,Hd,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,Hd).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:e,disableFontFace:t,_inspectFont:n}){if(!(!e||l(this,Hd).has(e.loadedName))){if(Wt(!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,Hd).add(i),n?.(e)}catch{Tt(`Cannot load system font: ${e.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(a)}return}Xt("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 Tt(`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 _t(this,"isFontLoadingAPISupported",e)}get isSyncFontLoadingSupported(){return _t(this,"isSyncFontLoadingSupported",oi||Wr.platform.isFirefox)}_queueLoadingCallback(e){function t(){for(Wt(!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 _t(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,M,I){let q=S.substring(0,A),Q=S.substring(A+M);return q+I+Q}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){Tt("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++}`,d=this._loadTestFont;d=i(d,976,h.length,h);let y=16,v=1482184792,w=n(d,y);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),d=i(d,y,4,BY(w));let b=`url(data:font/opentype;base64,${btoa(d)});`,E=`@font-face {font-family:"${h}";src:${b}}`;this.insertRule(E);let _=this._document.createElement("div");_.style.visibility="hidden",_.style.width=_.style.height="10px",_.style.position="absolute",_.style.top=_.style.left="0px";for(let S of[e.loadedName,h]){let A=this._document.createElement("span");A.textContent="Hi",A.style.fontFamily=S,_.append(A)}this._document.body.append(_),f(h,()=>{_.remove(),t.complete()})}};Hd=new WeakMap;xS=class{constructor(e,t=null,n,i){W(this,ar);this.compiledGlyphs=Object.create(null),N(this,ar,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,${this.data.toBase64()});`,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){Tt(`getPathGenerator - ignoring character: "${s}".`)}let o=R3(i?.path);return this.fontExtraProperties||e.delete(n),this.compiledGlyphs[t]=o}get black(){return l(this,ar).black}get bold(){return l(this,ar).bold}get disableFontFace(){return l(this,ar).disableFontFace??!1}set disableFontFace(e){_t(this,"disableFontFace",!!e)}get fontExtraProperties(){return l(this,ar).fontExtraProperties??!1}get isInvalidPDFjsFont(){return l(this,ar).isInvalidPDFjsFont}get isType3Font(){return l(this,ar).isType3Font}get italic(){return l(this,ar).italic}get missingFile(){return l(this,ar).missingFile}get remeasure(){return l(this,ar).remeasure}get vertical(){return l(this,ar).vertical}get ascent(){return l(this,ar).ascent}get defaultWidth(){return l(this,ar).defaultWidth}get descent(){return l(this,ar).descent}get bbox(){return l(this,ar).bbox}set bbox(e){_t(this,"bbox",e)}get fontMatrix(){return l(this,ar).fontMatrix}get fallbackName(){return l(this,ar).fallbackName}get loadedName(){return l(this,ar).loadedName}get mimetype(){return l(this,ar).mimetype}get name(){return l(this,ar).name}get data(){return l(this,ar).data}clearData(){l(this,ar).clearData()}get cssFontInfo(){return l(this,ar).cssFontInfo}get systemFontInfo(){return l(this,ar).systemFontInfo}get defaultVMetrics(){return l(this,ar).defaultVMetrics}};ar=new WeakMap;bd=class bd{constructor(e){W(this,Vd);W(this,qd);W(this,Gd);W(this,j0);N(this,qd,e),N(this,Gd,new DataView(l(this,qd))),N(this,j0,new TextDecoder)}static write(e){let t=new TextEncoder,n={},i=0;for(let c of bd.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 bd.strings){let f=n[c],h=f.length;a.setUint32(u,h),s.set(f,u+4),u+=4+h}return Wt(u===o.byteLength,"CssFontInfo.write: Buffer overflow"),o}get fontFamily(){return Y(this,Vd,Nv).call(this,0)}get fontWeight(){return Y(this,Vd,Nv).call(this,1)}get italicAngle(){return Y(this,Vd,Nv).call(this,2)}};qd=new WeakMap,Gd=new WeakMap,j0=new WeakMap,Vd=new WeakSet,Nv=function(e){Wt(e<bd.strings.length,"Invalid string index");let t=0;for(let i=0;i<e;i++)t+=l(this,Gd).getUint32(t)+4;let n=l(this,Gd).getUint32(t);return l(this,j0).decode(new Uint8Array(l(this,qd),t+4,n))},He(bd,"strings",["fontFamily","fontWeight","italicAngle"]);pE=bd,wd=class wd{constructor(e){W(this,hf);W(this,vu);W(this,Ho);W(this,ff);N(this,vu,e),N(this,Ho,new DataView(l(this,vu))),N(this,ff,new TextDecoder)}static write(e){let t=new TextEncoder,n={},i=0;for(let d of wd.strings){let g=t.encode(e[d]);n[d]=g,i+=4+g.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 d of wd.strings){let g=n[d],y=g.length;i+=4+y,f.setUint32(h,y),c.set(g,h+4),h+=4+y}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),Wt(h<=u.byteLength,"SubstitionInfo.write: Buffer overflow"),u.transferToFixedLength(h)}get guessFallback(){return l(this,Ho).getUint8(0)!==0}get css(){return Y(this,hf,Dm).call(this,0)}get loadedName(){return Y(this,hf,Dm).call(this,1)}get baseFontName(){return Y(this,hf,Dm).call(this,2)}get src(){return Y(this,hf,Dm).call(this,3)}get style(){let e=1;e+=4+l(this,Ho).getUint32(e);let t=l(this,Ho).getUint32(e),n=l(this,ff).decode(new Uint8Array(l(this,vu),e+4,t));e+=4+t;let i=l(this,Ho).getUint32(e),o=l(this,ff).decode(new Uint8Array(l(this,vu),e+4,i));return{style:n,weight:o}}};vu=new WeakMap,Ho=new WeakMap,ff=new WeakMap,hf=new WeakSet,Dm=function(e){Wt(e<wd.strings.length,"Invalid string index");let t=5;for(let i=0;i<e;i++)t+=l(this,Ho).getUint32(t)+4;let n=l(this,Ho).getUint32(t);return l(this,ff).decode(new Uint8Array(l(this,vu),t+4,n))},He(wd,"strings",["css","loadedName","baseFontName","src"]);gE=wd,Ct=class Ct{constructor({data:e,extra:t}){W(this,zr);W(this,qo);W(this,$0);W(this,lr);N(this,qo,e),N(this,$0,new TextDecoder),N(this,lr,new DataView(l(this,qo))),t&&Object.assign(this,t)}get black(){return Y(this,zr,Ys).call(this,0)}get bold(){return Y(this,zr,Ys).call(this,1)}get disableFontFace(){return Y(this,zr,Ys).call(this,2)}get fontExtraProperties(){return Y(this,zr,Ys).call(this,3)}get isInvalidPDFjsFont(){return Y(this,zr,Ys).call(this,4)}get isType3Font(){return Y(this,zr,Ys).call(this,5)}get italic(){return Y(this,zr,Ys).call(this,6)}get missingFile(){return Y(this,zr,Ys).call(this,7)}get remeasure(){return Y(this,zr,Ys).call(this,8)}get vertical(){return Y(this,zr,Ys).call(this,9)}get ascent(){return Y(this,zr,Ov).call(this,0)}get defaultWidth(){return Y(this,zr,Ov).call(this,1)}get descent(){return Y(this,zr,Ov).call(this,2)}get bbox(){let e=l(Ct,Yd);if(l(this,lr).getUint8(e)===0)return;e+=1;let n=[];for(let i=0;i<4;i++)n.push(l(this,lr).getInt16(e,!0)),e+=2;return n}get fontMatrix(){let e=l(Ct,Zd);if(l(this,lr).getUint8(e)===0)return;e+=1;let n=[];for(let i=0;i<6;i++)n.push(l(this,lr).getFloat64(e,!0)),e+=8;return n}get defaultVMetrics(){let e=l(Ct,Kd);if(l(this,lr).getUint8(e)===0)return;e+=1;let n=[];for(let i=0;i<3;i++)n.push(l(this,lr).getInt16(e,!0)),e+=2;return n}get fallbackName(){return Y(this,zr,Im).call(this,0)}get loadedName(){return Y(this,zr,Im).call(this,1)}get mimetype(){return Y(this,zr,Im).call(this,2)}get name(){return Y(this,zr,Im).call(this,3)}get data(){let e=l(Ct,Wi),t=l(this,lr).getUint32(e);e+=4+t;let n=l(this,lr).getUint32(e);e+=4+n;let i=l(this,lr).getUint32(e);e+=4+i;let o=l(this,lr).getUint32(e);if(o!==0)return new Uint8Array(l(this,qo),e+4,o)}clearData(){let e=l(Ct,Wi),t=l(this,lr).getUint32(e);e+=4+t;let n=l(this,lr).getUint32(e);e+=4+n;let i=l(this,lr).getUint32(e);e+=4+i;let o=l(this,lr).getUint32(e);new Uint8Array(l(this,qo),e+4,o).fill(0),l(this,lr).setUint32(e,0)}get cssFontInfo(){let e=l(Ct,Wi),t=l(this,lr).getUint32(e);e+=4+t;let n=l(this,lr).getUint32(e);e+=4+n;let i=l(this,lr).getUint32(e);if(i===0)return null;let o=new Uint8Array(i);return o.set(new Uint8Array(l(this,qo),e+4,i)),new pE(o.buffer)}get systemFontInfo(){let e=l(Ct,Wi),t=l(this,lr).getUint32(e);e+=4+t;let n=l(this,lr).getUint32(e);if(n===0)return null;let i=new Uint8Array(n);return i.set(new Uint8Array(l(this,qo),e+4,n)),new gE(i.buffer)}static write(e){let t=e.systemFontInfo?gE.write(e.systemFontInfo):null,n=e.cssFontInfo?pE.write(e.cssFontInfo):null,i=new TextEncoder,o={},s=0;for(let v of Ct.strings)o[v]=i.encode(e[v]),s+=4+o[v].length;let a=l(Ct,Wi)+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,d=Ct.bools.length,g=0,y=0;for(let v=0;v<d;v++){let w=e[Ct.bools[v]];g|=(w===void 0?0:w?2:1)<<y,y+=2,(y===8||v===d-1)&&(f.setUint8(h++,g),g=0,y=0)}Wt(h===l(Ct,Xd),"FontInfo.write: Boolean properties offset mismatch");for(let v of Ct.numbers)f.setFloat64(h,e[v]),h+=8;if(Wt(h===l(Ct,Yd),"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(Wt(h===l(Ct,Zd),"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(Wt(h===l(Ct,Kd),"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;Wt(h===l(Ct,Wi),"FontInfo.write: DefaultVMetrics properties offset mismatch"),f.setUint32(l(Ct,Wi),0),h+=4;for(let v of Ct.strings){let w=o[v],b=w.length;f.setUint32(h,b),c.set(w,h+4),h+=4+b}if(f.setUint32(l(Ct,Wi),h-l(Ct,Wi)-4),!t)f.setUint32(h,0),h+=4;else{let v=t.byteLength;f.setUint32(h,v),Wt(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),Wt(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),Wt(h<=u.byteLength,"FontInfo.write: Buffer overflow"),u.transferToFixedLength(h)}};Xd=new WeakMap,Yd=new WeakMap,Zd=new WeakMap,Kd=new WeakMap,Wi=new WeakMap,qo=new WeakMap,$0=new WeakMap,lr=new WeakMap,zr=new WeakSet,Ys=function(e){Wt(e<Ct.bools.length,"Invalid boolean index");let t=Math.floor(e/4),n=e*2%8,i=l(this,lr).getUint8(t)>>n&3;return i===0?void 0:i===2},Ov=function(e){return Wt(e<Ct.numbers.length,"Invalid number index"),l(this,lr).getFloat64(l(Ct,Xd)+e*8)},Im=function(e){Wt(e<Ct.strings.length,"Invalid string index");let t=l(Ct,Wi)+4;for(let o=0;o<e;o++)t+=l(this,lr).getUint32(t)+4;let n=l(this,lr).getUint32(t),i=new Uint8Array(n);return i.set(new Uint8Array(l(this,qo),t+4,n)),l(this,$0).decode(i)},He(Ct,"bools",["black","bold","disableFontFace","fontExtraProperties","isInvalidPDFjsFont","isType3Font","italic","missingFile","remeasure","vertical"]),He(Ct,"numbers",["ascent","defaultWidth","descent"]),He(Ct,"strings",["fallbackName","loadedName","mimetype","name"]),W(Ct,Xd,Math.ceil(Ct.bools.length*2/8)),W(Ct,Yd,l(Ct,Xd)+Ct.numbers.length*8),W(Ct,Zd,l(Ct,Yd)+1+8),W(Ct,Kd,l(Ct,Zd)+1+48),W(Ct,Wi,l(Ct,Kd)+1+6);SS=Ct,mr=class mr{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),d=s.length,g=a.length,y=0;for(let A of a)y+=1,y=Math.ceil(y/4)*4,y+=4+A.coords.length*4,y+=4+A.colors.length*4,A.verticesPerRow!==void 0&&(y+=4);let v=20+f*8+h*3+d*8+(n?16:0)+(c?3:0)+y,w=new ArrayBuffer(v),b=new DataView(w),E=new Uint8Array(w);b.setUint8(l(mr,z0),t),b.setUint8(l(mr,W0),n?1:0),b.setUint8(l(mr,H0),c?1:0),b.setUint8(l(mr,q0),u),b.setUint32(l(mr,G0),f,!0),b.setUint32(l(mr,V0),h,!0),b.setUint32(l(mr,X0),d,!0),b.setUint32(l(mr,Y0),g,!0);let _=20;new Float32Array(w,_,f*2).set(i),_+=f*8,E.set(o,_),_+=h*3;for(let[A,M]of s)b.setFloat32(_,A,!0),_+=4,b.setUint32(_,parseInt(M.slice(1),16),!0),_+=4;if(n)for(let A of n)b.setFloat32(_,A,!0),_+=4;c&&(E.set(c,_),_+=3);for(let A=0;A<a.length;A++){let M=a[A];b.setUint8(_,M.type),_+=1,_=Math.ceil(_/4)*4,b.setUint32(_,M.coords.length,!0),_+=4,new Int32Array(w,_,M.coords.length).set(M.coords),_+=M.coords.length*4,b.setUint32(_,M.colors.length,!0),_+=4,new Int32Array(w,_,M.colors.length).set(M.colors),_+=M.colors.length*4,M.verticesPerRow!==void 0&&(b.setUint32(_,M.verticesPerRow,!0),_+=4)}return w}getIR(){let e=this.view,t=this.data[l(mr,z0)],n=!!this.data[l(mr,W0)],i=!!this.data[l(mr,H0)],o=e.getUint32(l(mr,G0),!0),s=e.getUint32(l(mr,V0),!0),a=e.getUint32(l(mr,X0),!0),u=e.getUint32(l(mr,Y0),!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 d=[];for(let w=0;w<a;++w){let b=e.getFloat32(c,!0);c+=4;let E=e.getUint32(c,!0);c+=4,d.push([b,`#${E.toString(16).padStart(6,"0")}`])}let g=null;if(n){g=[];for(let w=0;w<4;++w)g.push(e.getFloat32(c,!0)),c+=4}let y=null;i&&(y=new Uint8Array(this.buffer,c,3),c+=3);let v=[];for(let w=0;w<u;++w){let b=e.getUint8(c);c+=1,c=Math.ceil(c/4)*4;let E=e.getUint32(c,!0);c+=4;let _=new Int32Array(this.buffer,c,E);c+=E*4;let S=e.getUint32(c,!0);c+=4;let A=new Int32Array(this.buffer,c,S);c+=S*4;let M={type:b,coords:_,colors:A};b===Yx.LATTICE&&(M.verticesPerRow=e.getUint32(c,!0),c+=4),v.push(M)}if(t===1)return["RadialAxial","axial",g,d,Array.from(f.slice(0,2)),Array.from(f.slice(2,4)),null,null];if(t===2)return["RadialAxial","radial",g,d,[f[0],f[1]],[f[3],f[4]],f[2],f[5]];if(t===3){let w=this.data[l(mr,q0)],b=null;if(f.length>0){let E=f[0],_=f[0],S=f[1],A=f[1];for(let M=0;M<f.length;M+=2){let I=f[M],q=f[M+1];E=E>I?I:E,S=S>q?q:S,_=_<I?I:_,A=A<q?q:A}b=[E,S,_,A]}return["Mesh",w,f,h,v,b,g,y]}throw new Error(`Unsupported pattern kind: ${t}`)}};z0=new WeakMap,W0=new WeakMap,H0=new WeakMap,q0=new WeakMap,G0=new WeakMap,V0=new WeakMap,X0=new WeakMap,Y0=new WeakMap,W(mr,z0,0),W(mr,W0,1),W(mr,H0,2),W(mr,q0,3),W(mr,G0,4),W(mr,V0,8),W(mr,X0,12),W(mr,Y0,16);TS=mr,CS=class{constructor(e){W(this,Jd);N(this,Jd,e)}static write(e){let t,n;return Wr.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 Wr.isFloat16ArraySupported?new Float16Array(l(this,Jd)):new Float32Array(l(this,Jd))}};Jd=new WeakMap;RS=r=>typeof r=="object"&&Number.isInteger(r?.num)&&r.num>=0&&Number.isInteger(r?.gen)&&r.gen>=0,GY=r=>typeof r=="object"&&typeof r?.name=="string",l6=zY.bind(null,RS,GY),DS=class{constructor(){W(this,Ya,new Map);W(this,ZE,Promise.resolve())}postMessage(e,t){let n={data:structuredClone(e,t?{transfer:t}:null)};l(this,ZE).then(()=>{for(let[i]of l(this,Ya))i.call(this,n)})}addEventListener(e,t,n=null){let i=null;if(n?.signal instanceof AbortSignal){let{signal:o}=n;if(o.aborted){Tt("LoopbackPort - cannot use an `aborted` signal.");return}let s=()=>this.removeEventListener(e,t);i=()=>o.removeEventListener("abort",s),o.addEventListener("abort",s)}l(this,Ya).set(t,i)}removeEventListener(e,t){l(this,Ya).get(t)?.(),l(this,Ya).delete(t)}terminate(){for(let[,e]of l(this,Ya))e?.();l(this,Ya).clear()}};Ya=new WeakMap,ZE=new WeakMap;gv={DATA:1,ERROR:2},Qr={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};Wc=class{constructor(e,t,n){W(this,js);W(this,Qd,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",Y(this,js,u6).bind(this),{signal:l(this,Qd).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:Qr.PULL,streamId:o,desiredSize:c.desiredSize}),f.promise},cancel:c=>{Wt(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:Qr.CANCEL,streamId:o,reason:_i(c)}),f.promise}},n)}destroy(){l(this,Qd)?.abort(),N(this,Qd,null)}};Qd=new WeakMap,js=new WeakSet,u6=function({data:e}){if(e.targetName!==this.sourceName)return;if(e.stream){Y(this,js,f6).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===gv.DATA)i.resolve(e.data);else if(e.callback===gv.ERROR)i.reject(_i(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:gv.DATA,callbackId:e.callbackId,data:s})},function(s){o.postMessage({sourceName:n,targetName:i,callback:gv.ERROR,callbackId:e.callbackId,reason:_i(s)})});return}if(e.streamId){Y(this,js,c6).call(this,e);return}t(e.data)},c6=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 d=this.desiredSize;this.desiredSize-=f,d>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),o.postMessage({sourceName:n,targetName:i,stream:Qr.ENQUEUE,streamId:t,chunk:c},h)},close(){this.isCancelled||(this.isCancelled=!0,o.postMessage({sourceName:n,targetName:i,stream:Qr.CLOSE,streamId:t}),delete s.streamSinks[t])},error(c){Wt(c instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,o.postMessage({sourceName:n,targetName:i,stream:Qr.ERROR,streamId:t,reason:_i(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:Qr.START_COMPLETE,streamId:t,success:!0})},function(c){o.postMessage({sourceName:n,targetName:i,stream:Qr.START_COMPLETE,streamId:t,reason:_i(c)})})},f6=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 Qr.START_COMPLETE:e.success?s.startCall.resolve():s.startCall.reject(_i(e.reason));break;case Qr.PULL_COMPLETE:e.success?s.pullCall.resolve():s.pullCall.reject(_i(e.reason));break;case Qr.PULL:if(!a){o.postMessage({sourceName:n,targetName:i,stream:Qr.PULL_COMPLETE,streamId:t,success:!0});break}a.desiredSize<=0&&e.desiredSize>0&&a.sinkCapability.resolve(),a.desiredSize=e.desiredSize,Promise.try(a.onPull||i3).then(function(){o.postMessage({sourceName:n,targetName:i,stream:Qr.PULL_COMPLETE,streamId:t,success:!0})},function(c){o.postMessage({sourceName:n,targetName:i,stream:Qr.PULL_COMPLETE,streamId:t,reason:_i(c)})});break;case Qr.ENQUEUE:if(Wt(s,"enqueue should have stream controller"),s.isClosed)break;s.controller.enqueue(e.chunk);break;case Qr.CLOSE:if(Wt(s,"close should have stream controller"),s.isClosed)break;s.isClosed=!0,s.controller.close(),Y(this,js,Lv).call(this,s,t);break;case Qr.ERROR:Wt(s,"error should have stream controller"),s.controller.error(_i(e.reason)),Y(this,js,Lv).call(this,s,t);break;case Qr.CANCEL_COMPLETE:e.success?s.cancelCall.resolve():s.cancelCall.reject(_i(e.reason)),Y(this,js,Lv).call(this,s,t);break;case Qr.CANCEL:if(!a)break;let u=_i(e.reason);Promise.try(a.onCancel||i3,u).then(function(){o.postMessage({sourceName:n,targetName:i,stream:Qr.CANCEL_COMPLETE,streamId:t,success:!0})},function(c){o.postMessage({sourceName:n,targetName:i,stream:Qr.CANCEL_COMPLETE,streamId:t,reason:_i(c)})}),a.sinkCapability.reject(u),a.isCancelled=!0,delete this.streamSinks[t];break;default:throw new Error("Unexpected stream case")}},Lv=async function(e,t){await Promise.allSettled([e.startCall?.promise,e.pullCall?.promise,e.cancelCall?.promise]),delete this.streamControllers[t]};mE=class{constructor({enableHWA:e=!1}){W(this,Z0,!1);N(this,Z0,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,Z0)})}}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){Xt("Abstract method `_createCanvas` called.")}};Z0=new WeakMap;IS=class extends mE{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}},yE=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){Xt("Abstract method `_fetch` called.")}},bE=class extends yE{async _fetch(e){let t=await og(e,this.isCompressed?"bytes":"text");return t instanceof Uint8Array?t:c1(t)}},wE=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){}},kS=class extends wE{constructor({docId:t,ownerDocument:n=globalThis.document}){super();W(this,ct);W(this,df);W(this,ep);W(this,Za);W(this,Ka);W(this,Vn);W(this,pf);W(this,gf,0);N(this,Ka,t),N(this,Vn,n)}addFilter(t){if(!t)return"none";let n=l(this,ct,Wn).get(t);if(n)return n;let[i,o,s]=Y(this,ct,Pv).call(this,t),a=t.length===1?i:`${i}${o}${s}`;if(n=l(this,ct,Wn).get(a),n)return l(this,ct,Wn).set(t,n),n;let u=`g_${l(this,Ka)}_transfer_map_${ln(this,gf)._++}`,c=Y(this,ct,ud).call(this,u);l(this,ct,Wn).set(t,c),l(this,ct,Wn).set(a,c);let f=Y(this,ct,cd).call(this,u);return Y(this,ct,Om).call(this,i,o,s,f),c}addHCMFilter(t,n){let i=`${t}-${n}`,o="base",s=l(this,ct,km).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,ct,km).set(o,s)),!t||!n))return s.url;let a=Y(this,ct,Lm).call(this,t);t=at.makeHexColor(...a);let u=Y(this,ct,Lm).call(this,n);if(n=at.makeHexColor(...u),l(this,ct,ld).style.color="",t==="#000000"&&n==="#ffffff"||t===n)return s.url;let c=new Array(256);for(let y=0;y<=255;y++){let v=y/255;c[y]=v<=.03928?v/12.92:((v+.055)/1.055)**2.4}let f=c.join(","),h=`g_${l(this,Ka)}_hcm_filter`,d=s.filter=Y(this,ct,cd).call(this,h);Y(this,ct,Om).call(this,f,f,f,d),Y(this,ct,NS).call(this,d);let g=(y,v)=>{let w=a[y]/255,b=u[y]/255,E=new Array(v+1);for(let _=0;_<=v;_++)E[_]=w+_/v*(b-w);return E.join(",")};return Y(this,ct,Om).call(this,g(0,5),g(1,5),g(2,5),d),s.url=Y(this,ct,ud).call(this,h),s.url}addAlphaFilter(t){let n=l(this,ct,Wn).get(t);if(n)return n;let[i]=Y(this,ct,Pv).call(this,[t]),o=`alpha_${i}`;if(n=l(this,ct,Wn).get(o),n)return l(this,ct,Wn).set(t,n),n;let s=`g_${l(this,Ka)}_alpha_map_${ln(this,gf)._++}`,a=Y(this,ct,ud).call(this,s);l(this,ct,Wn).set(t,a),l(this,ct,Wn).set(o,a);let u=Y(this,ct,cd).call(this,s);return Y(this,ct,OS).call(this,i,u),a}addLuminosityFilter(t){let n=l(this,ct,Wn).get(t||"luminosity");if(n)return n;let i,o;if(t?([i]=Y(this,ct,Pv).call(this,[t]),o=`luminosity_${i}`):o="luminosity",n=l(this,ct,Wn).get(o),n)return l(this,ct,Wn).set(t,n),n;let s=`g_${l(this,Ka)}_luminosity_map_${ln(this,gf)._++}`,a=Y(this,ct,ud).call(this,s);l(this,ct,Wn).set(t,a),l(this,ct,Wn).set(o,a);let u=Y(this,ct,cd).call(this,s);return Y(this,ct,h6).call(this,u),t&&Y(this,ct,OS).call(this,i,u),a}addHighlightHCMFilter(t,n,i,o,s){let a=`${n}-${i}-${o}-${s}`,u=l(this,ct,km).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,ct,km).set(t,u)),!n||!i))return u.url;let[c,f]=[n,i].map(Y(this,ct,Lm).bind(this)),h=Math.round(.2126*c[0]+.7152*c[1]+.0722*c[2]),d=Math.round(.2126*f[0]+.7152*f[1]+.0722*f[2]),[g,y]=[o,s].map(Y(this,ct,Lm).bind(this));d<h&&([h,d,g,y]=[d,h,y,g]),l(this,ct,ld).style.color="";let v=(E,_,S)=>{let A=new Array(256),M=(d-h)/S,I=E/255,q=(_-E)/(255*S),Q=0;for(let Z=0;Z<=S;Z++){let ne=Math.round(h+Z*M),L=I+Z*q;for(let $=Q;$<=ne;$++)A[$]=L;Q=ne+1}for(let Z=Q;Z<256;Z++)A[Z]=A[Q-1];return A.join(",")},w=`g_${l(this,Ka)}_hcm_${t}_filter`,b=u.filter=Y(this,ct,cd).call(this,w);return Y(this,ct,NS).call(this,b),Y(this,ct,Om).call(this,v(g[0],y[0],5),v(g[1],y[1],5),v(g[2],y[2],5),b),u.url=Y(this,ct,ud).call(this,w),u.url}destroy(t=!1){t&&l(this,pf)?.size||(l(this,Za)?.parentNode.parentNode.remove(),N(this,Za,null),l(this,ep)?.clear(),N(this,ep,null),l(this,pf)?.clear(),N(this,pf,null),N(this,gf,0))}};df=new WeakMap,ep=new WeakMap,Za=new WeakMap,Ka=new WeakMap,Vn=new WeakMap,pf=new WeakMap,gf=new WeakMap,ct=new WeakSet,Wn=function(){return l(this,ep)||N(this,ep,new Map)},km=function(){return l(this,pf)||N(this,pf,new Map)},ld=function(){if(!l(this,Za)){let t=l(this,Vn).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,Vn).createElementNS(Oa,"svg");i.setAttribute("width",0),i.setAttribute("height",0),N(this,Za,l(this,Vn).createElementNS(Oa,"defs")),t.append(i),i.append(l(this,Za)),l(this,Vn).body.append(t)}return l(this,Za)},Pv=function(t){if(t.length===1){let c=t[0],f=new Array(256);for(let d=0;d<256;d++)f[d]=c[d]/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(",")]},ud=function(t){if(l(this,df)===void 0){N(this,df,"");let n=l(this,Vn).URL;n!==l(this,Vn).baseURI&&(ub(n)?Tt('#createUrl: ignore "data:"-URL for performance reasons.'):N(this,df,CC(n,"")))}return`url(${l(this,df)}#${t})`},h6=function(t){let n=l(this,Vn).createElementNS(Oa,"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)},NS=function(t){let n=l(this,Vn).createElementNS(Oa,"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)},cd=function(t){let n=l(this,Vn).createElementNS(Oa,"filter");return n.setAttribute("color-interpolation-filters","sRGB"),n.setAttribute("id",t),l(this,ct,ld).append(n),n},Nm=function(t,n,i){let o=l(this,Vn).createElementNS(Oa,n);o.setAttribute("type","discrete"),o.setAttribute("tableValues",i),t.append(o)},Om=function(t,n,i,o){let s=l(this,Vn).createElementNS(Oa,"feComponentTransfer");o.append(s),Y(this,ct,Nm).call(this,s,"feFuncR",t),Y(this,ct,Nm).call(this,s,"feFuncG",n),Y(this,ct,Nm).call(this,s,"feFuncB",i)},OS=function(t,n){let i=l(this,Vn).createElementNS(Oa,"feComponentTransfer");n.append(i),Y(this,ct,Nm).call(this,i,"feFuncA",t)},Lm=function(t){return l(this,ct,ld).style.color=t,ag(getComputedStyle(l(this,ct,ld)).getPropertyValue("color"))};vE=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){Xt("Abstract method `_fetch` called.")}},EE=class extends vE{async _fetch(e){return og(e,"bytes")}},_E=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){Xt("Abstract method `_fetch` called.")}},AE=class extends _E{async _fetch(e){return og(e,"bytes")}};oi&&Tt("Please use the `legacy` build in Node.js environments.");LS=class extends wE{},PS=class extends mE{_createCanvas(e,t){return $e.getBuiltinModule("module").createRequire("")("@napi-rs/canvas").createCanvas(e,t)}},FS=class extends yE{async _fetch(e){return kC(e)}},MS=class extends vE{async _fetch(e){return kC(e)}},BS=class extends _E{async _fetch(e){return kC(e)}},sd="__forcedDependency",{floor:s3,ceil:o3}=Math;US=new Uint32Array(new Uint8Array([255,255,0,0]).buffer)[0],jS=class{constructor(e,t){W(this,tp);W(this,Eu);N(this,tp,e),N(this,Eu,t)}get length(){return l(this,tp).length}isEmpty(e){return l(this,tp)[e]===US}minX(e){return l(this,Eu)[e*4+0]/256}minY(e){return l(this,Eu)[e*4+1]/256}maxX(e){return(l(this,Eu)[e*4+2]+1)/256}maxY(e){return(l(this,Eu)[e*4+3]+1)/256}};tp=new WeakMap,Eu=new WeakMap;yv=(r,e)=>r?.getOrInsertComputed(e,()=>({dependencies:new Set,isRenderingOperation:!1})),$S=class{constructor(e,t,n=!1){W(this,J0);W(this,Si,{__proto__:null});W(this,Ti,{__proto__:null,transform:[],moveText:[],sameLineText:[],[sd]:[]});W(this,mf,new Map);W(this,Qs,[]);W(this,yf,[]);W(this,Ja,[[1,0,0,1,0,0]]);W(this,rr,[-1/0,-1/0,1/0,1/0]);W(this,ur,new Float64Array([1/0,1/0,-1/0,-1/0]));W(this,Qa,-1);W(this,Ci,new Set);W(this,K0,new Map);W(this,rp,new Map);W(this,bf);W(this,wf);W(this,el);W(this,Xn);W(this,Go);N(this,bf,e.width),N(this,wf,e.height),Y(this,J0,zS).call(this,t),n&&N(this,Go,new Map)}growOperationsCount(e){e>=l(this,Xn).length&&Y(this,J0,zS).call(this,e,l(this,Xn))}save(e){return N(this,Si,{__proto__:l(this,Si)}),N(this,Ti,{__proto__:l(this,Ti),transform:{__proto__:l(this,Ti).transform},moveText:{__proto__:l(this,Ti).moveText},sameLineText:{__proto__:l(this,Ti).sameLineText},[sd]:{__proto__:l(this,Ti)[sd]}}),N(this,rr,{__proto__:l(this,rr)}),l(this,Qs).push(e),this}restore(e){let t=Object.getPrototypeOf(l(this,Si));if(t===null)return this;N(this,Si,t),N(this,Ti,Object.getPrototypeOf(l(this,Ti))),N(this,rr,Object.getPrototypeOf(l(this,rr)));let n=l(this,Qs).pop();return n!==void 0&&(yv(l(this,Go),e)?.dependencies.add(n),l(this,Xn)[e]=l(this,Xn)[n]),this}recordOpenMarker(e){return l(this,Qs).push(e),this}getOpenMarker(){return l(this,Qs).length===0?null:l(this,Qs).at(-1)}recordCloseMarker(e){let t=l(this,Qs).pop();return t!==void 0&&(yv(l(this,Go),e)?.dependencies.add(t),l(this,Xn)[e]=l(this,Xn)[t]),this}beginMarkedContent(e){return l(this,yf).push(e),this}endMarkedContent(e){let t=l(this,yf).pop();return t!==void 0&&(yv(l(this,Go),e)?.dependencies.add(t),l(this,Xn)[e]=l(this,Xn)[t]),this}pushBaseTransform(e){return l(this,Ja).push(at.multiplyByDOMMatrix(l(this,Ja).at(-1),e.getTransform())),this}popBaseTransform(){return l(this,Ja).length>1&&l(this,Ja).pop(),this}recordSimpleData(e,t){return l(this,Si)[e]=t,this}recordIncrementalData(e,t){return l(this,Ti)[e].push(t),this}resetIncrementalData(e,t){return l(this,Ti)[e].length=0,this}recordNamedData(e,t){return l(this,mf).set(e,t),this}recordSimpleDataFromNamed(e,t,n){l(this,Si)[e]=l(this,mf).get(t)??n}recordFutureForcedDependency(e,t){return this.recordIncrementalData(sd,t),this}inheritSimpleDataAsFutureForcedDependencies(e){for(let t of e)t in l(this,Si)&&this.recordFutureForcedDependency(t,l(this,Si)[t]);return this}inheritPendingDependenciesAsFutureForcedDependencies(){for(let e of l(this,Ci))this.recordFutureForcedDependency(sd,e);return this}resetBBox(e){return l(this,Qa)!==e&&(N(this,Qa,e),l(this,ur)[0]=1/0,l(this,ur)[1]=1/0,l(this,ur)[2]=-1/0,l(this,ur)[3]=-1/0),this}recordClipBox(e,t,n,i,o,s){let a=at.multiplyByDOMMatrix(l(this,Ja).at(-1),t.getTransform()),u=[1/0,1/0,-1/0,-1/0];at.axialAlignedBoundingBox([n,o,i,s],a,u);let c=at.intersect(l(this,rr),u);return c?(l(this,rr)[0]=c[0],l(this,rr)[1]=c[1],l(this,rr)[2]=c[2],l(this,rr)[3]=c[3]):(l(this,rr)[0]=l(this,rr)[1]=1/0,l(this,rr)[2]=l(this,rr)[3]=-1/0),this}recordBBox(e,t,n,i,o,s){let a=l(this,rr);if(a[0]===1/0)return this;let u=at.multiplyByDOMMatrix(l(this,Ja).at(-1),t.getTransform());if(a[0]===-1/0)return at.axialAlignedBoundingBox([n,o,i,s],u,l(this,ur)),this;let c=[1/0,1/0,-1/0,-1/0];return at.axialAlignedBoundingBox([n,o,i,s],u,c),l(this,ur)[0]=Math.min(l(this,ur)[0],Math.max(c[0],a[0])),l(this,ur)[1]=Math.min(l(this,ur)[1],Math.max(c[1],a[1])),l(this,ur)[2]=Math.max(l(this,ur)[2],Math.min(c[2],a[2])),l(this,ur)[3]=Math.max(l(this,ur)[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,rp).get(n),c!==!1&&(f=[0,0,0,0],at.axialAlignedBoundingBox(u,n.fontMatrix,f),(i!==1||o!==0||s!==0)&&at.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,rp).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,ur)[0]=Math.max(0,l(this,rr)[0]),l(this,ur)[1]=Math.max(0,l(this,rr)[1]),l(this,ur)[2]=Math.min(l(this,bf),l(this,rr)[2]),l(this,ur)[3]=Math.min(l(this,wf),l(this,rr)[3]),this}getSimpleIndex(e){return l(this,Si)[e]}recordDependencies(e,t){let n=l(this,Ci),i=l(this,Si),o=l(this,Ti);for(let s of t)s in l(this,Si)?n.add(i[s]):s in o&&o[s].forEach(n.add,n);return this}recordNamedDependency(e,t){return l(this,mf).has(t)&&l(this,Ci).add(l(this,mf).get(t)),this}recordOperation(e,t=!1){if(this.recordDependencies(e,[sd]),l(this,Go)){let n=yv(l(this,Go),e),{dependencies:i}=n;l(this,Ci).forEach(i.add,i),l(this,Qs).forEach(i.add,i),l(this,yf).forEach(i.add,i),i.delete(e),n.isRenderingOperation=!0}if(l(this,Qa)===e){let n=s3(l(this,ur)[0]*256/l(this,bf)),i=s3(l(this,ur)[1]*256/l(this,wf)),o=o3(l(this,ur)[2]*256/l(this,bf)),s=o3(l(this,ur)[3]*256/l(this,wf));mv(l(this,el),e,n,i,o,s);for(let a of l(this,Ci))a!==e&&mv(l(this,el),a,n,i,o,s);for(let a of l(this,Qs))a!==e&&mv(l(this,el),a,n,i,o,s);for(let a of l(this,yf))a!==e&&mv(l(this,el),a,n,i,o,s);t||(l(this,Ci).clear(),N(this,Qa,-1))}return this}recordShowTextOperation(e,t=!1){let n=Array.from(l(this,Ci));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,Qa)===e&&(N(this,Qa,-1),l(this,rr)[0]=Math.max(l(this,rr)[0],l(this,ur)[0]),l(this,rr)[1]=Math.max(l(this,rr)[1],l(this,ur)[1]),l(this,rr)[2]=Math.min(l(this,rr)[2],l(this,ur)[2]),l(this,rr)[3]=Math.min(l(this,rr)[3],l(this,ur)[3]),t||l(this,Ci).clear()),this}_takePendingDependencies(){let e=l(this,Ci);return N(this,Ci,new Set),e}_extractOperation(e){let t=l(this,K0).get(e);return l(this,K0).delete(e),t}_pushPendingDependencies(e){for(let t of e)l(this,Ci).add(t)}take(){return l(this,rp).clear(),new jS(l(this,Xn),l(this,el))}takeDebugMetadata(){return l(this,Go)}};Si=new WeakMap,Ti=new WeakMap,mf=new WeakMap,Qs=new WeakMap,yf=new WeakMap,Ja=new WeakMap,rr=new WeakMap,ur=new WeakMap,Qa=new WeakMap,Ci=new WeakMap,K0=new WeakMap,rp=new WeakMap,bf=new WeakMap,wf=new WeakMap,el=new WeakMap,Xn=new WeakMap,Go=new WeakMap,J0=new WeakSet,zS=function(e,t){let n=new ArrayBuffer(e*4);N(this,el,new Uint8ClampedArray(n)),N(this,Xn,new Uint32Array(n)),t&&t.length>0?(l(this,Xn).set(t),l(this,Xn).fill(US,t.length)):l(this,Xn).fill(US)};LC=class LC{constructor(e,t,n){W(this,gr);W(this,Ur);W(this,eo);W(this,np,0);W(this,ip,0);if(e instanceof LC&&l(e,eo)===!!n)return e;N(this,gr,e),N(this,Ur,t),N(this,eo,!!n)}growOperationsCount(){throw new Error("Unreachable")}save(e){return ln(this,ip)._++,l(this,gr).save(l(this,Ur)),this}restore(e){return l(this,ip)>0&&(l(this,gr).restore(l(this,Ur)),ln(this,ip)._--),this}recordOpenMarker(e){return ln(this,np)._++,this}getOpenMarker(){return l(this,np)>0?l(this,Ur):l(this,gr).getOpenMarker()}recordCloseMarker(e){return ln(this,np)._--,this}beginMarkedContent(e){return this}endMarkedContent(e){return this}pushBaseTransform(e){return l(this,gr).pushBaseTransform(e),this}popBaseTransform(){return l(this,gr).popBaseTransform(),this}recordSimpleData(e,t){return l(this,gr).recordSimpleData(e,l(this,Ur)),this}recordIncrementalData(e,t){return l(this,gr).recordIncrementalData(e,l(this,Ur)),this}resetIncrementalData(e,t){return l(this,gr).resetIncrementalData(e,l(this,Ur)),this}recordNamedData(e,t){return this}recordSimpleDataFromNamed(e,t,n){return l(this,gr).recordSimpleDataFromNamed(e,t,l(this,Ur)),this}recordFutureForcedDependency(e,t){return l(this,gr).recordFutureForcedDependency(e,l(this,Ur)),this}inheritSimpleDataAsFutureForcedDependencies(e){return l(this,gr).inheritSimpleDataAsFutureForcedDependencies(e),this}inheritPendingDependenciesAsFutureForcedDependencies(){return l(this,gr).inheritPendingDependenciesAsFutureForcedDependencies(),this}resetBBox(e){return l(this,eo)||l(this,gr).resetBBox(l(this,Ur)),this}recordClipBox(e,t,n,i,o,s){return l(this,eo)||l(this,gr).recordClipBox(l(this,Ur),t,n,i,o,s),this}recordBBox(e,t,n,i,o,s){return l(this,eo)||l(this,gr).recordBBox(l(this,Ur),t,n,i,o,s),this}recordCharacterBBox(e,t,n,i,o,s,a){return l(this,eo)||l(this,gr).recordCharacterBBox(l(this,Ur),t,n,i,o,s,a),this}recordFullPageBBox(e){return l(this,eo)||l(this,gr).recordFullPageBBox(l(this,Ur)),this}getSimpleIndex(e){return l(this,gr).getSimpleIndex(e)}recordDependencies(e,t){return l(this,gr).recordDependencies(l(this,Ur),t),this}recordNamedDependency(e,t){return l(this,gr).recordNamedDependency(l(this,Ur),t),this}recordOperation(e){return l(this,gr).recordOperation(l(this,Ur),!0),this}recordShowTextOperation(e){return l(this,gr).recordShowTextOperation(l(this,Ur),!0),this}bboxToClipBoxDropOperation(e){return l(this,eo)||l(this,gr).bboxToClipBoxDropOperation(l(this,Ur),!0),this}take(){throw new Error("Unreachable")}takeDebugMetadata(){throw new Error("Unreachable")}};gr=new WeakMap,Ur=new WeakMap,eo=new WeakMap,np=new WeakMap,ip=new WeakMap;xE=LC,_s={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"]},Fn={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};r0=class{isModifyingCurrentTransform(){return!1}getPattern(){Xt("Abstract method `getPattern` called.")}},HS=class extends r0{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(),at.applyTransform(i,t),at.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);at.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===Fn.STROKE||i===Fn.FILL){if(this.isOriginBased()){let d=at.transform(n,t.baseTransform);this.matrix&&(d=at.transform(d,this.matrix));let g=.001,y=Math.hypot(d[0],d[1]),v=Math.hypot(d[2],d[3]),w=(d[0]*d[2]+d[1]*d[3])/(y*v);if(Math.abs(w)<g)if(this.isRadial()){if(Math.abs(y-v)<g)return this._createGradient(e,d)}else return this._createGradient(e,d)}let s=t.current.getClippedPathBoundingBox(i,kr(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=at.transform(n,[1,0,0,1,s[0],s[1]]),f.transform(...t.baseTransform),this.matrix&&f.transform(...this.matrix),WS(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 WS(e,this._bbox),o=this._createGradient(e);return o}};qS=class extends r0{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),d=Math.min(Math.ceil(Math.abs(f*e[1]*1.1)),3e3),g=c/h,y=f/d,v={coords:this._coords,colors:this._colors,offsetX:-a,offsetY:-u,scaleX:1/g,scaleY:1/y},w=h+4,b=d+4,E=n.getCanvas("mesh",w,b),_=E.context,S=_.createImageData(h,d);if(t){let M=S.data;for(let I=0,q=M.length;I<q;I+=4)M[I]=t[0],M[I+1]=t[1],M[I+2]=t[2],M[I+3]=255}for(let M of this._figures)VY(S,M,v);return _.putImageData(S,2,2),{canvas:E.canvas,offsetX:a-2*g,offsetY:u-2*y,scaleX:g,scaleY:y}}isModifyingCurrentTransform(){return!0}getPattern(e,t,n,i){WS(e,this._bbox);let o=new Float32Array(2);if(i===Fn.SHADING)at.singularValueDecompose2dScale(kr(e),o);else if(this.matrix){at.singularValueDecompose2dScale(this.matrix,o);let[a,u]=o;at.singularValueDecompose2dScale(t.baseTransform,o),o[0]*=a,o[1]*=u}else at.singularValueDecompose2dScale(t.baseTransform,o);let s=this._createMeshCanvas(o,i===Fn.SHADING?null:this._background,t.cachedCanvases);return i!==Fn.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")}},GS=class extends r0{getPattern(){return"hotpink"}};a3={COLORED:1,UNCOLORED:2},KE=class KE{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),u1("TilingType: "+s);let h=n[0],d=n[1],g=n[2],y=n[3],v=g-h,w=y-d,b=new Float32Array(2);at.singularValueDecompose2dScale(this.matrix,b);let[E,_]=b;at.singularValueDecompose2dScale(this.baseTransform,b);let S=E*b[0],A=_*b[1],M=v,I=w,q=!1,Q=!1,Z=Math.ceil(c*S),ne=Math.ceil(f*A),L=Math.ceil(v*S),$=Math.ceil(w*A);Z>=L?M=c:q=!0,ne>=$?I=f:Q=!0;let X=this.getSizeAndScale(M,this.ctx.canvas.width,S),ie=this.getSizeAndScale(I,this.ctx.canvas.height,A),re=e.cachedCanvases.getCanvas("pattern",X.size,ie.size),O=re.context,x=u.createCanvasGraphics(O,t);if(x.groupLevel=e.groupLevel,this.setFillAndStrokeStyleToContext(x,o,a),O.translate(-X.scale*h,-ie.scale*d),x.transform(0,X.scale,0,0,ie.scale,0,0),O.save(),x.dependencyTracker?.save(),this.clipBbox(x,h,d,g,y),x.baseTransform=kr(x.ctx),x.executeOperatorList(i),x.endDrawing(),x.dependencyTracker?.restore(),O.restore(),q||Q){let P=re.canvas;q&&(M=c),Q&&(I=f);let C=this.getSizeAndScale(M,this.ctx.canvas.width,S),j=this.getSizeAndScale(I,this.ctx.canvas.height,A),U=C.size,B=j.size,ee=e.cachedCanvases.getCanvas("pattern-workaround",U,B),fe=ee.context,Ee=q?Math.floor(v/c):0,te=Q?Math.floor(w/f):0;for(let H=0;H<=Ee;H++)for(let ae=0;ae<=te;ae++)fe.drawImage(P,U*H,B*ae,U,B,0,0,U,B);return{canvas:ee.canvas,scaleX:C.scale,scaleY:j.scale,offsetX:h,offsetY:d}}return{canvas:re.canvas,scaleX:X.scale,scaleY:ie.scale,offsetX:h,offsetY:d}}getSizeAndScale(e,t,n){let i=Math.max(KE.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),at.axialAlignedBoundingBox([t,n,i,o],kr(e.ctx),e.current.minMax),e.clip(),e.endPath()}setFillAndStrokeStyleToContext(e,t,n){let i=e.ctx,o=e.current;switch(t){case a3.COLORED:let{fillStyle:s,strokeStyle:a}=this.ctx;i.fillStyle=o.fillColor=s,i.strokeStyle=o.strokeColor=a;break;case a3.UNCOLORED:i.fillStyle=i.strokeStyle=n,o.fillColor=o.strokeColor=n;break;default:throw new Kx(`Unsupported paint type: ${t}`)}}isModifyingCurrentTransform(){return!1}getPattern(e,t,n,i,o){let s=n;i!==Fn.SHADING&&(s=at.transform(s,t.baseTransform),this.matrix&&(s=at.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}};He(KE,"MAX_PATTERN_SIZE",3e3);VS=KE;l3=16,u3=100,ZY=15,c3=10,Ni=16,Gx=new DOMMatrix,ss=new Float32Array(2),md=new Float32Array([1/0,1/0,-1/0,-1/0]);XS=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]}}};SE=class{constructor(e,t,n){He(this,"alphaIsShape",!1);He(this,"fontSize",0);He(this,"fontSizeScale",1);He(this,"textMatrix",null);He(this,"textMatrixScale",1);He(this,"fontMatrix",Xx);He(this,"leading",0);He(this,"x",0);He(this,"y",0);He(this,"lineX",0);He(this,"lineY",0);He(this,"charSpacing",0);He(this,"wordSpacing",0);He(this,"textHScale",1);He(this,"textRenderingMode",hn.FILL);He(this,"textRise",0);He(this,"fillColor","#000000");He(this,"strokeColor","#000000");He(this,"patternFill",!1);He(this,"patternStroke",!1);He(this,"fillAlpha",1);He(this,"strokeAlpha",1);He(this,"lineWidth",1);He(this,"activeSMask",null);He(this,"transferMaps","none");n?.(this),this.clipBox=new Float32Array([0,0,e,t]),this.minMax=md.slice()}clone(){let e=Object.create(this);return e.clipBox=this.clipBox.slice(),e.minMax=this.minMax.slice(),e}getPathBoundingBox(e=Fn.FILL,t=null){let n=this.minMax.slice();if(e===Fn.STROKE){t||Xt("Stroke bounding box must include transform."),at.singularValueDecompose2dScale(t,ss);let i=ss[0]*this.lineWidth/2,o=ss[1]*this.lineWidth/2;n[0]-=i,n[1]-=o,n[2]+=i,n[3]+=o}return n}updateClipFromPath(){let e=at.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(md,0)}getClippedPathBoundingBox(e=Fn.FILL,t=null){return at.intersect(this.clipBox,this.getPathBoundingBox(e,t))}};JY=["butt","round","square"],QY=["miter","round","bevel"],eZ={},p3={},PC=class PC{constructor(e,t,n,i,o,{optionalContentConfig:s,markedContentStack:a=null},u,c,f){W(this,fo);this.ctx=e,this.current=new SE(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,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 XS(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(...kr(this.compositeCtx))}this.ctx.save(),wv(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=kr(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>c3&&typeof n=="function",h=f?Date.now()+ZY:0,d=0,g=this.commonObjs,y=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!==Kp.dependency)w===null?this[v](u):this[v](u,...w);else for(let b of w){this.dependencyTracker?.recordNamedData(b,u);let E=b.startsWith("g_")?g:y;if(!E.has(b))return E.get(b,n),u}if(u++,u===c)return u;if(f&&++d>c3){if(Date.now()>h)return n(),u;d=0}}}endDrawing(){Y(this,fo,YS).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(),Y(this,fo,ZS).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 d=a,g=u;o>2&&a>1&&(d=a>=16384?Math.floor(a/2)-1||1:Math.ceil(a/2),o/=a/d),s>2&&u>1&&(g=u>=16384?Math.floor(u/2)-1||1:Math.ceil(u)/2,s/=u/g),f=this.cachedCanvases.getCanvas(c,d,g),h=f.context,h.clearRect(0,0,d,g),h.drawImage(e,0,0,a,u,0,0,d,g),e=f.canvas,a=d,u=g,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=kr(n),c,f,h,d;if((t.bitmap||t.data)&&t.count>1){let Z=t.bitmap||t.data.buffer;f=JSON.stringify(a?u:[u.slice(0,4),s]),c=this._cachedBitmapsMap.getOrInsertComputed(Z,f1);let ne=c.get(f);if(ne&&!a){let L=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,_s.transformAndFill),{canvas:ne,offsetX:L,offsetY:$}}h=ne}h||(d=this.cachedCanvases.getCanvas("maskCanvas",i,o),h3(d.context,t));let g=at.transform(u,[1/i,0,0,-1/o,0,0]);g=at.transform(g,[1,0,0,1,0,-o]);let y=md.slice();at.axialAlignedBoundingBox([0,0,i,o],g,y);let[v,w,b,E]=y,_=Math.round(b-v)||1,S=Math.round(E-w)||1,A=this.cachedCanvases.getCanvas("fillCanvas",_,S),M=A.context,I=v,q=w;M.translate(-I,-q),M.transform(...g),h||(h=this._scaleImage(d.canvas,ko(M)),h=h.img,c&&a&&c.set(f,h)),M.imageSmoothingEnabled=d3(kr(M),t.interpolate),bv(M,h,0,0,h.width,h.height,0,0,i,o),M.globalCompositeOperation="source-in";let Q=at.transform(ko(M),[1,0,0,1,-I,-q]);return M.fillStyle=a?s.getPattern(n,this,Q,Fn.FILL,e):s,M.fillRect(0,0,i,o),c&&!a&&(this.cachedCanvases.delete("fillCanvas"),c.set(f,A.canvas)),this.dependencyTracker?.recordDependencies(e,_s.transformAndFill),{canvas:A.canvas,offsetX:Math.round(I),offsetY:Math.round(q)}}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=JY[t]}setLineJoin(e,t){this.dependencyTracker?.recordSimpleData("lineJoin",e),this.ctx.lineJoin=QY[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()),wm(this.suspendedCtx,s),KY(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(),wm(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 d=e.canvas,g=u-f,y=c-h;if(s)if(g<0||y<0||g+n>d.width||y+i>d.height){let w=this.cachedCanvases.getCanvas("maskExtension",n,i),b=w.context;b.drawImage(d,-g,-y),b.globalCompositeOperation="destination-atop",b.fillStyle=s,b.fillRect(0,0,n,i),b.globalCompositeOperation="source-over",d=w.canvas,g=y=0}else{e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0);let w=new Path2D;w.rect(g,y,n,i),e.clip(w),e.globalCompositeOperation="destination-atop",e.fillStyle=s,e.fillRect(g,y,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(d,g,y,n,i,u,c,n,i),t.restore()}save(e){this.inSMaskMode&&wm(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&&wm(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===Kp.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]=R3(o)),at.axialAlignedBoundingBox(i,kr(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,ko(i),Fn.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,_s.stroke),n&&this.consumePath(e,t,this.current.getClippedPathBoundingBox(Fn.STROKE,kr(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,ko(i),Fn.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,_s.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,_s.rawFillPath).recordOperation(e)}clip(e){this.dependencyTracker?.recordFutureForcedDependency("clipMode",e),this.pendingClip=eZ}eoClip(e){this.dependencyTracker?.recordFutureForcedDependency("clipMode",e),this.pendingClip=p3}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||Xx,(o.fontMatrix[0]===0||o.fontMatrix[3]===0)&&Tt("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<l3?f=l3:n>u3&&(f=u3),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,d=f&hn.FILL_STROKE_MASK,g=!!(f&hn.ADD_TO_PATH_FLAG),y=u.patternFill&&!c.missingFile,v=u.patternStroke&&!c.missingFile,w;if((c.disableFontFace||g||y||v)&&!c.missingFile&&(w=c.getPathGenerator(this.commonObjs,t)),w&&(c.disableFontFace||y||v)){a.save(),a.translate(n,i),a.scale(h,-h),this.dependencyTracker?.recordCharacterBBox(e,a,c);let b;if(d===hn.FILL||d===hn.FILL_STROKE)if(o){b=a.getTransform(),a.setTransform(...o);let E=Y(this,fo,KS).call(this,w,b,o);a.fill(E)}else a.fill(w);if(d===hn.STROKE||d===hn.FILL_STROKE)if(s){b||(b=a.getTransform()),a.setTransform(...s);let{a:E,b:_,c:S,d:A}=b,M=at.inverseTransform(s),I=at.transform([E,_,S,A,0,0],M);at.singularValueDecompose2dScale(I,ss),a.lineWidth*=Math.max(ss[0],ss[1])/h,a.stroke(Y(this,fo,KS).call(this,w,b,s))}else a.lineWidth/=h,a.stroke(w);a.restore()}else(d===hn.FILL||d===hn.FILL_STROKE)&&(a.fillText(t,n,i),this.dependencyTracker?.recordCharacterBBox(e,a,c,h,n,i,()=>a.measureText(t))),(d===hn.STROKE||d===hn.FILL_STROKE)&&(this.dependencyTracker&&this.dependencyTracker?.recordCharacterBBox(e,a,c,h,n,i,()=>a.measureText(t)).recordDependencies(e,_s.stroke),a.strokeText(t,n,i));g&&((this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:kr(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 _t(this,"isFontSubpixelAAEnabled",n)}showText(e,t){this.dependencyTracker&&(this.dependencyTracker.recordDependencies(e,_s.showText).resetBBox(e),this.current.textRenderingMode&hn.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,d=t.length,g=i.vertical,y=g?1:-1,v=i.defaultVMetrics,w=o*n.fontMatrix[0],b=n.textRenderingMode===hn.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&hn.FILL_STROKE_MASK,A=S===hn.FILL||S===hn.FILL_STROKE,M=S===hn.STROKE||S===hn.FILL_STROKE;if(A&&n.patternFill){s.save();let ne=n.fillColor.getPattern(s,this,ko(s),Fn.FILL,e);E=kr(s),s.restore(),s.fillStyle=ne}if(M&&n.patternStroke){s.save();let ne=n.strokeColor.getPattern(s,this,ko(s),Fn.STROKE,e);_=kr(s),s.restore(),s.strokeStyle=ne}let I=n.lineWidth,q=n.textMatrixScale;if(q===0||I===0?M&&(I=this.getSinglePixelWidth()):I/=q,a!==1&&(s.scale(a,a),I/=a),s.lineWidth=I,i.isInvalidPDFjsFont){let ne=[],L=0;for(let X of t)ne.push(X.unicode),L+=X.width;let $=ne.join("");if(s.fillText($,0,0),this.dependencyTracker!==null){let X=s.measureText($);this.dependencyTracker.recordBBox(e,this.ctx,-X.actualBoundingBoxLeft,X.actualBoundingBoxRight,-X.actualBoundingBoxAscent,X.actualBoundingBoxDescent).recordShowTextOperation(e)}n.x+=L*w*h,s.restore(),this.compose();return}let Q=0,Z;for(Z=0;Z<d;++Z){let ne=t[Z];if(typeof ne=="number"){Q+=y*ne*o/1e3;continue}let L=!1,$=(ne.isSpace?c:0)+u,X=ne.fontChar,ie=ne.accent,re,O,x=ne.width;if(g){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,O=(Q+B)/a}else re=Q/a,O=0;let P;if(i.remeasure&&x>0){P=s.measureText(X);let j=P.width*1e3/o*a;if(x<j&&this.isFontSubpixelAAEnabled){let U=x/j;L=!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(b&&!ie)s.fillText(X,re,O),this.dependencyTracker?.recordCharacterBBox(e,s,P?{bbox:null}:i,o/a,re,O,()=>P??s.measureText(X));else if(this.paintChar(e,X,re,O,E,_),ie){let j=re+o*ie.offset.x/a,U=O-o*ie.offset.y/a;this.paintChar(e,ie.fontChar,j,U,E,_)}}let C=g?x*w-$*f:x*w+$*f;Q+=C,L&&s.restore()}g?n.y-=Q:n.x+=Q*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,d=i.fontMatrix||Xx,g=t.length,y=i.textRenderingMode===hn.INVISIBLE,v,w,b,E;if(y||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 _=this.dependencyTracker;for(this.dependencyTracker=_?new xE(_,e):null,v=0;v<g;++v){if(w=t[v],typeof w=="number"){E=u*w*s/1e3,this.ctx.translate(E,0),i.x+=E*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(...d),this.executeOperatorList(A),this.restore()):Tt(`Type3 character "${w.operatorListId}" is not available.`);let M=[w.width,0];at.applyTransform(M,d),b=M[0]*s+S,n.translate(b,0),i.x+=b*h}n.restore(),_&&(this.dependencyTracker=_)}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||kr(this.ctx),o={createCanvasGraphics:(s,a)=>new PC(s,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack},void 0,void 0,this.dependencyTracker?new xE(this.dependencyTracker,a,!0):null)};n=new VS(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=XY(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,ko(n),Fn.SHADING,e);let o=ko(n);if(o){let{width:s,height:a}=n.canvas,u=md.slice();at.axialAlignedBoundingBox([0,0,s,a],o,u);let[c,f,h,d]=u;this.ctx.fillRect(c,f,h-c,d-f)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.dependencyTracker?.resetBBox(e).recordFullPageBBox(e).recordDependencies(e,_s.transform).recordDependencies(e,_s.fill).recordOperation(e),this.compose(this.current.getClippedPathBoundingBox()),this.restore(e)}beginInlineImage(){Xt("Should not call beginInlineImage")}beginImageData(){Xt("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=kr(this.ctx),n)){at.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||u1("TODO: Support non-isolated groups."),t.knockout&&Tt("Knockout groups not supported.");let i=kr(n);if(t.matrix&&n.transform(...t.matrix),!t.bbox)throw new Error("Bounding box is required.");let o=md.slice();at.axialAlignedBoundingBox(t.bbox,kr(n),o);let s=[0,0,n.canvas.width,n.canvas.height];o=at.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 d=this.cachedCanvases.getCanvas(h,c,f),g=d.context;g.translate(-a,-u),g.transform(...i);let y=new Path2D,[v,w,b,E]=t.bbox;if(y.rect(v,w,b-v,E-w),t.matrix){let _=new Path2D;_.addPath(y,new DOMMatrix(t.matrix)),y=_}g.clip(y),t.smask&&this.smaskStack.push({canvas:d.canvas,context:g,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()),wm(n,g),this.ctx=g,this.dependencyTracker?.inheritSimpleDataAsFutureForcedDependencies(["fillAlpha","strokeAlpha","globalCompositeOperation"]).pushBaseTransform(n),this.setGState(e,[["BM","source-over"],["ca",1],["CA",1],["TR",null]]),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=kr(this.ctx);this.restore(e),this.ctx.save(),this.ctx.setTransform(...o);let s=md.slice();at.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(Y(this,fo,YS).call(this),wv(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,at.singularValueDecompose2dScale(kr(this.ctx),ss);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:d,context:g}=this.annotationCanvas;this.annotationCanvasMap.set(t,d),this.annotationCanvas.savedCtx=this.ctx,this.ctx=g,this.ctx.save(),this.ctx.setTransform(ss[0],0,0,-ss[1],0,u*ss[1]),wv(this.ctx)}else{wv(this.ctx),this.endPath(e);let c=new Path2D;c.rect(n[0],n[1],a,u),this.ctx.clip(c)}}this.current=new SE(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(e,...i),this.transform(e,...o)}endAnnotation(e){this.annotationCanvas&&(this.ctx.restore(),Y(this,fo,ZS).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=kr(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,d=a.length;h<d;h+=2){let g=at.transform(c,[n,i,o,s,a[h],a[h+1]]);u.drawImage(f.canvas,g[4],g[5]),this.dependencyTracker?.recordBBox(e,this.ctx,g[4],g[4]+f.canvas.width,g[5],g[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,_s.transformAndFill);for(let s of t){let{data:a,width:u,height:c,transform:f}=s,h=this.cachedCanvases.getCanvas("maskCanvas",u,c),d=h.context;d.save();let g=this.getObject(e,a,s);h3(d,g),d.globalCompositeOperation="source-in",d.fillStyle=o?i.getPattern(d,this,ko(n),Fn.FILL,e):i,d.fillRect(0,0,u,c),d.restore(),n.save(),n.transform(...f),n.scale(1,-1),bv(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){Tt("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){Tt("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;f3(f,t),a=this.applyTransferMapsToCanvas(f)}let u=this._scaleImage(a,ko(o));o.imageSmoothingEnabled=d3(kr(o),t.interpolate),this.dependencyTracker?.resetBBox(e).recordBBox(e,o,0,n,-i,0).recordDependencies(e,_s.imageXObject).recordOperation(e),bv(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;f3(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),bv(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,_s.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===p3?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=kr(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),Gx.a=1/o,Gx.d=1/s;let u=new Path2D;if(u.addPath(e,Gx),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}};fo=new WeakSet,YS=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)},ZS=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}}},KS=function(e,t,n){let i=new Path2D;return i.addPath(e,new DOMMatrix(n).invertSelf().multiplySelf(t)),i};Ed=PC;for(let r in Kp)Ed.prototype[r]!==void 0&&(Ed.prototype[Kp[r]]=Ed.prototype[r]);Ms=class{static get workerPort(){return l(this,Q0)}static set workerPort(e){if(!(typeof Worker<"u"&&e instanceof Worker)&&e!==null)throw new Error("Invalid `workerPort` type.");N(this,Q0,e)}static get workerSrc(){return l(this,ey)}static set workerSrc(e){if(typeof e!="string")throw new Error("Invalid `workerSrc` type.");N(this,ey,e)}};Q0=new WeakMap,ey=new WeakMap,W(Ms,Q0,null),W(Ms,ey,"");JS=class{constructor({parsedData:e,rawData:t}){W(this,sp);W(this,ty);N(this,sp,e),N(this,ty,t)}getRaw(){return l(this,ty)}get(e){return l(this,sp).get(e)??null}[Symbol.iterator](){return l(this,sp).entries()}};sp=new WeakMap,ty=new WeakMap;fd=Symbol("INTERNAL"),QS=class{constructor(e,{name:t,intent:n,usage:i,rbGroups:o}){W(this,ry,!1);W(this,ny,!1);W(this,iy,!1);W(this,op,!0);N(this,ry,!!(e&is.DISPLAY)),N(this,ny,!!(e&is.PRINT)),this.name=t,this.intent=n,this.usage=i,this.rbGroups=o}get visible(){if(l(this,iy))return l(this,op);if(!l(this,op))return!1;let{print:e,view:t}=this.usage;return l(this,ry)?t?.viewState!=="OFF":l(this,ny)?e?.printState!=="OFF":!0}_setVisible(e,t,n=!1){e!==fd&&Xt("Internal method `_setVisible` called."),N(this,iy,n),N(this,op,t)}};ry=new WeakMap,ny=new WeakMap,iy=new WeakMap,op=new WeakMap;eT=class{constructor(e,t=is.DISPLAY){W(this,sy);W(this,_u,null);W(this,cr,new Map);W(this,ap,null);W(this,lp,null);if(this.renderingIntent=t,this.name=null,this.creator=null,e!==null){this.name=e.name,this.creator=e.creator,N(this,lp,e.order);for(let n of e.groups)l(this,cr).set(n.id,new QS(t,n));if(e.baseState==="OFF")for(let n of l(this,cr).values())n._setVisible(fd,!1);for(let n of e.on)l(this,cr).get(n)._setVisible(fd,!0);for(let n of e.off)l(this,cr).get(n)._setVisible(fd,!1);N(this,ap,this.getHash())}}isVisible(e){if(l(this,cr).size===0)return!0;if(!e)return u1("Optional content group not defined."),!0;if(e.type==="OCG")return l(this,cr).has(e.id)?l(this,cr).get(e.id).visible:(Tt(`Optional content group not found: ${e.id}`),!0);if(e.type==="OCMD"){if(e.expression)return Y(this,sy,tT).call(this,e.expression);if(!e.policy||e.policy==="AnyOn"){for(let t of e.ids){if(!l(this,cr).has(t))return Tt(`Optional content group not found: ${t}`),!0;if(l(this,cr).get(t).visible)return!0}return!1}else if(e.policy==="AllOn"){for(let t of e.ids){if(!l(this,cr).has(t))return Tt(`Optional content group not found: ${t}`),!0;if(!l(this,cr).get(t).visible)return!1}return!0}else if(e.policy==="AnyOff"){for(let t of e.ids){if(!l(this,cr).has(t))return Tt(`Optional content group not found: ${t}`),!0;if(!l(this,cr).get(t).visible)return!0}return!1}else if(e.policy==="AllOff"){for(let t of e.ids){if(!l(this,cr).has(t))return Tt(`Optional content group not found: ${t}`),!0;if(l(this,cr).get(t).visible)return!1}return!0}return Tt(`Unknown optional content policy ${e.policy}.`),!0}return Tt(`Unknown group type ${e.type}.`),!0}setVisibility(e,t=!0,n=!0){let i=l(this,cr).get(e);if(!i){Tt(`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,cr).get(s)?._setVisible(fd,!1,!0);i._setVisible(fd,!!t,!0),N(this,_u,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,cr).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}}N(this,_u,null)}get hasInitialVisibility(){return l(this,ap)===null||this.getHash()===l(this,ap)}getOrder(){return l(this,cr).size?l(this,lp)?l(this,lp).slice():[...l(this,cr).keys()]:null}getGroup(e){return l(this,cr).get(e)||null}getHash(){if(l(this,_u)!==null)return l(this,_u);let e=new hE;for(let[t,n]of l(this,cr))e.update(`${t}:${n.visible}`);return N(this,_u,e.hexdigest())}[Symbol.iterator](){return l(this,cr).entries()}};_u=new WeakMap,cr=new WeakMap,ap=new WeakMap,lp=new WeakMap,sy=new WeakSet,tT=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=Y(this,sy,tT).call(this,o);else if(l(this,cr).has(o))s=l(this,cr).get(o).visible;else return Tt(`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"};eg=class{constructor(e,t,n){W(this,oy,null);W(this,ay,null);He(this,"_fullReader",null);He(this,"_rangeReaders",new Set);He(this,"_source",null);this._source=e,N(this,oy,t),N(this,ay,n)}get _progressiveDataLength(){return this._fullReader?._loaded??0}getFullReader(){return Wt(!this._fullReader,"BasePDFStream.getFullReader can only be called once."),this._fullReader=new(l(this,oy))(this)}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;let n=new(l(this,ay))(this,e,t);return this._rangeReaders.add(n),n}cancelAllRequests(e){this._fullReader?.cancel(e);for(let t of new Set(this._rangeReaders))t.cancel(e)}};oy=new WeakMap,ay=new WeakMap;tg=class{constructor(e){He(this,"onProgress",null);He(this,"_contentLength",0);He(this,"_filename",null);He(this,"_headersCapability",Promise.withResolvers());He(this,"_isRangeSupported",!1);He(this,"_isStreamingSupported",!1);He(this,"_loaded",0);He(this,"_stream",null);this._stream=e}_callOnProgress(){this.onProgress?.({loaded:this._loaded,total:this._contentLength})}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(){Xt("Abstract method `read` called")}cancel(e){Xt("Abstract method `cancel` called")}},rg=class{constructor(e,t,n){He(this,"_stream",null);this._stream=e}async read(){Xt("Abstract method `read` called")}cancel(e){Xt("Abstract method `cancel` called")}};rT=class extends eg{constructor(t){super(t,iT,sT);W(this,ly);He(this,"_progressiveDone",!1);He(this,"_queuedChunks",[]);let{pdfDataRangeTransport:n}=t,{initialData:i,progressiveDone:o}=n;if(i?.length>0){let s=g3(i);this._queuedChunks.push(s)}this._progressiveDone=o,n.addRangeListener((s,a)=>{Y(this,ly,nT).call(this,s,a)}),n.addProgressiveReadListener(s=>{Y(this,ly,nT).call(this,void 0,s)}),n.addProgressiveDoneListener(()=>{this._fullReader?.progressiveDone(),this._progressiveDone=!0}),n.transportReady()}getFullReader(){let t=super.getFullReader();return this._queuedChunks=null,t}getRangeReader(t,n){let i=super.getRangeReader(t,n);return i&&(i.onDone=()=>this._rangeReaders.delete(i),this._source.pdfDataRangeTransport.requestDataRange(t,n)),i}cancelAllRequests(t){super.cancelAllRequests(t),this._source.pdfDataRangeTransport.abort()}};ly=new WeakSet,nT=function(t,n){let i=g3(n);if(t===void 0)this._fullReader?this._fullReader._enqueue(i):this._queuedChunks.push(i);else{let o=this._rangeReaders.keys().find(s=>s._begin===t);Wt(o,"#onReceiveData - no `PDFDataTransportStreamRangeReader` instance found."),o._enqueue(i)}};iT=class extends tg{constructor(t){super(t);W(this,uy,d1.bind(this));He(this,"_done",!1);He(this,"_queuedChunks",null);He(this,"_requests",[]);let{pdfDataRangeTransport:n,disableRange:i,disableStream:o}=t._source,{length:s,contentDispositionFilename:a}=n;this._queuedChunks=t._queuedChunks||[];for(let c of this._queuedChunks)this._loaded+=c.byteLength;this._done=t._progressiveDone,this._contentLength=s,this._isStreamingSupported=!o,this._isRangeSupported=!i,h1(a)&&(this._filename=a),this._headersCapability.resolve();let u=this._loaded;Promise.resolve().then(()=>{u>0&&this._loaded===u&&this._callOnProgress()})}_enqueue(t){this._done||(this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunks.push(t),this._loaded+=t.byteLength,this._callOnProgress())}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};let t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0,l(this,uy).call(this)}progressiveDone(){this._done||(this._done=!0),this._queuedChunks.length===0&&l(this,uy).call(this)}};uy=new WeakMap;sT=class extends rg{constructor(t,n,i){super(t,n,i);W(this,cy,d1.bind(this));He(this,"onDone",null);He(this,"_begin",-1);He(this,"_done",!1);He(this,"_queuedChunk",null);He(this,"_requests",[]);this._begin=n}_enqueue(t){this._done||(this._requests.length===0?this._queuedChunk=t:(this._requests.shift().resolve({value:t,done:!1}),l(this,cy).call(this)),this._done=!0,this.onDone?.())}async read(){if(this._queuedChunk){let n=this._queuedChunk;return this._queuedChunk=null,{value:n,done:!1}}if(this._done)return{value:void 0,done:!0};let t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0,l(this,cy).call(this),this.onDone?.()}};cy=new WeakMap;oT=class extends eg{constructor(t){super(t,aT,lT);He(this,"_responseOrigin",null);let{httpHeaders:n,url:i}=t;Wt(/https?:/.test(i.protocol),"PDFFetchStream only supports http(s):// URLs."),this.headers=d6(!0,n)}},aT=class extends tg{constructor(t){super(t);He(this,"_abortController",new AbortController);He(this,"_reader",null);let{disableRange:n,disableStream:i,length:o,rangeChunkSize:s,url:a,withCredentials:u}=t._source;this._contentLength=o,this._isStreamingSupported=!i,this._isRangeSupported=!n;let c=new Headers(t.headers);y6(a,c,u,this._abortController).then(f=>{t._responseOrigin=p1(f.url),b6(f.status,a),this._reader=f.body.getReader();let h=f.headers,{allowRangeRequests:d,suggestedLength:g}=p6({responseHeaders:h,isHttp:!0,rangeChunkSize:s,disableRange:n});this._isRangeSupported=d,this._contentLength=g||this._contentLength,this._filename=g6(h),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new co("Streaming is disabled.")),this._headersCapability.resolve()}).catch(this._headersCapability.reject)}async read(){await this._headersCapability.promise;let{value:t,done:n}=await this._reader.read();return n?{value:t,done:n}:(this._loaded+=t.byteLength,this._callOnProgress(),{value:m1(t),done:!1})}cancel(t){this._reader?.cancel(t),this._abortController.abort()}},lT=class extends rg{constructor(t,n,i){super(t,n,i);He(this,"_abortController",new AbortController);He(this,"_readCapability",Promise.withResolvers());He(this,"_reader",null);let{url:o,withCredentials:s}=t._source,a=new Headers(t.headers);a.append("Range",`bytes=${n}-${i-1}`),y6(o,a,s,this._abortController).then(u=>{let c=p1(u.url);m6(c,t._responseOrigin),b6(u.status,o),this._reader=u.body.getReader(),this._readCapability.resolve()}).catch(this._readCapability.reject)}async read(){await this._readCapability.promise;let{value:t,done:n}=await this._reader.read();return n?{value:t,done:n}:{value:m1(t),done:!1}}cancel(t){this._reader?.cancel(t),this._abortController.abort()}},Vx=200,m3=206;uT=class extends eg{constructor(t){super(t,cT,fT);W(this,sg);W(this,Vo,new WeakMap);He(this,"_responseOrigin",null);let{httpHeaders:n,url:i}=t;this.url=i,this.isHttp=/https?:/.test(i.protocol),this.headers=d6(this.isHttp,n)}_request(t){let n=new XMLHttpRequest,i={validateStatus:null,onHeadersReceived:t.onHeadersReceived,onDone:t.onDone,onError:t.onError,onProgress:t.onProgress};l(this,Vo).set(n,i),n.open("GET",this.url),n.withCredentials=this._source.withCredentials;for(let[o,s]of this.headers)n.setRequestHeader(o,s);return this.isHttp&&"begin"in t&&"end"in t?(n.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`),i.validateStatus=o=>o===m3||o===Vx):i.validateStatus=o=>o===Vx,n.responseType="arraybuffer",Wt(t.onError,"Expected `onError` callback to be provided."),n.onerror=()=>t.onError(n.status),n.onreadystatechange=Y(this,sg,v6).bind(this,n),n.onprogress=Y(this,sg,w6).bind(this,n),n.send(null),n}_abortRequest(t){l(this,Vo).has(t)&&(l(this,Vo).delete(t),t.abort())}getRangeReader(t,n){let i=super.getRangeReader(t,n);return i&&(i.onClosed=()=>this._rangeReaders.delete(i)),i}};Vo=new WeakMap,sg=new WeakSet,w6=function(t,n){l(this,Vo).get(t)?.onProgress?.(n)},v6=function(t,n){let i=l(this,Vo).get(t);if(!i||(t.readyState>=2&&i.onHeadersReceived&&(i.onHeadersReceived(),delete i.onHeadersReceived),t.readyState!==4)||!l(this,Vo).has(t))return;if(l(this,Vo).delete(t),t.status===0&&this.isHttp){i.onError(t.status);return}let o=t.status||Vx;if(!i.validateStatus(o)){i.onError(t.status);return}let s=rZ(t.response);if(o===m3){let a=t.getResponseHeader("Content-Range");/bytes (\d+)-(\d+)\/(\d+)/.test(a)?i.onDone(s):(Tt('Missing or invalid "Content-Range" header.'),i.onError(0))}else s?i.onDone(s):i.onError(t.status)};cT=class extends tg{constructor(t){super(t);W(this,sa);W(this,fy,d1.bind(this));He(this,"_cachedChunks",[]);He(this,"_done",!1);He(this,"_requests",[]);He(this,"_storedError",null);let{length:n}=t._source;this._contentLength=n,this._fullRequestXhr=t._request({onHeadersReceived:Y(this,sa,E6).bind(this),onDone:Y(this,sa,_6).bind(this),onError:Y(this,sa,A6).bind(this),onProgress:Y(this,sa,x6).bind(this)})}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 t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0,this._headersCapability.reject(t),l(this,fy).call(this),this._stream._abortRequest(this._fullRequestXhr),this._fullRequestXhr=null}};fy=new WeakMap,sa=new WeakSet,E6=function(){let t=this._stream,{disableRange:n,rangeChunkSize:i}=t._source,o=this._fullRequestXhr;t._responseOrigin=p1(o.responseURL);let s=o.getAllResponseHeaders(),a=new Headers(s?s.trimStart().replace(/[^\S ]+$/,"").split(/[\r\n]+/).map(f=>{let[h,...d]=f.split(": ");return[h,d.join(": ")]}):[]),{allowRangeRequests:u,suggestedLength:c}=p6({responseHeaders:a,isHttp:t.isHttp,rangeChunkSize:i,disableRange:n});u&&(this._isRangeSupported=!0),this._contentLength=c||this._contentLength,this._filename=g6(a),this._isRangeSupported&&t._abortRequest(o),this._headersCapability.resolve()},_6=function(t){this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._cachedChunks.push(t),this._done=!0,this._cachedChunks.length===0&&l(this,fy).call(this)},A6=function(t){this._storedError=g1(t,this._stream.url),this._headersCapability.reject(this._storedError);for(let n of this._requests)n.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0},x6=function(t){this.onProgress?.({loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})};fT=class extends rg{constructor(t,n,i){super(t,n,i);W(this,Sl);W(this,hy,d1.bind(this));He(this,"onClosed",null);He(this,"_done",!1);He(this,"_queuedChunk",null);He(this,"_requests",[]);He(this,"_storedError",null);this._requestXhr=t._request({begin:n,end:i,onHeadersReceived:Y(this,Sl,S6).bind(this),onDone:Y(this,Sl,T6).bind(this),onError:Y(this,Sl,hT).bind(this),onProgress:null})}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){let n=this._queuedChunk;return this._queuedChunk=null,{value:n,done:!1}}if(this._done)return{value:void 0,done:!0};let t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0,l(this,hy).call(this),this._stream._abortRequest(this._requestXhr),this.onClosed?.()}};hy=new WeakMap,Sl=new WeakSet,S6=function(){let t=p1(this._requestXhr?.responseURL);try{m6(t,this._stream._responseOrigin)}catch(n){this._storedError=n,Y(this,Sl,hT).call(this,0)}},T6=function(t){this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunk=t,this._done=!0,l(this,hy).call(this),this.onClosed?.()},hT=function(t){this._storedError??(this._storedError=g1(t,this._stream.url));for(let n of this._requests)n.reject(this._storedError);this._requests.length=0,this._queuedChunk=null};dT=class extends eg{constructor(e){super(e,pT,gT);let{url:t}=e;Wt(t.protocol==="file:","PDFNodeStream only supports file:// URLs.")}},pT=class extends tg{constructor(t){super(t);He(this,"_reader",null);let{disableRange:n,disableStream:i,length:o,rangeChunkSize:s,url:a}=t._source;this._contentLength=o,this._isStreamingSupported=!i,this._isRangeSupported=!n;let u=$e.getBuiltinModule("fs");u.promises.lstat(a).then(c=>{let f=u.createReadStream(a),h=C6(f);this._reader=h.getReader();let{size:d}=c;d<=2*s&&(this._isRangeSupported=!1),this._contentLength=d,!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new co("Streaming is disabled.")),this._headersCapability.resolve()}).catch(c=>{c.code==="ENOENT"&&(c=g1(0,a)),this._headersCapability.reject(c)})}async read(){await this._headersCapability.promise;let{value:t,done:n}=await this._reader.read();return n?{value:t,done:n}:(this._loaded+=t.byteLength,this._callOnProgress(),{value:m1(t),done:!1})}cancel(t){this._reader?.cancel(t)}},gT=class extends rg{constructor(t,n,i){super(t,n,i);He(this,"_readCapability",Promise.withResolvers());He(this,"_reader",null);let{url:o}=t._source,s=$e.getBuiltinModule("fs");try{let a=s.createReadStream(o,{start:n,end:i-1}),u=C6(a);this._reader=u.getReader(),this._readCapability.resolve()}catch(a){this._readCapability.reject(a)}}async read(){await this._readCapability.promise;let{value:t,done:n}=await this._reader.read();return n?{value:t,done:n}:{value:m1(t),done:!1}}cancel(t){this._reader?.cancel(t)}},Pm=Symbol("INITIAL_DATA"),nZ=()=>({...Promise.withResolvers(),data:Pm}),TE=class{constructor(){W(this,dy);W(this,to,new Map)}get(e,t=null){if(t){let i=Y(this,dy,mT).call(this,e);return i.promise.then(()=>t(i.data)),null}let n=l(this,to).get(e);if(!n||n.data===Pm)throw new Error(`Requesting object that isn't resolved yet ${e}.`);return n.data}has(e){let t=l(this,to).get(e);return!!t&&t.data!==Pm}delete(e){let t=l(this,to).get(e);return!t||t.data===Pm?!1:(l(this,to).delete(e),!0)}resolve(e,t=null){let n=Y(this,dy,mT).call(this,e);n.data=t,n.resolve()}clear(){for(let{data:e}of l(this,to).values())e?.bitmap?.close();l(this,to).clear()}*[Symbol.iterator](){for(let[e,{data:t}]of l(this,to))t!==Pm&&(yield[e,t])}};to=new WeakMap,dy=new WeakSet,mT=function(e){return l(this,to).getOrInsertComputed(e,nZ)};iZ=1e5,y3=30,Dn=class Dn{constructor({textContentSource:e,container:t,viewport:n}){W(this,Tl);W(this,Au,Promise.withResolvers());W(this,Ri,null);W(this,py,!1);W(this,gy,!!globalThis.FontInspector?.enabled);W(this,vf,null);W(this,tl,null);W(this,my,0);W(this,yy,0);W(this,Ef,null);W(this,by,null);W(this,up,0);W(this,xu,0);W(this,cp,Object.create(null));W(this,wy,[]);W(this,fp,null);W(this,_f,[]);W(this,vy,new WeakMap);W(this,Ey,null);var u;if(e instanceof ReadableStream)N(this,fp,e);else if(typeof e=="object")N(this,fp,new ReadableStream({start(c){c.enqueue(e),c.close()}}));else throw new Error('No "textContentSource" parameter specified.');N(this,Ri,N(this,by,t)),N(this,xu,n.scale*ia.pixelRatio),N(this,up,n.rotation),N(this,tl,{div:null,properties:null,ctx:null});let{pageWidth:i,pageHeight:o,pageX:s,pageY:a}=n.rawDims;N(this,Ey,[1,0,0,-1,-s,a+o]),N(this,yy,i),N(this,my,o),Y(u=Dn,ls,I6).call(u),t.style.setProperty("--min-font-size",l(Dn,dp)),qu(t,n),l(this,Au).promise.finally(()=>{l(Dn,pp).delete(this),N(this,tl,null),N(this,cp,null)}).catch(()=>{})}static get fontFamilyMap(){let{isWindows:e,isFirefox:t}=Wr.platform;return _t(this,"fontFamilyMap",new Map([["sans-serif",`${e&&t?"Calibri, ":""}sans-serif`],["monospace",`${e&&t?"Lucida Console, ":""}monospace`]]))}render(){let e=()=>{l(this,Ef).read().then(({value:t,done:n})=>{if(n){l(this,Au).resolve();return}l(this,vf)??N(this,vf,t.lang),Object.assign(l(this,cp),t.styles),Y(this,Tl,R6).call(this,t.items),e()},l(this,Au).reject)};return N(this,Ef,l(this,fp).getReader()),l(Dn,pp).add(this),e(),l(this,Au).promise}update({viewport:e,onBefore:t=null}){var o;let n=e.scale*ia.pixelRatio,i=e.rotation;if(i!==l(this,up)&&(t?.(),N(this,up,i),qu(l(this,by),{rotation:i})),n!==l(this,xu)){t?.(),N(this,xu,n);let s={div:null,properties:null,ctx:Y(o=Dn,ls,Fv).call(o,l(this,vf))};for(let a of l(this,_f))s.properties=l(this,vy).get(a),s.div=a,Y(this,Tl,yT).call(this,s)}}cancel(){let e=new co("TextLayer task cancelled.");l(this,Ef)?.cancel(e).catch(()=>{}),N(this,Ef,null),l(this,Au).reject(e)}get textDivs(){return l(this,_f)}get textContentItemsStr(){return l(this,wy)}static cleanup(){if(!(l(this,pp).size>0)){l(this,hp).clear();for(let{canvas:e}of l(this,Af).values())e.remove();l(this,Af).clear()}}};Au=new WeakMap,Ri=new WeakMap,py=new WeakMap,gy=new WeakMap,vf=new WeakMap,tl=new WeakMap,my=new WeakMap,yy=new WeakMap,Ef=new WeakMap,by=new WeakMap,up=new WeakMap,xu=new WeakMap,cp=new WeakMap,wy=new WeakMap,fp=new WeakMap,_f=new WeakMap,vy=new WeakMap,Ey=new WeakMap,hp=new WeakMap,Af=new WeakMap,_y=new WeakMap,dp=new WeakMap,pp=new WeakMap,Tl=new WeakSet,R6=function(e){var i,o;if(l(this,py))return;(o=l(this,tl)).ctx??(o.ctx=Y(i=Dn,ls,Fv).call(i,l(this,vf)));let t=l(this,_f),n=l(this,wy);for(let s of e){if(t.length>iZ){Tt("Ignoring additional textDivs for performance reasons."),N(this,py,!0);return}if(s.str===void 0){if(s.type==="beginMarkedContentProps"||s.type==="beginMarkedContent"){let a=l(this,Ri);N(this,Ri,document.createElement("span")),l(this,Ri).classList.add("markedContent"),s.id&&l(this,Ri).setAttribute("id",`${s.id}`),s.tag==="Artifact"&&(l(this,Ri).ariaHidden=!0),a.append(l(this,Ri))}else s.type==="endMarkedContent"&&N(this,Ri,l(this,Ri).parentNode);continue}n.push(s.str),Y(this,Tl,D6).call(this,s)}},D6=function(e){var y;let t=document.createElement("span"),n={angle:0,canvasWidth:0,hasText:e.str!=="",hasEOL:e.hasEOL,fontSize:0};l(this,_f).push(t);let i=at.transform(l(this,Ey),e.transform),o=Math.atan2(i[1],i[0]),s=l(this,cp)[e.fontName];s.vertical&&(o+=Math.PI/2);let a=l(this,gy)&&s.fontSubstitution||s.fontFamily;a=Dn.fontFamilyMap.get(a)||a;let u=Math.hypot(i[2],i[3]),c=u*Y(y=Dn,ls,k6).call(y,a,s,l(this,vf)),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 d=t.style;d.left=`${(100*f/l(this,yy)).toFixed(2)}%`,d.top=`${(100*h/l(this,my)).toFixed(2)}%`,d.setProperty("--font-height",`${u.toFixed(2)}px`),d.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 g=!1;if(e.str.length>1)g=!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&&(g=!0)}if(g&&(n.canvasWidth=s.vertical?e.height:e.width),l(this,vy).set(t,n),l(this,tl).div=t,l(this,tl).properties=n,Y(this,Tl,yT).call(this,l(this,tl)),n.hasText&&l(this,Ri).append(t),n.hasEOL){let v=document.createElement("br");v.setAttribute("role","presentation"),l(this,Ri).append(v)}},yT=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;Y(s=Dn,ls,bT).call(s,i,c*l(this,xu),a);let{width:f}=i.measureText(t.textContent);f>0&&o.setProperty("--scale-x",u*l(this,xu)/f)}n.angle!==0&&o.setProperty("--rotate",`${n.angle}deg`)},ls=new WeakSet,Fv=function(e=null){let t=l(this,Af).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,Af).set(e,t),l(this,_y).set(t,{size:0,family:""})}return t},bT=function(e,t,n){let i=l(this,_y).get(e);t===i.size&&n===i.family||(e.font=`${t}px ${n}`,i.size=t,i.family=n)},I6=function(){if(l(this,dp)!==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),N(this,dp,e.getBoundingClientRect().height),e.remove()},k6=function(e,t,n){let i=l(this,hp).get(e);if(i)return i;let o=Y(this,ls,Fv).call(this,n);o.canvas.width=o.canvas.height=y3,Y(this,ls,bT).call(this,o,y3,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):(Wr.platform.isFirefox&&Tt("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,hp).set(e,c),c},W(Dn,ls),W(Dn,hp,new Map),W(Dn,Af,new Map),W(Dn,_y,new WeakMap),W(Dn,dp,null),W(Dn,pp,new Set);ng=Dn,sZ=100;QE=class QE{constructor(){He(this,"_capability",Promise.withResolvers());He(this,"_transport",null);He(this,"_worker",null);He(this,"docId",`d${ln(QE,JE)._++}`);He(this,"destroyed",!1);He(this,"onPassword",null);He(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()}};JE=new WeakMap,W(QE,JE,0);wT=QE,n0=class{constructor(e,t,n=!1,i=null){W(this,gp,Promise.withResolvers());W(this,Ay,[]);W(this,xy,[]);W(this,Sy,[]);this.length=e,this.initialData=t,this.progressiveDone=n,this.contentDispositionFilename=i,Object.defineProperty(this,"onDataProgress",{value:()=>{x3("`PDFDataRangeTransport.prototype.onDataProgress` - method was removed, since loading progress is now reported automatically through the `PDFDataTransportStream` class (and related code).")}})}addRangeListener(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,Sy))n(e,t)}onDataProgressiveRead(e){l(this,gp).promise.then(()=>{for(let t of l(this,xy))t(e)})}onDataProgressiveDone(){l(this,gp).promise.then(()=>{for(let e of l(this,Ay))e()})}transportReady(){l(this,gp).resolve()}requestDataRange(e,t){Xt("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}};gp=new WeakMap,Ay=new WeakMap,xy=new WeakMap,Sy=new WeakMap;vT=class{constructor(e,t){this._pdfInfo=e,this._transport=t}get pagesMapper(){return this._transport.pagesMapper}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 _t(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()}},ET=class{constructor(e,t,n,i,o=!1){W(this,xf);W(this,rl,!1);W(this,mp,null);this._pageIndex=e,this._pageInfo=t,this._transport=n,this._stats=o?new lE:null,this._pdfBug=o,this.commonObjs=n.commonObjs,this.objs=new TE,this._intentStates=new Map,this.destroyed=!1,this.recordedBBoxes=null,N(this,mp,i)}get pageNumber(){return this._pageIndex+1}set pageNumber(e){this._pageIndex=e-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 Jm({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 _t(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=bl.ENABLE,transform:s=null,background:a=null,optionalContentConfigPromise:u=null,annotationCanvasMap:c=null,pageColors:f=null,printAnnotationStorage:h=null,isEditing:d=!1,recordOperations:g=!1,operationsFilter:y=null}){this._stats?.time("Overall");let v=this._transport.getRenderingIntent(i,o,h,d),{renderingIntent:w,cacheKey:b}=v;N(this,rl,!1),u||(u=this._transport.getOptionalContentConfig(w));let E=this._intentStates.getOrInsertComputed(b,aE);E.streamReaderCancelTimeout&&(clearTimeout(E.streamReaderCancelTimeout),E.streamReaderCancelTimeout=null);let _=!!(w&is.PRINT);E.displayReadyCapability||(E.displayReadyCapability=Promise.withResolvers(),E.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&&(g||S),M=Q=>{if(E.renderTasks.delete(I),A){let Z=I.gfx?.dependencyTracker.take();Z&&(I.stepper&&I.stepper.setOperatorBBoxes(Z,I.gfx.dependencyTracker.takeDebugMetadata()),g&&(this.recordedBBoxes=Z))}_&&N(this,rl,!0),Y(this,xf,Fm).call(this),Q?(I.capability.reject(Q),this._abortOperatorList({intentState:E,reason:Q instanceof Error?Q:new Error(Q)})):I.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},I=new xT({callback:M,params:{canvas:t,canvasContext:e,dependencyTracker:A?new $S(t,E.operatorList.length,S):null,viewport:n,transform:s,background:a},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:c,operatorList:E.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!_,pdfBug:this._pdfBug,pageColors:f,enableHWA:this._transport.enableHWA,operationsFilter:y});(E.renderTasks||(E.renderTasks=new Set)).add(I);let q=I.task;return Promise.all([E.displayReadyCapability.promise,u]).then(([Q,Z])=>{if(this.destroyed){M();return}if(this._stats?.time("Rendering"),!(Z.renderingIntent&w))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");I.initializeGraphics({transparency:Q,optionalContentConfig:Z}),I.operatorListChanged()}).catch(M),q}getOperatorList({intent:e="display",annotationMode:t=bl.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.getOrInsertComputed(s.cacheKey,aE),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",{pageId:l(this,mp).getPageId(this._pageIndex+1)-1,pageIndex:this._pageIndex,includeMarkedContent:e===!0,disableNormalization:t===!0},{highWaterMark:100,size(i){return i.items.length}})}async getTextContent(e={}){if(this._transport._htmlForXfa)return this.getXfa().then(i=>Zm.textContent(i));let t=this.streamTextContent(e),n={items:[],styles:Object.create(null),lang:null};for await(let i of t)n.lang??(n.lang=i.lang),Object.assign(n.styles,i.styles),n.items.push(...i.items);return n}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(),N(this,rl,!1),Promise.all(e)}cleanup(e=!1){N(this,rl,!0);let t=Y(this,xf,Fm).call(this);return e&&t&&this._stats&&(this._stats=new lE),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&&Y(this,xf,Fm).call(this)}_pumpOperatorList({renderingIntent:e,cacheKey:t,annotationStorageSerializable:n,modifiedIds:i}){let{map:o,transfer:s}=n,u=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageId:l(this,mp).getPageId(this._pageIndex+1)-1,pageIndex:this._pageIndex,intent:e,cacheKey:t,annotationStorage:o,modifiedIds:i},void 0,s).getReader(),c=this._intentStates.get(t);c.streamReader=u;let f=()=>{u.read().then(({value:h,done:d})=>{if(d){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 d of c.renderTasks)d.operatorListChanged();Y(this,xf,Fm).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 Qp){let i=sZ;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 co(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}};rl=new WeakMap,mp=new WeakMap,xf=new WeakSet,Fm=function(){if(!l(this,rl)||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(),N(this,rl,!1),!0};Sr=class Sr{constructor({name:e=null,port:t=null,verbosity:n=PY()}={}){W(this,ai);W(this,Su,Promise.withResolvers());W(this,ro,null);W(this,nl,null);W(this,Sf,null);if(this.name=e,this.destroyed=!1,this.verbosity=n,t){if(l(Sr,Cf).has(t))throw new Error("Cannot use more than one PDFWorker per port.");l(Sr,Cf).set(t,this),Y(this,ai,O6).call(this,t)}else Y(this,ai,L6).call(this)}get promise(){return l(this,Su).promise}get port(){return l(this,nl)}get messageHandler(){return l(this,ro)}destroy(){this.destroyed=!0,l(this,Sf)?.terminate(),N(this,Sf,null),l(Sr,Cf).delete(l(this,nl)),N(this,nl,null),l(this,ro)?.destroy(),N(this,ro,null)}static create(e){let t=l(this,Cf).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 Sr(e)}static get workerSrc(){if(Ms.workerSrc)return Ms.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return _t(this,"_setupFakeWorkerGlobal",(async()=>l(this,yp,Bv)?l(this,yp,Bv):(await import(this.workerSrc)).WorkerMessageHandler)())}};Su=new WeakMap,ro=new WeakMap,nl=new WeakMap,Sf=new WeakMap,e1=new WeakMap,Tf=new WeakMap,Cf=new WeakMap,ai=new WeakSet,Mv=function(){l(this,Su).resolve(),l(this,ro).send("configure",{verbosity:this.verbosity})},O6=function(e){N(this,nl,e),N(this,ro,new Wc("main","worker",e)),l(this,ro).on("ready",()=>{}),Y(this,ai,Mv).call(this)},L6=function(){if(l(Sr,Tf)||l(Sr,yp,Bv)){Y(this,ai,Mm).call(this);return}let{workerSrc:e}=Sr;try{Sr._isSameOrigin(window.location,e)||(e=Sr._createCDNWrapper(new URL(e,window.location).href));let t=new Worker(e,{type:"module"}),n=new Wc("main","worker",t),i=()=>{o.abort(),n.destroy(),t.terminate(),this.destroyed?l(this,Su).reject(new Error("Worker was destroyed")):Y(this,ai,Mm).call(this)},o=new AbortController;t.addEventListener("error",()=>{l(this,Sf)||i()},{signal:o.signal}),n.on("test",a=>{if(o.abort(),this.destroyed||!a){i();return}N(this,ro,n),N(this,nl,t),N(this,Sf,t),Y(this,ai,Mv).call(this)}),n.on("ready",a=>{if(o.abort(),this.destroyed){i();return}try{s()}catch{Y(this,ai,Mm).call(this)}});let s=()=>{let a=new Uint8Array;n.send("test",a,[a.buffer])};s();return}catch{u1("The worker has been disabled.")}Y(this,ai,Mm).call(this)},Mm=function(){l(Sr,Tf)||(Tt("Setting up fake worker."),N(Sr,Tf,!0)),Sr._setupFakeWorkerGlobal.then(e=>{if(this.destroyed){l(this,Su).reject(new Error("Worker was destroyed"));return}let t=new DS;N(this,nl,t);let n=`fake${ln(Sr,e1)._++}`,i=new Wc(n+"_worker",n,t);e.setup(i,t),N(this,ro,new Wc(n,n+"_worker",t)),Y(this,ai,Mv).call(this)}).catch(e=>{l(this,Su).reject(new Error(`Setting up fake worker failed: "${e.message}".`))})},yp=new WeakSet,Bv=function(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}},W(Sr,yp),W(Sr,e1,0),W(Sr,Tf,!1),W(Sr,Cf,new WeakMap),oi&&(N(Sr,Tf,!0),Ms.workerSrc||(Ms.workerSrc="./pdf.worker.mjs")),Sr._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},Sr._createCDNWrapper=e=>{let t=`await import("${e}");`;return URL.createObjectURL(new Blob([t],{type:"text/javascript"}))},Sr.fromPort=e=>{if(x3("`PDFWorker.fromPort` - please use `PDFWorker.create` instead."),!e?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return Sr.create(e)};ig=Sr,_T=class{constructor(e,t,n,i,o,s){W(this,as);He(this,"downloadInfoCapability",Promise.withResolvers());W(this,Hi,null);W(this,Rf,new Map);W(this,il,null);W(this,Di,new Map);W(this,Xo,new Map);W(this,bp,new Map);W(this,sl,null);W(this,wp,null);this.messageHandler=e,this.loadingTask=t,N(this,il,n),this.commonObjs=new TE,this.fontLoader=new AS({ownerDocument:i.ownerDocument,styleElement:i.styleElement}),this.enableHWA=i.enableHWA,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.setupMessageHandler(),this.pagesMapper=s,this.pagesMapper.addListener(Y(this,as,P6).bind(this))}get annotationStorage(){return _t(this,"annotationStorage",new t0)}getRenderingIntent(e,t=bl.ENABLE,n=null,i=!1,o=!1){let s=is.DISPLAY,a=e0;switch(e){case"any":s=is.ANY;break;case"display":break;case"print":s=is.PRINT;break;default:Tt(`getRenderingIntent - invalid intent: ${e}`)}let u=s&is.PRINT&&n instanceof dE?n:this.annotationStorage;switch(t){case bl.DISABLE:s+=is.ANNOTATIONS_DISABLE;break;case bl.ENABLE:break;case bl.ENABLE_FORMS:s+=is.ANNOTATIONS_FORMS;break;case bl.ENABLE_STORAGE:s+=is.ANNOTATIONS_STORAGE,a=u.serializable;break;default:Tt(`getRenderingIntent - invalid annotationMode: ${t}`)}i&&(s+=is.IS_EDITING),o&&(s+=is.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,sl)?.reject(new Error("Worker was destroyed during onPassword callback"));let e=[];for(let n of l(this,Di).values())e.push(n._destroy());l(this,Di).clear(),l(this,Xo).clear(),l(this,bp).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,Rf).clear(),this.filterFactory.destroy(),ng.cleanup(),l(this,il)?.cancelAllRequests(new co("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)=>{Wt(l(this,il),"GetReader - no `BasePDFStream` instance available."),N(this,Hi,l(this,il).getFullReader()),l(this,Hi).onProgress=o=>Y(this,as,Uv).call(this,o),i.onPull=()=>{l(this,Hi).read().then(function({value:o,done:s}){if(s){i.close();return}Wt(o instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),i.enqueue(new Uint8Array(o),1,[o])}).catch(o=>{i.error(o)})},i.onCancel=o=>{l(this,Hi).cancel(o),i.ready.catch(s=>{if(!this.destroyed)throw s})}}),e.on("ReaderHeadersReady",async n=>{await l(this,Hi).headersReady;let{isStreamingSupported:i,isRangeSupported:o,contentLength:s}=l(this,Hi);return i&&o&&(l(this,Hi).onProgress=null),{isStreamingSupported:i,isRangeSupported:o,contentLength:s}}),e.on("GetRangeReader",(n,i)=>{Wt(l(this,il),"GetRangeReader - no `BasePDFStream` instance available.");let o=l(this,il).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}Wt(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.pagesMapper.pagesNumber=n.numPages,this._numPages=n.numPages,this._htmlForXfa=n.htmlForXfa,delete n.htmlForXfa,t._capability.resolve(new vT(n,this))}),e.on("DocException",n=>{t._capability.reject(_i(n))}),e.on("PasswordRequest",n=>{N(this,sl,Promise.withResolvers());try{if(!t.onPassword)throw _i(n);let i=o=>{o instanceof Error?l(this,sl).reject(o):l(this,sl).resolve({password:o})};t.onPassword(i,n.code)}catch(i){l(this,sl).reject(i)}return l(this,sl).promise}),e.on("DataLoaded",n=>{Y(this,as,Uv).call(this,{loaded:n.length,total:n.length}),this.downloadInfoCapability.resolve(n)}),e.on("StartRenderPage",n=>{if(this.destroyed)return;l(this,Di).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;Tt(`Error during font loading: ${h}`),this.commonObjs.resolve(n,h);break}let s=new SS(o),a=this._params.pdfBug&&globalThis.FontInspector?.enabled?(h,d)=>globalThis.FontInspector.fontAdded(h,d):null,u=new xS(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;Wt(c,"The imageRef must be defined.");for(let h of l(this,Di).values())for(let[,d]of h.objs)if(d?.ref===c)return d.dataLen?(this.commonObjs.resolve(n,structuredClone(d)),d.dataLen):null;break;case"FontPath":this.commonObjs.resolve(n,new CS(o));break;case"Image":this.commonObjs.resolve(n,o);break;case"Pattern":let f=new TS(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,Di).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||Y(this,as,Uv).call(this,n)}),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&&Tt("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:l(this,Hi)?.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.pagesMapper.pagesNumber)return Promise.reject(new Error("Invalid page request."));let t=e-1,n=this.pagesMapper.getPageId(e)-1,i=l(this,Xo).get(t);if(i)return i;let o=this.messageHandler.sendWithPromise("GetPage",{pageIndex:n}).then(s=>{if(this.destroyed)throw new Error("Transport destroyed");s.refStr&&l(this,bp).set(s.refStr,n);let a=new ET(t,s,this,this.pagesMapper,this._params.pdfBug);return l(this,Di).set(t,a),a});return l(this,Xo).set(t,o),o}async getPageIndex(e){if(!RS(e))throw new Error("Invalid pageIndex request.");let t=await this.messageHandler.sendWithPromise("GetPageIndex",{num:e.num,gen:e.gen}),n=this.pagesMapper.getPageNumber(t+1);if(n===0)throw new Error("GetPageIndex: page has been removed.");return n-1}getAnnotations(e,t){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:this.pagesMapper.getPageId(e+1)-1,intent:t})}getFieldObjects(){return Y(this,as,Bm).call(this,"GetFieldObjects")}hasJSActions(){return Y(this,as,Bm).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 Y(this,as,Bm).call(this,"GetDocJSActions")}getPageJSActions(e){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:this.pagesMapper.getPageId(e+1)-1})}getStructTree(e){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:this.pagesMapper.getPageId(e+1)-1})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(e){return Y(this,as,Bm).call(this,"GetOptionalContentConfig").then(t=>new eT(t,e))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){let e="GetMetadata";return l(this,Rf).getOrInsertComputed(e,()=>this.messageHandler.sendWithPromise(e,null).then(t=>({info:t[0],metadata:t[1]?new JS(t[1]):null,contentDispositionFilename:l(this,Hi)?.filename??null,contentLength:l(this,Hi)?.contentLength??null,hasStructTree:t[2]})))}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,Di).values())if(!t.cleanup())throw new Error(`startCleanup: Page ${t.pageNumber} is currently rendering.`);this.commonObjs.clear(),e||this.fontLoader.clear(),l(this,Rf).clear(),this.filterFactory.destroy(!0),ng.cleanup()}}cachedPageNumber(e){if(!RS(e))return null;let t=e.gen===0?`${e.num}R`:`${e.num}R${e.gen}`,n=l(this,bp).get(t);if(n>=0){let i=this.pagesMapper.getPageNumber(n+1);if(i!==0)return i}return null}};Hi=new WeakMap,Rf=new WeakMap,il=new WeakMap,Di=new WeakMap,Xo=new WeakMap,bp=new WeakMap,sl=new WeakMap,wp=new WeakMap,as=new WeakSet,P6=function({type:e,pageNumbers:t}){if(e==="copy"){N(this,wp,new Map);for(let s of t)l(this,wp).set(s,{proxy:l(this,Di).get(s-1)||null,promise:l(this,Xo).get(s-1)||null});return}if(e==="delete")for(let s of t)l(this,Di).delete(s-1),l(this,Xo).delete(s-1);let n=new Map,i=new Map,{pagesMapper:o}=this;for(let s=0,a=o.pagesNumber;s<a;s++){let u=o.getPrevPageNumber(s+1);if(u<0){let{proxy:d,promise:g}=l(this,wp)?.get(-u)||{};d&&n.set(s,d),g&&i.set(s,g);continue}let c=u-1,f=l(this,Di).get(c);f&&n.set(s,f);let h=l(this,Xo).get(c);h&&i.set(s,h)}N(this,Di,n),N(this,Xo,i)},Bm=function(e,t=null){return l(this,Rf).getOrInsertComputed(e,()=>this.messageHandler.sendWithPromise(e,t))},Uv=function({loaded:e,total:t}){this.loadingTask.onProgress?.({loaded:e,total:t,percent:gn(Math.round(e/t*100),0,100)})};AT=class{constructor(e){He(this,"_internalRenderTask",null);He(this,"onContinue",null);He(this,"onError",null);this._internalRenderTask=e}get promise(){return this._internalRenderTask.capability.promise}cancel(e=0){this._internalRenderTask.cancel(null,e)}get separateAnnots(){let{separateAnnots:e}=this._internalRenderTask.operatorList;if(!e)return!1;let{annotationCanvasMap:t}=this._internalRenderTask;return e.form||e.canvas&&t?.size>0}},$c=class $c{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:d=null,enableHWA:g=!1,operationsFilter:y=null}){W(this,Tu,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=d,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 AT(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=g,this._dependencyTracker=t.dependencyTracker,this._operationsFilter=y}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:e=!1,optionalContentConfig:t}){if(this.cancelled)return;if(this._canvas){if(l($c,Df).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($c,Df).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 Ed(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,Tu)&&(window.cancelAnimationFrame(l(this,Tu)),N(this,Tu,null)),l($c,Df).delete(this._canvas),e||(e=new Qp(`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?N(this,Tu,window.requestAnimationFrame(()=>{N(this,Tu,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($c,Df).delete(this._canvas),this.callback())))}};Tu=new WeakMap,Df=new WeakMap,W($c,Df,new WeakSet);xT=$c,F6="5.5.207",M6="527964698",Ai=class Ai{constructor({editor:e=null,uiManager:t=null}){W(this,fr);W(this,qi,null);W(this,If,null);W(this,vp);W(this,pn,null);W(this,Ty,!1);W(this,Ep,!1);W(this,ol,null);W(this,Cy);W(this,Cu,null);W(this,no,null);e?(N(this,Ep,!1),N(this,ol,e)):N(this,Ep,!0),N(this,no,e?._uiManager||t),N(this,Cy,l(this,no)._eventBus),N(this,vp,e?.color?.toUpperCase()||l(this,no)?.highlightColors.values().next().value||"#FFFF98"),l(Ai,Ry)||N(Ai,Ry,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 _t(this,"_keyboardManager",new sh([[["Escape","mac+Escape"],Ai.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],Ai.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],Ai.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],Ai.prototype._moveToPrevious],[["Home","mac+Home"],Ai.prototype._moveToBeginning],[["End","mac+End"],Ai.prototype._moveToEnd]]))}renderButton(){let e=N(this,qi,document.createElement("button"));e.className="colorPicker",e.tabIndex="0",e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),e.ariaHasPopup="true",l(this,ol)&&(e.ariaControls=`${l(this,ol).id}_colorpicker_dropdown`);let t=l(this,no)._signal;e.addEventListener("click",Y(this,fr,Mc).bind(this),{signal:t}),e.addEventListener("keydown",Y(this,fr,CT).bind(this),{signal:t});let n=N(this,If,document.createElement("span"));return n.className="swatch",n.ariaHidden="true",n.style.backgroundColor=l(this,vp),e.append(n),e}renderMainDropdown(){let e=N(this,pn,Y(this,fr,ST).call(this));return e.ariaOrientation="horizontal",e.ariaLabelledBy="highlightColorPickerLabel",e}_colorSelectFromKeyboard(e){if(e.target===l(this,qi)){Y(this,fr,Mc).call(this,e);return}let t=e.target.getAttribute("data-color");t&&Y(this,fr,TT).call(this,t,e)}_moveToNext(e){if(!l(this,fr,Kl)){Y(this,fr,Mc).call(this,e);return}if(e.target===l(this,qi)){l(this,pn).firstElementChild?.focus();return}e.target.nextSibling?.focus()}_moveToPrevious(e){if(e.target===l(this,pn)?.firstElementChild||e.target===l(this,qi)){l(this,fr,Kl)&&this._hideDropdownFromKeyboard();return}l(this,fr,Kl)||Y(this,fr,Mc).call(this,e),e.target.previousSibling?.focus()}_moveToBeginning(e){if(!l(this,fr,Kl)){Y(this,fr,Mc).call(this,e);return}l(this,pn).firstElementChild?.focus()}_moveToEnd(e){if(!l(this,fr,Kl)){Y(this,fr,Mc).call(this,e);return}l(this,pn).lastElementChild?.focus()}hideDropdown(){l(this,pn)?.classList.add("hidden"),l(this,qi).ariaExpanded="false",l(this,Cu)?.abort(),N(this,Cu,null)}_hideDropdownFromKeyboard(){if(!l(this,Ep)){if(!l(this,fr,Kl)){l(this,ol)?.unselect();return}this.hideDropdown(),l(this,qi).focus({preventScroll:!0,focusVisible:l(this,Ty)})}}updateColor(e){if(l(this,If)&&(l(this,If).style.backgroundColor=e),!l(this,pn))return;let t=l(this,no).highlightColors.values();for(let n of l(this,pn).children)n.ariaSelected=t.next().value===e.toUpperCase()}destroy(){l(this,qi)?.remove(),N(this,qi,null),N(this,If,null),l(this,pn)?.remove(),N(this,pn,null)}};qi=new WeakMap,If=new WeakMap,vp=new WeakMap,pn=new WeakMap,Ty=new WeakMap,Ep=new WeakMap,ol=new WeakMap,Cy=new WeakMap,Cu=new WeakMap,no=new WeakMap,Ry=new WeakMap,fr=new WeakSet,ST=function(){let e=document.createElement("div"),t=l(this,no)._signal;e.addEventListener("contextmenu",us,{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,ol)&&(e.id=`${l(this,ol).id}_colorpicker_dropdown`);for(let[n,i]of l(this,no).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(Ai,Ry)[n]);let s=document.createElement("span");o.append(s),s.className="swatch",s.style.backgroundColor=i,o.ariaSelected=i===l(this,vp),o.addEventListener("click",Y(this,fr,TT).bind(this,i),{signal:t}),e.append(o)}return e.addEventListener("keydown",Y(this,fr,CT).bind(this),{signal:t}),e},TT=function(e,t){t.stopPropagation(),l(this,Cy).dispatch("switchannotationeditorparams",{source:this,type:Bt.HIGHLIGHT_COLOR,value:e}),this.updateColor(e)},CT=function(e){Ai._keyboardManager.exec(this,e)},Mc=function(e){if(l(this,fr,Kl)){this.hideDropdown();return}if(N(this,Ty,e.detail===0),l(this,Cu)||(N(this,Cu,new AbortController),window.addEventListener("pointerdown",Y(this,fr,B6).bind(this),{signal:l(this,no).combinedSignal(l(this,Cu))})),l(this,qi).ariaExpanded="true",l(this,pn)){l(this,pn).classList.remove("hidden");return}let t=N(this,pn,Y(this,fr,ST).call(this));l(this,qi).append(t)},B6=function(e){l(this,pn)?.contains(e.target)||this.hideDropdown()},Kl=function(){return l(this,pn)&&!l(this,pn).classList.contains("hidden")},W(Ai,Ry,null);i0=Ai,zc=class zc{constructor(e){W(this,Yo,null);W(this,Dy,null);W(this,_p,null);N(this,Dy,e),N(this,_p,e._uiManager),l(zc,Iy)||N(zc,Iy,Object.freeze({freetext:"pdfjs-editor-color-picker-free-text-input",ink:"pdfjs-editor-color-picker-ink-input"}))}renderButton(){if(l(this,Yo))return l(this,Yo);let{editorType:e,colorType:t,color:n}=l(this,Dy),i=N(this,Yo,document.createElement("input"));return i.type="color",i.value=n||"#000000",i.className="basicColorPicker",i.tabIndex=0,i.setAttribute("data-l10n-id",l(zc,Iy)[e]),i.addEventListener("input",()=>{l(this,_p).updateParams(t,i.value)},{signal:l(this,_p)._signal}),i}update(e){l(this,Yo)&&(l(this,Yo).value=e)}destroy(){l(this,Yo)?.remove(),N(this,Yo,null)}hideDropdown(){}};Yo=new WeakMap,Dy=new WeakMap,_p=new WeakMap,Iy=new WeakMap,W(zc,Iy,null);CE=zc;RE=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=vm(e),[e,e,e]}static G_HTML([e]){let t=b3(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(vm)}static RGB_HTML(e){return`#${e.map(b3).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[vm(1-Math.min(1,e+i)),vm(1-Math.min(1,n+i)),vm(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]}},RT=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){Xt("Abstract method `_createSVG` called.")}},oh=class extends RT{_createSVG(e){return document.createElementNS(Oa,e)}},oZ=9,ah=new WeakSet,aZ=new Date().getTimezoneOffset()*60*1e3,Xm=class{static create(e){switch(e.data.annotationType){case Yr.LINK:return new s0(e);case Yr.TEXT:return new kT(e);case Yr.WIDGET:switch(e.data.fieldType){case"Tx":return new NT(e);case"Btn":return e.data.radioButton?new DE(e):e.data.checkBox?new LT(e):new PT(e);case"Ch":return new FT(e);case"Sig":return new OT(e)}return new Al(e);case Yr.POPUP:return new o0(e);case Yr.FREETEXT:return new IE(e);case Yr.LINE:return new HT(e);case Yr.SQUARE:return new qT(e);case Yr.CIRCLE:return new GT(e);case Yr.POLYLINE:return new kE(e);case Yr.CARET:return new XT(e);case Yr.INK:return new a0(e);case Yr.POLYGON:return new VT(e);case Yr.HIGHLIGHT:return new NE(e);case Yr.UNDERLINE:return new ZT(e);case Yr.SQUIGGLY:return new KT(e);case Yr.STRIKEOUT:return new JT(e);case Yr.STAMP:return new OE(e);case Yr.FILEATTACHMENT:return new QT(e);default:return new Or(e)}}},FC=class FC{constructor(e,{isRenderable:t=!1,ignoreBorder:n=!1,createQuadrilaterals:i=!1}={}){W(this,ky);W(this,kf,null);W(this,Ap,!1);W(this,Ls,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 FC._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(`${Ym}${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(`${Ym}${t.id}`,{id:t.id,annotationType:t.annotationType,page:this.parent.page,popup:n,popupRef:t.popupRef,modificationDate:new Date}),e||this.removePopup()}removePopup(){(l(this,Ls)?.popup||this.popup)?.remove(),N(this,Ls,this.popup=null)}updateEdited(e){if(!this.container)return;e.rect&&(l(this,kf)||N(this,kf,{rect:this.data.rect.slice(0)}));let{rect:t,popup:n}=e;t&&Y(this,ky,DT).call(this,t);let i=l(this,Ls)?.popup||this.popup;!i&&n?.text&&(this._createPopup(n),i=l(this,Ls).popup),i&&(i.updateEdited(e),n?.deleted&&(i.remove(),N(this,Ls,null),this.popup=null))}resetEdited(){l(this,kf)&&(Y(this,ky,DT).call(this,l(this,kf).rect),l(this,Ls)?.popup.resetEdited(),N(this,kf,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 Al)&&!(this instanceof s0)&&(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 o0){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 E=`calc(${v}px * var(--total-scale-factor)) / calc(${w}px * var(--total-scale-factor))`;s.borderRadius=E}else if(this instanceof DE){let E=`calc(${a}px * var(--total-scale-factor)) / calc(${u}px * var(--total-scale-factor))`;s.borderRadius=E}switch(t.borderStyle.style){case od.SOLID:s.borderStyle="solid";break;case od.DASHED:s.borderStyle="dashed";break;case od.BEVELED:Tt("Unimplemented border style: beveled");break;case od.INSET:Tt("Unimplemented border style: inset");break;case od.UNDERLINE:s.borderBottomStyle="solid";break;default:break}let b=t.borderColor||null;b?(N(this,Ap,!0),s.borderColor=at.makeHexColor(b[0]|0,b[1]|0,b[2]|0)):s.borderWidth=0}let c=at.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:d,pageY:g}=i.rawDims;s.left=`${100*(c[0]-d)/f}%`,s.top=`${100*(c[1]-g)/h}%`;let{rotation:y}=t;return t.hasOwnCanvas||y===0?(s.width=`${100*a/f}%`,s.height=`${100*u/h}%`):this.setRotation(y,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]=RE[`${s}_HTML`](a),this.annotationStorage.setValue(this.data.id,{[n]:RE[`${s}_rgb`](a)})};return _t(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,b,E]=e.subarray(2,6);if(i===v&&o===w&&t===b&&n===E)return}let{style:s}=this.container,a;if(l(this,Ap)){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 d=f.createElement("defs");h.append(d);let g=f.createElement("clipPath"),y=`clippath_${this.data.id}`;g.setAttribute("id",y),g.setAttribute("clipPathUnits","objectBoundingBox"),d.append(g);for(let v=2,w=e.length;v<w;v+=8){let b=e[v],E=e[v+1],_=e[v+2],S=e[v+3],A=f.createElement("rect"),M=(_-t)/u,I=(o-E)/c,q=(b-_)/u,Q=(E-S)/c;A.setAttribute("x",M),A.setAttribute("y",I),A.setAttribute("width",q),A.setAttribute("height",Q),g.append(A),a?.push(`<rect vector-effect="non-scaling-stroke" x="${M}" y="${I}" width="${q}" height="${Q}"/>`)}l(this,Ap)&&(a.push("</g></svg>')"),s.backgroundImage=a.join("")),this.container.append(h),this.container.style.clipPath=`url(#${y})`}_createPopup(e=null){let{data:t}=this,n,i;e?(n={str:e.text},i=e.date):(n=t.contentsObj,i=t.modificationDate),N(this,Ls,new o0({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,Ls)||this.popup||this.data.popupRef)}get extraPopupElement(){return l(this,Ls)}render(){Xt("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&&!ah.has(c)){Tt(`_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&&ah.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]}};kf=new WeakMap,Ap=new WeakMap,Ls=new WeakMap,ky=new WeakSet,DT=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)};Or=FC,IT=class extends Or{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()}},s0=class extends Or{constructor(t,n=null){super(t,{isRenderable:!0,ignoreBorder:!!n?.ignoreBorder,createQuadrilaterals:!0});W(this,os);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?(Y(this,os,U6).call(this,i,t.attachment,t.overlaidText,t.attachmentDest),o=!0):t.setOCGState?(Y(this,os,j6).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==="")&&Y(this,os,Bc).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),Y(this,os,Bc).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),Y(this,os,Bc).call(this)}_bindResetFormAction(t,n){let i=t.onclick;if(i||(t.href=this.linkService.getAnchorUrl("")),Y(this,os,Bc).call(this),!this._fieldObjects){Tt('_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 d of o){let g=this._fieldObjects[d]||[];for(let{id:y}of g)h.add(y)}for(let d of Object.values(this._fieldObjects))for(let g of d)h.has(g.id)===a&&u.push(g)}else for(let h of Object.values(this._fieldObjects))u.push(...h);let c=this.annotationStorage,f=[];for(let h of u){let{id:d}=h;switch(f.push(d),h.type){case"text":{let y=h.defaultValue||"";c.setValue(d,{value:y});break}case"checkbox":case"radiobutton":{let y=h.defaultValue===h.exportValues;c.setValue(d,{value:y});break}case"combobox":case"listbox":{let y=h.defaultValue||"";c.setValue(d,{value:y});break}default:continue}let g=document.querySelector(`[data-element-id="${d}"]`);if(g){if(!ah.has(g)){Tt(`_bindResetFormAction - element not allowed: ${d}`);continue}}else continue;g.dispatchEvent(new Event("resetform"))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:f,name:"ResetForm"}}),!1}}};os=new WeakSet,Bc=function(){this.container.setAttribute("data-internal-link","")},U6=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),Y(this,os,Bc).call(this)},j6=function(t,n,i=""){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(n),!1),i&&(t.title=i),Y(this,os,Bc).call(this)};kT=class extends Or{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}},Al=class extends Or{render(){return this.container}showElementAndHideCanvas(e){this.data.hasOwnCanvas&&(e.previousSibling?.nodeName==="CANVAS"&&(e.previousSibling.hidden=!0),e.hidden=!1)}_getKeyModifier(e){return Wr.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":at.makeHexColor(t[0],t[1],t[2])}_setTextStyle(e){let t=["left","center","right"],{fontColor:n}=this.data.defaultAppearanceData,i=this.data.defaultAppearanceData.fontSize||oZ,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/(Av*i))||1,h=c/f;s=Math.min(i,u(h/Av))}else{let c=Math.abs(this.data.rect[3]-this.data.rect[1]-a);s=Math.min(i,u(c/Av))}o.fontSize=`calc(${s}px * var(--total-scale-factor))`,o.color=at.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)}},NT=class extends Al{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(`
98
+ `)||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),ah.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,d=!!f&&this.enableScripting;c&&(n.title=c),this._setRequired(n,this.data.required),s&&(n.maxLength=s),n.addEventListener("input",y=>{e.setValue(t,{value:y.target.value}),this.setPropertyOnSiblings(n,"value",y.target.value,"value"),u.formattedValue=null}),n.addEventListener("resetform",y=>{let v=this.data.defaultFieldValue??"";n.value=u.userValue=v,u.formattedValue=null});let g=y=>{let{formattedValue:v}=u;v!=null&&(y.target.value=v),y.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){n.addEventListener("focus",v=>{if(u.focused)return;let{target:w}=v;if(d&&(w.type=f,h&&(w.step=h)),u.userValue){let b=u.userValue;if(d)if(f==="time"){let E=new Date(b),_=[E.getHours(),E.getMinutes(),E.getSeconds()];w.value=_.map(S=>S.toString().padStart(2,"0")).join(":")}else w.value=new Date(b-aZ).toISOString().split(f==="date"?"T":".",1)[0];else w.value=b}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(b){u.userValue=b.detail.value??"",d||e.setValue(t,{value:u.userValue.toString()}),b.target.value=u.userValue},formattedValue(b){let{formattedValue:E}=b.detail;u.formattedValue=E,E!=null&&b.target!==document.activeElement&&(b.target.value=E);let _={formattedValue:E};d&&(_.value=E),e.setValue(t,_)},selRange(b){b.target.setSelectionRange(...b.detail.selRange)},charLimit:b=>{let{charLimit:E}=b.detail,{target:_}=b;if(E===0){_.removeAttribute("maxLength");return}_.setAttribute("maxLength",E);let S=u.userValue;!S||S.length<=E||(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:_.selectionStart,selEnd:_.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:b}=v.target;u.lastCommittedValue!==b&&(u.lastCommittedValue=b,u.userValue=b,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:b,willCommit:!0,commitKey:w,selStart:v.target.selectionStart,selEnd:v.target.selectionEnd}}))});let y=g;g=null,n.addEventListener("blur",v=>{if(!u.focused||!v.relatedTarget)return;this.data.actions?.Blur||(u.focused=!1);let{target:w}=v,{value:b}=w;if(d){if(b&&f==="time"){let E=b.split(":").map(_=>parseInt(_,10));b=new Date(2e3,0,1,E[0],E[1],E[2]||0).valueOf(),w.step=""}else b.includes("T")||(b=`${b}T00:00`),b=new Date(b).valueOf();w.type="text"}u.userValue=b,u.lastCommittedValue!==b&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:b,willCommit:!0,commitKey:u.commitKey,selStart:v.target.selectionStart,selEnd:v.target.selectionEnd}}),y(v)}),this.data.actions?.Keystroke&&n.addEventListener("beforeinput",v=>{u.lastCommittedValue=null;let{data:w,target:b}=v,{value:E,selectionStart:_,selectionEnd:S}=b,A=_,M=S;switch(v.inputType){case"deleteWordBackward":{let I=E.substring(0,_).match(/\w*[^\w]*$/);I&&(A-=I[0].length);break}case"deleteWordForward":{let I=E.substring(_).match(/^[^\w]*\w*/);I&&(M+=I[0].length);break}case"deleteContentBackward":_===S&&(A-=1);break;case"deleteContentForward":_===S&&(M+=1);break}v.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:E,change:w||"",willCommit:!1,selStart:A,selEnd:M}})}),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(g&&n.addEventListener("blur",g),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}},OT=class extends Al{constructor(e){super(e,{isRenderable:!!e.data.hasOwnCanvas})}},LT=class extends Al{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 ah.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}},DE=class extends Al{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(ah.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 d=f&&h.id===n;h.domElement&&(h.domElement.checked=d),e.setValue(h.id,{value:d})}}};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}},PT=class extends s0{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}},FT=class extends Al{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");ah.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 d of i.options)d.selected=d.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:d,multiple:g}=i;return g?Array.prototype.filter.call(d,y=>y.selected).map(y=>y[h]):d.selectedIndex===-1?null:d[d.selectedIndex][h]},u=a(!1),c=f=>{let h=f.target.options;return Array.prototype.map.call(h,d=>({displayValue:d.textContent,exportValue:d.value}))};return this.enableScripting&&this.hasJSActions?(i.addEventListener("updatefromsandbox",f=>{let h={value(d){s?.();let g=d.detail.value,y=new Set(Array.isArray(g)?g:[g]);for(let v of i.options)v.selected=y.has(v.value);e.setValue(t,{value:a(!0)}),u=a(!1)},multipleSelection(d){i.multiple=!0},remove(d){let g=i.options,y=d.detail.remove;g[y].selected=!1,i.remove(y),g.length>0&&Array.prototype.findIndex.call(g,w=>w.selected)===-1&&(g[0].selected=!0),e.setValue(t,{value:a(!0),items:c(d)}),u=a(!1)},clear(d){for(;i.length!==0;)i.remove(0);e.setValue(t,{value:null,items:[]}),u=a(!1)},insert(d){let{index:g,displayValue:y,exportValue:v}=d.detail.insert,w=i.children[g],b=document.createElement("option");b.textContent=y,b.value=v,w?w.before(b):i.append(b),e.setValue(t,{value:a(!0),items:c(d)}),u=a(!1)},items(d){let{items:g}=d.detail;for(;i.length!==0;)i.remove(0);for(let y of g){let{displayValue:v,exportValue:w}=y,b=document.createElement("option");b.textContent=v,b.value=w,i.append(b)}i.options.length>0&&(i.options[0].selected=!0),e.setValue(t,{value:a(!0),items:c(d)}),u=a(!1)},indices(d){let g=new Set(d.detail.indices);for(let y of d.target.options)y.selected=g.has(y.index);e.setValue(t,{value:a(!0)}),u=a(!1)},editable(d){d.target.disabled=!d.detail.editable}};this._dispatchEventFromSandbox(h,f)}),i.addEventListener("input",f=>{let h=a(!0),d=a(!1);e.setValue(t,{value:h}),f.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:u,change:d,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}},o0=class extends Or{constructor(t){let{data:n,elements:i,parent:o}=t,s=!!o._commentManager;super(t,{isRenderable:!s&&Or._hasPopupData(n)});W(this,Ny);if(this.elements=i,s&&Or._hasPopupData(n)){let a=this.popup=Y(this,Ny,MT).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=Y(this,Ny,MT).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=>`${pd}${o}`).join(",")),this.container}};Ny=new WeakSet,MT=function(){return new BT({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})};BT=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:d=null}){W(this,Dt);W(this,Gi,null);W(this,Ru,Y(this,Dt,W6).bind(this));W(this,t1,Y(this,Dt,WT).bind(this));W(this,r1,Y(this,Dt,Wv).bind(this));W(this,xp,Y(this,Dt,zv).bind(this));W(this,Sp,null);W(this,jr,null);W(this,Zo,null);W(this,Du,null);W(this,Nf,null);W(this,Tp,null);W(this,Cp,null);W(this,Ko,!1);W(this,Vi,null);W(this,al,null);W(this,ll,null);W(this,$r,null);W(this,ul,null);W(this,Iu,null);W(this,Oy,null);W(this,cl,null);W(this,Rp,null);W(this,Of,null);W(this,ku,!1);W(this,_n,null);W(this,Nu,null);N(this,jr,e),N(this,Rp,i),N(this,Zo,s),N(this,cl,a),N(this,Tp,u),N(this,Sp,t),N(this,Oy,c),N(this,Cp,f),N(this,Nf,n),N(this,Gi,d),N(this,_n,n[0]),N(this,Du,nh.toDateObject(o)),this.trigger=n.flatMap(g=>g.getElementsToTriggerPopup()),d||(Y(this,Dt,jv).call(this),l(this,jr).hidden=!0,h&&Y(this,Dt,zv).call(this))}renderCommentButton(){if(l(this,$r)){l(this,$r).parentNode||l(this,_n).container.after(l(this,$r));return}if(l(this,ul)||Y(this,Dt,UT).call(this),!l(this,ul))return;let{signal:e}=N(this,al,new AbortController),t=l(this,_n).hasOwnCommentButton,n=()=>{l(this,Gi).toggleCommentPopup(this,!0,void 0,!t)},i=()=>{l(this,Gi).toggleCommentPopup(this,!1,!0,!t)},o=()=>{l(this,Gi).toggleCommentPopup(this,!1,!1)};if(t){N(this,$r,l(this,_n).container);for(let s of this.trigger)s.ariaHasPopup="dialog",s.ariaControls="commentPopup",s.addEventListener("keydown",l(this,Ru),{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=N(this,$r,document.createElement("button"));s.className="annotationCommentButton";let a=l(this,_n).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"),Y(this,Dt,$T).call(this),Y(this,Dt,jT).call(this),s.addEventListener("keydown",l(this,Ru),{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,_n).commentData;return e?l(this,Tp)._commentManager.makeCommentColor(e,t):null}focusCommentButton(){setTimeout(()=>{l(this,$r)?.focus()},0)}getData(){let{richText:e,color:t,opacity:n,creationDate:i,modificationDate:o}=l(this,_n).commentData;return{contentsObj:{str:this.comment},richText:e,color:t,opacity:n,creationDate:i,modificationDate:o}}get elementBeforePopup(){return l(this,$r)}get comment(){return l(this,Nu)||N(this,Nu,l(this,_n).commentText),l(this,Nu)}set comment(e){e!==this.comment&&(l(this,_n).commentText=N(this,Nu,e))}focus(){l(this,_n).container?.focus()}get parentBoundingClientRect(){return l(this,_n).layer.getBoundingClientRect()}setCommentButtonStates({selected:e,hasPopup:t}){l(this,$r)&&(l(this,$r).classList.toggle("selected",e),l(this,$r).ariaExpanded=t)}setSelectedCommentButton(e){l(this,$r).classList.toggle("selected",e)}get commentPopupPosition(){if(l(this,Iu))return l(this,Iu);let{x:e,y:t,height:n}=l(this,$r).getBoundingClientRect(),{x:i,y:o,width:s,height:a}=l(this,_n).layer.getBoundingClientRect();return[(e-i)/s,(t+n-o)/a]}set commentPopupPosition(e){N(this,Iu,e)}hasDefaultPopupPosition(){return l(this,Iu)===null}get commentButtonPosition(){return l(this,ul)}get commentButtonWidth(){return l(this,$r).getBoundingClientRect().width/this.parentBoundingClientRect.width}editComment(e){let[t,n]=l(this,Iu)||this.commentButtonPosition.map(c=>c/100),i=this.parentBoundingClientRect,{x:o,y:s,width:a,height:u}=i;l(this,Gi).showDialog(null,this,o+t*a,s+n*u,{...e,parentDimensions:i})}render(){if(l(this,Vi))return;let e=N(this,Vi,document.createElement("div"));if(e.className="popup",l(this,Sp)){let n=e.style.outlineColor=at.makeHexColor(...l(this,Sp));e.style.backgroundColor=`color-mix(in srgb, ${n} 30%, white)`}let t=document.createElement("span");if(t.className="header",l(this,Rp)?.str){let n=document.createElement("span");n.className="title",t.append(n),{dir:n.dir,str:n.textContent}=l(this,Rp)}if(e.append(t),l(this,Du)){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,Du).valueOf()})),n.dateTime=l(this,Du).toISOString(),t.append(n)}IC({html:l(this,Dt,$v)||l(this,Zo).str,dir:l(this,Zo)?.dir,className:"popupContent"},e),l(this,jr).append(e)}updateEdited({rect:e,popup:t,deleted:n}){if(l(this,Gi)){n?(this.remove(),N(this,Nu,null)):t&&(t.deleted?this.remove():(Y(this,Dt,$T).call(this),N(this,Nu,t.text))),e&&(N(this,ul,null),Y(this,Dt,UT).call(this),Y(this,Dt,jT).call(this));return}if(n||t?.deleted){this.remove();return}Y(this,Dt,jv).call(this),l(this,Of)||N(this,Of,{contentsObj:l(this,Zo),richText:l(this,cl)}),e&&N(this,ll,null),t&&t.text&&(N(this,cl,Y(this,Dt,z6).call(this,t.text)),N(this,Du,nh.toDateObject(t.date)),N(this,Zo,null)),l(this,Vi)?.remove(),N(this,Vi,null)}resetEdited(){l(this,Of)&&({contentsObj:ln(this,Zo)._,richText:ln(this,cl)._}=l(this,Of),N(this,Of,null),l(this,Vi)?.remove(),N(this,Vi,null),N(this,ll,null))}remove(){if(l(this,al)?.abort(),N(this,al,null),l(this,Vi)?.remove(),N(this,Vi,null),N(this,ku,!1),N(this,Ko,!1),l(this,$r)?.remove(),N(this,$r,null),this.trigger)for(let e of this.trigger)e.classList.remove("popupTriggerArea")}forceHide(){N(this,ku,this.isVisible),l(this,ku)&&(l(this,jr).hidden=!0)}maybeShow(){l(this,Gi)||(Y(this,Dt,jv).call(this),l(this,ku)&&(l(this,Vi)||Y(this,Dt,Wv).call(this),N(this,ku,!1),l(this,jr).hidden=!1))}get isVisible(){return l(this,Gi)?!1:l(this,jr).hidden===!1}};Gi=new WeakMap,Ru=new WeakMap,t1=new WeakMap,r1=new WeakMap,xp=new WeakMap,Sp=new WeakMap,jr=new WeakMap,Zo=new WeakMap,Du=new WeakMap,Nf=new WeakMap,Tp=new WeakMap,Cp=new WeakMap,Ko=new WeakMap,Vi=new WeakMap,al=new WeakMap,ll=new WeakMap,$r=new WeakMap,ul=new WeakMap,Iu=new WeakMap,Oy=new WeakMap,cl=new WeakMap,Rp=new WeakMap,Of=new WeakMap,ku=new WeakMap,_n=new WeakMap,Nu=new WeakMap,Dt=new WeakSet,jv=function(){if(l(this,al))return;N(this,al,new AbortController);let{signal:e}=l(this,al);for(let t of this.trigger)t.addEventListener("click",l(this,xp),{signal:e}),t.addEventListener("pointerenter",l(this,r1),{signal:e}),t.addEventListener("pointerleave",l(this,t1),{signal:e}),t.classList.add("popupTriggerArea");for(let t of l(this,Nf))t.container?.addEventListener("keydown",l(this,Ru),{signal:e})},UT=function(){let e=l(this,Nf).find(t=>t.hasCommentButton);e&&N(this,ul,e._normalizePoint(e.commentButtonPosition))},jT=function(){if(l(this,_n).extraPopupElement&&!l(this,_n).editor)return;l(this,$r)||this.renderCommentButton();let[e,t]=l(this,ul),{style:n}=l(this,$r);n.left=`calc(${e}%)`,n.top=`calc(${t}% - var(--comment-button-dim))`},$T=function(){l(this,_n).extraPopupElement||(l(this,$r)||this.renderCommentButton(),l(this,$r).style.backgroundColor=this.commentButtonColor||"")},$v=function(){let e=l(this,cl),t=l(this,Zo);return e?.str&&(!t?.str||t.str===e.str)&&l(this,cl).html||null},zT=function(){return l(this,Dt,$v)?.attributes?.style?.fontSize||0},$6=function(){return l(this,Dt,$v)?.attributes?.style?.color||null},z6=function(e){let t=[],n={str:e,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:t}]}},i={style:{color:l(this,Dt,$6),fontSize:l(this,Dt,zT)?`calc(${l(this,Dt,zT)}px * var(--total-scale-factor))`:""}};for(let o of e.split(`
99
+ `))t.push({name:"span",value:o,attributes:i});return n},W6=function(e){e.altKey||e.shiftKey||e.ctrlKey||e.metaKey||(e.key==="Enter"||e.key==="Escape"&&l(this,Ko))&&Y(this,Dt,zv).call(this)},H6=function(){if(l(this,ll)!==null)return;let{page:{view:e},viewport:{rawDims:{pageWidth:t,pageHeight:n,pageX:i,pageY:o}}}=l(this,Tp),s=!!l(this,Cp),a=s?l(this,Cp):l(this,Oy);for(let y of l(this,Nf))if(!a||at.intersect(y.data.rect,a)!==null){a=y.data.rect,s=!0;break}let u=at.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,d=u[1];N(this,ll,[100*(h-i)/t,100*(d-o)/n]);let{style:g}=l(this,jr);g.left=`${l(this,ll)[0]}%`,g.top=`${l(this,ll)[1]}%`},zv=function(){if(l(this,Gi)){l(this,Gi).toggleCommentPopup(this,!1);return}N(this,Ko,!l(this,Ko)),l(this,Ko)?(Y(this,Dt,Wv).call(this),l(this,jr).addEventListener("click",l(this,xp)),l(this,jr).addEventListener("keydown",l(this,Ru))):(Y(this,Dt,WT).call(this),l(this,jr).removeEventListener("click",l(this,xp)),l(this,jr).removeEventListener("keydown",l(this,Ru)))},Wv=function(){l(this,Vi)||this.render(),this.isVisible?l(this,Ko)&&l(this,jr).classList.add("focused"):(Y(this,Dt,H6).call(this),l(this,jr).hidden=!1,l(this,jr).style.zIndex=parseInt(l(this,jr).style.zIndex)+1e3)},WT=function(){l(this,jr).classList.remove("focused"),!(l(this,Ko)||!this.isVisible)&&(l(this,jr).hidden=!0,l(this,jr).style.zIndex=parseInt(l(this,jr).style.zIndex)-1e3)};IE=class extends Or{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.textContent=e.data.textContent,this.textPosition=e.data.textPosition,this.annotationEditorType=At.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}},HT=class extends Or{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0});W(this,Ly,null)}render(){this.container.classList.add("lineAnnotation");let{data:t,width:n,height:i}=this,o=this.svgFactory.create(n,i,!0),s=N(this,Ly,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,Ly)}addHighlightArea(){this.container.classList.add("highlightArea")}};Ly=new WeakMap;qT=class extends Or{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0});W(this,Py,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=N(this,Py,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,Py)}addHighlightArea(){this.container.classList.add("highlightArea")}};Py=new WeakMap;GT=class extends Or{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0});W(this,Fy,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=N(this,Fy,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,Fy)}addHighlightArea(){this.container.classList.add("highlightArea")}};Fy=new WeakMap;kE=class extends Or{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0});W(this,My,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,d=n.length;h<d;h+=2){let g=n[h]-t[0],y=t[3]-n[h+1];c.push(`${g},${y}`)}c=c.join(" ");let f=N(this,My,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,My)}addHighlightArea(){this.container.classList.add("highlightArea")}};My=new WeakMap;VT=class extends kE{constructor(e){super(e),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}},XT=class extends Or{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}},a0=class extends Or{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0});W(this,Uy);W(this,By,null);W(this,Lf,[]);this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=this.data.it==="InkHighlight"?At.HIGHLIGHT:At.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}=Y(this,Uy,YT).call(this,n,t),f=this.svgFactory.create(u,c,!0),h=N(this,By,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 d=0,g=i.length;d<g;d++){let y=this.svgFactory.createElement(this.svgElementName);l(this,Lf).push(y),y.setAttribute("points",i[d].join(",")),h.append(y)}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,By);if(n>=0&&s.setAttribute("stroke-width",n||1),i)for(let a=0,u=l(this,Lf).length;a<u;a++)l(this,Lf)[a].setAttribute("points",i[a].join(","));if(o){let{transform:a,width:u,height:c}=Y(this,Uy,YT).call(this,this.data.rotation,o);s.parentElement.setAttribute("viewBox",`0 0 ${u} ${c}`),s.setAttribute("transform",a)}}getElementsToTriggerPopup(){return l(this,Lf)}addHighlightArea(){this.container.classList.add("highlightArea")}};By=new WeakMap,Lf=new WeakMap,Uy=new WeakSet,YT=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]}}};NE=class extends Or{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=At.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}},ZT=class extends Or{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}},KT=class extends Or{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}},JT=class extends Or{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}},OE=class extends Or{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=At.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}},QT=class extends Or{constructor(t){super(t,{isRenderable:!0});W(this,$y);W(this,jy,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",Y(this,$y,eC).bind(this)),N(this,jy,i);let{isMac:o}=Wr.platform;return t.addEventListener("keydown",s=>{s.key==="Enter"&&(o?s.metaKey:s.ctrlKey)&&Y(this,$y,eC).call(this)}),!n.popupRef&&this.hasPopupData?(this.hasOwnCommentButton=!0,this._createPopup()):i.classList.add("popupTriggerArea"),t.append(i),t}getElementsToTriggerPopup(){return l(this,jy)}addHighlightArea(){this.container.classList.add("highlightArea")}};jy=new WeakMap,$y=new WeakSet,eC=function(){this.downloadManager?.openOrDownloadData(this.content,this.filename)};MC=class MC{constructor({div:e,accessibilityManager:t,annotationCanvasMap:n,annotationEditorUIManager:i,page:o,viewport:s,structTreeLayer:a,commentManager:u,linkService:c,annotationStorage:f}){W(this,vl);W(this,Pf,null);W(this,Ff,null);W(this,Dp,null);W(this,Ou,new Map);W(this,zy,null);W(this,Mf,null);W(this,Xi,[]);W(this,Wy,!1);this.div=e,N(this,Pf,t),N(this,Ff,n),N(this,zy,a||null),N(this,Mf,c||null),N(this,Dp,f||new t0),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;qu(n,this.viewport);let i=new Map,o=[],s={data:null,layer:n,linkService:l(this,Mf),downloadManager:e.downloadManager,imageResourcesPath:e.imageResourcesPath||"",renderForms:e.renderForms!==!1,svgFactory:new oh,annotationStorage:l(this,Dp),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===Yr.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=Xm.create(s);if(!c.isRenderable)continue;u||(l(this,Xi).push(c),a.popupRef&&i.getOrInsertComputed(a.popupRef,DC).push(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 Y(this,vl,Hv).call(this);for(let a of o){let u=s.elements=i.get(a.id);s.data=a;let c=Xm.create(s);if(!c.isRenderable)continue;let f=c.render();c.contentElement.id=`${pd}${a.id}`,a.hidden&&(f.style.visibility="hidden"),u.at(-1).container.after(f)}Y(this,vl,tC).call(this)}async addLinkAnnotations(e){let t={data:null,layer:this.div,linkService:l(this,Mf),svgFactory:new oh,parent:this};for(let n of e){n.borderStyle||(n.borderStyle=MC._defaultBorderStyle),t.data=n;let i=Xm.create(t);i.isRenderable&&(i.render(),i.contentElement.id=`${pd}${n.id}`,l(this,Xi).push(i))}await Y(this,vl,Hv).call(this)}update({viewport:e}){let t=this.div;this.viewport=e,qu(t,{rotation:e.rotation}),Y(this,vl,tC).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 IT({data:{id:n,rect:e.getPDFRect(),rotation:i},editor:e,layer:t,parent:this,enableComment:!!this._commentManager,linkService:l(this,Mf),annotationStorage:l(this,Dp)});return o.render(),o.contentElement.id=`${pd}${n}`,o.createOrUpdatePopup(),l(this,Xi).push(o),o}removeAnnotation(e){let t=l(this,Xi).findIndex(i=>i.data.id===e);if(t<0)return;let[n]=l(this,Xi).splice(t,1);l(this,Pf)?.removePointerInTextLayer(n.contentElement)}updateFakeAnnotations(e){if(e.length!==0){for(let t of e)t.updateFakeAnnotationElement(this);Y(this,vl,Hv).call(this)}}togglePointerEvents(e=!1){this.div.classList.toggle("disabled",!e)}static get _defaultBorderStyle(){return _t(this,"_defaultBorderStyle",Object.freeze({width:1,rawWidth:1,style:od.SOLID,dashArray:[3],horizontalCornerRadius:0,verticalCornerRadius:0}))}};Pf=new WeakMap,Ff=new WeakMap,Dp=new WeakMap,Ou=new WeakMap,zy=new WeakMap,Mf=new WeakMap,Xi=new WeakMap,Wy=new WeakMap,vl=new WeakSet,Hv=async function(){if(l(this,Xi).length===0)return;this.div.replaceChildren();let e=[];if(!l(this,Wy)){N(this,Wy,!0);for(let{contentElement:n,data:{id:i}}of l(this,Xi)){let o=n.id=`${pd}${i}`;e.push(l(this,zy)?.getAriaAttributes(o).then(s=>{if(s)for(let[a,u]of s)n.setAttribute(a,u)}))}}l(this,Xi).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,d=i,g=(i+s)/2,y=f,v=u,w=(u+f)/2;if(g>=y&&w<=d)return-1;if(w>=h&&g<=v)return 1;let b=(n+o)/2,E=(a+c)/2;return b-E});let t=document.createDocumentFragment();for(let n of l(this,Xi))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,Pf))for(let n of l(this,Xi))l(this,Pf).addPointerInTextLayer(n.contentElement,!1)},tC=function(){if(!l(this,Ff))return;let e=this.div;for(let[t,n]of l(this,Ff)){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,Ff).clear()};LE=MC,vv=/\r\n?|\n/g,Er=class Er extends br{constructor(t){super({...t,name:"freeTextEditor"});W(this,rn);W(this,Yi,"");W(this,Hy,`${this.id}-editor`);W(this,Bf,null);W(this,Zi);He(this,"_colorPicker",null);this.color=t.color||Er._defaultColor||br._defaultLineColor,N(this,Zi,t.fontSize||Er._defaultFontSize),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-freetext-added-alert"),this.canAddComment=!1}static get _keyboardManager(){let t=Er.prototype,n=s=>s.isEmpty(),i=Gu.TRANSLATE_SMALL,o=Gu.TRANSLATE_BIG;return _t(this,"_keyboardManager",new sh([[["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){br.initialize(t,n);let i=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(i.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,n){switch(t){case Bt.FREETEXT_SIZE:Er._defaultFontSize=n;break;case Bt.FREETEXT_COLOR:Er._defaultColor=n;break}}updateParams(t,n){switch(t){case Bt.FREETEXT_SIZE:Y(this,rn,q6).call(this,n);break;case Bt.FREETEXT_COLOR:Y(this,rn,G6).call(this,n);break}}static get defaultPropertiesToUpdate(){return[[Bt.FREETEXT_SIZE,Er._defaultFontSize],[Bt.FREETEXT_COLOR,Er._defaultColor||br._defaultLineColor]]}get propertiesToUpdate(){return[[Bt.FREETEXT_SIZE,l(this,Zi)],[Bt.FREETEXT_COLOR,this.color]]}get toolbarButtons(){return this._colorPicker||(this._colorPicker=new CE(this)),[["colorPicker",this._colorPicker]]}get colorType(){return Bt.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[-Er._internalPadding*t,-(Er._internalPadding+l(this,Zi))*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"),N(this,Bf,new AbortController);let t=this._uiManager.combinedSignal(l(this,Bf));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,Bf)?.abort(),N(this,Bf,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,Yi),n=N(this,Yi,Y(this,rn,V6).call(this).trimEnd());if(t===n)return;let i=o=>{if(N(this,Yi,o),!o){this.remove();return}Y(this,rn,Vv).call(this),this._uiManager.rebuild(this),Y(this,rn,qv).call(this)};this.addCommands({cmd:()=>{i(n)},undo:()=>{i(t)},mustExec:!1}),Y(this,rn,qv).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){Er._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,Zi)}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,[d,g]=this.pageTranslation,y,v;switch(this.rotation){case 0:y=t+(a[0]-d)/f,v=n+this.height-(a[1]-g)/h;break;case 90:y=t+(a[0]-d)/f,v=n-(a[1]-g)/h,[u,c]=[c,-u];break;case 180:y=t-this.width+(a[0]-d)/f,v=n-(a[1]-g)/h,[u,c]=[-u,-c];break;case 270:y=t+(a[0]-d-this.height*h)/f,v=n+(a[1]-g-this.width*f)/h,[u,c]=[-c,u];break}this.setAt(y*o,v*s,u,c)}else this._moveAfterPaste(t,n);Y(this,rn,Vv).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}editorDivPaste(t){var y,v,w;let n=t.clipboardData||window.clipboardData,{types:i}=n;if(i.length===1&&i[0]==="text/plain")return;t.preventDefault();let o=Y(y=Er,El,nC).call(y,n.getData("text")||"").replaceAll(vv,`
100
+ `);if(!o)return;let s=window.getSelection();if(!s.rangeCount)return;this.editorDiv.normalize(),s.deleteFromDocument();let a=s.getRangeAt(0);if(!o.includes(`
101
+ `)){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 b=u.parentElement;if(h.push(u.nodeValue.slice(c).replaceAll(vv,"")),b!==this.editorDiv){let E=f;for(let _ of this.editorDiv.childNodes){if(_===b){E=h;continue}E.push(Y(v=Er,El,Gv).call(v,_))}}f.push(u.nodeValue.slice(0,c).replaceAll(vv,""))}else if(u===this.editorDiv){let b=f,E=0;for(let _ of this.editorDiv.childNodes)E++===c&&(b=h),b.push(Y(w=Er,El,Gv).call(w,_))}N(this,Yi,`${f.join(`
102
+ `)}${o}${h.join(`
103
+ `)}`),Y(this,rn,Vv).call(this);let d=new Range,g=Math.sumPrecise(f.map(b=>b.length));for(let{firstChild:b}of this.editorDiv.childNodes)if(b.nodeType===Node.TEXT_NODE){let E=b.nodeValue.length;if(g<=E){d.setStart(b,g),d.setEnd(b,g);break}g-=E}s.removeAllRanges(),s.addRange(d)}get contentDiv(){return this.editorDiv}getPDFRect(){let t=Er._internalPadding*this.parentScale;return this.getRect(t,t)}static async deserialize(t,n,i){var a;let o=null;if(t instanceof IE){let{data:{defaultAppearanceData:{fontSize:u,fontColor:c},rect:f,rotation:h,id:d,popupRef:g,richText:y,contentsObj:v,creationDate:w,modificationDate:b},textContent:E,textPosition:_,parent:{page:{pageNumber:S}}}=t;if(!E||E.length===0)return null;o=t={annotationType:At.FREETEXT,color:Array.from(c),fontSize:u,value:E.join(`
104
+ `),position:_,pageIndex:S-1,rect:f.slice(0),rotation:h,annotationElementId:d,id:d,deleted:!1,popupRef:g,comment:v?.str||null,richText:y,creationDate:w,modificationDate:b}}let s=await super.deserialize(t,n,i);return N(s,Zi,t.fontSize),s.color=at.makeHexColor(...t.color),N(s,Yi,Y(a=Er,El,nC).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=br._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.color),i=Object.assign(super.serialize(t),{color:n,fontSize:l(this,Zi),value:Y(this,rn,X6).call(this)});return this.addComment(i),t?(i.isCopy=!0,i):this.annotationElementId&&!Y(this,rn,Y6).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,Zi)}px * var(--total-scale-factor))`,i.color=this.color,n.replaceChildren();for(let o of l(this,Yi).split(`
105
+ `)){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,Yi)}}),n}resetAnnotationElement(t){super.resetAnnotationElement(t),t.resetEdited()}};Yi=new WeakMap,Hy=new WeakMap,Bf=new WeakMap,Zi=new WeakMap,rn=new WeakSet,q6=function(t){let n=o=>{this.editorDiv.style.fontSize=`calc(${o}px * var(--total-scale-factor))`,this.translate(0,-(o-l(this,Zi))*this.parentScale),N(this,Zi,o),Y(this,rn,qv).call(this)},i=l(this,Zi);this.addCommands({cmd:n.bind(this,t),undo:n.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Bt.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})},G6=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:Bt.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})},V6=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(Y(i=Er,El,Gv).call(i,o)),n=o);return t.join(`
106
+ `)},qv=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()},El=new WeakSet,Gv=function(t){return(t.nodeType===Node.TEXT_NODE?t.nodeValue:t.innerText).replaceAll(vv,"")},Vv=function(){if(this.editorDiv.replaceChildren(),!!l(this,Yi))for(let t of l(this,Yi).split(`
107
+ `)){let n=document.createElement("div");n.append(t?document.createTextNode(t):document.createElement("br")),this.editorDiv.append(n)}},X6=function(){return l(this,Yi).replaceAll("\xA0"," ")},nC=function(t){return t.replaceAll(" ","\xA0")},Y6=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},W(Er,El),He(Er,"_freeTextDefaultContent",""),He(Er,"_internalPadding",0),He(Er,"_defaultColor",null),He(Er,"_defaultFontSize",10),He(Er,"_type","freetext"),He(Er,"_editorType",At.FREETEXT);rC=Er,ut=class{toSVGPath(){Xt("Abstract method `toSVGPath` must be implemented.")}get box(){Xt("Abstract getter `box` must be implemented.")}serialize(e,t){Xt("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]}};He(ut,"PRECISION",1e-4);Ma=class Ma{constructor({x:e,y:t},n,i,o,s,a=0){W(this,mn);W(this,Ki);W(this,io,[]);W(this,Ip);W(this,kp);W(this,Jo,[]);W(this,Lt,new Float32Array(18));W(this,Uf);W(this,jf);W(this,qy);W(this,Gy);W(this,Np);W(this,Op);W(this,Lu,[]);N(this,Ki,n),N(this,Op,o*i),N(this,kp,s),l(this,Lt).set([NaN,NaN,NaN,NaN,e,t],6),N(this,Ip,a),N(this,Gy,l(Ma,Vy)*i),N(this,qy,l(Ma,i1)*i),N(this,Np,i),l(this,Lu).push(e,t)}isEmpty(){return isNaN(l(this,Lt)[8])}add({x:e,y:t}){N(this,Uf,e),N(this,jf,t);let[n,i,o,s]=l(this,Ki),[a,u,c,f]=l(this,Lt).subarray(8,12),h=e-c,d=t-f,g=Math.hypot(h,d);if(g<l(this,qy))return!1;let y=g-l(this,Gy),v=y/g,w=v*h,b=v*d,E=a,_=u;a=c,u=f,c+=w,f+=b,l(this,Lu)?.push(e,t);let S=-b/y,A=w/y,M=S*l(this,Op),I=A*l(this,Op);return l(this,Lt).set(l(this,Lt).subarray(2,8),0),l(this,Lt).set([c+M,f+I],4),l(this,Lt).set(l(this,Lt).subarray(14,18),12),l(this,Lt).set([c-M,f-I],16),isNaN(l(this,Lt)[6])?(l(this,Jo).length===0&&(l(this,Lt).set([a+M,u+I],2),l(this,Jo).push(NaN,NaN,NaN,NaN,(a+M-n)/o,(u+I-i)/s),l(this,Lt).set([a-M,u-I],14),l(this,io).push(NaN,NaN,NaN,NaN,(a-M-n)/o,(u-I-i)/s)),l(this,Lt).set([E,_,a,u,c,f],6),!this.isEmpty()):(l(this,Lt).set([E,_,a,u,c,f],6),Math.abs(Math.atan2(_-u,E-a)-Math.atan2(b,w))<Math.PI/2?([a,u,c,f]=l(this,Lt).subarray(2,6),l(this,Jo).push(NaN,NaN,NaN,NaN,((a+c)/2-n)/o,((u+f)/2-i)/s),[a,u,E,_]=l(this,Lt).subarray(14,18),l(this,io).push(NaN,NaN,NaN,NaN,((E+a)/2-n)/o,((_+u)/2-i)/s),!0):([E,_,a,u,c,f]=l(this,Lt).subarray(0,6),l(this,Jo).push(((E+5*a)/6-n)/o,((_+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,Lt).subarray(12,18),l(this,io).push(((E+5*a)/6-n)/o,((_+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,Jo),t=l(this,io);if(isNaN(l(this,Lt)[6])&&!this.isEmpty())return Y(this,mn,Z6).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]}`);Y(this,mn,J6).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 Y(this,mn,K6).call(this,n),n.join(" ")}newFreeDrawOutline(e,t,n,i,o,s){return new FE(e,t,n,i,o,s)}getOutlines(){let e=l(this,Jo),t=l(this,io),n=l(this,Lt),[i,o,s,a]=l(this,Ki),u=new Float32Array((l(this,Lu)?.length??0)+2);for(let h=0,d=u.length-2;h<d;h+=2)u[h]=(l(this,Lu)[h]-i)/s,u[h+1]=(l(this,Lu)[h+1]-o)/a;if(u[u.length-2]=(l(this,Uf)-i)/s,u[u.length-1]=(l(this,jf)-o)/a,isNaN(n[6])&&!this.isEmpty())return Y(this,mn,Q6).call(this,u);let c=new Float32Array(l(this,Jo).length+24+l(this,io).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=Y(this,mn,t8).call(this,c,f);for(let h=t.length-6;h>=6;h-=6)for(let d=0;d<6;d+=2){if(isNaN(t[h+d])){c[f]=c[f+1]=NaN,f+=2;continue}c[f]=t[h+d],c[f+1]=t[h+d+1],f+=2}return Y(this,mn,e8).call(this,c,f),this.newFreeDrawOutline(c,u,l(this,Ki),l(this,Np),l(this,Ip),l(this,kp))}};Ki=new WeakMap,io=new WeakMap,Ip=new WeakMap,kp=new WeakMap,Jo=new WeakMap,Lt=new WeakMap,Uf=new WeakMap,jf=new WeakMap,qy=new WeakMap,Gy=new WeakMap,Np=new WeakMap,Op=new WeakMap,Lu=new WeakMap,Vy=new WeakMap,n1=new WeakMap,i1=new WeakMap,mn=new WeakSet,Um=function(){let e=l(this,Lt).subarray(4,6),t=l(this,Lt).subarray(16,18),[n,i,o,s]=l(this,Ki);return[(l(this,Uf)+(e[0]-t[0])/2-n)/o,(l(this,jf)+(e[1]-t[1])/2-i)/s,(l(this,Uf)+(t[0]-e[0])/2-n)/o,(l(this,jf)+(t[1]-e[1])/2-i)/s]},Z6=function(){let[e,t,n,i]=l(this,Ki),[o,s,a,u]=Y(this,mn,Um).call(this);return`M${(l(this,Lt)[2]-e)/n} ${(l(this,Lt)[3]-t)/i} L${(l(this,Lt)[4]-e)/n} ${(l(this,Lt)[5]-t)/i} L${o} ${s} L${a} ${u} L${(l(this,Lt)[16]-e)/n} ${(l(this,Lt)[17]-t)/i} L${(l(this,Lt)[14]-e)/n} ${(l(this,Lt)[15]-t)/i} Z`},K6=function(e){let t=l(this,io);e.push(`L${t[4]} ${t[5]} Z`)},J6=function(e){let[t,n,i,o]=l(this,Ki),s=l(this,Lt).subarray(4,6),a=l(this,Lt).subarray(16,18),[u,c,f,h]=Y(this,mn,Um).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}`)},Q6=function(e){let t=l(this,Lt),[n,i,o,s]=l(this,Ki),[a,u,c,f]=Y(this,mn,Um).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,Ki),l(this,Np),l(this,Ip),l(this,kp))},e8=function(e,t){let n=l(this,io);return e.set([NaN,NaN,NaN,NaN,n[4],n[5]],t),t+=6},t8=function(e,t){let n=l(this,Lt).subarray(4,6),i=l(this,Lt).subarray(16,18),[o,s,a,u]=l(this,Ki),[c,f,h,d]=Y(this,mn,Um).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,d,NaN,NaN,NaN,NaN,(i[0]-o)/a,(i[1]-s)/u],t),t+=24},W(Ma,Vy,8),W(Ma,n1,2),W(Ma,i1,l(Ma,Vy)+l(Ma,n1));PE=Ma,FE=class extends ut{constructor(t,n,i,o,s,a){super();W(this,s1);W(this,Lp);W(this,$f,new Float32Array(4));W(this,fl);W(this,Xy);W(this,Ji);W(this,Yy);W(this,Kr);N(this,Kr,t),N(this,Ji,n),N(this,Lp,i),N(this,Yy,o),N(this,fl,s),N(this,Xy,a),this.firstPoint=[NaN,NaN],this.lastPoint=[NaN,NaN],Y(this,s1,r8).call(this,a);let[u,c,f,h]=l(this,$f);for(let d=0,g=t.length;d<g;d+=2)t[d]=(t[d]-u)/f,t[d+1]=(t[d+1]-c)/h;for(let d=0,g=n.length;d<g;d+=2)n[d]=(n[d]-u)/f,n[d+1]=(n[d+1]-c)/h}toSVGPath(){let t=[`M${l(this,Kr)[4]} ${l(this,Kr)[5]}`];for(let n=6,i=l(this,Kr).length;n<i;n+=6){if(isNaN(l(this,Kr)[n])){t.push(`L${l(this,Kr)[n+4]} ${l(this,Kr)[n+5]}`);continue}t.push(`C${l(this,Kr)[n]} ${l(this,Kr)[n+1]} ${l(this,Kr)[n+2]} ${l(this,Kr)[n+3]} ${l(this,Kr)[n+4]} ${l(this,Kr)[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=ut._rescale(l(this,Kr),t,o,a,-u),f=ut._rescale(l(this,Ji),t,o,a,-u);break;case 90:c=ut._rescaleAndSwap(l(this,Kr),t,n,a,u),f=ut._rescaleAndSwap(l(this,Ji),t,n,a,u);break;case 180:c=ut._rescale(l(this,Kr),i,n,-a,u),f=ut._rescale(l(this,Ji),i,n,-a,u);break;case 270:c=ut._rescaleAndSwap(l(this,Kr),i,o,-a,-u),f=ut._rescaleAndSwap(l(this,Ji),i,o,-a,-u);break}return{outline:Array.from(c),points:[Array.from(f)]}}get box(){return l(this,$f)}newOutliner(t,n,i,o,s,a=0){return new PE(t,n,i,o,s,a)}getNewOutline(t,n){let[i,o,s,a]=l(this,$f),[u,c,f,h]=l(this,Lp),d=s*f,g=a*h,y=i*f+u,v=o*h+c,w=this.newOutliner({x:l(this,Ji)[0]*d+y,y:l(this,Ji)[1]*g+v},l(this,Lp),l(this,Yy),t,l(this,Xy),n??l(this,fl));for(let b=2;b<l(this,Ji).length;b+=2)w.add({x:l(this,Ji)[b]*d+y,y:l(this,Ji)[b+1]*g+v});return w.getOutlines()}};Lp=new WeakMap,$f=new WeakMap,fl=new WeakMap,Xy=new WeakMap,Ji=new WeakMap,Yy=new WeakMap,Kr=new WeakMap,s1=new WeakSet,r8=function(t){let n=l(this,Kr),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,d=new Float32Array(4);for(let y=6,v=n.length;y<v;y+=6){let w=n[y+4],b=n[y+5];isNaN(n[y])?(at.pointBoundingBox(w,b,s),u>b?(a=w,u=b):u===b&&(a=h(a,w)),f<b?(c=w,f=b):f===b&&(c=h(c,w))):(d[0]=d[1]=1/0,d[2]=d[3]=-1/0,at.bezierBoundingBox(i,o,...n.slice(y,y+6),d),at.rectBoundingBox(d[0],d[1],d[2],d[3],s),u>d[1]?(a=d[0],u=d[1]):u===d[1]&&(a=h(a,d[0])),f<d[3]?(c=d[2],f=d[3]):f===d[3]&&(c=h(c,d[2]))),i=w,o=b}let g=l(this,$f);g[0]=s[0]-l(this,fl),g[1]=s[1]-l(this,fl),g[2]=s[2]-s[0]+2*l(this,fl),g[3]=s[3]-s[1]+2*l(this,fl),this.firstPoint=[a,u],this.lastPoint=[c,f]};l0=class{constructor(e,t=0,n=0,i=!0){W(this,li);W(this,Zy);W(this,Ky);W(this,Jy);W(this,Pu,[]);W(this,so,[]);let o=[1/0,1/0,-1/0,-1/0],a=10**-4;for(let{x:w,y:b,width:E,height:_}of e){let S=Math.floor((w-t)/a)*a,A=Math.ceil((w+E+t)/a)*a,M=Math.floor((b-t)/a)*a,I=Math.ceil((b+_+t)/a)*a,q=[S,M,I,!0],Q=[A,M,I,!1];l(this,Pu).push(q,Q),at.rectBoundingBox(S,M,A,I,o)}let u=o[2]-o[0]+2*n,c=o[3]-o[1]+2*n,f=o[0]-n,h=o[1]-n,d=i?-1/0:1/0,g=1/0,y=l(this,Pu).at(i?-1:-2),v=[y[0],y[2]];for(let w of l(this,Pu)){let[b,E,_,S]=w;!S&&i?E<g?(g=E,d=b):E===g&&(d=Math.max(d,b)):S&&!i&&(E<g?(g=E,d=b):E===g&&(d=Math.min(d,b))),w[0]=(b-f)/u,w[1]=(E-h)/c,w[2]=(_-h)/c}N(this,Zy,new Float32Array([f,h,u,c])),N(this,Ky,[d,g]),N(this,Jy,v)}getOutlines(){l(this,Pu).sort((t,n)=>t[0]-n[0]||t[1]-n[1]||t[2]-n[2]);let e=[];for(let t of l(this,Pu))t[3]?(e.push(...Y(this,li,iC).call(this,t)),Y(this,li,i8).call(this,t)):(Y(this,li,s8).call(this,t),e.push(...Y(this,li,iC).call(this,t)));return Y(this,li,n8).call(this,e)}};Zy=new WeakMap,Ky=new WeakMap,Jy=new WeakMap,Pu=new WeakMap,so=new WeakMap,li=new WeakSet,n8=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 d=a,g=u;for(o=[a,c],i.push(o);;){let y;if(n.has(f))y=f;else if(n.has(h))y=h;else break;n.delete(y),[a,u,c,f,h]=y,d!==a&&(o.push(d,g,a,g===u?u:c),d=a),g=g===u?c:u}o.push(d,g)}return new sC(i,l(this,Zy),l(this,Ky),l(this,Jy))},Xv=function(e){let t=l(this,so),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},i8=function([,e,t]){let n=Y(this,li,Xv).call(this,e);l(this,so).splice(n,0,[e,t])},s8=function([,e,t]){let n=Y(this,li,Xv).call(this,e);for(let i=n;i<l(this,so).length;i++){let[o,s]=l(this,so)[i];if(o!==e)break;if(o===e&&s===t){l(this,so).splice(i,1);return}}for(let i=n-1;i>=0;i--){let[o,s]=l(this,so)[i];if(o!==e)break;if(o===e&&s===t){l(this,so).splice(i,1);return}}},iC=function(e){let[t,n,i]=e,o=[[t,n,i]],s=Y(this,li,Xv).call(this,i);for(let a=0;a<s;a++){let[u,c]=l(this,so)[a];for(let f=0,h=o.length;f<h;f++){let[,d,g]=o[f];if(!(c<=d||g<=u)){if(d>=u){if(g>c)o[f][1]=c;else{if(h===1)return[];o.splice(f,1),f--,h--}continue}o[f][2]=u,g>c&&o.push([t,c,g])}}}return o};sC=class extends ut{constructor(t,n,i,o){super();W(this,Qy);W(this,Pp);N(this,Pp,t),N(this,Qy,n),this.firstPoint=i,this.lastPoint=o}toSVGPath(){let t=[];for(let n of l(this,Pp)){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,Pp)){let h=new Array(f.length);for(let d=0;d<f.length;d+=2)h[d]=t+f[d]*u,h[d+1]=o-f[d+1]*c;a.push(h)}return a}get box(){return l(this,Qy)}get classNamesForOutlining(){return["highlightOutline"]}};Qy=new WeakMap,Pp=new WeakMap;u0=class extends PE{newFreeDrawOutline(e,t,n,i,o,s){return new oC(e,t,n,i,o,s)}},oC=class extends FE{newOutliner(e,t,n,i,o,s=0){return new u0(e,t,n,i,o,s)}},Vt=class Vt extends br{constructor(t){super({...t,name:"highlightEditor"});W(this,Rt);W(this,Fp,null);W(this,eb,0);W(this,hl);W(this,zf,null);W(this,tb,null);W(this,Ii,null);W(this,rb,null);W(this,nb,0);W(this,Wf,null);W(this,Qi,null);W(this,es,null);W(this,Ln,!1);W(this,Mp,null);W(this,Bp,null);W(this,Yn,null);W(this,Up,"");W(this,Ps);W(this,ib,"");this.color=t.color||Vt._defaultColor,N(this,Ps,t.thickness||Vt._defaultThickness),this.opacity=t.opacity||Vt._defaultOpacity,N(this,hl,t.boxes||null),N(this,ib,t.methodOfCreation||""),N(this,Up,t.text||""),this._isDraggable=!1,this.defaultL10nId="pdfjs-editor-highlight-editor",t.highlightId>-1?(N(this,Ln,!0),Y(this,Rt,Yv).call(this,t),Y(this,Rt,Uc).call(this)):l(this,hl)&&(N(this,Fp,t.anchorNode),N(this,eb,t.anchorOffset),N(this,rb,t.focusNode),N(this,nb,t.focusOffset),Y(this,Rt,aC).call(this),Y(this,Rt,Uc).call(this),this.rotate(this.rotation)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-highlight-added-alert")}static get _keyboardManager(){let t=Vt.prototype;return _t(this,"_keyboardManager",new sh([[["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,Ln)?"free_highlight":"highlight",color:this._uiManager.getNonHCMColorName(this.color),thickness:l(this,Ps),methodOfCreation:l(this,ib)}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.getNonHCMColorName(this.color)}}static computeTelemetryFinalData(t){return{numberOfColors:t.get("color").size}}static initialize(t,n){br.initialize(t,n),Vt._defaultColor||(Vt._defaultColor=n.highlightColors?.values().next().value||"#fff066")}static updateDefaultParams(t,n){switch(t){case Bt.HIGHLIGHT_COLOR:Vt._defaultColor=n;break;case Bt.HIGHLIGHT_THICKNESS:Vt._defaultThickness=n;break}}translateInPage(t,n){}get toolbarPosition(){return l(this,Bp)}get commentButtonPosition(){return l(this,Mp)}updateParams(t,n){switch(t){case Bt.HIGHLIGHT_COLOR:Y(this,Rt,o8).call(this,n);break;case Bt.HIGHLIGHT_THICKNESS:Y(this,Rt,a8).call(this,n);break}}static get defaultPropertiesToUpdate(){return[[Bt.HIGHLIGHT_COLOR,Vt._defaultColor],[Bt.HIGHLIGHT_THICKNESS,Vt._defaultThickness]]}get propertiesToUpdate(){return[[Bt.HIGHLIGHT_COLOR,this.color||Vt._defaultColor],[Bt.HIGHLIGHT_THICKNESS,l(this,Ps)||Vt._defaultThickness],[Bt.HIGHLIGHT_FREE,l(this,Ln)]]}onUpdatedColor(){this.parent?.drawLayer.updateProperties(l(this,es),{root:{fill:this.color,"fill-opacity":this.opacity}}),l(this,tb)?.updateColor(this.color),super.onUpdatedColor()}get toolbarButtons(){return this._uiManager.highlightColors?[["colorPicker",N(this,tb,new i0({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(Y(this,Rt,Kv).call(this))}getBaseTranslation(){return[0,0]}getRect(t,n){return super.getRect(t,n,Y(this,Rt,Kv).call(this))}onceAdded(t){this.annotationElementId||this.parent.addUndoableEditor(this),t&&this.div.focus()}remove(){Y(this,Rt,lC).call(this),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(Y(this,Rt,Uc).call(this),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){let n=!1;this.parent&&!t?Y(this,Rt,lC).call(this):t&&(Y(this,Rt,Uc).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,Ln)?(t=(t-this.rotation+360)%360,i=Y(o=Vt,Us,hd).call(o,l(this,Qi).box,t)):i=Y(s=Vt,Us,hd).call(s,[this.x,this.y,this.width,this.height],t),n.updateProperties(l(this,es),{bbox:i,root:{"data-main-rotation":t}}),n.updateProperties(l(this,Yn),{bbox:Y(a=Vt,Us,hd).call(a,l(this,Ii).box,t),root:{"data-main-rotation":t}})}render(){if(this.div)return this.div;let t=super.render();l(this,Up)&&(t.setAttribute("aria-label",l(this,Up)),t.setAttribute("role","mark")),l(this,Ln)?t.classList.add("free"):this.div.addEventListener("keydown",Y(this,Rt,u8).bind(this),{signal:this._uiManager._signal});let n=N(this,Wf,document.createElement("div"));return t.append(n),n.setAttribute("aria-hidden","true"),n.className="internal",n.style.clipPath=l(this,zf),this.setDims(),L3(this,l(this,Wf),["pointerover","pointerleave"]),this.enableEditing(),t}pointerover(){this.isSelected||this.parent?.drawLayer.updateProperties(l(this,Yn),{rootClass:{hovered:!0}})}pointerleave(){this.isSelected||this.parent?.drawLayer.updateProperties(l(this,Yn),{rootClass:{hovered:!1}})}_moveCaret(t){switch(this.parent.unselect(this),t){case 0:case 2:Y(this,Rt,Zv).call(this,!0);break;case 1:case 3:Y(this,Rt,Zv).call(this,!1);break}}select(){super.select(),l(this,Yn)&&this.parent?.drawLayer.updateProperties(l(this,Yn),{rootClass:{hovered:!1,selected:!0}})}unselect(){super.unselect(),l(this,Yn)&&(this.parent?.drawLayer.updateProperties(l(this,Yn),{rootClass:{selected:!1}}),l(this,Ln)||Y(this,Rt,Zv).call(this,!1))}get _mustFixPosition(){return!l(this,Ln)}show(t=this._isVisible){super.show(t),this.parent&&(this.parent.drawLayer.updateProperties(l(this,es),{rootClass:{hidden:!t}}),this.parent.drawLayer.updateProperties(l(this,Yn),{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,d=t.combinedSignal(h),g=y=>{h.abort(),Y(this,Us,d8).call(this,t,y)};window.addEventListener("blur",g,{signal:d}),window.addEventListener("pointerup",g,{signal:d}),window.addEventListener("pointerdown",Nr,{capture:!0,passive:!1,signal:d}),window.addEventListener("contextmenu",us,{signal:d}),i.addEventListener("pointermove",Y(this,Us,h8).bind(this,t),{signal:d}),this._freeHighlight=new u0({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,b,E;let o=null;if(t instanceof NE){let{data:{quadPoints:_,rect:S,rotation:A,id:M,color:I,opacity:q,popupRef:Q,richText:Z,contentsObj:ne,creationDate:L,modificationDate:$},parent:{page:{pageNumber:X}}}=t;o=t={annotationType:At.HIGHLIGHT,color:Array.from(I),opacity:q,quadPoints:_,boxes:null,pageIndex:X-1,rect:S.slice(0),rotation:A,annotationElementId:M,id:M,deleted:!1,popupRef:Q,richText:Z,comment:ne?.str||null,creationDate:L,modificationDate:$}}else if(t instanceof a0){let{data:{inkLists:_,rect:S,rotation:A,id:M,color:I,borderStyle:{rawWidth:q},popupRef:Q,richText:Z,contentsObj:ne,creationDate:L,modificationDate:$},parent:{page:{pageNumber:X}}}=t;o=t={annotationType:At.HIGHLIGHT,color:Array.from(I),thickness:q,inkLists:_,boxes:null,pageIndex:X-1,rect:S.slice(0),rotation:A,annotationElementId:M,id:M,deleted:!1,popupRef:Q,richText:Z,comment:ne?.str||null,creationDate:L,modificationDate:$}}let{color:s,quadPoints:a,inkLists:u,opacity:c}=t,f=await super.deserialize(t,n,i);f.color=at.makeHexColor(...s),f.opacity=c||1,u&&N(f,Ps,t.thickness),f._initialData=o,t.comment&&f.setCommentData(t);let[h,d]=f.pageDimensions,[g,y]=f.pageTranslation;if(a){let _=N(f,hl,[]);for(let S=0;S<a.length;S+=8)_.push({x:(a[S]-g)/h,y:1-(a[S+1]-y)/d,width:(a[S+2]-a[S])/h,height:(a[S+1]-a[S+5])/d});Y(v=f,Rt,aC).call(v),Y(w=f,Rt,Uc).call(w),f.rotate(f.rotation)}else if(u){N(f,Ln,!0);let _=u[0],S={x:_[0]-g,y:d-(_[1]-y)},A=new u0(S,[0,0,h,d],1,l(f,Ps)/2,!0,.001);for(let q=0,Q=_.length;q<Q;q+=2)S.x=_[q]-g,S.y=d-(_[q+1]-y),A.add(S);let{id:M,clipPathId:I}=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);Y(b=f,Rt,Yv).call(b,{highlightOutlines:A.getOutlines(),highlightId:M,clipPathId:I}),Y(E=f,Rt,Uc).call(E),f.rotate(f.parentRotation)}return f}serialize(t=!1){if(this.isEmpty()||t)return null;if(this.deleted)return this.serializeDeleted();let n=br._colorManager.convert(this._uiManager.getNonHCMColor(this.color)),i=super.serialize(t);return Object.assign(i,{color:n,opacity:this.opacity,thickness:l(this,Ps),quadPoints:Y(this,Rt,c8).call(this),outlines:Y(this,Rt,f8).call(this,i.rect)}),this.addComment(i),this.annotationElementId&&!Y(this,Rt,p8).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}};Fp=new WeakMap,eb=new WeakMap,hl=new WeakMap,zf=new WeakMap,tb=new WeakMap,Ii=new WeakMap,rb=new WeakMap,nb=new WeakMap,Wf=new WeakMap,Qi=new WeakMap,es=new WeakMap,Ln=new WeakMap,Mp=new WeakMap,Bp=new WeakMap,Yn=new WeakMap,Up=new WeakMap,Ps=new WeakMap,ib=new WeakMap,Rt=new WeakSet,aC=function(){let t=new l0(l(this,hl),.001);N(this,Qi,t.getOutlines()),[this.x,this.y,this.width,this.height]=l(this,Qi).box;let n=new l0(l(this,hl),.0025,.001,this._uiManager.direction==="ltr");N(this,Ii,n.getOutlines());let{firstPoint:i}=l(this,Qi);N(this,Mp,[(i[0]-this.x)/this.width,(i[1]-this.y)/this.height]);let{lastPoint:o}=l(this,Ii);N(this,Bp,[(o[0]-this.x)/this.width,(o[1]-this.y)/this.height])},Yv=function({highlightOutlines:t,highlightId:n,clipPathId:i}){var d,g;if(N(this,Qi,t),N(this,Ii,t.getNewOutline(l(this,Ps)/2+1.5,.0025)),n>=0)N(this,es,n),N(this,zf,i),this.parent.drawLayer.finalizeDraw(n,{bbox:t.box,path:{d:t.toSVGPath()}}),N(this,Yn,this.parent.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:!0},bbox:l(this,Ii).box,path:{d:l(this,Ii).toSVGPath()}},!0));else if(this.parent){let y=this.parent.viewport.rotation;this.parent.drawLayer.updateProperties(l(this,es),{bbox:Y(d=Vt,Us,hd).call(d,l(this,Qi).box,(y-this.rotation+360)%360),path:{d:t.toSVGPath()}}),this.parent.drawLayer.updateProperties(l(this,Yn),{bbox:Y(g=Vt,Us,hd).call(g,l(this,Ii).box,y),path:{d:l(this,Ii).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[y,v]=this.parentDimensions;this.x=a,this.y=1-s,this.width=u*v/y,this.height=c*y/v;break}case 180:this.x=1-s,this.y=1-a,this.width=u,this.height=c;break;case 270:{let[y,v]=this.parentDimensions;this.x=1-a,this.y=s,this.width=u*v/y,this.height=c*y/v;break}}let{firstPoint:f}=t;N(this,Mp,[(f[0]-s)/u,(f[1]-a)/c]);let{lastPoint:h}=l(this,Ii);N(this,Bp,[(h[0]-s)/u,(h[1]-a)/c])},o8=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,Vt._defaultOpacity),undo:n.bind(this,i,o),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:Bt.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.getNonHCMColorName(t)},!0)},a8=function(t){let n=l(this,Ps),i=o=>{N(this,Ps,o),Y(this,Rt,l8).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:Bt.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:t},!0)},l8=function(t){l(this,Ln)&&(Y(this,Rt,Yv).call(this,{highlightOutlines:l(this,Qi).getNewOutline(t/2)}),this.fixAndSetPosition(),this.setDims())},lC=function(){l(this,es)===null||!this.parent||(this.parent.drawLayer.remove(l(this,es)),N(this,es,null),this.parent.drawLayer.remove(l(this,Yn)),N(this,Yn,null))},Uc=function(t=this.parent){l(this,es)===null&&({id:ln(this,es)._,clipPathId:ln(this,zf)._}=t.drawLayer.draw({bbox:l(this,Qi).box,root:{viewBox:"0 0 1 1",fill:this.color,"fill-opacity":this.opacity},rootClass:{highlight:!0,free:l(this,Ln)},path:{d:l(this,Qi).toSVGPath()}},!1,!0),N(this,Yn,t.drawLayer.drawOutline({rootClass:{highlightOutline:!0,free:l(this,Ln)},bbox:l(this,Ii).box,path:{d:l(this,Ii).toSVGPath()}},l(this,Ln))),l(this,Wf)&&(l(this,Wf).style.clipPath=l(this,zf)))},Us=new WeakSet,hd=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]},u8=function(t){Vt._keyboardManager.exec(this,t)},Zv=function(t){if(!l(this,Fp))return;let n=window.getSelection();t?n.setPosition(l(this,Fp),l(this,eb)):n.setPosition(l(this,rb),l(this,nb))},Kv=function(){return l(this,Ln)?this.rotation:0},c8=function(){if(l(this,Ln))return null;let[t,n]=this.pageDimensions,[i,o]=this.pageTranslation,s=l(this,hl),a=new Float32Array(s.length*8),u=0;for(let{x:c,y:f,width:h,height:d}of s){let g=c*t+i,y=(1-f)*n+o;a[u]=a[u+4]=g,a[u+1]=a[u+3]=y,a[u+2]=a[u+6]=g+h*t,a[u+5]=a[u+7]=y-d*n,u+=8}return a},f8=function(t){return l(this,Qi).serialize(t,Y(this,Rt,Kv).call(this))},h8=function(t,n){this._freeHighlight.add(n)&&t.drawLayer.updateProperties(this._freeHighlightId,{path:{d:this._freeHighlight.toSVGPath()}})},d8=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=""},p8=function(t){let{color:n}=this._initialData;return this.hasEditedComment||t.color.some((i,o)=>i!==n[o])},W(Vt,Us),He(Vt,"_defaultColor",null),He(Vt,"_defaultOpacity",1),He(Vt,"_defaultThickness",12),He(Vt,"_type","highlight"),He(Vt,"_editorType",At.HIGHLIGHT),He(Vt,"_freeHighlightId",-1),He(Vt,"_freeHighlight",null),He(Vt,"_freeHighlightClipId","");ME=Vt,BE=class{constructor(){W(this,Hf,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,Hf)[e]=t}toSVGProperties(){let e=l(this,Hf);return N(this,Hf,Object.create(null)),{root:e}}reset(){N(this,Hf,Object.create(null))}updateAll(e=this){this.updateProperties(e)}clone(){Xt("Not implemented")}};Hf=new WeakMap;Mt=class Mt extends br{constructor(t){super(t);W(this,$t);W(this,ts,null);W(this,jp);He(this,"_colorPicker",null);He(this,"_drawId",null);N(this,jp,t.mustBeCommitted||!1),this._addOutlines(t)}onUpdatedColor(){this._colorPicker?.update(this.color),super.onUpdatedColor()}_addOutlines(t){t.drawOutlines&&(Y(this,$t,uC).call(this,t),Y(this,$t,jm).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){Xt("Not implemented")}static get typesMap(){Xt("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(Mt,An).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,ts).updateProperty(n,u);c&&Y(this,$t,$m).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,Mt._mergeSVGProperties(l(this,ts).getPathResizingSVGProperties(Y(this,$t,Jv).call(this)),{bbox:Y(this,$t,dd).call(this)}))}_onResized(){this.parent?.drawLayer.updateProperties(this._drawId,Mt._mergeSVGProperties(l(this,ts).getPathResizedSVGProperties(Y(this,$t,Jv).call(this)),{bbox:Y(this,$t,dd).call(this)}))}_onTranslating(t,n){this.parent?.drawLayer.updateProperties(this._drawId,{bbox:Y(this,$t,dd).call(this)})}_onTranslated(){this.parent?.drawLayer.updateProperties(this._drawId,Mt._mergeSVGProperties(l(this,ts).getPathTranslatedSVGProperties(Y(this,$t,Jv).call(this),this.parentDimensions),{bbox:Y(this,$t,dd).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,jp)&&(N(this,jp,!1),this.commit(),this.parent.setSelected(this),t&&this.isOnScreen&&this.div.focus())}remove(){Y(this,$t,fC).call(this),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(Y(this,$t,jm).call(this),Y(this,$t,$m).call(this,l(this,ts).box),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){let n=!1;this.parent&&!t?(this._uiManager.removeShouldRescale(this),Y(this,$t,fC).call(this)):t&&(this._uiManager.addShouldRescale(this),Y(this,$t,jm).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,Mt._mergeSVGProperties({bbox:Y(this,$t,dd).call(this)},l(this,ts).updateRotation((this.parentRotation-this.rotation+360)%360)))}onScaleChanging(){this.parent&&Y(this,$t,$m).call(this,l(this,ts).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){Xt("Not implemented")}static startDrawing(t,n,i,o){let{target:s,offsetX:a,offsetY:u,pointerId:c,pointerType:f}=o;if(Hn.isInitializedAndDifferentPointerType(f))return;let{viewport:{rotation:h}}=t,{width:d,height:g}=s.getBoundingClientRect(),y=N(Mt,qf,new AbortController),v=t.combinedSignal(y);if(Hn.setPointer(f,c),window.addEventListener("pointerup",w=>{Hn.isSamePointerIdOrRemove(w.pointerId)&&this._endDraw(w)},{signal:v}),window.addEventListener("pointercancel",w=>{Hn.isSamePointerIdOrRemove(w.pointerId)&&this._currentParent.endDrawingSession()},{signal:v}),window.addEventListener("pointerdown",w=>{Hn.isSamePointerType(w.pointerType)&&(Hn.initializeAndAddPointerId(w.pointerId),l(Mt,An).isCancellable()&&(l(Mt,An).removeLastElement(),l(Mt,An).isEmpty()?this._currentParent.endDrawingSession(!0):this._endDraw(null)))},{capture:!0,passive:!1,signal:v}),window.addEventListener("contextmenu",us,{signal:v}),s.addEventListener("pointermove",this._drawMove.bind(this),{signal:v}),s.addEventListener("touchmove",w=>{Hn.isSameTimeStamp(w.timeStamp)&&Nr(w)},{signal:v}),t.toggleDrawing(),n._editorUndoBar?.hide(),l(Mt,An)){t.drawLayer.updateProperties(this._currentDrawId,l(Mt,An).startNew(a,u,d,g,h));return}n.updateUIForDefaultProperties(this),N(Mt,An,this.createDrawerInstance(a,u,d,g,h)),N(Mt,Gf,this.getDefaultDrawingOptions()),this._currentParent=t,{id:this._currentDrawId}=t.drawLayer.draw(this._mergeSVGProperties(l(Mt,Gf).toSVGProperties(),l(Mt,An).defaultSVGProperties),!0,!1)}static _drawMove(t){if(Hn.isSameTimeStamp(t.timeStamp),!l(Mt,An))return;let{offsetX:n,offsetY:i,pointerId:o}=t;if(Hn.isSamePointerId(o)){if(Hn.isUsingMultiplePointers()){this._endDraw(t);return}this._currentParent.drawLayer.updateProperties(this._currentDrawId,l(Mt,An).add(n,i)),Hn.setTimeStamp(t.timeStamp),Nr(t)}}static _cleanup(t){t&&(this._currentDrawId=-1,this._currentParent=null,N(Mt,An,null),N(Mt,Gf,null),Hn.clearTimeStamp()),l(Mt,qf)&&(l(Mt,qf).abort(),N(Mt,qf,null),Hn.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(Mt,An).end(t.offsetX,t.offsetY)),this.supportMultipleDrawings){let i=l(Mt,An),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:Bt.DRAW_STEP});return}this.endDrawing(!1)}}static endDrawing(t){let n=this._currentParent;if(!n)return null;if(n.toggleDrawing(!0),n.cleanUndoStack(Bt.DRAW_STEP),!l(Mt,An).isEmpty()){let{pageDimensions:[i,o],scale:s}=n,a=n.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,drawOutlines:l(Mt,An).getOutlines(i*s,o*s,s,this._INNER_MARGIN),drawingOptions:l(Mt,Gf),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){Xt("Not implemented")}static async deserialize(t,n,i){var h,d;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),Y(h=f,$t,uC).call(h,{drawOutlines:c}),Y(d=f,$t,jm).call(d),f.onScaleChanging(),f.rotate(),f}serializeDraw(t){let[n,i]=this.pageTranslation,[o,s]=this.pageDimensions;return l(this,ts).serialize([n,i,o,s],t)}renderAnnotationElement(t){return t.updateEdited({rect:this.getPDFRect()}),null}static canCreateNewEmptyEditor(){return!1}};ts=new WeakMap,jp=new WeakMap,An=new WeakMap,qf=new WeakMap,Gf=new WeakMap,$t=new WeakSet,uC=function({drawOutlines:t,drawId:n,drawingOptions:i}){N(this,ts,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=Y(this,$t,cC).call(this,t,this.parent),Y(this,$t,$m).call(this,t.box)},cC=function(t,n){let{id:i}=n.drawLayer.draw(Mt._mergeSVGProperties(this._drawingOptions.toSVGProperties(),t.defaultSVGProperties),!1,!1);return i},fC=function(){this._drawId===null||!this.parent||(this.parent.drawLayer.remove(this._drawId),this._drawId=null,this._drawingOptions.reset())},jm=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=Y(this,$t,cC).call(this,l(this,ts),t)}},g8=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]}},Jv=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]}},$m=function(t){[this.x,this.y,this.width,this.height]=Y(this,$t,g8).call(this,t),this.div&&(this.fixAndSetPosition(),this.setDims()),this._onResized()},dd=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]}},He(Mt,"_currentDrawId",-1),He(Mt,"_currentParent",null),W(Mt,An,null),W(Mt,qf,null),W(Mt,Gf,null),He(Mt,"_INNER_MARGIN",3);UE=Mt,hC=class{constructor(e,t,n,i,o,s){W(this,zp);W(this,Qo,new Float64Array(6));W(this,xn);W(this,Sn);W(this,Vf);W(this,$p);W(this,ni);W(this,Pn,"");W(this,Fs,0);W(this,Xf,new lh);W(this,Yf);W(this,Zf);N(this,Yf,n),N(this,Zf,i),N(this,Vf,o),N(this,$p,s),[e,t]=Y(this,zp,Qv).call(this,e,t);let a=N(this,xn,[NaN,NaN,NaN,NaN,e,t]);N(this,ni,[e,t]),N(this,Sn,[{line:a,points:l(this,ni)}]),l(this,Qo).set(a,0)}updateProperty(e,t){e==="stroke-width"&&N(this,$p,t)}isEmpty(){return!l(this,Sn)||l(this,Sn).length===0}isCancellable(){return l(this,ni).length<=10}add(e,t){[e,t]=Y(this,zp,Qv).call(this,e,t);let[n,i,o,s]=l(this,Qo).subarray(2,6),a=e-o,u=t-s;return Math.hypot(l(this,Yf)*a,l(this,Zf)*u)<=2?null:(l(this,ni).push(e,t),isNaN(n)?(l(this,Qo).set([o,s,e,t],2),l(this,xn).push(NaN,NaN,NaN,NaN,e,t),{path:{d:this.toSVGPath()}}):(isNaN(l(this,Qo)[0])&&l(this,xn).splice(6,6),l(this,Qo).set([n,i,o,s,e,t],0),l(this,xn).push(...ut.createBezierPoints(n,i,o,s,e,t)),{path:{d:this.toSVGPath()}}))}end(e,t){let n=this.add(e,t);return n||(l(this,ni).length===2?{path:{d:this.toSVGPath()}}:null)}startNew(e,t,n,i,o){N(this,Yf,n),N(this,Zf,i),N(this,Vf,o),[e,t]=Y(this,zp,Qv).call(this,e,t);let s=N(this,xn,[NaN,NaN,NaN,NaN,e,t]);N(this,ni,[e,t]);let a=l(this,Sn).at(-1);return a&&(a.line=new Float32Array(a.line),a.points=new Float32Array(a.points)),l(this,Sn).push({line:s,points:l(this,ni)}),l(this,Qo).set(s,0),N(this,Fs,0),this.toSVGPath(),null}getLastElement(){return l(this,Sn).at(-1)}setLastElement(e){return l(this,Sn)?(l(this,Sn).push(e),N(this,xn,e.line),N(this,ni,e.points),N(this,Fs,0),{path:{d:this.toSVGPath()}}):l(this,Xf).setLastElement(e)}removeLastElement(){if(!l(this,Sn))return l(this,Xf).removeLastElement();l(this,Sn).pop(),N(this,Pn,"");for(let e=0,t=l(this,Sn).length;e<t;e++){let{line:n,points:i}=l(this,Sn)[e];N(this,xn,n),N(this,ni,i),N(this,Fs,0),this.toSVGPath()}return{path:{d:l(this,Pn)}}}toSVGPath(){let e=ut.svgRound(l(this,xn)[4]),t=ut.svgRound(l(this,xn)[5]);if(l(this,ni).length===2)return N(this,Pn,`${l(this,Pn)} M ${e} ${t} Z`),l(this,Pn);if(l(this,ni).length<=6){let i=l(this,Pn).lastIndexOf("M");N(this,Pn,`${l(this,Pn).slice(0,i)} M ${e} ${t}`),N(this,Fs,6)}if(l(this,ni).length===4){let i=ut.svgRound(l(this,xn)[10]),o=ut.svgRound(l(this,xn)[11]);return N(this,Pn,`${l(this,Pn)} L ${i} ${o}`),N(this,Fs,12),l(this,Pn)}let n=[];l(this,Fs)===0&&(n.push(`M ${e} ${t}`),N(this,Fs,6));for(let i=l(this,Fs),o=l(this,xn).length;i<o;i+=6){let[s,a,u,c,f,h]=l(this,xn).slice(i,i+6).map(ut.svgRound);n.push(`C${s} ${a} ${u} ${c} ${f} ${h}`)}return N(this,Pn,l(this,Pn)+n.join(" ")),N(this,Fs,l(this,xn).length),l(this,Pn)}getOutlines(e,t,n,i){let o=l(this,Sn).at(-1);return o.line=new Float32Array(o.line),o.points=new Float32Array(o.points),l(this,Xf).build(l(this,Sn),e,t,n,l(this,Vf),l(this,$p),i),N(this,Qo,null),N(this,xn,null),N(this,Sn,null),N(this,Pn,null),l(this,Xf)}get defaultSVGProperties(){return{root:{viewBox:"0 0 10000 10000"},rootClass:{draw:!0},bbox:[0,0,1,1]}}};Qo=new WeakMap,xn=new WeakMap,Sn=new WeakMap,Vf=new WeakMap,$p=new WeakMap,ni=new WeakMap,Pn=new WeakMap,Fs=new WeakMap,Xf=new WeakMap,Yf=new WeakMap,Zf=new WeakMap,zp=new WeakSet,Qv=function(e,t){return ut._normalizePoint(e,t,l(this,Yf),l(this,Zf),l(this,Vf))};lh=class extends ut{constructor(){super(...arguments);W(this,Mn);W(this,ii);W(this,sb,0);W(this,ob);W(this,rs);W(this,ea);W(this,ta);W(this,Wp);W(this,Hp);W(this,Kf)}build(t,n,i,o,s,a,u){N(this,ea,n),N(this,ta,i),N(this,Wp,o),N(this,Hp,s),N(this,Kf,a),N(this,ob,u??0),N(this,rs,t),Y(this,Mn,y8).call(this)}get thickness(){return l(this,Kf)}setLastElement(t){return l(this,rs).push(t),{path:{d:this.toSVGPath()}}}removeLastElement(){return l(this,rs).pop(),{path:{d:this.toSVGPath()}}}toSVGPath(){let t=[];for(let{line:n}of l(this,rs)){if(t.push(`M${ut.svgRound(n[4])} ${ut.svgRound(n[5])}`),n.length===6){t.push("Z");continue}if(n.length===12&&isNaN(n[6])){t.push(`L${ut.svgRound(n[10])} ${ut.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(ut.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,d]=Y(this,Mn,m8).call(this),g,y,v,w,b,E,_,S,A;switch(l(this,Hp)){case 0:A=ut._rescale,g=t,y=n+o,v=i,w=-o,b=t+c*i,E=n+(1-f-d)*o,_=t+(c+h)*i,S=n+(1-f)*o;break;case 90:A=ut._rescaleAndSwap,g=t,y=n,v=i,w=o,b=t+f*i,E=n+c*o,_=t+(f+d)*i,S=n+(c+h)*o;break;case 180:A=ut._rescale,g=t+i,y=n,v=-i,w=o,b=t+(1-c-h)*i,E=n+f*o,_=t+(1-c)*i,S=n+(f+d)*o;break;case 270:A=ut._rescaleAndSwap,g=t+i,y=n+o,v=-i,w=-o,b=t+(1-f-d)*i,E=n+(1-c-h)*o,_=t+(1-f)*i,S=n+(1-c)*o;break}for(let{line:M,points:I}of l(this,rs))a.push(A(M,g,y,v,w,s?new Array(M.length):null)),u.push(A(I,g,y,v,w,s?new Array(I.length):null));return{lines:a,points:u,rect:[b,E,_,S]}}static deserialize(t,n,i,o,s,{paths:{lines:a,points:u},rotation:c,thickness:f}){let h=[],d,g,y,v,w;switch(c){case 0:w=ut._rescale,d=-t/i,g=n/o+1,y=1/i,v=-1/o;break;case 90:w=ut._rescaleAndSwap,d=-n/o,g=-t/i,y=1/o,v=1/i;break;case 180:w=ut._rescale,d=t/i+1,g=-n/o,y=-1/i,v=1/o;break;case 270:w=ut._rescaleAndSwap,d=n/o+1,g=t/i+1,y=-1/o,v=-1/i;break}if(!a){a=[];for(let E of u){let _=E.length;if(_===2){a.push(new Float32Array([NaN,NaN,NaN,NaN,E[0],E[1]]));continue}if(_===4){a.push(new Float32Array([NaN,NaN,NaN,NaN,E[0],E[1],NaN,NaN,NaN,NaN,E[2],E[3]]));continue}let S=new Float32Array(3*(_-2));a.push(S);let[A,M,I,q]=E.subarray(0,4);S.set([NaN,NaN,NaN,NaN,A,M],0);for(let Q=4;Q<_;Q+=2){let Z=E[Q],ne=E[Q+1];S.set(ut.createBezierPoints(A,M,I,q,Z,ne),(Q-2)*3),[A,M,I,q]=[I,q,Z,ne]}}}for(let E=0,_=a.length;E<_;E++)h.push({line:w(a[E].map(S=>S??NaN),d,g,y,v),points:w(u[E].map(S=>S??NaN),d,g,y,v)});let b=new this.prototype.constructor;return b.build(h,i,o,1,c,f,s),b}get box(){return l(this,ii)}updateProperty(t,n){return t==="stroke-width"?Y(this,Mn,b8).call(this,n):null}updateParentDimensions([t,n],i){let[o,s]=Y(this,Mn,Pa).call(this);N(this,ea,t),N(this,ta,n),N(this,Wp,i);let[a,u]=Y(this,Mn,Pa).call(this),c=a-o,f=u-s,h=l(this,ii);return h[0]-=c,h[1]-=f,h[2]+=2*c,h[3]+=2*f,h}updateRotation(t){return N(this,sb,t),{path:{transform:this.rotationTransform}}}get viewBox(){return l(this,ii).map(ut.svgRound).join(" ")}get defaultProperties(){let[t,n]=l(this,ii);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${ut.svgRound(t)} ${ut.svgRound(n)}`}}}get rotationTransform(){let[,,t,n]=l(this,ii),i=0,o=0,s=0,a=0,u=0,c=0;switch(l(this,sb)){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} ${ut.svgRound(u)} ${ut.svgRound(c)})`}getPathResizingSVGProperties([t,n,i,o]){let[s,a]=Y(this,Mn,Pa).call(this),[u,c,f,h]=l(this,ii);if(Math.abs(f-s)<=ut.PRECISION||Math.abs(h-a)<=ut.PRECISION){let w=t+i/2-(u+f/2),b=n+o/2-(c+h/2);return{path:{"transform-origin":`${ut.svgRound(t)} ${ut.svgRound(n)}`,transform:`${this.rotationTransform} translate(${w} ${b})`}}}let d=(i-2*s)/(f-2*s),g=(o-2*a)/(h-2*a),y=f/i,v=h/o;return{path:{"transform-origin":`${ut.svgRound(u)} ${ut.svgRound(c)}`,transform:`${this.rotationTransform} scale(${y} ${v}) translate(${ut.svgRound(s)} ${ut.svgRound(a)}) scale(${d} ${g}) translate(${ut.svgRound(-s)} ${ut.svgRound(-a)})`}}}getPathResizedSVGProperties([t,n,i,o]){let[s,a]=Y(this,Mn,Pa).call(this),u=l(this,ii),[c,f,h,d]=u;if(u[0]=t,u[1]=n,u[2]=i,u[3]=o,Math.abs(h-s)<=ut.PRECISION||Math.abs(d-a)<=ut.PRECISION){let b=t+i/2-(c+h/2),E=n+o/2-(f+d/2);for(let{line:_,points:S}of l(this,rs))ut._translate(_,b,E,_),ut._translate(S,b,E,S);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${ut.svgRound(t)} ${ut.svgRound(n)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}let g=(i-2*s)/(h-2*s),y=(o-2*a)/(d-2*a),v=-g*(c+s)+t+s,w=-y*(f+a)+n+a;if(g!==1||y!==1||v!==0||w!==0)for(let{line:b,points:E}of l(this,rs))ut._rescale(b,v,w,g,y,b),ut._rescale(E,v,w,g,y,E);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${ut.svgRound(t)} ${ut.svgRound(n)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}getPathTranslatedSVGProperties([t,n],i){let[o,s]=i,a=l(this,ii),u=t-a[0],c=n-a[1];if(l(this,ea)===o&&l(this,ta)===s)for(let{line:f,points:h}of l(this,rs))ut._translate(f,u,c,f),ut._translate(h,u,c,h);else{let f=l(this,ea)/o,h=l(this,ta)/s;N(this,ea,o),N(this,ta,s);for(let{line:d,points:g}of l(this,rs))ut._rescale(d,u,c,f,h,d),ut._rescale(g,u,c,f,h,g);a[2]*=f,a[3]*=h}return a[0]=t,a[1]=n,{root:{viewBox:this.viewBox},path:{d:this.toSVGPath(),"transform-origin":`${ut.svgRound(t)} ${ut.svgRound(n)}`}}}get defaultSVGProperties(){let t=l(this,ii);return{root:{viewBox:this.viewBox},rootClass:{draw:!0},path:{d:this.toSVGPath(),"transform-origin":`${ut.svgRound(t[0])} ${ut.svgRound(t[1])}`,transform:this.rotationTransform||null},bbox:t}}};ii=new WeakMap,sb=new WeakMap,ob=new WeakMap,rs=new WeakMap,ea=new WeakMap,ta=new WeakMap,Wp=new WeakMap,Hp=new WeakMap,Kf=new WeakMap,Mn=new WeakSet,Pa=function(t=l(this,Kf)){let n=l(this,ob)+t/2*l(this,Wp);return l(this,Hp)%180===0?[n/l(this,ea),n/l(this,ta)]:[n/l(this,ta),n/l(this,ea)]},m8=function(){let[t,n,i,o]=l(this,ii),[s,a]=Y(this,Mn,Pa).call(this,0);return[t+s,n+a,i-2*s,o-2*a]},y8=function(){let t=N(this,ii,new Float32Array([1/0,1/0,-1/0,-1/0]));for(let{line:o}of l(this,rs)){if(o.length<=12){for(let u=4,c=o.length;u<c;u+=6)at.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,d,g,y,v]=o.subarray(u,u+6);at.bezierBoundingBox(s,a,f,h,d,g,y,v,t),s=y,a=v}}let[n,i]=Y(this,Mn,Pa).call(this);t[0]=gn(t[0]-n,0,1),t[1]=gn(t[1]-i,0,1),t[2]=gn(t[2]+n,0,1),t[3]=gn(t[3]+i,0,1),t[2]-=t[0],t[3]-=t[1]},b8=function(t){let[n,i]=Y(this,Mn,Pa).call(this);N(this,Kf,t);let[o,s]=Y(this,Mn,Pa).call(this),[a,u]=[o-n,s-i],c=l(this,ii);return c[0]-=a,c[1]-=u,c[2]+=2*a,c[3]+=2*u,c};jE=class r extends BE{constructor(e){super(),this._viewParameters=e,super.updateProperties({fill:"none",stroke:br._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}},vd=class vd extends UE{constructor(t){super({...t,name:"inkEditor"});W(this,o1);this._willKeepAspectRatio=!0,this.defaultL10nId="pdfjs-editor-ink-editor"}static initialize(t,n){br.initialize(t,n),this._defaultDrawingOptions=new jE(n.viewParameters)}static getDefaultDrawingOptions(t){let n=this._defaultDrawingOptions.clone();return n.updateProperties(t),n}static get supportMultipleDrawings(){return!0}static get typesMap(){return _t(this,"typesMap",new Map([[Bt.INK_THICKNESS,"stroke-width"],[Bt.INK_COLOR,"stroke"],[Bt.INK_OPACITY,"stroke-opacity"]]))}static createDrawerInstance(t,n,i,o,s){return new hC(t,n,i,o,s,this._defaultDrawingOptions["stroke-width"])}static deserializeDraw(t,n,i,o,s,a){return lh.deserialize(t,n,i,o,s,a)}static async deserialize(t,n,i){let o=null;if(t instanceof a0){let{data:{inkLists:a,rect:u,rotation:c,id:f,color:h,opacity:d,borderStyle:{rawWidth:g},popupRef:y,richText:v,contentsObj:w,creationDate:b,modificationDate:E},parent:{page:{pageNumber:_}}}=t;o=t={annotationType:At.INK,color:Array.from(h),thickness:g,opacity:d,paths:{points:a},boxes:null,pageIndex:_-1,rect:u.slice(0),rotation:c,annotationElementId:f,id:f,deleted:!1,popupRef:y,richText:v,comment:w?.str||null,creationDate:b,modificationDate:E}}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 CE(this)),[["colorPicker",this._colorPicker]]}get colorType(){return Bt.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=vd.getDefaultDrawingOptions({stroke:at.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:br._colorManager.convert(o),opacity:s,thickness:a,paths:{lines:n,points:i}});return this.addComment(u),t?(u.isCopy=!0,u):this.annotationElementId&&!Y(this,o1,w8).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}};o1=new WeakSet,w8=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},He(vd,"_type","ink"),He(vd,"_editorType",At.INK),He(vd,"_defaultDrawingOptions",null);dC=vd,c0=class extends lh{toSVGPath(){let e=super.toSVGPath();return e.endsWith("Z")||(e+="Z"),e}},Ev=8,Em=3,Bs=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,d=f.font=`${n} ${i} ${h}px ${t}`,{actualBoundingBoxLeft:g,actualBoundingBoxRight:y,actualBoundingBoxAscent:v,actualBoundingBoxDescent:w,fontBoundingBoxAscent:b,fontBoundingBoxDescent:E,width:_}=f.measureText(e),S=1.5,A=Math.ceil(Math.max(Math.abs(g)+Math.abs(y)||0,_)*S),M=Math.ceil(Math.max(Math.abs(v)+Math.abs(w)||h,Math.abs(b)+Math.abs(E)||h)*S);c=new OffscreenCanvas(A,M),f=c.getContext("2d",{alpha:!0,willReadFrequently:!0}),f.font=d,f.filter="grayscale(1)",f.fillStyle="white",f.fillRect(0,0,A,M),f.fillStyle="black",f.fillText(e,A*(S-1)/2,M*(3-S)/2);let I=Y(this,Kt,mC).call(this,f.getImageData(0,0,A,M).data),q=Y(this,Kt,x8).call(this,I),Q=Y(this,Kt,yC).call(this,q),Z=Y(this,Kt,gC).call(this,I,A,M,Q);return this.processDrawnLines({lines:{curves:Z,width:A,height:M},pageWidth:o,pageHeight:s,rotation:a,innerMargin:u,mustSmooth:!0,areContours:!0})}static process(e,t,n,i,o){let[s,a,u]=Y(this,Kt,S8).call(this,e),[c,f]=Y(this,Kt,A8).call(this,s,a,u,Math.hypot(a,u)*l(this,Jf).sigmaSFactor,l(this,Jf).sigmaR,l(this,Jf).kernelSize),h=Y(this,Kt,yC).call(this,f),d=Y(this,Kt,gC).call(this,c,a,u,h);return this.processDrawnLines({lines:{curves:d,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,d=[],g=Math.min(t/c,n/f),y=g/t,v=g/n,w=[];for(let{points:E}of u){let _=s?Y(this,Kt,_8).call(this,E):E;if(!_)continue;w.push(_);let S=_.length,A=new Float32Array(S),M=new Float32Array(3*(S===2?2:S-2));if(d.push({line:M,points:A}),S===2){A[0]=_[0]*y,A[1]=_[1]*v,M.set([NaN,NaN,NaN,NaN,A[0],A[1]],0);continue}let[I,q,Q,Z]=_;I*=y,q*=v,Q*=y,Z*=v,A.set([I,q,Q,Z],0),M.set([NaN,NaN,NaN,NaN,I,q],0);for(let ne=4;ne<S;ne+=2){let L=A[ne]=_[ne]*y,$=A[ne+1]=_[ne+1]*v;M.set(ut.createBezierPoints(I,q,Q,Z,L,$),(ne-2)*3),[I,q,Q,Z]=[Q,Z,L,$]}}if(d.length===0)return null;let b=a?new c0:new lh;return b.build(d,t,n,1,i,a?0:h,o),{outline:b,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 _ of e){u+=_.length;for(let S=2,A=_.length;S<A;S++){let M=_[S]-_[S-2];s=Math.min(s,M),a=Math.max(a,M)}}let c;s>=-128&&a<=127?c=Int8Array:s>=-32768&&a<=32767?c=Int16Array:c=Int32Array;let f=e.length,h=Ev+Em*f,d=new Uint32Array(h),g=0;d[g++]=h*Uint32Array.BYTES_PER_ELEMENT+(u-2*f)*c.BYTES_PER_ELEMENT,d[g++]=0,d[g++]=i,d[g++]=o,d[g++]=t?0:1,d[g++]=Math.max(0,Math.floor(n??0)),d[g++]=f,d[g++]=c.BYTES_PER_ELEMENT;for(let _ of e)d[g++]=_.length-2,d[g++]=_[0],d[g++]=_[1];let y=new CompressionStream("deflate-raw"),v=y.writable.getWriter();await v.ready,v.write(d);let w=c.prototype.constructor;for(let _ of e){let S=new w(_.length-2);for(let A=2,M=_.length;A<M;A++)S[A-2]=_[A]-_[A-2];v.write(S)}v.close();let b=await new Response(y.readable).arrayBuffer();return new Uint8Array(b).toBase64()}static async decompressSignature(e){try{let t=Uint8Array.fromBase64(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 _ of n)s||(s=new Uint8Array(new Uint32Array(_.buffer,0,4)[0])),s.set(_,a),a+=_.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],d=u[4]===0,g=u[5],y=u[6],v=u[7],w=[],b=(Ev+Em*y)*Uint32Array.BYTES_PER_ELEMENT,E;switch(v){case Int8Array.BYTES_PER_ELEMENT:E=new Int8Array(s.buffer,b);break;case Int16Array.BYTES_PER_ELEMENT:E=new Int16Array(s.buffer,b);break;case Int32Array.BYTES_PER_ELEMENT:E=new Int32Array(s.buffer,b);break}a=0;for(let _=0;_<y;_++){let S=u[Em*_+Ev],A=new Float32Array(S+2);w.push(A);for(let M=0;M<Em-1;M++)A[M]=u[Em*_+Ev+M+1];for(let M=0;M<S;M++)A[M+2]=A[M]+E[a++]}return{areContours:d,thickness:g,outlines:w,width:f,height:h}}catch(t){return Tt(`decompressSignature: ${t}`),null}}};Jf=new WeakMap,Kt=new WeakSet,pC=function(e,t,n,i){return n-=e,i-=t,n===0?i>0?0:4:n===1?i+6:2-i},oo=new WeakMap,v8=function(e,t,n,i,o,s,a){let u=Y(this,Kt,pC).call(this,n,i,o,s);for(let c=0;c<8;c++){let f=(-c+u-a+16)%8,h=l(this,oo)[2*f],d=l(this,oo)[2*f+1];if(e[(n+h)*t+(i+d)]!==0)return f}return-1},E8=function(e,t,n,i,o,s,a){let u=Y(this,Kt,pC).call(this,n,i,o,s);for(let c=0;c<8;c++){let f=(c+u+a+16)%8,h=l(this,oo)[2*f],d=l(this,oo)[2*f+1];if(e[(n+h)*t+(i+d)]!==0)return f}return-1},gC=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 d=f*t+h,g=s[d];if(g===0)continue;let y=f,v=h;if(g===1&&s[d-1]===0)a+=1,v-=1;else if(g>=1&&s[d+1]===0)a+=1,v+=1,g>1&&(u=g);else{g!==1&&(u=Math.abs(g));continue}let w=[h,f],b=v===h+1,E={isHole:b,points:w,id:a,parent:0};c.push(E);let _;for(let ne of c)if(ne.id===u){_=ne;break}_?_.isHole?E.parent=b?_.parent:u:E.parent=b?u:_.parent:E.parent=b?u:0;let S=Y(this,Kt,v8).call(this,s,t,f,h,y,v,0);if(S===-1){s[d]=-a,s[d]!==1&&(u=Math.abs(s[d]));continue}let A=l(this,oo)[2*S],M=l(this,oo)[2*S+1],I=f+A,q=h+M;y=I,v=q;let Q=f,Z=h;for(;;){let ne=Y(this,Kt,E8).call(this,s,t,Q,Z,y,v,1);A=l(this,oo)[2*ne],M=l(this,oo)[2*ne+1];let L=Q+A,$=Z+M;w.push($,L);let X=Q*t+Z;if(s[X+1]===0?s[X]=-a:s[X]===1&&(s[X]=a),L===f&&$===h&&Q===I&&Z===q){s[d]!==1&&(u=Math.abs(s[d]));break}else y=Q,v=Z,Q=L,Z=$}}}return c},eE=function(e,t,n,i){if(n-t<=4){for(let I=t;I<n-2;I+=2)i.push(e[I],e[I+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,d=f*s-h*o,g=u/a,y=1/c,v=Math.atan(g),w=Math.cos(v),b=Math.sin(v),E=y*(Math.abs(w)+Math.abs(b)),_=y*(1-E+E**2),S=Math.max(Math.atan(Math.abs(b+w)*_),Math.atan(Math.abs(b-w)*_)),A=0,M=t;for(let I=t+2;I<n-2;I+=2){let q=Math.abs(d-f*e[I+1]+h*e[I]);q>A&&(M=I,A=q)}A>(c*S)**2?(Y(this,Kt,eE).call(this,e,t,M+2,i),Y(this,Kt,eE).call(this,e,M,n,i)):i.push(o,s)},_8=function(e){let t=[],n=e.length;return Y(this,Kt,eE).call(this,e,0,n,t),t.push(e[n-2],e[n-1]),t.length<=4?null:t},A8=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 b=0;b<s;b++)a[v*s+b]=Math.exp((w+(b-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 d=e.length,g=new Uint8Array(d),y=new Uint32Array(256);for(let v=0;v<n;v++)for(let w=0;w<t;w++){let b=v*t+w,E=e[b],_=0,S=0;for(let M=0;M<s;M++){let I=v+M-c;if(!(I<0||I>=n))for(let q=0;q<s;q++){let Q=w+q-c;if(Q<0||Q>=t)continue;let Z=e[I*t+Q],ne=a[M*s+q]*f[Math.abs(Z-E)];_+=Z*ne,S+=ne}}let A=g[b]=Math.round(_/S);y[A]++}return[g,y]},x8=function(e){let t=new Uint32Array(256);for(let n of e)t[n]++;return t},mC=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},yC=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},S8=function(e){let t=e,{width:n,height:i}=e,{maxDim:o}=l(this,Jf),s=n,a=i;if(n>o||i>o){let d=n,g=i,y=Math.log2(Math.max(n,i)/o),v=Math.floor(y);y=y===v?v-1:v;for(let b=0;b<y;b++){s=Math.ceil(d/2),a=Math.ceil(g/2);let E=new OffscreenCanvas(s,a);E.getContext("2d").drawImage(e,0,0,d,g,0,0,s,a),d=s,g=a,e!==t&&e.close(),e=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[Y(this,Kt,mC).call(this,f),s,a]},W(Bs,Kt),W(Bs,Jf,{maxDim:512,sigmaSFactor:.02,sigmaR:25,kernelSize:16}),W(Bs,oo,new Int32Array([0,1,-1,1,-1,0,-1,-1,0,-1,1,-1,1,0,1,1]));bC=class r extends BE{constructor(){super(),super.updateProperties({fill:br._defaultLineColor,"stroke-width":0})}clone(){let e=new r;return e.updateAll(this),e}},wC=class r extends jE{constructor(e){super(e),super.updateProperties({stroke:br._defaultLineColor,"stroke-width":1})}clone(){let e=new r(this._viewParameters);return e.updateAll(this),e}},Ui=class Ui extends UE{constructor(t){super({...t,mustBeCommitted:!0,name:"signatureEditor"});W(this,Fu,!1);W(this,ra,null);W(this,Mu,null);W(this,Qf,null);this._willKeepAspectRatio=!0,N(this,Mu,t.signatureData||null),N(this,ra,null),this.defaultL10nId="pdfjs-editor-signature-editor1"}static initialize(t,n){br.initialize(t,n),this._defaultDrawingOptions=new bC,this._defaultDrawnSignatureOptions=new wC(n.viewParameters)}static getDefaultDrawingOptions(t){let n=this._defaultDrawingOptions.clone();return n.updateProperties(t),n}static get supportMultipleDrawings(){return!1}static get typesMap(){return _t(this,"typesMap",new Map)}static get isDrawer(){return!1}get telemetryFinalData(){return{type:"signature",hasDescription:!!l(this,ra)}}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,Mu)){let{lines:o,mustSmooth:s,areContours:a,description:u,uuid:c,heightInPage:f}=l(this,Mu),{rawDims:{pageWidth:h,pageHeight:d},rotation:g}=this.parent.viewport,y=Bs.processDrawnLines({lines:o,pageWidth:h,pageHeight:d,rotation:g,innerMargin:Ui._INNER_MARGIN,mustSmooth:s,areContours:a});this.addSignature(y,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,ra)||""}));return i&&(this._isCopy=!0,this._moveAfterPaste(t,n)),this.div}setUuid(t){N(this,Qf,t),this.addEditToolbar()}getUuid(){return l(this,Qf)}get description(){return l(this,ra)}set description(t){N(this,ra,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,Mu),a=Math.max(o,s),u=Bs.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}=N(this,Mu,t);N(this,Fu,u instanceof c0),this.description=i;let c;l(this,Fu)?c=Ui.getDefaultDrawingOptions():(c=Ui._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 Bs.process(t,n,i,o,Ui._INNER_MARGIN)}getFromText(t,n){let{rawDims:{pageWidth:i,pageHeight:o},rotation:s}=this.parent.viewport;return Bs.extractContoursFromText(t,n,i,o,s,Ui._INNER_MARGIN)}getDrawnSignature(t){let{rawDims:{pageWidth:n,pageHeight:i},rotation:o}=this.parent.viewport;return Bs.processDrawnLines({lines:t,pageWidth:n,pageHeight:i,rotation:o,innerMargin:Ui._INNER_MARGIN,mustSmooth:!1,areContours:!1})}createDrawingOptions({areContours:t,thickness:n}){t?this._drawingOptions=Ui.getDefaultDrawingOptions():(this._drawingOptions=Ui._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,Fu),color:[0,0,0],thickness:l(this,Fu)?0:o});return this.addComment(s),t?(s.paths={lines:n,points:i},s.uuid=l(this,Qf),s.isCopy=!0):s.lines=n,l(this,ra)&&(s.accessibilityData={type:"Figure",alt:l(this,ra)}),s}static deserializeDraw(t,n,i,o,s,a){return a.areContours?c0.deserialize(t,n,i,o,s,a):lh.deserialize(t,n,i,o,s,a)}static async deserialize(t,n,i){let o=await super.deserialize(t,n,i);return N(o,Fu,t.areContours),o.description=t.accessibilityData?.alt||"",N(o,Qf,t.uuid),o}};Fu=new WeakMap,ra=new WeakMap,Mu=new WeakMap,Qf=new WeakMap,He(Ui,"_type","signature"),He(Ui,"_editorType",At.SIGNATURE),He(Ui,"_defaultDrawingOptions",null);vC=Ui,zm=class extends br{constructor(t){super({...t,name:"stampEditor"});W(this,zt);W(this,Cr,null);W(this,Tn,null);W(this,Bu,null);W(this,dl,null);W(this,Uu,null);W(this,qp,"");W(this,pl,null);W(this,eh,!1);W(this,na,null);W(this,ns,!1);W(this,Gp,!1);N(this,dl,t.bitmapUrl),N(this,Uu,t.bitmapFile),this.defaultL10nId="pdfjs-editor-stamp-editor"}static initialize(t,n){br.initialize(t,n)}static isHandlingMimeForPasting(t){return uE.includes(t)}static paste(t,n){n.pasteEditor({mode:At.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,Tn)&&(N(this,Cr,null),this._uiManager.imageManager.deleteId(l(this,Tn)),l(this,pl)?.remove(),N(this,pl,null),l(this,na)&&(clearTimeout(l(this,na)),N(this,na,null))),super.remove()}rebuild(){if(!this.parent){l(this,Tn)&&Y(this,zt,tE).call(this);return}super.rebuild(),this.div!==null&&(l(this,Tn)&&l(this,pl)===null&&Y(this,zt,tE).call(this),this.isAttachedToDOM||this.parent.add(this))}onceAdded(t){this._isDraggable=!0,t&&this.div.focus()}isEmpty(){return!(l(this,Bu)||l(this,Cr)||l(this,dl)||l(this,Uu)||l(this,Tn)||l(this,eh))}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,eh)||(l(this,Cr)?Y(this,zt,rE).call(this):Y(this,zt,tE).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)&&(N(this,Tn,i),o&&N(this,Cr,o),N(this,eh,!1),Y(this,zt,rE).call(this))}_onResized(){this.onScaleChanging()}onScaleChanging(){if(!this.parent)return;l(this,na)!==null&&clearTimeout(l(this,na)),N(this,na,setTimeout(()=>{N(this,na,null),Y(this,zt,EC).call(this)},200))}copyCanvas(t,n,i=!1){t||(t=224);let{width:o,height:s}=l(this,Cr),a=new ia,u=l(this,Cr),c=o,f=s,h=null;if(n){if(o>n||s>n){let I=Math.min(n/o,n/s);c=Math.floor(o*I),f=Math.floor(s*I)}h=document.createElement("canvas");let g=h.width=Math.ceil(c*a.sx),y=h.height=Math.ceil(f*a.sy);l(this,ns)||(u=Y(this,zt,nE).call(this,g,y));let v=h.getContext("2d");v.filter=this._uiManager.hcmFilter;let w="white",b="#cfcfd8";this._uiManager.hcmFilter!=="none"?b="black":Qx.isDarkMode&&(w="#8f8f9d",b="#42414d");let E=15,_=E*a.sx,S=E*a.sy,A=new OffscreenCanvas(_*2,S*2),M=A.getContext("2d");M.fillStyle=w,M.fillRect(0,0,_*2,S*2),M.fillStyle=b,M.fillRect(0,0,_,S),M.fillRect(_,S,_,S),v.fillStyle=v.createPattern(A,"repeat"),v.fillRect(0,0,g,y),v.drawImage(u,0,0,u.width,u.height,0,0,g,y)}let d=null;if(i){let g,y;if(a.symmetric&&u.width<t&&u.height<t)g=u.width,y=u.height;else if(u=l(this,Cr),o>t||s>t){let b=Math.min(t/o,t/s);g=Math.floor(o*b),y=Math.floor(s*b),l(this,ns)||(u=Y(this,zt,nE).call(this,g,y))}let w=new OffscreenCanvas(g,y).getContext("2d",{willReadFrequently:!0});w.drawImage(u,0,0,u.width,u.height,0,0,g,y),d={width:g,height:y,data:w.getImageData(0,0,g,y).data}}return{canvas:h,width:c,height:f,imageData:d}}static async deserialize(t,n,i){let o=null,s=!1;if(t instanceof OE){let{data:{rect:w,rotation:b,id:E,structParent:_,popupRef:S,richText:A,contentsObj:M,creationDate:I,modificationDate:q},container:Q,parent:{page:{pageNumber:Z}},canvas:ne}=t,L,$;ne?(delete t.canvas,{id:L,bitmap:$}=i.imageManager.getFromCanvas(Q.id,ne),ne.remove()):(s=!0,t._hasNoCanvas=!0);let X=(await n._structTree.getAriaAttributes(`${pd}${E}`))?.get("aria-label")||"";o=t={annotationType:At.STAMP,bitmapId:L,bitmap:$,pageIndex:Z-1,rect:w.slice(0),rotation:b,annotationElementId:E,id:E,deleted:!1,accessibilityData:{decorative:!1,altText:X},isSvg:!1,structParent:_,popupRef:S,richText:A,comment:M?.str||null,creationDate:I,modificationDate:q}}let a=await super.deserialize(t,n,i),{rect:u,bitmap:c,bitmapUrl:f,bitmapId:h,isSvg:d,accessibilityData:g}=t;s?(i.addMissingCanvas(t.id,a),N(a,eh,!0)):h&&i.imageManager.isValidId(h)?(N(a,Tn,h),c&&N(a,Cr,c)):N(a,dl,f),N(a,ns,d);let[y,v]=a.pageDimensions;return a.width=(u[2]-u[0])/y,a.height=(u[3]-u[1])/v,g&&(a.altTextData=g),a._initialData=o,t.comment&&a.setCommentData(t),N(a,Gp,!!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,Tn),isSvg:l(this,ns)});if(this.addComment(i),t)return i.bitmapUrl=Y(this,zt,iE).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=Y(this,zt,T8).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,ns)?(i.rect[2]-i.rect[0])*(i.rect[3]-i.rect[1]):null;if(!n.stamps.has(l(this,Tn)))n.stamps.set(l(this,Tn),{area:a,serialized:i}),i.bitmap=Y(this,zt,iE).call(this,!1);else if(l(this,ns)){let u=n.stamps.get(l(this,Tn));a>u.area&&(u.area=a,u.serialized.bitmap.close(),u.serialized.bitmap=Y(this,zt,iE).call(this,!1))}return i}renderAnnotationElement(t){return this.deleted?(t.hide(),null):(t.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}};Cr=new WeakMap,Tn=new WeakMap,Bu=new WeakMap,dl=new WeakMap,Uu=new WeakMap,qp=new WeakMap,pl=new WeakMap,eh=new WeakMap,na=new WeakMap,ns=new WeakMap,Gp=new WeakMap,zt=new WeakSet,Wm=function(t,n=!1){if(!t){this.remove();return}N(this,Cr,t.bitmap),n||(N(this,Tn,t.id),N(this,ns,t.isSvg)),t.file&&N(this,qp,t.file.name),Y(this,zt,rE).call(this)},Hm=function(){if(N(this,Bu,null),this._uiManager.enableWaiting(!1),!!l(this,pl)){if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&l(this,Cr)){this.addEditToolbar().then(()=>{this._editToolbar.hide(),this._uiManager.editAltText(this,!0)});return}if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&l(this,Cr)){this._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!1,alt_text_type:"empty"}});try{this.mlGuessAltText()}catch{}}this.div.focus()}},tE=function(){if(l(this,Tn)){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(l(this,Tn)).then(i=>Y(this,zt,Wm).call(this,i,!0)).finally(()=>Y(this,zt,Hm).call(this));return}if(l(this,dl)){let i=l(this,dl);N(this,dl,null),this._uiManager.enableWaiting(!0),N(this,Bu,this._uiManager.imageManager.getFromUrl(i).then(o=>Y(this,zt,Wm).call(this,o)).finally(()=>Y(this,zt,Hm).call(this)));return}if(l(this,Uu)){let i=l(this,Uu);N(this,Uu,null),this._uiManager.enableWaiting(!0),N(this,Bu,this._uiManager.imageManager.getFromFile(i).then(o=>Y(this,zt,Wm).call(this,o)).finally(()=>Y(this,zt,Hm).call(this)));return}let t=document.createElement("input");t.type="file",t.accept=uE.join(",");let n=this._uiManager._signal;N(this,Bu,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}}),Y(this,zt,Wm).call(this,o)}i()},{signal:n}),t.addEventListener("cancel",()=>{this.remove(),i()},{signal:n})}).finally(()=>Y(this,zt,Hm).call(this))),t.click()},rE=function(){let{div:t}=this,{width:n,height:i}=l(this,Cr),[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=N(this,pl,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),Y(this,zt,EC).call(this),l(this,Gp)||(this.parent.addUndoableEditor(this),N(this,Gp,!0)),this._reportTelemetry({action:"inserted_image"}),l(this,qp)&&this.div.setAttribute("aria-description",l(this,qp)),this.annotationElementId||this._uiManager.a11yAlert("pdfjs-editor-stamp-added-alert")},nE=function(t,n){let{width:i,height:o}=l(this,Cr),s=i,a=o,u=l(this,Cr);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},EC=function(){let[t,n]=this.parentDimensions,{width:i,height:o}=this,s=new ia,a=Math.ceil(i*t*s.sx),u=Math.ceil(o*n*s.sy),c=l(this,pl);if(!c||c.width===a&&c.height===u)return;c.width=a,c.height=u;let f=l(this,ns)?l(this,Cr):Y(this,zt,nE).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)},iE=function(t){if(t){if(l(this,ns)){let o=this._uiManager.imageManager.getSvgUrl(l(this,Tn));if(o)return o}let n=document.createElement("canvas");return{width:n.width,height:n.height}=l(this,Cr),n.getContext("2d").drawImage(l(this,Cr),0,0),n.toDataURL()}if(l(this,ns)){let[n,i]=this.pageDimensions,o=Math.round(this.width*n*_l.PDF_TO_CSS_UNITS),s=Math.round(this.height*i*_l.PDF_TO_CSS_UNITS),a=new OffscreenCanvas(o,s);return a.getContext("2d").drawImage(l(this,Cr),0,0,l(this,Cr).width,l(this,Cr).height,0,0,o,s),a.transferToImageBitmap()}return structuredClone(l(this,Cr))},T8=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}},He(zm,"_type","stamp"),He(zm,"_editorType",At.STAMP);Zs=class Zs{constructor({uiManager:e,pageIndex:t,div:n,structTreeLayer:i,accessibilityManager:o,annotationLayer:s,drawLayer:a,textLayer:u,viewport:c,l10n:f}){W(this,nr);W(this,th);W(this,Vp,!1);W(this,ju,null);W(this,$u,null);W(this,gl,null);W(this,ki,new Map);W(this,zu,!1);W(this,Xp,!1);W(this,Yp,!1);W(this,ao,null);W(this,ml,null);W(this,Cn,null);W(this,yl,null);W(this,Wu,null);W(this,Zp,-1);W(this,ht);let h=[...l(Zs,Hu).values()];if(!Zs._initialized){Zs._initialized=!0;for(let d of h)d.initialize(f,e)}e.registerEditorTypes(h),N(this,ht,e),this.pageIndex=t,this.div=n,N(this,th,o),N(this,ju,s),this.viewport=c,N(this,Cn,u),this.drawLayer=a,this._structTree=i,l(this,ht).addLayer(this)}updatePageIndex(e){for(let t of l(this,nr,qm))t.updatePageIndex(e);this.pageIndex=e,l(this,ht).addLayer(this)}async setClonedFrom(e){if(!e)return;let t=[];for(let n of l(e,nr,qm)){let i=n.serialize(!0);i&&(i.isCopy=!1,t.push(this.deserialize(i).then(o=>{o&&this.addOrRebuild(o)})))}await Promise.all(t)}get isEmpty(){return l(this,ki).size===0}get isInvisible(){return this.isEmpty&&l(this,ht).getMode()===At.NONE}updateToolbar(e){l(this,ht).updateToolbar(e)}updateMode(e=l(this,ht).getMode()){switch(Y(this,nr,sE).call(this),e){case At.NONE:this.div.classList.toggle("nonEditing",!0),this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),this.disableClick();return;case At.INK:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick();break;case At.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===At.POPUP)t.toggle("commentEditing",!0);else{t.toggle("commentEditing",!1);for(let n of l(Zs,Hu).values())t.toggle(`${n._type}Editing`,e===n._editorType)}this.div.hidden=!1}hasTextLayer(e){return e===l(this,Cn)?.div}setEditingState(e){l(this,ht).setEditingState(e)}addCommands(e){l(this,ht).addCommands(e)}cleanUndoStack(e){l(this,ht).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,ju)?.togglePointerEvents(e)}async enable(){N(this,Yp,!0),this.div.tabIndex=0,this.togglePointerEvents(!0),this.div.classList.toggle("nonEditing",!1),l(this,Wu)?.abort(),N(this,Wu,null);let e=new Set;for(let n of l(this,nr,qm))n.enableEditing(),n.show(!0),n.annotationElementId&&(l(this,ht).removeChangedExistingAnnotation(n),e.add(n.annotationElementId));let t=l(this,ju);if(t)for(let n of t.getEditableAnnotations()){if(n.hide(),l(this,ht).isDeletedAnnotationElement(n.data.id)||e.has(n.data.id))continue;let i=await this.deserialize(n);i&&(this.addOrRebuild(i),i.enableEditing())}N(this,Yp,!1),l(this,ht)._eventBus.dispatch("editorsrendered",{source:this,pageNumber:this.pageIndex+1})}disable(){if(N(this,Xp,!0),this.div.tabIndex=-1,this.togglePointerEvents(!1),this.div.classList.toggle("nonEditing",!0),l(this,Cn)&&!l(this,Wu)){N(this,Wu,new AbortController);let i=l(this,ht).combinedSignal(l(this,Wu));l(this,Cn).div.addEventListener("pointerdown",o=>{let{clientX:a,clientY:u,timeStamp:c}=o,f=l(this,Zp);if(c-f>500){N(this,Zp,c);return}N(this,Zp,-1);let{classList:h}=this.div;h.toggle("getElements",!0);let d=document.elementsFromPoint(a,u);if(h.toggle("getElements",!1),!this.div.contains(d[0]))return;let g,y=new RegExp(`^${Ym}[0-9]+$`);for(let w of d)if(y.test(w.id)){g=w.id;break}if(!g)return;let v=l(this,ki).get(g);v?.annotationElementId===null&&(o.stopPropagation(),o.preventDefault(),v.dblclick(o))},{signal:i,capture:!0})}let e=l(this,ju),t=[];if(e){let i=new Map,o=new Map;for(let a of l(this,nr,qm)){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,ht).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,ht).addChangedExistingAnnotation(c),c.renderAnnotationElement(a)&&c.show(!1)),a.show()}}Y(this,nr,sE).call(this),this.isEmpty&&(this.div.hidden=!0);let{classList:n}=this.div;for(let i of l(Zs,Hu).values())n.remove(`${i._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),e?.updateFakeAnnotations(t),N(this,Xp,!1)}getEditableAnnotation(e){return l(this,ju)?.getEditableAnnotation(e)||null}setActiveEditor(e){l(this,ht).getActive()!==e&&l(this,ht).setActiveEditor(e)}enableTextSelection(){if(this.div.tabIndex=-1,l(this,Cn)?.div&&!l(this,yl)){N(this,yl,new AbortController);let e=l(this,ht).combinedSignal(l(this,yl));l(this,Cn).div.addEventListener("pointerdown",Y(this,nr,C8).bind(this),{signal:e}),l(this,Cn).div.classList.add("highlighting")}}disableTextSelection(){this.div.tabIndex=0,l(this,Cn)?.div&&l(this,yl)&&(l(this,yl).abort(),N(this,yl,null),l(this,Cn).div.classList.remove("highlighting"))}enableClick(){if(l(this,$u))return;N(this,$u,new AbortController);let e=l(this,ht).combinedSignal(l(this,$u));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,$u)?.abort(),N(this,$u,null)}attach(e){l(this,ki).set(e.id,e);let{annotationElementId:t}=e;t&&l(this,ht).isDeletedAnnotationElement(t)&&l(this,ht).removeDeletedAnnotationElement(e)}detach(e){l(this,ki).delete(e.id),l(this,th)?.removePointerInTextLayer(e.contentDiv),!l(this,Xp)&&e.annotationElementId&&l(this,ht).addDeletedAnnotationElement(e)}remove(e){this.detach(e),l(this,ht).removeEditor(e),e.div.remove(),e.isAttachedToDOM=!1}changeParent(e){e.parent!==this&&(e.parent&&e.annotationElementId&&(l(this,ht).addDeletedAnnotationElement(e),br.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,ht).addEditor(e),this.attach(e),!e.isAttachedToDOM){let t=e.render();this.div.append(t),e.isAttachedToDOM=!0}e.fixAndSetPosition(),e.onceAdded(!l(this,Yp)),l(this,ht).addToAnnotationStorage(e),e._reportTelemetry(e.telemetryInitialData)}}moveEditorInDOM(e){if(!e.isAttachedToDOM)return;let{activeElement:t}=document;e.div.contains(t)&&!l(this,gl)&&(e._focusEventsAllowed=!1,N(this,gl,setTimeout(()=>{N(this,gl,null),e.div.contains(document.activeElement)?e._focusEventsAllowed=!0:(e.div.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:l(this,ht)._signal}),t.focus())},0))),e._structTreeParentId=l(this,th)?.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,ki).values())if(t.uid===e)return t;return null}getNextId(){return l(this,ht).getId()}combinedSignal(e){return l(this,ht).combinedSignal(e)}canCreateNewEmptyEditor(){return l(this,nr,Oo)?.canCreateNewEmptyEditor()}async pasteEditor(e,t){this.updateToolbar(e),await l(this,ht).updateMode(e.mode);let{offsetX:n,offsetY:i}=Y(this,nr,AC).call(this),o=this.getNextId(),s=Y(this,nr,_C).call(this,{parent:this,id:o,x:n,y:i,uiManager:l(this,ht),isCentered:!0,...t});s&&this.add(s)}async deserialize(e){return await l(Zs,Hu).get(e.annotationType??e.annotationEditorType)?.deserialize(e,this,l(this,ht))||null}createAndAddNewEditor(e,t,n={}){let i=this.getNextId(),o=Y(this,nr,_C).call(this,{parent:this,id:i,x:e.offsetX,y:e.offsetY,uiManager:l(this,ht),isCentered:t,...n});return o&&this.add(o),o}get boundingClientRect(){return this.div.getBoundingClientRect()}addNewEditor(e={}){this.createAndAddNewEditor(Y(this,nr,AC).call(this),!0,e)}setSelected(e){l(this,ht).setSelected(e)}toggleSelected(e){l(this,ht).toggleSelected(e)}unselect(e){l(this,ht).unselect(e)}pointerup(e){let{isMac:t}=Wr.platform;if(e.button!==0||e.ctrlKey&&t||e.target!==this.div||!l(this,zu)||(N(this,zu,!1),l(this,nr,Oo)?.isDrawer&&l(this,nr,Oo).supportMultipleDrawings))return;if(!l(this,Vp)){N(this,Vp,!0);return}let n=l(this,ht).getMode();if(n===At.STAMP||n===At.SIGNATURE){l(this,ht).unselectAll();return}this.createAndAddNewEditor(e,!1)}pointerdown(e){if(l(this,ht).getMode()===At.HIGHLIGHT&&this.enableTextSelection(),l(this,zu)){N(this,zu,!1);return}let{isMac:t}=Wr.platform;if(e.button!==0||e.ctrlKey&&t||e.target!==this.div)return;if(N(this,zu,!0),l(this,nr,Oo)?.isDrawer){this.startDrawingSession(e);return}let n=l(this,ht).getActive();N(this,Vp,!n||n.isEmpty())}startDrawingSession(e){if(this.div.focus({preventScroll:!0}),l(this,ao)){l(this,nr,Oo).startDrawing(this,l(this,ht),!1,e);return}l(this,ht).setCurrentDrawingSession(this),N(this,ao,new AbortController);let t=l(this,ht).combinedSignal(l(this,ao));this.div.addEventListener("blur",({relatedTarget:n})=>{n&&!this.div.contains(n)&&(N(this,ml,null),this.commitOrRemove())},{signal:t}),l(this,nr,Oo).startDrawing(this,l(this,ht),!1,e)}pause(e){if(e){let{activeElement:t}=document;this.div.contains(t)&&N(this,ml,t);return}l(this,ml)&&setTimeout(()=>{l(this,ml)?.focus(),N(this,ml,null)},0)}endDrawingSession(e=!1){return l(this,ao)?(l(this,ht).setCurrentDrawingSession(null),l(this,ao).abort(),N(this,ao,null),N(this,ml,null),l(this,nr,Oo).endDrawing(e)):null}findNewParent(e,t,n){let i=l(this,ht).findParent(t,n);return i===null||i===this?!1:(i.changeParent(e),!0)}commitOrRemove(){return l(this,ao)?(this.endDrawingSession(),!0):!1}onScaleChanging(){l(this,ao)&&l(this,nr,Oo).onScaleChangingWhenDrawing(this)}destroy(){this.commitOrRemove(),l(this,ht).getActive()?.parent===this&&(l(this,ht).commitOrRemove(),l(this,ht).setActiveEditor(null)),l(this,gl)&&(clearTimeout(l(this,gl)),N(this,gl,null));for(let e of l(this,ki).values())l(this,th)?.removePointerInTextLayer(e.contentDiv),e.setParent(null),e.isAttachedToDOM=!1,e.div.remove();this.div=null,l(this,ki).clear(),l(this,ht).removeLayer(this)}render({viewport:e}){this.viewport=e,qu(this.div,e);for(let t of l(this,ht).getEditors(this.pageIndex))this.add(t),t.rebuild();this.updateMode()}update({viewport:e}){l(this,ht).commitOrRemove(),Y(this,nr,sE).call(this);let t=this.viewport.rotation,n=e.rotation;if(this.viewport=e,qu(this.div,{rotation:n}),t!==n)for(let i of l(this,ki).values())i.rotate(n)}get pageDimensions(){let{pageWidth:e,pageHeight:t}=this.viewport.rawDims;return[e,t]}get scale(){return l(this,ht).viewParameters.realScale}};th=new WeakMap,Vp=new WeakMap,ju=new WeakMap,$u=new WeakMap,gl=new WeakMap,ki=new WeakMap,zu=new WeakMap,Xp=new WeakMap,Yp=new WeakMap,ao=new WeakMap,ml=new WeakMap,Cn=new WeakMap,yl=new WeakMap,Wu=new WeakMap,Zp=new WeakMap,ht=new WeakMap,Hu=new WeakMap,nr=new WeakSet,qm=function(){return l(this,ki).size!==0?l(this,ki).values():l(this,ht).getEditors(this.pageIndex)},C8=function(e){l(this,ht).unselectAll();let{target:t}=e;if(t===l(this,Cn).div||(t.getAttribute("role")==="img"||t.classList.contains("endOfContent"))&&l(this,Cn).div.contains(t)){let{isMac:n}=Wr.platform;if(e.button!==0||e.ctrlKey&&n)return;l(this,ht).showAllEditors("highlight",!0,!0),l(this,Cn).div.classList.add("free"),this.toggleDrawing(),ME.startHighlighting(this,l(this,ht).direction==="ltr",{target:l(this,Cn).div,x:e.x,y:e.y}),l(this,Cn).div.addEventListener("pointerup",()=>{l(this,Cn).div.classList.remove("free"),this.toggleDrawing(!0)},{once:!0,signal:l(this,ht)._signal}),e.preventDefault()}},Oo=function(){return l(Zs,Hu).get(l(this,ht).getMode())},_C=function(e){let t=l(this,nr,Oo);return t?new t.prototype.constructor(e):null},AC=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,d]=this.viewport.rotation%180===0?[c,f]:[f,c];return{offsetX:h,offsetY:d}},sE=function(){for(let e of l(this,ki).values())e.isEmpty()&&e.remove()},He(Zs,"_initialized",!1),W(Zs,Hu,new Map([rC,dC,zm,ME,vC].map(e=>[e._editorType,e])));$E=Zs,dn=class dn{constructor(){W(this,oa);W(this,lo,null);W(this,si,new Map);W(this,rh,new Map)}setParent(e){if(!l(this,lo)){N(this,lo,e);return}if(l(this,lo)!==e){if(l(this,si).size>0)for(let t of l(this,si).values())t.remove(),e.append(t);N(this,lo,e)}}static get _svgFactory(){return _t(this,"_svgFactory",new oh)}draw(e,t=!1,n=!1){let i=ln(dn,ab)._++,o=Y(this,oa,xC).call(this),s=dn._svgFactory.createElement("defs");o.append(s);let a=dn._svgFactory.createElement("path");s.append(a);let u=`path_${i}`;a.setAttribute("id",u),a.setAttribute("vector-effect","non-scaling-stroke"),t&&l(this,rh).set(i,a);let c=n?Y(this,oa,D8).call(this,s,u):null,f=dn._svgFactory.createElement("use");return o.append(f),f.setAttribute("href",`#${u}`),this.updateProperties(o,e),l(this,si).set(i,o),{id:i,clipPathId:`url(#${c})`}}drawOutline(e,t){let n=ln(dn,ab)._++,i=Y(this,oa,xC).call(this),o=dn._svgFactory.createElement("defs");i.append(o);let s=dn._svgFactory.createElement("path");o.append(s);let a=`path_${n}`;s.setAttribute("id",a),s.setAttribute("vector-effect","non-scaling-stroke");let u;if(t){let h=dn._svgFactory.createElement("mask");o.append(h),u=`mask_${n}`,h.setAttribute("id",u),h.setAttribute("maskUnits","objectBoundingBox");let d=dn._svgFactory.createElement("rect");h.append(d),d.setAttribute("width","1"),d.setAttribute("height","1"),d.setAttribute("fill","white");let g=dn._svgFactory.createElement("use");h.append(g),g.setAttribute("href",`#${a}`),g.setAttribute("stroke","none"),g.setAttribute("fill","black"),g.setAttribute("fill-rule","nonzero"),g.classList.add("mask")}let c=dn._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,si).set(n,i),n}finalizeDraw(e,t){l(this,rh).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,si).get(e):e;if(a){if(n&&Y(this,oa,SC).call(this,a,n),i&&Y(u=dn,a1,R8).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;Y(this,oa,SC).call(this,f,s)}}}updateParent(e,t){if(t===this)return;let n=l(this,si).get(e);n&&(l(t,lo).append(n),l(this,si).delete(e),l(t,si).set(e,n))}remove(e){l(this,rh).delete(e),l(this,lo)!==null&&(l(this,si).get(e).remove(),l(this,si).delete(e))}destroy(){N(this,lo,null);for(let e of l(this,si).values())e.remove();l(this,si).clear(),l(this,rh).clear()}};lo=new WeakMap,si=new WeakMap,rh=new WeakMap,ab=new WeakMap,a1=new WeakSet,R8=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}%`},oa=new WeakSet,xC=function(){let e=dn._svgFactory.create(1,1,!0);return l(this,lo).append(e),e.setAttribute("aria-hidden",!0),e},D8=function(e,t){let n=dn._svgFactory.createElement("clipPath");e.append(n);let i=`clip_${t}`;n.setAttribute("id",i),n.setAttribute("clipPathUnits","objectBoundingBox");let o=dn._svgFactory.createElement("use");return n.append(o),o.setAttribute("href",`#${t}`),o.classList.add("clip"),i},SC=function(e,t){for(let[n,i]of Object.entries(t))i===null?e.removeAttribute(n):e.setAttribute(n,i)},W(dn,a1),W(dn,ab,0);zE=dn;globalThis._pdfjsTestingUtils={HighlightOutliner:l0};globalThis.pdfjsLib={AbortException:co,AnnotationEditorLayer:$E,AnnotationEditorParamsType:Bt,AnnotationEditorType:At,AnnotationEditorUIManager:Gu,AnnotationLayer:LE,AnnotationMode:bl,AnnotationType:Yr,applyOpacity:T3,build:M6,ColorPicker:i0,createValidAbsoluteUrl:TC,CSSConstants:cE,DOMSVGFactory:oh,DrawLayer:zE,FeatureTest:Wr,fetchData:og,findContrastColor:C3,getDocument:N6,getFilenameFromUrl:_3,getPdfFilenameFromUrl:A3,getRGB:ag,getUuid:RC,getXfaPageViewport:S3,GlobalWorkerOptions:Ms,ImageKind:Gm,InvalidPDFException:Jp,isDataScheme:ub,isPdfFile:h1,isValidExplicitDest:l6,makeArr:DC,makeMap:f1,makeObj:aE,MathClamp:gn,noContextMenu:us,normalizeUnicode:E3,OPS:Kp,OutputScale:ia,PasswordResponses:v3,PDFDataRangeTransport:n0,PDFDateString:nh,PDFWorker:ig,PermissionFlag:w3,PixelsPerInch:_l,RenderingCancelledException:Qp,renderRichText:IC,ResponseException:ih,setLayerDimensions:qu,shadow:_t,SignatureExtractor:Bs,stopEvent:Nr,SupportedImageMimeTypes:uE,TextLayer:ng,TouchManager:Qm,updateUrlHash:CC,Util:at,VerbosityLevel:lb,version:F6,XfaLayer:Km}});var _Z={};go(_Z,{OfficeParser:()=>ch,default:()=>vZ,parseOffice:()=>wZ});Se();Ce();Te();Se();Ce();Te();iw();Se();Ce();Te();Se();Ce();Te();Se();Ce();Te();var iL=Rl(gw()),qt=r=>new iL.DOMParser().parseFromString(r,"text/xml"),Le=(r,e)=>Array.from(r.getElementsByTagName(e)),Rn=(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},jl=r=>{let e=qt(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 zg=(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},w7=r=>{let e=r.toString("utf8"),n=qt(e).documentElement,i=zg(n,"c:title"),o,s,a=n.getElementsByTagName("c:catAx");a.length>0&&(o=zg(a[0],"c:title"));let u=n.getElementsByTagName("c:valAx");u.length>0&&(s=zg(u[0],"c:title"));let c=n.getElementsByTagName("c:ser"),f=[],h=[];for(let g=0;g<c.length;g++){let y=c[g],v=zg(y,"c:tx"),w=[],b=y.getElementsByTagName("c:val")[0]||y.getElementsByTagName("c:yVal")[0];if(b){let A=b.getElementsByTagName("c:v");for(let M=0;M<A.length;M++){let I=A[M].textContent?.trim();I&&w.push(I)}}let E=[],_=y.getElementsByTagName("c:dLbl");for(let A=0;A<_.length;A++){let M=zg(_[A],"c:tx");M&&E.push(M)}let S=y.getElementsByTagName("c:cat")[0]||y.getElementsByTagName("c:xVal")[0];if(S){let A=S.getElementsByTagName("c:v"),M=[];for(let I=0;I<A.length;I++){let q=A[I].textContent?.trim();q&&M.push(q)}M.length>0&&h.length===0&&h.push(...M)}f.push({name:v,values:w,pointLabels:E})}let d=[];for(let g of f)g.name&&d.push(g.name),d.push(...h),d.push(...g.values);return{title:i,xAxisTitle:o,yAxisTitle:s,dataSets:f,labels:h,rawTexts:d}},v7=r=>{let e=r.toString("utf8"),t=qt(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 g=[],y=Rn(s,"table:table-header-rows")[0];if(y&&g.push(...Rn(y,"table:table-row")),g.push(...Rn(s,"table:table-row")),g.length>0){let v=Rn(g[0],"table:table-cell");for(let w=1;w<v.length;w++){let b=parseInt(v[w].getAttribute("table:number-columns-repeated")||"1"),E=Rn(v[w],"text:p")[0]?.textContent||void 0;for(let _=0;_<b;_++)a.push({name:E,values:[],pointLabels:[]})}for(let w=1;w<g.length;w++){let b=Rn(g[w],"table:table-cell");if(b.length>0){let E=Rn(b[0],"text:p")[0]?.textContent||void 0;E&&u.push(E);let _=0;for(let S=1;S<b.length;S++){let A=parseInt(b[S].getAttribute("table:number-columns-repeated")||"1"),M=b[S].getAttribute("office:value")||Rn(b[S],"text:p")[0]?.textContent||"";for(let I=0;I<A;I++)a[_]&&a[_].values.push(M),_++}}}}}else{let g=Le(n,"chart:series");for(let v of g){let w=v.getAttribute("chart:label-cell-address"),b=v.getAttribute("chart:values-cell-range-address"),E,_=Le(v,"text:p");_.length>0&&(E=_[0].textContent||void 0),!E&&w&&(E=`Series ${w.split(".").pop()?.replace(/\$/g,"")||w}`);let S={name:E,values:[],pointLabels:[]};b&&S.values.push(`[${b}]`),a.push(S)}let y=Le(n,"chart:categories")[0];if(y){let v=y.getAttribute("table:cell-range-address");v&&u.push(`[${v}]`)}}let f=Le(t,"chart:axis"),h,d;for(let g of f){let y=g.getAttribute("chart:dimension"),v=Le(g,"chart:title")[0],w=v&&Le(v,"text:p")[0]?.textContent||void 0;y==="x"?h=w:y==="y"&&(d=w)}o&&c.push(o);for(let g of a)g.name&&c.push(g.name),c.push(...u),c.push(...g.values);return{title:o,xAxisTitle:h,yAxisTitle:d,dataSets:a,labels:u,rawTexts:c}},wc=r=>r.toString("utf8",0,500).includes("urn:oasis:names:tc:opendocument:xmlns:chart:1.0")?v7(r):w7(r);Se();Ce();Te();var $h="[OfficeParser]: ";var E7={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.'},sL=(r,e)=>{let t=E7[r];return typeof t=="function"?t(e):t},Aa=(r,e,t)=>{let n=sL(r,t);return e.outputErrorToConsole&&console.error($h+n),new Error($h+n)},oL=(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=sL("FILE_CORRUPTED",t)),e.outputErrorToConsole&&console.error($h+n),new Error($h+n)},yi=(r,e,t)=>{e.outputErrorToConsole&&(t?console.warn($h+r,t):console.warn($h+r))};Se();Ce();Te();var _7=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"}},A7=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"}},qs=(r,e)=>{let t=r.split(".").pop()||"",n=A7(e);return n||(n=_7(t)),{type:"image",mimeType:n,data:e.toString("base64"),name:r,extension:t}};Se();Ce();Te();var ZL=Rl(YL()),ms=async(r,e="eng")=>{let t=await(0,ZL.createWorker)(e,1,{logger:()=>{}}),n=r;typeof window<"u"&&typeof Blob<"u"&&We.isBuffer(r)&&(n=new Blob([r],{type:"image/bmp"}));let i=await t.recognize(n);return await t.terminate(),i.data.text};Se();Ce();Te();var qM=Rl(DF()),GM=Rl(HM()),Xl=(r,e)=>new Promise((t,n)=>{qM.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,GM.default)(f=>{s.push({path:a.fileName,content:f}),o.readEntry()}))}):o.readEntry()}),o.on("end",()=>t(s)),o.on("error",n)})});var VM=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 Xl(r,L=>!!L.match(t)||!!L.match(n)||!!L.match(i)||L===o||L==="xl/styles.xml"||L==="xl/workbook.xml"||L==="xl/_rels/workbook.xml.rels"||!!L.match(a)||!!e.extractAttachments&&(!!L.match(s)||!!L.match(u)||!!L.match(c))),h=f.find(L=>L.path===o),d=[];if(h){let L=qt(h.content.toString()),$=Le(L,"si");for(let X of $){let ie=Le(X,"r");if(ie.length>0){let re=[];for(let O of ie){let x=Le(O,"t")[0];if(x){let P=x.textContent||"",C=Le(O,"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 Ee=B.getAttribute("rgb");Ee&&(j.color="#"+Ee.substring(2))}let ee=Le(C,"rFont")[0];ee&&(j.font=ee.getAttribute("val")||void 0);let fe=Le(C,"vertAlign")[0];if(fe){let Ee=fe.getAttribute("val");Ee==="subscript"&&(j.subscript=!0),Ee==="superscript"&&(j.superscript=!0)}}re.push({type:"text",text:P,formatting:Object.keys(j).length>0?j:void 0})}}d.push(re)}else{let re=Le(X,"t"),O="";for(let x of re)O+=x.textContent||"";d.push(O)}}}let g=f.find(L=>L.path==="xl/styles.xml"),y={};if(g){let L=qt(g.content.toString()),$=Le(L,"fonts")[0],X=[];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 ee=Le(P,"vertAlign")[0];if(ee){let fe=ee.getAttribute("val");fe==="subscript"&&(C.subscript=!0),fe==="superscript"&&(C.superscript=!0)}X.push(C)}}let ie=Le(L,"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"),ee=U.getAttribute("theme");if(B&&B!=="00000000")C.backgroundColor="#"+B.substring(2);else if(ee){let fe=parseInt(ee);fe===0?C.backgroundColor="#FFFFFF":fe===1?C.backgroundColor="#000000":fe===2?C.backgroundColor="#EEECE1":fe===3&&(C.backgroundColor="#1F497D")}}}re.push(C)}}let O=Le(L,"cellXfs")[0];if(O){let x=Le(O,"xf");for(let P=0;P<x.length;P++){let C=x[P],j={},U=C.getAttribute("fontId");if(U){let fe=parseInt(U);X[fe]&&Object.assign(j,X[fe])}let B=C.getAttribute("fillId");if(B){let fe=parseInt(B);re[fe]&&re[fe].backgroundColor&&(j.backgroundColor=re[fe].backgroundColor)}let ee=Le(C,"alignment")[0];if(ee){let fe=ee.getAttribute("horizontal");(fe==="center"||fe==="right"||fe==="justify"||fe==="left")&&(j.alignment=fe)}y[P]=j}}}let v=[],w=f.filter(L=>L.path.match(/xl\/media\/.*/)),b=f.filter(L=>L.path.match(i)),E={};if(e.extractAttachments){let L=f.filter(X=>X.path.match(c));for(let X of L){let re=`xl/drawings/${X.path.split("/").pop()?.replace(".rels","")||""}`,O=qt(X.content.toString()),x=Le(O,"Relationship");E[re]||(E[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("../","");E[re][C]={path:U}}}}let $=f.filter(X=>X.path.match(n));for(let X of $){let ie=qt(X.content.toString()),re=Le(ie,"xdr:pic"),O=E[X.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,ee=B?B.getAttribute("descr")||B.getAttribute("name"):void 0;j&&O[j]&&(O[j].altText=ee||"")}}for(let X of w){let ie=qs(X.path.split("/").pop()||"image",X.content),re="";for(let O in E){for(let x in E[O])if(E[O][x].path===X.path){re=E[O][x].altText||"";break}if(re)break}if(re&&(ie.altText=re),v.push(ie),e.ocr&&ie.mimeType.startsWith("image/"))try{let O=await ms(X.content,e.ocrLanguage);O.trim()&&(ie.ocrText=O.trim())}catch(O){yi(`OCR failed for ${ie.name}:`,e,O)}}for(let X of b){let ie={type:"chart",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",data:X.content.toString("base64"),name:X.path.split("/").pop()||"",extension:"xml"};try{let re=wc(X.content);ie.chartData=re}catch(re){yi(`Failed to extract chart data from ${X.path}:`,e,re)}v.push(ie)}}let _={};if(e.extractAttachments){let L=f.filter($=>$.path.match(c));for(let $ of L){let ie=`xl/drawings/${$.path.split("/").pop()?.replace(".rels","")||""}`,re=qt($.content.toString()),O=Le(re,"Relationship");_[ie]||(_[ie]={});for(let x of O){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()||"";_[ie][P]=U}}}}let S={},A=f.find(L=>L.path==="xl/workbook.xml"),M=f.find(L=>L.path==="xl/_rels/workbook.xml.rels");if(A&&M){let L=qt(M.content.toString()),$=Le(L,"Relationship"),X={};for(let O of $){let x=O.getAttribute("Id"),P=O.getAttribute("Target");if(x&&P){let C=P.split("/").pop()||"";X[x]=C}}let ie=qt(A.content.toString()),re=Le(ie,"sheet");for(let O of re){let x=O.getAttribute("name"),P=O.getAttribute("r:id");x&&P&&X[P]&&(S[X[P]]=x)}}let I=[],q=[];for(let L of f)if(!L.path.match(s)&&L.path!==o&&L.path!=="xl/styles.xml"&&!L.path.match(n)&&!L.path.match(i)&&!L.path.match(u)&&!L.path.match(c)&&L.path.match(t)){e.includeRawContent&&q.push(L.content.toString());let $=[],X=/<row.*?>[\s\S]*?<\/row>/g,ie=L.content.toString().match(X);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 ee of j){let fe=ee.match(/t="([a-z]+)"/),Ee=fe?fe[1]:"n",te=ee.match(/<v>(.*?)<\/v>/),H=ee.match(/<t>(.*?)<\/t>/),ae="",we=[];if(Ee==="s"&&te){let oe=parseInt(te[1]),ge=d[oe];Array.isArray(ge)?(we=JSON.parse(JSON.stringify(ge)),ae=we.map(Re=>Re.text).join("")):ae=ge||""}else Ee==="inlineStr"&&H?ae=H[1]:te&&(ae=te[1]);let xe=ee.match(/r="([A-Z]+)(\d+)"/),F=(xe?xe[1]:"").charCodeAt(0)-65;if(ae||we.length>0){let oe=ee.match(/s="(\d+)"/),ge=oe?parseInt(oe[1]):void 0,Re=ge!==void 0&&y[ge]?y[ge]:{};if(we.length>0)for(let pe of we)pe.formatting||(pe.formatting={}),Re.backgroundColor&&(pe.formatting.backgroundColor=Re.backgroundColor),Re.alignment&&(pe.formatting.alignment=Re.alignment),!pe.formatting.font&&Re.font&&(pe.formatting.font=Re.font),!pe.formatting.size&&Re.size&&(pe.formatting.size=Re.size);else we.push({type:"text",text:ae,formatting:Re});let be={type:"cell",text:ae,children:we,metadata:{row:B,col:F}};e.includeRawContent&&(be.rawContent=ee),P.push(be)}}if(P.length>0){let ee={type:"row",children:P,metadata:void 0};e.includeRawContent&&(ee.rawContent=x),$.push(ee)}}if(e.extractAttachments){let P=`xl/worksheets/_rels/${L.path.split("/").pop()||""}.rels`,C=f.find(B=>B.path===P),j={};if(C){let B=qt(C.content.toString()),ee=Le(B,"Relationship");for(let fe of ee){let Ee=fe.getAttribute("Id"),te=fe.getAttribute("Target"),H=fe.getAttribute("Type");Ee&&te&&H&&H.includes("drawing")&&(j[Ee]="xl/drawings/"+te.replace("../drawings/",""))}}let U=L.content.toString().match(/<drawing r:id="(.*?)"/g);if(U)for(let B of U){let ee=B.match(/r:id="(.*?)"/),fe=ee?ee[1]:null;if(fe&&j[fe]){let Ee=j[fe],te=E[Ee];if(te)for(let ae in te){let we=te[ae],xe=v.find(V=>V.name===we.path.split("/").pop());if(xe){let V={type:"image",text:"",children:[],metadata:{attachmentName:xe.name||"unknown",altText:we.altText||void 0}};$.push(V)}}let H=_[Ee];if(H)for(let ae in H){let we=H[ae];if(v.find(V=>V.name===we)){let V={type:"chart",text:"",children:[],metadata:{attachmentName:we}};$.push(V)}}}}}let re=L.path.split("/").pop()||"Sheet",O=S[re]||re;I.push({type:"sheet",children:$,metadata:{sheetName:O},rawContent:e.includeRawContent?L.content.toString():void 0})}let Q=f.find(L=>L.path.match(a)),Z=Q?jl(Q.content.toString()):{},ne=L=>{for(let $ of L){if("attachmentName"in($.metadata||{})){let X=$.metadata,ie=v.find(re=>re.name===X.attachmentName);ie&&($.type==="image"&&(ie.ocrText&&($.text=ie.ocrText),X.altText&&(ie.altText=X.altText)),$.type==="chart"&&ie.chartData&&($.text=ie.chartData.rawTexts.join(e.newlineDelimiter||`
108
+ `)))}$.children&&ne($.children)}};return ne(I),{type:"xlsx",metadata:Z,content:I,attachments:v,toText:()=>I.map(L=>{let $=X=>{let ie="";return X.children?ie+=X.children.map($).filter(re=>re!="").join(X.children[0]?.children?e.newlineDelimiter??`
109
+ `:""):ie+=X.text||"",ie};return $(L)}).filter(L=>L!="").join(e.newlineDelimiter??`
110
+ `)}};Se();Ce();Te();var XM=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 Xl(r,X=>!!X.match(t)||!!X.match(n)||!!X.match(o)||!!X.match(s)||!!X.match(a)||!!e.extractAttachments&&!!X.match(i)),c=u.find(X=>X.path==="mimetype"),f="odt";if(c){let X=c.content.toString().trim();X.includes("spreadsheet")?f="ods":X.includes("presentation")?f="odp":X.includes("text")&&(f="odt")}let h=u.find(X=>X.path==="content.xml")||u.find(X=>X.path.match(t)),d=u.find(X=>X.path==="styles.xml"),g=[],y=[],v={},w={},b={};d&&(X=>{let ie=qt(X),re=Le(ie,"style:style");for(let O of re){let x=O.getAttribute("style:name");if(!x)continue;let P={},C=Le(O,"style:paragraph-properties")[0];if(C){let ee=C.getAttribute("fo:text-align");if(ee){let Ee={start:"left",left:"left",center:"center",end:"right",right:"right",justify:"justify"};Ee[ee]&&(P.alignment=Ee[ee])}Le(C,"style:drop-cap")[0]&&(P.dropCap=!0)}Object.keys(P).length>0&&(w[x]=P);let j=Le(O,"style:text-properties")[0],U=Le(O,"style:table-cell-properties")[0],B={};if(U){let ee=U.getAttribute("fo:background-color");ee&&ee!=="transparent"&&(B.backgroundColor=ee)}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 ee=j.getAttribute("fo:font-size")||j.getAttribute("style:font-size-asian");ee&&(B.size=ee);let fe=j.getAttribute("fo:color");fe&&(B.color=fe);let Ee=j.getAttribute("fo:background-color");Ee&&Ee!=="transparent"&&(B.backgroundColor=Ee);let te=j.getAttribute("style:font-name")||j.getAttribute("fo:font-family");te&&(B.font=te);let H=j.getAttribute("style:text-position");H&&(H.startsWith("sub")&&(B.subscript=!0),H.startsWith("super")&&(B.superscript=!0)),Object.keys(B).length>0&&(v[x]=B)}}})(d.content.toString());let _=(X,ie,re,O,x,P={},C)=>{let j=[],U="";if(!X.childNodes)return{text:"",children:[]};for(let B=0;B<X.childNodes.length;B++){let ee=X.childNodes[B];if(ee.nodeType===3){let fe=ee.textContent||"";fe&&(U+=fe,j.push({type:"text",text:fe,formatting:P,metadata:C?{...C}:void 0}))}else if(ee.nodeType===1){let fe=ee,Ee=fe.tagName;if(Ee==="text:s"){let te=parseInt(fe.getAttribute("text:c")||"1"),H=" ".repeat(te);U+=H,j.push({type:"text",text:H,formatting:P,metadata:C?{...C}:void 0})}else if(Ee==="text:tab")U+=" ",j.push({type:"text",text:" ",formatting:P,metadata:C?{...C}:void 0});else if(Ee==="text:line-break")U+=`
111
+ `,j.push({type:"text",text:`
112
+ `,formatting:P,metadata:C?{...C}:void 0});else if(Ee==="text:span"){let te=fe.getAttribute("text:style-name"),H=te?{...P,...ie[te]}:P,ae=_(fe,ie,re,O,x,H,C);U+=ae.text,j.push(...ae.children)}else if(Ee==="text:a"){let te=fe.getAttribute("xlink:href")||"",H=te.startsWith("#")?"internal":"external",we=_(fe,ie,re,O,x,P,{link:te,linkType:H});U+=we.text,j.push(...we.children)}else if(Ee==="text:note"&&!re.ignoreNotes){let te=fe.getAttribute("text:note-class")||"footnote",H=fe.getAttribute("text:id")||fe.getAttribute("xml:id")||void 0,ae=Le(fe,"text:note-body")[0];if(ae){let we=Le(ae,"text:p"),xe=[],V="";for(let oe of we){let ge=S(oe,x,ie,re);V+=(V?" ":"")+ge.text;let Re={type:"paragraph",text:ge.text,children:ge.children,metadata:ge.alignment?{alignment:ge.alignment}:void 0};xe.push(Re)}let F={type:"note",text:V,children:xe,metadata:{noteType:te,noteId:H}};re.putNotesAtLast?O.push(F):j.push(F)}}else if(Ee==="draw:frame"){let te=fe,H="",ae=Le(te,"svg:title")[0],we=Le(te,"svg:desc")[0];ae&&ae.textContent?H=ae.textContent:we&&we.textContent&&(H=we.textContent);let xe="",V=Le(te,"draw:image");if(V.length>0&&(xe=V[0].getAttribute("xlink:href")||"",xe)){let oe=xe.split("/");xe=oe[oe.length-1]}let F={type:"image",text:"",children:[],metadata:{attachmentName:xe,...H?{altText:H}:{}}};re.includeRawContent&&(F.rawContent=te.toString()),j.push(F)}}}return{text:U,children:j}},S=(X,ie,re,O)=>{let x=X.getAttribute("text:style-name"),P=x?ie[x]:void 0,C=P?.alignment,j=P?.dropCap,U=_(X,re,O,y,ie);if(x&&U.children.forEach(B=>{if(B.type==="text"){B.metadata||(B.metadata={});let ee=B.metadata;ee.style||(ee.style=x)}}),U.children.length===0&&X.textContent){let B=X.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 ee=B.text[0],fe=B.text.substring(1),Ee={type:"text",text:ee,formatting:{...B.formatting,size:"58.5pt"},metadata:B.metadata};B.text=fe,U.children.unshift(Ee)}}return{text:U.text,children:U.children,alignment:C,style:x||void 0}},A=(X,ie,re,O)=>{let x=[],P=Rn(X,"table:table-row"),C=0;for(let j of P){let U=[],B=Rn(j,"table:table-cell"),ee=parseInt(j.getAttribute("table:number-rows-repeated")||"1"),fe=0;for(let Ee of B){let te=[],H={value:""},ae=parseInt(Ee.getAttribute("table:number-columns-repeated")||"1"),we=parseInt(Ee.getAttribute("table:number-columns-spanned")||"1"),xe=parseInt(Ee.getAttribute("table:number-rows-spanned")||"1"),V=oe=>{if(oe.childNodes)for(let ge=0;ge<oe.childNodes.length;ge++){let Re=oe.childNodes[ge];if(Re.nodeType===1){let be=Re;if(be.tagName==="text:p"||be.tagName==="text:h"){let pe=S(be,ie,re,O),Ae={type:be.tagName==="text:h"?"heading":"paragraph",text:pe.text,children:pe.children,metadata:{...pe.alignment?{alignment:pe.alignment}:{},...pe.style?{style:pe.style}:{}}};Object.keys(Ae.metadata||{}).length===0&&delete Ae.metadata,be.tagName==="text:h"&&(Ae.metadata||(Ae.metadata={}),Ae.metadata.level=parseInt(be.getAttribute("text:outline-level")||"1")),O.includeRawContent&&(Ae.rawContent=be.toString()),te.push(Ae),H.value+=pe.text,H.value&&!H.value.endsWith(`
113
+ `)&&(H.value+=`
114
+ `)}else if(be.tagName==="table:table"){let pe=A(be,ie,re,O);te.push(pe)}else(be.tagName==="draw:frame"||be.tagName==="draw:text-box")&&V(be)}}};V(Ee);let F=H.value;F.endsWith(`
115
+ `)&&(F=F.slice(0,-1));for(let oe=0;oe<ae;oe++){let ge={type:"cell",text:F,children:te.length>0?oe===0?te:JSON.parse(JSON.stringify(te)):[],metadata:{row:C,col:fe}},Re=ge.metadata;we>1&&(Re.colSpan=we),xe>1&&(Re.rowSpan=xe),O.includeRawContent&&(ge.rawContent=Ee.toString()),U.push(ge),fe++}}for(let Ee=0;Ee<ee;Ee++){let te={type:"row",children:Ee===0?U:JSON.parse(JSON.stringify(U))};Ee>0&&te.children?.forEach(H=>{H.metadata&&"row"in H.metadata&&(H.metadata.row=C)}),O.includeRawContent&&(te.rawContent=j.toString()),x.push(te),C++}}return{type:"table",children:x}};h&&(X=>{let ie=qt(X),re=Le(ie,"office:body")[0],O=Le(ie,"office:automatic-styles")[0];if(O){let P=Le(O,"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 ee=Le(C,"style:text-properties")[0];if(ee){let fe={};(ee.getAttribute("fo:font-weight")==="bold"||ee.getAttribute("style:font-weight-asian")==="bold")&&(fe.bold=!0),(ee.getAttribute("fo:font-style")==="italic"||ee.getAttribute("style:font-style-asian")==="italic")&&(fe.italic=!0),ee.getAttribute("style:text-underline-style")==="solid"&&(fe.underline=!0),ee.getAttribute("style:text-line-through-style")==="solid"&&(fe.strikethrough=!0);let Ee=ee.getAttribute("fo:font-size")||ee.getAttribute("style:font-size-asian");Ee&&(fe.size=Ee);let te=ee.getAttribute("fo:color");te&&(fe.color=te);let H=ee.getAttribute("fo:background-color");H&&H!=="transparent"&&(fe.backgroundColor=H);let ae=ee.getAttribute("style:font-name")||ee.getAttribute("fo:font-family");ae&&(fe.font=ae);let we=ee.getAttribute("style:text-position");we&&(we.startsWith("sub")&&(fe.subscript=!0),we.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",ee={type:B,text:U.text,children:U.children,metadata:{...U.alignment?{alignment:U.alignment}:{},...U.style?{style:U.style}:{}}};B==="heading"&&ee.metadata&&(ee.metadata.level=ee.metadata.level||1),Object.keys(ee.metadata||{}).length===0&&delete ee.metadata,e.includeRawContent&&(ee.rawContent=P.toString()),C.push(ee)}else if(P.tagName==="text:h"){let U=parseInt(P.getAttribute("text:outline-level")||"1"),B=S(P,w,v,e),ee={type:"heading",text:B.text,children:B.children,metadata:{level:U,...B.alignment?{alignment:B.alignment}:{},...B.style?{style:B.style}:{}}};e.includeRawContent&&(ee.rawContent=P.toString()),C.push(ee)}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=Rn(P,"text:list-item"),B=P.getAttribute("text:style-name")||P.getAttribute("xml:id"),ee=B||`list-${C.length}`,fe="unordered",Ee=!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(qt(h?.content.toString()||""),"office:automatic-styles")[0];if(xe){let V=Le(xe,"text:list-style");for(let F of V)if(F.getAttribute("style:name")===te){let oe=Le(F,"text:list-level-style-bullet"),ge=Le(F,"text:list-level-style-number"),Re=Le(F,"text:list-level-style-image");ge.length>0?(fe="ordered",Ee=ge.some(be=>!!be.getAttribute("style:num-format"))):oe.length>0&&(fe="unordered",Ee=oe.some(be=>!!be.getAttribute("text:bullet-char"))),Re.length>0&&(Ee=!0);break}}if(d&&!Ee){let V=qt(d.content.toString()),F=Le(V,"text:list-style");for(let oe of F)if(oe.getAttribute("style:name")===te){let ge=Le(oe,"text:list-level-style-bullet"),Re=Le(oe,"text:list-level-style-number"),be=Le(oe,"text:list-level-style-image");Re.length>0?(fe="ordered",Ee=Re.some(pe=>!!pe.getAttribute("style:num-format"))):ge.length>0&&(fe="unordered",Ee=ge.some(pe=>!!pe.getAttribute("text:bullet-char"))),be.length>0&&(Ee=!0);break}}}if(!Ee){for(let xe=0;xe<U.length;xe++){let V=U[xe];if(V.childNodes)for(let F=0;F<V.childNodes.length;F++){let oe=V.childNodes[F];oe.nodeType===1&&x(oe,C,j)}}return}let H=0,ae=P.parentNode;for(;ae;)ae.nodeName==="text:list"&&H++,ae=ae.parentNode;b[ee]||(b[ee]={});let we=H.toString();b[ee][we]===void 0&&(b[ee][we]=-1);for(let xe=0;xe<U.length;xe++){let V=U[xe];b[ee][we]++;let F=b[ee][we];for(let oe=H+1;oe<10;oe++)b[ee][oe.toString()]!==void 0&&(b[ee][oe.toString()]=-1);if(V.childNodes)for(let oe=0;oe<V.childNodes.length;oe++){let ge=V.childNodes[oe];if(ge.nodeType===1){let Re=ge;if(Re.tagName==="text:p"){let be=S(Re,w,v,e),pe={type:"list",text:be.text,children:be.children,metadata:{listType:fe,indentation:H,itemIndex:F,listId:ee,alignment:be.alignment||"left",style:be.style}};e.includeRawContent&&(pe.rawContent=Re.toString()),C.push(pe)}else if(Re.tagName==="text:h"){let be=parseInt(Re.getAttribute("text:outline-level")||"1"),pe=S(Re,w,v,e),Ae={type:"list",text:pe.text,children:pe.children,metadata:{listType:fe,indentation:H,itemIndex:F,listId:ee,...pe.alignment?{alignment:pe.alignment}:{},style:pe.style}};e.includeRawContent&&(Ae.rawContent=Re.toString()),C.push(Ae)}else Re.tagName==="text:list"&&x(Re,C,j)}}}}else if(P.tagName==="draw:frame"){let U=P.getAttribute("presentation:class"),B=U==="title"||U==="sub-title",ee=Le(P,"draw:text-box")[0],fe=Le(P,"draw:image")[0],Ee=Le(P,"table:table")[0],te=Le(P,"draw:object")[0];if(ee)x(ee,C,B||j);else if(Ee){let H=A(Ee,w,v,e);e.includeRawContent&&(H.rawContent=Ee.toString()),C.push(H)}else if(fe){let H="",ae=Le(P,"svg:title")[0],we=Le(P,"svg:desc")[0];ae&&ae.textContent?H=ae.textContent:we&&we.textContent&&(H=we.textContent);let xe=fe.getAttribute("xlink:href")||"";if(xe){let F=xe.split("/");xe=F[F.length-1]}let V={type:"image",text:"",children:[],metadata:{attachmentName:xe,...H?{altText:H}:{}}};e.includeRawContent&&(V.rawContent=P.toString()),C.push(V)}else if(te){let H=te.getAttribute("xlink:href");if(H){let ae=H.split("/")[0],we=`${ae}/content.xml`,xe=u.find(V=>V.path===we||V.path.endsWith(we));if(xe){let V=wc(xe.content),F={type:"chart",text:V.rawTexts.join(" "),metadata:{attachmentName:ae,chartData:V}};e.includeRawContent&&(F.rawContent=P.toString()),C.push(F)}else{let V={type:"chart",text:"",metadata:{attachmentName:ae}};e.includeRawContent&&(V.rawContent=P.toString()),C.push(V)}}}}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}`,ee=[],fe=Le(U,"table:table-row"),Ee=0;for(let H=0;H<fe.length;H++){let ae=fe[H],we=[],xe=Le(ae,"table:table-cell"),V=0,F=parseInt(ae.getAttribute("table:number-rows-repeated")||"1");for(let oe=0;oe<xe.length;oe++){let ge=xe[oe],Re=parseInt(ge.getAttribute("table:number-columns-repeated")||"1"),be="",pe=[],Ae=Le(ge,"text:p");for(let Oe=0;Oe<Ae.length;Oe++){let ke=Ae[Oe],Ke=Le(ke,"text:span");if(Ke.length>0)for(let tt of Ke){let it=tt.getAttribute("text:style-name"),T=it?v[it]:{},m=tt.textContent||"";be+=m;let p={type:"text",text:m,formatting:T};pe.push(p)}else{let tt=ke.textContent||"";if(be+=tt,tt.trim()){let it={type:"text",text:tt,formatting:{}};pe.push(it)}}Oe<Ae.length-1&&(be+=`
116
+ `)}let ze=Le(ge,"draw:frame");for(let Oe of ze){let ke="",Ke=Le(Oe,"svg:title")[0],tt=Le(Oe,"svg:desc")[0];Ke&&Ke.textContent?ke=Ke.textContent:tt&&tt.textContent&&(ke=tt.textContent);let it="",T=Le(Oe,"draw:image");if(T.length>0){let R=T[0].getAttribute("xlink:href");if(R){let J=R.split("/");it=J[J.length-1]}}let m="",p=Le(Oe,"draw:object");if(p.length>0){let R=p[0].getAttribute("xlink:href");R&&(m=R.split("/")[0])}if(T.length>0){let R={type:"image",text:"",children:[],metadata:{attachmentName:it,...ke?{altText:ke}:{}}};e.includeRawContent&&(R.rawContent=Oe.toString()),pe.push(R)}else if(m){let R={type:"chart",text:"",children:[],metadata:{attachmentName:m}};pe.push(R)}}for(let Oe=0;Oe<Re;Oe++){if(be||pe.length>0||f!=="ods"){let ke={type:"cell",text:be,children:pe,metadata:{row:Ee,col:V}};e.includeRawContent&&(ke.rawContent=ge.toString()),we.push(ke)}V++}}if(we.length>0)for(let oe=0;oe<F;oe++){let ge={type:"row",children:JSON.parse(JSON.stringify(we)),metadata:void 0};oe>0&&ge.children?.forEach(Re=>{Re.metadata&&"row"in Re.metadata&&(Re.metadata.row=Ee)}),e.includeRawContent&&(ge.rawContent=ae.toString()),ee.push(ge),Ee++}else Ee+=F}let te={type:"sheet",children:ee,metadata:{sheetName:B}};e.includeRawContent&&(te.rawContent=U.toString()),g.push(te)}}}else if(f==="odp"){let P=Le(re,"office:presentation")[0];if(P){let C=Rn(P,"draw:page"),j=[];for(let U=0;U<C.length;U++){let B=C[U],ee={type:"slide",children:[],metadata:{slideNumber:U+1}},fe,Ee=B.childNodes;if(Ee)for(let te=0;te<Ee.length;te++){let H=Ee[te];if(H.nodeType===1){let ae=H;if(ae.tagName==="presentation:notes"){e.ignoreNotes||(fe={type:"note",children:[],metadata:{slideNumber:U+1,noteId:`slide-note-${U+1}`}},x(ae,fe.children));continue}x(ae,ee.children)}}e.includeRawContent&&(ee.rawContent=B.toString()),g.push(ee),fe&&fe.children&&fe.children.length>0&&(e.putNotesAtLast?j.push(fe):g.push(fe))}j.length>0&&g.push(...j)}}else{let P=Le(re,"office:text")[0];P&&x(P,g)}})(h.content.toString());let I=[],q=u.filter(X=>X.path.match(/(Pictures|media)\/.*/));if(e.extractAttachments){let X=u.filter(ie=>ie.path.match(/Object \d+\/content\.xml/));for(let ie of X){let re=qt(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=wc(ie.content);C.rawTexts.length>0&&(P.chartData=C),I.push(P)}}}if(e.extractAttachments)for(let X of q){let ie=qs(X.path.split("/").pop()||"image",X.content);if(I.push(ie),e.ocr&&ie.mimeType.startsWith("image/"))try{ie.ocrText=(await ms(X.content,e.ocrLanguage)).trim()}catch(re){yi(`OCR failed for ${ie.name}:`,e,re)}}let Q=u.find(X=>X.path.match(o)),Z=Q?jl(Q.content.toString()):{},ne=(X,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,""),ee=C.substring(U+1).replace(/\$/g,""),fe=ee;if(j)if(j.startsWith("."))fe=j.substring(1).replace(/\$/g,"");else{let xe=j.lastIndexOf(".");fe=j.substring(xe+1).replace(/\$/g,"")}let Ee=xe=>{let V=xe.match(/[A-Z]+/),F=xe.match(/\d+/);if(!V||!F)return null;let oe=V[0],ge=0;for(let be=0;be<oe.length;be++)ge=ge*26+(oe.charCodeAt(be)-65+1);return ge-=1,{r:parseInt(F[0])-1,c:ge}},te=Ee(ee),H=Ee(fe);if(!te||!H)return[x];let ae=ie.find(xe=>xe.type==="sheet"&&xe.metadata?.sheetName===B);if(!ae||!ae.children)return[x];let we=[];for(let xe of ae.children)if(xe.children)for(let V of xe.children){let F=V.metadata;F&&F.row>=te.r&&F.row<=H.r&&F.col>=te.c&&F.col<=H.c&&we.push(V.text||"")}return we.length>0?we:[]};for(let x of X.dataSets){let P=[];for(let C of x.values)C.startsWith("[")?P.push(...re(C)):P.push(C);x.values=P}let O=[];for(let x of X.labels)x.startsWith("[")?O.push(...re(x)):O.push(x);X.labels=O,X.rawTexts=[],X.title&&X.rawTexts.push(X.title);for(let x of X.dataSets)x.name&&X.rawTexts.push(x.name),X.rawTexts.push(...X.labels),X.rawTexts.push(...x.values)};for(let X of I)X.type==="chart"&&X.chartData&&ne(X.chartData,g);(X=>{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(X);let O=I.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<O.length&&(j=O[x++].name,C.metadata.attachmentName=j),j){let U=I.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??`
117
+ `)))}}C.children&&C.children.forEach(P)};X.forEach(P)})(g);let $={};for(let X in v)$[X]={formatting:v[X],alignment:w[X]?.alignment};for(let X in w)$[X]||($[X]={formatting:{},alignment:w[X]?.alignment});return e.putNotesAtLast&&y.length>0&&g.push(...y),{type:f,metadata:{...Z,styleMap:$},content:g,attachments:I,toText:()=>g.map(X=>{let ie=re=>{let O="";if(re.children&&re.children.length>0){let P=re.children.some(C=>C.children&&C.children.length>0)?e.newlineDelimiter??`
118
+ `:"";O+=re.children.map(ie).filter(C=>C!="").join(P)}else O+=re.text||"";return O};return ie(X)}).filter(X=>X!="").join(e.newlineDelimiter??`
119
+ `)}};Se();Ce();Te();Se();Ce();Te();async function BC(r){return new Function("s","return import(s)")(r)}async function N8(){return typeof window>"u"?BC("file-type"):Promise.resolve().then(()=>(KB(),ZB))}async function O8(){if(typeof window>"u")try{return await BC("pdfjs-dist/legacy/build/pdf.mjs")}catch{return await BC("pdfjs-dist")}return Promise.resolve().then(()=>(k8(),I8))}function L8(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,d=c*(f*60+h),g=Date.UTC(t,n,i,o,s,a);return new Date(g-d*6e4)}return new Date(t,n,i,o,s,a)}catch{try{return new Date(r)}catch{return}}}function uZ(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 cZ(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 fZ(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),d=Math.max(s,u);if(t>=c&&t<=f&&n>=h&&n<=d)return i}}function hZ(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=We.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 d=(f*r+h)*4,g=t[d+0],y=t[d+1],v=t[d+2],b=t[d+3]/255,E=Math.round(g*b+255*(1-b)),_=Math.round(y*b+255*(1-b)),S=Math.round(v*b+255*(1-b));u[c+0]=S,u[c+1]=_,u[c+2]=E,c+=3}for(let h=0;h<i;h++)u[c]=0,c++}return u}function dZ(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 We.from(i.buffer,i.byteOffset,i.byteLength)}var P8=async(r,e)=>{let t=await O8();if(e.pdfWorkerSrc)t.GlobalWorkerOptions.workerSrc=e.pdfWorkerSrc;else if(typeof window<"u")t.GlobalWorkerOptions.workerSrc=`https://unpkg.com/pdfjs-dist@${t.version}/build/pdf.worker.min.mjs`;else try{let y=Zu.resolve("pdfjs-dist/legacy/build/pdf.worker.mjs");t.GlobalWorkerOptions.workerSrc=y}catch(y){e.outputErrorToConsole&&console.warn("[PdfParser] Could not auto-resolve local worker path:",y)}let n=new Uint8Array(r),i=t.getDocument({data:n,verbosity:0}),o;try{o=await i.promise}catch(y){throw y.message?.includes("workerSrc")||y.message?.includes('No "GlobalWorkerOptions.workerSrc" specified')?Aa("PDF_WORKER_MISSING",e):y}let s=[],a=[],u=o.numPages,c=[],h=(await o.getMetadata().catch(()=>({info:{}}))).info,d={pages:u,title:h?.Title||void 0,author:h?.Author||void 0,subject:h?.Subject||void 0,description:h?.Keywords||void 0,created:L8(h?.CreationDate),modified:L8(h?.ModDate)};try{let y=await o.getAttachments();if(y&&e.extractAttachments)for(let v in y){let w=y[v],b=We.from(w.content),E=qs(w.filename,b);a.push(E)}}catch(y){e.outputErrorToConsole&&console.error("Error extracting embedded attachments:",y)}for(let y=1;y<=u;y++){let v,w,b=[];try{v=await o.getPage(y),w=await v.getTextContent()}catch(_){e.outputErrorToConsole&&console.warn(`[PdfParser] Error loading page ${y}:`,_),c.push(b);continue}let E=v.commonObjs;for(let _ of w.items){let S=_.transform,A=S[4],M=S[5],I=_.width||0,q=_.height||Math.abs(S[3])||12,Q={},Z;if(_.fontName&&E)try{if(E.has(_.fontName)){let ne=await new Promise(L=>{E.get(_.fontName,$=>L($))});if(ne?.name){Z=ne.name.replace(/^[A-Z]{6}\+/,""),Q.font=Z;let L=ne.name.toLowerCase();L.includes("bold")&&(Q.bold=!0),(L.includes("italic")||L.includes("oblique"))&&(Q.italic=!0)}}}catch{}q>0&&(Q.size=Math.round(q).toString()),b.push({type:"text",x:A,y:M,width:I,height:q,text:_.str,fontName:Z,formatting:Q})}if(e.extractAttachments||e.ocr)try{let _=await v.getOperatorList(),S=_.fnArray,A=_.argsArray;for(let M=0;M<S.length;M++){let I=S[M];if(I===t.OPS.dependency){let q=A[M];for(let Q of q)try{if(v.objs.has(Q))continue;await new Promise(Z=>{let ne=setTimeout(()=>{Z()},500);v.objs.get(Q,L=>{clearTimeout(ne),Z()})})}catch(Z){e.outputErrorToConsole&&console.error(`[PdfParser] Failed to load dependency ${Q}:`,Z)}}if(I===t.OPS.paintImageXObject||I===t.OPS.paintXObject){let q=A[M][0];try{let Q=v.objs.has(q),Z=v.objs;if(!Q&&v.commonObjs.has(q)&&(Q=!0,Z=v.commonObjs),Q){let L=await new Promise($=>{Z.get(q,X=>$(X))});if(typeof window<"u"&&!L.data&&L.bitmap)try{let $=document.createElement("canvas");$.width=L.width,$.height=L.height;let X=$.getContext("2d");X&&(X.drawImage(L.bitmap,0,0),L.data=X.getImageData(0,0,L.width,L.height).data,L.kind=3)}catch($){e.outputErrorToConsole&&console.error("[PdfParser] Failed to extract from ImageBitmap:",$)}if(L?.data&&L.width>0&&L.height>0){let $=0,X=0;for(let ie=M-1;ie>=0;ie--)if(S[ie]===t.OPS.transform){$=A[ie][4],X=A[ie][5];break}b.push({type:"image",x:$,y:X,name:q,data:L.data,width:L.width,height:L.height,kind:L.kind})}}}catch{}}}}catch(_){e.outputErrorToConsole&&console.error(`Error extracting images from page ${y}:`,_)}c.push(b)}let g=uZ(c);for(let y=0;y<c.length;y++){let v=y+1,w;try{w=await o.getPage(v)}catch(q){e.outputErrorToConsole&&console.warn(`[PdfParser] Error loading page ${v} in second pass:`,q);continue}let b=c[y],E=[],_=[];try{let q=await w.getAnnotations();for(let Q of q)Q.subtype==="Link"&&Q.rect&&_.push({rect:Q.rect,url:Q.url,dest:Q.dest})}catch(q){e.outputErrorToConsole&&console.error(`Error extracting annotations from page ${v}:`,q)}b.sort((q,Q)=>Math.abs(Q.y-q.y)>5?Q.y-q.y:q.x-Q.x);let S=null,A=0,M=-1,I=0;for(let q of b)if(q.type==="text"){let Q=q.text;if(!Q)continue;if(M!==-1&&Math.abs(q.y-M)>5&&S&&((S.text||"").trim().length>0&&E.push(S),S=null),!S&&Q.trim().length===0){M=q.y;continue}let ne=cZ(q.height,g);if(S||(ne>0?S={type:"heading",text:"",children:[],metadata:{level:ne}}:S={type:"paragraph",text:"",children:[]},A=q.height),Q.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+=Q,S.text+=Q)}M=q.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+=Q;let L=fZ(q,_),$;L&&(L.url?$={link:L.url,linkType:L.url.startsWith("#")?"internal":"external"}:L.dest&&($={link:typeof L.dest=="string"?`#${L.dest}`:"#internal",linkType:"internal"}));let X=!1;if(S.children&&S.children.length>0&&!$){let ie=S.children[S.children.length-1];ie.type==="text"&&pZ(ie.formatting,q.formatting)&&!ie.metadata&&(ie.text=(ie.text||"")+Q,X=!0)}if(!X){let ie={type:"text",text:Q,formatting:Object.keys(q.formatting).length>0?q.formatting:void 0};$&&(ie.metadata=$),S.children?.push(ie)}M=q.y}else if(q.type==="image"){S&&((S.text||"").trim().length>0&&E.push(S),S=null),I++;let Q=`pdf_image_p${v}_${I}.bmp`;if(e.extractAttachments)try{let Z=dZ(q.data,q.width,q.height,q.kind),ne=hZ(q.width,q.height,new Uint8Array(Z)),L=qs(Q,ne);if(L.mimeType="image/bmp",e.ocr)try{q.width>=10&&q.height>=10&&(L.ocrText=(await ms(ne,e.ocrLanguage)).trim())}catch(X){e.outputErrorToConsole&&console.error(`OCR failed for ${Q}:`,X)}a.push(L);let $={attachmentName:Q};E.push({type:"image",text:L.ocrText||"",metadata:{...$}})}catch(Z){yi(`Failed to process image ${Q}:`,e,Z)}}S&&(S.text||"").trim().length>0&&E.push(S),s.push({type:"page",children:E,text:E.map(q=>q.text).join(e.newlineDelimiter??`
120
+
121
+ `),metadata:{pageNumber:v}})}return{type:"pdf",metadata:d,content:s,attachments:a,toText:()=>s.map(y=>y.text).join(e.newlineDelimiter??`
122
+
123
+ `)}};function pZ(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}Se();Ce();Te();var F8=Rl(gw());var M8=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 F8.XMLSerializer,f=await Xl(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)),d=h?jl(h.content.toString()):{};f.sort((ie,re)=>{let O=ie.path.match(o),x=re.path.match(o),P=O?parseInt(O[1]):0,C=x?parseInt(x[1]):0;return P-C});let g=[],y=[],v={},w=0,b=0,E=!1,_=null,S=0,A={},M=ie=>{let re=[],O=Le(ie,"a:tr");for(let x=0;x<O.length;x++){let P=O[x],C=[],j=Le(P,"a:tc");for(let B=0;B<j.length;B++){let ee=j[B],fe=[],Ee="",te=Le(ee,"a:txBody")[0];if(te){let ae=Le(te,"a:p");for(let we of ae){let xe={type:"paragraph",text:"",children:[],metadata:{}};e.includeRawContent&&(xe.rawContent=we.toString());let V=Le(we,"a:r");for(let F of V){let oe=Le(F,"a:t")[0];if(oe&&oe.childNodes[0]){let ge=oe.childNodes[0].nodeValue||"";xe.text+=ge;let Re=Le(F,"a:rPr")[0],be={};if(Re){Re.getAttribute("b")==="1"&&(be.bold=!0),Re.getAttribute("i")==="1"&&(be.italic=!0),Re.getAttribute("u")==="sng"&&(be.underline=!0),Re.getAttribute("strike")==="sngStrike"&&(be.strikethrough=!0);let pe=Re.getAttribute("sz");pe&&(be.size=(parseInt(pe)/100).toString()+"pt");let Ae=Le(Re,"a:solidFill")[0];if(Ae){let Oe=Le(Ae,"a:srgbClr")[0];if(Oe){let ke=Oe.getAttribute("val");ke&&(be.color="#"+ke)}}let ze=Le(Re,"a:latin")[0];if(ze){let Oe=ze.getAttribute("typeface");Oe&&(be.font=Oe)}}xe.children?.push({type:"text",text:ge,formatting:be})}}fe.push(xe),Ee+=xe.text}}let H={type:"cell",text:Ee,children:fe,metadata:{row:x,col:B}};C.push(H)}let U={type:"row",children:C};re.push(U)}return{type:"table",children:re}},I=(ie,re)=>{let O=Le(ie,"a:blip")[0];if(!O)return null;let x=O.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}}},q=(ie,re)=>{let O=Le(ie,"a:graphicData")[0];if(!O||!(O.getAttribute("uri")==="http://schemas.openxmlformats.org/drawingml/2006/chart"))return null;let C=Le(O,"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 ee={type:"chart",text:"",metadata:{attachmentName:U.target}};return e.includeRawContent&&(ee.rawContent=c.serializeToString(ie)),ee},Q=(ie,re)=>{let O=Le(ie,"a:tbl")[0];if(O){let x=M(O);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=q(ie,re);if(x)return x}return null},Z=(ie,re)=>{let O=[],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 ee=Le(B,"a:p");for(let fe=0;fe<ee.length;fe++){let Ee=ee[fe],te={type:U?"heading":"paragraph",text:"",children:[],metadata:U?{level:1}:{}},H=Le(Ee,"a:pPr")[0],ae=!1,we="unordered",xe=0;if(H){let F=H.getAttribute("lvl");F&&(xe=parseInt(F));let oe=Le(H,"a:buAutoNum")[0],ge=Le(H,"a:buChar")[0],Re=Le(H,"a:buBlip")[0],be=Le(H,"a:bu")[0];oe?(ae=!0,we="ordered"):(ge||Re||be)&&(ae=!0,we="unordered");let pe=H.getAttribute("algn");if(pe){let Ae={l:"left",ctr:"center",r:"right",just:"justify"};Ae[pe]&&(te.metadata.alignment=Ae[pe])}}if(ae){te.type="list";let F=xe;if(!E||we!==_){w++;for(let ge in A)delete A[ge];b=0,A[F]=0}else if(F>S)b=0,A[F]=0;else if(F<S){for(let Re in A){let be=parseInt(Re);be>F&&delete A[be]}b=(A[F]||0)+1,A[F]=b}else b=(A[F]||0)+1,A[F]=b;E=!0,_=we,S=F,te.metadata={...te.metadata,listType:we,indentation:F,listId:w.toString(),itemIndex:b,alignment:te.metadata?.alignment||"left"}}else E=!1,_=null,S=0;U&&(te.metadata={...te.metadata,level:1}),e.includeRawContent&&(te.rawContent=Ee.toString());let V=Le(Ee,"a:r");for(let F=0;F<V.length;F++){let oe=V[F],ge=Le(oe,"a:t")[0];if(ge&&ge.childNodes[0]){let Re=ge.childNodes[0].nodeValue||"";te.text+=Re;let be=Le(oe,"a:rPr")[0],pe={};if(be){be.getAttribute("b")==="1"&&(pe.bold=!0),be.getAttribute("i")==="1"&&(pe.italic=!0),be.getAttribute("u")==="sng"&&(pe.underline=!0),be.getAttribute("strike")==="sngStrike"&&(pe.strikethrough=!0);let Oe=be.getAttribute("sz");Oe&&(pe.size=(parseInt(Oe)/100).toString()+"pt");let ke=Le(be,"a:solidFill")[0];if(ke){let T=Le(ke,"a:srgbClr")[0];if(T){let m=T.getAttribute("val");m&&(pe.color="#"+m)}}let Ke=Le(be,"a:highlight")[0];if(Ke){let T=Le(Ke,"a:srgbClr")[0];if(T){let m=T.getAttribute("val");m&&(pe.backgroundColor="#"+m)}}let tt=Le(be,"a:latin")[0];if(tt){let T=tt.getAttribute("typeface");T&&(pe.font=T)}let it=be.getAttribute("baseline");if(it){let T=parseInt(it);T<0&&(pe.subscript=!0),T>0&&(pe.superscript=!0)}}let Ae={type:"text",text:Re,formatting:pe},ze=Le(oe,"a:hlinkClick")[0];if(ze){let Oe=ze.getAttribute("r:id"),ke=ze.getAttribute("action"),Ke,tt;Oe&&v[re]&&v[re][Oe]&&v[re][Oe].type==="hyperlink"?(Ke=v[re][Oe].target,tt="external"):Oe&&v[re]&&v[re][Oe]&&v[re][Oe].type==="slide"?(Ke=v[re][Oe].target,tt="internal"):ke&&(Ke=ke,tt="internal"),Ke&&(Ae.metadata={link:Ke,linkType:tt})}te.children?.push(Ae)}}te.text&&O.push(te)}}return O};function ne(ie,re){let O=[];for(let x of Array.from(ie?.childNodes||[])){if(x.nodeType!==1)continue;let P=x,C=P.tagName;if(C==="p:sp")O.push(...Z(P,re));else if(C==="p:pic"){let j=I(P,re);j&&O.push(j)}else if(C==="p:graphicFrame"){let j=Q(P,re);j&&O.push(j)}else if(C==="p:grpSp"){let j=P.getElementsByTagName("p:spTree")[0];O.push(...ne(j,re))}}return O}for(let ie of f)if(ie.path.match(i)){let re=ie.path.match(/slide(\d+)\.xml\.rels/);if(re){let O=parseInt(re[1]);v[O]={};let x=qt(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 ee="other";U.includes("relationships/image")?ee="image":U.includes("relationships/hyperlink")?ee="hyperlink":U.includes("relationships/chart")?ee="chart":U.includes("relationships/slide")?ee="slide":U.includes("relationships/notesSlide")&&(ee="notes");let fe=B;B.startsWith("http://")||B.startsWith("https://")||(fe=fe.split("/").pop()||""),v[O][j]={type:ee,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(),O=qt(re);e.includeRawContent&&y.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(O,"p:spTree")[0];U&&j.children?.push(...ne(U,P)),j.children&&j.children.length>0&&g.push(j)}let L=[],$=f.filter(ie=>ie.path.match(/ppt\/media\/.*/)),X=f.filter(ie=>ie.path.match(/ppt\/charts\/chart\d+\.xml/));if(e.extractAttachments){for(let re of $){let O=qs(re.path.split("/").pop()||"image",re.content);if(L.push(O),e.ocr&&O.mimeType.startsWith("image/"))try{O.ocrText=(await ms(re.content,e.ocrLanguage)).trim()}catch(x){yi(`OCR failed for ${O.name}:`,e,x)}}for(let re of X){let O={type:"chart",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",data:re.content.toString("base64"),name:re.path.split("/").pop()||"",extension:"xml"};L.push(O);try{let x=await wc(re.content);O.chartData=x}catch(x){yi(`Failed to extract text from chart ${re.path}:`,e,x)}}let ie=re=>{for(let O of re){if("attachmentName"in(O.metadata||{})){let x=O.metadata,P=L.find(C=>C.name===x.attachmentName);P&&(O.type==="image"&&(P.altText=x.altText,P.ocrText&&(O.text=P.ocrText)),O.type==="chart"&&(O.text=P.chartData?.rawTexts.join(e.newlineDelimiter||`
124
+ `)))}O.children&&ie(O.children)}};ie(g)}return!e.ignoreNotes&&e.putNotesAtLast&&g.sort((ie,re)=>{let O=ie.type==="note"?1:0,x=re.type==="note"?1:0;return O-x}),{type:"pptx",metadata:d,content:g,attachments:L,toText:()=>g.map(ie=>{let re=O=>{let x="";return O.children?x+=O.children.map(re).filter(P=>P!="").join(O.children[0]?.children?e.newlineDelimiter??`
125
+ `:""):x+=O.text||"",x};return re(ie)}).filter(ie=>ie!="").join(e.newlineDelimiter??`
126
+ `)}};Se();Ce();Te();var gZ={pngblip:"png",jpegblip:"jpeg",gifblip:"gif",tiffblip:"tiff",dibitmap:"bmp",wbitmap:"bmp"},mZ={png:"image/png",jpeg:"image/jpeg",gif:"image/gif",tiff:"image/tiff",bmp:"image/bmp"},UC=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})}},B8=async(r,e)=>{try{let n=new UC(r).parse(),i=yZ(n),o=bZ(n),s=[],a=[],u=[],c="",f=[],h="",d="",g={},y=s,v=0,w="left",b=!1,E,_,S,A,M,I=[],q=0,Q=0,Z=()=>I.length>0?I[I.length-1]:void 0,ne=()=>{I.length===0&&I.push({rows:[],currentCells:[],currentCellContent:[],rowIndex:0})},L=!1,$=!1,X=0,ie=[],re={isMergedContinuation:!1},O=0,x=0,P={},C=!1,j=!1,U,B,ee={},fe=!1,Ee,te,H={},ae={},we,xe=(p,R)=>p.bold!==R.bold||p.italic!==R.italic||p.underline!==R.underline||p.strikethrough!==R.strikethrough||p.size!==R.size||p.font!==R.font||p.color!==R.color||p.backgroundColor!==R.backgroundColor||p.subscript!==R.subscript||p.superscript!==R.superscript,V=()=>{if(d){let p={type:"text",text:d,formatting:{...g}};we&&(p.metadata={link:we,linkType:Ae(we)}),f.push(p),c+=d,d=""}},F=!1,oe=()=>{V();let p=c||f.length>0;if(L&&!$&&!F&&p){let R=c,J=[...f],D=h;c="",f=[],h="",be(),c=R,f=J,h=D}if(p){let R="paragraph",J;if(_!==void 0&&_>0)R="heading",J={level:_},A=void 0,M=void 0;else if(b){R="list";let le=S||A,he=E||M||"unordered",_e=0;le&&(ae[le]||(ae[le]={}),ae[le][v]===void 0?ae[le][v]=0:ae[le][v]++,_e=ae[le][v]),J={listType:he,indentation:v,listId:le||"",itemIndex:_e,alignment:w},le&&(A=le),he&&(M=he)}let D={type:R,text:c,children:f,formatting:void 0,metadata:J};e.includeRawContent&&h&&(D.rawContent=h),L&&$?(ne(),Z().currentCellContent.push(D)):y.push(D),c="",f=[],h="",v=0,b=!1,E=void 0,_=void 0,S=void 0}},ge=p=>{oe();let R=p||Z();if(!R)return;let J={type:"cell",text:R.currentCellContent.map(D=>D.text).join(`
127
+ `),children:[...R.currentCellContent],metadata:{row:R.rowIndex,col:R.currentCells.length}};return R.currentCellContent=[],J},Re=p=>{let R=p||Z();if(!R)return;let J=ge(R);if(J&&(J.children&&J.children.length>0||J.text)&&R.currentCells.push(J),R.currentCells.length>0){let D={type:"row",text:R.currentCells.map(le=>le.text).filter(le=>le!=="").join(e.newlineDelimiter??`
128
+ `),children:[...R.currentCells]};R.rows.push(D),R.currentCells=[],R.rowIndex++}},be=()=>{if(F)return;F=!0;let p=Z();if(!p){F=!1;return}if(Re(p),p.rows.length>0){X++;let R={type:"table",text:p.rows.map(J=>J.text).join(`
129
+ `),children:[...p.rows]};I.length>1?I[I.length-2].currentCellContent.push(R):y.push(R)}I.pop(),I.length===0&&(L=!1,$=!1),F=!1},pe=p=>{let R,J=D=>{if(D.type==="text"){let le=D.value,he=le.match(/HYPERLINK\s+"([^"]+)"/i);if(he)return he[1];let _e=le.match(/"(https?:\/\/[^"]+|mailto:[^"]+|#[^"]+)"/);if(_e)return _e[1]}else if(D.type==="group"){let le=!1,he;for(let _e of D.content)if(_e.type==="text"){_e.value.toUpperCase().includes("HYPERLINK")&&(le=!0);let Ie=_e.value.match(/"([^"]+)"/);Ie&&le&&(he=Ie[1])}else if(_e.type==="group"){let ve=J(_e);ve&&(he=ve)}if(he)return he}};for(let D of p.content)if(D.type==="group"){let le=J(D);if(le)return le}return R},Ae=p=>{let R=p.trim();return R.startsWith("#")||!/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(R)?"internal":"external"},ze=p=>{let R="",J=D=>{if(D.type==="text")R+=D.value;else if(D.type==="group")for(let le of D.content)J(le)};for(let D of p.content)J(D);return R},Oe=p=>{let R,J="";for(let le of p.content)if(le.type==="control"){let he=gZ[le.value];he&&(R=he)}else le.type==="text"?J+=le.value.replace(/[^0-9a-fA-F]/g,""):le.type;if(!R||J.length===0)return;let D=mZ[R];if(D)try{let le=We.from(J,"hex"),he=R,_e=`image_${u.length+1}.${he}`;return{type:"image",mimeType:D,data:le.toString("base64"),name:_e,extension:he}}catch{return}},ke=p=>{if(!/^[a-zA-Z]/.test(p.value))return`\\${p.value}`;let R=`\\${p.value}`;return p.param!==void 0&&(R+=p.param),R+=" ",R},Ke=p=>p.value.replace(/([\\{}])/g,"\\$1"),tt=(p,R,J=0)=>{if(p.type==="group"){let D=["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"],le=!1,he=!1,_e=!1,ve=!1;if(p.destination){if(p.destination==="footnote")he=!0;else if(p.destination==="field"){let Fe=pe(p);Fe&&(V(),_e=!0,we=Fe)}else if(p.destination==="listtable")C=!0;else if(C&&p.destination==="list")j=!0,U=void 0,B=void 0;else if(p.destination==="listoverridetable")fe=!0;else if(fe&&p.destination==="listoverride")Ee=void 0,te=void 0;else if(p.destination==="pict")e.extractAttachments?ve=!0:le=!0;else if(D.includes(p.destination))le=!0;else if(p.content.length>0&&p.content[0].type==="control"&&p.content[0].value==="*"){let Fe=["fldinst","nesttableprops"];e.extractAttachments&&Fe.push("shppict","listpicture"),Fe.includes(p.destination||"")||(le=!0)}}if(p.destination==="listtext"||p.destination==="pntext"){b||(v=0),b=!0;let Fe=ze(p);if(Fe){let nt=Fe.trim();["\xB7","\u2022","o","\xA7","\u25A0","\u25A1","\u25CF","\u25CB","\u25C6","\u25C7","\u25BA","\u25B8","\xB7","\u2022","\u25CF","\u25CB"].some(je=>nt.includes(je))||nt.length===1&&!/[0-9a-zA-Z]/.test(nt)?E="unordered":(/^[0-9ivxlcdm]+[\.\)]/i.test(nt)||/^[a-z][\.\)]/i.test(nt))&&(E="ordered")}le=!0}if(le)return;if(h+="{",ve){let Fe=Oe(p);Fe&&(u.push(Fe),!C&&!j&&(oe(),y.push({type:"image",text:"",metadata:{attachmentName:Fe.name||`image_${u.length}`}})));for(let nt of p.content)if(nt.type==="control")h+=ke(nt);else if(nt.type==="text")h+=Ke(nt);else if(nt.type==="group"){let k=Pe=>{for(let je of Pe.content)je.type==="control"?h+=ke(je):je.type==="text"?h+=Ke(je):je.type==="group"&&(h+="{",k(je),h+="}")};k(p)}h+="}";return}let Ie=y;if(he){if(e.ignoreNotes)return;oe(),q++;let Fe="footnote";Q===1?Fe="endnote":Q===2&&(Fe=p.content.some(Pe=>Pe.type==="control"&&Pe.value==="ftnalt")?"endnote":"footnote");let nt={type:"note",children:[],metadata:{noteId:q.toString(),noteType:Fe}};a.push(nt),y=nt.children}let K={...R};for(let Fe of p.content){if(Fe.type==="group"&&Fe.destination==="fldinst"){h+="{";let nt=k=>{for(let Pe of k.content)Pe.type==="control"?h+=ke(Pe):Pe.type==="text"?h+=Ke(Pe):Pe.type==="group"&&(h+="{",nt(Pe),h+="}")};nt(Fe),h+="}";continue}tt(Fe,K,J+1)}p.destination==="listtable"?C=!1:p.destination==="list"?(j=!1,U!==void 0&&B!==void 0&&(ee[U]=B)):p.destination==="listoverridetable"?fe=!1:fe&&p.destination==="listoverride"&&te!==void 0&&Ee!==void 0&&(H[te]=Ee),he&&(oe(),y=Ie),_e&&(V(),we=void 0),h+="}"}else if(p.type==="text"){if(C||fe){h+=Ke(p);return}xe(g,R)&&(V(),g={...R}),d+=p.value,h+=Ke(p)}else if(p.type==="control"){if(h+=ke(p),C){if(p.value==="listid")U=p.param;else if(p.value==="levelnfc"||p.value==="levelnfcn"){let D=p.param!==void 0&&(p.param===0||p.param>=0&&p.param<=4);(!B||B==="unordered"&&D)&&(B=D?"ordered":"unordered")}return}if(fe){p.value==="listid"?Ee=p.param:p.value==="ls"&&(te=p.param);return}if(p.value==="par")oe(),g={...R};else if(p.value==="trowd"){let D=Z();L&&D&&D.currentCellContent.length>0?(ne(),I.push({rows:[],currentCells:[],currentCellContent:[],rowIndex:0})):L||(L=!0,ne()),$=!0,ie=[],re={isMergedContinuation:!1},O=0}else if(p.value==="clvmrg")re.isMergedContinuation=!0;else if(p.value==="clmgf")re.isMergedContinuation=!1;else if(p.value==="cellx")ie.push({...re}),re={isMergedContinuation:!1};else if(p.value==="cell"){$=!0;let D=!1;O<ie.length&&(D=ie[O].isMergedContinuation),O++;let le=ge();if(le&&!D){let he=Z();he&&he.currentCells.push(le)}g={...R}}else if(p.value==="nestcell"){if(I.length>1){let le=Z();le&&(le.rows.length>0||le.currentCells.length>0)&&be()}$=!0;let D=ge();if(D){let le=Z();le&&le.currentCells.push(D)}g={...R}}else if(p.value==="row")Re(),g={...R},O=0,$=!1;else if(p.value==="nestrow")I.length>1&&be(),Re(),g={...R},O=0;else if(p.value==="intbl")L=!0,$=!0,ne();else if(p.value==="pard")$=!1,v=0,w="left",b=!1,E=void 0,_=void 0,S=void 0,R.backgroundColor=void 0;else if(p.value==="tab")xe(g,R)&&(V(),g={...R}),d+=" ";else if(p.value==="line")xe(g,R)&&(V(),g={...R}),d+=`
130
+ `;else if(p.value==="lquote")xe(g,R)&&(V(),g={...R}),d+="\u2018";else if(p.value==="rquote")xe(g,R)&&(V(),g={...R}),d+="\u2019";else if(p.value==="ldblquote")xe(g,R)&&(V(),g={...R}),d+="\u201C";else if(p.value==="rdblquote")xe(g,R)&&(V(),g={...R}),d+="\u201D";else if(p.value==="u"){if(p.param!==void 0){let D=p.param;D<0&&(D+=65536),xe(g,R)&&(V(),g={...R}),d+=String.fromCharCode(D)}}else if(p.value==="b")R.bold=p.param!==0;else if(p.value==="i")R.italic=p.param!==0;else if(p.value==="ul")R.underline=p.param!==0;else if(p.value==="ulnone")R.underline=!1;else if(p.value==="strike")R.strikethrough=p.param!==0;else if(p.value==="plain")R.bold=!1,R.italic=!1,R.underline=!1,R.strikethrough=!1,R.subscript=!1,R.superscript=!1,R.size=void 0,R.font=void 0,R.color=void 0,R.backgroundColor=void 0;else if(p.value==="fs")p.param!==void 0&&(R.size=(p.param/2).toString()+"pt");else if(p.value==="f")p.param!==void 0&&i[p.param]&&(R.font=i[p.param]);else if(p.value==="cf")p.param!==void 0&&o[p.param]&&(R.color=o[p.param]);else if(p.value==="fet")p.param!==void 0&&(Q=p.param);else if(p.value==="cb"||p.value==="highlight"||p.value==="chcbpat"||p.value==="cbpat")p.param!==void 0&&o[p.param]&&(R.backgroundColor=o[p.param]);else if(p.value==="sub")R.subscript=!0,R.superscript=!1;else if(p.value==="super")R.superscript=!0,R.subscript=!1;else if(p.value==="nosupersub")R.subscript=!1,R.superscript=!1;else if(p.value==="li")p.param!==void 0&&(v=Math.floor(p.param/360));else if(p.value==="ls"){if(p.param!==void 0){b||(v=0),b=!0,P[p.param]||(x++,P[p.param]=`rtf-list-${x}`),S=P[p.param];let D=H[p.param]!==void 0?H[p.param]:p.param;ee[D]&&(E=ee[D])}}else p.value==="ilvl"?p.param!==void 0&&(b=!0,v=p.param):p.value==="pnlvl"?(b=!0,p.param!==void 0&&(v=p.param)):p.value==="levelnfc"||p.value==="pnf"?p.param!==void 0&&(b=!0,p.param===23?E="unordered":E="ordered"):p.value==="pndec"||p.value==="pnord"||p.value==="pnlcltr"||p.value==="pnucltr"?(b||(v=0),b=!0,E="ordered"):p.value==="pnbullet"||p.value==="pncard"?(b||(v=0),b=!0,E="unordered"):p.value==="s"?p.param!==void 0&&p.param>=1&&p.param<=9&&(_=p.param):p.value==="ql"?w="left":p.value==="qc"?w="center":p.value==="qr"?w="right":p.value==="qj"&&(w="justify")}};tt(n,{});let it=Z();if((L||it&&(it.rows.length>0||it.currentCells.length>0))&&be(),oe(),!e.putNotesAtLast&&a.length>0&&(s.push(...a),a.length=0),e.ocr&&e.extractAttachments){for(let R of u)if(R.mimeType.startsWith("image/"))try{let J=We.from(R.data,"base64");R.ocrText=(await ms(J,e.ocrLanguage)).trim()}catch(J){yi(`OCR failed for ${R.name}:`,e,J)}let p=R=>{for(let J of R){if(J.type==="image"&&J.metadata&&"attachmentName"in J.metadata){let D=J.metadata,le=u.find(he=>he.name===D.attachmentName);le&&(le.ocrText&&(J.text=le.ocrText),le.altText&&(D.altText=le.altText))}J.children&&p(J.children)}};p(s)}let T=p=>{for(let R of p){if(R.type==="note"&&R.children){let J=D=>D.children&&D.children.length>0?D.children.map(J).join(""):D.text||"";R.text=R.children.map(J).join("").trim()}R.children&&T(R.children)}};T(s),T(a);let m={type:"rtf",metadata:{},content:s,attachments:u,toText:()=>{let p=s.map(R=>R.text).join(e.newlineDelimiter??`
131
+ `);return e.putNotesAtLast&&a.length>0&&(p+=(e.newlineDelimiter??`
132
+ `)+a.map(R=>R.text).join(e.newlineDelimiter??`
133
+ `)),p}};return e.putNotesAtLast&&a.length>0&&s.push(...a),m}catch(t){throw t}};function yZ(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 bZ(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}Se();Ce();Te();var U8=Rl(gw());var j8=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 U8.XMLSerializer,h=x=>{let P={},C=f.serializeToString(x),j=(F,oe)=>{let ge=new RegExp(`<${oe}(?:\\s+w:val="([^"]+)")?\\s*\\/?>`),Re=F.match(ge);if(Re){let be=Re[1];return be===void 0?!0:be==="1"||be==="true"||be==="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 ee=C.match(/<w:u(?: w:val="([^"]+)")?\/?>/);if(ee){let F=ee[1];(!F||F!=="none")&&(P.underline=!0)}let fe=j(C,"w:strike"),Ee=j(C,"w:dstrike");fe!==null?P.strikethrough=fe:Ee!==null&&(P.strikethrough=Ee);let te=C.match(/<w:sz w:val="(\d+)"/);te&&(P.size=(parseInt(te[1])/2).toString()+"pt");let H=C.match(/<w:color w:val="([^"]+)"/);H&&H[1]!=="auto"&&(P.color="#"+H[1]);let ae=C.match(/<w:shd[^>]*w:fill="([^"]+)"/);ae&&ae[1]!=="auto"&&(P.backgroundColor="#"+ae[1]);let we=C.match(/<w:highlight w:val="([^"]+)"/);if(we&&we[1]!=="none"){let F={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=F[we[1]]||we[1]}let xe=C.match(/<w:rFonts[^>]*w:ascii="([^"]+)"/);if(xe)P.font=xe[1];else{let F=C.match(/<w:rFonts[^>]*w:hAnsi="([^"]+)"/);F&&(P.font=F[1])}let V=C.match(/<w:vertAlign w:val="([^"]+)"/);return V&&(V[1]==="subscript"&&(P.subscript=!0),V[1]==="superscript"&&(P.superscript=!0)),P},d=await Xl(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)),g=d.find(x=>x.path.match(a)),y=g?jl(g.content.toString()):{},v=new Map,w=new Map,b=[],E=[],_=d.filter(x=>x.path.match(s)),S=d.find(x=>x.path.match(u)),A={};if(S){let x=qt(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 M=d.find(x=>x.path.match(o)),I={};if(M){let x=qt(M.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]){I[B]={};let Ee=Le(j[fe],"w:lvl");for(let te=0;te<Ee.length;te++){let H=Ee[te].getAttribute("w:ilvl"),ae=Le(Ee[te],"w:numFmt")[0],we=Le(Ee[te],"w:lvlText")[0];H&&(I[B][H]={numFmt:ae?.getAttribute("w:val")||"decimal",lvlText:we?.getAttribute("w:val")||""})}}}}let q=d.find(x=>x.path.match(c)),Q={};if(q){let x=qt(q.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],ee=U?h(U):{},fe,Ee;if(B){let te=Le(B,"w:jc")[0];if(te){let ae=te.getAttribute("w:val");(ae==="left"||ae==="center"||ae==="right"||ae==="justify")&&(fe=ae)}let H=Le(B,"w:shd")[0];if(H){let ae=H.getAttribute("w:fill");ae&&ae!=="auto"&&(Ee="#"+ae)}}Q[j]={formatting:ee,alignment:fe,backgroundColor:Ee}}}}let Z={};if(q){let x=qt(q.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&&(Z=h(j))}}}let ne;if(q){let x=qt(q.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&&Q.Normal&&(ne="Normal")}let L=[],$=[],X={},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,ee=B?B.getAttribute("w:val"):null,fe=ee?ee.startsWith("Heading")||ee==="Title":!1,Ee=ee&&Q[ee]?Q[ee]:{formatting:{}},te=Ee.alignment;if(U){let oe=Le(U,"w:jc")[0];if(oe){let ge=oe.getAttribute("w:val");(ge==="left"||ge==="center"||ge==="right"||ge==="justify")&&(te=ge)}}let H=Ee.backgroundColor;if(U){let oe=Le(U,"w:shd")[0];if(oe){let ge=oe.getAttribute("w:fill");ge&&ge!=="auto"&&(H="#"+ge)}}let ae={...Ee.formatting};if(U){let oe=Le(U,"w:rPr")[0];if(oe){let ge=h(oe);for(let Re in ge){let be=ge[Re];be===!1?delete ae[Re]:be!==void 0&&(ae[Re]=be)}}}let we="",xe=[],V=oe=>{if(oe.nodeName==="w:r"){let ge=oe,Re=Le(ge,"w:rPr")[0],be={};for(let Oe in ae)be[Oe]=ae[Oe];let pe=Re?Le(Re,"w:rStyle")[0]:null,Ae=pe?pe.getAttribute("w:val"):ee;if(Ae&&Q[Ae])for(let Oe in Q[Ae].formatting)be[Oe]=Q[Ae].formatting[Oe];if(Re){let Oe=h(Re);for(let ke in Oe){let Ke=Oe[ke];Ke===!1?delete be[ke]:Ke!==void 0&&(be[ke]=Ke)}}!be.backgroundColor&&H&&(be.backgroundColor=H);let ze=Le(ge,"w:t");for(let Oe of ze){let ke=Oe.textContent||"";we+=ke;let Ke={type:"text",text:ke,formatting:be};e.includeRawContent&&(Ke.rawContent=f.serializeToString(Oe));let tt=Ae||ee||ne;tt&&(Ke.metadata={style:tt}),xe.push(Ke)}if(e.extractAttachments){let Oe=Le(ge,"w:drawing"),ke=Le(ge,"w:pict"),Ke=[...Oe,...ke];for(let tt of Ke){let it=f.serializeToString(tt),T="",m=Le(tt,"wp:docPr")[0];m&&(T=m.getAttribute("descr")||m.getAttribute("title")||"");let p="",R=Le(tt,"a:blip")[0];if(R)p=R.getAttribute("r:embed")||"";else{let J=Le(tt,"v:imagedata")[0];J&&(p=J.getAttribute("r:id")||"")}if(p&&A[p]){let D=A[p].split("/").pop();if(D){let le={type:"image",text:"",metadata:{attachmentName:D,altText:T}};e.includeRawContent&&(le.rawContent=it),xe.push(le)}}else{let J={type:"image",text:""};e.includeRawContent&&(J.rawContent=it),xe.push(J)}}}if(!e.ignoreNotes){let Oe=Le(ge,"w:footnoteReference")[0];if(Oe){let Ke=Oe.getAttribute("w:id");if(Ke&&v.has(Ke)){let tt=v.get(Ke),it={type:"note",text:tt.map(T=>T.text).join(" "),children:tt,metadata:{noteType:"footnote",noteId:Ke}};e.putNotesAtLast?b.push(it):xe.push(it)}}let ke=Le(ge,"w:endnoteReference")[0];if(ke){let Ke=ke.getAttribute("w:id");if(Ke&&w.has(Ke)){let tt=w.get(Ke),it={type:"note",text:tt.map(T=>T.text).join(" "),children:tt,metadata:{noteType:"endnote",noteId:Ke}};e.putNotesAtLast?b.push(it):xe.push(it)}}}}else if(oe.nodeName==="w:hyperlink"){let ge=oe,Re=ge.getAttribute("r:id"),be=ge.getAttribute("w:anchor"),pe;be?pe={link:"#"+be,linkType:"internal"}:Re&&A[Re]&&(pe={link:A[Re],linkType:"external"});let Ae=Array.from(ge.childNodes);for(let ze of Ae){let Oe=xe.length;if(V(ze),pe)for(let ke=Oe;ke<xe.length;ke++)xe[ke].type==="text"&&(xe[ke].metadata={...xe[ke].metadata??{},...pe})}}},F=Array.from(x.childNodes);for(let oe of F)V(oe);if(j){let oe=Le(C,"w:numId")[0],ge=Le(C,"w:ilvl")[0],Re=oe&&oe.getAttribute("w:val")||"0",be=ge?parseInt(ge.getAttribute("w:val")||"0"):0,pe="ordered",Ae=0;if(Re&&I[Re]){let Oe=be.toString();X[Re]||(X[Re]={}),X[Re][Oe]||(X[Re][Oe]=0),X[Re][Oe]++;for(let Ke=be+1;Ke<10;Ke++)X[Re][Ke.toString()]&&(X[Re][Ke.toString()]=0);pe=(I[Re][Oe]?.numFmt||"decimal")==="bullet"?"unordered":"ordered",ie[Re]||(ie[Re]={}),ie[Re][Oe]===void 0?ie[Re][Oe]=0:ie[Re][Oe]++,Ae=ie[Re][Oe]}let ze={type:"list",text:we,children:xe,metadata:{listType:pe,indentation:be,alignment:te||"left",listId:Re,itemIndex:Ae,style:ee}};return e.includeRawContent&&(ze.rawContent=P),ze}else if(fe){let oe=ee&&parseInt(ee.replace("Heading",""))||1,ge={type:"heading",text:we,children:xe,metadata:{level:oe,alignment:te,style:ee??void 0}};return e.includeRawContent&&(ge.rawContent=P),ge}else{let oe={type:"paragraph",text:we,children:xe,metadata:{alignment:te,style:ee??void 0}};return e.includeRawContent&&(oe.rawContent=P),oe}},O=x=>{let P=[],C=Rn(x,"w:tr");for(let j=0;j<C.length;j++){let U=C[j],B=[],ee=Rn(U,"w:tc");for(let Ee=0;Ee<ee.length;Ee++){let te=ee[Ee],H=[],ae="",we=Array.from(te.childNodes);for(let V of we)if(V.nodeName==="w:p"){let F=re(V);H.push(F),ae+=F.text}else if(V.nodeName==="w:tbl"){let F=O(V);H.push(F)}let xe={type:"cell",text:ae,children:H,metadata:{row:j,col:Ee}};B.push(xe)}let fe={type:"row",children:B};P.push(fe)}return{type:"table",children:P}};if(!e.ignoreNotes){let x=d.find(C=>C.path.match(n));if(x){let C=qt(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 ee=Le(U,"w:p");v.set(B,ee.map(fe=>re(fe)))}}let P=d.find(C=>C.path.match(i));if(P){let C=qt(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 ee=Le(U,"w:p");w.set(B,ee.map(fe=>re(fe)))}}}for(let x of d){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=qt(P),j=Le(C,"w:body")[0];if(j){let U=Array.from(j.childNodes);for(let B of U)B.nodeName==="w:p"?L.push(re(B)):B.nodeName==="w:tbl"&&L.push(O(B))}}if(e.extractAttachments){for(let x of _){let P=qs(x.path.split("/").pop()||"image",x.content);if(E.push(P),e.ocr&&P.mimeType.startsWith("image/"))try{P.ocrText=(await ms(x.content,e.ocrLanguage)).trim()}catch(C){yi(`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=E.find(B=>B.name===j.attachmentName);U&&U.ocrText&&(C.text=U.ocrText,U.altText=j.altText)}C.children&&x(C.children)}};x(L)}}return e.putNotesAtLast&&b.length>0&&L.push(...b),{type:"docx",metadata:{...y,formatting:Z,styleMap:Q},content:L,attachments:E,toText:()=>L.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??`
134
+ `:""):j+=C.text||"",j};return P(x)}).filter(x=>x!="").join(e.newlineDelimiter??`
135
+ `)}};var ch=class{static async parseOffice(e,t,n){let i,o={};typeof t=="function"?(i=t,o=n||{}):o=t||{};let s={ignoreNotes:!1,newlineDelimiter:`
136
+ `,putNotesAtLast:!1,outputErrorToConsole:!1,extractAttachments:!1,ocr:!1,ocrLanguage:"eng",includeRawContent:!1,pdfWorkerSrc:"",...o},a=We.alloc(0),u="",c;try{if(!e)throw Aa("IMPROPER_ARGUMENTS",s);if(e instanceof ArrayBuffer)a=We.from(e);else if(We.isBuffer(e))a=e;else if(typeof e=="string"){if(c=e,!rw(e))throw Aa("FILE_DOES_NOT_EXIST",s,e);if(D_(e).isDirectory())throw Aa("LOCATION_NOT_FOUND",s,e);a=I_(e),u=e.split(".").pop()?.toLowerCase()||""}else throw Aa("INVALID_INPUT",s);if(!u){let{fileTypeFromBuffer:h}=await N8(),d=await h(a);if(d)u=d.ext.toLowerCase();else throw Aa("IMPROPER_BUFFERS",s)}let f;switch(u){case"docx":f=await j8(a,s);break;case"pptx":f=await M8(a,s);break;case"xlsx":f=await VM(a,s);break;case"odt":case"odp":case"ods":f=await XM(a,s);break;case"pdf":f=await P8(a,s);break;case"rtf":f=await B8(a,s);break;default:throw Aa("EXTENSION_UNSUPPORTED",s,u)}return i&&i(f),f}catch(f){let h=oL(f,s,c);throw i&&i(void 0,h),h}}};var wZ=ch.parseOffice;var vZ=ch;if(typeof Zu<"u"&&typeof module<"u"&&Zu.main===module){let i=function(o){return o.startsWith("--")&&o.includes("=")};EZ=i;let r=$e.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}),ch.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 EZ;return qr(_Z);})();
137
+ /*! Bundled license information:
138
+
139
+ @jspm/core/nodelibs/browser/chunk-DtuTasat.js:
140
+ @jspm/core/nodelibs/browser/chunk-B738Er4n.js:
141
+ ieee754/index.js:
142
+ (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
143
+
144
+ @jspm/core/nodelibs/browser/chunk-CjPlbOtt.js:
145
+ (*!
146
+ * The buffer module from node.js, for the browser.
147
+ *
148
+ * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
149
+ * @license MIT
150
+ *)
151
+
152
+ @jspm/core/nodelibs/browser/chunk-CcCWfKp1.js:
153
+ (*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
154
+ */