@cerebriline/core 4.100.251 → 4.100.253

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.
@@ -1,34 +1,34 @@
1
- import{createRequire as JX}from"node:module";var dK=Object.create;var{getPrototypeOf:oK,defineProperty:WJ,getOwnPropertyNames:nK}=Object;var iK=Object.prototype.hasOwnProperty;function rK(Q){return this[Q]}var aK,sK,j$=(Q,J,Y)=>{var $=Q!=null&&typeof Q==="object";if($){var q=J?aK??=new WeakMap:sK??=new WeakMap,V=q.get(Q);if(V)return V}Y=Q!=null?dK(oK(Q)):{};let K=J||!Q||!Q.__esModule?WJ(Y,"default",{value:Q,enumerable:!0}):Y;for(let X of nK(Q))if(!iK.call(K,X))WJ(K,X,{get:rK.bind(Q,X),enumerable:!0});if($)q.set(Q,K);return K};var E=(Q,J)=>()=>(J||Q((J={exports:{}}).exports,J),J.exports);var tK=(Q)=>Q;function eK(Q,J){this[Q]=tK.bind(null,J)}var QX=(Q,J)=>{for(var Y in J)WJ(Q,Y,{get:J[Y],enumerable:!0,configurable:!0,set:eK.bind(J,Y)})};var UJ=(Q,J)=>()=>(Q&&(J=Q(Q=0)),J);var a=JX(import.meta.url);var z$=E((KQ)=>{(function(Q){Q.parser=function(W,G){return new Y(W,G)},Q.SAXParser=Y,Q.SAXStream=U,Q.createStream=Z,Q.MAX_BUFFER_LENGTH=65536;var J=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];Q.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function Y(W,G){if(!(this instanceof Y))return new Y(W,G);var F=this;if(q(F),F.q=F.c="",F.bufferCheckPosition=Q.MAX_BUFFER_LENGTH,F.encoding=null,F.opt=G||{},F.opt.lowercase=F.opt.lowercase||F.opt.lowercasetags,F.looseCase=F.opt.lowercase?"toLowerCase":"toUpperCase",F.opt.maxEntityCount=F.opt.maxEntityCount||512,F.opt.maxEntityDepth=F.opt.maxEntityDepth||4,F.entityCount=F.entityDepth=0,F.tags=[],F.closed=F.closedRoot=F.sawRoot=!1,F.tag=F.error=null,F.strict=!!W,F.noscript=!!(W||F.opt.noscript),F.state=L.BEGIN,F.strictEntities=F.opt.strictEntities,F.ENTITIES=F.strictEntities?Object.create(Q.XML_ENTITIES):Object.create(Q.ENTITIES),F.attribList=[],F.opt.xmlns)F.ns=Object.create(j);if(F.opt.unquotedAttributeValues===void 0)F.opt.unquotedAttributeValues=!W;if(F.trackPosition=F.opt.position!==!1,F.trackPosition)F.position=F.line=F.column=0;I(F,"onready")}if(!Object.create)Object.create=function(W){function G(){}G.prototype=W;var F=new G;return F};if(!Object.keys)Object.keys=function(W){var G=[];for(var F in W)if(W.hasOwnProperty(F))G.push(F);return G};function $(W){var G=Math.max(Q.MAX_BUFFER_LENGTH,10),F=0;for(var O=0,u=J.length;O<u;O++){var r=W[J[O]].length;if(r>G)switch(J[O]){case"textNode":$0(W);break;case"cdata":y(W,"oncdata",W.cdata),W.cdata="";break;case"script":y(W,"onscript",W.script),W.script="";break;default:Q0(W,"Max buffer length exceeded: "+J[O])}F=Math.max(F,r)}var J0=Q.MAX_BUFFER_LENGTH-F;W.bufferCheckPosition=J0+W.position}function q(W){for(var G=0,F=J.length;G<F;G++)W[J[G]]=""}function V(W){if($0(W),W.cdata!=="")y(W,"oncdata",W.cdata),W.cdata="";if(W.script!=="")y(W,"onscript",W.script),W.script=""}Y.prototype={end:function(){$Q(this)},write:VQ,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){V(this)}};var K;try{K=a("stream").Stream}catch(W){K=function(){}}if(!K)K=function(){};var X=Q.EVENTS.filter(function(W){return W!=="error"&&W!=="end"});function Z(W,G){return new U(W,G)}function H(W,G){if(W.length>=2){if(W[0]===255&&W[1]===254)return"utf-16le";if(W[0]===254&&W[1]===255)return"utf-16be"}if(W.length>=3&&W[0]===239&&W[1]===187&&W[2]===191)return"utf8";if(W.length>=4){if(W[0]===60&&W[1]===0&&W[2]===63&&W[3]===0)return"utf-16le";if(W[0]===0&&W[1]===60&&W[2]===0&&W[3]===63)return"utf-16be";return"utf8"}return G?"utf8":null}function U(W,G){if(!(this instanceof U))return new U(W,G);K.apply(this),this._parser=new Y(W,G),this.writable=!0,this.readable=!0;var F=this;this._parser.onend=function(){F.emit("end")},this._parser.onerror=function(O){F.emit("error",O),F._parser.error=null},this._decoder=null,this._decoderBuffer=null,X.forEach(function(O){Object.defineProperty(F,"on"+O,{get:function(){return F._parser["on"+O]},set:function(u){if(!u)return F.removeAllListeners(O),F._parser["on"+O]=u,u;F.on(O,u)},enumerable:!0,configurable:!1})})}U.prototype=Object.create(K.prototype,{constructor:{value:U}}),U.prototype._decodeBuffer=function(W,G){if(this._decoderBuffer)W=Buffer.concat([this._decoderBuffer,W]),this._decoderBuffer=null;if(!this._decoder){var F=H(W,G);if(!F)return this._decoderBuffer=W,"";this._parser.encoding=F,this._decoder=new TextDecoder(F)}return this._decoder.decode(W,{stream:!G})},U.prototype.write=function(W){if(typeof Buffer==="function"&&typeof Buffer.isBuffer==="function"&&Buffer.isBuffer(W))W=this._decodeBuffer(W,!1);else if(this._decoderBuffer){var G=this._decodeBuffer(Buffer.alloc(0),!0);if(G)this._parser.write(G),this.emit("data",G)}return this._parser.write(W.toString()),this.emit("data",W),!0},U.prototype.end=function(W){if(W&&W.length)this.write(W);if(this._decoderBuffer){var G=this._decodeBuffer(Buffer.alloc(0),!0);if(G)this._parser.write(G),this.emit("data",G)}else if(this._decoder){var F=this._decoder.decode();if(F)this._parser.write(F),this.emit("data",F)}return this._parser.end(),!0},U.prototype.on=function(W,G){var F=this;if(!F._parser["on"+W]&&X.indexOf(W)!==-1)F._parser["on"+W]=function(){var O=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);O.splice(0,0,W),F.emit.apply(F,O)};return K.prototype.on.call(F,W,G)};var B=/^\[CDATA\[$/i,P=/^DOCTYPE$/i,z="http://www.w3.org/XML/1998/namespace",N="http://www.w3.org/2000/xmlns/",j={xml:z,xmlns:N},C=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,A=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,M=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,T=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function R(W){return W===" "||W===`
2
- `||W==="\r"||W==="\t"}function D(W){return W==='"'||W==="'"}function x(W){return W===">"||R(W)}function w(W,G){return W.test(G)}function v(W,G){return!w(W,G)}var L=0;Q.STATE={BEGIN:L++,BEGIN_WHITESPACE:L++,TEXT:L++,TEXT_ENTITY:L++,OPEN_WAKA:L++,SGML_DECL:L++,SGML_DECL_QUOTED:L++,DOCTYPE:L++,DOCTYPE_QUOTED:L++,DOCTYPE_DTD:L++,DOCTYPE_DTD_QUOTED:L++,COMMENT_STARTING:L++,COMMENT:L++,COMMENT_ENDING:L++,COMMENT_ENDED:L++,CDATA:L++,CDATA_ENDING:L++,CDATA_ENDING_2:L++,PROC_INST:L++,PROC_INST_BODY:L++,PROC_INST_ENDING:L++,OPEN_TAG:L++,OPEN_TAG_SLASH:L++,ATTRIB:L++,ATTRIB_NAME:L++,ATTRIB_NAME_SAW_WHITE:L++,ATTRIB_VALUE:L++,ATTRIB_VALUE_QUOTED:L++,ATTRIB_VALUE_CLOSED:L++,ATTRIB_VALUE_UNQUOTED:L++,ATTRIB_VALUE_ENTITY_Q:L++,ATTRIB_VALUE_ENTITY_U:L++,CLOSE_TAG:L++,CLOSE_TAG_SAW_WHITE:L++,SCRIPT:L++,SCRIPT_ENDING:L++},Q.XML_ENTITIES=Object.assign(Object.create(null),{amp:"&",gt:">",lt:"<",quot:'"',apos:"'"}),Q.ENTITIES=Object.assign(Object.create(null),{amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830}),Object.keys(Q.ENTITIES).forEach(function(W){var G=Q.ENTITIES[W],F=typeof G==="number"?String.fromCharCode(G):G;Q.ENTITIES[W]=F});for(var k in Q.STATE)Q.STATE[Q.STATE[k]]=k;L=Q.STATE;function I(W,G,F){W[G]&&W[G](F)}function _(W){var G=W&&W.match(/(?:^|\s)encoding\s*=\s*(['"])([^'"]+)\1/i);return G?G[2]:null}function o(W){if(!W)return null;return W.toLowerCase().replace(/[^a-z0-9]/g,"")}function i(W,G){let F=o(W),O=o(G);if(!F||!O)return!0;if(O==="utf16")return F==="utf16le"||F==="utf16be";return F===O}function D0(W,G){if(!W.strict||!W.encoding||!G||G.name!=="xml")return;var F=_(G.body);if(F&&!i(W.encoding,F))m(W,"XML declaration encoding "+F+" does not match detected stream encoding "+W.encoding.toUpperCase())}function y(W,G,F){if(W.textNode)$0(W);I(W,G,F)}function $0(W){if(W.textNode=W0(W.opt,W.textNode),W.textNode)I(W,"ontext",W.textNode);W.textNode=""}function W0(W,G){if(W.trim)G=G.trim();if(W.normalize)G=G.replace(/\s+/g," ");return G}function Q0(W,G){if($0(W),W.trackPosition)G+=`
3
- Line: `+W.line+`
4
- Column: `+W.column+`
5
- Char: `+W.c;return G=Error(G),W.error=G,I(W,"onerror",G),W}function $Q(W){if(W.sawRoot&&!W.closedRoot)m(W,"Unclosed root tag");if(W.state!==L.BEGIN&&W.state!==L.BEGIN_WHITESPACE&&W.state!==L.TEXT)Q0(W,"Unexpected end");return $0(W),W.c="",W.closed=!0,I(W,"onend"),Y.call(W,W.strict,W.opt),W}function m(W,G){if(typeof W!=="object"||!(W instanceof Y))throw Error("bad call to strictFail");if(W.strict)Q0(W,G)}function H8(W){if(!W.strict)W.tagName=W.tagName[W.looseCase]();var G=W.tags[W.tags.length-1]||W,F=W.tag={name:W.tagName,attributes:{}};if(W.opt.xmlns)F.ns=G.ns;W.attribList.length=0,y(W,"onopentagstart",F)}function E0(W,G){var F=W.indexOf(":"),O=F<0?["",W]:W.split(":"),u=O[0],r=O[1];if(G&&W==="xmlns")u="xmlns",r="";return{prefix:u,local:r}}function E6(W){if(!W.strict)W.attribName=W.attribName[W.looseCase]();if(W.attribList.indexOf(W.attribName)!==-1||W.tag.attributes.hasOwnProperty(W.attribName)){W.attribName=W.attribValue="";return}if(W.opt.xmlns){var G=E0(W.attribName,!0),F=G.prefix,O=G.local;if(F==="xmlns")if(O==="xml"&&W.attribValue!==z)m(W,"xml: prefix must be bound to "+z+`
6
- Actual: `+W.attribValue);else if(O==="xmlns"&&W.attribValue!==N)m(W,"xmlns: prefix must be bound to "+N+`
7
- Actual: `+W.attribValue);else{var u=W.tag,r=W.tags[W.tags.length-1]||W;if(u.ns===r.ns)u.ns=Object.create(r.ns);u.ns[O]=W.attribValue}W.attribList.push([W.attribName,W.attribValue])}else W.tag.attributes[W.attribName]=W.attribValue,y(W,"onattribute",{name:W.attribName,value:W.attribValue});W.attribName=W.attribValue=""}function B0(W,G){if(W.opt.xmlns){var F=W.tag,O=E0(W.tagName);if(F.prefix=O.prefix,F.local=O.local,F.uri=F.ns[O.prefix]||"",F.prefix&&!F.uri)m(W,"Unbound namespace prefix: "+JSON.stringify(W.tagName)),F.uri=O.prefix;var u=W.tags[W.tags.length-1]||W;if(F.ns&&u.ns!==F.ns)Object.keys(F.ns).forEach(function(P$){y(W,"onopennamespace",{prefix:P$,uri:F.ns[P$]})});for(var r=0,J0=W.attribList.length;r<J0;r++){var U0=W.attribList[r],Z0=U0[0],m0=U0[1],V0=E0(Z0,!0),u0=V0.prefix,lK=V0.local,O$=u0===""?"":F.ns[u0]||"",HJ={name:Z0,value:m0,prefix:u0,local:lK,uri:O$};if(u0&&u0!=="xmlns"&&!O$)m(W,"Unbound namespace prefix: "+JSON.stringify(u0)),HJ.uri=u0;W.tag.attributes[Z0]=HJ,y(W,"onattribute",HJ)}W.attribList.length=0}if(W.tag.isSelfClosing=!!G,W.sawRoot=!0,W.tags.push(W.tag),y(W,"onopentag",W.tag),!G){if(!W.noscript&&W.tagName.toLowerCase()==="script")W.state=L.SCRIPT;else W.state=L.TEXT;W.tag=null,W.tagName=""}W.attribName=W.attribValue="",W.attribList.length=0}function U6(W){if(!W.tagName){m(W,"Weird empty close tag."),W.textNode+="</>",W.state=L.TEXT;return}if(W.script){if(W.tagName!=="script"){W.script+="</"+W.tagName+">",W.tagName="",W.state=L.SCRIPT;return}y(W,"onscript",W.script),W.script=""}var G=W.tags.length,F=W.tagName;if(!W.strict)F=F[W.looseCase]();var O=F;while(G--){var u=W.tags[G];if(u.name!==O)m(W,"Unexpected close tag");else break}if(G<0){m(W,"Unmatched closing tag: "+W.tagName),W.textNode+="</"+W.tagName+">",W.state=L.TEXT;return}W.tagName=F;var r=W.tags.length;while(r-- >G){var J0=W.tag=W.tags.pop();W.tagName=W.tag.name,y(W,"onclosetag",W.tagName);var U0={};for(var Z0 in J0.ns)U0[Z0]=J0.ns[Z0];var m0=W.tags[W.tags.length-1]||W;if(W.opt.xmlns&&J0.ns!==m0.ns)Object.keys(J0.ns).forEach(function(V0){var u0=J0.ns[V0];y(W,"onclosenamespace",{prefix:V0,uri:u0})})}if(G===0)W.closedRoot=!0;W.tagName=W.attribValue=W.attribName="",W.attribList.length=0,W.state=L.TEXT}function W8(W){var G=W.entity,F=G.toLowerCase(),O,u="";if(W.ENTITIES[G])return W.ENTITIES[G];if(W.ENTITIES[F])return W.ENTITIES[F];if(G=F,G.charAt(0)==="#")if(G.charAt(1)==="x")G=G.slice(2),O=parseInt(G,16),u=O.toString(16);else G=G.slice(1),O=parseInt(G,10),u=O.toString(10);if(G=G.replace(/^0+/,""),isNaN(O)||u.toLowerCase()!==G||O<0||O>1114111||!qQ(O))return m(W,"Invalid character entity"),"&"+W.entity+";";return String.fromCodePoint(O)}function qQ(W){return W===9||W===10||W===13||W>=32&&W<=55295||W>=57344&&W<=65533||W>=65536&&W<=1114111}function U8(W,G){if(G==="<")W.state=L.OPEN_WAKA,W.startTagPosition=W.position;else if(!R(G))m(W,"Non-whitespace before first tag."),W.textNode=G,W.state=L.TEXT}function Z8(W,G){var F="";if(G<W.length)F=W.charAt(G);return F}function VQ(W){var G=this;if(this.error)throw this.error;if(G.closed)return Q0(G,"Cannot write after close. Assign an onready handler.");if(W===null)return $Q(G);if(typeof W==="object")W=W.toString();var F=0,O="";while(!0){if(O=Z8(W,F++),G.c=O,!O)break;if(G.trackPosition)if(G.position++,O===`
8
- `)G.line++,G.column=0;else G.column++;switch(G.state){case L.BEGIN:if(G.state=L.BEGIN_WHITESPACE,O==="\uFEFF")continue;U8(G,O);continue;case L.BEGIN_WHITESPACE:U8(G,O);continue;case L.TEXT:if(G.sawRoot&&!G.closedRoot){var r=F-1;while(O&&O!=="<"&&O!=="&")if(O=Z8(W,F++),O&&G.trackPosition)if(G.position++,O===`
9
- `)G.line++,G.column=0;else G.column++;G.textNode+=W.substring(r,F-1)}if(O==="<"&&!(G.sawRoot&&G.closedRoot&&!G.strict))G.state=L.OPEN_WAKA,G.startTagPosition=G.position;else{if(!R(O)&&(!G.sawRoot||G.closedRoot))m(G,"Text data outside of root node.");if(O==="&")G.state=L.TEXT_ENTITY;else G.textNode+=O}continue;case L.SCRIPT:if(O==="<")G.state=L.SCRIPT_ENDING;else G.script+=O;continue;case L.SCRIPT_ENDING:if(O==="/")G.state=L.CLOSE_TAG;else G.script+="<"+O,G.state=L.SCRIPT;continue;case L.OPEN_WAKA:if(O==="!")G.state=L.SGML_DECL,G.sgmlDecl="";else if(R(O));else if(w(C,O))G.state=L.OPEN_TAG,G.tagName=O;else if(O==="/")G.state=L.CLOSE_TAG,G.tagName="";else if(O==="?")G.state=L.PROC_INST,G.procInstName=G.procInstBody="";else{if(m(G,"Unencoded <"),G.startTagPosition+1<G.position){var u=G.position-G.startTagPosition;O=Array(u).join(" ")+O}G.textNode+="<"+O,G.state=L.TEXT}continue;case L.SGML_DECL:if(G.sgmlDecl+O==="--"){G.state=L.COMMENT,G.comment="",G.sgmlDecl="";continue}if(G.doctype&&G.doctype!==!0&&G.sgmlDecl)G.state=L.DOCTYPE_DTD,G.doctype+="<!"+G.sgmlDecl+O,G.sgmlDecl="";else if(B.test(G.sgmlDecl+O))y(G,"onopencdata"),G.state=L.CDATA,G.sgmlDecl="",G.cdata="";else if(P.test(G.sgmlDecl+O)){if(G.state=L.DOCTYPE,G.doctype||G.sawRoot)m(G,"Inappropriately located doctype declaration");G.doctype="",G.sgmlDecl=""}else if(O===">")y(G,"onsgmldeclaration",G.sgmlDecl),G.sgmlDecl="",G.state=L.TEXT;else if(D(O))G.state=L.SGML_DECL_QUOTED,G.sgmlDecl+=O;else G.sgmlDecl+=O;continue;case L.SGML_DECL_QUOTED:if(O===G.q)G.state=L.SGML_DECL,G.q="";G.sgmlDecl+=O;continue;case L.DOCTYPE:if(O===">")G.state=L.TEXT,y(G,"ondoctype",G.doctype),G.doctype=!0;else if(G.doctype+=O,O==="[")G.state=L.DOCTYPE_DTD;else if(D(O))G.state=L.DOCTYPE_QUOTED,G.q=O;continue;case L.DOCTYPE_QUOTED:if(G.doctype+=O,O===G.q)G.q="",G.state=L.DOCTYPE;continue;case L.DOCTYPE_DTD:if(O==="]")G.doctype+=O,G.state=L.DOCTYPE;else if(O==="<")G.state=L.OPEN_WAKA,G.startTagPosition=G.position;else if(D(O))G.doctype+=O,G.state=L.DOCTYPE_DTD_QUOTED,G.q=O;else G.doctype+=O;continue;case L.DOCTYPE_DTD_QUOTED:if(G.doctype+=O,O===G.q)G.state=L.DOCTYPE_DTD,G.q="";continue;case L.COMMENT:if(O==="-")G.state=L.COMMENT_ENDING;else G.comment+=O;continue;case L.COMMENT_ENDING:if(O==="-"){if(G.state=L.COMMENT_ENDED,G.comment=W0(G.opt,G.comment),G.comment)y(G,"oncomment",G.comment);G.comment=""}else G.comment+="-"+O,G.state=L.COMMENT;continue;case L.COMMENT_ENDED:if(O!==">")m(G,"Malformed comment"),G.comment+="--"+O,G.state=L.COMMENT;else if(G.doctype&&G.doctype!==!0)G.state=L.DOCTYPE_DTD;else G.state=L.TEXT;continue;case L.CDATA:var r=F-1;while(O&&O!=="]")if(O=Z8(W,F++),O&&G.trackPosition)if(G.position++,O===`
10
- `)G.line++,G.column=0;else G.column++;if(G.cdata+=W.substring(r,F-1),O==="]")G.state=L.CDATA_ENDING;continue;case L.CDATA_ENDING:if(O==="]")G.state=L.CDATA_ENDING_2;else G.cdata+="]"+O,G.state=L.CDATA;continue;case L.CDATA_ENDING_2:if(O===">"){if(G.cdata)y(G,"oncdata",G.cdata);y(G,"onclosecdata"),G.cdata="",G.state=L.TEXT}else if(O==="]")G.cdata+="]";else G.cdata+="]]"+O,G.state=L.CDATA;continue;case L.PROC_INST:if(O==="?")G.state=L.PROC_INST_ENDING;else if(R(O))G.state=L.PROC_INST_BODY;else G.procInstName+=O;continue;case L.PROC_INST_BODY:if(!G.procInstBody&&R(O))continue;else if(O==="?")G.state=L.PROC_INST_ENDING;else G.procInstBody+=O;continue;case L.PROC_INST_ENDING:if(O===">"){let m0={name:G.procInstName,body:G.procInstBody};D0(G,m0),y(G,"onprocessinginstruction",m0),G.procInstName=G.procInstBody="",G.state=L.TEXT}else G.procInstBody+="?"+O,G.state=L.PROC_INST_BODY;continue;case L.OPEN_TAG:if(w(A,O))G.tagName+=O;else if(H8(G),O===">")B0(G);else if(O==="/")G.state=L.OPEN_TAG_SLASH;else{if(!R(O))m(G,"Invalid character in tag name");G.state=L.ATTRIB}continue;case L.OPEN_TAG_SLASH:if(O===">")B0(G,!0),U6(G);else m(G,"Forward-slash in opening tag not followed by >"),G.state=L.ATTRIB;continue;case L.ATTRIB:if(R(O))continue;else if(O===">")B0(G);else if(O==="/")G.state=L.OPEN_TAG_SLASH;else if(w(C,O))G.attribName=O,G.attribValue="",G.state=L.ATTRIB_NAME;else m(G,"Invalid attribute name");continue;case L.ATTRIB_NAME:if(O==="=")G.state=L.ATTRIB_VALUE;else if(O===">")m(G,"Attribute without value"),G.attribValue=G.attribName,E6(G),B0(G);else if(R(O))G.state=L.ATTRIB_NAME_SAW_WHITE;else if(w(A,O))G.attribName+=O;else m(G,"Invalid attribute name");continue;case L.ATTRIB_NAME_SAW_WHITE:if(O==="=")G.state=L.ATTRIB_VALUE;else if(R(O))continue;else if(m(G,"Attribute without value"),G.tag.attributes[G.attribName]="",G.attribValue="",y(G,"onattribute",{name:G.attribName,value:""}),G.attribName="",O===">")B0(G);else if(w(C,O))G.attribName=O,G.state=L.ATTRIB_NAME;else m(G,"Invalid attribute name"),G.state=L.ATTRIB;continue;case L.ATTRIB_VALUE:if(R(O))continue;else if(D(O))G.q=O,G.state=L.ATTRIB_VALUE_QUOTED;else{if(!G.opt.unquotedAttributeValues)Q0(G,"Unquoted attribute value");G.state=L.ATTRIB_VALUE_UNQUOTED,G.attribValue=O}continue;case L.ATTRIB_VALUE_QUOTED:if(O!==G.q){if(O==="&")G.state=L.ATTRIB_VALUE_ENTITY_Q;else G.attribValue+=O;continue}E6(G),G.q="",G.state=L.ATTRIB_VALUE_CLOSED;continue;case L.ATTRIB_VALUE_CLOSED:if(R(O))G.state=L.ATTRIB;else if(O===">")B0(G);else if(O==="/")G.state=L.OPEN_TAG_SLASH;else if(w(C,O))m(G,"No whitespace between attributes"),G.attribName=O,G.attribValue="",G.state=L.ATTRIB_NAME;else m(G,"Invalid attribute name");continue;case L.ATTRIB_VALUE_UNQUOTED:if(!x(O)){if(O==="&")G.state=L.ATTRIB_VALUE_ENTITY_U;else G.attribValue+=O;continue}if(E6(G),O===">")B0(G);else G.state=L.ATTRIB;continue;case L.CLOSE_TAG:if(!G.tagName)if(R(O))continue;else if(v(C,O))if(G.script)G.script+="</"+O,G.state=L.SCRIPT;else m(G,"Invalid tagname in closing tag.");else G.tagName=O;else if(O===">")U6(G);else if(w(A,O))G.tagName+=O;else if(G.script)G.script+="</"+G.tagName+O,G.tagName="",G.state=L.SCRIPT;else{if(!R(O))m(G,"Invalid tagname in closing tag");G.state=L.CLOSE_TAG_SAW_WHITE}continue;case L.CLOSE_TAG_SAW_WHITE:if(R(O))continue;if(O===">")U6(G);else m(G,"Invalid characters in closing tag");continue;case L.TEXT_ENTITY:case L.ATTRIB_VALUE_ENTITY_Q:case L.ATTRIB_VALUE_ENTITY_U:var J0,U0;switch(G.state){case L.TEXT_ENTITY:J0=L.TEXT,U0="textNode";break;case L.ATTRIB_VALUE_ENTITY_Q:J0=L.ATTRIB_VALUE_QUOTED,U0="attribValue";break;case L.ATTRIB_VALUE_ENTITY_U:J0=L.ATTRIB_VALUE_UNQUOTED,U0="attribValue";break}if(O===";"){var Z0=W8(G);if(G.opt.unparsedEntities&&!Object.values(Q.XML_ENTITIES).includes(Z0)){if((G.entityCount+=1)>G.opt.maxEntityCount)Q0(G,"Parsed entity count exceeds max entity count");if((G.entityDepth+=1)>G.opt.maxEntityDepth)Q0(G,"Parsed entity depth exceeds max entity depth");G.entity="",G.state=J0,G.write(Z0),G.entityDepth-=1}else G[U0]+=Z0,G.entity="",G.state=J0}else if(w(G.entity.length?T:M,O))G.entity+=O;else m(G,"Invalid character in entity name"),G[U0]+="&"+G.entity+O,G.entity="",G.state=J0;continue;default:throw Error(G,"Unknown state: "+G.state)}}if(G.position>=G.bufferCheckPosition)$(G);return G}/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */if(!String.fromCodePoint)(function(){var W=String.fromCharCode,G=Math.floor,F=function(){var O=16384,u=[],r,J0,U0=-1,Z0=arguments.length;if(!Z0)return"";var m0="";while(++U0<Z0){var V0=Number(arguments[U0]);if(!isFinite(V0)||V0<0||V0>1114111||G(V0)!==V0)throw RangeError("Invalid code point: "+V0);if(V0<=65535)u.push(V0);else V0-=65536,r=(V0>>10)+55296,J0=V0%1024+56320,u.push(r,J0);if(U0+1===Z0||u.length>O)m0+=W.apply(null,u),u.length=0}return m0};if(Object.defineProperty)Object.defineProperty(String,"fromCodePoint",{value:F,configurable:!0,writable:!0});else String.fromCodePoint=F})()})(typeof KQ>"u"?KQ.sax={}:KQ)});import N$,{resolve as HX,basename as WX,extname as UX,dirname as ZX}from"node:path";import{EventEmitter as LX}from"events";function BX(...Q){return HX(...Q)}function OX(Q,J){return WX(Q,J)}function PX(Q){return UX(Q)}function jX(Q){return ZX(Q)}function zX(Q){return N$.posix.isAbsolute(Q)}function FX(...Q){return N$.posix.join(...Q)}function RX(Q){if(Q.charCodeAt(0)===65279)return Q.slice(1);return Q}function IX(Q){return Q.toLowerCase()}function MX(Q){return typeof Q==="object"&&Q!==null&&Object.keys(Q).length===0}function XQ(Q,J,Y){for(let $ of Q)J=$(J,Y);return J}function w6(Q,J,Y){let $=Object.create(null);$.value=Y,$.writable=!0,$.enumerable=!0,$.configurable=!0,Object.defineProperty(Q,J,$)}function AX(Q,J){let Y={};if(typeof J==="object")Y=J;return new R$(Y).parseStringPromise(Q)}async function v6(Q,J={}){return await AX(Q,J)}function GQ(Q){return Q.replace(/-([a-z])/gi,(J)=>J[1].toUpperCase())}var C$,t,NX,CX=(Q,J,Y)=>(J in Q)?NX(Q,J,{enumerable:!0,configurable:!0,writable:!0,value:Y}):Q[J]=Y,j0=(Q,J,Y)=>CX(Q,typeof J!=="symbol"?J+"":J,Y),F$,R$;var I$=UJ(()=>{C$=j$(z$(),1);t={resolve:BX,basename:OX,extname:PX,dirname:jX,isAbsolutePosix:zX,joinPosix:FX},NX=Object.defineProperty;F$={0.1:{explicitCharkey:!1,trim:!0,normalize:!0,normalizeTags:!1,attrkey:"@",charkey:"#",explicitArray:!1,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!1,validator:null,xmlns:!1,explicitChildren:!1,childkey:"@@",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,emptyTag:""},0.2:{explicitCharkey:!1,trim:!1,normalize:!1,normalizeTags:!1,attrkey:"$",charkey:"_",explicitArray:!0,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!0,validator:null,xmlns:!1,explicitChildren:!1,preserveChildrenOrder:!1,childkey:"$$",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:!0},doctype:null,renderOpts:{pretty:!0,indent:" ",newline:`
11
- `},headless:!1,chunkSize:1e4,emptyTag:"",cdata:!1}};R$=class R$ extends LX{constructor(Q){super();if(j0(this,"options"),j0(this,"remaining",""),j0(this,"saxParser"),j0(this,"resultObject",null),j0(this,"EXPLICIT_CHARKEY"),j0(this,"errThrown",!1),j0(this,"ended",!1),j0(this,"processAsync",()=>{try{if(this.remaining.length<=this.options.chunkSize){let J=this.remaining;this.remaining="",this.saxParser=this.saxParser.write(J),this.saxParser.close()}else{let J=this.remaining.slice(0,this.options.chunkSize);this.remaining=this.remaining.slice(this.options.chunkSize),this.saxParser=this.saxParser.write(J),setTimeout(this.processAsync,0)}}catch(J){if(!this.errThrown)this.errThrown=!0,this.emit("error",J)}}),j0(this,"assignOrPush",(J,Y,$)=>{if(!(Y in J))if(!this.options.explicitArray)w6(J,Y,$);else w6(J,Y,[$]);else{if(!Array.isArray(J[Y]))w6(J,Y,[J[Y]]);J[Y].push($)}}),j0(this,"reset",()=>{this.removeAllListeners(),this.saxParser=C$.default.parser(this.options.strict,{trim:!1,normalize:!1,xmlns:this.options.xmlns}),this.errThrown=!1,this.saxParser.onerror=(V)=>{if(this.saxParser.resume(),!this.errThrown)this.errThrown=!0,this.emit("error",V)},this.saxParser.onend=()=>{if(!this.ended)this.ended=!0,this.emit("end",this.resultObject)},this.ended=!1,this.EXPLICIT_CHARKEY=this.options.explicitCharkey,this.resultObject=null;let J=[],Y=this.options.attrkey,$=this.options.charkey;this.saxParser.onopentag=(V)=>{let K={};if(K[$]="",!this.options.ignoreAttrs)Object.keys(V.attributes).forEach((X)=>{if(!(Y in K)&&!this.options.mergeAttrs)K[Y]={};let Z=this.options.attrValueProcessors?XQ(this.options.attrValueProcessors,V.attributes[X],X):V.attributes[X],H=this.options.attrNameProcessors?XQ(this.options.attrNameProcessors,X):X;if(this.options.mergeAttrs)this.assignOrPush(K,H,Z);else w6(K[Y],H,Z)});if(K["#name"]=this.options.tagNameProcessors?XQ(this.options.tagNameProcessors,V.name):V.name,this.options.xmlns)K[this.options.xmlnskey]={uri:V.uri,local:V.local};J.push(K)},this.saxParser.onclosetag=()=>{let V=J.pop(),K=V["#name"];if(!this.options.explicitChildren||!this.options.preserveChildrenOrder)delete V["#name"];let X;if(V.cdata===!0)X=V.cdata,delete V.cdata;let Z=J[J.length-1],H="";if(V[$].match(/^\s*$/)&&!X)H=V[$],delete V[$];else{if(this.options.trim)V[$]=V[$].trim();if(this.options.normalize)V[$]=V[$].replace(/\s{2,}/g," ").trim();if(V[$]=this.options.valueProcessors?XQ(this.options.valueProcessors,V[$],K):V[$],Object.keys(V).length===1&&$ in V&&!this.EXPLICIT_CHARKEY)V=V[$]}if(MX(V))if(typeof this.options.emptyTag==="function")V=this.options.emptyTag();else V=this.options.emptyTag!==""?this.options.emptyTag:H;if(this.options.validator){let U=`/${J.map((B)=>B["#name"]).concat(K).join("/")}`;(()=>{try{V=this.options.validator(U,Z&&Z[K],V)}catch(B){this.emit("error",B)}})()}if(this.options.explicitChildren&&!this.options.mergeAttrs&&typeof V==="object"){if(!this.options.preserveChildrenOrder){let U={};if(this.options.attrkey in V)U[this.options.attrkey]=V[this.options.attrkey],delete V[this.options.attrkey];if(!this.options.charsAsChildren&&this.options.charkey in V)U[this.options.charkey]=V[this.options.charkey],delete V[this.options.charkey];if(Object.getOwnPropertyNames(V).length>0)U[this.options.childkey]=V;V=U}else if(Z){Z[this.options.childkey]=Z[this.options.childkey]||[];let U={};if(Object.keys(V).forEach((B)=>{w6(U,B,V[B])}),Z[this.options.childkey].push(U),delete V["#name"],Object.keys(V).length===1&&$ in V&&!this.EXPLICIT_CHARKEY)V=V[$]}}if(J.length>0)this.assignOrPush(Z,K,V);else{if(this.options.explicitRoot){let U=V,B={};w6(B,K,U),V=B}this.resultObject=V,this.ended=!0,this.emit("end",this.resultObject)}};let q=(V)=>{let K=J[J.length-1];if(K){if(K[$]+=V,this.options.explicitChildren&&this.options.preserveChildrenOrder&&this.options.charsAsChildren&&(this.options.includeWhiteChars||V.replace(/\\n/g,"").trim()!=="")){K[this.options.childkey]=K[this.options.childkey]||[];let X={"#name":"__text__"};if(X[$]=V,this.options.normalize)X[$]=X[$].replace(/\s{2,}/g," ").trim();K[this.options.childkey].push(X)}}return K};this.saxParser.ontext=q,this.saxParser.oncdata=(V)=>{let K=q(V);if(K)K.cdata=!0}}),j0(this,"parseString",(J,Y)=>{if(Y&&typeof Y==="function")this.on("end",($)=>{this.reset(),Y(null,$)}),this.on("error",($)=>{this.reset(),Y($)});try{if(J=J.toString(),J.trim()==="")return this.emit("end",null),!0;if(J=RX(J),this.options.async)return this.remaining=J,setTimeout(this.processAsync,0),this.saxParser;return this.saxParser.write(J).close()}catch($){if(!this.errThrown&&!this.ended)this.emit("error",$),this.errThrown=!0;else if(this.ended)throw $}}),j0(this,"parseStringPromise",(J)=>{return new Promise((Y,$)=>{this.parseString(J,(q,V)=>{if(q)$(q);else Y(V)})})}),this.options={},Object.keys(F$["0.2"]).forEach((J)=>{this.options[J]=F$["0.2"][J]}),Q)Object.keys(Q).forEach((J)=>{this.options[J]=Q[J]});if(this.options.xmlns)this.options.xmlnskey=`${this.options.attrkey}ns`;if(this.options.normalizeTags){if(!this.options.tagNameProcessors)this.options.tagNameProcessors=[];this.options.tagNameProcessors.unshift(IX)}this.reset()}}});var L8=E((aZ,LJ)=>{if(typeof process>"u"||!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0)LJ.exports={nextTick:TX};else LJ.exports=process;function TX(Q,J,Y,$){if(typeof Q!=="function")throw TypeError('"callback" argument must be a function');var q=arguments.length,V,K;switch(q){case 0:case 1:return process.nextTick(Q);case 2:return process.nextTick(function(){Q.call(null,J)});case 3:return process.nextTick(function(){Q.call(null,J,Y)});case 4:return process.nextTick(function(){Q.call(null,J,Y,$)});default:V=Array(q-1),K=0;while(K<V.length)V[K++]=arguments[K];return process.nextTick(function(){Q.apply(null,V)})}}});var A$=E((sZ,M$)=>{var DX={}.toString;M$.exports=Array.isArray||function(Q){return DX.call(Q)=="[object Array]"}});var B8=E((BJ,D$)=>{var HQ=a("buffer"),p0=HQ.Buffer;function T$(Q,J){for(var Y in Q)J[Y]=Q[Y]}if(p0.from&&p0.alloc&&p0.allocUnsafe&&p0.allocUnsafeSlow)D$.exports=HQ;else T$(HQ,BJ),BJ.Buffer=x6;function x6(Q,J,Y){return p0(Q,J,Y)}T$(p0,x6);x6.from=function(Q,J,Y){if(typeof Q==="number")throw TypeError("Argument must not be a number");return p0(Q,J,Y)};x6.alloc=function(Q,J,Y){if(typeof Q!=="number")throw TypeError("Argument must be a number");var $=p0(Q);if(J!==void 0)if(typeof Y==="string")$.fill(J,Y);else $.fill(J);else $.fill(0);return $};x6.allocUnsafe=function(Q){if(typeof Q!=="number")throw TypeError("Argument must be a number");return p0(Q)};x6.allocUnsafeSlow=function(Q){if(typeof Q!=="number")throw TypeError("Argument must be a number");return HQ.SlowBuffer(Q)}});var S6=E((cX)=>{function EX(Q){if(Array.isArray)return Array.isArray(Q);return WQ(Q)==="[object Array]"}cX.isArray=EX;function wX(Q){return typeof Q==="boolean"}cX.isBoolean=wX;function vX(Q){return Q===null}cX.isNull=vX;function xX(Q){return Q==null}cX.isNullOrUndefined=xX;function SX(Q){return typeof Q==="number"}cX.isNumber=SX;function kX(Q){return typeof Q==="string"}cX.isString=kX;function yX(Q){return typeof Q==="symbol"}cX.isSymbol=yX;function gX(Q){return Q===void 0}cX.isUndefined=gX;function hX(Q){return WQ(Q)==="[object RegExp]"}cX.isRegExp=hX;function _X(Q){return typeof Q==="object"&&Q!==null}cX.isObject=_X;function bX(Q){return WQ(Q)==="[object Date]"}cX.isDate=bX;function fX(Q){return WQ(Q)==="[object Error]"||Q instanceof Error}cX.isError=fX;function mX(Q){return typeof Q==="function"}cX.isFunction=mX;function uX(Q){return Q===null||typeof Q==="boolean"||typeof Q==="number"||typeof Q==="string"||typeof Q==="symbol"||typeof Q>"u"}cX.isPrimitive=uX;cX.isBuffer=a("buffer").Buffer.isBuffer;function WQ(Q){return Object.prototype.toString.call(Q)}});var E$=E((eZ,OJ)=>{if(typeof Object.create==="function")OJ.exports=function(J,Y){if(Y)J.super_=Y,J.prototype=Object.create(Y.prototype,{constructor:{value:J,enumerable:!1,writable:!0,configurable:!0}})};else OJ.exports=function(J,Y){if(Y){J.super_=Y;var $=function(){};$.prototype=Y.prototype,J.prototype=new $,J.prototype.constructor=J}}});var k6=E((QL,PJ)=>{try{if(UQ=a("util"),typeof UQ.inherits!=="function")throw"";PJ.exports=UQ.inherits}catch(Q){PJ.exports=E$()}var UQ});var v$=E((JL,jJ)=>{function q4(Q,J){if(!(Q instanceof J))throw TypeError("Cannot call a class as a function")}var w$=B8().Buffer,O8=a("util");function V4(Q,J,Y){Q.copy(J,Y)}jJ.exports=function(){function Q(){q4(this,Q),this.head=null,this.tail=null,this.length=0}return Q.prototype.push=function(Y){var $={data:Y,next:null};if(this.length>0)this.tail.next=$;else this.head=$;this.tail=$,++this.length},Q.prototype.unshift=function(Y){var $={data:Y,next:this.head};if(this.length===0)this.tail=$;this.head=$,++this.length},Q.prototype.shift=function(){if(this.length===0)return;var Y=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,Y},Q.prototype.clear=function(){this.head=this.tail=null,this.length=0},Q.prototype.join=function(Y){if(this.length===0)return"";var $=this.head,q=""+$.data;while($=$.next)q+=Y+$.data;return q},Q.prototype.concat=function(Y){if(this.length===0)return w$.alloc(0);var $=w$.allocUnsafe(Y>>>0),q=this.head,V=0;while(q)V4(q.data,$,V),V+=q.data.length,q=q.next;return $},Q}();if(O8&&O8.inspect&&O8.inspect.custom)jJ.exports.prototype[O8.inspect.custom]=function(){var Q=O8.inspect({length:this.length});return this.constructor.name+" "+Q}});var zJ=E((YL,x$)=>{var ZQ=L8();function K4(Q,J){var Y=this,$=this._readableState&&this._readableState.destroyed,q=this._writableState&&this._writableState.destroyed;if($||q){if(J)J(Q);else if(Q){if(!this._writableState)ZQ.nextTick(LQ,this,Q);else if(!this._writableState.errorEmitted)this._writableState.errorEmitted=!0,ZQ.nextTick(LQ,this,Q)}return this}if(this._readableState)this._readableState.destroyed=!0;if(this._writableState)this._writableState.destroyed=!0;return this._destroy(Q||null,function(V){if(!J&&V){if(!Y._writableState)ZQ.nextTick(LQ,Y,V);else if(!Y._writableState.errorEmitted)Y._writableState.errorEmitted=!0,ZQ.nextTick(LQ,Y,V)}else if(J)J(V)}),this}function X4(){if(this._readableState)this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1;if(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 LQ(Q,J){Q.emit("error",J)}x$.exports={destroy:K4,undestroy:X4}});var k$=E(($L,S$)=>{S$.exports=a("util").deprecate});var NJ=E((qL,u$)=>{var Z6=L8();u$.exports=e;function g$(Q){var J=this;this.next=null,this.entry=null,this.finish=function(){A4(J,Q)}}var G4=["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:Z6.nextTick,y6;e.WritableState=j8;var h$=Object.create(S6());h$.inherits=k6();var H4={deprecate:k$()},_$=a("stream"),OQ=B8().Buffer,W4=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function U4(Q){return OQ.from(Q)}function Z4(Q){return OQ.isBuffer(Q)||Q instanceof W4}var b$=zJ();h$.inherits(e,_$);function L4(){}function j8(Q,J){y6=y6||L6(),Q=Q||{};var Y=J instanceof y6;if(this.objectMode=!!Q.objectMode,Y)this.objectMode=this.objectMode||!!Q.writableObjectMode;var{highWaterMark:$,writableHighWaterMark:q}=Q,V=this.objectMode?16:16384;if($||$===0)this.highWaterMark=$;else if(Y&&(q||q===0))this.highWaterMark=q;else this.highWaterMark=V;this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var K=Q.decodeStrings===!1;this.decodeStrings=!K,this.defaultEncoding=Q.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(X){N4(J,X)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new g$(this)}j8.prototype.getBuffer=function(){var J=this.bufferedRequest,Y=[];while(J)Y.push(J),J=J.next;return Y};(function(){try{Object.defineProperty(j8.prototype,"buffer",{get:H4.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(Q){}})();var BQ;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function")BQ=Function.prototype[Symbol.hasInstance],Object.defineProperty(e,Symbol.hasInstance,{value:function(Q){if(BQ.call(this,Q))return!0;if(this!==e)return!1;return Q&&Q._writableState instanceof j8}});else BQ=function(Q){return Q instanceof this};function e(Q){if(y6=y6||L6(),!BQ.call(e,this)&&!(this instanceof y6))return new e(Q);if(this._writableState=new j8(Q,this),this.writable=!0,Q){if(typeof Q.write==="function")this._write=Q.write;if(typeof Q.writev==="function")this._writev=Q.writev;if(typeof Q.destroy==="function")this._destroy=Q.destroy;if(typeof Q.final==="function")this._final=Q.final}_$.call(this)}e.prototype.pipe=function(){this.emit("error",Error("Cannot pipe, not readable"))};function B4(Q,J){var Y=Error("write after end");Q.emit("error",Y),Z6.nextTick(J,Y)}function O4(Q,J,Y,$){var q=!0,V=!1;if(Y===null)V=TypeError("May not write null values to stream");else if(typeof Y!=="string"&&Y!==void 0&&!J.objectMode)V=TypeError("Invalid non-string/buffer chunk");if(V)Q.emit("error",V),Z6.nextTick($,V),q=!1;return q}e.prototype.write=function(Q,J,Y){var $=this._writableState,q=!1,V=!$.objectMode&&Z4(Q);if(V&&!OQ.isBuffer(Q))Q=U4(Q);if(typeof J==="function")Y=J,J=null;if(V)J="buffer";else if(!J)J=$.defaultEncoding;if(typeof Y!=="function")Y=L4;if($.ended)B4(this,Y);else if(V||O4(this,$,Q,Y))$.pendingcb++,q=j4(this,$,V,Q,J,Y);return q};e.prototype.cork=function(){var Q=this._writableState;Q.corked++};e.prototype.uncork=function(){var Q=this._writableState;if(Q.corked){if(Q.corked--,!Q.writing&&!Q.corked&&!Q.bufferProcessing&&Q.bufferedRequest)f$(this,Q)}};e.prototype.setDefaultEncoding=function(J){if(typeof J==="string")J=J.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((J+"").toLowerCase())>-1))throw TypeError("Unknown encoding: "+J);return this._writableState.defaultEncoding=J,this};function P4(Q,J,Y){if(!Q.objectMode&&Q.decodeStrings!==!1&&typeof J==="string")J=OQ.from(J,Y);return J}Object.defineProperty(e.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function j4(Q,J,Y,$,q,V){if(!Y){var K=P4(J,$,q);if($!==K)Y=!0,q="buffer",$=K}var X=J.objectMode?1:$.length;J.length+=X;var Z=J.length<J.highWaterMark;if(!Z)J.needDrain=!0;if(J.writing||J.corked){var H=J.lastBufferedRequest;if(J.lastBufferedRequest={chunk:$,encoding:q,isBuf:Y,callback:V,next:null},H)H.next=J.lastBufferedRequest;else J.bufferedRequest=J.lastBufferedRequest;J.bufferedRequestCount+=1}else FJ(Q,J,!1,X,$,q,V);return Z}function FJ(Q,J,Y,$,q,V,K){if(J.writelen=$,J.writecb=K,J.writing=!0,J.sync=!0,Y)Q._writev(q,J.onwrite);else Q._write(q,V,J.onwrite);J.sync=!1}function z4(Q,J,Y,$,q){if(--J.pendingcb,Y)Z6.nextTick(q,$),Z6.nextTick(P8,Q,J),Q._writableState.errorEmitted=!0,Q.emit("error",$);else q($),Q._writableState.errorEmitted=!0,Q.emit("error",$),P8(Q,J)}function F4(Q){Q.writing=!1,Q.writecb=null,Q.length-=Q.writelen,Q.writelen=0}function N4(Q,J){var Y=Q._writableState,$=Y.sync,q=Y.writecb;if(F4(Y),J)z4(Q,Y,$,J,q);else{var V=m$(Y);if(!V&&!Y.corked&&!Y.bufferProcessing&&Y.bufferedRequest)f$(Q,Y);if($)G4(y$,Q,Y,V,q);else y$(Q,Y,V,q)}}function y$(Q,J,Y,$){if(!Y)C4(Q,J);J.pendingcb--,$(),P8(Q,J)}function C4(Q,J){if(J.length===0&&J.needDrain)J.needDrain=!1,Q.emit("drain")}function f$(Q,J){J.bufferProcessing=!0;var Y=J.bufferedRequest;if(Q._writev&&Y&&Y.next){var $=J.bufferedRequestCount,q=Array($),V=J.corkedRequestsFree;V.entry=Y;var K=0,X=!0;while(Y){if(q[K]=Y,!Y.isBuf)X=!1;Y=Y.next,K+=1}if(q.allBuffers=X,FJ(Q,J,!0,J.length,q,"",V.finish),J.pendingcb++,J.lastBufferedRequest=null,V.next)J.corkedRequestsFree=V.next,V.next=null;else J.corkedRequestsFree=new g$(J);J.bufferedRequestCount=0}else{while(Y){var{chunk:Z,encoding:H,callback:U}=Y,B=J.objectMode?1:Z.length;if(FJ(Q,J,!1,B,Z,H,U),Y=Y.next,J.bufferedRequestCount--,J.writing)break}if(Y===null)J.lastBufferedRequest=null}J.bufferedRequest=Y,J.bufferProcessing=!1}e.prototype._write=function(Q,J,Y){Y(Error("_write() is not implemented"))};e.prototype._writev=null;e.prototype.end=function(Q,J,Y){var $=this._writableState;if(typeof Q==="function")Y=Q,Q=null,J=null;else if(typeof J==="function")Y=J,J=null;if(Q!==null&&Q!==void 0)this.write(Q,J);if($.corked)$.corked=1,this.uncork();if(!$.ending)M4(this,$,Y)};function m$(Q){return Q.ending&&Q.length===0&&Q.bufferedRequest===null&&!Q.finished&&!Q.writing}function R4(Q,J){Q._final(function(Y){if(J.pendingcb--,Y)Q.emit("error",Y);J.prefinished=!0,Q.emit("prefinish"),P8(Q,J)})}function I4(Q,J){if(!J.prefinished&&!J.finalCalled)if(typeof Q._final==="function")J.pendingcb++,J.finalCalled=!0,Z6.nextTick(R4,Q,J);else J.prefinished=!0,Q.emit("prefinish")}function P8(Q,J){var Y=m$(J);if(Y){if(I4(Q,J),J.pendingcb===0)J.finished=!0,Q.emit("finish")}return Y}function M4(Q,J,Y){if(J.ending=!0,P8(Q,J),Y)if(J.finished)Z6.nextTick(Y);else Q.once("finish",Y);J.ended=!0,Q.writable=!1}function A4(Q,J,Y){var $=Q.entry;Q.entry=null;while($){var q=$.callback;J.pendingcb--,q(Y),$=$.next}J.corkedRequestsFree.next=Q}Object.defineProperty(e.prototype,"destroyed",{get:function(){if(this._writableState===void 0)return!1;return this._writableState.destroyed},set:function(Q){if(!this._writableState)return;this._writableState.destroyed=Q}});e.prototype.destroy=b$.destroy;e.prototype._undestroy=b$.undestroy;e.prototype._destroy=function(Q,J){this.end(),J(Q)}});var L6=E((VL,d$)=>{var c$=L8(),T4=Object.keys||function(Q){var J=[];for(var Y in Q)J.push(Y);return J};d$.exports=l0;var p$=Object.create(S6());p$.inherits=k6();var l$=RJ(),CJ=NJ();p$.inherits(l0,l$);{PQ=T4(CJ.prototype);for(z8=0;z8<PQ.length;z8++)if(F8=PQ[z8],!l0.prototype[F8])l0.prototype[F8]=CJ.prototype[F8]}var PQ,F8,z8;function l0(Q){if(!(this instanceof l0))return new l0(Q);if(l$.call(this,Q),CJ.call(this,Q),Q&&Q.readable===!1)this.readable=!1;if(Q&&Q.writable===!1)this.writable=!1;if(this.allowHalfOpen=!0,Q&&Q.allowHalfOpen===!1)this.allowHalfOpen=!1;this.once("end",D4)}Object.defineProperty(l0.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function D4(){if(this.allowHalfOpen||this._writableState.ended)return;c$.nextTick(E4,this)}function E4(Q){Q.end()}Object.defineProperty(l0.prototype,"destroyed",{get:function(){if(this._readableState===void 0||this._writableState===void 0)return!1;return this._readableState.destroyed&&this._writableState.destroyed},set:function(Q){if(this._readableState===void 0||this._writableState===void 0)return;this._readableState.destroyed=Q,this._writableState.destroyed=Q}});l0.prototype._destroy=function(Q,J){this.push(null),this.end(),c$.nextTick(J,Q)}});var AJ=E((c4)=>{var MJ=B8().Buffer,o$=MJ.isEncoding||function(Q){switch(Q=""+Q,Q&&Q.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 w4(Q){if(!Q)return"utf8";var J;while(!0)switch(Q){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 Q;default:if(J)return;Q=(""+Q).toLowerCase(),J=!0}}function v4(Q){var J=w4(Q);if(typeof J!=="string"&&(MJ.isEncoding===o$||!o$(Q)))throw Error("Unknown encoding: "+Q);return J||Q}c4.StringDecoder=N8;function N8(Q){this.encoding=v4(Q);var J;switch(this.encoding){case"utf16le":this.text=h4,this.end=_4,J=4;break;case"utf8":this.fillLast=k4,J=4;break;case"base64":this.text=b4,this.end=f4,J=3;break;default:this.write=m4,this.end=u4;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=MJ.allocUnsafe(J)}N8.prototype.write=function(Q){if(Q.length===0)return"";var J,Y;if(this.lastNeed){if(J=this.fillLast(Q),J===void 0)return"";Y=this.lastNeed,this.lastNeed=0}else Y=0;if(Y<Q.length)return J?J+this.text(Q,Y):this.text(Q,Y);return J||""};N8.prototype.end=g4;N8.prototype.text=y4;N8.prototype.fillLast=function(Q){if(this.lastNeed<=Q.length)return Q.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);Q.copy(this.lastChar,this.lastTotal-this.lastNeed,0,Q.length),this.lastNeed-=Q.length};function IJ(Q){if(Q<=127)return 0;else if(Q>>5===6)return 2;else if(Q>>4===14)return 3;else if(Q>>3===30)return 4;return Q>>6===2?-1:-2}function x4(Q,J,Y){var $=J.length-1;if($<Y)return 0;var q=IJ(J[$]);if(q>=0){if(q>0)Q.lastNeed=q-1;return q}if(--$<Y||q===-2)return 0;if(q=IJ(J[$]),q>=0){if(q>0)Q.lastNeed=q-2;return q}if(--$<Y||q===-2)return 0;if(q=IJ(J[$]),q>=0){if(q>0)if(q===2)q=0;else Q.lastNeed=q-3;return q}return 0}function S4(Q,J,Y){if((J[0]&192)!==128)return Q.lastNeed=0,"�";if(Q.lastNeed>1&&J.length>1){if((J[1]&192)!==128)return Q.lastNeed=1,"�";if(Q.lastNeed>2&&J.length>2){if((J[2]&192)!==128)return Q.lastNeed=2,"�"}}}function k4(Q){var J=this.lastTotal-this.lastNeed,Y=S4(this,Q,J);if(Y!==void 0)return Y;if(this.lastNeed<=Q.length)return Q.copy(this.lastChar,J,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);Q.copy(this.lastChar,J,0,Q.length),this.lastNeed-=Q.length}function y4(Q,J){var Y=x4(this,Q,J);if(!this.lastNeed)return Q.toString("utf8",J);this.lastTotal=Y;var $=Q.length-(Y-this.lastNeed);return Q.copy(this.lastChar,0,$),Q.toString("utf8",J,$)}function g4(Q){var J=Q&&Q.length?this.write(Q):"";if(this.lastNeed)return J+"�";return J}function h4(Q,J){if((Q.length-J)%2===0){var Y=Q.toString("utf16le",J);if(Y){var $=Y.charCodeAt(Y.length-1);if($>=55296&&$<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=Q[Q.length-2],this.lastChar[1]=Q[Q.length-1],Y.slice(0,-1)}return Y}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=Q[Q.length-1],Q.toString("utf16le",J,Q.length-1)}function _4(Q){var J=Q&&Q.length?this.write(Q):"";if(this.lastNeed){var Y=this.lastTotal-this.lastNeed;return J+this.lastChar.toString("utf16le",0,Y)}return J}function b4(Q,J){var Y=(Q.length-J)%3;if(Y===0)return Q.toString("base64",J);if(this.lastNeed=3-Y,this.lastTotal=3,Y===1)this.lastChar[0]=Q[Q.length-1];else this.lastChar[0]=Q[Q.length-2],this.lastChar[1]=Q[Q.length-1];return Q.toString("base64",J,Q.length-Y)}function f4(Q){var J=Q&&Q.length?this.write(Q):"";if(this.lastNeed)return J+this.lastChar.toString("base64",0,3-this.lastNeed);return J}function m4(Q){return Q.toString(this.encoding)}function u4(Q){return Q&&Q.length?this.write(Q):""}});var RJ=E((GL,q5)=>{var h6=L8();q5.exports=l;var l4=A$(),C8;l.ReadableState=e$;var XL=a("events").EventEmitter,a$=function(Q,J){return Q.listeners(J).length},vJ=a("stream"),R8=B8().Buffer,d4=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function o4(Q){return R8.from(Q)}function n4(Q){return R8.isBuffer(Q)||Q instanceof d4}var s$=Object.create(S6());s$.inherits=k6();var TJ=a("util"),f=void 0;if(TJ&&TJ.debuglog)f=TJ.debuglog("stream");else f=function(){};var i4=v$(),t$=zJ(),g6;s$.inherits(l,vJ);var DJ=["error","close","destroy","pause","resume"];function r4(Q,J,Y){if(typeof Q.prependListener==="function")return Q.prependListener(J,Y);if(!Q._events||!Q._events[J])Q.on(J,Y);else if(l4(Q._events[J]))Q._events[J].unshift(Y);else Q._events[J]=[Y,Q._events[J]]}function e$(Q,J){C8=C8||L6(),Q=Q||{};var Y=J instanceof C8;if(this.objectMode=!!Q.objectMode,Y)this.objectMode=this.objectMode||!!Q.readableObjectMode;var{highWaterMark:$,readableHighWaterMark:q}=Q,V=this.objectMode?16:16384;if($||$===0)this.highWaterMark=$;else if(Y&&(q||q===0))this.highWaterMark=q;else this.highWaterMark=V;if(this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new i4,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.destroyed=!1,this.defaultEncoding=Q.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,Q.encoding){if(!g6)g6=AJ().StringDecoder;this.decoder=new g6(Q.encoding),this.encoding=Q.encoding}}function l(Q){if(C8=C8||L6(),!(this instanceof l))return new l(Q);if(this._readableState=new e$(Q,this),this.readable=!0,Q){if(typeof Q.read==="function")this._read=Q.read;if(typeof Q.destroy==="function")this._destroy=Q.destroy}vJ.call(this)}Object.defineProperty(l.prototype,"destroyed",{get:function(){if(this._readableState===void 0)return!1;return this._readableState.destroyed},set:function(Q){if(!this._readableState)return;this._readableState.destroyed=Q}});l.prototype.destroy=t$.destroy;l.prototype._undestroy=t$.undestroy;l.prototype._destroy=function(Q,J){this.push(null),J(Q)};l.prototype.push=function(Q,J){var Y=this._readableState,$;if(!Y.objectMode){if(typeof Q==="string"){if(J=J||Y.defaultEncoding,J!==Y.encoding)Q=R8.from(Q,J),J="";$=!0}}else $=!0;return Q5(this,Q,J,!1,$)};l.prototype.unshift=function(Q){return Q5(this,Q,null,!0,!1)};function Q5(Q,J,Y,$,q){var V=Q._readableState;if(J===null)V.reading=!1,e4(Q,V);else{var K;if(!q)K=a4(V,J);if(K)Q.emit("error",K);else if(V.objectMode||J&&J.length>0){if(typeof J!=="string"&&!V.objectMode&&Object.getPrototypeOf(J)!==R8.prototype)J=o4(J);if($)if(V.endEmitted)Q.emit("error",Error("stream.unshift() after end event"));else EJ(Q,V,J,!0);else if(V.ended)Q.emit("error",Error("stream.push() after EOF"));else if(V.reading=!1,V.decoder&&!Y)if(J=V.decoder.write(J),V.objectMode||J.length!==0)EJ(Q,V,J,!1);else J5(Q,V);else EJ(Q,V,J,!1)}else if(!$)V.reading=!1}return s4(V)}function EJ(Q,J,Y,$){if(J.flowing&&J.length===0&&!J.sync)Q.emit("data",Y),Q.read(0);else{if(J.length+=J.objectMode?1:Y.length,$)J.buffer.unshift(Y);else J.buffer.push(Y);if(J.needReadable)jQ(Q)}J5(Q,J)}function a4(Q,J){var Y;if(!n4(J)&&typeof J!=="string"&&J!==void 0&&!Q.objectMode)Y=TypeError("Invalid non-string/buffer chunk");return Y}function s4(Q){return!Q.ended&&(Q.needReadable||Q.length<Q.highWaterMark||Q.length===0)}l.prototype.isPaused=function(){return this._readableState.flowing===!1};l.prototype.setEncoding=function(Q){if(!g6)g6=AJ().StringDecoder;return this._readableState.decoder=new g6(Q),this._readableState.encoding=Q,this};var n$=8388608;function t4(Q){if(Q>=n$)Q=n$;else Q--,Q|=Q>>>1,Q|=Q>>>2,Q|=Q>>>4,Q|=Q>>>8,Q|=Q>>>16,Q++;return Q}function i$(Q,J){if(Q<=0||J.length===0&&J.ended)return 0;if(J.objectMode)return 1;if(Q!==Q)if(J.flowing&&J.length)return J.buffer.head.data.length;else return J.length;if(Q>J.highWaterMark)J.highWaterMark=t4(Q);if(Q<=J.length)return Q;if(!J.ended)return J.needReadable=!0,0;return J.length}l.prototype.read=function(Q){f("read",Q),Q=parseInt(Q,10);var J=this._readableState,Y=Q;if(Q!==0)J.emittedReadable=!1;if(Q===0&&J.needReadable&&(J.length>=J.highWaterMark||J.ended)){if(f("read: emitReadable",J.length,J.ended),J.length===0&&J.ended)wJ(this);else jQ(this);return null}if(Q=i$(Q,J),Q===0&&J.ended){if(J.length===0)wJ(this);return null}var $=J.needReadable;if(f("need readable",$),J.length===0||J.length-Q<J.highWaterMark)$=!0,f("length less than watermark",$);if(J.ended||J.reading)$=!1,f("reading or ended",$);else if($){if(f("do read"),J.reading=!0,J.sync=!0,J.length===0)J.needReadable=!0;if(this._read(J.highWaterMark),J.sync=!1,!J.reading)Q=i$(Y,J)}var q;if(Q>0)q=Y5(Q,J);else q=null;if(q===null)J.needReadable=!0,Q=0;else J.length-=Q;if(J.length===0){if(!J.ended)J.needReadable=!0;if(Y!==Q&&J.ended)wJ(this)}if(q!==null)this.emit("data",q);return q};function e4(Q,J){if(J.ended)return;if(J.decoder){var Y=J.decoder.end();if(Y&&Y.length)J.buffer.push(Y),J.length+=J.objectMode?1:Y.length}J.ended=!0,jQ(Q)}function jQ(Q){var J=Q._readableState;if(J.needReadable=!1,!J.emittedReadable)if(f("emitReadable",J.flowing),J.emittedReadable=!0,J.sync)h6.nextTick(r$,Q);else r$(Q)}function r$(Q){f("emit readable"),Q.emit("readable"),xJ(Q)}function J5(Q,J){if(!J.readingMore)J.readingMore=!0,h6.nextTick(Q1,Q,J)}function Q1(Q,J){var Y=J.length;while(!J.reading&&!J.flowing&&!J.ended&&J.length<J.highWaterMark)if(f("maybeReadMore read 0"),Q.read(0),Y===J.length)break;else Y=J.length;J.readingMore=!1}l.prototype._read=function(Q){this.emit("error",Error("_read() is not implemented"))};l.prototype.pipe=function(Q,J){var Y=this,$=this._readableState;switch($.pipesCount){case 0:$.pipes=Q;break;case 1:$.pipes=[$.pipes,Q];break;default:$.pipes.push(Q);break}$.pipesCount+=1,f("pipe count=%d opts=%j",$.pipesCount,J);var q=(!J||J.end!==!1)&&Q!==process.stdout&&Q!==process.stderr,V=q?X:C;if($.endEmitted)h6.nextTick(V);else Y.once("end",V);Q.on("unpipe",K);function K(A,M){if(f("onunpipe"),A===Y){if(M&&M.hasUnpiped===!1)M.hasUnpiped=!0,U()}}function X(){f("onend"),Q.end()}var Z=J1(Y);Q.on("drain",Z);var H=!1;function U(){if(f("cleanup"),Q.removeListener("close",N),Q.removeListener("finish",j),Q.removeListener("drain",Z),Q.removeListener("error",z),Q.removeListener("unpipe",K),Y.removeListener("end",X),Y.removeListener("end",C),Y.removeListener("data",P),H=!0,$.awaitDrain&&(!Q._writableState||Q._writableState.needDrain))Z()}var B=!1;Y.on("data",P);function P(A){f("ondata"),B=!1;var M=Q.write(A);if(M===!1&&!B){if(($.pipesCount===1&&$.pipes===Q||$.pipesCount>1&&$5($.pipes,Q)!==-1)&&!H)f("false write response, pause",$.awaitDrain),$.awaitDrain++,B=!0;Y.pause()}}function z(A){if(f("onerror",A),C(),Q.removeListener("error",z),a$(Q,"error")===0)Q.emit("error",A)}r4(Q,"error",z);function N(){Q.removeListener("finish",j),C()}Q.once("close",N);function j(){f("onfinish"),Q.removeListener("close",N),C()}Q.once("finish",j);function C(){f("unpipe"),Y.unpipe(Q)}if(Q.emit("pipe",Y),!$.flowing)f("pipe resume"),Y.resume();return Q};function J1(Q){return function(){var J=Q._readableState;if(f("pipeOnDrain",J.awaitDrain),J.awaitDrain)J.awaitDrain--;if(J.awaitDrain===0&&a$(Q,"data"))J.flowing=!0,xJ(Q)}}l.prototype.unpipe=function(Q){var J=this._readableState,Y={hasUnpiped:!1};if(J.pipesCount===0)return this;if(J.pipesCount===1){if(Q&&Q!==J.pipes)return this;if(!Q)Q=J.pipes;if(J.pipes=null,J.pipesCount=0,J.flowing=!1,Q)Q.emit("unpipe",this,Y);return this}if(!Q){var{pipes:$,pipesCount:q}=J;J.pipes=null,J.pipesCount=0,J.flowing=!1;for(var V=0;V<q;V++)$[V].emit("unpipe",this,{hasUnpiped:!1});return this}var K=$5(J.pipes,Q);if(K===-1)return this;if(J.pipes.splice(K,1),J.pipesCount-=1,J.pipesCount===1)J.pipes=J.pipes[0];return Q.emit("unpipe",this,Y),this};l.prototype.on=function(Q,J){var Y=vJ.prototype.on.call(this,Q,J);if(Q==="data"){if(this._readableState.flowing!==!1)this.resume()}else if(Q==="readable"){var $=this._readableState;if(!$.endEmitted&&!$.readableListening){if($.readableListening=$.needReadable=!0,$.emittedReadable=!1,!$.reading)h6.nextTick(Y1,this);else if($.length)jQ(this)}}return Y};l.prototype.addListener=l.prototype.on;function Y1(Q){f("readable nexttick read 0"),Q.read(0)}l.prototype.resume=function(){var Q=this._readableState;if(!Q.flowing)f("resume"),Q.flowing=!0,$1(this,Q);return this};function $1(Q,J){if(!J.resumeScheduled)J.resumeScheduled=!0,h6.nextTick(q1,Q,J)}function q1(Q,J){if(!J.reading)f("resume read 0"),Q.read(0);if(J.resumeScheduled=!1,J.awaitDrain=0,Q.emit("resume"),xJ(Q),J.flowing&&!J.reading)Q.read(0)}l.prototype.pause=function(){if(f("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1)f("pause"),this._readableState.flowing=!1,this.emit("pause");return this};function xJ(Q){var J=Q._readableState;f("flow",J.flowing);while(J.flowing&&Q.read()!==null);}l.prototype.wrap=function(Q){var J=this,Y=this._readableState,$=!1;Q.on("end",function(){if(f("wrapped end"),Y.decoder&&!Y.ended){var K=Y.decoder.end();if(K&&K.length)J.push(K)}J.push(null)}),Q.on("data",function(K){if(f("wrapped data"),Y.decoder)K=Y.decoder.write(K);if(Y.objectMode&&(K===null||K===void 0))return;else if(!Y.objectMode&&(!K||!K.length))return;var X=J.push(K);if(!X)$=!0,Q.pause()});for(var q in Q)if(this[q]===void 0&&typeof Q[q]==="function")this[q]=function(K){return function(){return Q[K].apply(Q,arguments)}}(q);for(var V=0;V<DJ.length;V++)Q.on(DJ[V],this.emit.bind(this,DJ[V]));return this._read=function(K){if(f("wrapped _read",K),$)$=!1,Q.resume()},this};Object.defineProperty(l.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});l._fromList=Y5;function Y5(Q,J){if(J.length===0)return null;var Y;if(J.objectMode)Y=J.buffer.shift();else if(!Q||Q>=J.length){if(J.decoder)Y=J.buffer.join("");else if(J.buffer.length===1)Y=J.buffer.head.data;else Y=J.buffer.concat(J.length);J.buffer.clear()}else Y=V1(Q,J.buffer,J.decoder);return Y}function V1(Q,J,Y){var $;if(Q<J.head.data.length)$=J.head.data.slice(0,Q),J.head.data=J.head.data.slice(Q);else if(Q===J.head.data.length)$=J.shift();else $=Y?K1(Q,J):X1(Q,J);return $}function K1(Q,J){var Y=J.head,$=1,q=Y.data;Q-=q.length;while(Y=Y.next){var V=Y.data,K=Q>V.length?V.length:Q;if(K===V.length)q+=V;else q+=V.slice(0,Q);if(Q-=K,Q===0){if(K===V.length)if(++$,Y.next)J.head=Y.next;else J.head=J.tail=null;else J.head=Y,Y.data=V.slice(K);break}++$}return J.length-=$,q}function X1(Q,J){var Y=R8.allocUnsafe(Q),$=J.head,q=1;$.data.copy(Y),Q-=$.data.length;while($=$.next){var V=$.data,K=Q>V.length?V.length:Q;if(V.copy(Y,Y.length-Q,0,K),Q-=K,Q===0){if(K===V.length)if(++q,$.next)J.head=$.next;else J.head=J.tail=null;else J.head=$,$.data=V.slice(K);break}++q}return J.length-=q,Y}function wJ(Q){var J=Q._readableState;if(J.length>0)throw Error('"endReadable()" called on non-empty stream');if(!J.endEmitted)J.ended=!0,h6.nextTick(G1,J,Q)}function G1(Q,J){if(!Q.endEmitted&&Q.length===0)Q.endEmitted=!0,J.readable=!1,J.emit("end")}function $5(Q,J){for(var Y=0,$=Q.length;Y<$;Y++)if(Q[Y]===J)return Y;return-1}});var SJ=E((HL,X5)=>{X5.exports=d0;var zQ=L6(),K5=Object.create(S6());K5.inherits=k6();K5.inherits(d0,zQ);function H1(Q,J){var Y=this._transformState;Y.transforming=!1;var $=Y.writecb;if(!$)return this.emit("error",Error("write callback called multiple times"));if(Y.writechunk=null,Y.writecb=null,J!=null)this.push(J);$(Q);var q=this._readableState;if(q.reading=!1,q.needReadable||q.length<q.highWaterMark)this._read(q.highWaterMark)}function d0(Q){if(!(this instanceof d0))return new d0(Q);if(zQ.call(this,Q),this._transformState={afterTransform:H1.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,Q){if(typeof Q.transform==="function")this._transform=Q.transform;if(typeof Q.flush==="function")this._flush=Q.flush}this.on("prefinish",W1)}function W1(){var Q=this;if(typeof this._flush==="function")this._flush(function(J,Y){V5(Q,J,Y)});else V5(this,null,null)}d0.prototype.push=function(Q,J){return this._transformState.needTransform=!1,zQ.prototype.push.call(this,Q,J)};d0.prototype._transform=function(Q,J,Y){throw Error("_transform() is not implemented")};d0.prototype._write=function(Q,J,Y){var $=this._transformState;if($.writecb=Y,$.writechunk=Q,$.writeencoding=J,!$.transforming){var q=this._readableState;if($.needTransform||q.needReadable||q.length<q.highWaterMark)this._read(q.highWaterMark)}};d0.prototype._read=function(Q){var J=this._transformState;if(J.writechunk!==null&&J.writecb&&!J.transforming)J.transforming=!0,this._transform(J.writechunk,J.writeencoding,J.afterTransform);else J.needTransform=!0};d0.prototype._destroy=function(Q,J){var Y=this;zQ.prototype._destroy.call(this,Q,function($){J($),Y.emit("close")})};function V5(Q,J,Y){if(J)return Q.emit("error",J);if(Y!=null)Q.push(Y);if(Q._writableState.length)throw Error("Calling transform done when ws.length != 0");if(Q._transformState.transforming)throw Error("Calling transform done when still transforming");return Q.push(null)}});var U5=E((WL,W5)=>{W5.exports=I8;var G5=SJ(),H5=Object.create(S6());H5.inherits=k6();H5.inherits(I8,G5);function I8(Q){if(!(this instanceof I8))return new I8(Q);G5.call(this,Q)}I8.prototype._transform=function(Q,J,Y){Y(null,Q)}});var kJ=E((K0,FQ)=>{var w0=a("stream");if(process.env.READABLE_STREAM==="disable"&&w0)FQ.exports=w0,K0=FQ.exports=w0.Readable,K0.Readable=w0.Readable,K0.Writable=w0.Writable,K0.Duplex=w0.Duplex,K0.Transform=w0.Transform,K0.PassThrough=w0.PassThrough,K0.Stream=w0;else K0=FQ.exports=RJ(),K0.Stream=w0||K0,K0.Readable=K0,K0.Writable=NJ(),K0.Duplex=L6(),K0.Transform=SJ(),K0.PassThrough=U5()});var o0=E((Z1)=>{Z1.base64=!0;Z1.array=!0;Z1.string=!0;Z1.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u";Z1.nodebuffer=typeof Buffer<"u";Z1.uint8array=typeof Uint8Array<"u";if(typeof ArrayBuffer>"u")Z1.blob=!1;else{NQ=new ArrayBuffer(0);try{Z1.blob=new Blob([NQ],{type:"application/zip"}).size===0}catch(Q){try{gJ=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,CQ=new gJ,CQ.append(NQ),Z1.blob=CQ.getBlob("application/zip").size===0}catch(J){Z1.blob=!1}}}var NQ,gJ,CQ;try{Z1.nodestream=!!kJ().Readable}catch(Q){Z1.nodestream=!1}});var hJ=E((C1)=>{var F1=n(),N1=o0(),v0="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";C1.encode=function(Q){var J=[],Y,$,q,V,K,X,Z,H=0,U=Q.length,B=U,P=F1.getTypeOf(Q)!=="string";while(H<Q.length){if(B=U-H,!P)Y=Q.charCodeAt(H++),$=H<U?Q.charCodeAt(H++):0,q=H<U?Q.charCodeAt(H++):0;else Y=Q[H++],$=H<U?Q[H++]:0,q=H<U?Q[H++]:0;V=Y>>2,K=(Y&3)<<4|$>>4,X=B>1?($&15)<<2|q>>6:64,Z=B>2?q&63:64,J.push(v0.charAt(V)+v0.charAt(K)+v0.charAt(X)+v0.charAt(Z))}return J.join("")};C1.decode=function(Q){var J,Y,$,q,V,K,X,Z=0,H=0,U="data:";if(Q.substr(0,U.length)===U)throw Error("Invalid base64 input, it looks like a data url.");Q=Q.replace(/[^A-Za-z0-9+/=]/g,"");var B=Q.length*3/4;if(Q.charAt(Q.length-1)===v0.charAt(64))B--;if(Q.charAt(Q.length-2)===v0.charAt(64))B--;if(B%1!==0)throw Error("Invalid base64 input, bad content length.");var P;if(N1.uint8array)P=new Uint8Array(B|0);else P=Array(B|0);while(Z<Q.length){if(q=v0.indexOf(Q.charAt(Z++)),V=v0.indexOf(Q.charAt(Z++)),K=v0.indexOf(Q.charAt(Z++)),X=v0.indexOf(Q.charAt(Z++)),J=q<<2|V>>4,Y=(V&15)<<4|K>>2,$=(K&3)<<6|X,P[H++]=J,K!==64)P[H++]=Y;if(X!==64)P[H++]=$}return P}});var M8=E((LL,Z5)=>{Z5.exports={isNode:typeof Buffer<"u",newBufferFrom:function(Q,J){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(Q,J);else{if(typeof Q==="number")throw Error('The "data" argument must not be a number');return new Buffer(Q,J)}},allocBuffer:function(Q){if(Buffer.alloc)return Buffer.alloc(Q);else{var J=new Buffer(Q);return J.fill(0),J}},isBuffer:function(Q){return Buffer.isBuffer(Q)},isStream:function(Q){return Q&&typeof Q.on==="function"&&typeof Q.pause==="function"&&typeof Q.resume==="function"}}});var O5=E((OL,B5)=>{var BL=global.MutationObserver||global.WebKitMutationObserver,L5;L5=function(){process.nextTick(E1)};var M1,A1,T1,D1,_J,A8=[];function E1(){_J=!0;var Q,J,Y=A8.length;while(Y){J=A8,A8=[],Q=-1;while(++Q<Y)J[Q]();Y=A8.length}_J=!1}B5.exports=w1;function w1(Q){if(A8.push(Q)===1&&!_J)L5()}});var R5=E((PL,C5)=>{var P5=O5();function b6(){}var G0={},j5=["REJECTED"],bJ=["FULFILLED"],z5=["PENDING"];_6=["UNHANDLED"];var _6;C5.exports=e0;function e0(Q){if(typeof Q!=="function")throw TypeError("resolver must be a function");if(this.state=z5,this.queue=[],this.outcome=void 0,this.handled=_6,Q!==b6)F5(this,Q)}e0.prototype.finally=function(Q){if(typeof Q!=="function")return this;var J=this.constructor;return this.then(Y,$);function Y(q){function V(){return q}return J.resolve(Q()).then(V)}function $(q){function V(){throw q}return J.resolve(Q()).then(V)}};e0.prototype.catch=function(Q){return this.then(null,Q)};e0.prototype.then=function(Q,J){if(typeof Q!=="function"&&this.state===bJ||typeof J!=="function"&&this.state===j5)return this;var Y=new this.constructor(b6);if(this.handled===_6)this.handled=null;if(this.state!==z5){var $=this.state===bJ?Q:J;fJ(Y,$,this.outcome)}else this.queue.push(new T8(Y,Q,J));return Y};function T8(Q,J,Y){if(this.promise=Q,typeof J==="function")this.onFulfilled=J,this.callFulfilled=this.otherCallFulfilled;if(typeof Y==="function")this.onRejected=Y,this.callRejected=this.otherCallRejected}T8.prototype.callFulfilled=function(Q){G0.resolve(this.promise,Q)};T8.prototype.otherCallFulfilled=function(Q){fJ(this.promise,this.onFulfilled,Q)};T8.prototype.callRejected=function(Q){G0.reject(this.promise,Q)};T8.prototype.otherCallRejected=function(Q){fJ(this.promise,this.onRejected,Q)};function fJ(Q,J,Y){P5(function(){var $;try{$=J(Y)}catch(q){return G0.reject(Q,q)}if($===Q)G0.reject(Q,TypeError("Cannot resolve promise with itself"));else G0.resolve(Q,$)})}G0.resolve=function(Q,J){var Y=N5(v1,J);if(Y.status==="error")return G0.reject(Q,Y.value);var $=Y.value;if($)F5(Q,$);else{Q.state=bJ,Q.outcome=J;var q=-1,V=Q.queue.length;while(++q<V)Q.queue[q].callFulfilled(J)}return Q};G0.reject=function(Q,J){if(Q.state=j5,Q.outcome=J,Q.handled===_6)P5(function(){if(Q.handled===_6)process.emit("unhandledRejection",J,Q)});var Y=-1,$=Q.queue.length;while(++Y<$)Q.queue[Y].callRejected(J);return Q};function v1(Q){var J=Q&&Q.then;if(Q&&(typeof Q==="object"||typeof Q==="function")&&typeof J==="function")return function(){J.apply(Q,arguments)}}function F5(Q,J){var Y=!1;function $(X){if(Y)return;Y=!0,G0.reject(Q,X)}function q(X){if(Y)return;Y=!0,G0.resolve(Q,X)}function V(){J(q,$)}var K=N5(V);if(K.status==="error")$(K.value)}function N5(Q,J){var Y={};try{Y.value=Q(J),Y.status="success"}catch($){Y.status="error",Y.value=$}return Y}e0.resolve=x1;function x1(Q){if(Q instanceof this)return Q;return G0.resolve(new this(b6),Q)}e0.reject=S1;function S1(Q){var J=new this(b6);return G0.reject(J,Q)}e0.all=k1;function k1(Q){var J=this;if(Object.prototype.toString.call(Q)!=="[object Array]")return this.reject(TypeError("must be an array"));var Y=Q.length,$=!1;if(!Y)return this.resolve([]);var q=Array(Y),V=0,K=-1,X=new this(b6);while(++K<Y)Z(Q[K],K);return X;function Z(H,U){J.resolve(H).then(B,function(P){if(!$)$=!0,G0.reject(X,P)});function B(P){if(q[U]=P,++V===Y&&!$)$=!0,G0.resolve(X,q)}}}e0.race=y1;function y1(Q){var J=this;if(Object.prototype.toString.call(Q)!=="[object Array]")return this.reject(TypeError("must be an array"));var Y=Q.length,$=!1;if(!Y)return this.resolve([]);var q=-1,V=new this(b6);while(++q<Y)K(Q[q]);return V;function K(X){J.resolve(X).then(function(Z){if(!$)$=!0,G0.resolve(V,Z)},function(Z){if(!$)$=!0,G0.reject(V,Z)})}}});var f6=E((jL,I5)=>{var mJ=null;if(typeof Promise<"u")mJ=Promise;else mJ=R5();I5.exports={Promise:mJ}});var A5=E((M5)=>{(function(Q,J){if(Q.setImmediate)return;var Y=1,$={},q=!1,V=Q.document,K;function X(M){if(typeof M!=="function")M=Function(""+M);var T=Array(arguments.length-1);for(var R=0;R<T.length;R++)T[R]=arguments[R+1];var D={callback:M,args:T};return $[Y]=D,K(Y),Y++}function Z(M){delete $[M]}function H(M){var{callback:T,args:R}=M;switch(R.length){case 0:T();break;case 1:T(R[0]);break;case 2:T(R[0],R[1]);break;case 3:T(R[0],R[1],R[2]);break;default:T.apply(J,R);break}}function U(M){if(q)setTimeout(U,0,M);else{var T=$[M];if(T){q=!0;try{H(T)}finally{Z(M),q=!1}}}}function B(){K=function(M){process.nextTick(function(){U(M)})}}function P(){if(Q.postMessage&&!Q.importScripts){var M=!0,T=Q.onmessage;return Q.onmessage=function(){M=!1},Q.postMessage("","*"),Q.onmessage=T,M}}function z(){var M="setImmediate$"+Math.random()+"$",T=function(R){if(R.source===Q&&typeof R.data==="string"&&R.data.indexOf(M)===0)U(+R.data.slice(M.length))};if(Q.addEventListener)Q.addEventListener("message",T,!1);else Q.attachEvent("onmessage",T);K=function(R){Q.postMessage(M+R,"*")}}function N(){var M=new MessageChannel;M.port1.onmessage=function(T){var R=T.data;U(R)},K=function(T){M.port2.postMessage(T)}}function j(){var M=V.documentElement;K=function(T){var R=V.createElement("script");R.onreadystatechange=function(){U(T),R.onreadystatechange=null,M.removeChild(R),R=null},M.appendChild(R)}}function C(){K=function(M){setTimeout(U,0,M)}}var A=Object.getPrototypeOf&&Object.getPrototypeOf(Q);if(A=A&&A.setTimeout?A:Q,{}.toString.call(Q.process)==="[object process]")B();else if(P())z();else if(Q.MessageChannel)N();else if(V&&"onreadystatechange"in V.createElement("script"))j();else C();A.setImmediate=X,A.clearImmediate=Z})(typeof self>"u"?typeof global>"u"?M5:global:self)});var n=E((_1)=>{var Q6=o0(),g1=hJ(),m6=M8(),uJ=f6();A5();function h1(Q){var J=null;if(Q6.uint8array)J=new Uint8Array(Q.length);else J=Array(Q.length);return IQ(Q,J)}_1.newBlob=function(Q,J){_1.checkSupport("blob");try{return new Blob([Q],{type:J})}catch(q){try{var Y=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,$=new Y;return $.append(Q),$.getBlob(J)}catch(V){throw Error("Bug : can't construct the Blob.")}}};function D8(Q){return Q}function IQ(Q,J){for(var Y=0;Y<Q.length;++Y)J[Y]=Q.charCodeAt(Y)&255;return J}var RQ={stringifyByChunk:function(Q,J,Y){var $=[],q=0,V=Q.length;if(V<=Y)return String.fromCharCode.apply(null,Q);while(q<V){if(J==="array"||J==="nodebuffer")$.push(String.fromCharCode.apply(null,Q.slice(q,Math.min(q+Y,V))));else $.push(String.fromCharCode.apply(null,Q.subarray(q,Math.min(q+Y,V))));q+=Y}return $.join("")},stringifyByChar:function(Q){var J="";for(var Y=0;Y<Q.length;Y++)J+=String.fromCharCode(Q[Y]);return J},applyCanBeUsed:{uint8array:function(){try{return Q6.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch(Q){return!1}}(),nodebuffer:function(){try{return Q6.nodebuffer&&String.fromCharCode.apply(null,m6.allocBuffer(1)).length===1}catch(Q){return!1}}()}};function E8(Q){var J=65536,Y=_1.getTypeOf(Q),$=!0;if(Y==="uint8array")$=RQ.applyCanBeUsed.uint8array;else if(Y==="nodebuffer")$=RQ.applyCanBeUsed.nodebuffer;if($)while(J>1)try{return RQ.stringifyByChunk(Q,Y,J)}catch(q){J=Math.floor(J/2)}return RQ.stringifyByChar(Q)}_1.applyFromCharCode=E8;function MQ(Q,J){for(var Y=0;Y<Q.length;Y++)J[Y]=Q[Y];return J}var J6={};J6.string={string:D8,array:function(Q){return IQ(Q,Array(Q.length))},arraybuffer:function(Q){return J6.string.uint8array(Q).buffer},uint8array:function(Q){return IQ(Q,new Uint8Array(Q.length))},nodebuffer:function(Q){return IQ(Q,m6.allocBuffer(Q.length))}};J6.array={string:E8,array:D8,arraybuffer:function(Q){return new Uint8Array(Q).buffer},uint8array:function(Q){return new Uint8Array(Q)},nodebuffer:function(Q){return m6.newBufferFrom(Q)}};J6.arraybuffer={string:function(Q){return E8(new Uint8Array(Q))},array:function(Q){return MQ(new Uint8Array(Q),Array(Q.byteLength))},arraybuffer:D8,uint8array:function(Q){return new Uint8Array(Q)},nodebuffer:function(Q){return m6.newBufferFrom(new Uint8Array(Q))}};J6.uint8array={string:E8,array:function(Q){return MQ(Q,Array(Q.length))},arraybuffer:function(Q){return Q.buffer},uint8array:D8,nodebuffer:function(Q){return m6.newBufferFrom(Q)}};J6.nodebuffer={string:E8,array:function(Q){return MQ(Q,Array(Q.length))},arraybuffer:function(Q){return J6.nodebuffer.uint8array(Q).buffer},uint8array:function(Q){return MQ(Q,new Uint8Array(Q.length))},nodebuffer:D8};_1.transformTo=function(Q,J){if(!J)J="";if(!Q)return J;_1.checkSupport(Q);var Y=_1.getTypeOf(J),$=J6[Y][Q](J);return $};_1.resolve=function(Q){var J=Q.split("/"),Y=[];for(var $=0;$<J.length;$++){var q=J[$];if(q==="."||q===""&&$!==0&&$!==J.length-1)continue;else if(q==="..")Y.pop();else Y.push(q)}return Y.join("/")};_1.getTypeOf=function(Q){if(typeof Q==="string")return"string";if(Object.prototype.toString.call(Q)==="[object Array]")return"array";if(Q6.nodebuffer&&m6.isBuffer(Q))return"nodebuffer";if(Q6.uint8array&&Q instanceof Uint8Array)return"uint8array";if(Q6.arraybuffer&&Q instanceof ArrayBuffer)return"arraybuffer"};_1.checkSupport=function(Q){var J=Q6[Q.toLowerCase()];if(!J)throw Error(Q+" is not supported by this platform")};_1.MAX_VALUE_16BITS=65535;_1.MAX_VALUE_32BITS=-1;_1.pretty=function(Q){var J="",Y,$;for($=0;$<(Q||"").length;$++)Y=Q.charCodeAt($),J+="\\x"+(Y<16?"0":"")+Y.toString(16).toUpperCase();return J};_1.delay=function(Q,J,Y){setImmediate(function(){Q.apply(Y||null,J||[])})};_1.inherits=function(Q,J){var Y=function(){};Y.prototype=J.prototype,Q.prototype=new Y};_1.extend=function(){var Q={},J,Y;for(J=0;J<arguments.length;J++)for(Y in arguments[J])if(Object.prototype.hasOwnProperty.call(arguments[J],Y)&&typeof Q[Y]>"u")Q[Y]=arguments[J][Y];return Q};_1.prepareContent=function(Q,J,Y,$,q){var V=uJ.Promise.resolve(J).then(function(K){var X=Q6.blob&&(K instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(K))!==-1);if(X&&typeof FileReader<"u")return new uJ.Promise(function(Z,H){var U=new FileReader;U.onload=function(B){Z(B.target.result)},U.onerror=function(B){H(B.target.error)},U.readAsArrayBuffer(K)});else return K});return V.then(function(K){var X=_1.getTypeOf(K);if(!X)return uJ.Promise.reject(Error("Can't read the data of '"+Q+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"));if(X==="arraybuffer")K=_1.transformTo("uint8array",K);else if(X==="string"){if(q)K=g1.decode(K);else if(Y){if($!==!0)K=h1(K)}}return K})}});var O0=E((NL,w5)=>{function E5(Q){this.name=Q||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}E5.prototype={push:function(Q){this.emit("data",Q)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(Q){this.emit("error",Q)}return!0},error:function(Q){if(this.isFinished)return!1;if(this.isPaused)this.generatedError=Q;else{if(this.isFinished=!0,this.emit("error",Q),this.previous)this.previous.error(Q);this.cleanUp()}return!0},on:function(Q,J){return this._listeners[Q].push(J),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(Q,J){if(this._listeners[Q])for(var Y=0;Y<this._listeners[Q].length;Y++)this._listeners[Q][Y].call(this,J)},pipe:function(Q){return Q.registerPrevious(this)},registerPrevious:function(Q){if(this.isLocked)throw Error("The stream '"+this+"' has already been used.");this.streamInfo=Q.streamInfo,this.mergeStreamInfo(),this.previous=Q;var J=this;return Q.on("data",function(Y){J.processChunk(Y)}),Q.on("end",function(){J.end()}),Q.on("error",function(Y){J.error(Y)}),this},pause:function(){if(this.isPaused||this.isFinished)return!1;if(this.isPaused=!0,this.previous)this.previous.pause();return!0},resume:function(){if(!this.isPaused||this.isFinished)return!1;this.isPaused=!1;var Q=!1;if(this.generatedError)this.error(this.generatedError),Q=!0;if(this.previous)this.previous.resume();return!Q},flush:function(){},processChunk:function(Q){this.push(Q)},withStreamInfo:function(Q,J){return this.extraStreamInfo[Q]=J,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var Q in this.extraStreamInfo){if(!Object.prototype.hasOwnProperty.call(this.extraStreamInfo,Q))continue;this.streamInfo[Q]=this.extraStreamInfo[Q]}},lock:function(){if(this.isLocked)throw Error("The stream '"+this+"' has already been used.");if(this.isLocked=!0,this.previous)this.previous.lock()},toString:function(){var Q="Worker "+this.name;if(this.previous)return this.previous+" -> "+Q;else return Q}};w5.exports=E5});var c6=E((t1)=>{var u6=n(),B6=o0(),i1=M8(),AQ=O0(),w8=Array(256);for(x0=0;x0<256;x0++)w8[x0]=x0>=252?6:x0>=248?5:x0>=240?4:x0>=224?3:x0>=192?2:1;var x0;w8[254]=w8[254]=1;var r1=function(Q){var J,Y,$,q,V,K=Q.length,X=0;for(q=0;q<K;q++){if(Y=Q.charCodeAt(q),(Y&64512)===55296&&q+1<K){if($=Q.charCodeAt(q+1),($&64512)===56320)Y=65536+(Y-55296<<10)+($-56320),q++}X+=Y<128?1:Y<2048?2:Y<65536?3:4}if(B6.uint8array)J=new Uint8Array(X);else J=Array(X);for(V=0,q=0;V<X;q++){if(Y=Q.charCodeAt(q),(Y&64512)===55296&&q+1<K){if($=Q.charCodeAt(q+1),($&64512)===56320)Y=65536+(Y-55296<<10)+($-56320),q++}if(Y<128)J[V++]=Y;else if(Y<2048)J[V++]=192|Y>>>6,J[V++]=128|Y&63;else if(Y<65536)J[V++]=224|Y>>>12,J[V++]=128|Y>>>6&63,J[V++]=128|Y&63;else J[V++]=240|Y>>>18,J[V++]=128|Y>>>12&63,J[V++]=128|Y>>>6&63,J[V++]=128|Y&63}return J},a1=function(Q,J){var Y;if(J=J||Q.length,J>Q.length)J=Q.length;Y=J-1;while(Y>=0&&(Q[Y]&192)===128)Y--;if(Y<0)return J;if(Y===0)return J;return Y+w8[Q[Y]]>J?Y:J},s1=function(Q){var J,Y,$,q,V=Q.length,K=Array(V*2);for(Y=0,J=0;J<V;){if($=Q[J++],$<128){K[Y++]=$;continue}if(q=w8[$],q>4){K[Y++]=65533,J+=q-1;continue}$&=q===2?31:q===3?15:7;while(q>1&&J<V)$=$<<6|Q[J++]&63,q--;if(q>1){K[Y++]=65533;continue}if($<65536)K[Y++]=$;else $-=65536,K[Y++]=55296|$>>10&1023,K[Y++]=56320|$&1023}if(K.length!==Y)if(K.subarray)K=K.subarray(0,Y);else K.length=Y;return u6.applyFromCharCode(K)};t1.utf8encode=function(J){if(B6.nodebuffer)return i1.newBufferFrom(J,"utf-8");return r1(J)};t1.utf8decode=function(J){if(B6.nodebuffer)return u6.transformTo("nodebuffer",J).toString("utf-8");return J=u6.transformTo(B6.uint8array?"uint8array":"array",J),s1(J)};function TQ(){AQ.call(this,"utf-8 decode"),this.leftOver=null}u6.inherits(TQ,AQ);TQ.prototype.processChunk=function(Q){var J=u6.transformTo(B6.uint8array?"uint8array":"array",Q.data);if(this.leftOver&&this.leftOver.length){if(B6.uint8array){var Y=J;J=new Uint8Array(Y.length+this.leftOver.length),J.set(this.leftOver,0),J.set(Y,this.leftOver.length)}else J=this.leftOver.concat(J);this.leftOver=null}var $=a1(J),q=J;if($!==J.length)if(B6.uint8array)q=J.subarray(0,$),this.leftOver=J.subarray($,J.length);else q=J.slice(0,$),this.leftOver=J.slice($,J.length);this.push({data:t1.utf8decode(q),meta:Q.meta})};TQ.prototype.flush=function(){if(this.leftOver&&this.leftOver.length)this.push({data:t1.utf8decode(this.leftOver),meta:{}}),this.leftOver=null};t1.Utf8DecodeWorker=TQ;function pJ(){AQ.call(this,"utf-8 encode")}u6.inherits(pJ,AQ);pJ.prototype.processChunk=function(Q){this.push({data:t1.utf8encode(Q.data),meta:Q.meta})};t1.Utf8EncodeWorker=pJ});var y5=E((RL,k5)=>{var x5=O0(),S5=n();function dJ(Q){x5.call(this,"ConvertWorker to "+Q),this.destType=Q}S5.inherits(dJ,x5);dJ.prototype.processChunk=function(Q){this.push({data:S5.transformTo(this.destType,Q.data),meta:Q.meta})};k5.exports=dJ});var _5=E((IL,h5)=>{var g5=kJ().Readable,JG=n();JG.inherits(oJ,g5);function oJ(Q,J,Y){g5.call(this,J),this._helper=Q;var $=this;Q.on("data",function(q,V){if(!$.push(q))$._helper.pause();if(Y)Y(V)}).on("error",function(q){$.emit("error",q)}).on("end",function(){$.push(null)})}oJ.prototype._read=function(){this._helper.resume()};h5.exports=oJ});var nJ=E((ML,m5)=>{var O6=n(),YG=y5(),$G=O0(),qG=hJ(),VG=o0(),KG=f6(),b5=null;if(VG.nodestream)try{b5=_5()}catch(Q){}function XG(Q,J,Y){switch(Q){case"blob":return O6.newBlob(O6.transformTo("arraybuffer",J),Y);case"base64":return qG.encode(J);default:return O6.transformTo(Q,J)}}function GG(Q,J){var Y,$=0,q=null,V=0;for(Y=0;Y<J.length;Y++)V+=J[Y].length;switch(Q){case"string":return J.join("");case"array":return Array.prototype.concat.apply([],J);case"uint8array":q=new Uint8Array(V);for(Y=0;Y<J.length;Y++)q.set(J[Y],$),$+=J[Y].length;return q;case"nodebuffer":return Buffer.concat(J);default:throw Error("concat : unsupported type '"+Q+"'")}}function HG(Q,J){return new KG.Promise(function(Y,$){var q=[],V=Q._internalType,K=Q._outputType,X=Q._mimeType;Q.on("data",function(Z,H){if(q.push(Z),J)J(H)}).on("error",function(Z){q=[],$(Z)}).on("end",function(){try{var Z=XG(K,GG(V,q),X);Y(Z)}catch(H){$(H)}q=[]}).resume()})}function f5(Q,J,Y){var $=J;switch(J){case"blob":case"arraybuffer":$="uint8array";break;case"base64":$="string";break}try{this._internalType=$,this._outputType=J,this._mimeType=Y,O6.checkSupport($),this._worker=Q.pipe(new YG($)),Q.lock()}catch(q){this._worker=new $G("error"),this._worker.error(q)}}f5.prototype={accumulate:function(Q){return HG(this,Q)},on:function(Q,J){var Y=this;if(Q==="data")this._worker.on(Q,function($){J.call(Y,$.data,$.meta)});else this._worker.on(Q,function(){O6.delay(J,arguments,Y)});return this},resume:function(){return O6.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(Q){if(O6.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw Error(this._outputType+" is not supported by this method");return new b5(this,{objectMode:this._outputType!=="nodebuffer"},Q)}};m5.exports=f5});var iJ=E((WG)=>{WG.base64=!1;WG.binary=!1;WG.dir=!1;WG.createFolders=!0;WG.date=null;WG.compression=null;WG.compressionOptions=null;WG.comment=null;WG.unixPermissions=null;WG.dosPermissions=null});var rJ=E((TL,u5)=>{var DQ=n(),EQ=O0(),CG=16384;function p6(Q){EQ.call(this,"DataWorker");var J=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,Q.then(function(Y){if(J.dataIsReady=!0,J.data=Y,J.max=Y&&Y.length||0,J.type=DQ.getTypeOf(Y),!J.isPaused)J._tickAndRepeat()},function(Y){J.error(Y)})}DQ.inherits(p6,EQ);p6.prototype.cleanUp=function(){EQ.prototype.cleanUp.call(this),this.data=null};p6.prototype.resume=function(){if(!EQ.prototype.resume.call(this))return!1;if(!this._tickScheduled&&this.dataIsReady)this._tickScheduled=!0,DQ.delay(this._tickAndRepeat,[],this);return!0};p6.prototype._tickAndRepeat=function(){if(this._tickScheduled=!1,this.isPaused||this.isFinished)return;if(this._tick(),!this.isFinished)DQ.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0};p6.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var Q=CG,J=null,Y=Math.min(this.max,this.index+Q);if(this.index>=this.max)return this.end();else{switch(this.type){case"string":J=this.data.substring(this.index,Y);break;case"uint8array":J=this.data.subarray(this.index,Y);break;case"array":case"nodebuffer":J=this.data.slice(this.index,Y);break}return this.index=Y,this.push({data:J,meta:{percent:this.max?this.index/this.max*100:0}})}};u5.exports=p6});var wQ=E((DL,p5)=>{var RG=n();function IG(){var Q,J=[];for(var Y=0;Y<256;Y++){Q=Y;for(var $=0;$<8;$++)Q=Q&1?3988292384^Q>>>1:Q>>>1;J[Y]=Q}return J}var c5=IG();function MG(Q,J,Y,$){var q=c5,V=$+Y;Q=Q^-1;for(var K=$;K<V;K++)Q=Q>>>8^q[(Q^J[K])&255];return Q^-1}function AG(Q,J,Y,$){var q=c5,V=$+Y;Q=Q^-1;for(var K=$;K<V;K++)Q=Q>>>8^q[(Q^J.charCodeAt(K))&255];return Q^-1}p5.exports=function(J,Y){if(typeof J>"u"||!J.length)return 0;var $=RG.getTypeOf(J)!=="string";if($)return MG(Y|0,J,J.length,0);else return AG(Y|0,J,J.length,0)}});var sJ=E((EL,d5)=>{var l5=O0(),TG=wQ(),DG=n();function aJ(){l5.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}DG.inherits(aJ,l5);aJ.prototype.processChunk=function(Q){this.streamInfo.crc32=TG(Q.data,this.streamInfo.crc32||0),this.push(Q)};d5.exports=aJ});var n5=E((wL,o5)=>{var EG=n(),tJ=O0();function eJ(Q){tJ.call(this,"DataLengthProbe for "+Q),this.propName=Q,this.withStreamInfo(Q,0)}EG.inherits(eJ,tJ);eJ.prototype.processChunk=function(Q){if(Q){var J=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=J+Q.data.length}tJ.prototype.processChunk.call(this,Q)};o5.exports=eJ});var vQ=E((vL,a5)=>{var i5=f6(),r5=rJ(),wG=sJ(),QY=n5();function JY(Q,J,Y,$,q){this.compressedSize=Q,this.uncompressedSize=J,this.crc32=Y,this.compression=$,this.compressedContent=q}JY.prototype={getContentWorker:function(){var Q=new r5(i5.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new QY("data_length")),J=this;return Q.on("end",function(){if(this.streamInfo.data_length!==J.uncompressedSize)throw Error("Bug : uncompressed data size mismatch")}),Q},getCompressedWorker:function(){return new r5(i5.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}};JY.createWorkerFrom=function(Q,J,Y){return Q.pipe(new wG).pipe(new QY("uncompressedSize")).pipe(J.compressWorker(Y)).pipe(new QY("compressedSize")).withStreamInfo("compression",J)};a5.exports=JY});var Qq=E((xL,e5)=>{var vG=nJ(),xG=rJ(),YY=c6(),$Y=vQ(),s5=O0(),qY=function(Q,J,Y){this.name=Q,this.dir=Y.dir,this.date=Y.date,this.comment=Y.comment,this.unixPermissions=Y.unixPermissions,this.dosPermissions=Y.dosPermissions,this._data=J,this._dataBinary=Y.binary,this.options={compression:Y.compression,compressionOptions:Y.compressionOptions}};qY.prototype={internalStream:function(Q){var J=null,Y="string";try{if(!Q)throw Error("No output type specified.");Y=Q.toLowerCase();var $=Y==="string"||Y==="text";if(Y==="binarystring"||Y==="text")Y="string";J=this._decompressWorker();var q=!this._dataBinary;if(q&&!$)J=J.pipe(new YY.Utf8EncodeWorker);if(!q&&$)J=J.pipe(new YY.Utf8DecodeWorker)}catch(V){J=new s5("error"),J.error(V)}return new vG(J,Y,"")},async:function(Q,J){return this.internalStream(Q).accumulate(J)},nodeStream:function(Q,J){return this.internalStream(Q||"nodebuffer").toNodejsStream(J)},_compressWorker:function(Q,J){if(this._data instanceof $Y&&this._data.compression.magic===Q.magic)return this._data.getCompressedWorker();else{var Y=this._decompressWorker();if(!this._dataBinary)Y=Y.pipe(new YY.Utf8EncodeWorker);return $Y.createWorkerFrom(Y,Q,J)}},_decompressWorker:function(){if(this._data instanceof $Y)return this._data.getContentWorker();else if(this._data instanceof s5)return this._data;else return new xG(this._data)}};var t5=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],SG=function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")};for(v8=0;v8<t5.length;v8++)qY.prototype[t5[v8]]=SG;var v8;e5.exports=qY});var n0=E((VY)=>{var hG=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function _G(Q,J){return Object.prototype.hasOwnProperty.call(Q,J)}VY.assign=function(Q){var J=Array.prototype.slice.call(arguments,1);while(J.length){var Y=J.shift();if(!Y)continue;if(typeof Y!=="object")throw TypeError(Y+"must be non-object");for(var $ in Y)if(_G(Y,$))Q[$]=Y[$]}return Q};VY.shrinkBuf=function(Q,J){if(Q.length===J)return Q;if(Q.subarray)return Q.subarray(0,J);return Q.length=J,Q};var bG={arraySet:function(Q,J,Y,$,q){if(J.subarray&&Q.subarray){Q.set(J.subarray(Y,Y+$),q);return}for(var V=0;V<$;V++)Q[q+V]=J[Y+V]},flattenChunks:function(Q){var J,Y,$,q,V,K;$=0;for(J=0,Y=Q.length;J<Y;J++)$+=Q[J].length;K=new Uint8Array($),q=0;for(J=0,Y=Q.length;J<Y;J++)V=Q[J],K.set(V,q),q+=V.length;return K}},fG={arraySet:function(Q,J,Y,$,q){for(var V=0;V<$;V++)Q[q+V]=J[Y+V]},flattenChunks:function(Q){return[].concat.apply([],Q)}};VY.setTyped=function(Q){if(Q)VY.Buf8=Uint8Array,VY.Buf16=Uint16Array,VY.Buf32=Int32Array,VY.assign(VY,bG);else VY.Buf8=Array,VY.Buf16=Array,VY.Buf32=Array,VY.assign(VY,fG)};VY.setTyped(hG)});var Mq=E((G9)=>{var uG=n0(),cG=4,Yq=0,$q=1,pG=2;function d6(Q){var J=Q.length;while(--J>=0)Q[J]=0}var lG=0,Hq=1,dG=2,oG=3,nG=258,LY=29,h8=256,S8=h8+1+LY,l6=30,BY=19,Wq=2*S8+1,P6=15,XY=16,iG=7,OY=256,Uq=16,Zq=17,Lq=18,UY=[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],xQ=[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],rG=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Bq=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],aG=512,i0=Array((S8+2)*2);d6(i0);var x8=Array(l6*2);d6(x8);var k8=Array(aG);d6(k8);var y8=Array(nG-oG+1);d6(y8);var PY=Array(LY);d6(PY);var SQ=Array(l6);d6(SQ);function GY(Q,J,Y,$,q){this.static_tree=Q,this.extra_bits=J,this.extra_base=Y,this.elems=$,this.max_length=q,this.has_stree=Q&&Q.length}var Oq,Pq,jq;function HY(Q,J){this.dyn_tree=Q,this.max_code=0,this.stat_desc=J}function zq(Q){return Q<256?k8[Q]:k8[256+(Q>>>7)]}function g8(Q,J){Q.pending_buf[Q.pending++]=J&255,Q.pending_buf[Q.pending++]=J>>>8&255}function L0(Q,J,Y){if(Q.bi_valid>XY-Y)Q.bi_buf|=J<<Q.bi_valid&65535,g8(Q,Q.bi_buf),Q.bi_buf=J>>XY-Q.bi_valid,Q.bi_valid+=Y-XY;else Q.bi_buf|=J<<Q.bi_valid&65535,Q.bi_valid+=Y}function S0(Q,J,Y){L0(Q,Y[J*2],Y[J*2+1])}function Fq(Q,J){var Y=0;do Y|=Q&1,Q>>>=1,Y<<=1;while(--J>0);return Y>>>1}function sG(Q){if(Q.bi_valid===16)g8(Q,Q.bi_buf),Q.bi_buf=0,Q.bi_valid=0;else if(Q.bi_valid>=8)Q.pending_buf[Q.pending++]=Q.bi_buf&255,Q.bi_buf>>=8,Q.bi_valid-=8}function tG(Q,J){var{dyn_tree:Y,max_code:$}=J,q=J.stat_desc.static_tree,V=J.stat_desc.has_stree,K=J.stat_desc.extra_bits,X=J.stat_desc.extra_base,Z=J.stat_desc.max_length,H,U,B,P,z,N,j=0;for(P=0;P<=P6;P++)Q.bl_count[P]=0;Y[Q.heap[Q.heap_max]*2+1]=0;for(H=Q.heap_max+1;H<Wq;H++){if(U=Q.heap[H],P=Y[Y[U*2+1]*2+1]+1,P>Z)P=Z,j++;if(Y[U*2+1]=P,U>$)continue;if(Q.bl_count[P]++,z=0,U>=X)z=K[U-X];if(N=Y[U*2],Q.opt_len+=N*(P+z),V)Q.static_len+=N*(q[U*2+1]+z)}if(j===0)return;do{P=Z-1;while(Q.bl_count[P]===0)P--;Q.bl_count[P]--,Q.bl_count[P+1]+=2,Q.bl_count[Z]--,j-=2}while(j>0);for(P=Z;P!==0;P--){U=Q.bl_count[P];while(U!==0){if(B=Q.heap[--H],B>$)continue;if(Y[B*2+1]!==P)Q.opt_len+=(P-Y[B*2+1])*Y[B*2],Y[B*2+1]=P;U--}}}function Nq(Q,J,Y){var $=Array(P6+1),q=0,V,K;for(V=1;V<=P6;V++)$[V]=q=q+Y[V-1]<<1;for(K=0;K<=J;K++){var X=Q[K*2+1];if(X===0)continue;Q[K*2]=Fq($[X]++,X)}}function eG(){var Q,J,Y,$,q,V=Array(P6+1);Y=0;for($=0;$<LY-1;$++){PY[$]=Y;for(Q=0;Q<1<<UY[$];Q++)y8[Y++]=$}y8[Y-1]=$,q=0;for($=0;$<16;$++){SQ[$]=q;for(Q=0;Q<1<<xQ[$];Q++)k8[q++]=$}q>>=7;for(;$<l6;$++){SQ[$]=q<<7;for(Q=0;Q<1<<xQ[$]-7;Q++)k8[256+q++]=$}for(J=0;J<=P6;J++)V[J]=0;Q=0;while(Q<=143)i0[Q*2+1]=8,Q++,V[8]++;while(Q<=255)i0[Q*2+1]=9,Q++,V[9]++;while(Q<=279)i0[Q*2+1]=7,Q++,V[7]++;while(Q<=287)i0[Q*2+1]=8,Q++,V[8]++;Nq(i0,S8+1,V);for(Q=0;Q<l6;Q++)x8[Q*2+1]=5,x8[Q*2]=Fq(Q,5);Oq=new GY(i0,UY,h8+1,S8,P6),Pq=new GY(x8,xQ,0,l6,P6),jq=new GY([],rG,0,BY,iG)}function Cq(Q){var J;for(J=0;J<S8;J++)Q.dyn_ltree[J*2]=0;for(J=0;J<l6;J++)Q.dyn_dtree[J*2]=0;for(J=0;J<BY;J++)Q.bl_tree[J*2]=0;Q.dyn_ltree[OY*2]=1,Q.opt_len=Q.static_len=0,Q.last_lit=Q.matches=0}function Rq(Q){if(Q.bi_valid>8)g8(Q,Q.bi_buf);else if(Q.bi_valid>0)Q.pending_buf[Q.pending++]=Q.bi_buf;Q.bi_buf=0,Q.bi_valid=0}function Q9(Q,J,Y,$){if(Rq(Q),$)g8(Q,Y),g8(Q,~Y);uG.arraySet(Q.pending_buf,Q.window,J,Y,Q.pending),Q.pending+=Y}function qq(Q,J,Y,$){var q=J*2,V=Y*2;return Q[q]<Q[V]||Q[q]===Q[V]&&$[J]<=$[Y]}function WY(Q,J,Y){var $=Q.heap[Y],q=Y<<1;while(q<=Q.heap_len){if(q<Q.heap_len&&qq(J,Q.heap[q+1],Q.heap[q],Q.depth))q++;if(qq(J,$,Q.heap[q],Q.depth))break;Q.heap[Y]=Q.heap[q],Y=q,q<<=1}Q.heap[Y]=$}function Vq(Q,J,Y){var $,q,V=0,K,X;if(Q.last_lit!==0)do if($=Q.pending_buf[Q.d_buf+V*2]<<8|Q.pending_buf[Q.d_buf+V*2+1],q=Q.pending_buf[Q.l_buf+V],V++,$===0)S0(Q,q,J);else{if(K=y8[q],S0(Q,K+h8+1,J),X=UY[K],X!==0)q-=PY[K],L0(Q,q,X);if($--,K=zq($),S0(Q,K,Y),X=xQ[K],X!==0)$-=SQ[K],L0(Q,$,X)}while(V<Q.last_lit);S0(Q,OY,J)}function ZY(Q,J){var Y=J.dyn_tree,$=J.stat_desc.static_tree,q=J.stat_desc.has_stree,V=J.stat_desc.elems,K,X,Z=-1,H;Q.heap_len=0,Q.heap_max=Wq;for(K=0;K<V;K++)if(Y[K*2]!==0)Q.heap[++Q.heap_len]=Z=K,Q.depth[K]=0;else Y[K*2+1]=0;while(Q.heap_len<2)if(H=Q.heap[++Q.heap_len]=Z<2?++Z:0,Y[H*2]=1,Q.depth[H]=0,Q.opt_len--,q)Q.static_len-=$[H*2+1];J.max_code=Z;for(K=Q.heap_len>>1;K>=1;K--)WY(Q,Y,K);H=V;do K=Q.heap[1],Q.heap[1]=Q.heap[Q.heap_len--],WY(Q,Y,1),X=Q.heap[1],Q.heap[--Q.heap_max]=K,Q.heap[--Q.heap_max]=X,Y[H*2]=Y[K*2]+Y[X*2],Q.depth[H]=(Q.depth[K]>=Q.depth[X]?Q.depth[K]:Q.depth[X])+1,Y[K*2+1]=Y[X*2+1]=H,Q.heap[1]=H++,WY(Q,Y,1);while(Q.heap_len>=2);Q.heap[--Q.heap_max]=Q.heap[1],tG(Q,J),Nq(Y,Z,Q.bl_count)}function Kq(Q,J,Y){var $,q=-1,V,K=J[1],X=0,Z=7,H=4;if(K===0)Z=138,H=3;J[(Y+1)*2+1]=65535;for($=0;$<=Y;$++){if(V=K,K=J[($+1)*2+1],++X<Z&&V===K)continue;else if(X<H)Q.bl_tree[V*2]+=X;else if(V!==0){if(V!==q)Q.bl_tree[V*2]++;Q.bl_tree[Uq*2]++}else if(X<=10)Q.bl_tree[Zq*2]++;else Q.bl_tree[Lq*2]++;if(X=0,q=V,K===0)Z=138,H=3;else if(V===K)Z=6,H=3;else Z=7,H=4}}function Xq(Q,J,Y){var $,q=-1,V,K=J[1],X=0,Z=7,H=4;if(K===0)Z=138,H=3;for($=0;$<=Y;$++){if(V=K,K=J[($+1)*2+1],++X<Z&&V===K)continue;else if(X<H)do S0(Q,V,Q.bl_tree);while(--X!==0);else if(V!==0){if(V!==q)S0(Q,V,Q.bl_tree),X--;S0(Q,Uq,Q.bl_tree),L0(Q,X-3,2)}else if(X<=10)S0(Q,Zq,Q.bl_tree),L0(Q,X-3,3);else S0(Q,Lq,Q.bl_tree),L0(Q,X-11,7);if(X=0,q=V,K===0)Z=138,H=3;else if(V===K)Z=6,H=3;else Z=7,H=4}}function J9(Q){var J;Kq(Q,Q.dyn_ltree,Q.l_desc.max_code),Kq(Q,Q.dyn_dtree,Q.d_desc.max_code),ZY(Q,Q.bl_desc);for(J=BY-1;J>=3;J--)if(Q.bl_tree[Bq[J]*2+1]!==0)break;return Q.opt_len+=3*(J+1)+5+5+4,J}function Y9(Q,J,Y,$){var q;L0(Q,J-257,5),L0(Q,Y-1,5),L0(Q,$-4,4);for(q=0;q<$;q++)L0(Q,Q.bl_tree[Bq[q]*2+1],3);Xq(Q,Q.dyn_ltree,J-1),Xq(Q,Q.dyn_dtree,Y-1)}function $9(Q){var J=4093624447,Y;for(Y=0;Y<=31;Y++,J>>>=1)if(J&1&&Q.dyn_ltree[Y*2]!==0)return Yq;if(Q.dyn_ltree[18]!==0||Q.dyn_ltree[20]!==0||Q.dyn_ltree[26]!==0)return $q;for(Y=32;Y<h8;Y++)if(Q.dyn_ltree[Y*2]!==0)return $q;return Yq}var Gq=!1;function q9(Q){if(!Gq)eG(),Gq=!0;Q.l_desc=new HY(Q.dyn_ltree,Oq),Q.d_desc=new HY(Q.dyn_dtree,Pq),Q.bl_desc=new HY(Q.bl_tree,jq),Q.bi_buf=0,Q.bi_valid=0,Cq(Q)}function Iq(Q,J,Y,$){L0(Q,(lG<<1)+($?1:0),3),Q9(Q,J,Y,!0)}function V9(Q){L0(Q,Hq<<1,3),S0(Q,OY,i0),sG(Q)}function K9(Q,J,Y,$){var q,V,K=0;if(Q.level>0){if(Q.strm.data_type===pG)Q.strm.data_type=$9(Q);if(ZY(Q,Q.l_desc),ZY(Q,Q.d_desc),K=J9(Q),q=Q.opt_len+3+7>>>3,V=Q.static_len+3+7>>>3,V<=q)q=V}else q=V=Y+5;if(Y+4<=q&&J!==-1)Iq(Q,J,Y,$);else if(Q.strategy===cG||V===q)L0(Q,(Hq<<1)+($?1:0),3),Vq(Q,i0,x8);else L0(Q,(dG<<1)+($?1:0),3),Y9(Q,Q.l_desc.max_code+1,Q.d_desc.max_code+1,K+1),Vq(Q,Q.dyn_ltree,Q.dyn_dtree);if(Cq(Q),$)Rq(Q)}function X9(Q,J,Y){if(Q.pending_buf[Q.d_buf+Q.last_lit*2]=J>>>8&255,Q.pending_buf[Q.d_buf+Q.last_lit*2+1]=J&255,Q.pending_buf[Q.l_buf+Q.last_lit]=Y&255,Q.last_lit++,J===0)Q.dyn_ltree[Y*2]++;else Q.matches++,J--,Q.dyn_ltree[(y8[Y]+h8+1)*2]++,Q.dyn_dtree[zq(J)*2]++;return Q.last_lit===Q.lit_bufsize-1}G9._tr_init=q9;G9._tr_stored_block=Iq;G9._tr_flush_block=K9;G9._tr_tally=X9;G9._tr_align=V9});var jY=E((yL,Aq)=>{function B9(Q,J,Y,$){var q=Q&65535|0,V=Q>>>16&65535|0,K=0;while(Y!==0){K=Y>2000?2000:Y,Y-=K;do q=q+J[$++]|0,V=V+q|0;while(--K);q%=65521,V%=65521}return q|V<<16|0}Aq.exports=B9});var zY=E((gL,Tq)=>{function O9(){var Q,J=[];for(var Y=0;Y<256;Y++){Q=Y;for(var $=0;$<8;$++)Q=Q&1?3988292384^Q>>>1:Q>>>1;J[Y]=Q}return J}var P9=O9();function j9(Q,J,Y,$){var q=P9,V=$+Y;Q^=-1;for(var K=$;K<V;K++)Q=Q>>>8^q[(Q^J[K])&255];return Q^-1}Tq.exports=j9});var kQ=E((hL,Dq)=>{Dq.exports={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"}});var hq=E((a9)=>{var H0=n0(),z0=Mq(),xq=jY(),Y6=zY(),z9=kQ(),N6=0,F9=1,N9=3,X6=4,Eq=5,y0=0,wq=1,F0=-2,C9=-3,FY=-5,R9=-1,I9=1,yQ=2,M9=3,A9=4,T9=0,D9=2,bQ=8,E9=9,w9=15,v9=8,x9=29,S9=256,CY=S9+1+x9,k9=30,y9=19,g9=2*CY+1,h9=15,h=3,V6=258,I0=V6+h+1,_9=32,fQ=42,RY=69,gQ=73,hQ=91,_Q=103,j6=113,b8=666,Y0=1,f8=2,z6=3,i6=4,b9=3;function K6(Q,J){return Q.msg=z9[J],J}function vq(Q){return(Q<<1)-(Q>4?9:0)}function q6(Q){var J=Q.length;while(--J>=0)Q[J]=0}function $6(Q){var J=Q.state,Y=J.pending;if(Y>Q.avail_out)Y=Q.avail_out;if(Y===0)return;if(H0.arraySet(Q.output,J.pending_buf,J.pending_out,Y,Q.next_out),Q.next_out+=Y,J.pending_out+=Y,Q.total_out+=Y,Q.avail_out-=Y,J.pending-=Y,J.pending===0)J.pending_out=0}function X0(Q,J){z0._tr_flush_block(Q,Q.block_start>=0?Q.block_start:-1,Q.strstart-Q.block_start,J),Q.block_start=Q.strstart,$6(Q.strm)}function b(Q,J){Q.pending_buf[Q.pending++]=J}function _8(Q,J){Q.pending_buf[Q.pending++]=J>>>8&255,Q.pending_buf[Q.pending++]=J&255}function f9(Q,J,Y,$){var q=Q.avail_in;if(q>$)q=$;if(q===0)return 0;if(Q.avail_in-=q,H0.arraySet(J,Q.input,Q.next_in,q,Y),Q.state.wrap===1)Q.adler=xq(Q.adler,J,q,Y);else if(Q.state.wrap===2)Q.adler=Y6(Q.adler,J,q,Y);return Q.next_in+=q,Q.total_in+=q,q}function Sq(Q,J){var{max_chain_length:Y,strstart:$}=Q,q,V,K=Q.prev_length,X=Q.nice_match,Z=Q.strstart>Q.w_size-I0?Q.strstart-(Q.w_size-I0):0,H=Q.window,U=Q.w_mask,B=Q.prev,P=Q.strstart+V6,z=H[$+K-1],N=H[$+K];if(Q.prev_length>=Q.good_match)Y>>=2;if(X>Q.lookahead)X=Q.lookahead;do{if(q=J,H[q+K]!==N||H[q+K-1]!==z||H[q]!==H[$]||H[++q]!==H[$+1])continue;$+=2,q++;do;while(H[++$]===H[++q]&&H[++$]===H[++q]&&H[++$]===H[++q]&&H[++$]===H[++q]&&H[++$]===H[++q]&&H[++$]===H[++q]&&H[++$]===H[++q]&&H[++$]===H[++q]&&$<P);if(V=V6-(P-$),$=P-V6,V>K){if(Q.match_start=J,K=V,V>=X)break;z=H[$+K-1],N=H[$+K]}}while((J=B[J&U])>Z&&--Y!==0);if(K<=Q.lookahead)return K;return Q.lookahead}function F6(Q){var J=Q.w_size,Y,$,q,V,K;do{if(V=Q.window_size-Q.lookahead-Q.strstart,Q.strstart>=J+(J-I0)){H0.arraySet(Q.window,Q.window,J,J,0),Q.match_start-=J,Q.strstart-=J,Q.block_start-=J,$=Q.hash_size,Y=$;do q=Q.head[--Y],Q.head[Y]=q>=J?q-J:0;while(--$);$=J,Y=$;do q=Q.prev[--Y],Q.prev[Y]=q>=J?q-J:0;while(--$);V+=J}if(Q.strm.avail_in===0)break;if($=f9(Q.strm,Q.window,Q.strstart+Q.lookahead,V),Q.lookahead+=$,Q.lookahead+Q.insert>=h){K=Q.strstart-Q.insert,Q.ins_h=Q.window[K],Q.ins_h=(Q.ins_h<<Q.hash_shift^Q.window[K+1])&Q.hash_mask;while(Q.insert)if(Q.ins_h=(Q.ins_h<<Q.hash_shift^Q.window[K+h-1])&Q.hash_mask,Q.prev[K&Q.w_mask]=Q.head[Q.ins_h],Q.head[Q.ins_h]=K,K++,Q.insert--,Q.lookahead+Q.insert<h)break}}while(Q.lookahead<I0&&Q.strm.avail_in!==0)}function m9(Q,J){var Y=65535;if(Y>Q.pending_buf_size-5)Y=Q.pending_buf_size-5;for(;;){if(Q.lookahead<=1){if(F6(Q),Q.lookahead===0&&J===N6)return Y0;if(Q.lookahead===0)break}Q.strstart+=Q.lookahead,Q.lookahead=0;var $=Q.block_start+Y;if(Q.strstart===0||Q.strstart>=$){if(Q.lookahead=Q.strstart-$,Q.strstart=$,X0(Q,!1),Q.strm.avail_out===0)return Y0}if(Q.strstart-Q.block_start>=Q.w_size-I0){if(X0(Q,!1),Q.strm.avail_out===0)return Y0}}if(Q.insert=0,J===X6){if(X0(Q,!0),Q.strm.avail_out===0)return z6;return i6}if(Q.strstart>Q.block_start){if(X0(Q,!1),Q.strm.avail_out===0)return Y0}return Y0}function NY(Q,J){var Y,$;for(;;){if(Q.lookahead<I0){if(F6(Q),Q.lookahead<I0&&J===N6)return Y0;if(Q.lookahead===0)break}if(Y=0,Q.lookahead>=h)Q.ins_h=(Q.ins_h<<Q.hash_shift^Q.window[Q.strstart+h-1])&Q.hash_mask,Y=Q.prev[Q.strstart&Q.w_mask]=Q.head[Q.ins_h],Q.head[Q.ins_h]=Q.strstart;if(Y!==0&&Q.strstart-Y<=Q.w_size-I0)Q.match_length=Sq(Q,Y);if(Q.match_length>=h)if($=z0._tr_tally(Q,Q.strstart-Q.match_start,Q.match_length-h),Q.lookahead-=Q.match_length,Q.match_length<=Q.max_lazy_match&&Q.lookahead>=h){Q.match_length--;do Q.strstart++,Q.ins_h=(Q.ins_h<<Q.hash_shift^Q.window[Q.strstart+h-1])&Q.hash_mask,Y=Q.prev[Q.strstart&Q.w_mask]=Q.head[Q.ins_h],Q.head[Q.ins_h]=Q.strstart;while(--Q.match_length!==0);Q.strstart++}else Q.strstart+=Q.match_length,Q.match_length=0,Q.ins_h=Q.window[Q.strstart],Q.ins_h=(Q.ins_h<<Q.hash_shift^Q.window[Q.strstart+1])&Q.hash_mask;else $=z0._tr_tally(Q,0,Q.window[Q.strstart]),Q.lookahead--,Q.strstart++;if($){if(X0(Q,!1),Q.strm.avail_out===0)return Y0}}if(Q.insert=Q.strstart<h-1?Q.strstart:h-1,J===X6){if(X0(Q,!0),Q.strm.avail_out===0)return z6;return i6}if(Q.last_lit){if(X0(Q,!1),Q.strm.avail_out===0)return Y0}return f8}function o6(Q,J){var Y,$,q;for(;;){if(Q.lookahead<I0){if(F6(Q),Q.lookahead<I0&&J===N6)return Y0;if(Q.lookahead===0)break}if(Y=0,Q.lookahead>=h)Q.ins_h=(Q.ins_h<<Q.hash_shift^Q.window[Q.strstart+h-1])&Q.hash_mask,Y=Q.prev[Q.strstart&Q.w_mask]=Q.head[Q.ins_h],Q.head[Q.ins_h]=Q.strstart;if(Q.prev_length=Q.match_length,Q.prev_match=Q.match_start,Q.match_length=h-1,Y!==0&&Q.prev_length<Q.max_lazy_match&&Q.strstart-Y<=Q.w_size-I0){if(Q.match_length=Sq(Q,Y),Q.match_length<=5&&(Q.strategy===I9||Q.match_length===h&&Q.strstart-Q.match_start>4096))Q.match_length=h-1}if(Q.prev_length>=h&&Q.match_length<=Q.prev_length){q=Q.strstart+Q.lookahead-h,$=z0._tr_tally(Q,Q.strstart-1-Q.prev_match,Q.prev_length-h),Q.lookahead-=Q.prev_length-1,Q.prev_length-=2;do if(++Q.strstart<=q)Q.ins_h=(Q.ins_h<<Q.hash_shift^Q.window[Q.strstart+h-1])&Q.hash_mask,Y=Q.prev[Q.strstart&Q.w_mask]=Q.head[Q.ins_h],Q.head[Q.ins_h]=Q.strstart;while(--Q.prev_length!==0);if(Q.match_available=0,Q.match_length=h-1,Q.strstart++,$){if(X0(Q,!1),Q.strm.avail_out===0)return Y0}}else if(Q.match_available){if($=z0._tr_tally(Q,0,Q.window[Q.strstart-1]),$)X0(Q,!1);if(Q.strstart++,Q.lookahead--,Q.strm.avail_out===0)return Y0}else Q.match_available=1,Q.strstart++,Q.lookahead--}if(Q.match_available)$=z0._tr_tally(Q,0,Q.window[Q.strstart-1]),Q.match_available=0;if(Q.insert=Q.strstart<h-1?Q.strstart:h-1,J===X6){if(X0(Q,!0),Q.strm.avail_out===0)return z6;return i6}if(Q.last_lit){if(X0(Q,!1),Q.strm.avail_out===0)return Y0}return f8}function u9(Q,J){var Y,$,q,V,K=Q.window;for(;;){if(Q.lookahead<=V6){if(F6(Q),Q.lookahead<=V6&&J===N6)return Y0;if(Q.lookahead===0)break}if(Q.match_length=0,Q.lookahead>=h&&Q.strstart>0){if(q=Q.strstart-1,$=K[q],$===K[++q]&&$===K[++q]&&$===K[++q]){V=Q.strstart+V6;do;while($===K[++q]&&$===K[++q]&&$===K[++q]&&$===K[++q]&&$===K[++q]&&$===K[++q]&&$===K[++q]&&$===K[++q]&&q<V);if(Q.match_length=V6-(V-q),Q.match_length>Q.lookahead)Q.match_length=Q.lookahead}}if(Q.match_length>=h)Y=z0._tr_tally(Q,1,Q.match_length-h),Q.lookahead-=Q.match_length,Q.strstart+=Q.match_length,Q.match_length=0;else Y=z0._tr_tally(Q,0,Q.window[Q.strstart]),Q.lookahead--,Q.strstart++;if(Y){if(X0(Q,!1),Q.strm.avail_out===0)return Y0}}if(Q.insert=0,J===X6){if(X0(Q,!0),Q.strm.avail_out===0)return z6;return i6}if(Q.last_lit){if(X0(Q,!1),Q.strm.avail_out===0)return Y0}return f8}function c9(Q,J){var Y;for(;;){if(Q.lookahead===0){if(F6(Q),Q.lookahead===0){if(J===N6)return Y0;break}}if(Q.match_length=0,Y=z0._tr_tally(Q,0,Q.window[Q.strstart]),Q.lookahead--,Q.strstart++,Y){if(X0(Q,!1),Q.strm.avail_out===0)return Y0}}if(Q.insert=0,J===X6){if(X0(Q,!0),Q.strm.avail_out===0)return z6;return i6}if(Q.last_lit){if(X0(Q,!1),Q.strm.avail_out===0)return Y0}return f8}function k0(Q,J,Y,$,q){this.good_length=Q,this.max_lazy=J,this.nice_length=Y,this.max_chain=$,this.func=q}var n6;n6=[new k0(0,0,0,0,m9),new k0(4,4,8,4,NY),new k0(4,5,16,8,NY),new k0(4,6,32,32,NY),new k0(4,4,16,16,o6),new k0(8,16,32,32,o6),new k0(8,16,128,128,o6),new k0(8,32,128,256,o6),new k0(32,128,258,1024,o6),new k0(32,258,258,4096,o6)];function p9(Q){Q.window_size=2*Q.w_size,q6(Q.head),Q.max_lazy_match=n6[Q.level].max_lazy,Q.good_match=n6[Q.level].good_length,Q.nice_match=n6[Q.level].nice_length,Q.max_chain_length=n6[Q.level].max_chain,Q.strstart=0,Q.block_start=0,Q.lookahead=0,Q.insert=0,Q.match_length=Q.prev_length=h-1,Q.match_available=0,Q.ins_h=0}function l9(){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=bQ,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 H0.Buf16(g9*2),this.dyn_dtree=new H0.Buf16((2*k9+1)*2),this.bl_tree=new H0.Buf16((2*y9+1)*2),q6(this.dyn_ltree),q6(this.dyn_dtree),q6(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new H0.Buf16(h9+1),this.heap=new H0.Buf16(2*CY+1),q6(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new H0.Buf16(2*CY+1),q6(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 kq(Q){var J;if(!Q||!Q.state)return K6(Q,F0);if(Q.total_in=Q.total_out=0,Q.data_type=D9,J=Q.state,J.pending=0,J.pending_out=0,J.wrap<0)J.wrap=-J.wrap;return J.status=J.wrap?fQ:j6,Q.adler=J.wrap===2?0:1,J.last_flush=N6,z0._tr_init(J),y0}function yq(Q){var J=kq(Q);if(J===y0)p9(Q.state);return J}function d9(Q,J){if(!Q||!Q.state)return F0;if(Q.state.wrap!==2)return F0;return Q.state.gzhead=J,y0}function gq(Q,J,Y,$,q,V){if(!Q)return F0;var K=1;if(J===R9)J=6;if($<0)K=0,$=-$;else if($>15)K=2,$-=16;if(q<1||q>E9||Y!==bQ||$<8||$>15||J<0||J>9||V<0||V>A9)return K6(Q,F0);if($===8)$=9;var X=new l9;return Q.state=X,X.strm=Q,X.wrap=K,X.gzhead=null,X.w_bits=$,X.w_size=1<<X.w_bits,X.w_mask=X.w_size-1,X.hash_bits=q+7,X.hash_size=1<<X.hash_bits,X.hash_mask=X.hash_size-1,X.hash_shift=~~((X.hash_bits+h-1)/h),X.window=new H0.Buf8(X.w_size*2),X.head=new H0.Buf16(X.hash_size),X.prev=new H0.Buf16(X.w_size),X.lit_bufsize=1<<q+6,X.pending_buf_size=X.lit_bufsize*4,X.pending_buf=new H0.Buf8(X.pending_buf_size),X.d_buf=1*X.lit_bufsize,X.l_buf=3*X.lit_bufsize,X.level=J,X.strategy=V,X.method=Y,yq(Q)}function o9(Q,J){return gq(Q,J,bQ,w9,v9,T9)}function n9(Q,J){var Y,$,q,V;if(!Q||!Q.state||J>Eq||J<0)return Q?K6(Q,F0):F0;if($=Q.state,!Q.output||!Q.input&&Q.avail_in!==0||$.status===b8&&J!==X6)return K6(Q,Q.avail_out===0?FY:F0);if($.strm=Q,Y=$.last_flush,$.last_flush=J,$.status===fQ)if($.wrap===2)if(Q.adler=0,b($,31),b($,139),b($,8),!$.gzhead)b($,0),b($,0),b($,0),b($,0),b($,0),b($,$.level===9?2:$.strategy>=yQ||$.level<2?4:0),b($,b9),$.status=j6;else{if(b($,($.gzhead.text?1:0)+($.gzhead.hcrc?2:0)+(!$.gzhead.extra?0:4)+(!$.gzhead.name?0:8)+(!$.gzhead.comment?0:16)),b($,$.gzhead.time&255),b($,$.gzhead.time>>8&255),b($,$.gzhead.time>>16&255),b($,$.gzhead.time>>24&255),b($,$.level===9?2:$.strategy>=yQ||$.level<2?4:0),b($,$.gzhead.os&255),$.gzhead.extra&&$.gzhead.extra.length)b($,$.gzhead.extra.length&255),b($,$.gzhead.extra.length>>8&255);if($.gzhead.hcrc)Q.adler=Y6(Q.adler,$.pending_buf,$.pending,0);$.gzindex=0,$.status=RY}else{var K=bQ+($.w_bits-8<<4)<<8,X=-1;if($.strategy>=yQ||$.level<2)X=0;else if($.level<6)X=1;else if($.level===6)X=2;else X=3;if(K|=X<<6,$.strstart!==0)K|=_9;if(K+=31-K%31,$.status=j6,_8($,K),$.strstart!==0)_8($,Q.adler>>>16),_8($,Q.adler&65535);Q.adler=1}if($.status===RY)if($.gzhead.extra){q=$.pending;while($.gzindex<($.gzhead.extra.length&65535)){if($.pending===$.pending_buf_size){if($.gzhead.hcrc&&$.pending>q)Q.adler=Y6(Q.adler,$.pending_buf,$.pending-q,q);if($6(Q),q=$.pending,$.pending===$.pending_buf_size)break}b($,$.gzhead.extra[$.gzindex]&255),$.gzindex++}if($.gzhead.hcrc&&$.pending>q)Q.adler=Y6(Q.adler,$.pending_buf,$.pending-q,q);if($.gzindex===$.gzhead.extra.length)$.gzindex=0,$.status=gQ}else $.status=gQ;if($.status===gQ)if($.gzhead.name){q=$.pending;do{if($.pending===$.pending_buf_size){if($.gzhead.hcrc&&$.pending>q)Q.adler=Y6(Q.adler,$.pending_buf,$.pending-q,q);if($6(Q),q=$.pending,$.pending===$.pending_buf_size){V=1;break}}if($.gzindex<$.gzhead.name.length)V=$.gzhead.name.charCodeAt($.gzindex++)&255;else V=0;b($,V)}while(V!==0);if($.gzhead.hcrc&&$.pending>q)Q.adler=Y6(Q.adler,$.pending_buf,$.pending-q,q);if(V===0)$.gzindex=0,$.status=hQ}else $.status=hQ;if($.status===hQ)if($.gzhead.comment){q=$.pending;do{if($.pending===$.pending_buf_size){if($.gzhead.hcrc&&$.pending>q)Q.adler=Y6(Q.adler,$.pending_buf,$.pending-q,q);if($6(Q),q=$.pending,$.pending===$.pending_buf_size){V=1;break}}if($.gzindex<$.gzhead.comment.length)V=$.gzhead.comment.charCodeAt($.gzindex++)&255;else V=0;b($,V)}while(V!==0);if($.gzhead.hcrc&&$.pending>q)Q.adler=Y6(Q.adler,$.pending_buf,$.pending-q,q);if(V===0)$.status=_Q}else $.status=_Q;if($.status===_Q)if($.gzhead.hcrc){if($.pending+2>$.pending_buf_size)$6(Q);if($.pending+2<=$.pending_buf_size)b($,Q.adler&255),b($,Q.adler>>8&255),Q.adler=0,$.status=j6}else $.status=j6;if($.pending!==0){if($6(Q),Q.avail_out===0)return $.last_flush=-1,y0}else if(Q.avail_in===0&&vq(J)<=vq(Y)&&J!==X6)return K6(Q,FY);if($.status===b8&&Q.avail_in!==0)return K6(Q,FY);if(Q.avail_in!==0||$.lookahead!==0||J!==N6&&$.status!==b8){var Z=$.strategy===yQ?c9($,J):$.strategy===M9?u9($,J):n6[$.level].func($,J);if(Z===z6||Z===i6)$.status=b8;if(Z===Y0||Z===z6){if(Q.avail_out===0)$.last_flush=-1;return y0}if(Z===f8){if(J===F9)z0._tr_align($);else if(J!==Eq){if(z0._tr_stored_block($,0,0,!1),J===N9){if(q6($.head),$.lookahead===0)$.strstart=0,$.block_start=0,$.insert=0}}if($6(Q),Q.avail_out===0)return $.last_flush=-1,y0}}if(J!==X6)return y0;if($.wrap<=0)return wq;if($.wrap===2)b($,Q.adler&255),b($,Q.adler>>8&255),b($,Q.adler>>16&255),b($,Q.adler>>24&255),b($,Q.total_in&255),b($,Q.total_in>>8&255),b($,Q.total_in>>16&255),b($,Q.total_in>>24&255);else _8($,Q.adler>>>16),_8($,Q.adler&65535);if($6(Q),$.wrap>0)$.wrap=-$.wrap;return $.pending!==0?y0:wq}function i9(Q){var J;if(!Q||!Q.state)return F0;if(J=Q.state.status,J!==fQ&&J!==RY&&J!==gQ&&J!==hQ&&J!==_Q&&J!==j6&&J!==b8)return K6(Q,F0);return Q.state=null,J===j6?K6(Q,C9):y0}function r9(Q,J){var Y=J.length,$,q,V,K,X,Z,H,U;if(!Q||!Q.state)return F0;if($=Q.state,K=$.wrap,K===2||K===1&&$.status!==fQ||$.lookahead)return F0;if(K===1)Q.adler=xq(Q.adler,J,Y,0);if($.wrap=0,Y>=$.w_size){if(K===0)q6($.head),$.strstart=0,$.block_start=0,$.insert=0;U=new H0.Buf8($.w_size),H0.arraySet(U,J,Y-$.w_size,$.w_size,0),J=U,Y=$.w_size}X=Q.avail_in,Z=Q.next_in,H=Q.input,Q.avail_in=Y,Q.next_in=0,Q.input=J,F6($);while($.lookahead>=h){q=$.strstart,V=$.lookahead-(h-1);do $.ins_h=($.ins_h<<$.hash_shift^$.window[q+h-1])&$.hash_mask,$.prev[q&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=q,q++;while(--V);$.strstart=q,$.lookahead=h-1,F6($)}return $.strstart+=$.lookahead,$.block_start=$.strstart,$.insert=$.lookahead,$.lookahead=0,$.match_length=$.prev_length=h-1,$.match_available=0,Q.next_in=Z,Q.input=H,Q.avail_in=X,$.wrap=K,y0}a9.deflateInit=o9;a9.deflateInit2=gq;a9.deflateReset=yq;a9.deflateResetKeep=kq;a9.deflateSetHeader=d9;a9.deflate=n9;a9.deflateEnd=i9;a9.deflateSetDictionary=r9;a9.deflateInfo="pako deflate (from Nodeca project)"});var IY=E((KH)=>{var mQ=n0(),_q=!0,bq=!0;try{String.fromCharCode.apply(null,[0])}catch(Q){_q=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(Q){bq=!1}var m8=new mQ.Buf8(256);for(g0=0;g0<256;g0++)m8[g0]=g0>=252?6:g0>=248?5:g0>=240?4:g0>=224?3:g0>=192?2:1;var g0;m8[254]=m8[254]=1;KH.string2buf=function(Q){var J,Y,$,q,V,K=Q.length,X=0;for(q=0;q<K;q++){if(Y=Q.charCodeAt(q),(Y&64512)===55296&&q+1<K){if($=Q.charCodeAt(q+1),($&64512)===56320)Y=65536+(Y-55296<<10)+($-56320),q++}X+=Y<128?1:Y<2048?2:Y<65536?3:4}J=new mQ.Buf8(X);for(V=0,q=0;V<X;q++){if(Y=Q.charCodeAt(q),(Y&64512)===55296&&q+1<K){if($=Q.charCodeAt(q+1),($&64512)===56320)Y=65536+(Y-55296<<10)+($-56320),q++}if(Y<128)J[V++]=Y;else if(Y<2048)J[V++]=192|Y>>>6,J[V++]=128|Y&63;else if(Y<65536)J[V++]=224|Y>>>12,J[V++]=128|Y>>>6&63,J[V++]=128|Y&63;else J[V++]=240|Y>>>18,J[V++]=128|Y>>>12&63,J[V++]=128|Y>>>6&63,J[V++]=128|Y&63}return J};function fq(Q,J){if(J<65534){if(Q.subarray&&bq||!Q.subarray&&_q)return String.fromCharCode.apply(null,mQ.shrinkBuf(Q,J))}var Y="";for(var $=0;$<J;$++)Y+=String.fromCharCode(Q[$]);return Y}KH.buf2binstring=function(Q){return fq(Q,Q.length)};KH.binstring2buf=function(Q){var J=new mQ.Buf8(Q.length);for(var Y=0,$=J.length;Y<$;Y++)J[Y]=Q.charCodeAt(Y);return J};KH.buf2string=function(Q,J){var Y,$,q,V,K=J||Q.length,X=Array(K*2);for($=0,Y=0;Y<K;){if(q=Q[Y++],q<128){X[$++]=q;continue}if(V=m8[q],V>4){X[$++]=65533,Y+=V-1;continue}q&=V===2?31:V===3?15:7;while(V>1&&Y<K)q=q<<6|Q[Y++]&63,V--;if(V>1){X[$++]=65533;continue}if(q<65536)X[$++]=q;else q-=65536,X[$++]=55296|q>>10&1023,X[$++]=56320|q&1023}return fq(X,$)};KH.utf8border=function(Q,J){var Y;if(J=J||Q.length,J>Q.length)J=Q.length;Y=J-1;while(Y>=0&&(Q[Y]&192)===128)Y--;if(Y<0)return J;if(Y===0)return J;return Y+m8[Q[Y]]>J?Y:J}});var MY=E((fL,mq)=>{function ZH(){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}mq.exports=ZH});var lq=E((NH)=>{var u8=hq(),c8=n0(),TY=IY(),DY=kQ(),LH=MY(),pq=Object.prototype.toString,BH=0,AY=4,r6=0,uq=1,cq=2,OH=-1,PH=0,jH=8;function C6(Q){if(!(this instanceof C6))return new C6(Q);this.options=c8.assign({level:OH,method:jH,chunkSize:16384,windowBits:15,memLevel:8,strategy:PH,to:""},Q||{});var J=this.options;if(J.raw&&J.windowBits>0)J.windowBits=-J.windowBits;else if(J.gzip&&J.windowBits>0&&J.windowBits<16)J.windowBits+=16;this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new LH,this.strm.avail_out=0;var Y=u8.deflateInit2(this.strm,J.level,J.method,J.windowBits,J.memLevel,J.strategy);if(Y!==r6)throw Error(DY[Y]);if(J.header)u8.deflateSetHeader(this.strm,J.header);if(J.dictionary){var $;if(typeof J.dictionary==="string")$=TY.string2buf(J.dictionary);else if(pq.call(J.dictionary)==="[object ArrayBuffer]")$=new Uint8Array(J.dictionary);else $=J.dictionary;if(Y=u8.deflateSetDictionary(this.strm,$),Y!==r6)throw Error(DY[Y]);this._dict_set=!0}}C6.prototype.push=function(Q,J){var Y=this.strm,$=this.options.chunkSize,q,V;if(this.ended)return!1;if(V=J===~~J?J:J===!0?AY:BH,typeof Q==="string")Y.input=TY.string2buf(Q);else if(pq.call(Q)==="[object ArrayBuffer]")Y.input=new Uint8Array(Q);else Y.input=Q;Y.next_in=0,Y.avail_in=Y.input.length;do{if(Y.avail_out===0)Y.output=new c8.Buf8($),Y.next_out=0,Y.avail_out=$;if(q=u8.deflate(Y,V),q!==uq&&q!==r6)return this.onEnd(q),this.ended=!0,!1;if(Y.avail_out===0||Y.avail_in===0&&(V===AY||V===cq))if(this.options.to==="string")this.onData(TY.buf2binstring(c8.shrinkBuf(Y.output,Y.next_out)));else this.onData(c8.shrinkBuf(Y.output,Y.next_out))}while((Y.avail_in>0||Y.avail_out===0)&&q!==uq);if(V===AY)return q=u8.deflateEnd(this.strm),this.onEnd(q),this.ended=!0,q===r6;if(V===cq)return this.onEnd(r6),Y.avail_out=0,!0;return!0};C6.prototype.onData=function(Q){this.chunks.push(Q)};C6.prototype.onEnd=function(Q){if(Q===r6)if(this.options.to==="string")this.result=this.chunks.join("");else this.result=c8.flattenChunks(this.chunks);this.chunks=[],this.err=Q,this.msg=this.strm.msg};function EY(Q,J){var Y=new C6(J);if(Y.push(Q,!0),Y.err)throw Y.msg||DY[Y.err];return Y.result}function zH(Q,J){return J=J||{},J.raw=!0,EY(Q,J)}function FH(Q,J){return J=J||{},J.gzip=!0,EY(Q,J)}NH.Deflate=C6;NH.deflate=EY;NH.deflateRaw=zH;NH.gzip=FH});var oq=E((uL,dq)=>{var uQ=30,AH=12;dq.exports=function(J,Y){var $,q,V,K,X,Z,H,U,B,P,z,N,j,C,A,M,T,R,D,x,w,v,L,k,I;$=J.state,q=J.next_in,k=J.input,V=q+(J.avail_in-5),K=J.next_out,I=J.output,X=K-(Y-J.avail_out),Z=K+(J.avail_out-257),H=$.dmax,U=$.wsize,B=$.whave,P=$.wnext,z=$.window,N=$.hold,j=$.bits,C=$.lencode,A=$.distcode,M=(1<<$.lenbits)-1,T=(1<<$.distbits)-1;Q:do{if(j<15)N+=k[q++]<<j,j+=8,N+=k[q++]<<j,j+=8;R=C[N&M];J:for(;;){if(D=R>>>24,N>>>=D,j-=D,D=R>>>16&255,D===0)I[K++]=R&65535;else if(D&16){if(x=R&65535,D&=15,D){if(j<D)N+=k[q++]<<j,j+=8;x+=N&(1<<D)-1,N>>>=D,j-=D}if(j<15)N+=k[q++]<<j,j+=8,N+=k[q++]<<j,j+=8;R=A[N&T];Y:for(;;){if(D=R>>>24,N>>>=D,j-=D,D=R>>>16&255,D&16){if(w=R&65535,D&=15,j<D){if(N+=k[q++]<<j,j+=8,j<D)N+=k[q++]<<j,j+=8}if(w+=N&(1<<D)-1,w>H){J.msg="invalid distance too far back",$.mode=uQ;break Q}if(N>>>=D,j-=D,D=K-X,w>D){if(D=w-D,D>B){if($.sane){J.msg="invalid distance too far back",$.mode=uQ;break Q}}if(v=0,L=z,P===0){if(v+=U-D,D<x){x-=D;do I[K++]=z[v++];while(--D);v=K-w,L=I}}else if(P<D){if(v+=U+P-D,D-=P,D<x){x-=D;do I[K++]=z[v++];while(--D);if(v=0,P<x){D=P,x-=D;do I[K++]=z[v++];while(--D);v=K-w,L=I}}}else if(v+=P-D,D<x){x-=D;do I[K++]=z[v++];while(--D);v=K-w,L=I}while(x>2)I[K++]=L[v++],I[K++]=L[v++],I[K++]=L[v++],x-=3;if(x){if(I[K++]=L[v++],x>1)I[K++]=L[v++]}}else{v=K-w;do I[K++]=I[v++],I[K++]=I[v++],I[K++]=I[v++],x-=3;while(x>2);if(x){if(I[K++]=I[v++],x>1)I[K++]=I[v++]}}}else if((D&64)===0){R=A[(R&65535)+(N&(1<<D)-1)];continue Y}else{J.msg="invalid distance code",$.mode=uQ;break Q}break}}else if((D&64)===0){R=C[(R&65535)+(N&(1<<D)-1)];continue J}else if(D&32){$.mode=AH;break Q}else{J.msg="invalid literal/length code",$.mode=uQ;break Q}break}}while(q<V&&K<Z);x=j>>3,q-=x,j-=x<<3,N&=(1<<j)-1,J.next_in=q,J.next_out=K,J.avail_in=q<V?5+(V-q):5-(q-V),J.avail_out=K<Z?257+(Z-K):257-(K-Z),$.hold=N,$.bits=j;return}});var eq=E((cL,tq)=>{var nq=n0(),a6=15,iq=852,rq=592,aq=0,wY=1,sq=2,TH=[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],DH=[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],EH=[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],wH=[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];tq.exports=function(J,Y,$,q,V,K,X,Z){var H=Z.bits,U=0,B=0,P=0,z=0,N=0,j=0,C=0,A=0,M=0,T=0,R,D,x,w,v,L=null,k=0,I,_=new nq.Buf16(a6+1),o=new nq.Buf16(a6+1),i=null,D0=0,y,$0,W0;for(U=0;U<=a6;U++)_[U]=0;for(B=0;B<q;B++)_[Y[$+B]]++;N=H;for(z=a6;z>=1;z--)if(_[z]!==0)break;if(N>z)N=z;if(z===0)return V[K++]=20971520,V[K++]=20971520,Z.bits=1,0;for(P=1;P<z;P++)if(_[P]!==0)break;if(N<P)N=P;A=1;for(U=1;U<=a6;U++)if(A<<=1,A-=_[U],A<0)return-1;if(A>0&&(J===aq||z!==1))return-1;o[1]=0;for(U=1;U<a6;U++)o[U+1]=o[U]+_[U];for(B=0;B<q;B++)if(Y[$+B]!==0)X[o[Y[$+B]]++]=B;if(J===aq)L=i=X,I=19;else if(J===wY)L=TH,k-=257,i=DH,D0-=257,I=256;else L=EH,i=wH,I=-1;if(T=0,B=0,U=P,v=K,j=N,C=0,x=-1,M=1<<N,w=M-1,J===wY&&M>iq||J===sq&&M>rq)return 1;for(;;){if(y=U-C,X[B]<I)$0=0,W0=X[B];else if(X[B]>I)$0=i[D0+X[B]],W0=L[k+X[B]];else $0=96,W0=0;R=1<<U-C,D=1<<j,P=D;do D-=R,V[v+(T>>C)+D]=y<<24|$0<<16|W0|0;while(D!==0);R=1<<U-1;while(T&R)R>>=1;if(R!==0)T&=R-1,T+=R;else T=0;if(B++,--_[U]===0){if(U===z)break;U=Y[$+X[B]]}if(U>N&&(T&w)!==x){if(C===0)C=N;v+=P,j=U-C,A=1<<j;while(j+C<z){if(A-=_[j+C],A<=0)break;j++,A<<=1}if(M+=1<<j,J===wY&&M>iq||J===sq&&M>rq)return 1;x=T&w,V[x]=N<<24|j<<16|v-K|0}}if(T!==0)V[v+T]=U-C<<24|4194304|0;return Z.bits=N,0}});var yV=E((iH)=>{var P0=n0(),gY=jY(),h0=zY(),vH=oq(),p8=eq(),xH=0,AV=1,TV=2,QV=4,SH=5,cQ=6,R6=0,kH=1,yH=2,N0=-2,DV=-3,hY=-4,gH=-5,JV=8,EV=1,YV=2,$V=3,qV=4,VV=5,KV=6,XV=7,GV=8,HV=9,WV=10,dQ=11,r0=12,vY=13,UV=14,xY=15,ZV=16,LV=17,BV=18,OV=19,pQ=20,lQ=21,PV=22,jV=23,zV=24,FV=25,NV=26,SY=27,CV=28,RV=29,d=30,_Y=31,hH=32,_H=852,bH=592,fH=15,mH=fH;function IV(Q){return(Q>>>24&255)+(Q>>>8&65280)+((Q&65280)<<8)+((Q&255)<<24)}function uH(){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 P0.Buf16(320),this.work=new P0.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function wV(Q){var J;if(!Q||!Q.state)return N0;if(J=Q.state,Q.total_in=Q.total_out=J.total=0,Q.msg="",J.wrap)Q.adler=J.wrap&1;return J.mode=EV,J.last=0,J.havedict=0,J.dmax=32768,J.head=null,J.hold=0,J.bits=0,J.lencode=J.lendyn=new P0.Buf32(_H),J.distcode=J.distdyn=new P0.Buf32(bH),J.sane=1,J.back=-1,R6}function vV(Q){var J;if(!Q||!Q.state)return N0;return J=Q.state,J.wsize=0,J.whave=0,J.wnext=0,wV(Q)}function xV(Q,J){var Y,$;if(!Q||!Q.state)return N0;if($=Q.state,J<0)Y=0,J=-J;else if(Y=(J>>4)+1,J<48)J&=15;if(J&&(J<8||J>15))return N0;if($.window!==null&&$.wbits!==J)$.window=null;return $.wrap=Y,$.wbits=J,vV(Q)}function SV(Q,J){var Y,$;if(!Q)return N0;if($=new uH,Q.state=$,$.window=null,Y=xV(Q,J),Y!==R6)Q.state=null;return Y}function cH(Q){return SV(Q,mH)}var MV=!0,kY,yY;function pH(Q){if(MV){var J;kY=new P0.Buf32(512),yY=new P0.Buf32(32),J=0;while(J<144)Q.lens[J++]=8;while(J<256)Q.lens[J++]=9;while(J<280)Q.lens[J++]=7;while(J<288)Q.lens[J++]=8;p8(AV,Q.lens,0,288,kY,0,Q.work,{bits:9}),J=0;while(J<32)Q.lens[J++]=5;p8(TV,Q.lens,0,32,yY,0,Q.work,{bits:5}),MV=!1}Q.lencode=kY,Q.lenbits=9,Q.distcode=yY,Q.distbits=5}function kV(Q,J,Y,$){var q,V=Q.state;if(V.window===null)V.wsize=1<<V.wbits,V.wnext=0,V.whave=0,V.window=new P0.Buf8(V.wsize);if($>=V.wsize)P0.arraySet(V.window,J,Y-V.wsize,V.wsize,0),V.wnext=0,V.whave=V.wsize;else{if(q=V.wsize-V.wnext,q>$)q=$;if(P0.arraySet(V.window,J,Y-$,q,V.wnext),$-=q,$)P0.arraySet(V.window,J,Y-$,$,0),V.wnext=$,V.whave=V.wsize;else{if(V.wnext+=q,V.wnext===V.wsize)V.wnext=0;if(V.whave<V.wsize)V.whave+=q}}return 0}function lH(Q,J){var Y,$,q,V,K,X,Z,H,U,B,P,z,N,j,C=0,A,M,T,R,D,x,w,v,L=new P0.Buf8(4),k,I,_=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!Q||!Q.state||!Q.output||!Q.input&&Q.avail_in!==0)return N0;if(Y=Q.state,Y.mode===r0)Y.mode=vY;K=Q.next_out,q=Q.output,Z=Q.avail_out,V=Q.next_in,$=Q.input,X=Q.avail_in,H=Y.hold,U=Y.bits,B=X,P=Z,v=R6;Q:for(;;)switch(Y.mode){case EV:if(Y.wrap===0){Y.mode=vY;break}while(U<16){if(X===0)break Q;X--,H+=$[V++]<<U,U+=8}if(Y.wrap&2&&H===35615){Y.check=0,L[0]=H&255,L[1]=H>>>8&255,Y.check=h0(Y.check,L,2,0),H=0,U=0,Y.mode=YV;break}if(Y.flags=0,Y.head)Y.head.done=!1;if(!(Y.wrap&1)||(((H&255)<<8)+(H>>8))%31){Q.msg="incorrect header check",Y.mode=d;break}if((H&15)!==JV){Q.msg="unknown compression method",Y.mode=d;break}if(H>>>=4,U-=4,w=(H&15)+8,Y.wbits===0)Y.wbits=w;else if(w>Y.wbits){Q.msg="invalid window size",Y.mode=d;break}Y.dmax=1<<w,Q.adler=Y.check=1,Y.mode=H&512?WV:r0,H=0,U=0;break;case YV:while(U<16){if(X===0)break Q;X--,H+=$[V++]<<U,U+=8}if(Y.flags=H,(Y.flags&255)!==JV){Q.msg="unknown compression method",Y.mode=d;break}if(Y.flags&57344){Q.msg="unknown header flags set",Y.mode=d;break}if(Y.head)Y.head.text=H>>8&1;if(Y.flags&512)L[0]=H&255,L[1]=H>>>8&255,Y.check=h0(Y.check,L,2,0);H=0,U=0,Y.mode=$V;case $V:while(U<32){if(X===0)break Q;X--,H+=$[V++]<<U,U+=8}if(Y.head)Y.head.time=H;if(Y.flags&512)L[0]=H&255,L[1]=H>>>8&255,L[2]=H>>>16&255,L[3]=H>>>24&255,Y.check=h0(Y.check,L,4,0);H=0,U=0,Y.mode=qV;case qV:while(U<16){if(X===0)break Q;X--,H+=$[V++]<<U,U+=8}if(Y.head)Y.head.xflags=H&255,Y.head.os=H>>8;if(Y.flags&512)L[0]=H&255,L[1]=H>>>8&255,Y.check=h0(Y.check,L,2,0);H=0,U=0,Y.mode=VV;case VV:if(Y.flags&1024){while(U<16){if(X===0)break Q;X--,H+=$[V++]<<U,U+=8}if(Y.length=H,Y.head)Y.head.extra_len=H;if(Y.flags&512)L[0]=H&255,L[1]=H>>>8&255,Y.check=h0(Y.check,L,2,0);H=0,U=0}else if(Y.head)Y.head.extra=null;Y.mode=KV;case KV:if(Y.flags&1024){if(z=Y.length,z>X)z=X;if(z){if(Y.head){if(w=Y.head.extra_len-Y.length,!Y.head.extra)Y.head.extra=Array(Y.head.extra_len);P0.arraySet(Y.head.extra,$,V,z,w)}if(Y.flags&512)Y.check=h0(Y.check,$,z,V);X-=z,V+=z,Y.length-=z}if(Y.length)break Q}Y.length=0,Y.mode=XV;case XV:if(Y.flags&2048){if(X===0)break Q;z=0;do if(w=$[V+z++],Y.head&&w&&Y.length<65536)Y.head.name+=String.fromCharCode(w);while(w&&z<X);if(Y.flags&512)Y.check=h0(Y.check,$,z,V);if(X-=z,V+=z,w)break Q}else if(Y.head)Y.head.name=null;Y.length=0,Y.mode=GV;case GV:if(Y.flags&4096){if(X===0)break Q;z=0;do if(w=$[V+z++],Y.head&&w&&Y.length<65536)Y.head.comment+=String.fromCharCode(w);while(w&&z<X);if(Y.flags&512)Y.check=h0(Y.check,$,z,V);if(X-=z,V+=z,w)break Q}else if(Y.head)Y.head.comment=null;Y.mode=HV;case HV:if(Y.flags&512){while(U<16){if(X===0)break Q;X--,H+=$[V++]<<U,U+=8}if(H!==(Y.check&65535)){Q.msg="header crc mismatch",Y.mode=d;break}H=0,U=0}if(Y.head)Y.head.hcrc=Y.flags>>9&1,Y.head.done=!0;Q.adler=Y.check=0,Y.mode=r0;break;case WV:while(U<32){if(X===0)break Q;X--,H+=$[V++]<<U,U+=8}Q.adler=Y.check=IV(H),H=0,U=0,Y.mode=dQ;case dQ:if(Y.havedict===0)return Q.next_out=K,Q.avail_out=Z,Q.next_in=V,Q.avail_in=X,Y.hold=H,Y.bits=U,yH;Q.adler=Y.check=1,Y.mode=r0;case r0:if(J===SH||J===cQ)break Q;case vY:if(Y.last){H>>>=U&7,U-=U&7,Y.mode=SY;break}while(U<3){if(X===0)break Q;X--,H+=$[V++]<<U,U+=8}switch(Y.last=H&1,H>>>=1,U-=1,H&3){case 0:Y.mode=UV;break;case 1:if(pH(Y),Y.mode=pQ,J===cQ){H>>>=2,U-=2;break Q}break;case 2:Y.mode=LV;break;case 3:Q.msg="invalid block type",Y.mode=d}H>>>=2,U-=2;break;case UV:H>>>=U&7,U-=U&7;while(U<32){if(X===0)break Q;X--,H+=$[V++]<<U,U+=8}if((H&65535)!==(H>>>16^65535)){Q.msg="invalid stored block lengths",Y.mode=d;break}if(Y.length=H&65535,H=0,U=0,Y.mode=xY,J===cQ)break Q;case xY:Y.mode=ZV;case ZV:if(z=Y.length,z){if(z>X)z=X;if(z>Z)z=Z;if(z===0)break Q;P0.arraySet(q,$,V,z,K),X-=z,V+=z,Z-=z,K+=z,Y.length-=z;break}Y.mode=r0;break;case LV:while(U<14){if(X===0)break Q;X--,H+=$[V++]<<U,U+=8}if(Y.nlen=(H&31)+257,H>>>=5,U-=5,Y.ndist=(H&31)+1,H>>>=5,U-=5,Y.ncode=(H&15)+4,H>>>=4,U-=4,Y.nlen>286||Y.ndist>30){Q.msg="too many length or distance symbols",Y.mode=d;break}Y.have=0,Y.mode=BV;case BV:while(Y.have<Y.ncode){while(U<3){if(X===0)break Q;X--,H+=$[V++]<<U,U+=8}Y.lens[_[Y.have++]]=H&7,H>>>=3,U-=3}while(Y.have<19)Y.lens[_[Y.have++]]=0;if(Y.lencode=Y.lendyn,Y.lenbits=7,k={bits:Y.lenbits},v=p8(xH,Y.lens,0,19,Y.lencode,0,Y.work,k),Y.lenbits=k.bits,v){Q.msg="invalid code lengths set",Y.mode=d;break}Y.have=0,Y.mode=OV;case OV:while(Y.have<Y.nlen+Y.ndist){for(;;){if(C=Y.lencode[H&(1<<Y.lenbits)-1],A=C>>>24,M=C>>>16&255,T=C&65535,A<=U)break;if(X===0)break Q;X--,H+=$[V++]<<U,U+=8}if(T<16)H>>>=A,U-=A,Y.lens[Y.have++]=T;else{if(T===16){I=A+2;while(U<I){if(X===0)break Q;X--,H+=$[V++]<<U,U+=8}if(H>>>=A,U-=A,Y.have===0){Q.msg="invalid bit length repeat",Y.mode=d;break}w=Y.lens[Y.have-1],z=3+(H&3),H>>>=2,U-=2}else if(T===17){I=A+3;while(U<I){if(X===0)break Q;X--,H+=$[V++]<<U,U+=8}H>>>=A,U-=A,w=0,z=3+(H&7),H>>>=3,U-=3}else{I=A+7;while(U<I){if(X===0)break Q;X--,H+=$[V++]<<U,U+=8}H>>>=A,U-=A,w=0,z=11+(H&127),H>>>=7,U-=7}if(Y.have+z>Y.nlen+Y.ndist){Q.msg="invalid bit length repeat",Y.mode=d;break}while(z--)Y.lens[Y.have++]=w}}if(Y.mode===d)break;if(Y.lens[256]===0){Q.msg="invalid code -- missing end-of-block",Y.mode=d;break}if(Y.lenbits=9,k={bits:Y.lenbits},v=p8(AV,Y.lens,0,Y.nlen,Y.lencode,0,Y.work,k),Y.lenbits=k.bits,v){Q.msg="invalid literal/lengths set",Y.mode=d;break}if(Y.distbits=6,Y.distcode=Y.distdyn,k={bits:Y.distbits},v=p8(TV,Y.lens,Y.nlen,Y.ndist,Y.distcode,0,Y.work,k),Y.distbits=k.bits,v){Q.msg="invalid distances set",Y.mode=d;break}if(Y.mode=pQ,J===cQ)break Q;case pQ:Y.mode=lQ;case lQ:if(X>=6&&Z>=258){if(Q.next_out=K,Q.avail_out=Z,Q.next_in=V,Q.avail_in=X,Y.hold=H,Y.bits=U,vH(Q,P),K=Q.next_out,q=Q.output,Z=Q.avail_out,V=Q.next_in,$=Q.input,X=Q.avail_in,H=Y.hold,U=Y.bits,Y.mode===r0)Y.back=-1;break}Y.back=0;for(;;){if(C=Y.lencode[H&(1<<Y.lenbits)-1],A=C>>>24,M=C>>>16&255,T=C&65535,A<=U)break;if(X===0)break Q;X--,H+=$[V++]<<U,U+=8}if(M&&(M&240)===0){R=A,D=M,x=T;for(;;){if(C=Y.lencode[x+((H&(1<<R+D)-1)>>R)],A=C>>>24,M=C>>>16&255,T=C&65535,R+A<=U)break;if(X===0)break Q;X--,H+=$[V++]<<U,U+=8}H>>>=R,U-=R,Y.back+=R}if(H>>>=A,U-=A,Y.back+=A,Y.length=T,M===0){Y.mode=NV;break}if(M&32){Y.back=-1,Y.mode=r0;break}if(M&64){Q.msg="invalid literal/length code",Y.mode=d;break}Y.extra=M&15,Y.mode=PV;case PV:if(Y.extra){I=Y.extra;while(U<I){if(X===0)break Q;X--,H+=$[V++]<<U,U+=8}Y.length+=H&(1<<Y.extra)-1,H>>>=Y.extra,U-=Y.extra,Y.back+=Y.extra}Y.was=Y.length,Y.mode=jV;case jV:for(;;){if(C=Y.distcode[H&(1<<Y.distbits)-1],A=C>>>24,M=C>>>16&255,T=C&65535,A<=U)break;if(X===0)break Q;X--,H+=$[V++]<<U,U+=8}if((M&240)===0){R=A,D=M,x=T;for(;;){if(C=Y.distcode[x+((H&(1<<R+D)-1)>>R)],A=C>>>24,M=C>>>16&255,T=C&65535,R+A<=U)break;if(X===0)break Q;X--,H+=$[V++]<<U,U+=8}H>>>=R,U-=R,Y.back+=R}if(H>>>=A,U-=A,Y.back+=A,M&64){Q.msg="invalid distance code",Y.mode=d;break}Y.offset=T,Y.extra=M&15,Y.mode=zV;case zV:if(Y.extra){I=Y.extra;while(U<I){if(X===0)break Q;X--,H+=$[V++]<<U,U+=8}Y.offset+=H&(1<<Y.extra)-1,H>>>=Y.extra,U-=Y.extra,Y.back+=Y.extra}if(Y.offset>Y.dmax){Q.msg="invalid distance too far back",Y.mode=d;break}Y.mode=FV;case FV:if(Z===0)break Q;if(z=P-Z,Y.offset>z){if(z=Y.offset-z,z>Y.whave){if(Y.sane){Q.msg="invalid distance too far back",Y.mode=d;break}}if(z>Y.wnext)z-=Y.wnext,N=Y.wsize-z;else N=Y.wnext-z;if(z>Y.length)z=Y.length;j=Y.window}else j=q,N=K-Y.offset,z=Y.length;if(z>Z)z=Z;Z-=z,Y.length-=z;do q[K++]=j[N++];while(--z);if(Y.length===0)Y.mode=lQ;break;case NV:if(Z===0)break Q;q[K++]=Y.length,Z--,Y.mode=lQ;break;case SY:if(Y.wrap){while(U<32){if(X===0)break Q;X--,H|=$[V++]<<U,U+=8}if(P-=Z,Q.total_out+=P,Y.total+=P,P)Q.adler=Y.check=Y.flags?h0(Y.check,q,P,K-P):gY(Y.check,q,P,K-P);if(P=Z,(Y.flags?H:IV(H))!==Y.check){Q.msg="incorrect data check",Y.mode=d;break}H=0,U=0}Y.mode=CV;case CV:if(Y.wrap&&Y.flags){while(U<32){if(X===0)break Q;X--,H+=$[V++]<<U,U+=8}if(H!==(Y.total&4294967295)){Q.msg="incorrect length check",Y.mode=d;break}H=0,U=0}Y.mode=RV;case RV:v=kH;break Q;case d:v=DV;break Q;case _Y:return hY;case hH:default:return N0}if(Q.next_out=K,Q.avail_out=Z,Q.next_in=V,Q.avail_in=X,Y.hold=H,Y.bits=U,Y.wsize||P!==Q.avail_out&&Y.mode<d&&(Y.mode<SY||J!==QV)){if(kV(Q,Q.output,Q.next_out,P-Q.avail_out))return Y.mode=_Y,hY}if(B-=Q.avail_in,P-=Q.avail_out,Q.total_in+=B,Q.total_out+=P,Y.total+=P,Y.wrap&&P)Q.adler=Y.check=Y.flags?h0(Y.check,q,P,Q.next_out-P):gY(Y.check,q,P,Q.next_out-P);if(Q.data_type=Y.bits+(Y.last?64:0)+(Y.mode===r0?128:0)+(Y.mode===pQ||Y.mode===xY?256:0),(B===0&&P===0||J===QV)&&v===R6)v=gH;return v}function dH(Q){if(!Q||!Q.state)return N0;var J=Q.state;if(J.window)J.window=null;return Q.state=null,R6}function oH(Q,J){var Y;if(!Q||!Q.state)return N0;if(Y=Q.state,(Y.wrap&2)===0)return N0;return Y.head=J,J.done=!1,R6}function nH(Q,J){var Y=J.length,$,q,V;if(!Q||!Q.state)return N0;if($=Q.state,$.wrap!==0&&$.mode!==dQ)return N0;if($.mode===dQ){if(q=1,q=gY(q,J,Y,0),q!==$.check)return DV}if(V=kV(Q,J,Y,Y),V)return $.mode=_Y,hY;return $.havedict=1,R6}iH.inflateReset=vV;iH.inflateReset2=xV;iH.inflateResetKeep=wV;iH.inflateInit=cH;iH.inflateInit2=SV;iH.inflate=lH;iH.inflateEnd=dH;iH.inflateGetHeader=oH;iH.inflateSetDictionary=nH;iH.inflateInfo="pako inflate (from Nodeca project)"});var bY=E((lL,gV)=>{gV.exports={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}});var _V=E((dL,hV)=>{function VW(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}hV.exports=VW});var fV=E((HW)=>{var s6=yV(),l8=n0(),oQ=IY(),s=bY(),fY=kQ(),KW=MY(),XW=_V(),bV=Object.prototype.toString;function I6(Q){if(!(this instanceof I6))return new I6(Q);this.options=l8.assign({chunkSize:16384,windowBits:0,to:""},Q||{});var J=this.options;if(J.raw&&J.windowBits>=0&&J.windowBits<16){if(J.windowBits=-J.windowBits,J.windowBits===0)J.windowBits=-15}if(J.windowBits>=0&&J.windowBits<16&&!(Q&&Q.windowBits))J.windowBits+=32;if(J.windowBits>15&&J.windowBits<48){if((J.windowBits&15)===0)J.windowBits|=15}this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new KW,this.strm.avail_out=0;var Y=s6.inflateInit2(this.strm,J.windowBits);if(Y!==s.Z_OK)throw Error(fY[Y]);if(this.header=new XW,s6.inflateGetHeader(this.strm,this.header),J.dictionary){if(typeof J.dictionary==="string")J.dictionary=oQ.string2buf(J.dictionary);else if(bV.call(J.dictionary)==="[object ArrayBuffer]")J.dictionary=new Uint8Array(J.dictionary);if(J.raw){if(Y=s6.inflateSetDictionary(this.strm,J.dictionary),Y!==s.Z_OK)throw Error(fY[Y])}}}I6.prototype.push=function(Q,J){var Y=this.strm,$=this.options.chunkSize,q=this.options.dictionary,V,K,X,Z,H,U=!1;if(this.ended)return!1;if(K=J===~~J?J:J===!0?s.Z_FINISH:s.Z_NO_FLUSH,typeof Q==="string")Y.input=oQ.binstring2buf(Q);else if(bV.call(Q)==="[object ArrayBuffer]")Y.input=new Uint8Array(Q);else Y.input=Q;Y.next_in=0,Y.avail_in=Y.input.length;do{if(Y.avail_out===0)Y.output=new l8.Buf8($),Y.next_out=0,Y.avail_out=$;if(V=s6.inflate(Y,s.Z_NO_FLUSH),V===s.Z_NEED_DICT&&q)V=s6.inflateSetDictionary(this.strm,q);if(V===s.Z_BUF_ERROR&&U===!0)V=s.Z_OK,U=!1;if(V!==s.Z_STREAM_END&&V!==s.Z_OK)return this.onEnd(V),this.ended=!0,!1;if(Y.next_out){if(Y.avail_out===0||V===s.Z_STREAM_END||Y.avail_in===0&&(K===s.Z_FINISH||K===s.Z_SYNC_FLUSH))if(this.options.to==="string"){if(X=oQ.utf8border(Y.output,Y.next_out),Z=Y.next_out-X,H=oQ.buf2string(Y.output,X),Y.next_out=Z,Y.avail_out=$-Z,Z)l8.arraySet(Y.output,Y.output,X,Z,0);this.onData(H)}else this.onData(l8.shrinkBuf(Y.output,Y.next_out))}if(Y.avail_in===0&&Y.avail_out===0)U=!0}while((Y.avail_in>0||Y.avail_out===0)&&V!==s.Z_STREAM_END);if(V===s.Z_STREAM_END)K=s.Z_FINISH;if(K===s.Z_FINISH)return V=s6.inflateEnd(this.strm),this.onEnd(V),this.ended=!0,V===s.Z_OK;if(K===s.Z_SYNC_FLUSH)return this.onEnd(s.Z_OK),Y.avail_out=0,!0;return!0};I6.prototype.onData=function(Q){this.chunks.push(Q)};I6.prototype.onEnd=function(Q){if(Q===s.Z_OK)if(this.options.to==="string")this.result=this.chunks.join("");else this.result=l8.flattenChunks(this.chunks);this.chunks=[],this.err=Q,this.msg=this.strm.msg};function mY(Q,J){var Y=new I6(J);if(Y.push(Q,!0),Y.err)throw Y.msg||fY[Y.err];return Y.result}function GW(Q,J){return J=J||{},J.raw=!0,mY(Q,J)}HW.Inflate=I6;HW.inflate=mY;HW.inflateRaw=GW;HW.ungzip=mY});var cV=E((nL,uV)=>{var BW=n0().assign,OW=lq(),PW=fV(),jW=bY(),mV={};BW(mV,OW,PW,jW);uV.exports=mV});var lV=E((CW)=>{var zW=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",FW=cV(),pV=n(),nQ=O0(),NW=zW?"uint8array":"array";CW.magic="\b\x00";function M6(Q,J){nQ.call(this,"FlateWorker/"+Q),this._pako=null,this._pakoAction=Q,this._pakoOptions=J,this.meta={}}pV.inherits(M6,nQ);M6.prototype.processChunk=function(Q){if(this.meta=Q.meta,this._pako===null)this._createPako();this._pako.push(pV.transformTo(NW,Q.data),!1)};M6.prototype.flush=function(){if(nQ.prototype.flush.call(this),this._pako===null)this._createPako();this._pako.push([],!0)};M6.prototype.cleanUp=function(){nQ.prototype.cleanUp.call(this),this._pako=null};M6.prototype._createPako=function(){this._pako=new FW[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var Q=this;this._pako.onData=function(J){Q.push({data:J,meta:Q.meta})}};CW.compressWorker=function(Q){return new M6("Deflate",Q)};CW.uncompressWorker=function(){return new M6("Inflate",{})}});var uY=E((AW)=>{var dV=O0();AW.STORE={magic:"\x00\x00",compressWorker:function(){return new dV("STORE compression")},uncompressWorker:function(){return new dV("STORE decompression")}};AW.DEFLATE=lV()});var cY=E((EW)=>{EW.LOCAL_FILE_HEADER="PK\x03\x04";EW.CENTRAL_FILE_HEADER="PK\x01\x02";EW.CENTRAL_DIRECTORY_END="PK\x05\x06";EW.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x06\x07";EW.ZIP64_CENTRAL_DIRECTORY_END="PK\x06\x06";EW.DATA_DESCRIPTOR="PK\x07\b"});var rV=E((sL,iV)=>{var t6=n(),e6=O0(),pY=c6(),oV=wQ(),iQ=cY(),p=function(Q,J){var Y="",$;for($=0;$<J;$++)Y+=String.fromCharCode(Q&255),Q=Q>>>8;return Y},gW=function(Q,J){var Y=Q;if(!Q)Y=J?16893:33204;return(Y&65535)<<16},hW=function(Q){return(Q||0)&63},nV=function(Q,J,Y,$,q,V){var{file:K,compression:X}=Q,Z=V!==pY.utf8encode,H=t6.transformTo("string",V(K.name)),U=t6.transformTo("string",pY.utf8encode(K.name)),B=K.comment,P=t6.transformTo("string",V(B)),z=t6.transformTo("string",pY.utf8encode(B)),N=U.length!==K.name.length,j=z.length!==B.length,C,A,M="",T="",R="",D=K.dir,x=K.date,w={crc32:0,compressedSize:0,uncompressedSize:0};if(!J||Y)w.crc32=Q.crc32,w.compressedSize=Q.compressedSize,w.uncompressedSize=Q.uncompressedSize;var v=0;if(J)v|=8;if(!Z&&(N||j))v|=2048;var L=0,k=0;if(D)L|=16;if(q==="UNIX")k=798,L|=gW(K.unixPermissions,D);else k=20,L|=hW(K.dosPermissions,D);if(C=x.getUTCHours(),C=C<<6,C=C|x.getUTCMinutes(),C=C<<5,C=C|x.getUTCSeconds()/2,A=x.getUTCFullYear()-1980,A=A<<4,A=A|x.getUTCMonth()+1,A=A<<5,A=A|x.getUTCDate(),N)T=p(1,1)+p(oV(H),4)+U,M+="up"+p(T.length,2)+T;if(j)R=p(1,1)+p(oV(P),4)+z,M+="uc"+p(R.length,2)+R;var I="";I+=`
12
- \x00`,I+=p(v,2),I+=X.magic,I+=p(C,2),I+=p(A,2),I+=p(w.crc32,4),I+=p(w.compressedSize,4),I+=p(w.uncompressedSize,4),I+=p(H.length,2),I+=p(M.length,2);var _=iQ.LOCAL_FILE_HEADER+I+H+M,o=iQ.CENTRAL_FILE_HEADER+p(k,2)+I+p(P.length,2)+"\x00\x00\x00\x00"+p(L,4)+p($,4)+H+M+P;return{fileRecord:_,dirRecord:o}},_W=function(Q,J,Y,$,q){var V="",K=t6.transformTo("string",q($));return V=iQ.CENTRAL_DIRECTORY_END+"\x00\x00\x00\x00"+p(Q,2)+p(Q,2)+p(J,4)+p(Y,4)+p(K.length,2)+K,V},bW=function(Q){var J="";return J=iQ.DATA_DESCRIPTOR+p(Q.crc32,4)+p(Q.compressedSize,4)+p(Q.uncompressedSize,4),J};function M0(Q,J,Y,$){e6.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=J,this.zipPlatform=Y,this.encodeFileName=$,this.streamFiles=Q,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}t6.inherits(M0,e6);M0.prototype.push=function(Q){var J=Q.meta.percent||0,Y=this.entriesCount,$=this._sources.length;if(this.accumulate)this.contentBuffer.push(Q);else this.bytesWritten+=Q.data.length,e6.prototype.push.call(this,{data:Q.data,meta:{currentFile:this.currentFile,percent:Y?(J+100*(Y-$-1))/Y:100}})};M0.prototype.openedSource=function(Q){this.currentSourceOffset=this.bytesWritten,this.currentFile=Q.file.name;var J=this.streamFiles&&!Q.file.dir;if(J){var Y=nV(Q,J,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:Y.fileRecord,meta:{percent:0}})}else this.accumulate=!0};M0.prototype.closedSource=function(Q){this.accumulate=!1;var J=this.streamFiles&&!Q.file.dir,Y=nV(Q,J,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(Y.dirRecord),J)this.push({data:bW(Q),meta:{percent:100}});else{this.push({data:Y.fileRecord,meta:{percent:0}});while(this.contentBuffer.length)this.push(this.contentBuffer.shift())}this.currentFile=null};M0.prototype.flush=function(){var Q=this.bytesWritten;for(var J=0;J<this.dirRecords.length;J++)this.push({data:this.dirRecords[J],meta:{percent:100}});var Y=this.bytesWritten-Q,$=_W(this.dirRecords.length,Y,Q,this.zipComment,this.encodeFileName);this.push({data:$,meta:{percent:100}})};M0.prototype.prepareNextSource=function(){if(this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused)this.previous.pause();else this.previous.resume()};M0.prototype.registerPrevious=function(Q){this._sources.push(Q);var J=this;return Q.on("data",function(Y){J.processChunk(Y)}),Q.on("end",function(){if(J.closedSource(J.previous.streamInfo),J._sources.length)J.prepareNextSource();else J.end()}),Q.on("error",function(Y){J.error(Y)}),this};M0.prototype.resume=function(){if(!e6.prototype.resume.call(this))return!1;if(!this.previous&&this._sources.length)return this.prepareNextSource(),!0;if(!this.previous&&!this._sources.length&&!this.generatedError)return this.end(),!0};M0.prototype.error=function(Q){var J=this._sources;if(!e6.prototype.error.call(this,Q))return!1;for(var Y=0;Y<J.length;Y++)try{J[Y].error(Q)}catch($){}return!0};M0.prototype.lock=function(){e6.prototype.lock.call(this);var Q=this._sources;for(var J=0;J<Q.length;J++)Q[J].lock()};iV.exports=M0});var aV=E((cW)=>{var fW=uY(),mW=rV(),uW=function(Q,J){var Y=Q||J,$=fW[Y];if(!$)throw Error(Y+" is not a valid compression method !");return $};cW.generateWorker=function(Q,J,Y){var $=new mW(J.streamFiles,Y,J.platform,J.encodeFileName),q=0;try{Q.forEach(function(V,K){q++;var X=uW(K.options.compression,J.compression),Z=K.options.compressionOptions||J.compressionOptions||{},H=K.dir,U=K.date;K._compressWorker(X,Z).withStreamInfo("file",{name:V,dir:H,date:U,comment:K.comment||"",unixPermissions:K.unixPermissions,dosPermissions:K.dosPermissions}).pipe($)}),$.entriesCount=q}catch(V){$.error(V)}return $}});var tV=E((eL,sV)=>{var lW=n(),rQ=O0();function d8(Q,J){rQ.call(this,"Nodejs stream input adapter for "+Q),this._upstreamEnded=!1,this._bindStream(J)}lW.inherits(d8,rQ);d8.prototype._bindStream=function(Q){var J=this;this._stream=Q,Q.pause(),Q.on("data",function(Y){J.push({data:Y,meta:{percent:0}})}).on("error",function(Y){if(J.isPaused)this.generatedError=Y;else J.error(Y)}).on("end",function(){if(J.isPaused)J._upstreamEnded=!0;else J.end()})};d8.prototype.pause=function(){if(!rQ.prototype.pause.call(this))return!1;return this._stream.pause(),!0};d8.prototype.resume=function(){if(!rQ.prototype.resume.call(this))return!1;if(this._upstreamEnded)this.end();else this._stream.resume();return!0};sV.exports=d8});var G7=E((QB,X7)=>{var dW=c6(),o8=n(),Y7=O0(),oW=nJ(),$7=iJ(),eV=vQ(),nW=Qq(),iW=aV(),Q7=M8(),rW=tV(),q7=function(Q,J,Y){var $=o8.getTypeOf(J),q,V=o8.extend(Y||{},$7);if(V.date=V.date||new Date,V.compression!==null)V.compression=V.compression.toUpperCase();if(typeof V.unixPermissions==="string")V.unixPermissions=parseInt(V.unixPermissions,8);if(V.unixPermissions&&V.unixPermissions&16384)V.dir=!0;if(V.dosPermissions&&V.dosPermissions&16)V.dir=!0;if(V.dir)Q=V7(Q);if(V.createFolders&&(q=aW(Q)))K7.call(this,q,!0);var K=$==="string"&&V.binary===!1&&V.base64===!1;if(!Y||typeof Y.binary>"u")V.binary=!K;var X=J instanceof eV&&J.uncompressedSize===0;if(X||V.dir||!J||J.length===0)V.base64=!1,V.binary=!0,J="",V.compression="STORE",$="string";var Z=null;if(J instanceof eV||J instanceof Y7)Z=J;else if(Q7.isNode&&Q7.isStream(J))Z=new rW(Q,J);else Z=o8.prepareContent(Q,J,V.binary,V.optimizedBinaryString,V.base64);var H=new nW(Q,Z,V);this.files[Q]=H},aW=function(Q){if(Q.slice(-1)==="/")Q=Q.substring(0,Q.length-1);var J=Q.lastIndexOf("/");return J>0?Q.substring(0,J):""},V7=function(Q){if(Q.slice(-1)!=="/")Q+="/";return Q},K7=function(Q,J){if(J=typeof J<"u"?J:$7.createFolders,Q=V7(Q),!this.files[Q])q7.call(this,Q,null,{dir:!0,createFolders:J});return this.files[Q]};function J7(Q){return Object.prototype.toString.call(Q)==="[object RegExp]"}var sW={load:function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(Q){var J,Y,$;for(J in this.files)if($=this.files[J],Y=J.slice(this.root.length,J.length),Y&&J.slice(0,this.root.length)===this.root)Q(Y,$)},filter:function(Q){var J=[];return this.forEach(function(Y,$){if(Q(Y,$))J.push($)}),J},file:function(Q,J,Y){if(arguments.length===1)if(J7(Q)){var $=Q;return this.filter(function(V,K){return!K.dir&&$.test(V)})}else{var q=this.files[this.root+Q];if(q&&!q.dir)return q;else return null}else Q=this.root+Q,q7.call(this,Q,J,Y);return this},folder:function(Q){if(!Q)return this;if(J7(Q))return this.filter(function(q,V){return V.dir&&Q.test(q)});var J=this.root+Q,Y=K7.call(this,J),$=this.clone();return $.root=Y.name,$},remove:function(Q){Q=this.root+Q;var J=this.files[Q];if(!J){if(Q.slice(-1)!=="/")Q+="/";J=this.files[Q]}if(J&&!J.dir)delete this.files[Q];else{var Y=this.filter(function(q,V){return V.name.slice(0,Q.length)===Q});for(var $=0;$<Y.length;$++)delete this.files[Y[$].name]}return this},generate:function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(Q){var J,Y={};try{if(Y=o8.extend(Q||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:dW.utf8encode}),Y.type=Y.type.toLowerCase(),Y.compression=Y.compression.toUpperCase(),Y.type==="binarystring")Y.type="string";if(!Y.type)throw Error("No output type specified.");if(o8.checkSupport(Y.type),Y.platform==="darwin"||Y.platform==="freebsd"||Y.platform==="linux"||Y.platform==="sunos")Y.platform="UNIX";if(Y.platform==="win32")Y.platform="DOS";var $=Y.comment||this.comment||"";J=iW.generateWorker(this,Y,$)}catch(q){J=new Y7("error"),J.error(q)}return new oW(J,Y.type||"string",Y.mimeType)},generateAsync:function(Q,J){return this.generateInternalStream(Q).accumulate(J)},generateNodeStream:function(Q,J){if(Q=Q||{},!Q.type)Q.type="nodebuffer";return this.generateInternalStream(Q).toNodejsStream(J)}};X7.exports=sW});var lY=E((JB,W7)=>{var tW=n();function H7(Q){this.data=Q,this.length=Q.length,this.index=0,this.zero=0}H7.prototype={checkOffset:function(Q){this.checkIndex(this.index+Q)},checkIndex:function(Q){if(this.length<this.zero+Q||Q<0)throw Error("End of data reached (data length = "+this.length+", asked index = "+Q+"). Corrupted zip ?")},setIndex:function(Q){this.checkIndex(Q),this.index=Q},skip:function(Q){this.setIndex(this.index+Q)},byteAt:function(){},readInt:function(Q){var J=0,Y;this.checkOffset(Q);for(Y=this.index+Q-1;Y>=this.index;Y--)J=(J<<8)+this.byteAt(Y);return this.index+=Q,J},readString:function(Q){return tW.transformTo("string",this.readData(Q))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var Q=this.readInt(4);return new Date(Date.UTC((Q>>25&127)+1980,(Q>>21&15)-1,Q>>16&31,Q>>11&31,Q>>5&63,(Q&31)<<1))}};W7.exports=H7});var dY=E((YB,Z7)=>{var U7=lY(),eW=n();function Q8(Q){U7.call(this,Q);for(var J=0;J<this.data.length;J++)Q[J]=Q[J]&255}eW.inherits(Q8,U7);Q8.prototype.byteAt=function(Q){return this.data[this.zero+Q]};Q8.prototype.lastIndexOfSignature=function(Q){var J=Q.charCodeAt(0),Y=Q.charCodeAt(1),$=Q.charCodeAt(2),q=Q.charCodeAt(3);for(var V=this.length-4;V>=0;--V)if(this.data[V]===J&&this.data[V+1]===Y&&this.data[V+2]===$&&this.data[V+3]===q)return V-this.zero;return-1};Q8.prototype.readAndCheckSignature=function(Q){var J=Q.charCodeAt(0),Y=Q.charCodeAt(1),$=Q.charCodeAt(2),q=Q.charCodeAt(3),V=this.readData(4);return J===V[0]&&Y===V[1]&&$===V[2]&&q===V[3]};Q8.prototype.readData=function(Q){if(this.checkOffset(Q),Q===0)return[];var J=this.data.slice(this.zero+this.index,this.zero+this.index+Q);return this.index+=Q,J};Z7.exports=Q8});var O7=E(($B,B7)=>{var L7=lY(),Q3=n();function J8(Q){L7.call(this,Q)}Q3.inherits(J8,L7);J8.prototype.byteAt=function(Q){return this.data.charCodeAt(this.zero+Q)};J8.prototype.lastIndexOfSignature=function(Q){return this.data.lastIndexOf(Q)-this.zero};J8.prototype.readAndCheckSignature=function(Q){var J=this.readData(4);return Q===J};J8.prototype.readData=function(Q){this.checkOffset(Q);var J=this.data.slice(this.zero+this.index,this.zero+this.index+Q);return this.index+=Q,J};B7.exports=J8});var nY=E((qB,j7)=>{var P7=dY(),J3=n();function oY(Q){P7.call(this,Q)}J3.inherits(oY,P7);oY.prototype.readData=function(Q){if(this.checkOffset(Q),Q===0)return new Uint8Array(0);var J=this.data.subarray(this.zero+this.index,this.zero+this.index+Q);return this.index+=Q,J};j7.exports=oY});var N7=E((VB,F7)=>{var z7=nY(),Y3=n();function iY(Q){z7.call(this,Q)}Y3.inherits(iY,z7);iY.prototype.readData=function(Q){this.checkOffset(Q);var J=this.data.slice(this.zero+this.index,this.zero+this.index+Q);return this.index+=Q,J};F7.exports=iY});var rY=E((KB,R7)=>{var aQ=n(),C7=o0(),$3=dY(),q3=O7(),V3=N7(),K3=nY();R7.exports=function(Q){var J=aQ.getTypeOf(Q);if(aQ.checkSupport(J),J==="string"&&!C7.uint8array)return new q3(Q);if(J==="nodebuffer")return new V3(Q);if(C7.uint8array)return new K3(aQ.transformTo("uint8array",Q));return new $3(aQ.transformTo("array",Q))}});var T7=E((XB,A7)=>{var aY=rY(),G6=n(),X3=vQ(),I7=wQ(),sQ=c6(),tQ=uY(),G3=o0(),H3=0,W3=3,U3=function(Q){for(var J in tQ){if(!Object.prototype.hasOwnProperty.call(tQ,J))continue;if(tQ[J].magic===Q)return tQ[J]}return null};function M7(Q,J){this.options=Q,this.loadOptions=J}M7.prototype={isEncrypted:function(){return(this.bitFlag&1)===1},useUTF8:function(){return(this.bitFlag&2048)===2048},readLocalPart:function(Q){var J,Y;if(Q.skip(22),this.fileNameLength=Q.readInt(2),Y=Q.readInt(2),this.fileName=Q.readData(this.fileNameLength),Q.skip(Y),this.compressedSize===-1||this.uncompressedSize===-1)throw Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(J=U3(this.compressionMethod),J===null)throw Error("Corrupted zip : compression "+G6.pretty(this.compressionMethod)+" unknown (inner file : "+G6.transformTo("string",this.fileName)+")");this.decompressed=new X3(this.compressedSize,this.uncompressedSize,this.crc32,J,Q.readData(this.compressedSize))},readCentralPart:function(Q){this.versionMadeBy=Q.readInt(2),Q.skip(2),this.bitFlag=Q.readInt(2),this.compressionMethod=Q.readString(2),this.date=Q.readDate(),this.crc32=Q.readInt(4),this.compressedSize=Q.readInt(4),this.uncompressedSize=Q.readInt(4);var J=Q.readInt(2);if(this.extraFieldsLength=Q.readInt(2),this.fileCommentLength=Q.readInt(2),this.diskNumberStart=Q.readInt(2),this.internalFileAttributes=Q.readInt(2),this.externalFileAttributes=Q.readInt(4),this.localHeaderOffset=Q.readInt(4),this.isEncrypted())throw Error("Encrypted zip are not supported");Q.skip(J),this.readExtraFields(Q),this.parseZIP64ExtraField(Q),this.fileComment=Q.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var Q=this.versionMadeBy>>8;if(this.dir=this.externalFileAttributes&16?!0:!1,Q===H3)this.dosPermissions=this.externalFileAttributes&63;if(Q===W3)this.unixPermissions=this.externalFileAttributes>>16&65535;if(!this.dir&&this.fileNameStr.slice(-1)==="/")this.dir=!0},parseZIP64ExtraField:function(){if(!this.extraFields[1])return;var Q=aY(this.extraFields[1].value);if(this.uncompressedSize===G6.MAX_VALUE_32BITS)this.uncompressedSize=Q.readInt(8);if(this.compressedSize===G6.MAX_VALUE_32BITS)this.compressedSize=Q.readInt(8);if(this.localHeaderOffset===G6.MAX_VALUE_32BITS)this.localHeaderOffset=Q.readInt(8);if(this.diskNumberStart===G6.MAX_VALUE_32BITS)this.diskNumberStart=Q.readInt(4)},readExtraFields:function(Q){var J=Q.index+this.extraFieldsLength,Y,$,q;if(!this.extraFields)this.extraFields={};while(Q.index+4<J)Y=Q.readInt(2),$=Q.readInt(2),q=Q.readData($),this.extraFields[Y]={id:Y,length:$,value:q};Q.setIndex(J)},handleUTF8:function(){var Q=G3.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=sQ.utf8decode(this.fileName),this.fileCommentStr=sQ.utf8decode(this.fileComment);else{var J=this.findExtraFieldUnicodePath();if(J!==null)this.fileNameStr=J;else{var Y=G6.transformTo(Q,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(Y)}var $=this.findExtraFieldUnicodeComment();if($!==null)this.fileCommentStr=$;else{var q=G6.transformTo(Q,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(q)}}},findExtraFieldUnicodePath:function(){var Q=this.extraFields[28789];if(Q){var J=aY(Q.value);if(J.readInt(1)!==1)return null;if(I7(this.fileName)!==J.readInt(4))return null;return sQ.utf8decode(J.readData(Q.length-5))}return null},findExtraFieldUnicodeComment:function(){var Q=this.extraFields[25461];if(Q){var J=aY(Q.value);if(J.readInt(1)!==1)return null;if(I7(this.fileComment)!==J.readInt(4))return null;return sQ.utf8decode(J.readData(Q.length-5))}return null}};A7.exports=M7});var w7=E((GB,E7)=>{var Z3=rY(),a0=n(),A0=cY(),L3=T7(),B3=o0();function D7(Q){this.files=[],this.loadOptions=Q}D7.prototype={checkSignature:function(Q){if(!this.reader.readAndCheckSignature(Q)){this.reader.index-=4;var J=this.reader.readString(4);throw Error("Corrupted zip or bug: unexpected signature ("+a0.pretty(J)+", expected "+a0.pretty(Q)+")")}},isSignature:function(Q,J){var Y=this.reader.index;this.reader.setIndex(Q);var $=this.reader.readString(4),q=$===J;return this.reader.setIndex(Y),q},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var Q=this.reader.readData(this.zipCommentLength),J=B3.uint8array?"uint8array":"array",Y=a0.transformTo(J,Q);this.zipComment=this.loadOptions.decodeFileName(Y)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};var Q=this.zip64EndOfCentralSize-44,J=0,Y,$,q;while(J<Q)Y=this.reader.readInt(2),$=this.reader.readInt(4),q=this.reader.readData($),this.zip64ExtensibleData[Y]={id:Y,length:$,value:q}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var Q,J;for(Q=0;Q<this.files.length;Q++)J=this.files[Q],this.reader.setIndex(J.localHeaderOffset),this.checkSignature(A0.LOCAL_FILE_HEADER),J.readLocalPart(this.reader),J.handleUTF8(),J.processAttributes()},readCentralDir:function(){var Q;this.reader.setIndex(this.centralDirOffset);while(this.reader.readAndCheckSignature(A0.CENTRAL_FILE_HEADER))Q=new L3({zip64:this.zip64},this.loadOptions),Q.readCentralPart(this.reader),this.files.push(Q);if(this.centralDirRecords!==this.files.length){if(this.centralDirRecords!==0&&this.files.length===0)throw Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)}},readEndOfCentral:function(){var Q=this.reader.lastIndexOfSignature(A0.CENTRAL_DIRECTORY_END);if(Q<0){var J=!this.isSignature(0,A0.LOCAL_FILE_HEADER);if(J)throw Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");else throw Error("Corrupted zip: can't find end of central directory")}this.reader.setIndex(Q);var Y=Q;if(this.checkSignature(A0.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===a0.MAX_VALUE_16BITS||this.diskWithCentralDirStart===a0.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===a0.MAX_VALUE_16BITS||this.centralDirRecords===a0.MAX_VALUE_16BITS||this.centralDirSize===a0.MAX_VALUE_32BITS||this.centralDirOffset===a0.MAX_VALUE_32BITS){if(this.zip64=!0,Q=this.reader.lastIndexOfSignature(A0.ZIP64_CENTRAL_DIRECTORY_LOCATOR),Q<0)throw Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(Q),this.checkSignature(A0.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,A0.ZIP64_CENTRAL_DIRECTORY_END)){if(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(A0.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0)throw Error("Corrupted zip: can't find the ZIP64 end of central directory")}this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(A0.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var $=this.centralDirOffset+this.centralDirSize;if(this.zip64)$+=20,$+=12+this.zip64EndOfCentralSize;var q=Y-$;if(q>0)if(this.isSignature(Y,A0.CENTRAL_FILE_HEADER));else this.reader.zero=q;else if(q<0)throw Error("Corrupted zip: missing "+Math.abs(q)+" bytes.")},prepareReader:function(Q){this.reader=Z3(Q)},load:function(Q){this.prepareReader(Q),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}};E7.exports=D7});var S7=E((HB,x7)=>{var sY=n(),eQ=f6(),O3=c6(),P3=w7(),j3=sJ(),v7=M8();function z3(Q){return new eQ.Promise(function(J,Y){var $=Q.decompressed.getContentWorker().pipe(new j3);$.on("error",function(q){Y(q)}).on("end",function(){if($.streamInfo.crc32!==Q.decompressed.crc32)Y(Error("Corrupted zip : CRC32 mismatch"));else J()}).resume()})}x7.exports=function(Q,J){var Y=this;if(J=sY.extend(J||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:O3.utf8decode}),v7.isNode&&v7.isStream(Q))return eQ.Promise.reject(Error("JSZip can't accept a stream when loading a zip file."));return sY.prepareContent("the loaded zip file",Q,!0,J.optimizedBinaryString,J.base64).then(function($){var q=new P3(J);return q.load($),q}).then(function(q){var V=[eQ.Promise.resolve(q)],K=q.files;if(J.checkCRC32)for(var X=0;X<K.length;X++)V.push(z3(K[X]));return eQ.Promise.all(V)}).then(function(q){var V=q.shift(),K=V.files;for(var X=0;X<K.length;X++){var Z=K[X],H=Z.fileNameStr,U=sY.resolve(Z.fileNameStr);if(Y.file(U,Z.decompressed,{binary:!0,optimizedBinaryString:!0,date:Z.date,dir:Z.dir,comment:Z.fileCommentStr.length?Z.fileCommentStr:null,unixPermissions:Z.unixPermissions,dosPermissions:Z.dosPermissions,createFolders:J.createFolders}),!Z.dir)Y.file(U).unsafeOriginalName=H}if(V.zipComment.length)Y.comment=V.zipComment;return Y})}});var y7=E((WB,k7)=>{function C0(){if(!(this instanceof C0))return new C0;if(arguments.length)throw Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var Q=new C0;for(var J in this)if(typeof this[J]!=="function")Q[J]=this[J];return Q}}C0.prototype=G7();C0.prototype.loadAsync=S7();C0.support=o0();C0.defaults=iJ();C0.version="3.10.1";C0.loadAsync=function(Q,J){return new C0().loadAsync(Q,J)};C0.external=f6();k7.exports=C0});import{createRequire as F3}from"module";function u7(Q,J){return S3(Q,{i:2},J&&J.out,J&&J.dictionary)}var N3,$8,C3,R3,R0,Y8,I3,g7,h7,M3,_7=function(Q,J){var Y=new Y8(31);for(var $=0;$<31;++$)Y[$]=J+=1<<Q[$-1];var q=new I3(Y[30]);for(var $=1;$<30;++$)for(var V=Y[$];V<Y[$+1];++V)q[V]=V-Y[$]<<5|$;return{b:Y,r:q}},$8,b7,A3,f7,T3,ZB,Q$,_0,g,n8=function(Q,J,Y){var $=Q.length,q=0,V=new Y8(J);for(;q<$;++q)if(Q[q])++V[Q[q]-1];var K=new Y8(J);for(q=1;q<J;++q)K[q]=K[q-1]+V[q-1]<<1;var X;if(Y){X=new Y8(1<<J);var Z=15-J;for(q=0;q<$;++q)if(Q[q]){var H=q<<4|Q[q],U=J-Q[q],B=K[Q[q]-1]++<<U;for(var P=B|(1<<U)-1;B<=P;++B)X[Q$[B]>>Z]=H}}else{X=new Y8($);for(q=0;q<$;++q)if(Q[q])X[q]=Q$[K[Q[q]-1]++]>>15-Q[q]}return X},i8,g,g,g,g,m7,g,D3,E3,tY=function(Q){var J=Q[0];for(var Y=1;Y<Q.length;++Y)if(Q[Y]>J)J=Q[Y];return J},T0=function(Q,J,Y){var $=J/8|0;return(Q[$]|Q[$+1]<<8)>>(J&7)&Y},eY=function(Q,J){var Y=J/8|0;return(Q[Y]|Q[Y+1]<<8|Q[Y+2]<<16)>>(J&7)},w3=function(Q){return(Q+7)/8|0},v3=function(Q,J,Y){if(J==null||J<0)J=0;if(Y==null||Y>Q.length)Y=Q.length;return new R0(Q.subarray(J,Y))},x3,s0=function(Q,J,Y){var $=Error(J||x3[Q]);if($.code=Q,Error.captureStackTrace)Error.captureStackTrace($,s0);if(!Y)throw $;return $},S3=function(Q,J,Y,$){var q=Q.length,V=$?$.length:0;if(!q||J.f&&!J.l)return Y||new R0(0);var K=!Y,X=K||J.i!=2,Z=J.i;if(K)Y=new R0(q*3);var H=function(VQ){var W=Y.length;if(VQ>W){var G=new R0(Math.max(W*2,VQ));G.set(Y),Y=G}},U=J.f||0,B=J.p||0,P=J.b||0,z=J.l,N=J.d,j=J.m,C=J.n,A=q*8;do{if(!z){U=T0(Q,B,1);var M=T0(Q,B+1,3);if(B+=3,!M){var T=w3(B)+4,R=Q[T-4]|Q[T-3]<<8,D=T+R;if(D>q){if(Z)s0(0);break}if(X)H(P+R);Y.set(Q.subarray(T,D),P),J.b=P+=R,J.p=B=D*8,J.f=U;continue}else if(M==1)z=D3,N=E3,j=9,C=5;else if(M==2){var x=T0(Q,B,31)+257,w=T0(Q,B+10,15)+4,v=x+T0(Q,B+5,31)+1;B+=14;var L=new R0(v),k=new R0(19);for(var I=0;I<w;++I)k[M3[I]]=T0(Q,B+I*3,7);B+=w*3;var _=tY(k),o=(1<<_)-1,i=n8(k,_,1);for(var I=0;I<v;){var D0=i[T0(Q,B,o)];B+=D0&15;var T=D0>>4;if(T<16)L[I++]=T;else{var y=0,$0=0;if(T==16)$0=3+T0(Q,B,3),B+=2,y=L[I-1];else if(T==17)$0=3+T0(Q,B,7),B+=3;else if(T==18)$0=11+T0(Q,B,127),B+=7;while($0--)L[I++]=y}}var W0=L.subarray(0,x),Q0=L.subarray(x);j=tY(W0),C=tY(Q0),z=n8(W0,j,1),N=n8(Q0,C,1)}else s0(1);if(B>A){if(Z)s0(0);break}}if(X)H(P+131072);var $Q=(1<<j)-1,m=(1<<C)-1,H8=B;for(;;H8=B){var y=z[eY(Q,B)&$Q],E0=y>>4;if(B+=y&15,B>A){if(Z)s0(0);break}if(!y)s0(2);if(E0<256)Y[P++]=E0;else if(E0==256){H8=B,z=null;break}else{var E6=E0-254;if(E0>264){var I=E0-257,B0=g7[I];E6=T0(Q,B,(1<<B0)-1)+b7[I],B+=B0}var U6=N[eY(Q,B)&m],W8=U6>>4;if(!U6)s0(3);B+=U6&15;var Q0=T3[W8];if(W8>3){var B0=h7[W8];Q0+=eY(Q,B)&(1<<B0)-1,B+=B0}if(B>A){if(Z)s0(0);break}if(X)H(P+131072);var qQ=P+E6;if(P<Q0){var U8=V-Q0,Z8=Math.min(Q0,qQ);if(U8+P<0)s0(3);for(;P<Z8;++P)Y[P]=$[U8+P]}for(;P<qQ;++P)Y[P]=Y[P-Q0]}}if(J.l=z,J.p=H8,J.b=P,J.f=U,z)U=1,J.m=j,J.d=N,J.n=C}while(!U);return P!=Y.length&&K?v3(Y,0,P):Y.subarray(0,P)},k3,y3,g3=0;var c7=UJ(()=>{N3=F3("/");try{$8=N3("worker_threads"),C3=$8.Worker,R3=$8.isMarkedAsUntransferable}catch(Q){}R0=Uint8Array,Y8=Uint16Array,I3=Int32Array,g7=new R0([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,0,0,0]),h7=new R0([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,0,0]),M3=new R0([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),$8=_7(g7,2),b7=$8.b,A3=$8.r;b7[28]=258,A3[258]=28;f7=_7(h7,0),T3=f7.b,ZB=f7.r,Q$=new Y8(32768);for(g=0;g<32768;++g)_0=(g&43690)>>1|(g&21845)<<1,_0=(_0&52428)>>2|(_0&13107)<<2,_0=(_0&61680)>>4|(_0&3855)<<4,Q$[g]=((_0&65280)>>8|(_0&255)<<8)>>1;i8=new R0(288);for(g=0;g<144;++g)i8[g]=8;for(g=144;g<256;++g)i8[g]=9;for(g=256;g<280;++g)i8[g]=7;for(g=280;g<288;++g)i8[g]=8;m7=new R0(32);for(g=0;g<32;++g)m7[g]=5;D3=n8(i8,9,1),E3=n8(m7,5,1),x3=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],k3=new R0(0);y3=typeof TextDecoder<"u"&&new TextDecoder;try{y3.decode(k3,{stream:!0}),g3=1}catch(Q){}});var t7={};QX(t7,{initEpubFile:()=>RU,EPUB_HREF_PREFIX:()=>A6});import h3,{writeFileSync as _3,existsSync as b3,mkdirSync as f3,unlink as m3,readFileSync as u3}from"node:fs";import{Buffer as $$}from"node:buffer";import QJ from"node:crypto";function n7(Q,J,Y){_3(Q,J,Y)}function c3(Q,J){return u3(Q)}function p7(Q){return b3(Q)}function p3(Q,J){return f3(Q,J)}function l3(Q){m3(Q,()=>{})}async function n3(Q){let J=new i7(Q);return await J.loadZip(),J}class i7{constructor(Q){this.filePath=Q,J$(this,"jsZip"),J$(this,"names"),J$(this,"pathToProcessors",{})}getNames(){return[...this.names.values()]}useDeprocessors(Q){this.pathToProcessors={...this.pathToProcessors,...Q}}async loadZip(){this.jsZip=await this.readZip(this.filePath),this.names=new Map(Object.keys(this.jsZip.files).map((Q)=>{return[Q.toLowerCase(),Q]}))}async readZip(Q){return new Promise((J,Y)=>{{let $=typeof Q==="string"?new Uint8Array(h3.readFileSync(Q)):Q;new o7.default().loadAsync($).then((q)=>{J(q)})}})}async readFile(Q){let J=await this.readResource(Q);return new TextDecoder().decode(J)}async readResource(Q){if(!this.hasFile(Q))return console.warn(`${Q} file was not exit in ${this.filePath}, return an empty uint8 array`),new Uint8Array;let J=this.getFileName(Q),Y=await this.jsZip.file(J).async("uint8array");if(this.pathToProcessors[J])for(let $ of this.pathToProcessors[J])Y=await $(Y);return Y}hasFile(Q){return this.names.has(Q.toLowerCase())}getFileName(Q){return this.names.get(Q.toLowerCase())}}function Y$(Q){let J=new Set;for(let Y of String(Q).matchAll(/xmlns:([\w.-]+)\s*=\s*["']([^"']*)["']/g))if(s3.has(Y[2].trim().replace(/\/+$/,"")))J.add(Y[1]);return{tagNameProcessors:[(Y)=>{let $=Y.indexOf(":");return $>0&&J.has(Y.slice(0,$))?Y.slice($+1):Y}]}}function t3(Q){let J={};if(Q.rsaPrivateKey)J.rsaPrivateKey=typeof Q.rsaPrivateKey==="string"?Uint8Array.from(atob(Q.rsaPrivateKey),(Y)=>Y.charCodeAt(0)):Q.rsaPrivateKey;if(Q.aesSymmetricKey)J.aesSymmetricKey=typeof Q.aesSymmetricKey==="string"?Uint8Array.from(atob(Q.aesSymmetricKey),(Y)=>Y.charCodeAt(0)):Q.aesSymmetricKey;return J}function e3(Q){let J=new Map;return(...Y)=>{let $=JSON.stringify(Y);if(J.has($))return J.get($);let q=Q(...Y);return J.set($,q),q}}function QU(Q){if(Q.endsWith("s"))return Number.parseFloat(Q);let J=Q.split(":").map(Number);if(J.length===3){let[Y,$,q]=J;return Y*3600+$*60+q}else if(J.length===2){let[Y,$]=J;return Y*60+$}else return Number(Q)}async function JU(Q,J,Y="sha256"){{let $=$$.from(J,"base64"),q=QJ.createPrivateKey({key:$$.from(Q),format:"der",type:"pkcs8"}),V=QJ.privateDecrypt({key:q,padding:QJ.constants.RSA_PKCS1_OAEP_PADDING,oaepHash:Y},$);return new Uint8Array(V)}}async function d7(Q,J,Y){{let $=Q.endsWith("gcm"),q=$?12:16,V=$?16:0,K=Y.slice(0,q),X=$?Y.slice(Y.length-V):void 0,Z=Y.slice(q,Y.length-V),H=QJ.createDecipheriv(Q,J,K);if($&&X)H.setAuthTag(X);let U=$$.concat([H.update(Z),H.final()]);return new Uint8Array(U)}}function YU(Q){let J=Q.trim().toLowerCase();if(J!=="application/epub+zip")throw Error("Unsupported mime type. The mimetype file must be the application/epub+zip");return J}function $U(Q){let J=Q.container;if(!J||!J.rootfiles||J.rootfiles.length===0)throw Error("No <rootfiles></rootfiles> tag found in meta-inf/container.xml");let Y=J.rootfiles[0].rootfile[0];if(Y.$["media-type"]!=="application/oebps-package+xml")throw Error("media-type of <rootfile/> application/oebps-package+xml");let q=Y.$["full-path"];if(t.isAbsolutePosix(q))throw Error("full-path must be a relative path");return q}function qU(Q){let J={title:"",language:"",identifier:{id:""},packageIdentifier:{id:""},metas:{}},Y=new Map;for(let K in Q){let X=Q[K],Z=K.split(":").pop();switch(Z){case"title":case"language":case"description":case"publisher":case"type":case"format":case"source":case"relation":case"coverage":case"rights":{J[Z]=X[0]._??X[0];break}case"date":{J.date={};for(let H of X){let U=H.$?.["opf:event"]??"publication";J.date[U]=H._??H}break}case"identifier":{for(let H of X){let U={id:H._,scheme:H.$?.["opf:scheme"]??""},B=H.$&&H.$.id;if(B)J.packageIdentifier=U,Y.set(B,U);else J.identifier=U}break}case"subject":{J.subject=[];for(let H of X){let U=H.$,B={subject:H._??H,authority:U?.authority??"",term:U?.term??""};if(J.subject.push(B),H.$?.id)Y.set(H.$.id,B)}break}case"creator":case"contributor":{J[Z]=[];for(let H of X){let U=H.$,B={contributor:H._??H,fileAs:U?.["opf:file-as"]??"",role:U?.["opf:role"]??""};if(J[Z].push(B),U?.id)Y.set(U.id,B)}break}}}let $=Q.meta??[];for(let K of $){let X=K.$;if(K._)if(X.refines){let Z=X.refines.slice(1),H=Y.get(Z);if(!H){console.warn(`No element with id "${Z}" found when parsing <metadata>`);continue}let U=GQ(X.property);if("contributor"in H)H[U]||(H[U]=K._);else if("subject"in H)H[U]||(H[U]=K._);else if("id"in H)H[U]||(H[U]=K._),H.scheme=H.scheme||X.scheme}else{let Z=X.property;J.metas[Z]=K._}else{let Z=X.name;J.metas[Z]=X.content}}let q=Q.link??[],V=[];for(let K of q){let X=K.$;if(!X.refines){let Z={href:"",rel:""};for(let H in X)Z[GQ(H)]=X[H];V.push(Z)}else{let Z=X.refines.slice(1),H=Y.get(Z);if(!H){console.warn(`No element with id "${Z}" found when parsing <metadata>`);continue}let U=GQ(X.rel),B=X.href;H[U]=B}}return J.links=V,J}function VU(Q,J){let Y=Q.item;if(!Y)throw Error("The manifest element must contain one or more item elements");let $={},q=[];for(let V of Y){let K=V.$,{id:X,href:Z,"media-type":H,"media-overlay":U,properties:B}=K;if(!K||!X||!Z||!H){console.warn("The item in manifest must have attributes id, href and mediaType. So skip this item.");continue}if($[X]={id:X,href:t.joinPosix(J,Z),mediaType:H,properties:B||"",mediaOverlay:U||""},K.fallback)$[X].fallback=[K.fallback],q.push($[X])}for(let V of q){let K=new Set;K.add(V.id);let X=$[V.fallback[0]];while(X&&X.fallback){K.add(X.id);let Z=X.fallback;if(Z.length>1){V.fallback.push(...Z);break}let H=Z[0];if(K.has(H)){console.warn(`Cycle references have appeard when next item id is "${H}". Therefore stop parsing.`);break}V.fallback.push(H),X=$[H]}}return $}function KU(Q,J){let Y="";if(Q.$?.toc)Y=J[Q.$.toc]?.href??"";let $=[],q=Q.itemref;if(!q)throw Error("The spine element must contain one or more itemref elements");for(let V of q){let K=V.$;if(K.idref){let X=J[K.idref];if(!X)continue;$.push({...X,href:`epub:${X.href}`,linear:K.linear||"yes"})}}return{tocPath:Y,spine:$}}function XU(Q,J){let Y=[],$=Q.reference;if(!$)return Y;for(let q of $){let V=q.$;if(V.href&&V.href.length>0)V.href=A6+t.joinPosix(J,V.href);Y.push(V)}return Y}function GU(Q,J){let Y=[];for(let $ of Q){let q=$.$.role,V=[];for(let K of $.link)V.push(t.joinPosix(J,K.$.href));Y.push({role:q,links:V})}return Y}function HU(Q,J,Y){let $=[];return r7($,Q?.navPoint??[],J,Y),$}function r7(Q,J,Y,$){for(let q of J){let V={label:"",href:"",id:"",playOrder:""};if(q.navLabel){let K=t.joinPosix($,decodeURIComponent(q.content[0].$?.src)),X=K.split("#")[0];V={label:q.navLabel[0].text?.[0]??"",href:A6+K,id:Y[X],playOrder:q.$?.playOrder??""},Q.push(V)}if(q.navPoint)V.children=[],r7(V.children,q.navPoint,Y,$)}}function WU(Q,J,Y){let $="";if(Q.navLabel)$=Q.navLabel[0].text[0];let q=[];for(let V of Q.pageTarget){let K=t.joinPosix(Y,decodeURIComponent(V.content[0].$?.src)),X=K.split("#")[0],Z=V.$,H={label:V.navLabel[0].text[0]||"",value:Z.value||"",href:A6+K,playOrder:Z.playOrder||"",type:Z.type||"",correspondId:J[X]};q.push(H)}return{label:$,pageTargets:q}}function UU(Q,J,Y){let $="";if(Q.navLabel)$=Q.navLabel[0].text[0];let q=[];for(let V of Q.navTarget){let K=t.joinPosix(Y,decodeURIComponent(V.content[0].$?.src)),X=K.split("#")[0],Z={label:V.navLabel[0]?.text?.[0]||"",href:A6+K,correspondId:J[X]};q.push(Z)}return{label:$,navTargets:q}}async function ZU(Q,J){if(!Q)return{};let Y={};for(let $ of Q){let q=$.$.Id,V=$.EncryptionMethod[0],K=V.$.Algorithm.split("#")[1];if(!K.startsWith("rsa"))throw Error(`Unsupported encryption algorithm: ${K}. Only RSA and AES algorithms are supported.`);let X="sha1";if(K==="rsa-oaep")X=V.DigestMethod[0].$.Algorithm.split("#")[1];let Z=$.CipherData[0].CipherValue[0].trim(),H=await JU(J,Z,X);Y[q]=H}return Y}function LU(Q=[],J,Y){let $={};for(let q of Q){let V=q.EncryptionMethod[0].$.Algorithm.split("#")[1];if(!V.startsWith("aes")){console.warn(`Unsupported encryption algorithm: ${V}. Only AES and RSA algorithms are supported.`);continue}let K=V.replace("aes","aes-"),X=q.CipherData[0].CipherReference[0].$.URI;$[X]=[];let Z=$[X],H=q.KeyInfo?.[0];if(H&&H.RetrievalMethod){let B=H.RetrievalMethod[0].$.URI.slice(1),P=J[B];if(!P)throw Error(`No symmetric key found for id "${B}". Skipping decryption for file "${X}".`);let z=async(N)=>{return await d7(K,P,N)};Z.push(z)}else{let B=async(P)=>{return await d7(K,Y,P)};Z.push(B)}let U=q.EncryptionProperties?.[0].EncryptionProperty;if(U)for(let B of U){let P=B.Compression[0];if(P&&P.$.Method==="8")Z.push(u7)}$[X]=Z}return $}function OU(Q){let J=Q.EncryptionMethod?.[0]?.$?.Algorithm;return!BU.includes(J)}async function PU(Q,J){let Y=Q.encryption,$=Y.EncryptedKey,q=Y.EncryptedData??[],V=q?.filter(OU);if(q.length!==V.length){if(console.warn("lingo-reader doesn't handle font obfuscation and it doesn't read the font file."),V.length===0)return{}}if($&&!J.rsaPrivateKey)throw Error("Please provide the RSA private key to decrypt the encrypted AES keys.");if(!$&&V&&!J.aesSymmetricKey)throw Error("The file is encrypted with AES, but no symmetric key is provided. ");let K=await ZU($,J.rsaPrivateKey);return LU(V,K,J.aesSymmetricKey)}function q8(Q,J,Y){let $=t.joinPosix(J,Q).replace(/\//g,"_");return t.resolve(Y,$)}function jU(Q,J,Y){return Q=Q.replace(/<(img|video|audio|source)[^>]*>/g,($)=>{let q=$.match(/src="([^"]*)"/)?.[1];if(q){let K=q8(q,J,Y);$=$.replace(q,K)}let V=$.match(/poster="([^"]*)"/)?.[1];if(V){let K=q8(V,J,Y);$=$.replace(V,K)}return $}),Q=Q.replace(/<image[^>]*>/g,($)=>{let q=$.match(/href="([^"]*)"/)?.[1];if(q){let V=q8(q,J,Y);$=$.replace(q,V)}return $}),Q=Q.replace(/<a[^>]*>/g,($)=>{let q=$.match(/href="([^"]*)"/)?.[1];if(q&&!/^https?|mailto/.test(q)){let V=t.joinPosix(J,q);$=$.replace(q,A6+decodeURIComponent(V))}return $}),Q}function zU(Q,J,Y){let $=Q.match(/<head[^>]*>([\s\S]*)<\/head>/i),q=[];if($){let X=$[1].match(/<link[^>]*>/g);if(X)for(let Z of X){let H=Z.match(/href=["']([^"']*)["']/)?.[1];if(!H)continue;if(H.endsWith(".css")){let U=t.joinPosix(J,H),B=U.replace(/\//g,"_"),P=t.resolve(Y,B),z;try{z=new TextDecoder().decode(c3(P))}catch{continue}z=z.replace(/url\(([^)]*)\)/g,(N,j)=>{return j=j.replace(/['"]/g,""),`url(${q8(j.trim(),t.dirname(U),Y)})`}),n7(P,new TextEncoder().encode(z)),q.push({id:B,href:P})}}}let V=Q.match(/<body[^>]*>(.*?)<\/body>/is),K=V?jU(V[1],J,Y):"";return{css:q,html:K}}function a7(Q,J,Y,$){for(let q of Q)if(q["#name"]==="par"){let V=q.text[0].$.src.split("#")[1],K=q.audio[0].$,X=q8(K.src,J,Y),Z=l7(K.clipBegin),H=l7(K.clipEnd);if(!$[X])$[X]={audioSrc:X,pars:[]};$[X].pars.push({textDOMId:V,clipBegin:Z,clipEnd:H})}else a7(q.children,J,Y,$)}function FU(Q,J,Y){let $={},q=Q.smil.body[0].children;return a7(q,J,Y,$),Object.values($)}async function RU(Q,J="./images",Y={}){let $=new s7(Q,J,Y);return await $.loadEpub(),await $.parse(),$}class s7{constructor(Q,J="./images",Y={}){if(this.epub=Q,this.options=Y,q0(this,"fileName",""),q0(this,"mimeType",""),q0(this,"metadata"),q0(this,"manifest",{}),q0(this,"spine",[]),q0(this,"guide",[]),q0(this,"collections",[]),q0(this,"navMap",[]),q0(this,"pageList"),q0(this,"navList"),q0(this,"zip"),q0(this,"opfPath",""),q0(this,"opfDir",""),q0(this,"resourceSaveDir"),q0(this,"encryptionKeys",{}),q0(this,"savedResourcePath",[]),q0(this,"hrefToIdMap",{}),q0(this,"chapterCache",new Map),typeof Q==="string")this.fileName=t.basename(Q);else if(Q instanceof Uint8Array)this.fileName="";else this.fileName=Q.name;if(this.resourceSaveDir=J,!p7(this.resourceSaveDir))p3(this.resourceSaveDir,{recursive:!0});this.encryptionKeys=t3(this.options)}getFileInfo(){return{fileName:this.fileName,mimetype:this.mimeType}}getMetadata(){return this.metadata}getManifest(){return this.manifest}getSpine(){return this.spine}getGuide(){return this.guide}getCollection(){return this.collections}getToc(){return this.navMap}getPageList(){return this.pageList}getNavList(){return this.navList}async loadEpub(){this.zip=await n3(this.epub)}async parse(){let Q=await this.zip.readFile("mimetype");this.mimeType=YU(Q);let J=await this.zip.readFile("meta-inf/container.xml"),Y=await v6(J,Y$(J));if(this.opfPath=$U(Y),this.opfDir=t.dirname(this.opfPath),this.zip.hasFile("meta-inf/encryption.xml")){let $=await this.zip.readFile("meta-inf/encryption.xml"),q=await v6($,{tagNameProcessors:[(K)=>K.replace(a3,"")]}),V=await PU(q,this.encryptionKeys);this.zip.useDeprocessors(V)}await this.parseRootFile()}async parseRootFile(){let Q=await this.zip.readFile(this.opfPath),Y=(await v6(Q,Y$(Q))).package,$="";if(Y.metadata)this.metadata=qU(Y.metadata[0]);if(Y.manifest){this.manifest=VU(Y.manifest[0],this.opfDir);for(let q in this.manifest){let V=this.manifest[q];if(this.hrefToIdMap[V.href]=V.id,r3.has(V.mediaType)||V.mediaType.startsWith("text/css")){let K=V.href.replace(/\//g,"_"),X=t.resolve(this.resourceSaveDir,K);this.savedResourcePath.push(X),n7(X,await this.zip.readResource(V.href))}}}if(Y.spine){let q=KU(Y.spine[0],this.manifest);$=q.tocPath,this.spine=q.spine}if(Y.guide)this.guide=XU(Y.guide[0],this.opfDir);if(Y.collection)this.collections=GU(Y.collection,this.opfDir);if($.length>0){let q=t.dirname($),V=await this.zip.readFile($),K=(await v6(V,Y$(V))).ncx;if(K.navMap)this.navMap=HU(K.navMap[0],this.hrefToIdMap,q);if(K.pageList)this.pageList=WU(K.pageList[0],this.hrefToIdMap,q);if(K.navList)this.navList=UU(K.navList[0],this.hrefToIdMap,q)}}async loadChapter(Q){if(this.chapterCache.has(Q))return this.chapterCache.get(Q);let J=this.manifest[Q],Y=J.href,$=t.dirname(Y),q=zU(await this.zip.readFile(Y),$,this.resourceSaveDir),V=J.mediaOverlay;if(V){let X=this.manifest[V].href,Z=FU(await v6(await this.zip.readFile(X),{preserveChildrenOrder:!0,explicitChildren:!0,childkey:"children"}),t.dirname(X),this.resourceSaveDir);q.mediaOverlays=Z}return this.chapterCache.set(Q,q),q}resolveHref(Q){if(!Q.startsWith(A6))return;Q=Q.slice(5).trim();let[J,Y]=Q.split("#"),$="";if(this.hrefToIdMap[J])$=this.hrefToIdMap[J];else return;let q="";if(Y)q=`[id="${Y}"]`;return{id:$,selector:q}}getCoverImage(){let Q=this.guide.find((J)=>J.type==="cover");if(Q){let J=this.resolveHref(Q.href).id,Y=this.manifest[J];return q8(Y.href,"",this.resourceSaveDir)}return""}destroy(){this.savedResourcePath.forEach((Q)=>{if(p7(Q))l3(Q)}),this.savedResourcePath.length=0}}var o7,d3,o3=(Q,J,Y)=>(J in Q)?d3(Q,J,{enumerable:!0,configurable:!0,writable:!0,value:Y}):Q[J]=Y,J$=(Q,J,Y)=>o3(Q,typeof J!=="symbol"?J+"":J,Y),i3,r3,a3,s3,l7,A6="epub:",BU,NU,CU=(Q,J,Y)=>(J in Q)?NU(Q,J,{enumerable:!0,configurable:!0,writable:!0,value:Y}):Q[J]=Y,q0=(Q,J,Y)=>CU(Q,typeof J!=="symbol"?J+"":J,Y);var e7=UJ(()=>{I$();c7();o7=j$(y7(),1);d3=Object.defineProperty;i3={jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",bmp:"image/bmp",ico:"image/x-icon",tiff:"image/tiff",tif:"image/tiff",heic:"image/heic",avif:"image/avif",css:"text/css",mp4:"video/mp4",mkv:"video/mkv",webm:"video/webm",mp3:"audio/mp3",wav:"audio/wav",ogg:"audio/ogg",ttf:"font/ttf",otf:"font/otf",woff:"font/woff",woff2:"font/woff2",eot:"font/eot"},r3=new Set(Object.values(i3)),a3=/(?!xmlns)^.*:/,s3=new Set(["http://www.idpf.org/2007/opf","http://www.daisy.org/z3986/2005/ncx","urn:oasis:names:tc:opendocument:xmlns:container"]);l7=e3(QU);BU=["http://www.idpf.org/2008/embedding","http://ns.adobe.com/pdf/enc#RC"];NU=Object.defineProperty});import{mkdir as yZ,writeFile as gZ}from"node:fs/promises";import{join as mK}from"node:path";import SZ from"node:fs/promises";import{existsSync as QK,readdirSync as IU,readFileSync as JK,statSync as MU}from"node:fs";import*as T6 from"node:path";import{createHash as YX}from"node:crypto";import{inflateSync as $X}from"node:zlib";var qX=new Set(["image/png","image/jpeg","image/gif","image/webp"]),VX={"image/png":"png","image/jpeg":"jpg","image/gif":"gif","image/webp":"webp","image/bmp":"bmp","image/tiff":"tif","image/svg+xml":"svg","image/emf":"emf","image/wmf":"wmf","image/x-pict":"pict"};function KX(Q){let J=($,...q)=>q.every((V,K)=>Q[$+K]===V);if(J(0,137,80,78,71))return"image/png";if(J(0,255,216,255))return"image/jpeg";if(J(0,71,73,70,56))return"image/gif";if(J(0,82,73,70,70)&&J(8,87,69,66,80))return"image/webp";if(J(0,66,77))return"image/bmp";if(J(0,73,73,42,0)||J(0,77,77,0,42))return"image/tiff";if(J(40,32,69,77,70))return"image/emf";if(J(0,215,205,198,154)||J(0,1,0,9,0))return"image/wmf";if(J(10,0,17,2,255))return"image/x-pict";let Y=Buffer.from(Q.subarray(0,256)).toString("utf8").trimStart();if(Y.startsWith("<svg")||Y.startsWith("<?xml")&&Y.includes("<svg"))return"image/svg+xml";return}function XX(Q){if(Q[0]!==120||![1,94,156,218].includes(Q[1]??0))return Q;try{return new Uint8Array($X(Q))}catch{return Q}}class ZJ{linkDir;byHash=new Map;names=new Set;pending=[];constructor(Q="images"){this.linkDir=Q}add(Q){if(Q.data.byteLength===0)return;let J=XX(Q.data),Y=YX("sha1").update(J).digest("hex"),$=this.byHash.get(Y);if($)return $;let q=KX(J)??Q.mediaType??"application/octet-stream",V=VX[q]??"bin",K=this.uniqueName(GX(Q.stem),V),X={file:K,link:`${this.linkDir}/${K}`,mediaType:q,bytes:J.byteLength,...Q.width?{width:Q.width}:{},...Q.height?{height:Q.height}:{},...Q.source?{source:Q.source}:{},...Q.alt?.trim()?{alt:Q.alt.trim()}:{},...qX.has(q)||q==="image/svg+xml"?{}:{notViewable:!0},sha1:Y};return this.byHash.set(Y,X),this.pending.push({image:X,data:J}),X}get images(){return this.pending.map((Q)=>Q.image)}entries(){return this.pending}uniqueName(Q,J){let Y=`${Q}.${J}`;for(let $=2;this.names.has(Y);$++)Y=`${Q}-${$}.${J}`;return this.names.add(Y),Y}}function GX(Q){return Q.replace(/\.[a-z0-9]{2,4}$/i,"").replace(/[^a-zA-Z0-9._-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,60)||"image"}function c0(Q){return`![${(Q.alt??"").replace(/[[\]\n]/g," ").trim()}](${Q.link})`}var AU=/\.(png|jpe?g|gif|webp|bmp|svg|tiff?)$/i;function TU(Q){if(Q.length<90)return 0;let J=new DataView(Q.buffer,Q.byteOffset,Q.byteLength),Y=J.getUint32(78);if(Y+14>Q.length)return 0;return J.getUint16(Y+12)}function DU(Q){let J=Buffer.from(Q.buffer,Q.byteOffset,Q.byteLength);return J.includes("META-INF/rights.xml")||J.includes("META-INF/license.lcpl")}function EU(Q){let J=Buffer.from(Q.buffer,Q.byteOffset,Q.byteLength);if(J.length<22||J.readUInt32LE(0)!==67324752)return"it does not start as a ZIP archive, which every EPUB is";let Y=J.lastIndexOf(Buffer.from([80,75,5,6]),J.length-22);if(Y<0||Y<J.length-22-65535)return`it ends before its index (${J.length.toLocaleString("en-US")} bytes), so it was cut short when it was copied, downloaded or unpacked`;let $=J.readUInt32LE(Y+12),q=J.readUInt32LE(Y+16);if(q!==4294967295&&$!==4294967295&&q+$>Y)return"its index points past the end of the file, so part of it is missing";return}var YK=120000;async function JJ(Q){let J;try{return await Promise.race([Q,new Promise((Y,$)=>{J=setTimeout(()=>$(Error(`The book could not be opened: the reader gave no answer in ${YK/1000}s, which is what it does with a damaged file. Check that the file is complete.`)),YK)})])}finally{clearTimeout(J)}}function $K(Q,J=0,Y=[]){for(let $ of Q){if(Y.length>=200)break;let q=String($.label??"").trim();if(q)Y.push(`${" ".repeat(J)}${q}`);if(Array.isArray($.children))$K($.children,J+1,Y)}return Y}function YJ(Q){if(typeof Q==="string")return Q.trim()||void 0;if(Array.isArray(Q))for(let J of Q){let Y=YJ(typeof J==="object"&&J!==null?J.contributor??J.name:J);if(Y)return Y}if(typeof Q==="object"&&Q!==null){let J=Q;return YJ(J.contributor??J.name??J.value)}return}async function wU(Q){let{default:J}=await import("turndown"),{gfm:Y}=await import("@joplin/turndown-plugin-gfm"),$=new J({headingStyle:"atx",codeBlockStyle:"fenced",bulletListMarker:"-"});return $.use(Y),$.remove(["script","style","head"]),$.addRule("image",{filter:"img",replacement:(q,V)=>{let K=V,X=K.getAttribute("src")??"";return Q(X,K.getAttribute("alt")??"")??""}}),$.addRule("svgImage",{filter:(q)=>q.nodeName.toLowerCase()==="image",replacement:(q,V)=>{let K=V,X=K.getAttribute("xlink:href")??K.getAttribute("href")??"";return Q(X,"")??""}}),$}async function qK(Q,J,Y,$){if((Y==="mobi"||Y==="azw3")&&TU(J)>1)throw Error("This Kindle book is DRM-protected. It can be read only in a Kindle app; nothing here can remove the protection.");if(Y==="epub"&&DU(J))throw Error("This EPUB is DRM-protected (Adobe ADEPT or Readium LCP). It can be read only in a reader app licensed for it.");if(Y==="epub"){let B=EU(J);if(B)throw Error(`This EPUB is damaged: ${B}. Nothing can be read from it; get the file again.`)}let q=$.scratchDir,{initEpubFile:V}=await Promise.resolve().then(() => (e7(),t7)),{initFb2File:K}=await import("@lingo-reader/fb2-parser"),{initKf8File:X,initMobiFile:Z}=await import("@lingo-reader/mobi-parser"),H,U;if(Y==="epub")H=await JJ(V(Q,q)),U="lingo-reader (EPUB)";else if(Y==="fb2")H=await JJ(K(Q,q)),U="lingo-reader (FB2)";else{let[B,P]=Y==="azw3"?[X,Z]:[Z,X];try{H=await JJ(B(Q,q)),U=`lingo-reader (${B===X?"KF8":"MOBI"})`}catch{H=await JJ(P(Q,q)),U=`lingo-reader (${P===X?"KF8":"MOBI"})`}}try{let B=new Map,P=0,N=await wU((x,w)=>{if(!$.wantImages||!x||/^(data:|https?:)/i.test(x))return;let v=x;try{v=decodeURI(x.replace(/^file:\/\//,""))}catch{}if(!T6.isAbsolute(v)||!QK(v))return;if(!B.has(v))B.set(v,$.images.add({data:JK(v),stem:T6.basename(v),source:`chapter ${P}`,...w?{alt:w}:{}}));let L=B.get(v);return L?c0(L):void 0}),j=H.getSpine(),C=[],A=[];for(let x=0;x<j.length;x++){let w=x+1;if($.selects&&!$.selects(w))continue;$.signal?.throwIfAborted(),P=w,$.onProgress?.({unit:"chapter",at:w,total:j.length,pictures:B.size}),C.push(w);let L=(await H.loadChapter(j[x].id))?.html??"",k=L?N.turndown(L).trim():"";if(k)A.push(k)}if($.wantImages&&QK(q))for(let x of IU(q,{recursive:!0})){let w=T6.join(q,x);if(!AU.test(x)||B.has(w)||!MU(w).isFile())continue;B.set(w,$.images.add({data:JK(w),stem:T6.basename(x)}))}let M=H.getMetadata()??{},T=YJ(M.title),R=YJ(M.creator??M.author),D=$K(H.getToc()??[]);return{markdown:A.join(`
13
-
14
- `),reader:U,...T&&T!=="Unknown"?{title:T}:{},...R&&R!=="Unknown"?{author:R}:{},units:{name:"chapter",total:j.length,read:C},...D.length?{contents:D}:{}}}finally{H.destroy()}}import*as q$ from"node:path";var vU={pdf:"PDF",docx:"Word document (DOCX)",pptx:"PowerPoint presentation (PPTX)",xlsx:"Excel workbook (XLSX)",odt:"OpenDocument text (ODT)",odp:"OpenDocument presentation (ODP)",ods:"OpenDocument spreadsheet (ODS)",odg:"OpenDocument drawing (ODG)",rtf:"Rich Text (RTF)",csv:"CSV",html:"HTML",epub:"EPUB ebook",mobi:"Mobipocket / Kindle ebook (MOBI)",azw3:"Kindle KF8 ebook (AZW3)",fb2:"FictionBook (FB2)",doc:"Word 97-2003 document (DOC)",xls:"Excel 97-2003 workbook (XLS)",ppt:"PowerPoint 97-2003 presentation (PPT)"},VK={".pdf":"pdf",".docx":"docx",".docm":"docx",".dotx":"docx",".pptx":"pptx",".pptm":"pptx",".ppsx":"pptx",".xlsx":"xlsx",".xlsm":"xlsx",".odt":"odt",".odp":"odp",".ods":"ods",".odg":"odg",".rtf":"rtf",".csv":"csv",".html":"html",".htm":"html",".xhtml":"html",".epub":"epub",".mobi":"mobi",".prc":"mobi",".azw":"mobi",".azw3":"azw3",".kf8":"azw3",".fb2":"fb2",".doc":"doc",".dot":"doc",".xls":"xls",".ppt":"ppt",".pps":"ppt"},xU={".djvu":"DjVu has no JavaScript reader.",".djv":"DjVu has no JavaScript reader.",".chm":"Compiled HTML Help (CHM) has no JavaScript reader.",".lit":"Microsoft Reader (LIT) has no JavaScript reader.",".lrf":"Sony BBeB (LRF) has no JavaScript reader.",".kfx":"KFX is Amazon's DRM-bound format and cannot be read.",".pages":"Apple Pages files have no JavaScript reader; export them as DOCX or PDF.",".key":"Apple Keynote files have no JavaScript reader; export them as PPTX or PDF.",".numbers":"Apple Numbers files have no JavaScript reader; export them as XLSX or CSV.",".xlsb":"Binary Excel workbooks (XLSB) are not read; save the workbook as XLSX.",".wps":"Microsoft Works documents are not read; save them as DOCX.",".cbz":"Comic archives are not read yet.",".cbr":"Comic archives are not read yet."},RB=Object.keys(VK);function KK(Q,J){let Y=q$.extname(Q).toLowerCase(),$=xU[Y];if($)return{unsupported:$};let q=Buffer.from(J.subarray(0,512)).toString("latin1"),V=VK[Y];if(q.startsWith("%PDF"))return{format:"pdf"};if(q.startsWith("{\\rtf"))return{format:"rtf"};if(q.slice(60,68)==="BOOKMOBI")return{format:V==="azw3"?"azw3":"mobi"};let K=q.startsWith("PK\x03\x04"),X=q.startsWith("ÐÏ\x11ࡱ\x1Aá");if(K){if(q.includes("mimetypeapplication/epub+zip"))return{format:"epub"};let Z=/mimetypeapplication\/vnd\.oasis\.opendocument\.(text|presentation|spreadsheet|graphics)/.exec(q);if(Z)return{format:{text:"odt",presentation:"odp",spreadsheet:"ods",graphics:"odg"}[Z[1]]};if(V&&["docx","pptx","xlsx","epub","odt","odp","ods","odg"].includes(V))return{format:V};if(V==="doc")return{format:"docx"};if(V==="xls")return{format:"xlsx"};if(V==="ppt")return{format:"pptx"}}if(X){if(V==="doc"||V==="xls"||V==="ppt")return{format:V};if(V==="docx")return{format:"doc"};if(V==="xlsx")return{format:"xls"};if(V==="pptx")return{format:"ppt"};return{unsupported:"This is an OLE compound file, but its extension does not say which Office program wrote it; rename it to .doc, .xls or .ppt."}}if(V==="fb2"||/<FictionBook[\s>]/.test(q))return{format:"fb2"};if(V==="html"||V==="csv")return{format:V};if(V)return{unsupported:`The file is named as ${vU[V]} but its contents are not; it may be damaged or a different format.`};return{unsupported:`No reader for ${Y||"files without an extension"}. Readable: PDF, DOCX/DOC, PPTX/PPT, XLSX/XLS, ODT/ODP/ODS/ODG, RTF, CSV, HTML, EPUB, MOBI/AZW/AZW3, FB2.`}}import{existsSync as UK,readFileSync as mU}from"node:fs";import{dirname as OK,join as ZK}from"node:path";import{fileURLToPath as uU}from"node:url";class QQ{__destroy_into_raw(){let Q=this.__wbg_ptr;return this.__wbg_ptr=0,XK.unregister(this),Q}free(){let Q=this.__destroy_into_raw();S.__wbg_wasmdocument_free(Q,0)}formatName(){let Q,J;try{let q=S.__wbindgen_add_to_stack_pointer(-16);S.wasmdocument_formatName(q,this.__wbg_ptr);var Y=c().getInt32(q+0,!0),$=c().getInt32(q+4,!0);return Q=Y,J=$,W6(Y,$)}finally{S.__wbindgen_add_to_stack_pointer(16),S.__wbindgen_export3(Q,J,1)}}constructor(Q,J){try{let V=S.__wbindgen_add_to_stack_pointer(-16),K=HK(Q,S.__wbindgen_export),X=f0,Z=t8(J,S.__wbindgen_export,S.__wbindgen_export2),H=f0;S.wasmdocument_new(V,K,X,Z,H);var Y=c().getInt32(V+0,!0),$=c().getInt32(V+4,!0),q=c().getInt32(V+8,!0);if(q)throw b0($);return this.__wbg_ptr=Y,XK.register(this,this.__wbg_ptr,this),this}finally{S.__wbindgen_add_to_stack_pointer(16)}}plainText(){let Q,J;try{let q=S.__wbindgen_add_to_stack_pointer(-16);S.wasmdocument_plainText(q,this.__wbg_ptr);var Y=c().getInt32(q+0,!0),$=c().getInt32(q+4,!0);return Q=Y,J=$,W6(Y,$)}finally{S.__wbindgen_add_to_stack_pointer(16),S.__wbindgen_export3(Q,J,1)}}toHtml(){let Q,J;try{let q=S.__wbindgen_add_to_stack_pointer(-16);S.wasmdocument_toHtml(q,this.__wbg_ptr);var Y=c().getInt32(q+0,!0),$=c().getInt32(q+4,!0);return Q=Y,J=$,W6(Y,$)}finally{S.__wbindgen_add_to_stack_pointer(16),S.__wbindgen_export3(Q,J,1)}}toIr(){try{let $=S.__wbindgen_add_to_stack_pointer(-16);S.wasmdocument_toIr($,this.__wbg_ptr);var Q=c().getInt32($+0,!0),J=c().getInt32($+4,!0),Y=c().getInt32($+8,!0);if(Y)throw b0(J);return b0(Q)}finally{S.__wbindgen_add_to_stack_pointer(16)}}toMarkdownWithImages(){let Q,J;try{let q=S.__wbindgen_add_to_stack_pointer(-16);S.wasmdocument_toMarkdownWithImages(q,this.__wbg_ptr);var Y=c().getInt32(q+0,!0),$=c().getInt32(q+4,!0);return Q=Y,J=$,W6(Y,$)}finally{S.__wbindgen_add_to_stack_pointer(16),S.__wbindgen_export3(Q,J,1)}}toMarkdown(){let Q,J;try{let q=S.__wbindgen_add_to_stack_pointer(-16);S.wasmdocument_toMarkdown(q,this.__wbg_ptr);var Y=c().getInt32(q+0,!0),$=c().getInt32(q+4,!0);return Q=Y,J=$,W6(Y,$)}finally{S.__wbindgen_add_to_stack_pointer(16),S.__wbindgen_export3(Q,J,1)}}}if(Symbol.dispose)QQ.prototype[Symbol.dispose]=QQ.prototype.free;class K${__destroy_into_raw(){let Q=this.__wbg_ptr;return this.__wbg_ptr=0,GK.unregister(this),Q}free(){let Q=this.__destroy_into_raw();S.__wbg_wasmeditabledocument_free(Q,0)}constructor(Q,J){try{let V=S.__wbindgen_add_to_stack_pointer(-16),K=HK(Q,S.__wbindgen_export),X=f0,Z=t8(J,S.__wbindgen_export,S.__wbindgen_export2),H=f0;S.wasmeditabledocument_new(V,K,X,Z,H);var Y=c().getInt32(V+0,!0),$=c().getInt32(V+4,!0),q=c().getInt32(V+8,!0);if(q)throw b0($);return this.__wbg_ptr=Y,GK.register(this,this.__wbg_ptr,this),this}finally{S.__wbindgen_add_to_stack_pointer(16)}}replaceText(Q,J){try{let V=S.__wbindgen_add_to_stack_pointer(-16),K=t8(Q,S.__wbindgen_export,S.__wbindgen_export2),X=f0,Z=t8(J,S.__wbindgen_export,S.__wbindgen_export2),H=f0;S.wasmeditabledocument_replaceText(V,this.__wbg_ptr,K,X,Z,H);var Y=c().getInt32(V+0,!0),$=c().getInt32(V+4,!0),q=c().getInt32(V+8,!0);if(q)throw b0($);return Y>>>0}finally{S.__wbindgen_add_to_stack_pointer(16)}}toBytes(){try{let V=S.__wbindgen_add_to_stack_pointer(-16);S.wasmeditabledocument_toBytes(V,this.__wbg_ptr);var Q=c().getInt32(V+0,!0),J=c().getInt32(V+4,!0),Y=c().getInt32(V+8,!0),$=c().getInt32(V+12,!0);if($)throw b0(Y);var q=yU(Q,J).slice();return S.__wbindgen_export3(Q,J*1,1),q}finally{S.__wbindgen_add_to_stack_pointer(16)}}}if(Symbol.dispose)K$.prototype[Symbol.dispose]=K$.prototype.free;function SU(){return{__proto__:null,"./office_oxide_bg.js":{__proto__:null,__wbg_Error_67e7344beaa85059:function(J,Y){let $=Error(W6(J,Y));return H6($)},__wbg_String_8564e559799eccda:function(J,Y){let $=String(a8(Y)),q=t8($,S.__wbindgen_export,S.__wbindgen_export2),V=f0;c().setInt32(J+4,V,!0),c().setInt32(J+0,q,!0)},__wbg___wbindgen_throw_5d9e815e6fdf150f:function(J,Y){throw Error(W6(J,Y))},__wbg_new_bebc3f4757acf305:function(){return H6({})},__wbg_new_ffa92086ea89f79c:function(){return H6([])},__wbg_set_13d25b81ab403f5e:function(J,Y,$){a8(J)[Y>>>0]=b0($)},__wbg_set_6be42768c690e380:function(J,Y,$){a8(J)[b0(Y)]=b0($)},__wbindgen_generic_0000000000000001:function(J){return H6(J)},__wbindgen_generic_0000000000000002:function(J){return H6(J)},__wbindgen_generic_0000000000000003:function(J,Y){let $=W6(J,Y);return H6($)},__wbindgen_generic_0000000000000004:function(J){let Y=BigInt.asUintN(64,J);return H6(Y)},__wbindgen_object_clone_ref:function(J){let Y=a8(J);return H6(Y)},__wbindgen_object_drop_ref:function(J){b0(J)}}}}var XK=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((Q)=>S.__wbg_wasmdocument_free(Q,1)),GK=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((Q)=>S.__wbg_wasmeditabledocument_free(Q,1));function H6(Q){if(s8===t0.length)t0.push(t0.length+1);let J=s8;return s8=t0[J],t0[J]=Q,J}function kU(Q){if(Q<1028)return;t0[Q]=s8,s8=Q}function yU(Q,J){return Q=Q>>>0,V8().subarray(Q/1,Q/1+J)}var D6=null;function c(){if(D6===null||D6.buffer.detached===!0||D6.buffer.detached===void 0&&D6.buffer!==S.memory.buffer)D6=new DataView(S.memory.buffer);return D6}function W6(Q,J){return hU(Q>>>0,J)}var r8=null;function V8(){if(r8===null||r8.byteLength===0)r8=new Uint8Array(S.memory.buffer);return r8}function a8(Q){return t0[Q]}var t0=Array(1024).fill(void 0);t0.push(void 0,null,!0,!1);var s8=t0.length;function HK(Q,J){let Y=J(Q.length*1,1)>>>0;return V8().set(Q,Y/1),f0=Q.length,Y}function t8(Q,J,Y){if(Y===void 0){let X=e8.encode(Q),Z=J(X.length,1)>>>0;return V8().subarray(Z,Z+X.length).set(X),f0=X.length,Z}let $=Q.length,q=J($,1)>>>0,V=V8(),K=0;for(;K<$;K++){let X=Q.charCodeAt(K);if(X>127)break;V[q+K]=X}if(K!==$){if(K!==0)Q=Q.slice(K);q=Y(q,$,$=K+Q.length*3,1)>>>0;let X=V8().subarray(q+K,q+$),Z=e8.encodeInto(Q,X);K+=Z.written,q=Y(q,$,K,1)>>>0}return f0=K,q}function b0(Q){let J=a8(Q);return kU(Q),J}var $J=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});$J.decode();var gU=2146435072,V$=0;function hU(Q,J){if(V$+=J,V$>=gU)$J=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),$J.decode(),V$=J;return $J.decode(V8().subarray(Q,Q+J))}var e8=new TextEncoder;if(!("encodeInto"in e8))e8.encodeInto=function(Q,J){let Y=e8.encode(Q);return J.set(Y),{read:Q.length,written:Y.length}};var f0=0,_U,bU,S;function fU(Q,J){return bU=Q,S=Q.exports,_U=J,D6=null,r8=null,S}function WK(Q){if(S!==void 0)return S;if(Q!==void 0)if(Object.getPrototypeOf(Q)===Object.prototype)({module:Q}=Q);else console.warn("using deprecated parameters for `initSync()`; pass a single object instead");let J=SU();if(!(Q instanceof WebAssembly.Module))Q=new WebAssembly.Module(Q);let Y=new WebAssembly.Instance(Q,J);return fU(Y,Q)}var LK="office_oxide_bg.wasm",BK=!1;function cU(Q=pU()){let J=ZK(Q,"office-oxide",LK);if(UK(J))return J;let Y=Q;for(let $=0;$<7;$++){let q=ZK(Y,"assets","office-oxide",LK);if(UK(q))return q;let V=OK(Y);if(V===Y)break;Y=V}return}function pU(){try{return OK(uU(import.meta.url))}catch{return"."}}function PK(Q,J){if(!BK){let Y=cU();if(!Y)throw Error("The reader for Word, Excel and PowerPoint 97-2003 files is missing from this installation (office_oxide_bg.wasm was not found).");WK({module:mU(Y)}),BK=!0}return new QQ(Q,J)}var lU=/\[image-base64:([A-Za-z0-9+/=\s]+)\]/g;function dU(Q){return Q.replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g,"")}function oU(Q,J){let Y=new DataView(Q.buffer,Q.byteOffset,Q.byteLength),$=J+8;while($+12<=Q.length){let q=Y.getUint32($),V=String.fromCharCode(...Q.subarray($+4,$+8));if($+=12+q,V==="IEND")return $-J;if(q>Q.length)return}return}function nU(Q,J){let Y=J+2;while(Y+4<=Q.length){if(Q[Y]!==255)return;let $=Q[Y+1];if($===217)return Y+2-J;if($===218){Y+=2+(Q[Y+2]<<8|Q[Y+3]);while(Y+1<Q.length){if(Q[Y]===255){let q=Q[Y+1];if(q===217)return Y+2-J;if(q!==0&&(q<208||q>215))break}Y++}continue}Y+=2+(Q[Y+2]<<8|Q[Y+3])}return}async function iU(Q){let J=await import("cfb"),Y=J.default??J,$;try{$=Y.read(Buffer.from(Q),{type:"buffer"})}catch{return[]}let q=[];for(let V of $.FileIndex){let K=V.content;if(V.type!==2||!K||K.length<64)continue;let X=K instanceof Uint8Array?K:new Uint8Array(K);for(let Z=0;Z+8<X.length;Z++){let H;if(X[Z]===137&&X[Z+1]===80&&X[Z+2]===78&&X[Z+3]===71)H=oU(X,Z);else if(X[Z]===255&&X[Z+1]===216&&X[Z+2]===255)H=nU(X,Z);if(H&&H>64&&Z+H<=X.length)q.push(X.slice(Z,Z+H)),Z+=H-1}}return q}async function jK(Q,J,Y){let $=PK(Q,J),q;try{q=$.toMarkdownWithImages()}finally{$.free()}let V=0;q=q.replace(lU,(X,Z)=>{if(!Y.wantImages)return"";V++;let H=Y.images.add({data:Buffer.from(Z.replace(/\s/g,""),"base64"),stem:`${J}-image-${V}`});return H?c0(H):""}),q=dU(q).replace(/\n{3,}/g,`
15
-
16
- `).trim();let K=[];if(Y.wantImages&&J==="doc"){let X=[];for(let Z of await iU(Q)){let H=Y.images.images.length;V++;let U=Y.images.add({data:Z,stem:`${J}-image-${V}`});if(U&&Y.images.images.length>H)X.push(c0(U))}if(X.length)q+=`
1
+ import{createRequire as nh}from"node:module";var Yc=Object.create;var{getPrototypeOf:Jc,defineProperty:ys,getOwnPropertyNames:Qc}=Object;var ws=Object.prototype.hasOwnProperty;function eh(e){return this[e]}var th,rh,bs=(e,t,r)=>{var n=e!=null&&typeof e==="object";if(n){var i=t?th??=new WeakMap:rh??=new WeakMap,a=i.get(e);if(a)return a}r=e!=null?Yc(Jc(e)):{};let s=t||!e||!e.__esModule||!ws.call(e,"default")?ys(r,"default",{value:e,enumerable:!0}):r;if(e&&typeof e==="object"||typeof e==="function"){for(let o of Qc(e))if(!ws.call(s,o))ys(s,o,{get:eh.bind(e,o),enumerable:!0})}if(n)i.set(e,s);return s};var I=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var pi=(e,t,r)=>()=>{if(e)try{t=e(e=0)}catch(n){r=[n]}if(r)throw r[0];return t};var Ee=nh(import.meta.url);var xs=I(function(un){(function(e){e.parser=function(u,f){return new r(u,f)},e.SAXParser=r,e.SAXStream=c,e.createStream=h,e.MAX_BUFFER_LENGTH=65536;var t=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];e.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function r(u,f){if(!(this instanceof r))return new r(u,f);var y=this;if(i(y),y.q=y.c="",y.bufferCheckPosition=e.MAX_BUFFER_LENGTH,y.encoding=null,y.opt=f||{},y.opt.lowercase=y.opt.lowercase||y.opt.lowercasetags,y.looseCase=y.opt.lowercase?"toLowerCase":"toUpperCase",y.opt.maxEntityCount=y.opt.maxEntityCount||512,y.opt.maxEntityDepth=y.opt.maxEntityDepth||4,y.entityCount=y.entityDepth=0,y.tags=[],y.closed=y.closedRoot=y.sawRoot=!1,y.tag=y.error=null,y.strict=!!u,y.noscript=!!(u||y.opt.noscript),y.state=d.BEGIN,y.strictEntities=y.opt.strictEntities,y.ENTITIES=y.strictEntities?Object.create(e.XML_ENTITIES):Object.create(e.ENTITIES),y.attribList=[],y.opt.xmlns)y.ns=Object.create(v);if(y.opt.unquotedAttributeValues===void 0)y.opt.unquotedAttributeValues=!u;if(y.trackPosition=y.opt.position!==!1,y.trackPosition)y.position=y.line=y.column=0;E(y,"onready")}if(!Object.create)Object.create=function(u){function f(){}f.prototype=u;var y=new f;return y};if(!Object.keys)Object.keys=function(u){var f=[];for(var y in u)if(u.hasOwnProperty(y))f.push(y);return f};function n(u){var f=Math.max(e.MAX_BUFFER_LENGTH,10),y=0;for(var g=0,j=t.length;g<j;g++){var K=u[t[g]].length;if(K>f)switch(t[g]){case"textNode":ne(u);break;case"cdata":N(u,"oncdata",u.cdata),u.cdata="";break;case"script":N(u,"onscript",u.script),u.script="";break;default:ee(u,"Max buffer length exceeded: "+t[g])}y=Math.max(y,K)}var te=e.MAX_BUFFER_LENGTH-y;u.bufferCheckPosition=te+u.position}function i(u){for(var f=0,y=t.length;f<y;f++)u[t[f]]=""}function a(u){if(ne(u),u.cdata!=="")N(u,"oncdata",u.cdata),u.cdata="";if(u.script!=="")N(u,"onscript",u.script),u.script=""}r.prototype={end:function(){on(this)},write:ln,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){a(this)}};var s;try{s=Ee("stream").Stream}catch(u){s=function(){}}if(!s)s=function(){};var o=e.EVENTS.filter(function(u){return u!=="error"&&u!=="end"});function h(u,f){return new c(u,f)}function l(u,f){if(u.length>=2){if(u[0]===255&&u[1]===254)return"utf-16le";if(u[0]===254&&u[1]===255)return"utf-16be"}if(u.length>=3&&u[0]===239&&u[1]===187&&u[2]===191)return"utf8";if(u.length>=4){if(u[0]===60&&u[1]===0&&u[2]===63&&u[3]===0)return"utf-16le";if(u[0]===0&&u[1]===60&&u[2]===0&&u[3]===63)return"utf-16be";return"utf8"}return f?"utf8":null}function c(u,f){if(!(this instanceof c))return new c(u,f);s.apply(this),this._parser=new r(u,f),this.writable=!0,this.readable=!0;var y=this;this._parser.onend=function(){y.emit("end")},this._parser.onerror=function(g){y.emit("error",g),y._parser.error=null},this._decoder=null,this._decoderBuffer=null,o.forEach(function(g){Object.defineProperty(y,"on"+g,{get:function(){return y._parser["on"+g]},set:function(j){if(!j)return y.removeAllListeners(g),y._parser["on"+g]=j,j;y.on(g,j)},enumerable:!0,configurable:!1})})}c.prototype=Object.create(s.prototype,{constructor:{value:c}}),c.prototype._decodeBuffer=function(u,f){if(this._decoderBuffer)u=Buffer.concat([this._decoderBuffer,u]),this._decoderBuffer=null;if(!this._decoder){var y=l(u,f);if(!y)return this._decoderBuffer=u,"";this._parser.encoding=y,this._decoder=new TextDecoder(y)}return this._decoder.decode(u,{stream:!f})},c.prototype.write=function(u){if(typeof Buffer==="function"&&typeof Buffer.isBuffer==="function"&&Buffer.isBuffer(u))u=this._decodeBuffer(u,!1);else if(this._decoderBuffer){var f=this._decodeBuffer(Buffer.alloc(0),!0);if(f)this._parser.write(f),this.emit("data",f)}return this._parser.write(u.toString()),this.emit("data",u),!0},c.prototype.end=function(u){if(u&&u.length)this.write(u);if(this._decoderBuffer){var f=this._decodeBuffer(Buffer.alloc(0),!0);if(f)this._parser.write(f),this.emit("data",f)}else if(this._decoder){var y=this._decoder.decode();if(y)this._parser.write(y),this.emit("data",y)}return this._parser.end(),!0},c.prototype.on=function(u,f){var y=this;if(!y._parser["on"+u]&&o.indexOf(u)!==-1)y._parser["on"+u]=function(){var g=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);g.splice(0,0,u),y.emit.apply(y,g)};return s.prototype.on.call(y,u,f)};var p=/^\[CDATA\[$/i,m=/^DOCTYPE$/i,_="http://www.w3.org/XML/1998/namespace",w="http://www.w3.org/2000/xmlns/",v={xml:_,xmlns:w},b=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,S=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,T=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,k=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function x(u){return u===" "||u===`
2
+ `||u==="\r"||u==="\t"}function A(u){return u==='"'||u==="'"}function O(u){return u===">"||x(u)}function C(u,f){return u.test(f)}function D(u,f){return!C(u,f)}var d=0;e.STATE={BEGIN:d++,BEGIN_WHITESPACE:d++,TEXT:d++,TEXT_ENTITY:d++,OPEN_WAKA:d++,SGML_DECL:d++,SGML_DECL_QUOTED:d++,DOCTYPE:d++,DOCTYPE_QUOTED:d++,DOCTYPE_DTD:d++,DOCTYPE_DTD_QUOTED:d++,COMMENT_STARTING:d++,COMMENT:d++,COMMENT_ENDING:d++,COMMENT_ENDED:d++,CDATA:d++,CDATA_ENDING:d++,CDATA_ENDING_2:d++,PROC_INST:d++,PROC_INST_BODY:d++,PROC_INST_ENDING:d++,OPEN_TAG:d++,OPEN_TAG_SLASH:d++,ATTRIB:d++,ATTRIB_NAME:d++,ATTRIB_NAME_SAW_WHITE:d++,ATTRIB_VALUE:d++,ATTRIB_VALUE_QUOTED:d++,ATTRIB_VALUE_CLOSED:d++,ATTRIB_VALUE_UNQUOTED:d++,ATTRIB_VALUE_ENTITY_Q:d++,ATTRIB_VALUE_ENTITY_U:d++,CLOSE_TAG:d++,CLOSE_TAG_SAW_WHITE:d++,SCRIPT:d++,SCRIPT_ENDING:d++},e.XML_ENTITIES=Object.assign(Object.create(null),{amp:"&",gt:">",lt:"<",quot:'"',apos:"'"}),e.ENTITIES=Object.assign(Object.create(null),{amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830}),Object.keys(e.ENTITIES).forEach(function(u){var f=e.ENTITIES[u],y=typeof f==="number"?String.fromCharCode(f):f;e.ENTITIES[u]=y});for(var R in e.STATE)e.STATE[e.STATE[R]]=R;d=e.STATE;function E(u,f,y){u[f]&&u[f](y)}function B(u){var f=u&&u.match(/(?:^|\s)encoding\s*=\s*(['"])([^'"]+)\1/i);return f?f[2]:null}function G(u){if(!u)return null;return u.toLowerCase().replace(/[^a-z0-9]/g,"")}function V(u,f){let y=G(u),g=G(f);if(!y||!g)return!0;if(g==="utf16")return y==="utf16le"||y==="utf16be";return y===g}function Ie(u,f){if(!u.strict||!u.encoding||!f||f.name!=="xml")return;var y=B(f.body);if(y&&!V(u.encoding,y))U(u,"XML declaration encoding "+y+" does not match detected stream encoding "+u.encoding.toUpperCase())}function N(u,f,y){if(u.textNode)ne(u);E(u,f,y)}function ne(u){if(u.textNode=ue(u.opt,u.textNode),u.textNode)E(u,"ontext",u.textNode);u.textNode=""}function ue(u,f){if(u.trim)f=f.trim();if(u.normalize)f=f.replace(/\s+/g," ");return f}function ee(u,f){if(ne(u),u.trackPosition)f+=`
3
+ Line: `+u.line+`
4
+ Column: `+u.column+`
5
+ Char: `+u.c;return f=Error(f),u.error=f,E(u,"onerror",f),u}function on(u){if(u.sawRoot&&!u.closedRoot)U(u,"Unclosed root tag");if(u.state!==d.BEGIN&&u.state!==d.BEGIN_WHITESPACE&&u.state!==d.TEXT)ee(u,"Unexpected end");return ne(u),u.c="",u.closed=!0,E(u,"onend"),r.call(u,u.strict,u.opt),u}function U(u,f){if(typeof u!=="object"||!(u instanceof r))throw Error("bad call to strictFail");if(u.strict)ee(u,f)}function hr(u){if(!u.strict)u.tagName=u.tagName[u.looseCase]();var f=u.tags[u.tags.length-1]||u,y=u.tag={name:u.tagName,attributes:{}};if(u.opt.xmlns)y.ns=f.ns;u.attribList.length=0,N(u,"onopentagstart",y)}function Ce(u,f){var y=u.indexOf(":"),g=y<0?["",u]:u.split(":"),j=g[0],K=g[1];if(f&&u==="xmlns")j="xmlns",K="";return{prefix:j,local:K}}function Ct(u){if(!u.strict)u.attribName=u.attribName[u.looseCase]();if(u.attribList.indexOf(u.attribName)!==-1||u.tag.attributes.hasOwnProperty(u.attribName)){u.attribName=u.attribValue="";return}if(u.opt.xmlns){var f=Ce(u.attribName,!0),{prefix:y,local:g}=f;if(y==="xmlns")if(g==="xml"&&u.attribValue!==_)U(u,"xml: prefix must be bound to "+_+`
6
+ Actual: `+u.attribValue);else if(g==="xmlns"&&u.attribValue!==w)U(u,"xmlns: prefix must be bound to "+w+`
7
+ Actual: `+u.attribValue);else{var j=u.tag,K=u.tags[u.tags.length-1]||u;if(j.ns===K.ns)j.ns=Object.create(K.ns);j.ns[g]=u.attribValue}u.attribList.push([u.attribName,u.attribValue])}else u.tag.attributes[u.attribName]=u.attribValue,N(u,"onattribute",{name:u.attribName,value:u.attribValue});u.attribName=u.attribValue=""}function pe(u,f){if(u.opt.xmlns){var y=u.tag,g=Ce(u.tagName);if(y.prefix=g.prefix,y.local=g.local,y.uri=y.ns[g.prefix]||"",y.prefix&&!y.uri)U(u,"Unbound namespace prefix: "+JSON.stringify(u.tagName)),y.uri=g.prefix;var j=u.tags[u.tags.length-1]||u;if(y.ns&&j.ns!==y.ns)Object.keys(y.ns).forEach(function(_s){N(u,"onopennamespace",{prefix:_s,uri:y.ns[_s]})});for(var K=0,te=u.attribList.length;K<te;K++){var ce=u.attribList[K],he=ce[0],je=ce[1],ae=Ce(he,!0),{prefix:qe,local:Kc}=ae,vs=qe===""?"":y.ns[qe]||"",di={name:he,value:je,prefix:qe,local:Kc,uri:vs};if(qe&&qe!=="xmlns"&&!vs)U(u,"Unbound namespace prefix: "+JSON.stringify(qe)),di.uri=qe;u.tag.attributes[he]=di,N(u,"onattribute",di)}u.attribList.length=0}if(u.tag.isSelfClosing=!!f,u.sawRoot=!0,u.tags.push(u.tag),N(u,"onopentag",u.tag),!f){if(!u.noscript&&u.tagName.toLowerCase()==="script")u.state=d.SCRIPT;else u.state=d.TEXT;u.tag=null,u.tagName=""}u.attribName=u.attribValue="",u.attribList.length=0}function ht(u){if(!u.tagName){U(u,"Weird empty close tag."),u.textNode+="</>",u.state=d.TEXT;return}if(u.script){if(u.tagName!=="script"){u.script+="</"+u.tagName+">",u.tagName="",u.state=d.SCRIPT;return}N(u,"onscript",u.script),u.script=""}var f=u.tags.length,y=u.tagName;if(!u.strict)y=y[u.looseCase]();var g=y;while(f--){var j=u.tags[f];if(j.name!==g)U(u,"Unexpected close tag");else break}if(f<0){U(u,"Unmatched closing tag: "+u.tagName),u.textNode+="</"+u.tagName+">",u.state=d.TEXT;return}u.tagName=y;var K=u.tags.length;while(K-- >f){var te=u.tag=u.tags.pop();u.tagName=u.tag.name,N(u,"onclosetag",u.tagName);var ce={};for(var he in te.ns)ce[he]=te.ns[he];var je=u.tags[u.tags.length-1]||u;if(u.opt.xmlns&&te.ns!==je.ns)Object.keys(te.ns).forEach(function(ae){var qe=te.ns[ae];N(u,"onclosenamespace",{prefix:ae,uri:qe})})}if(f===0)u.closedRoot=!0;u.tagName=u.attribValue=u.attribName="",u.attribList.length=0,u.state=d.TEXT}function dr(u){var f=u.entity,y=f.toLowerCase(),g,j="";if(u.ENTITIES[f])return u.ENTITIES[f];if(u.ENTITIES[y])return u.ENTITIES[y];if(f=y,f.charAt(0)==="#")if(f.charAt(1)==="x")f=f.slice(2),g=parseInt(f,16),j=g.toString(16);else f=f.slice(1),g=parseInt(f,10),j=g.toString(10);if(f=f.replace(/^0+/,""),isNaN(g)||j.toLowerCase()!==f||g<0||g>1114111||!fn(g))return U(u,"Invalid character entity"),"&"+u.entity+";";return String.fromCodePoint(g)}function fn(u){return u===9||u===10||u===13||u>=32&&u<=55295||u>=57344&&u<=65533||u>=65536&&u<=1114111}function pr(u,f){if(f==="<")u.state=d.OPEN_WAKA,u.startTagPosition=u.position;else if(!x(f))U(u,"Non-whitespace before first tag."),u.textNode=f,u.state=d.TEXT}function gr(u,f){var y="";if(f<u.length)y=u.charAt(f);return y}function ln(u){var f=this;if(this.error)throw this.error;if(f.closed)return ee(f,"Cannot write after close. Assign an onready handler.");if(u===null)return on(f);if(typeof u==="object")u=u.toString();var y=0,g="";while(!0){if(g=gr(u,y++),f.c=g,!g)break;if(f.trackPosition)if(f.position++,g===`
8
+ `)f.line++,f.column=0;else f.column++;switch(f.state){case d.BEGIN:if(f.state=d.BEGIN_WHITESPACE,g==="\uFEFF")continue;pr(f,g);continue;case d.BEGIN_WHITESPACE:pr(f,g);continue;case d.TEXT:if(f.sawRoot&&!f.closedRoot){var K=y-1;while(g&&g!=="<"&&g!=="&")if(g=gr(u,y++),g&&f.trackPosition)if(f.position++,g===`
9
+ `)f.line++,f.column=0;else f.column++;f.textNode+=u.substring(K,y-1)}if(g==="<"&&!(f.sawRoot&&f.closedRoot&&!f.strict))f.state=d.OPEN_WAKA,f.startTagPosition=f.position;else{if(!x(g)&&(!f.sawRoot||f.closedRoot))U(f,"Text data outside of root node.");if(g==="&")f.state=d.TEXT_ENTITY;else f.textNode+=g}continue;case d.SCRIPT:if(g==="<")f.state=d.SCRIPT_ENDING;else f.script+=g;continue;case d.SCRIPT_ENDING:if(g==="/")f.state=d.CLOSE_TAG;else f.script+="<"+g,f.state=d.SCRIPT;continue;case d.OPEN_WAKA:if(g==="!")f.state=d.SGML_DECL,f.sgmlDecl="";else if(x(g));else if(C(b,g))f.state=d.OPEN_TAG,f.tagName=g;else if(g==="/")f.state=d.CLOSE_TAG,f.tagName="";else if(g==="?")f.state=d.PROC_INST,f.procInstName=f.procInstBody="";else{if(U(f,"Unencoded <"),f.startTagPosition+1<f.position){var j=f.position-f.startTagPosition;g=Array(j).join(" ")+g}f.textNode+="<"+g,f.state=d.TEXT}continue;case d.SGML_DECL:if(f.sgmlDecl+g==="--"){f.state=d.COMMENT,f.comment="",f.sgmlDecl="";continue}if(f.doctype&&f.doctype!==!0&&f.sgmlDecl)f.state=d.DOCTYPE_DTD,f.doctype+="<!"+f.sgmlDecl+g,f.sgmlDecl="";else if(p.test(f.sgmlDecl+g))N(f,"onopencdata"),f.state=d.CDATA,f.sgmlDecl="",f.cdata="";else if(m.test(f.sgmlDecl+g)){if(f.state=d.DOCTYPE,f.doctype||f.sawRoot)U(f,"Inappropriately located doctype declaration");f.doctype="",f.sgmlDecl=""}else if(g===">")N(f,"onsgmldeclaration",f.sgmlDecl),f.sgmlDecl="",f.state=d.TEXT;else if(A(g))f.state=d.SGML_DECL_QUOTED,f.sgmlDecl+=g;else f.sgmlDecl+=g;continue;case d.SGML_DECL_QUOTED:if(g===f.q)f.state=d.SGML_DECL,f.q="";f.sgmlDecl+=g;continue;case d.DOCTYPE:if(g===">")f.state=d.TEXT,N(f,"ondoctype",f.doctype),f.doctype=!0;else if(f.doctype+=g,g==="[")f.state=d.DOCTYPE_DTD;else if(A(g))f.state=d.DOCTYPE_QUOTED,f.q=g;continue;case d.DOCTYPE_QUOTED:if(f.doctype+=g,g===f.q)f.q="",f.state=d.DOCTYPE;continue;case d.DOCTYPE_DTD:if(g==="]")f.doctype+=g,f.state=d.DOCTYPE;else if(g==="<")f.state=d.OPEN_WAKA,f.startTagPosition=f.position;else if(A(g))f.doctype+=g,f.state=d.DOCTYPE_DTD_QUOTED,f.q=g;else f.doctype+=g;continue;case d.DOCTYPE_DTD_QUOTED:if(f.doctype+=g,g===f.q)f.state=d.DOCTYPE_DTD,f.q="";continue;case d.COMMENT:if(g==="-")f.state=d.COMMENT_ENDING;else f.comment+=g;continue;case d.COMMENT_ENDING:if(g==="-"){if(f.state=d.COMMENT_ENDED,f.comment=ue(f.opt,f.comment),f.comment)N(f,"oncomment",f.comment);f.comment=""}else f.comment+="-"+g,f.state=d.COMMENT;continue;case d.COMMENT_ENDED:if(g!==">")U(f,"Malformed comment"),f.comment+="--"+g,f.state=d.COMMENT;else if(f.doctype&&f.doctype!==!0)f.state=d.DOCTYPE_DTD;else f.state=d.TEXT;continue;case d.CDATA:var K=y-1;while(g&&g!=="]")if(g=gr(u,y++),g&&f.trackPosition)if(f.position++,g===`
10
+ `)f.line++,f.column=0;else f.column++;if(f.cdata+=u.substring(K,y-1),g==="]")f.state=d.CDATA_ENDING;continue;case d.CDATA_ENDING:if(g==="]")f.state=d.CDATA_ENDING_2;else f.cdata+="]"+g,f.state=d.CDATA;continue;case d.CDATA_ENDING_2:if(g===">"){if(f.cdata)N(f,"oncdata",f.cdata);N(f,"onclosecdata"),f.cdata="",f.state=d.TEXT}else if(g==="]")f.cdata+="]";else f.cdata+="]]"+g,f.state=d.CDATA;continue;case d.PROC_INST:if(g==="?")f.state=d.PROC_INST_ENDING;else if(x(g))f.state=d.PROC_INST_BODY;else f.procInstName+=g;continue;case d.PROC_INST_BODY:if(!f.procInstBody&&x(g))continue;else if(g==="?")f.state=d.PROC_INST_ENDING;else f.procInstBody+=g;continue;case d.PROC_INST_ENDING:if(g===">"){let je={name:f.procInstName,body:f.procInstBody};Ie(f,je),N(f,"onprocessinginstruction",je),f.procInstName=f.procInstBody="",f.state=d.TEXT}else f.procInstBody+="?"+g,f.state=d.PROC_INST_BODY;continue;case d.OPEN_TAG:if(C(S,g))f.tagName+=g;else if(hr(f),g===">")pe(f);else if(g==="/")f.state=d.OPEN_TAG_SLASH;else{if(!x(g))U(f,"Invalid character in tag name");f.state=d.ATTRIB}continue;case d.OPEN_TAG_SLASH:if(g===">")pe(f,!0),ht(f);else U(f,"Forward-slash in opening tag not followed by >"),f.state=d.ATTRIB;continue;case d.ATTRIB:if(x(g))continue;else if(g===">")pe(f);else if(g==="/")f.state=d.OPEN_TAG_SLASH;else if(C(b,g))f.attribName=g,f.attribValue="",f.state=d.ATTRIB_NAME;else U(f,"Invalid attribute name");continue;case d.ATTRIB_NAME:if(g==="=")f.state=d.ATTRIB_VALUE;else if(g===">")U(f,"Attribute without value"),f.attribValue=f.attribName,Ct(f),pe(f);else if(x(g))f.state=d.ATTRIB_NAME_SAW_WHITE;else if(C(S,g))f.attribName+=g;else U(f,"Invalid attribute name");continue;case d.ATTRIB_NAME_SAW_WHITE:if(g==="=")f.state=d.ATTRIB_VALUE;else if(x(g))continue;else if(U(f,"Attribute without value"),f.tag.attributes[f.attribName]="",f.attribValue="",N(f,"onattribute",{name:f.attribName,value:""}),f.attribName="",g===">")pe(f);else if(C(b,g))f.attribName=g,f.state=d.ATTRIB_NAME;else U(f,"Invalid attribute name"),f.state=d.ATTRIB;continue;case d.ATTRIB_VALUE:if(x(g))continue;else if(A(g))f.q=g,f.state=d.ATTRIB_VALUE_QUOTED;else{if(!f.opt.unquotedAttributeValues)ee(f,"Unquoted attribute value");f.state=d.ATTRIB_VALUE_UNQUOTED,f.attribValue=g}continue;case d.ATTRIB_VALUE_QUOTED:if(g!==f.q){if(g==="&")f.state=d.ATTRIB_VALUE_ENTITY_Q;else f.attribValue+=g;continue}Ct(f),f.q="",f.state=d.ATTRIB_VALUE_CLOSED;continue;case d.ATTRIB_VALUE_CLOSED:if(x(g))f.state=d.ATTRIB;else if(g===">")pe(f);else if(g==="/")f.state=d.OPEN_TAG_SLASH;else if(C(b,g))U(f,"No whitespace between attributes"),f.attribName=g,f.attribValue="",f.state=d.ATTRIB_NAME;else U(f,"Invalid attribute name");continue;case d.ATTRIB_VALUE_UNQUOTED:if(!O(g)){if(g==="&")f.state=d.ATTRIB_VALUE_ENTITY_U;else f.attribValue+=g;continue}if(Ct(f),g===">")pe(f);else f.state=d.ATTRIB;continue;case d.CLOSE_TAG:if(!f.tagName)if(x(g))continue;else if(D(b,g))if(f.script)f.script+="</"+g,f.state=d.SCRIPT;else U(f,"Invalid tagname in closing tag.");else f.tagName=g;else if(g===">")ht(f);else if(C(S,g))f.tagName+=g;else if(f.script)f.script+="</"+f.tagName+g,f.tagName="",f.state=d.SCRIPT;else{if(!x(g))U(f,"Invalid tagname in closing tag");f.state=d.CLOSE_TAG_SAW_WHITE}continue;case d.CLOSE_TAG_SAW_WHITE:if(x(g))continue;if(g===">")ht(f);else U(f,"Invalid characters in closing tag");continue;case d.TEXT_ENTITY:case d.ATTRIB_VALUE_ENTITY_Q:case d.ATTRIB_VALUE_ENTITY_U:var te,ce;switch(f.state){case d.TEXT_ENTITY:te=d.TEXT,ce="textNode";break;case d.ATTRIB_VALUE_ENTITY_Q:te=d.ATTRIB_VALUE_QUOTED,ce="attribValue";break;case d.ATTRIB_VALUE_ENTITY_U:te=d.ATTRIB_VALUE_UNQUOTED,ce="attribValue";break}if(g===";"){var he=dr(f);if(f.opt.unparsedEntities&&!Object.values(e.XML_ENTITIES).includes(he)){if((f.entityCount+=1)>f.opt.maxEntityCount)ee(f,"Parsed entity count exceeds max entity count");if((f.entityDepth+=1)>f.opt.maxEntityDepth)ee(f,"Parsed entity depth exceeds max entity depth");f.entity="",f.state=te,f.write(he),f.entityDepth-=1}else f[ce]+=he,f.entity="",f.state=te}else if(C(f.entity.length?k:T,g))f.entity+=g;else U(f,"Invalid character in entity name"),f[ce]+="&"+f.entity+g,f.entity="",f.state=te;continue;default:throw Error(f,"Unknown state: "+f.state)}}if(f.position>=f.bufferCheckPosition)n(f);return f}/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */if(!String.fromCodePoint)(function(){var u=String.fromCharCode,f=Math.floor,y=function(){var g=16384,j=[],K,te,ce=-1,he=arguments.length;if(!he)return"";var je="";while(++ce<he){var ae=Number(arguments[ce]);if(!isFinite(ae)||ae<0||ae>1114111||f(ae)!==ae)throw RangeError("Invalid code point: "+ae);if(ae<=65535)j.push(ae);else ae-=65536,K=(ae>>10)+55296,te=ae%1024+56320,j.push(K,te);if(ce+1===he||j.length>g)je+=u.apply(null,j),j.length=0}return je};if(Object.defineProperty)Object.defineProperty(String,"fromCodePoint",{value:y,configurable:!0,writable:!0});else String.fromCodePoint=y})()})(typeof un>"u"?un.sax={}:un)});import Ts,{resolve as ch,basename as hh,extname as dh,dirname as ph}from"node:path";import{EventEmitter as gh}from"events";function mh(...e){return ch(...e)}function vh(e,t){return hh(e,t)}function _h(e){return dh(e)}function yh(e){return ph(e)}function wh(e){return Ts.posix.isAbsolute(e)}function bh(...e){return Ts.posix.join(...e)}function Th(e){if(e.charCodeAt(0)===65279)return e.slice(1);return e}function Sh(e){return e.toLowerCase()}function kh(e){return typeof e==="object"&&e!==null&&Object.keys(e).length===0}function cn(e,t,r){for(let n of e)t=n(t,r);return t}function Dt(e,t,r){let n=Object.create(null);n.value=r,n.writable=!0,n.enumerable=!0,n.configurable=!0,Object.defineProperty(e,t,n)}function Ah(e,t){let r={};if(typeof t==="object")r=t;return new ks(r).parseStringPromise(e)}async function Ot(e,t={}){return await Ah(e,t)}function hn(e){return e.replace(/-([a-z])/gi,(t)=>t[1].toUpperCase())}var Ss,J,xh,Eh=(e,t,r)=>(t in e)?xh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ve=(e,t,r)=>Eh(e,typeof t!=="symbol"?t+"":t,r),Es,ks;var As=pi(()=>{Ss=bs(xs(),1);J={resolve:mh,basename:vh,extname:_h,dirname:yh,isAbsolutePosix:wh,joinPosix:bh},xh=Object.defineProperty;Es={0.1:{explicitCharkey:!1,trim:!0,normalize:!0,normalizeTags:!1,attrkey:"@",charkey:"#",explicitArray:!1,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!1,validator:null,xmlns:!1,explicitChildren:!1,childkey:"@@",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,emptyTag:""},0.2:{explicitCharkey:!1,trim:!1,normalize:!1,normalizeTags:!1,attrkey:"$",charkey:"_",explicitArray:!0,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!0,validator:null,xmlns:!1,explicitChildren:!1,preserveChildrenOrder:!1,childkey:"$$",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:!0},doctype:null,renderOpts:{pretty:!0,indent:" ",newline:`
11
+ `},headless:!1,chunkSize:1e4,emptyTag:"",cdata:!1}};ks=class ks extends gh{constructor(e){super();if(ve(this,"options"),ve(this,"remaining",""),ve(this,"saxParser"),ve(this,"resultObject",null),ve(this,"EXPLICIT_CHARKEY"),ve(this,"errThrown",!1),ve(this,"ended",!1),ve(this,"processAsync",()=>{try{if(this.remaining.length<=this.options.chunkSize){let t=this.remaining;this.remaining="",this.saxParser=this.saxParser.write(t),this.saxParser.close()}else{let t=this.remaining.slice(0,this.options.chunkSize);this.remaining=this.remaining.slice(this.options.chunkSize),this.saxParser=this.saxParser.write(t),setTimeout(this.processAsync,0)}}catch(t){if(!this.errThrown)this.errThrown=!0,this.emit("error",t)}}),ve(this,"assignOrPush",(t,r,n)=>{if(!(r in t))if(!this.options.explicitArray)Dt(t,r,n);else Dt(t,r,[n]);else{if(!Array.isArray(t[r]))Dt(t,r,[t[r]]);t[r].push(n)}}),ve(this,"reset",()=>{this.removeAllListeners(),this.saxParser=Ss.default.parser(this.options.strict,{trim:!1,normalize:!1,xmlns:this.options.xmlns}),this.errThrown=!1,this.saxParser.onerror=(a)=>{if(this.saxParser.resume(),!this.errThrown)this.errThrown=!0,this.emit("error",a)},this.saxParser.onend=()=>{if(!this.ended)this.ended=!0,this.emit("end",this.resultObject)},this.ended=!1,this.EXPLICIT_CHARKEY=this.options.explicitCharkey,this.resultObject=null;let t=[],r=this.options.attrkey,n=this.options.charkey;this.saxParser.onopentag=(a)=>{let s={};if(s[n]="",!this.options.ignoreAttrs)Object.keys(a.attributes).forEach((o)=>{if(!(r in s)&&!this.options.mergeAttrs)s[r]={};let h=this.options.attrValueProcessors?cn(this.options.attrValueProcessors,a.attributes[o],o):a.attributes[o],l=this.options.attrNameProcessors?cn(this.options.attrNameProcessors,o):o;if(this.options.mergeAttrs)this.assignOrPush(s,l,h);else Dt(s[r],l,h)});if(s["#name"]=this.options.tagNameProcessors?cn(this.options.tagNameProcessors,a.name):a.name,this.options.xmlns)s[this.options.xmlnskey]={uri:a.uri,local:a.local};t.push(s)},this.saxParser.onclosetag=()=>{let a=t.pop(),s=a["#name"];if(!this.options.explicitChildren||!this.options.preserveChildrenOrder)delete a["#name"];let o;if(a.cdata===!0)o=a.cdata,delete a.cdata;let h=t[t.length-1],l="";if(a[n].match(/^\s*$/)&&!o)l=a[n],delete a[n];else{if(this.options.trim)a[n]=a[n].trim();if(this.options.normalize)a[n]=a[n].replace(/\s{2,}/g," ").trim();if(a[n]=this.options.valueProcessors?cn(this.options.valueProcessors,a[n],s):a[n],Object.keys(a).length===1&&n in a&&!this.EXPLICIT_CHARKEY)a=a[n]}if(kh(a))if(typeof this.options.emptyTag==="function")a=this.options.emptyTag();else a=this.options.emptyTag!==""?this.options.emptyTag:l;if(this.options.validator){let c=`/${t.map((p)=>p["#name"]).concat(s).join("/")}`;(()=>{try{a=this.options.validator(c,h&&h[s],a)}catch(p){this.emit("error",p)}})()}if(this.options.explicitChildren&&!this.options.mergeAttrs&&typeof a==="object"){if(!this.options.preserveChildrenOrder){let c={};if(this.options.attrkey in a)c[this.options.attrkey]=a[this.options.attrkey],delete a[this.options.attrkey];if(!this.options.charsAsChildren&&this.options.charkey in a)c[this.options.charkey]=a[this.options.charkey],delete a[this.options.charkey];if(Object.getOwnPropertyNames(a).length>0)c[this.options.childkey]=a;a=c}else if(h){h[this.options.childkey]=h[this.options.childkey]||[];let c={};if(Object.keys(a).forEach((p)=>{Dt(c,p,a[p])}),h[this.options.childkey].push(c),delete a["#name"],Object.keys(a).length===1&&n in a&&!this.EXPLICIT_CHARKEY)a=a[n]}}if(t.length>0)this.assignOrPush(h,s,a);else{if(this.options.explicitRoot){let c=a,p={};Dt(p,s,c),a=p}this.resultObject=a,this.ended=!0,this.emit("end",this.resultObject)}};let i=(a)=>{let s=t[t.length-1];if(s){if(s[n]+=a,this.options.explicitChildren&&this.options.preserveChildrenOrder&&this.options.charsAsChildren&&(this.options.includeWhiteChars||a.replace(/\\n/g,"").trim()!=="")){s[this.options.childkey]=s[this.options.childkey]||[];let o={"#name":"__text__"};if(o[n]=a,this.options.normalize)o[n]=o[n].replace(/\s{2,}/g," ").trim();s[this.options.childkey].push(o)}}return s};this.saxParser.ontext=i,this.saxParser.oncdata=(a)=>{let s=i(a);if(s)s.cdata=!0}}),ve(this,"parseString",(t,r)=>{if(r&&typeof r==="function")this.on("end",(n)=>{this.reset(),r(null,n)}),this.on("error",(n)=>{this.reset(),r(n)});try{if(t=t.toString(),t.trim()==="")return this.emit("end",null),!0;if(t=Th(t),this.options.async)return this.remaining=t,setTimeout(this.processAsync,0),this.saxParser;return this.saxParser.write(t).close()}catch(n){if(!this.errThrown&&!this.ended)this.emit("error",n),this.errThrown=!0;else if(this.ended)throw n}}),ve(this,"parseStringPromise",(t)=>new Promise((r,n)=>{this.parseString(t,(i,a)=>{if(i)n(i);else r(a)})})),this.options={},Object.keys(Es["0.2"]).forEach((t)=>{this.options[t]=Es["0.2"][t]}),e)Object.keys(e).forEach((t)=>{this.options[t]=e[t]});if(this.options.xmlns)this.options.xmlnskey=`${this.options.attrkey}ns`;if(this.options.normalizeTags){if(!this.options.tagNameProcessors)this.options.tagNameProcessors=[];this.options.tagNameProcessors.unshift(Sh)}this.reset()}}});var mr=I(function(Kw,mi){if(typeof process>"u"||!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0)mi.exports={nextTick:Ih};else mi.exports=process;function Ih(e,t,r,n){if(typeof e!=="function")throw TypeError('"callback" argument must be a function');var i=arguments.length,a,s;switch(i){case 0:case 1:return process.nextTick(e);case 2:return process.nextTick(function(){e.call(null,t)});case 3:return process.nextTick(function(){e.call(null,t,r)});case 4:return process.nextTick(function(){e.call(null,t,r,n)});default:a=Array(i-1),s=0;while(s<a.length)a[s++]=arguments[s];return process.nextTick(function(){e.apply(null,a)})}}});var Cs=I(function(Yw,Is){var Ch={}.toString;Is.exports=Array.isArray||function(e){return Ch.call(e)=="[object Array]"}});var vr=I(function(vi,Os){var dn=Ee("buffer"),$e=dn.Buffer;function Ds(e,t){for(var r in e)t[r]=e[r]}if($e.from&&$e.alloc&&$e.allocUnsafe&&$e.allocUnsafeSlow)Os.exports=dn;else Ds(dn,vi),vi.Buffer=Pt;function Pt(e,t,r){return $e(e,t,r)}Ds($e,Pt);Pt.from=function(e,t,r){if(typeof e==="number")throw TypeError("Argument must not be a number");return $e(e,t,r)};Pt.alloc=function(e,t,r){if(typeof e!=="number")throw TypeError("Argument must be a number");var n=$e(e);if(t!==void 0)if(typeof r==="string")n.fill(t,r);else n.fill(t);else n.fill(0);return n};Pt.allocUnsafe=function(e){if(typeof e!=="number")throw TypeError("Argument must be a number");return $e(e)};Pt.allocUnsafeSlow=function(e){if(typeof e!=="number")throw TypeError("Argument must be a number");return dn.SlowBuffer(e)}});var Rt=I(function($h){function Dh(e){if(Array.isArray)return Array.isArray(e);return pn(e)==="[object Array]"}$h.isArray=Dh;function Oh(e){return typeof e==="boolean"}$h.isBoolean=Oh;function Ph(e){return e===null}$h.isNull=Ph;function Rh(e){return e==null}$h.isNullOrUndefined=Rh;function Nh(e){return typeof e==="number"}$h.isNumber=Nh;function Fh(e){return typeof e==="string"}$h.isString=Fh;function Mh(e){return typeof e==="symbol"}$h.isSymbol=Mh;function Bh(e){return e===void 0}$h.isUndefined=Bh;function zh(e){return pn(e)==="[object RegExp]"}$h.isRegExp=zh;function Lh(e){return typeof e==="object"&&e!==null}$h.isObject=Lh;function Uh(e){return pn(e)==="[object Date]"}$h.isDate=Uh;function jh(e){return pn(e)==="[object Error]"||e instanceof Error}$h.isError=jh;function qh(e){return typeof e==="function"}$h.isFunction=qh;function Wh(e){return e===null||typeof e==="boolean"||typeof e==="number"||typeof e==="string"||typeof e==="symbol"||typeof e>"u"}$h.isPrimitive=Wh;$h.isBuffer=Ee("buffer").Buffer.isBuffer;function pn(e){return Object.prototype.toString.call(e)}});var Ps=I(function(Qw,_i){if(typeof Object.create==="function")_i.exports=function(t,r){if(r)t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})};else _i.exports=function(t,r){if(r){t.super_=r;var n=function(){};n.prototype=r.prototype,t.prototype=new n,t.prototype.constructor=t}}});var Nt=I(function(eb,yi){try{if(gn=Ee("util"),typeof gn.inherits!=="function")throw"";yi.exports=gn.inherits}catch(e){yi.exports=Ps()}var gn});var Ns=I(function(tb,wi){function sd(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}var Rs=vr().Buffer,_r=Ee("util");function od(e,t,r){e.copy(t,r)}wi.exports=function(){function e(){sd(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(r){var n={data:r,next:null};if(this.length>0)this.tail.next=n;else this.head=n;this.tail=n,++this.length},e.prototype.unshift=function(r){var n={data:r,next:this.head};if(this.length===0)this.tail=n;this.head=n,++this.length},e.prototype.shift=function(){if(this.length===0)return;var r=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,r},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(r){if(this.length===0)return"";var n=this.head,i=""+n.data;while(n=n.next)i+=r+n.data;return i},e.prototype.concat=function(r){if(this.length===0)return Rs.alloc(0);var n=Rs.allocUnsafe(r>>>0),i=this.head,a=0;while(i)od(i.data,n,a),a+=i.data.length,i=i.next;return n},e}();if(_r&&_r.inspect&&_r.inspect.custom)wi.exports.prototype[_r.inspect.custom]=function(){var e=_r.inspect({length:this.length});return this.constructor.name+" "+e}});var bi=I(function(rb,Fs){var mn=mr();function fd(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;if(n||i){if(t)t(e);else if(e){if(!this._writableState)mn.nextTick(vn,this,e);else if(!this._writableState.errorEmitted)this._writableState.errorEmitted=!0,mn.nextTick(vn,this,e)}return this}if(this._readableState)this._readableState.destroyed=!0;if(this._writableState)this._writableState.destroyed=!0;return this._destroy(e||null,function(a){if(!t&&a){if(!r._writableState)mn.nextTick(vn,r,a);else if(!r._writableState.errorEmitted)r._writableState.errorEmitted=!0,mn.nextTick(vn,r,a)}else if(t)t(a)}),this}function ld(){if(this._readableState)this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1;if(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 vn(e,t){e.emit("error",t)}Fs.exports={destroy:fd,undestroy:ld}});var Bs=I(function(nb,Ms){Ms.exports=Ee("util").deprecate});var Ei=I(function(ib,Zs){var dt=mr();Zs.exports=Q;function Ls(e){var t=this;this.next=null,this.entry=null,this.finish=function(){Ad(t,e)}}var ud=["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:dt.nextTick,Ft;Q.WritableState=wr;var Us=Object.create(Rt());Us.inherits=Nt();var cd={deprecate:Bs()},js=Ee("stream"),yn=vr().Buffer,hd=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function dd(e){return yn.from(e)}function pd(e){return yn.isBuffer(e)||e instanceof hd}var qs=bi();Us.inherits(Q,js);function gd(){}function wr(e,t){Ft=Ft||pt(),e=e||{};var r=t instanceof Ft;if(this.objectMode=!!e.objectMode,r)this.objectMode=this.objectMode||!!e.writableObjectMode;var n=e.highWaterMark,i=e.writableHighWaterMark,a=this.objectMode?16:16384;if(n||n===0)this.highWaterMark=n;else if(r&&(i||i===0))this.highWaterMark=i;else this.highWaterMark=a;this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=e.decodeStrings===!1;this.decodeStrings=!s,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(o){xd(t,o)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new Ls(this)}wr.prototype.getBuffer=function(){var t=this.bufferedRequest,r=[];while(t)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(wr.prototype,"buffer",{get:cd.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}})();var _n;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function")_n=Function.prototype[Symbol.hasInstance],Object.defineProperty(Q,Symbol.hasInstance,{value:function(e){if(_n.call(this,e))return!0;if(this!==Q)return!1;return e&&e._writableState instanceof wr}});else _n=function(e){return e instanceof this};function Q(e){if(Ft=Ft||pt(),!_n.call(Q,this)&&!(this instanceof Ft))return new Q(e);if(this._writableState=new wr(e,this),this.writable=!0,e){if(typeof e.write==="function")this._write=e.write;if(typeof e.writev==="function")this._writev=e.writev;if(typeof e.destroy==="function")this._destroy=e.destroy;if(typeof e.final==="function")this._final=e.final}js.call(this)}Q.prototype.pipe=function(){this.emit("error",Error("Cannot pipe, not readable"))};function md(e,t){var r=Error("write after end");e.emit("error",r),dt.nextTick(t,r)}function vd(e,t,r,n){var i=!0,a=!1;if(r===null)a=TypeError("May not write null values to stream");else if(typeof r!=="string"&&r!==void 0&&!t.objectMode)a=TypeError("Invalid non-string/buffer chunk");if(a)e.emit("error",a),dt.nextTick(n,a),i=!1;return i}Q.prototype.write=function(e,t,r){var n=this._writableState,i=!1,a=!n.objectMode&&pd(e);if(a&&!yn.isBuffer(e))e=dd(e);if(typeof t==="function")r=t,t=null;if(a)t="buffer";else if(!t)t=n.defaultEncoding;if(typeof r!=="function")r=gd;if(n.ended)md(this,r);else if(a||vd(this,n,e,r))n.pendingcb++,i=yd(this,n,a,e,t,r);return i};Q.prototype.cork=function(){var e=this._writableState;e.corked++};Q.prototype.uncork=function(){var e=this._writableState;if(e.corked){if(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest)Ws(this,e)}};Q.prototype.setDefaultEncoding=function(t){if(typeof t==="string")t=t.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this};function _d(e,t,r){if(!e.objectMode&&e.decodeStrings!==!1&&typeof t==="string")t=yn.from(t,r);return t}Object.defineProperty(Q.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function yd(e,t,r,n,i,a){if(!r){var s=_d(t,n,i);if(n!==s)r=!0,i="buffer",n=s}var o=t.objectMode?1:n.length;t.length+=o;var h=t.length<t.highWaterMark;if(!h)t.needDrain=!0;if(t.writing||t.corked){var l=t.lastBufferedRequest;if(t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:a,next:null},l)l.next=t.lastBufferedRequest;else t.bufferedRequest=t.lastBufferedRequest;t.bufferedRequestCount+=1}else xi(e,t,!1,o,n,i,a);return h}function xi(e,t,r,n,i,a,s){if(t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,r)e._writev(i,t.onwrite);else e._write(i,a,t.onwrite);t.sync=!1}function wd(e,t,r,n,i){if(--t.pendingcb,r)dt.nextTick(i,n),dt.nextTick(yr,e,t),e._writableState.errorEmitted=!0,e.emit("error",n);else i(n),e._writableState.errorEmitted=!0,e.emit("error",n),yr(e,t)}function bd(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function xd(e,t){var r=e._writableState,{sync:n,writecb:i}=r;if(bd(r),t)wd(e,r,n,t,i);else{var a=$s(r);if(!a&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest)Ws(e,r);if(n)ud(zs,e,r,a,i);else zs(e,r,a,i)}}function zs(e,t,r,n){if(!r)Ed(e,t);t.pendingcb--,n(),yr(e,t)}function Ed(e,t){if(t.length===0&&t.needDrain)t.needDrain=!1,e.emit("drain")}function Ws(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=Array(n),a=t.corkedRequestsFree;a.entry=r;var s=0,o=!0;while(r){if(i[s]=r,!r.isBuf)o=!1;r=r.next,s+=1}if(i.allBuffers=o,xi(e,t,!0,t.length,i,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next)t.corkedRequestsFree=a.next,a.next=null;else t.corkedRequestsFree=new Ls(t);t.bufferedRequestCount=0}else{while(r){var h=r.chunk,l=r.encoding,c=r.callback,p=t.objectMode?1:h.length;if(xi(e,t,!1,p,h,l,c),r=r.next,t.bufferedRequestCount--,t.writing)break}if(r===null)t.lastBufferedRequest=null}t.bufferedRequest=r,t.bufferProcessing=!1}Q.prototype._write=function(e,t,r){r(Error("_write() is not implemented"))};Q.prototype._writev=null;Q.prototype.end=function(e,t,r){var n=this._writableState;if(typeof e==="function")r=e,e=null,t=null;else if(typeof t==="function")r=t,t=null;if(e!==null&&e!==void 0)this.write(e,t);if(n.corked)n.corked=1,this.uncork();if(!n.ending)kd(this,n,r)};function $s(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function Td(e,t){e._final(function(r){if(t.pendingcb--,r)e.emit("error",r);t.prefinished=!0,e.emit("prefinish"),yr(e,t)})}function Sd(e,t){if(!t.prefinished&&!t.finalCalled)if(typeof e._final==="function")t.pendingcb++,t.finalCalled=!0,dt.nextTick(Td,e,t);else t.prefinished=!0,e.emit("prefinish")}function yr(e,t){var r=$s(t);if(r){if(Sd(e,t),t.pendingcb===0)t.finished=!0,e.emit("finish")}return r}function kd(e,t,r){if(t.ending=!0,yr(e,t),r)if(t.finished)dt.nextTick(r);else e.once("finish",r);t.ended=!0,e.writable=!1}function Ad(e,t,r){var n=e.entry;e.entry=null;while(n){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}Object.defineProperty(Q.prototype,"destroyed",{get:function(){if(this._writableState===void 0)return!1;return this._writableState.destroyed},set:function(e){if(!this._writableState)return;this._writableState.destroyed=e}});Q.prototype.destroy=qs.destroy;Q.prototype._undestroy=qs.undestroy;Q.prototype._destroy=function(e,t){this.end(),t(e)}});var pt=I(function(ab,Vs){var Hs=mr(),Id=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};Vs.exports=Ze;var Gs=Object.create(Rt());Gs.inherits=Nt();var Xs=Si(),Ti=Ei();Gs.inherits(Ze,Xs);{wn=Id(Ti.prototype);for(br=0;br<wn.length;br++)if(xr=wn[br],!Ze.prototype[xr])Ze.prototype[xr]=Ti.prototype[xr]}var wn,xr,br;function Ze(e){if(!(this instanceof Ze))return new Ze(e);if(Xs.call(this,e),Ti.call(this,e),e&&e.readable===!1)this.readable=!1;if(e&&e.writable===!1)this.writable=!1;if(this.allowHalfOpen=!0,e&&e.allowHalfOpen===!1)this.allowHalfOpen=!1;this.once("end",Cd)}Object.defineProperty(Ze.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Cd(){if(this.allowHalfOpen||this._writableState.ended)return;Hs.nextTick(Dd,this)}function Dd(e){e.end()}Object.defineProperty(Ze.prototype,"destroyed",{get:function(){if(this._readableState===void 0||this._writableState===void 0)return!1;return this._readableState.destroyed&&this._writableState.destroyed},set:function(e){if(this._readableState===void 0||this._writableState===void 0)return;this._readableState.destroyed=e,this._writableState.destroyed=e}});Ze.prototype._destroy=function(e,t){this.push(null),this.end(),Hs.nextTick(t,e)}});var Ii=I(function($d){var Ai=vr().Buffer,Ks=Ai.isEncoding||function(e){switch(e=""+e,e&&e.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 Od(e){if(!e)return"utf8";var t;while(!0)switch(e){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 e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function Pd(e){var t=Od(e);if(typeof t!=="string"&&(Ai.isEncoding===Ks||!Ks(e)))throw Error("Unknown encoding: "+e);return t||e}$d.StringDecoder=Er;function Er(e){this.encoding=Pd(e);var t;switch(this.encoding){case"utf16le":this.text=zd,this.end=Ld,t=4;break;case"utf8":this.fillLast=Fd,t=4;break;case"base64":this.text=Ud,this.end=jd,t=3;break;default:this.write=qd,this.end=Wd;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Ai.allocUnsafe(t)}Er.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;if(r<e.length)return t?t+this.text(e,r):this.text(e,r);return t||""};Er.prototype.end=Bd;Er.prototype.text=Md;Er.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function ki(e){if(e<=127)return 0;else if(e>>5===6)return 2;else if(e>>4===14)return 3;else if(e>>3===30)return 4;return e>>6===2?-1:-2}function Rd(e,t,r){var n=t.length-1;if(n<r)return 0;var i=ki(t[n]);if(i>=0){if(i>0)e.lastNeed=i-1;return i}if(--n<r||i===-2)return 0;if(i=ki(t[n]),i>=0){if(i>0)e.lastNeed=i-2;return i}if(--n<r||i===-2)return 0;if(i=ki(t[n]),i>=0){if(i>0)if(i===2)i=0;else e.lastNeed=i-3;return i}return 0}function Nd(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2){if((t[2]&192)!==128)return e.lastNeed=2,"�"}}}function Fd(e){var t=this.lastTotal-this.lastNeed,r=Nd(this,e,t);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function Md(e,t){var r=Rd(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function Bd(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed)return t+"�";return t}function zd(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function Ld(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function Ud(e,t){var r=(e.length-t)%3;if(r===0)return e.toString("base64",t);if(this.lastNeed=3-r,this.lastTotal=3,r===1)this.lastChar[0]=e[e.length-1];else this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1];return e.toString("base64",t,e.length-r)}function jd(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed)return t+this.lastChar.toString("base64",0,3-this.lastNeed);return t}function qd(e){return e.toString(this.encoding)}function Wd(e){return e&&e.length?this.write(e):""}});var Si=I(function(fb,fo){var Bt=mr();fo.exports=Z;var Hd=Cs(),Tr;Z.ReadableState=no;var ob=Ee("events").EventEmitter,eo=function(e,t){return e.listeners(t).length},Ri=Ee("stream"),Sr=vr().Buffer,Gd=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Xd(e){return Sr.from(e)}function Vd(e){return Sr.isBuffer(e)||e instanceof Gd}var to=Object.create(Rt());to.inherits=Nt();var Ci=Ee("util"),L=void 0;if(Ci&&Ci.debuglog)L=Ci.debuglog("stream");else L=function(){};var Kd=Ns(),ro=bi(),Mt;to.inherits(Z,Ri);var Di=["error","close","destroy","pause","resume"];function Yd(e,t,r){if(typeof e.prependListener==="function")return e.prependListener(t,r);if(!e._events||!e._events[t])e.on(t,r);else if(Hd(e._events[t]))e._events[t].unshift(r);else e._events[t]=[r,e._events[t]]}function no(e,t){Tr=Tr||pt(),e=e||{};var r=t instanceof Tr;if(this.objectMode=!!e.objectMode,r)this.objectMode=this.objectMode||!!e.readableObjectMode;var n=e.highWaterMark,i=e.readableHighWaterMark,a=this.objectMode?16:16384;if(n||n===0)this.highWaterMark=n;else if(r&&(i||i===0))this.highWaterMark=i;else this.highWaterMark=a;if(this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new Kd,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.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding){if(!Mt)Mt=Ii().StringDecoder;this.decoder=new Mt(e.encoding),this.encoding=e.encoding}}function Z(e){if(Tr=Tr||pt(),!(this instanceof Z))return new Z(e);if(this._readableState=new no(e,this),this.readable=!0,e){if(typeof e.read==="function")this._read=e.read;if(typeof e.destroy==="function")this._destroy=e.destroy}Ri.call(this)}Object.defineProperty(Z.prototype,"destroyed",{get:function(){if(this._readableState===void 0)return!1;return this._readableState.destroyed},set:function(e){if(!this._readableState)return;this._readableState.destroyed=e}});Z.prototype.destroy=ro.destroy;Z.prototype._undestroy=ro.undestroy;Z.prototype._destroy=function(e,t){this.push(null),t(e)};Z.prototype.push=function(e,t){var r=this._readableState,n;if(!r.objectMode){if(typeof e==="string"){if(t=t||r.defaultEncoding,t!==r.encoding)e=Sr.from(e,t),t="";n=!0}}else n=!0;return io(this,e,t,!1,n)};Z.prototype.unshift=function(e){return io(this,e,null,!0,!1)};function io(e,t,r,n,i){var a=e._readableState;if(t===null)a.reading=!1,tp(e,a);else{var s;if(!i)s=Jd(a,t);if(s)e.emit("error",s);else if(a.objectMode||t&&t.length>0){if(typeof t!=="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==Sr.prototype)t=Xd(t);if(n)if(a.endEmitted)e.emit("error",Error("stream.unshift() after end event"));else Oi(e,a,t,!0);else if(a.ended)e.emit("error",Error("stream.push() after EOF"));else if(a.reading=!1,a.decoder&&!r)if(t=a.decoder.write(t),a.objectMode||t.length!==0)Oi(e,a,t,!1);else ao(e,a);else Oi(e,a,t,!1)}else if(!n)a.reading=!1}return Qd(a)}function Oi(e,t,r,n){if(t.flowing&&t.length===0&&!t.sync)e.emit("data",r),e.read(0);else{if(t.length+=t.objectMode?1:r.length,n)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)bn(e)}ao(e,t)}function Jd(e,t){var r;if(!Vd(t)&&typeof t!=="string"&&t!==void 0&&!e.objectMode)r=TypeError("Invalid non-string/buffer chunk");return r}function Qd(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||e.length===0)}Z.prototype.isPaused=function(){return this._readableState.flowing===!1};Z.prototype.setEncoding=function(e){if(!Mt)Mt=Ii().StringDecoder;return this._readableState.decoder=new Mt(e),this._readableState.encoding=e,this};var Ys=8388608;function ep(e){if(e>=Ys)e=Ys;else e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++;return e}function Js(e,t){if(e<=0||t.length===0&&t.ended)return 0;if(t.objectMode)return 1;if(e!==e)if(t.flowing&&t.length)return t.buffer.head.data.length;else return t.length;if(e>t.highWaterMark)t.highWaterMark=ep(e);if(e<=t.length)return e;if(!t.ended)return t.needReadable=!0,0;return t.length}Z.prototype.read=function(e){L("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0)t.emittedReadable=!1;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){if(L("read: emitReadable",t.length,t.ended),t.length===0&&t.ended)Pi(this);else bn(this);return null}if(e=Js(e,t),e===0&&t.ended){if(t.length===0)Pi(this);return null}var n=t.needReadable;if(L("need readable",n),t.length===0||t.length-e<t.highWaterMark)n=!0,L("length less than watermark",n);if(t.ended||t.reading)n=!1,L("reading or ended",n);else if(n){if(L("do read"),t.reading=!0,t.sync=!0,t.length===0)t.needReadable=!0;if(this._read(t.highWaterMark),t.sync=!1,!t.reading)e=Js(r,t)}var i;if(e>0)i=so(e,t);else i=null;if(i===null)t.needReadable=!0,e=0;else t.length-=e;if(t.length===0){if(!t.ended)t.needReadable=!0;if(r!==e&&t.ended)Pi(this)}if(i!==null)this.emit("data",i);return i};function tp(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();if(r&&r.length)t.buffer.push(r),t.length+=t.objectMode?1:r.length}t.ended=!0,bn(e)}function bn(e){var t=e._readableState;if(t.needReadable=!1,!t.emittedReadable)if(L("emitReadable",t.flowing),t.emittedReadable=!0,t.sync)Bt.nextTick(Qs,e);else Qs(e)}function Qs(e){L("emit readable"),e.emit("readable"),Ni(e)}function ao(e,t){if(!t.readingMore)t.readingMore=!0,Bt.nextTick(rp,e,t)}function rp(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark)if(L("maybeReadMore read 0"),e.read(0),r===t.length)break;else r=t.length;t.readingMore=!1}Z.prototype._read=function(e){this.emit("error",Error("_read() is not implemented"))};Z.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e);break}n.pipesCount+=1,L("pipe count=%d opts=%j",n.pipesCount,t);var i=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr,a=i?o:b;if(n.endEmitted)Bt.nextTick(a);else r.once("end",a);e.on("unpipe",s);function s(S,T){if(L("onunpipe"),S===r){if(T&&T.hasUnpiped===!1)T.hasUnpiped=!0,c()}}function o(){L("onend"),e.end()}var h=np(r);e.on("drain",h);var l=!1;function c(){if(L("cleanup"),e.removeListener("close",w),e.removeListener("finish",v),e.removeListener("drain",h),e.removeListener("error",_),e.removeListener("unpipe",s),r.removeListener("end",o),r.removeListener("end",b),r.removeListener("data",m),l=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain))h()}var p=!1;r.on("data",m);function m(S){L("ondata"),p=!1;var T=e.write(S);if(T===!1&&!p){if((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&oo(n.pipes,e)!==-1)&&!l)L("false write response, pause",n.awaitDrain),n.awaitDrain++,p=!0;r.pause()}}function _(S){if(L("onerror",S),b(),e.removeListener("error",_),eo(e,"error")===0)e.emit("error",S)}Yd(e,"error",_);function w(){e.removeListener("finish",v),b()}e.once("close",w);function v(){L("onfinish"),e.removeListener("close",w),b()}e.once("finish",v);function b(){L("unpipe"),r.unpipe(e)}if(e.emit("pipe",r),!n.flowing)L("pipe resume"),r.resume();return e};function np(e){return function(){var t=e._readableState;if(L("pipeOnDrain",t.awaitDrain),t.awaitDrain)t.awaitDrain--;if(t.awaitDrain===0&&eo(e,"data"))t.flowing=!0,Ni(e)}}Z.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1){if(e&&e!==t.pipes)return this;if(!e)e=t.pipes;if(t.pipes=null,t.pipesCount=0,t.flowing=!1,e)e.emit("unpipe",this,r);return this}if(!e){var{pipes:n,pipesCount:i}=t;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<i;a++)n[a].emit("unpipe",this,{hasUnpiped:!1});return this}var s=oo(t.pipes,e);if(s===-1)return this;if(t.pipes.splice(s,1),t.pipesCount-=1,t.pipesCount===1)t.pipes=t.pipes[0];return e.emit("unpipe",this,r),this};Z.prototype.on=function(e,t){var r=Ri.prototype.on.call(this,e,t);if(e==="data"){if(this._readableState.flowing!==!1)this.resume()}else if(e==="readable"){var n=this._readableState;if(!n.endEmitted&&!n.readableListening){if(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,!n.reading)Bt.nextTick(ip,this);else if(n.length)bn(this)}}return r};Z.prototype.addListener=Z.prototype.on;function ip(e){L("readable nexttick read 0"),e.read(0)}Z.prototype.resume=function(){var e=this._readableState;if(!e.flowing)L("resume"),e.flowing=!0,ap(this,e);return this};function ap(e,t){if(!t.resumeScheduled)t.resumeScheduled=!0,Bt.nextTick(sp,e,t)}function sp(e,t){if(!t.reading)L("resume read 0"),e.read(0);if(t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),Ni(e),t.flowing&&!t.reading)e.read(0)}Z.prototype.pause=function(){if(L("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1)L("pause"),this._readableState.flowing=!1,this.emit("pause");return this};function Ni(e){var t=e._readableState;L("flow",t.flowing);while(t.flowing&&e.read()!==null);}Z.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;e.on("end",function(){if(L("wrapped end"),r.decoder&&!r.ended){var s=r.decoder.end();if(s&&s.length)t.push(s)}t.push(null)}),e.on("data",function(s){if(L("wrapped data"),r.decoder)s=r.decoder.write(s);if(r.objectMode&&(s===null||s===void 0))return;else if(!r.objectMode&&(!s||!s.length))return;var o=t.push(s);if(!o)n=!0,e.pause()});for(var i in e)if(this[i]===void 0&&typeof e[i]==="function")this[i]=function(s){return function(){return e[s].apply(e,arguments)}}(i);for(var a=0;a<Di.length;a++)e.on(Di[a],this.emit.bind(this,Di[a]));return this._read=function(s){if(L("wrapped _read",s),n)n=!1,e.resume()},this};Object.defineProperty(Z.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Z._fromList=so;function so(e,t){if(t.length===0)return null;var r;if(t.objectMode)r=t.buffer.shift();else if(!e||e>=t.length){if(t.decoder)r=t.buffer.join("");else if(t.buffer.length===1)r=t.buffer.head.data;else r=t.buffer.concat(t.length);t.buffer.clear()}else r=op(e,t.buffer,t.decoder);return r}function op(e,t,r){var n;if(e<t.head.data.length)n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e);else if(e===t.head.data.length)n=t.shift();else n=r?fp(e,t):lp(e,t);return n}function fp(e,t){var r=t.head,n=1,i=r.data;e-=i.length;while(r=r.next){var a=r.data,s=e>a.length?a.length:e;if(s===a.length)i+=a;else i+=a.slice(0,e);if(e-=s,e===0){if(s===a.length)if(++n,r.next)t.head=r.next;else t.head=t.tail=null;else t.head=r,r.data=a.slice(s);break}++n}return t.length-=n,i}function lp(e,t){var r=Sr.allocUnsafe(e),n=t.head,i=1;n.data.copy(r),e-=n.data.length;while(n=n.next){var a=n.data,s=e>a.length?a.length:e;if(a.copy(r,r.length-e,0,s),e-=s,e===0){if(s===a.length)if(++i,n.next)t.head=n.next;else t.head=t.tail=null;else t.head=n,n.data=a.slice(s);break}++i}return t.length-=i,r}function Pi(e){var t=e._readableState;if(t.length>0)throw Error('"endReadable()" called on non-empty stream');if(!t.endEmitted)t.ended=!0,Bt.nextTick(up,t,e)}function up(e,t){if(!e.endEmitted&&e.length===0)e.endEmitted=!0,t.readable=!1,t.emit("end")}function oo(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}});var Fi=I(function(lb,co){co.exports=He;var xn=pt(),uo=Object.create(Rt());uo.inherits=Nt();uo.inherits(He,xn);function cp(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",Error("write callback called multiple times"));if(r.writechunk=null,r.writecb=null,t!=null)this.push(t);n(e);var i=this._readableState;if(i.reading=!1,i.needReadable||i.length<i.highWaterMark)this._read(i.highWaterMark)}function He(e){if(!(this instanceof He))return new He(e);if(xn.call(this,e),this._transformState={afterTransform:cp.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e){if(typeof e.transform==="function")this._transform=e.transform;if(typeof e.flush==="function")this._flush=e.flush}this.on("prefinish",hp)}function hp(){var e=this;if(typeof this._flush==="function")this._flush(function(t,r){lo(e,t,r)});else lo(this,null,null)}He.prototype.push=function(e,t){return this._transformState.needTransform=!1,xn.prototype.push.call(this,e,t)};He.prototype._transform=function(e,t,r){throw Error("_transform() is not implemented")};He.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;if(n.needTransform||i.needReadable||i.length<i.highWaterMark)this._read(i.highWaterMark)}};He.prototype._read=function(e){var t=this._transformState;if(t.writechunk!==null&&t.writecb&&!t.transforming)t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform);else t.needTransform=!0};He.prototype._destroy=function(e,t){var r=this;xn.prototype._destroy.call(this,e,function(n){t(n),r.emit("close")})};function lo(e,t,r){if(t)return e.emit("error",t);if(r!=null)e.push(r);if(e._writableState.length)throw Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw Error("Calling transform done when still transforming");return e.push(null)}});var mo=I(function(ub,go){go.exports=kr;var ho=Fi(),po=Object.create(Rt());po.inherits=Nt();po.inherits(kr,ho);function kr(e){if(!(this instanceof kr))return new kr(e);ho.call(this,e)}kr.prototype._transform=function(e,t,r){r(null,e)}});var Mi=I(function(se,En){var De=Ee("stream");if(process.env.READABLE_STREAM==="disable"&&De)En.exports=De,se=En.exports=De.Readable,se.Readable=De.Readable,se.Writable=De.Writable,se.Duplex=De.Duplex,se.Transform=De.Transform,se.PassThrough=De.PassThrough,se.Stream=De;else se=En.exports=Si(),se.Stream=De||se,se.Readable=se,se.Writable=Ei(),se.Duplex=pt(),se.Transform=Fi(),se.PassThrough=mo()});var Ge=I(function(pp){pp.base64=!0;pp.array=!0;pp.string=!0;pp.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u";pp.nodebuffer=typeof Buffer<"u";pp.uint8array=typeof Uint8Array<"u";if(typeof ArrayBuffer>"u")pp.blob=!1;else{Tn=new ArrayBuffer(0);try{pp.blob=new Blob([Tn],{type:"application/zip"}).size===0}catch(e){try{zi=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,Sn=new zi,Sn.append(Tn),pp.blob=Sn.getBlob("application/zip").size===0}catch(t){pp.blob=!1}}}var Tn,zi,Sn;try{pp.nodestream=!!Mi().Readable}catch(e){pp.nodestream=!1}});var Li=I(function(Ep){var bp=X(),xp=Ge(),Oe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";Ep.encode=function(e){var t=[],r,n,i,a,s,o,h,l=0,c=e.length,p=c,m=bp.getTypeOf(e)!=="string";while(l<e.length){if(p=c-l,!m)r=e.charCodeAt(l++),n=l<c?e.charCodeAt(l++):0,i=l<c?e.charCodeAt(l++):0;else r=e[l++],n=l<c?e[l++]:0,i=l<c?e[l++]:0;a=r>>2,s=(r&3)<<4|n>>4,o=p>1?(n&15)<<2|i>>6:64,h=p>2?i&63:64,t.push(Oe.charAt(a)+Oe.charAt(s)+Oe.charAt(o)+Oe.charAt(h))}return t.join("")};Ep.decode=function(e){var t,r,n,i,a,s,o,h=0,l=0,c="data:";if(e.substr(0,c.length)===c)throw Error("Invalid base64 input, it looks like a data url.");e=e.replace(/[^A-Za-z0-9+/=]/g,"");var p=e.length*3/4;if(e.charAt(e.length-1)===Oe.charAt(64))p--;if(e.charAt(e.length-2)===Oe.charAt(64))p--;if(p%1!==0)throw Error("Invalid base64 input, bad content length.");var m;if(xp.uint8array)m=new Uint8Array(p|0);else m=Array(p|0);while(h<e.length){if(i=Oe.indexOf(e.charAt(h++)),a=Oe.indexOf(e.charAt(h++)),s=Oe.indexOf(e.charAt(h++)),o=Oe.indexOf(e.charAt(h++)),t=i<<2|a>>4,r=(a&15)<<4|s>>2,n=(s&3)<<6|o,m[l++]=t,s!==64)m[l++]=r;if(o!==64)m[l++]=n}return m}});var Ar=I(function(db,vo){vo.exports={isNode:typeof Buffer<"u",newBufferFrom:function(e,t){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(e,t);else{if(typeof e==="number")throw Error('The "data" argument must not be a number');return new Buffer(e,t)}},allocBuffer:function(e){if(Buffer.alloc)return Buffer.alloc(e);else{var t=new Buffer(e);return t.fill(0),t}},isBuffer:function(e){return Buffer.isBuffer(e)},isStream:function(e){return e&&typeof e.on==="function"&&typeof e.pause==="function"&&typeof e.resume==="function"}}});var wo=I(function(gb,yo){var pb=global.MutationObserver||global.WebKitMutationObserver,_o;_o=function(){process.nextTick(Dp)};var kp,Ap,Ip,Cp,Ui,Ir=[];function Dp(){Ui=!0;var e,t,r=Ir.length;while(r){t=Ir,Ir=[],e=-1;while(++e<r)t[e]();r=Ir.length}Ui=!1}yo.exports=Op;function Op(e){if(Ir.push(e)===1&&!Ui)_o()}});var Ao=I(function(mb,ko){var bo=wo();function Lt(){}var fe={},xo=["REJECTED"],ji=["FULFILLED"],Eo=["PENDING"];zt=["UNHANDLED"];var zt;ko.exports=et;function et(e){if(typeof e!=="function")throw TypeError("resolver must be a function");if(this.state=Eo,this.queue=[],this.outcome=void 0,this.handled=zt,e!==Lt)To(this,e)}et.prototype.finally=function(e){if(typeof e!=="function")return this;var t=this.constructor;return this.then(r,n);function r(i){function a(){return i}return t.resolve(e()).then(a)}function n(i){function a(){throw i}return t.resolve(e()).then(a)}};et.prototype.catch=function(e){return this.then(null,e)};et.prototype.then=function(e,t){if(typeof e!=="function"&&this.state===ji||typeof t!=="function"&&this.state===xo)return this;var r=new this.constructor(Lt);if(this.handled===zt)this.handled=null;if(this.state!==Eo){var n=this.state===ji?e:t;qi(r,n,this.outcome)}else this.queue.push(new Cr(r,e,t));return r};function Cr(e,t,r){if(this.promise=e,typeof t==="function")this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled;if(typeof r==="function")this.onRejected=r,this.callRejected=this.otherCallRejected}Cr.prototype.callFulfilled=function(e){fe.resolve(this.promise,e)};Cr.prototype.otherCallFulfilled=function(e){qi(this.promise,this.onFulfilled,e)};Cr.prototype.callRejected=function(e){fe.reject(this.promise,e)};Cr.prototype.otherCallRejected=function(e){qi(this.promise,this.onRejected,e)};function qi(e,t,r){bo(function(){var n;try{n=t(r)}catch(i){return fe.reject(e,i)}if(n===e)fe.reject(e,TypeError("Cannot resolve promise with itself"));else fe.resolve(e,n)})}fe.resolve=function(e,t){var r=So(Pp,t);if(r.status==="error")return fe.reject(e,r.value);var n=r.value;if(n)To(e,n);else{e.state=ji,e.outcome=t;var i=-1,a=e.queue.length;while(++i<a)e.queue[i].callFulfilled(t)}return e};fe.reject=function(e,t){if(e.state=xo,e.outcome=t,e.handled===zt)bo(function(){if(e.handled===zt)process.emit("unhandledRejection",t,e)});var r=-1,n=e.queue.length;while(++r<n)e.queue[r].callRejected(t);return e};function Pp(e){var t=e&&e.then;if(e&&(typeof e==="object"||typeof e==="function")&&typeof t==="function")return function(){t.apply(e,arguments)}}function To(e,t){var r=!1;function n(o){if(r)return;r=!0,fe.reject(e,o)}function i(o){if(r)return;r=!0,fe.resolve(e,o)}function a(){t(i,n)}var s=So(a);if(s.status==="error")n(s.value)}function So(e,t){var r={};try{r.value=e(t),r.status="success"}catch(n){r.status="error",r.value=n}return r}et.resolve=Rp;function Rp(e){if(e instanceof this)return e;return fe.resolve(new this(Lt),e)}et.reject=Np;function Np(e){var t=new this(Lt);return fe.reject(t,e)}et.all=Fp;function Fp(e){var t=this;if(Object.prototype.toString.call(e)!=="[object Array]")return this.reject(TypeError("must be an array"));var r=e.length,n=!1;if(!r)return this.resolve([]);var i=Array(r),a=0,s=-1,o=new this(Lt);while(++s<r)h(e[s],s);return o;function h(l,c){t.resolve(l).then(p,function(m){if(!n)n=!0,fe.reject(o,m)});function p(m){if(i[c]=m,++a===r&&!n)n=!0,fe.resolve(o,i)}}}et.race=Mp;function Mp(e){var t=this;if(Object.prototype.toString.call(e)!=="[object Array]")return this.reject(TypeError("must be an array"));var r=e.length,n=!1;if(!r)return this.resolve([]);var i=-1,a=new this(Lt);while(++i<r)s(e[i]);return a;function s(o){t.resolve(o).then(function(h){if(!n)n=!0,fe.resolve(a,h)},function(h){if(!n)n=!0,fe.reject(a,h)})}}});var Ut=I(function(vb,Io){var Wi=null;if(typeof Promise<"u")Wi=Promise;else Wi=Ao();Io.exports={Promise:Wi}});var Do=I(function(Co){(function(e,t){if(e.setImmediate)return;var r=1,n={},i=!1,a=e.document,s;function o(T){if(typeof T!=="function")T=Function(""+T);var k=Array(arguments.length-1);for(var x=0;x<k.length;x++)k[x]=arguments[x+1];var A={callback:T,args:k};return n[r]=A,s(r),r++}function h(T){delete n[T]}function l(T){var{callback:k,args:x}=T;switch(x.length){case 0:k();break;case 1:k(x[0]);break;case 2:k(x[0],x[1]);break;case 3:k(x[0],x[1],x[2]);break;default:k.apply(t,x);break}}function c(T){if(i)setTimeout(c,0,T);else{var k=n[T];if(k){i=!0;try{l(k)}finally{h(T),i=!1}}}}function p(){s=function(T){process.nextTick(function(){c(T)})}}function m(){if(e.postMessage&&!e.importScripts){var T=!0,k=e.onmessage;return e.onmessage=function(){T=!1},e.postMessage("","*"),e.onmessage=k,T}}function _(){var T="setImmediate$"+Math.random()+"$",k=function(x){if(x.source===e&&typeof x.data==="string"&&x.data.indexOf(T)===0)c(+x.data.slice(T.length))};if(e.addEventListener)e.addEventListener("message",k,!1);else e.attachEvent("onmessage",k);s=function(x){e.postMessage(T+x,"*")}}function w(){var T=new MessageChannel;T.port1.onmessage=function(k){var x=k.data;c(x)},s=function(k){T.port2.postMessage(k)}}function v(){var T=a.documentElement;s=function(k){var x=a.createElement("script");x.onreadystatechange=function(){c(k),x.onreadystatechange=null,T.removeChild(x),x=null},T.appendChild(x)}}function b(){s=function(T){setTimeout(c,0,T)}}var S=Object.getPrototypeOf&&Object.getPrototypeOf(e);if(S=S&&S.setTimeout?S:e,{}.toString.call(e.process)==="[object process]")p();else if(m())_();else if(e.MessageChannel)w();else if(a&&"onreadystatechange"in a.createElement("script"))v();else b();S.setImmediate=o,S.clearImmediate=h})(typeof self>"u"?typeof global>"u"?Co:global:self)});var X=I(function(gt){var tt=Ge(),Bp=Li(),jt=Ar(),$i=Ut();Do();function zp(e){var t=null;if(tt.uint8array)t=new Uint8Array(e.length);else t=Array(e.length);return An(e,t)}gt.newBlob=function(e,t){gt.checkSupport("blob");try{return new Blob([e],{type:t})}catch(i){try{var r=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,n=new r;return n.append(e),n.getBlob(t)}catch(a){throw Error("Bug : can't construct the Blob.")}}};function Dr(e){return e}function An(e,t){for(var r=0;r<e.length;++r)t[r]=e.charCodeAt(r)&255;return t}var kn={stringifyByChunk:function(e,t,r){var n=[],i=0,a=e.length;if(a<=r)return String.fromCharCode.apply(null,e);while(i<a){if(t==="array"||t==="nodebuffer")n.push(String.fromCharCode.apply(null,e.slice(i,Math.min(i+r,a))));else n.push(String.fromCharCode.apply(null,e.subarray(i,Math.min(i+r,a))));i+=r}return n.join("")},stringifyByChar:function(e){var t="";for(var r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},applyCanBeUsed:{uint8array:function(){try{return tt.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch(e){return!1}}(),nodebuffer:function(){try{return tt.nodebuffer&&String.fromCharCode.apply(null,jt.allocBuffer(1)).length===1}catch(e){return!1}}()}};function Or(e){var t=65536,r=gt.getTypeOf(e),n=!0;if(r==="uint8array")n=kn.applyCanBeUsed.uint8array;else if(r==="nodebuffer")n=kn.applyCanBeUsed.nodebuffer;if(n)while(t>1)try{return kn.stringifyByChunk(e,r,t)}catch(i){t=Math.floor(t/2)}return kn.stringifyByChar(e)}gt.applyFromCharCode=Or;function In(e,t){for(var r=0;r<e.length;r++)t[r]=e[r];return t}var rt={};rt.string={string:Dr,array:function(e){return An(e,Array(e.length))},arraybuffer:function(e){return rt.string.uint8array(e).buffer},uint8array:function(e){return An(e,new Uint8Array(e.length))},nodebuffer:function(e){return An(e,jt.allocBuffer(e.length))}};rt.array={string:Or,array:Dr,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return jt.newBufferFrom(e)}};rt.arraybuffer={string:function(e){return Or(new Uint8Array(e))},array:function(e){return In(new Uint8Array(e),Array(e.byteLength))},arraybuffer:Dr,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return jt.newBufferFrom(new Uint8Array(e))}};rt.uint8array={string:Or,array:function(e){return In(e,Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:Dr,nodebuffer:function(e){return jt.newBufferFrom(e)}};rt.nodebuffer={string:Or,array:function(e){return In(e,Array(e.length))},arraybuffer:function(e){return rt.nodebuffer.uint8array(e).buffer},uint8array:function(e){return In(e,new Uint8Array(e.length))},nodebuffer:Dr};gt.transformTo=function(e,t){if(!t)t="";if(!e)return t;gt.checkSupport(e);var r=gt.getTypeOf(t),n=rt[r][e](t);return n};gt.resolve=function(e){var t=e.split("/"),r=[];for(var n=0;n<t.length;n++){var i=t[n];if(i==="."||i===""&&n!==0&&n!==t.length-1)continue;else if(i==="..")r.pop();else r.push(i)}return r.join("/")};gt.getTypeOf=function(e){if(typeof e==="string")return"string";if(Object.prototype.toString.call(e)==="[object Array]")return"array";if(tt.nodebuffer&&jt.isBuffer(e))return"nodebuffer";if(tt.uint8array&&e instanceof Uint8Array)return"uint8array";if(tt.arraybuffer&&e instanceof ArrayBuffer)return"arraybuffer"};gt.checkSupport=function(e){var t=tt[e.toLowerCase()];if(!t)throw Error(e+" is not supported by this platform")};gt.MAX_VALUE_16BITS=65535;gt.MAX_VALUE_32BITS=-1;gt.pretty=function(e){var t="",r,n;for(n=0;n<(e||"").length;n++)r=e.charCodeAt(n),t+="\\x"+(r<16?"0":"")+r.toString(16).toUpperCase();return t};gt.delay=function(e,t,r){setImmediate(function(){e.apply(r||null,t||[])})};gt.inherits=function(e,t){var r=function(){};r.prototype=t.prototype,e.prototype=new r};gt.extend=function(){var e={},t,r;for(t=0;t<arguments.length;t++)for(r in arguments[t])if(Object.prototype.hasOwnProperty.call(arguments[t],r)&&typeof e[r]>"u")e[r]=arguments[t][r];return e};gt.prepareContent=function(e,t,r,n,i){var a=$i.Promise.resolve(t).then(function(s){var o=tt.blob&&(s instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(s))!==-1);if(o&&typeof FileReader<"u")return new $i.Promise(function(h,l){var c=new FileReader;c.onload=function(p){h(p.target.result)},c.onerror=function(p){l(p.target.error)},c.readAsArrayBuffer(s)});else return s});return a.then(function(s){var o=gt.getTypeOf(s);if(!o)return $i.Promise.reject(Error("Can't read the data of '"+e+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"));if(o==="arraybuffer")s=gt.transformTo("uint8array",s);else if(o==="string"){if(i)s=Bp.decode(s);else if(r){if(n!==!0)s=zp(s)}}return s})}});var ge=I(function(wb,No){function Ro(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}Ro.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){if(this.isFinished)return!1;if(this.isPaused)this.generatedError=e;else{if(this.isFinished=!0,this.emit("error",e),this.previous)this.previous.error(e);this.cleanUp()}return!0},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var r=0;r<this._listeners[e].length;r++)this._listeners[e][r].call(this,t)},pipe:function(e){return e.registerPrevious(this)},registerPrevious:function(e){if(this.isLocked)throw Error("The stream '"+this+"' has already been used.");this.streamInfo=e.streamInfo,this.mergeStreamInfo(),this.previous=e;var t=this;return e.on("data",function(r){t.processChunk(r)}),e.on("end",function(){t.end()}),e.on("error",function(r){t.error(r)}),this},pause:function(){if(this.isPaused||this.isFinished)return!1;if(this.isPaused=!0,this.previous)this.previous.pause();return!0},resume:function(){if(!this.isPaused||this.isFinished)return!1;this.isPaused=!1;var e=!1;if(this.generatedError)this.error(this.generatedError),e=!0;if(this.previous)this.previous.resume();return!e},flush:function(){},processChunk:function(e){this.push(e)},withStreamInfo:function(e,t){return this.extraStreamInfo[e]=t,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var e in this.extraStreamInfo){if(!Object.prototype.hasOwnProperty.call(this.extraStreamInfo,e))continue;this.streamInfo[e]=this.extraStreamInfo[e]}},lock:function(){if(this.isLocked)throw Error("The stream '"+this+"' has already been used.");if(this.isLocked=!0,this.previous)this.previous.lock()},toString:function(){var e="Worker "+this.name;if(this.previous)return this.previous+" -> "+e;else return e}};No.exports=Ro});var Wt=I(function(Qp){var qt=X(),mt=Ge(),Vp=Ar(),Cn=ge(),Pr=Array(256);for(Pe=0;Pe<256;Pe++)Pr[Pe]=Pe>=252?6:Pe>=248?5:Pe>=240?4:Pe>=224?3:Pe>=192?2:1;var Pe;Pr[254]=Pr[254]=1;var Kp=function(e){var t,r,n,i,a,s=e.length,o=0;for(i=0;i<s;i++){if(r=e.charCodeAt(i),(r&64512)===55296&&i+1<s){if(n=e.charCodeAt(i+1),(n&64512)===56320)r=65536+(r-55296<<10)+(n-56320),i++}o+=r<128?1:r<2048?2:r<65536?3:4}if(mt.uint8array)t=new Uint8Array(o);else t=Array(o);for(a=0,i=0;a<o;i++){if(r=e.charCodeAt(i),(r&64512)===55296&&i+1<s){if(n=e.charCodeAt(i+1),(n&64512)===56320)r=65536+(r-55296<<10)+(n-56320),i++}if(r<128)t[a++]=r;else if(r<2048)t[a++]=192|r>>>6,t[a++]=128|r&63;else if(r<65536)t[a++]=224|r>>>12,t[a++]=128|r>>>6&63,t[a++]=128|r&63;else t[a++]=240|r>>>18,t[a++]=128|r>>>12&63,t[a++]=128|r>>>6&63,t[a++]=128|r&63}return t},Yp=function(e,t){var r;if(t=t||e.length,t>e.length)t=e.length;r=t-1;while(r>=0&&(e[r]&192)===128)r--;if(r<0)return t;if(r===0)return t;return r+Pr[e[r]]>t?r:t},Jp=function(e){var t,r,n,i,a=e.length,s=Array(a*2);for(r=0,t=0;t<a;){if(n=e[t++],n<128){s[r++]=n;continue}if(i=Pr[n],i>4){s[r++]=65533,t+=i-1;continue}n&=i===2?31:i===3?15:7;while(i>1&&t<a)n=n<<6|e[t++]&63,i--;if(i>1){s[r++]=65533;continue}if(n<65536)s[r++]=n;else n-=65536,s[r++]=55296|n>>10&1023,s[r++]=56320|n&1023}if(s.length!==r)if(s.subarray)s=s.subarray(0,r);else s.length=r;return qt.applyFromCharCode(s)};Qp.utf8encode=function(t){if(mt.nodebuffer)return Vp.newBufferFrom(t,"utf-8");return Kp(t)};Qp.utf8decode=function(t){if(mt.nodebuffer)return qt.transformTo("nodebuffer",t).toString("utf-8");return t=qt.transformTo(mt.uint8array?"uint8array":"array",t),Jp(t)};function Dn(){Cn.call(this,"utf-8 decode"),this.leftOver=null}qt.inherits(Dn,Cn);Dn.prototype.processChunk=function(e){var t=qt.transformTo(mt.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(mt.uint8array){var r=t;t=new Uint8Array(r.length+this.leftOver.length),t.set(this.leftOver,0),t.set(r,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var n=Yp(t),i=t;if(n!==t.length)if(mt.uint8array)i=t.subarray(0,n),this.leftOver=t.subarray(n,t.length);else i=t.slice(0,n),this.leftOver=t.slice(n,t.length);this.push({data:Qp.utf8decode(i),meta:e.meta})};Dn.prototype.flush=function(){if(this.leftOver&&this.leftOver.length)this.push({data:Qp.utf8decode(this.leftOver),meta:{}}),this.leftOver=null};Qp.Utf8DecodeWorker=Dn;function Hi(){Cn.call(this,"utf-8 encode")}qt.inherits(Hi,Cn);Hi.prototype.processChunk=function(e){this.push({data:Qp.utf8encode(e.data),meta:e.meta})};Qp.Utf8EncodeWorker=Hi});var Lo=I(function(xb,zo){var Mo=ge(),Bo=X();function Xi(e){Mo.call(this,"ConvertWorker to "+e),this.destType=e}Bo.inherits(Xi,Mo);Xi.prototype.processChunk=function(e){this.push({data:Bo.transformTo(this.destType,e.data),meta:e.meta})};zo.exports=Xi});var qo=I(function(Eb,jo){var Uo=Mi().Readable,rg=X();rg.inherits(Vi,Uo);function Vi(e,t,r){Uo.call(this,t),this._helper=e;var n=this;e.on("data",function(i,a){if(!n.push(i))n._helper.pause();if(r)r(a)}).on("error",function(i){n.emit("error",i)}).on("end",function(){n.push(null)})}Vi.prototype._read=function(){this._helper.resume()};jo.exports=Vi});var Ki=I(function(Tb,Zo){var vt=X(),ng=Lo(),ig=ge(),ag=Li(),sg=Ge(),og=Ut(),Wo=null;if(sg.nodestream)try{Wo=qo()}catch(e){}function fg(e,t,r){switch(e){case"blob":return vt.newBlob(vt.transformTo("arraybuffer",t),r);case"base64":return ag.encode(t);default:return vt.transformTo(e,t)}}function lg(e,t){var r,n=0,i=null,a=0;for(r=0;r<t.length;r++)a+=t[r].length;switch(e){case"string":return t.join("");case"array":return Array.prototype.concat.apply([],t);case"uint8array":i=new Uint8Array(a);for(r=0;r<t.length;r++)i.set(t[r],n),n+=t[r].length;return i;case"nodebuffer":return Buffer.concat(t);default:throw Error("concat : unsupported type '"+e+"'")}}function ug(e,t){return new og.Promise(function(r,n){var i=[],{_internalType:a,_outputType:s,_mimeType:o}=e;e.on("data",function(h,l){if(i.push(h),t)t(l)}).on("error",function(h){i=[],n(h)}).on("end",function(){try{var h=fg(s,lg(a,i),o);r(h)}catch(l){n(l)}i=[]}).resume()})}function $o(e,t,r){var n=t;switch(t){case"blob":case"arraybuffer":n="uint8array";break;case"base64":n="string";break}try{this._internalType=n,this._outputType=t,this._mimeType=r,vt.checkSupport(n),this._worker=e.pipe(new ng(n)),e.lock()}catch(i){this._worker=new ig("error"),this._worker.error(i)}}$o.prototype={accumulate:function(e){return ug(this,e)},on:function(e,t){var r=this;if(e==="data")this._worker.on(e,function(n){t.call(r,n.data,n.meta)});else this._worker.on(e,function(){vt.delay(t,arguments,r)});return this},resume:function(){return vt.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(e){if(vt.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw Error(this._outputType+" is not supported by this method");return new Wo(this,{objectMode:this._outputType!=="nodebuffer"},e)}};Zo.exports=$o});var Yi=I(function(cg){cg.base64=!1;cg.binary=!1;cg.dir=!1;cg.createFolders=!0;cg.date=null;cg.compression=null;cg.compressionOptions=null;cg.comment=null;cg.unixPermissions=null;cg.dosPermissions=null});var Ji=I(function(kb,Ho){var On=X(),Pn=ge(),xg=16384;function $t(e){Pn.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then(function(r){if(t.dataIsReady=!0,t.data=r,t.max=r&&r.length||0,t.type=On.getTypeOf(r),!t.isPaused)t._tickAndRepeat()},function(r){t.error(r)})}On.inherits($t,Pn);$t.prototype.cleanUp=function(){Pn.prototype.cleanUp.call(this),this.data=null};$t.prototype.resume=function(){if(!Pn.prototype.resume.call(this))return!1;if(!this._tickScheduled&&this.dataIsReady)this._tickScheduled=!0,On.delay(this._tickAndRepeat,[],this);return!0};$t.prototype._tickAndRepeat=function(){if(this._tickScheduled=!1,this.isPaused||this.isFinished)return;if(this._tick(),!this.isFinished)On.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0};$t.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=xg,t=null,r=Math.min(this.max,this.index+e);if(this.index>=this.max)return this.end();else{switch(this.type){case"string":t=this.data.substring(this.index,r);break;case"uint8array":t=this.data.subarray(this.index,r);break;case"array":case"nodebuffer":t=this.data.slice(this.index,r);break}return this.index=r,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})}};Ho.exports=$t});var Rn=I(function(Ab,Xo){var Eg=X();function Tg(){var e,t=[];for(var r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;t[r]=e}return t}var Go=Tg();function Sg(e,t,r,n){var i=Go,a=n+r;e=e^-1;for(var s=n;s<a;s++)e=e>>>8^i[(e^t[s])&255];return e^-1}function kg(e,t,r,n){var i=Go,a=n+r;e=e^-1;for(var s=n;s<a;s++)e=e>>>8^i[(e^t.charCodeAt(s))&255];return e^-1}Xo.exports=function(t,r){if(typeof t>"u"||!t.length)return 0;var n=Eg.getTypeOf(t)!=="string";if(n)return Sg(r|0,t,t.length,0);else return kg(r|0,t,t.length,0)}});var ea=I(function(Ib,Ko){var Vo=ge(),Ag=Rn(),Ig=X();function Qi(){Vo.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}Ig.inherits(Qi,Vo);Qi.prototype.processChunk=function(e){this.streamInfo.crc32=Ag(e.data,this.streamInfo.crc32||0),this.push(e)};Ko.exports=Qi});var Jo=I(function(Cb,Yo){var Cg=X(),ta=ge();function ra(e){ta.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}Cg.inherits(ra,ta);ra.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}ta.prototype.processChunk.call(this,e)};Yo.exports=ra});var Nn=I(function(Db,tf){var Qo=Ut(),ef=Ji(),Dg=ea(),na=Jo();function ia(e,t,r,n,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=r,this.compression=n,this.compressedContent=i}ia.prototype={getContentWorker:function(){var e=new ef(Qo.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new na("data_length")),t=this;return e.on("end",function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw Error("Bug : uncompressed data size mismatch")}),e},getCompressedWorker:function(){return new ef(Qo.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}};ia.createWorkerFrom=function(e,t,r){return e.pipe(new Dg).pipe(new na("uncompressedSize")).pipe(t.compressWorker(r)).pipe(new na("compressedSize")).withStreamInfo("compression",t)};tf.exports=ia});var sf=I(function(Ob,af){var Og=Ki(),Pg=Ji(),aa=Wt(),sa=Nn(),rf=ge(),oa=function(e,t,r){this.name=e,this.dir=r.dir,this.date=r.date,this.comment=r.comment,this.unixPermissions=r.unixPermissions,this.dosPermissions=r.dosPermissions,this._data=t,this._dataBinary=r.binary,this.options={compression:r.compression,compressionOptions:r.compressionOptions}};oa.prototype={internalStream:function(e){var t=null,r="string";try{if(!e)throw Error("No output type specified.");r=e.toLowerCase();var n=r==="string"||r==="text";if(r==="binarystring"||r==="text")r="string";t=this._decompressWorker();var i=!this._dataBinary;if(i&&!n)t=t.pipe(new aa.Utf8EncodeWorker);if(!i&&n)t=t.pipe(new aa.Utf8DecodeWorker)}catch(a){t=new rf("error"),t.error(a)}return new Og(t,r,"")},async:function(e,t){return this.internalStream(e).accumulate(t)},nodeStream:function(e,t){return this.internalStream(e||"nodebuffer").toNodejsStream(t)},_compressWorker:function(e,t){if(this._data instanceof sa&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();else{var r=this._decompressWorker();if(!this._dataBinary)r=r.pipe(new aa.Utf8EncodeWorker);return sa.createWorkerFrom(r,e,t)}},_decompressWorker:function(){if(this._data instanceof sa)return this._data.getContentWorker();else if(this._data instanceof rf)return this._data;else return new Pg(this._data)}};var nf=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],Rg=function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")};for(Rr=0;Rr<nf.length;Rr++)oa.prototype[nf[Rr]]=Rg;var Rr;af.exports=oa});var Xe=I(function(Zt){var Bg=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function zg(e,t){return Object.prototype.hasOwnProperty.call(e,t)}Zt.assign=function(e){var t=Array.prototype.slice.call(arguments,1);while(t.length){var r=t.shift();if(!r)continue;if(typeof r!=="object")throw TypeError(r+"must be non-object");for(var n in r)if(zg(r,n))e[n]=r[n]}return e};Zt.shrinkBuf=function(e,t){if(e.length===t)return e;if(e.subarray)return e.subarray(0,t);return e.length=t,e};var Lg={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray){e.set(t.subarray(r,r+n),i);return}for(var a=0;a<n;a++)e[i+a]=t[r+a]},flattenChunks:function(e){var t,r,n,i,a,s;n=0;for(t=0,r=e.length;t<r;t++)n+=e[t].length;s=new Uint8Array(n),i=0;for(t=0,r=e.length;t<r;t++)a=e[t],s.set(a,i),i+=a.length;return s}},Ug={arraySet:function(e,t,r,n,i){for(var a=0;a<n;a++)e[i+a]=t[r+a]},flattenChunks:function(e){return[].concat.apply([],e)}};Zt.setTyped=function(e){if(e)Zt.Buf8=Uint8Array,Zt.Buf16=Uint16Array,Zt.Buf32=Int32Array,Zt.assign(Zt,Lg);else Zt.Buf8=Array,Zt.Buf16=Array,Zt.Buf32=Array,Zt.assign(Zt,Ug)};Zt.setTyped(Bg)});var Df=I(function(l0){var qg=Xe(),Wg=4,ff=0,lf=1,$g=2;function Gt(e){var t=e.length;while(--t>=0)e[t]=0}var Zg=0,gf=1,Hg=2,Gg=3,Xg=258,ga=29,Lr=256,Fr=Lr+1+ga,Ht=30,ma=19,mf=2*Fr+1,_t=15,la=16,Vg=7,va=256,vf=16,_f=17,yf=18,da=[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],Fn=[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],Kg=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],wf=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Yg=512,Ve=Array((Fr+2)*2);Gt(Ve);var Nr=Array(Ht*2);Gt(Nr);var Mr=Array(Yg);Gt(Mr);var Br=Array(Xg-Gg+1);Gt(Br);var _a=Array(ga);Gt(_a);var Mn=Array(Ht);Gt(Mn);function ua(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}var bf,xf,Ef;function ca(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function Tf(e){return e<256?Mr[e]:Mr[256+(e>>>7)]}function zr(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function de(e,t,r){if(e.bi_valid>la-r)e.bi_buf|=t<<e.bi_valid&65535,zr(e,e.bi_buf),e.bi_buf=t>>la-e.bi_valid,e.bi_valid+=r-la;else e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r}function Re(e,t,r){de(e,r[t*2],r[t*2+1])}function Sf(e,t){var r=0;do r|=e&1,e>>>=1,r<<=1;while(--t>0);return r>>>1}function Jg(e){if(e.bi_valid===16)zr(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0;else if(e.bi_valid>=8)e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8}function Qg(e,t){var{dyn_tree:r,max_code:n}=t,i=t.stat_desc.static_tree,a=t.stat_desc.has_stree,s=t.stat_desc.extra_bits,o=t.stat_desc.extra_base,h=t.stat_desc.max_length,l,c,p,m,_,w,v=0;for(m=0;m<=_t;m++)e.bl_count[m]=0;r[e.heap[e.heap_max]*2+1]=0;for(l=e.heap_max+1;l<mf;l++){if(c=e.heap[l],m=r[r[c*2+1]*2+1]+1,m>h)m=h,v++;if(r[c*2+1]=m,c>n)continue;if(e.bl_count[m]++,_=0,c>=o)_=s[c-o];if(w=r[c*2],e.opt_len+=w*(m+_),a)e.static_len+=w*(i[c*2+1]+_)}if(v===0)return;do{m=h-1;while(e.bl_count[m]===0)m--;e.bl_count[m]--,e.bl_count[m+1]+=2,e.bl_count[h]--,v-=2}while(v>0);for(m=h;m!==0;m--){c=e.bl_count[m];while(c!==0){if(p=e.heap[--l],p>n)continue;if(r[p*2+1]!==m)e.opt_len+=(m-r[p*2+1])*r[p*2],r[p*2+1]=m;c--}}}function kf(e,t,r){var n=Array(_t+1),i=0,a,s;for(a=1;a<=_t;a++)n[a]=i=i+r[a-1]<<1;for(s=0;s<=t;s++){var o=e[s*2+1];if(o===0)continue;e[s*2]=Sf(n[o]++,o)}}function e0(){var e,t,r,n,i,a=Array(_t+1);r=0;for(n=0;n<ga-1;n++){_a[n]=r;for(e=0;e<1<<da[n];e++)Br[r++]=n}Br[r-1]=n,i=0;for(n=0;n<16;n++){Mn[n]=i;for(e=0;e<1<<Fn[n];e++)Mr[i++]=n}i>>=7;for(;n<Ht;n++){Mn[n]=i<<7;for(e=0;e<1<<Fn[n]-7;e++)Mr[256+i++]=n}for(t=0;t<=_t;t++)a[t]=0;e=0;while(e<=143)Ve[e*2+1]=8,e++,a[8]++;while(e<=255)Ve[e*2+1]=9,e++,a[9]++;while(e<=279)Ve[e*2+1]=7,e++,a[7]++;while(e<=287)Ve[e*2+1]=8,e++,a[8]++;kf(Ve,Fr+1,a);for(e=0;e<Ht;e++)Nr[e*2+1]=5,Nr[e*2]=Sf(e,5);bf=new ua(Ve,da,Lr+1,Fr,_t),xf=new ua(Nr,Fn,0,Ht,_t),Ef=new ua([],Kg,0,ma,Vg)}function Af(e){var t;for(t=0;t<Fr;t++)e.dyn_ltree[t*2]=0;for(t=0;t<Ht;t++)e.dyn_dtree[t*2]=0;for(t=0;t<ma;t++)e.bl_tree[t*2]=0;e.dyn_ltree[va*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function If(e){if(e.bi_valid>8)zr(e,e.bi_buf);else if(e.bi_valid>0)e.pending_buf[e.pending++]=e.bi_buf;e.bi_buf=0,e.bi_valid=0}function t0(e,t,r,n){if(If(e),n)zr(e,r),zr(e,~r);qg.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}function uf(e,t,r,n){var i=t*2,a=r*2;return e[i]<e[a]||e[i]===e[a]&&n[t]<=n[r]}function ha(e,t,r){var n=e.heap[r],i=r<<1;while(i<=e.heap_len){if(i<e.heap_len&&uf(t,e.heap[i+1],e.heap[i],e.depth))i++;if(uf(t,n,e.heap[i],e.depth))break;e.heap[r]=e.heap[i],r=i,i<<=1}e.heap[r]=n}function cf(e,t,r){var n,i,a=0,s,o;if(e.last_lit!==0)do if(n=e.pending_buf[e.d_buf+a*2]<<8|e.pending_buf[e.d_buf+a*2+1],i=e.pending_buf[e.l_buf+a],a++,n===0)Re(e,i,t);else{if(s=Br[i],Re(e,s+Lr+1,t),o=da[s],o!==0)i-=_a[s],de(e,i,o);if(n--,s=Tf(n),Re(e,s,r),o=Fn[s],o!==0)n-=Mn[s],de(e,n,o)}while(a<e.last_lit);Re(e,va,t)}function pa(e,t){var r=t.dyn_tree,n=t.stat_desc.static_tree,i=t.stat_desc.has_stree,a=t.stat_desc.elems,s,o,h=-1,l;e.heap_len=0,e.heap_max=mf;for(s=0;s<a;s++)if(r[s*2]!==0)e.heap[++e.heap_len]=h=s,e.depth[s]=0;else r[s*2+1]=0;while(e.heap_len<2)if(l=e.heap[++e.heap_len]=h<2?++h:0,r[l*2]=1,e.depth[l]=0,e.opt_len--,i)e.static_len-=n[l*2+1];t.max_code=h;for(s=e.heap_len>>1;s>=1;s--)ha(e,r,s);l=a;do s=e.heap[1],e.heap[1]=e.heap[e.heap_len--],ha(e,r,1),o=e.heap[1],e.heap[--e.heap_max]=s,e.heap[--e.heap_max]=o,r[l*2]=r[s*2]+r[o*2],e.depth[l]=(e.depth[s]>=e.depth[o]?e.depth[s]:e.depth[o])+1,r[s*2+1]=r[o*2+1]=l,e.heap[1]=l++,ha(e,r,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Qg(e,t),kf(r,h,e.bl_count)}function hf(e,t,r){var n,i=-1,a,s=t[1],o=0,h=7,l=4;if(s===0)h=138,l=3;t[(r+1)*2+1]=65535;for(n=0;n<=r;n++){if(a=s,s=t[(n+1)*2+1],++o<h&&a===s)continue;else if(o<l)e.bl_tree[a*2]+=o;else if(a!==0){if(a!==i)e.bl_tree[a*2]++;e.bl_tree[vf*2]++}else if(o<=10)e.bl_tree[_f*2]++;else e.bl_tree[yf*2]++;if(o=0,i=a,s===0)h=138,l=3;else if(a===s)h=6,l=3;else h=7,l=4}}function df(e,t,r){var n,i=-1,a,s=t[1],o=0,h=7,l=4;if(s===0)h=138,l=3;for(n=0;n<=r;n++){if(a=s,s=t[(n+1)*2+1],++o<h&&a===s)continue;else if(o<l)do Re(e,a,e.bl_tree);while(--o!==0);else if(a!==0){if(a!==i)Re(e,a,e.bl_tree),o--;Re(e,vf,e.bl_tree),de(e,o-3,2)}else if(o<=10)Re(e,_f,e.bl_tree),de(e,o-3,3);else Re(e,yf,e.bl_tree),de(e,o-11,7);if(o=0,i=a,s===0)h=138,l=3;else if(a===s)h=6,l=3;else h=7,l=4}}function r0(e){var t;hf(e,e.dyn_ltree,e.l_desc.max_code),hf(e,e.dyn_dtree,e.d_desc.max_code),pa(e,e.bl_desc);for(t=ma-1;t>=3;t--)if(e.bl_tree[wf[t]*2+1]!==0)break;return e.opt_len+=3*(t+1)+5+5+4,t}function n0(e,t,r,n){var i;de(e,t-257,5),de(e,r-1,5),de(e,n-4,4);for(i=0;i<n;i++)de(e,e.bl_tree[wf[i]*2+1],3);df(e,e.dyn_ltree,t-1),df(e,e.dyn_dtree,r-1)}function i0(e){var t=4093624447,r;for(r=0;r<=31;r++,t>>>=1)if(t&1&&e.dyn_ltree[r*2]!==0)return ff;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return lf;for(r=32;r<Lr;r++)if(e.dyn_ltree[r*2]!==0)return lf;return ff}var pf=!1;function a0(e){if(!pf)e0(),pf=!0;e.l_desc=new ca(e.dyn_ltree,bf),e.d_desc=new ca(e.dyn_dtree,xf),e.bl_desc=new ca(e.bl_tree,Ef),e.bi_buf=0,e.bi_valid=0,Af(e)}function Cf(e,t,r,n){de(e,(Zg<<1)+(n?1:0),3),t0(e,t,r,!0)}function s0(e){de(e,gf<<1,3),Re(e,va,Ve),Jg(e)}function o0(e,t,r,n){var i,a,s=0;if(e.level>0){if(e.strm.data_type===$g)e.strm.data_type=i0(e);if(pa(e,e.l_desc),pa(e,e.d_desc),s=r0(e),i=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=i)i=a}else i=a=r+5;if(r+4<=i&&t!==-1)Cf(e,t,r,n);else if(e.strategy===Wg||a===i)de(e,(gf<<1)+(n?1:0),3),cf(e,Ve,Nr);else de(e,(Hg<<1)+(n?1:0),3),n0(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),cf(e,e.dyn_ltree,e.dyn_dtree);if(Af(e),n)If(e)}function f0(e,t,r){if(e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=r&255,e.last_lit++,t===0)e.dyn_ltree[r*2]++;else e.matches++,t--,e.dyn_ltree[(Br[r]+Lr+1)*2]++,e.dyn_dtree[Tf(t)*2]++;return e.last_lit===e.lit_bufsize-1}l0._tr_init=a0;l0._tr_stored_block=Cf;l0._tr_flush_block=o0;l0._tr_tally=f0;l0._tr_align=s0});var ya=I(function(Nb,Of){function g0(e,t,r,n){var i=e&65535|0,a=e>>>16&65535|0,s=0;while(r!==0){s=r>2000?2000:r,r-=s;do i=i+t[n++]|0,a=a+i|0;while(--s);i%=65521,a%=65521}return i|a<<16|0}Of.exports=g0});var wa=I(function(Fb,Pf){function m0(){var e,t=[];for(var r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;t[r]=e}return t}var v0=m0();function _0(e,t,r,n){var i=v0,a=n+r;e^=-1;for(var s=n;s<a;s++)e=e>>>8^i[(e^t[s])&255];return e^-1}Pf.exports=_0});var Bn=I(function(Mb,Rf){Rf.exports={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"}});var qf=I(function(Y0){var le=Xe(),_e=Df(),Bf=ya(),nt=wa(),y0=Bn(),xt=0,w0=1,b0=3,ft=4,Nf=5,Fe=0,Ff=1,ye=-2,x0=-3,ba=-5,E0=-1,T0=1,zn=2,S0=3,k0=4,A0=0,I0=2,qn=8,C0=9,D0=15,O0=8,P0=29,R0=256,Ea=R0+1+P0,N0=30,F0=19,M0=2*Ea+1,B0=15,M=3,st=258,Te=st+M+1,z0=32,Wn=42,Ta=69,Ln=73,Un=91,jn=103,yt=113,jr=666,re=1,qr=2,wt=3,Kt=4,L0=3;function ot(e,t){return e.msg=y0[t],t}function Mf(e){return(e<<1)-(e>4?9:0)}function at(e){var t=e.length;while(--t>=0)e[t]=0}function it(e){var t=e.state,r=t.pending;if(r>e.avail_out)r=e.avail_out;if(r===0)return;if(le.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,t.pending===0)t.pending_out=0}function oe(e,t){_e._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,it(e.strm)}function z(e,t){e.pending_buf[e.pending++]=t}function Ur(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function U0(e,t,r,n){var i=e.avail_in;if(i>n)i=n;if(i===0)return 0;if(e.avail_in-=i,le.arraySet(t,e.input,e.next_in,i,r),e.state.wrap===1)e.adler=Bf(e.adler,t,i,r);else if(e.state.wrap===2)e.adler=nt(e.adler,t,i,r);return e.next_in+=i,e.total_in+=i,i}function zf(e,t){var{max_chain_length:r,strstart:n}=e,i,a,{prev_length:s,nice_match:o}=e,h=e.strstart>e.w_size-Te?e.strstart-(e.w_size-Te):0,{window:l,w_mask:c,prev:p}=e,m=e.strstart+st,_=l[n+s-1],w=l[n+s];if(e.prev_length>=e.good_match)r>>=2;if(o>e.lookahead)o=e.lookahead;do{if(i=t,l[i+s]!==w||l[i+s-1]!==_||l[i]!==l[n]||l[++i]!==l[n+1])continue;n+=2,i++;do;while(l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&n<m);if(a=st-(m-n),n=m-st,a>s){if(e.match_start=t,s=a,a>=o)break;_=l[n+s-1],w=l[n+s]}}while((t=p[t&c])>h&&--r!==0);if(s<=e.lookahead)return s;return e.lookahead}function bt(e){var t=e.w_size,r,n,i,a,s;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-Te)){le.arraySet(e.window,e.window,t,t,0),e.match_start-=t,e.strstart-=t,e.block_start-=t,n=e.hash_size,r=n;do i=e.head[--r],e.head[r]=i>=t?i-t:0;while(--n);n=t,r=n;do i=e.prev[--r],e.prev[r]=i>=t?i-t:0;while(--n);a+=t}if(e.strm.avail_in===0)break;if(n=U0(e.strm,e.window,e.strstart+e.lookahead,a),e.lookahead+=n,e.lookahead+e.insert>=M){s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=(e.ins_h<<e.hash_shift^e.window[s+1])&e.hash_mask;while(e.insert)if(e.ins_h=(e.ins_h<<e.hash_shift^e.window[s+M-1])&e.hash_mask,e.prev[s&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=s,s++,e.insert--,e.lookahead+e.insert<M)break}}while(e.lookahead<Te&&e.strm.avail_in!==0)}function j0(e,t){var r=65535;if(r>e.pending_buf_size-5)r=e.pending_buf_size-5;for(;;){if(e.lookahead<=1){if(bt(e),e.lookahead===0&&t===xt)return re;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if(e.strstart===0||e.strstart>=n){if(e.lookahead=e.strstart-n,e.strstart=n,oe(e,!1),e.strm.avail_out===0)return re}if(e.strstart-e.block_start>=e.w_size-Te){if(oe(e,!1),e.strm.avail_out===0)return re}}if(e.insert=0,t===ft){if(oe(e,!0),e.strm.avail_out===0)return wt;return Kt}if(e.strstart>e.block_start){if(oe(e,!1),e.strm.avail_out===0)return re}return re}function xa(e,t){var r,n;for(;;){if(e.lookahead<Te){if(bt(e),e.lookahead<Te&&t===xt)return re;if(e.lookahead===0)break}if(r=0,e.lookahead>=M)e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+M-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;if(r!==0&&e.strstart-r<=e.w_size-Te)e.match_length=zf(e,r);if(e.match_length>=M)if(n=_e._tr_tally(e,e.strstart-e.match_start,e.match_length-M),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=M){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+M-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=_e._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n){if(oe(e,!1),e.strm.avail_out===0)return re}}if(e.insert=e.strstart<M-1?e.strstart:M-1,t===ft){if(oe(e,!0),e.strm.avail_out===0)return wt;return Kt}if(e.last_lit){if(oe(e,!1),e.strm.avail_out===0)return re}return qr}function Xt(e,t){var r,n,i;for(;;){if(e.lookahead<Te){if(bt(e),e.lookahead<Te&&t===xt)return re;if(e.lookahead===0)break}if(r=0,e.lookahead>=M)e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+M-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;if(e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=M-1,r!==0&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-Te){if(e.match_length=zf(e,r),e.match_length<=5&&(e.strategy===T0||e.match_length===M&&e.strstart-e.match_start>4096))e.match_length=M-1}if(e.prev_length>=M&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-M,n=_e._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-M),e.lookahead-=e.prev_length-1,e.prev_length-=2;do if(++e.strstart<=i)e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+M-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.prev_length!==0);if(e.match_available=0,e.match_length=M-1,e.strstart++,n){if(oe(e,!1),e.strm.avail_out===0)return re}}else if(e.match_available){if(n=_e._tr_tally(e,0,e.window[e.strstart-1]),n)oe(e,!1);if(e.strstart++,e.lookahead--,e.strm.avail_out===0)return re}else e.match_available=1,e.strstart++,e.lookahead--}if(e.match_available)n=_e._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0;if(e.insert=e.strstart<M-1?e.strstart:M-1,t===ft){if(oe(e,!0),e.strm.avail_out===0)return wt;return Kt}if(e.last_lit){if(oe(e,!1),e.strm.avail_out===0)return re}return qr}function q0(e,t){var r,n,i,a,s=e.window;for(;;){if(e.lookahead<=st){if(bt(e),e.lookahead<=st&&t===xt)return re;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=M&&e.strstart>0){if(i=e.strstart-1,n=s[i],n===s[++i]&&n===s[++i]&&n===s[++i]){a=e.strstart+st;do;while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&i<a);if(e.match_length=st-(a-i),e.match_length>e.lookahead)e.match_length=e.lookahead}}if(e.match_length>=M)r=_e._tr_tally(e,1,e.match_length-M),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0;else r=_e._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r){if(oe(e,!1),e.strm.avail_out===0)return re}}if(e.insert=0,t===ft){if(oe(e,!0),e.strm.avail_out===0)return wt;return Kt}if(e.last_lit){if(oe(e,!1),e.strm.avail_out===0)return re}return qr}function W0(e,t){var r;for(;;){if(e.lookahead===0){if(bt(e),e.lookahead===0){if(t===xt)return re;break}}if(e.match_length=0,r=_e._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r){if(oe(e,!1),e.strm.avail_out===0)return re}}if(e.insert=0,t===ft){if(oe(e,!0),e.strm.avail_out===0)return wt;return Kt}if(e.last_lit){if(oe(e,!1),e.strm.avail_out===0)return re}return qr}function Ne(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}var Vt;Vt=[new Ne(0,0,0,0,j0),new Ne(4,4,8,4,xa),new Ne(4,5,16,8,xa),new Ne(4,6,32,32,xa),new Ne(4,4,16,16,Xt),new Ne(8,16,32,32,Xt),new Ne(8,16,128,128,Xt),new Ne(8,32,128,256,Xt),new Ne(32,128,258,1024,Xt),new Ne(32,258,258,4096,Xt)];function $0(e){e.window_size=2*e.w_size,at(e.head),e.max_lazy_match=Vt[e.level].max_lazy,e.good_match=Vt[e.level].good_length,e.nice_match=Vt[e.level].nice_length,e.max_chain_length=Vt[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=M-1,e.match_available=0,e.ins_h=0}function Z0(){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=qn,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 le.Buf16(M0*2),this.dyn_dtree=new le.Buf16((2*N0+1)*2),this.bl_tree=new le.Buf16((2*F0+1)*2),at(this.dyn_ltree),at(this.dyn_dtree),at(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new le.Buf16(B0+1),this.heap=new le.Buf16(2*Ea+1),at(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new le.Buf16(2*Ea+1),at(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 Lf(e){var t;if(!e||!e.state)return ot(e,ye);if(e.total_in=e.total_out=0,e.data_type=I0,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0)t.wrap=-t.wrap;return t.status=t.wrap?Wn:yt,e.adler=t.wrap===2?0:1,t.last_flush=xt,_e._tr_init(t),Fe}function Uf(e){var t=Lf(e);if(t===Fe)$0(e.state);return t}function H0(e,t){if(!e||!e.state)return ye;if(e.state.wrap!==2)return ye;return e.state.gzhead=t,Fe}function jf(e,t,r,n,i,a){if(!e)return ye;var s=1;if(t===E0)t=6;if(n<0)s=0,n=-n;else if(n>15)s=2,n-=16;if(i<1||i>C0||r!==qn||n<8||n>15||t<0||t>9||a<0||a>k0)return ot(e,ye);if(n===8)n=9;var o=new Z0;return e.state=o,o.strm=e,o.wrap=s,o.gzhead=null,o.w_bits=n,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=i+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+M-1)/M),o.window=new le.Buf8(o.w_size*2),o.head=new le.Buf16(o.hash_size),o.prev=new le.Buf16(o.w_size),o.lit_bufsize=1<<i+6,o.pending_buf_size=o.lit_bufsize*4,o.pending_buf=new le.Buf8(o.pending_buf_size),o.d_buf=1*o.lit_bufsize,o.l_buf=3*o.lit_bufsize,o.level=t,o.strategy=a,o.method=r,Uf(e)}function G0(e,t){return jf(e,t,qn,D0,O0,A0)}function X0(e,t){var r,n,i,a;if(!e||!e.state||t>Nf||t<0)return e?ot(e,ye):ye;if(n=e.state,!e.output||!e.input&&e.avail_in!==0||n.status===jr&&t!==ft)return ot(e,e.avail_out===0?ba:ye);if(n.strm=e,r=n.last_flush,n.last_flush=t,n.status===Wn)if(n.wrap===2)if(e.adler=0,z(n,31),z(n,139),z(n,8),!n.gzhead)z(n,0),z(n,0),z(n,0),z(n,0),z(n,0),z(n,n.level===9?2:n.strategy>=zn||n.level<2?4:0),z(n,L0),n.status=yt;else{if(z(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(!n.gzhead.extra?0:4)+(!n.gzhead.name?0:8)+(!n.gzhead.comment?0:16)),z(n,n.gzhead.time&255),z(n,n.gzhead.time>>8&255),z(n,n.gzhead.time>>16&255),z(n,n.gzhead.time>>24&255),z(n,n.level===9?2:n.strategy>=zn||n.level<2?4:0),z(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length)z(n,n.gzhead.extra.length&255),z(n,n.gzhead.extra.length>>8&255);if(n.gzhead.hcrc)e.adler=nt(e.adler,n.pending_buf,n.pending,0);n.gzindex=0,n.status=Ta}else{var s=qn+(n.w_bits-8<<4)<<8,o=-1;if(n.strategy>=zn||n.level<2)o=0;else if(n.level<6)o=1;else if(n.level===6)o=2;else o=3;if(s|=o<<6,n.strstart!==0)s|=z0;if(s+=31-s%31,n.status=yt,Ur(n,s),n.strstart!==0)Ur(n,e.adler>>>16),Ur(n,e.adler&65535);e.adler=1}if(n.status===Ta)if(n.gzhead.extra){i=n.pending;while(n.gzindex<(n.gzhead.extra.length&65535)){if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i)e.adler=nt(e.adler,n.pending_buf,n.pending-i,i);if(it(e),i=n.pending,n.pending===n.pending_buf_size)break}z(n,n.gzhead.extra[n.gzindex]&255),n.gzindex++}if(n.gzhead.hcrc&&n.pending>i)e.adler=nt(e.adler,n.pending_buf,n.pending-i,i);if(n.gzindex===n.gzhead.extra.length)n.gzindex=0,n.status=Ln}else n.status=Ln;if(n.status===Ln)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i)e.adler=nt(e.adler,n.pending_buf,n.pending-i,i);if(it(e),i=n.pending,n.pending===n.pending_buf_size){a=1;break}}if(n.gzindex<n.gzhead.name.length)a=n.gzhead.name.charCodeAt(n.gzindex++)&255;else a=0;z(n,a)}while(a!==0);if(n.gzhead.hcrc&&n.pending>i)e.adler=nt(e.adler,n.pending_buf,n.pending-i,i);if(a===0)n.gzindex=0,n.status=Un}else n.status=Un;if(n.status===Un)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i)e.adler=nt(e.adler,n.pending_buf,n.pending-i,i);if(it(e),i=n.pending,n.pending===n.pending_buf_size){a=1;break}}if(n.gzindex<n.gzhead.comment.length)a=n.gzhead.comment.charCodeAt(n.gzindex++)&255;else a=0;z(n,a)}while(a!==0);if(n.gzhead.hcrc&&n.pending>i)e.adler=nt(e.adler,n.pending_buf,n.pending-i,i);if(a===0)n.status=jn}else n.status=jn;if(n.status===jn)if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size)it(e);if(n.pending+2<=n.pending_buf_size)z(n,e.adler&255),z(n,e.adler>>8&255),e.adler=0,n.status=yt}else n.status=yt;if(n.pending!==0){if(it(e),e.avail_out===0)return n.last_flush=-1,Fe}else if(e.avail_in===0&&Mf(t)<=Mf(r)&&t!==ft)return ot(e,ba);if(n.status===jr&&e.avail_in!==0)return ot(e,ba);if(e.avail_in!==0||n.lookahead!==0||t!==xt&&n.status!==jr){var h=n.strategy===zn?W0(n,t):n.strategy===S0?q0(n,t):Vt[n.level].func(n,t);if(h===wt||h===Kt)n.status=jr;if(h===re||h===wt){if(e.avail_out===0)n.last_flush=-1;return Fe}if(h===qr){if(t===w0)_e._tr_align(n);else if(t!==Nf){if(_e._tr_stored_block(n,0,0,!1),t===b0){if(at(n.head),n.lookahead===0)n.strstart=0,n.block_start=0,n.insert=0}}if(it(e),e.avail_out===0)return n.last_flush=-1,Fe}}if(t!==ft)return Fe;if(n.wrap<=0)return Ff;if(n.wrap===2)z(n,e.adler&255),z(n,e.adler>>8&255),z(n,e.adler>>16&255),z(n,e.adler>>24&255),z(n,e.total_in&255),z(n,e.total_in>>8&255),z(n,e.total_in>>16&255),z(n,e.total_in>>24&255);else Ur(n,e.adler>>>16),Ur(n,e.adler&65535);if(it(e),n.wrap>0)n.wrap=-n.wrap;return n.pending!==0?Fe:Ff}function V0(e){var t;if(!e||!e.state)return ye;if(t=e.state.status,t!==Wn&&t!==Ta&&t!==Ln&&t!==Un&&t!==jn&&t!==yt&&t!==jr)return ot(e,ye);return e.state=null,t===yt?ot(e,x0):Fe}function K0(e,t){var r=t.length,n,i,a,s,o,h,l,c;if(!e||!e.state)return ye;if(n=e.state,s=n.wrap,s===2||s===1&&n.status!==Wn||n.lookahead)return ye;if(s===1)e.adler=Bf(e.adler,t,r,0);if(n.wrap=0,r>=n.w_size){if(s===0)at(n.head),n.strstart=0,n.block_start=0,n.insert=0;c=new le.Buf8(n.w_size),le.arraySet(c,t,r-n.w_size,n.w_size,0),t=c,r=n.w_size}o=e.avail_in,h=e.next_in,l=e.input,e.avail_in=r,e.next_in=0,e.input=t,bt(n);while(n.lookahead>=M){i=n.strstart,a=n.lookahead-(M-1);do n.ins_h=(n.ins_h<<n.hash_shift^n.window[i+M-1])&n.hash_mask,n.prev[i&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=i,i++;while(--a);n.strstart=i,n.lookahead=M-1,bt(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=M-1,n.match_available=0,e.next_in=h,e.input=l,e.avail_in=o,n.wrap=s,Fe}Y0.deflateInit=G0;Y0.deflateInit2=jf;Y0.deflateReset=Uf;Y0.deflateResetKeep=Lf;Y0.deflateSetHeader=H0;Y0.deflate=X0;Y0.deflateEnd=V0;Y0.deflateSetDictionary=K0;Y0.deflateInfo="pako deflate (from Nodeca project)"});var Sa=I(function(om){var $n=Xe(),Wf=!0,$f=!0;try{String.fromCharCode.apply(null,[0])}catch(e){Wf=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){$f=!1}var Wr=new $n.Buf8(256);for(Me=0;Me<256;Me++)Wr[Me]=Me>=252?6:Me>=248?5:Me>=240?4:Me>=224?3:Me>=192?2:1;var Me;Wr[254]=Wr[254]=1;om.string2buf=function(e){var t,r,n,i,a,s=e.length,o=0;for(i=0;i<s;i++){if(r=e.charCodeAt(i),(r&64512)===55296&&i+1<s){if(n=e.charCodeAt(i+1),(n&64512)===56320)r=65536+(r-55296<<10)+(n-56320),i++}o+=r<128?1:r<2048?2:r<65536?3:4}t=new $n.Buf8(o);for(a=0,i=0;a<o;i++){if(r=e.charCodeAt(i),(r&64512)===55296&&i+1<s){if(n=e.charCodeAt(i+1),(n&64512)===56320)r=65536+(r-55296<<10)+(n-56320),i++}if(r<128)t[a++]=r;else if(r<2048)t[a++]=192|r>>>6,t[a++]=128|r&63;else if(r<65536)t[a++]=224|r>>>12,t[a++]=128|r>>>6&63,t[a++]=128|r&63;else t[a++]=240|r>>>18,t[a++]=128|r>>>12&63,t[a++]=128|r>>>6&63,t[a++]=128|r&63}return t};function Zf(e,t){if(t<65534){if(e.subarray&&$f||!e.subarray&&Wf)return String.fromCharCode.apply(null,$n.shrinkBuf(e,t))}var r="";for(var n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r}om.buf2binstring=function(e){return Zf(e,e.length)};om.binstring2buf=function(e){var t=new $n.Buf8(e.length);for(var r=0,n=t.length;r<n;r++)t[r]=e.charCodeAt(r);return t};om.buf2string=function(e,t){var r,n,i,a,s=t||e.length,o=Array(s*2);for(n=0,r=0;r<s;){if(i=e[r++],i<128){o[n++]=i;continue}if(a=Wr[i],a>4){o[n++]=65533,r+=a-1;continue}i&=a===2?31:a===3?15:7;while(a>1&&r<s)i=i<<6|e[r++]&63,a--;if(a>1){o[n++]=65533;continue}if(i<65536)o[n++]=i;else i-=65536,o[n++]=55296|i>>10&1023,o[n++]=56320|i&1023}return Zf(o,n)};om.utf8border=function(e,t){var r;if(t=t||e.length,t>e.length)t=e.length;r=t-1;while(r>=0&&(e[r]&192)===128)r--;if(r<0)return t;if(r===0)return t;return r+Wr[e[r]]>t?r:t}});var ka=I(function(Lb,Hf){function dm(){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}Hf.exports=dm});var Kf=I(function(bm){var $r=qf(),Zr=Xe(),Ia=Sa(),Ca=Bn(),pm=ka(),Vf=Object.prototype.toString,gm=0,Aa=4,Yt=0,Gf=1,Xf=2,mm=-1,vm=0,_m=8;function Et(e){if(!(this instanceof Et))return new Et(e);this.options=Zr.assign({level:mm,method:_m,chunkSize:16384,windowBits:15,memLevel:8,strategy:vm,to:""},e||{});var t=this.options;if(t.raw&&t.windowBits>0)t.windowBits=-t.windowBits;else if(t.gzip&&t.windowBits>0&&t.windowBits<16)t.windowBits+=16;this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new pm,this.strm.avail_out=0;var r=$r.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==Yt)throw Error(Ca[r]);if(t.header)$r.deflateSetHeader(this.strm,t.header);if(t.dictionary){var n;if(typeof t.dictionary==="string")n=Ia.string2buf(t.dictionary);else if(Vf.call(t.dictionary)==="[object ArrayBuffer]")n=new Uint8Array(t.dictionary);else n=t.dictionary;if(r=$r.deflateSetDictionary(this.strm,n),r!==Yt)throw Error(Ca[r]);this._dict_set=!0}}Et.prototype.push=function(e,t){var r=this.strm,n=this.options.chunkSize,i,a;if(this.ended)return!1;if(a=t===~~t?t:t===!0?Aa:gm,typeof e==="string")r.input=Ia.string2buf(e);else if(Vf.call(e)==="[object ArrayBuffer]")r.input=new Uint8Array(e);else r.input=e;r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0)r.output=new Zr.Buf8(n),r.next_out=0,r.avail_out=n;if(i=$r.deflate(r,a),i!==Gf&&i!==Yt)return this.onEnd(i),this.ended=!0,!1;if(r.avail_out===0||r.avail_in===0&&(a===Aa||a===Xf))if(this.options.to==="string")this.onData(Ia.buf2binstring(Zr.shrinkBuf(r.output,r.next_out)));else this.onData(Zr.shrinkBuf(r.output,r.next_out))}while((r.avail_in>0||r.avail_out===0)&&i!==Gf);if(a===Aa)return i=$r.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===Yt;if(a===Xf)return this.onEnd(Yt),r.avail_out=0,!0;return!0};Et.prototype.onData=function(e){this.chunks.push(e)};Et.prototype.onEnd=function(e){if(e===Yt)if(this.options.to==="string")this.result=this.chunks.join("");else this.result=Zr.flattenChunks(this.chunks);this.chunks=[],this.err=e,this.msg=this.strm.msg};function Da(e,t){var r=new Et(t);if(r.push(e,!0),r.err)throw r.msg||Ca[r.err];return r.result}function ym(e,t){return t=t||{},t.raw=!0,Da(e,t)}function wm(e,t){return t=t||{},t.gzip=!0,Da(e,t)}bm.Deflate=Et;bm.deflate=Da;bm.deflateRaw=ym;bm.gzip=wm});var Jf=I(function(jb,Yf){var Zn=30,km=12;Yf.exports=function(t,r){var n,i,a,s,o,h,l,c,p,m,_,w,v,b,S,T,k,x,A,O,C,D,d,R,E;n=t.state,i=t.next_in,R=t.input,a=i+(t.avail_in-5),s=t.next_out,E=t.output,o=s-(r-t.avail_out),h=s+(t.avail_out-257),l=n.dmax,c=n.wsize,p=n.whave,m=n.wnext,_=n.window,w=n.hold,v=n.bits,b=n.lencode,S=n.distcode,T=(1<<n.lenbits)-1,k=(1<<n.distbits)-1;e:do{if(v<15)w+=R[i++]<<v,v+=8,w+=R[i++]<<v,v+=8;x=b[w&T];t:for(;;){if(A=x>>>24,w>>>=A,v-=A,A=x>>>16&255,A===0)E[s++]=x&65535;else if(A&16){if(O=x&65535,A&=15,A){if(v<A)w+=R[i++]<<v,v+=8;O+=w&(1<<A)-1,w>>>=A,v-=A}if(v<15)w+=R[i++]<<v,v+=8,w+=R[i++]<<v,v+=8;x=S[w&k];r:for(;;){if(A=x>>>24,w>>>=A,v-=A,A=x>>>16&255,A&16){if(C=x&65535,A&=15,v<A){if(w+=R[i++]<<v,v+=8,v<A)w+=R[i++]<<v,v+=8}if(C+=w&(1<<A)-1,C>l){t.msg="invalid distance too far back",n.mode=Zn;break e}if(w>>>=A,v-=A,A=s-o,C>A){if(A=C-A,A>p){if(n.sane){t.msg="invalid distance too far back",n.mode=Zn;break e}}if(D=0,d=_,m===0){if(D+=c-A,A<O){O-=A;do E[s++]=_[D++];while(--A);D=s-C,d=E}}else if(m<A){if(D+=c+m-A,A-=m,A<O){O-=A;do E[s++]=_[D++];while(--A);if(D=0,m<O){A=m,O-=A;do E[s++]=_[D++];while(--A);D=s-C,d=E}}}else if(D+=m-A,A<O){O-=A;do E[s++]=_[D++];while(--A);D=s-C,d=E}while(O>2)E[s++]=d[D++],E[s++]=d[D++],E[s++]=d[D++],O-=3;if(O){if(E[s++]=d[D++],O>1)E[s++]=d[D++]}}else{D=s-C;do E[s++]=E[D++],E[s++]=E[D++],E[s++]=E[D++],O-=3;while(O>2);if(O){if(E[s++]=E[D++],O>1)E[s++]=E[D++]}}}else if((A&64)===0){x=S[(x&65535)+(w&(1<<A)-1)];continue r}else{t.msg="invalid distance code",n.mode=Zn;break e}break}}else if((A&64)===0){x=b[(x&65535)+(w&(1<<A)-1)];continue t}else if(A&32){n.mode=km;break e}else{t.msg="invalid literal/length code",n.mode=Zn;break e}break}}while(i<a&&s<h);O=v>>3,i-=O,v-=O<<3,w&=(1<<v)-1,t.next_in=i,t.next_out=s,t.avail_in=i<a?5+(a-i):5-(i-a),t.avail_out=s<h?257+(h-s):257-(s-h),n.hold=w,n.bits=v;return}});var al=I(function(qb,il){var Qf=Xe(),Jt=15,el=852,tl=592,rl=0,Oa=1,nl=2,Am=[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],Im=[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],Cm=[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],Dm=[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];il.exports=function(t,r,n,i,a,s,o,h){var l=h.bits,c=0,p=0,m=0,_=0,w=0,v=0,b=0,S=0,T=0,k=0,x,A,O,C,D,d=null,R=0,E,B=new Qf.Buf16(Jt+1),G=new Qf.Buf16(Jt+1),V=null,Ie=0,N,ne,ue;for(c=0;c<=Jt;c++)B[c]=0;for(p=0;p<i;p++)B[r[n+p]]++;w=l;for(_=Jt;_>=1;_--)if(B[_]!==0)break;if(w>_)w=_;if(_===0)return a[s++]=20971520,a[s++]=20971520,h.bits=1,0;for(m=1;m<_;m++)if(B[m]!==0)break;if(w<m)w=m;S=1;for(c=1;c<=Jt;c++)if(S<<=1,S-=B[c],S<0)return-1;if(S>0&&(t===rl||_!==1))return-1;G[1]=0;for(c=1;c<Jt;c++)G[c+1]=G[c]+B[c];for(p=0;p<i;p++)if(r[n+p]!==0)o[G[r[n+p]]++]=p;if(t===rl)d=V=o,E=19;else if(t===Oa)d=Am,R-=257,V=Im,Ie-=257,E=256;else d=Cm,V=Dm,E=-1;if(k=0,p=0,c=m,D=s,v=w,b=0,O=-1,T=1<<w,C=T-1,t===Oa&&T>el||t===nl&&T>tl)return 1;for(;;){if(N=c-b,o[p]<E)ne=0,ue=o[p];else if(o[p]>E)ne=V[Ie+o[p]],ue=d[R+o[p]];else ne=96,ue=0;x=1<<c-b,A=1<<v,m=A;do A-=x,a[D+(k>>b)+A]=N<<24|ne<<16|ue|0;while(A!==0);x=1<<c-1;while(k&x)x>>=1;if(x!==0)k&=x-1,k+=x;else k=0;if(p++,--B[c]===0){if(c===_)break;c=r[n+o[p]]}if(c>w&&(k&C)!==O){if(b===0)b=w;D+=m,v=c-b,S=1<<v;while(v+b<_){if(S-=B[v+b],S<=0)break;v++,S<<=1}if(T+=1<<v,t===Oa&&T>el||t===nl&&T>tl)return 1;O=k&C,a[O]=w<<24|v<<16|D-s|0}}if(k!==0)a[D+k]=c-b<<24|4194304|0;return h.bits=w,0}});var Ul=I(function(Vm){var me=Xe(),Ba=ya(),Be=wa(),Om=Jf(),Hr=al(),Pm=0,Ol=1,Pl=2,sl=4,Rm=5,Hn=6,Tt=0,Nm=1,Fm=2,we=-2,Rl=-3,za=-4,Mm=-5,ol=8,Nl=1,fl=2,ll=3,ul=4,cl=5,hl=6,dl=7,pl=8,gl=9,ml=10,Vn=11,Ke=12,Pa=13,vl=14,Ra=15,_l=16,yl=17,wl=18,bl=19,Gn=20,Xn=21,xl=22,El=23,Tl=24,Sl=25,kl=26,Na=27,Al=28,Il=29,H=30,La=31,Bm=32,zm=852,Lm=592,Um=15,jm=Um;function Cl(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function qm(){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 me.Buf16(320),this.work=new me.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Fl(e){var t;if(!e||!e.state)return we;if(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap)e.adler=t.wrap&1;return t.mode=Nl,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new me.Buf32(zm),t.distcode=t.distdyn=new me.Buf32(Lm),t.sane=1,t.back=-1,Tt}function Ml(e){var t;if(!e||!e.state)return we;return t=e.state,t.wsize=0,t.whave=0,t.wnext=0,Fl(e)}function Bl(e,t){var r,n;if(!e||!e.state)return we;if(n=e.state,t<0)r=0,t=-t;else if(r=(t>>4)+1,t<48)t&=15;if(t&&(t<8||t>15))return we;if(n.window!==null&&n.wbits!==t)n.window=null;return n.wrap=r,n.wbits=t,Ml(e)}function zl(e,t){var r,n;if(!e)return we;if(n=new qm,e.state=n,n.window=null,r=Bl(e,t),r!==Tt)e.state=null;return r}function Wm(e){return zl(e,jm)}var Dl=!0,Fa,Ma;function $m(e){if(Dl){var t;Fa=new me.Buf32(512),Ma=new me.Buf32(32),t=0;while(t<144)e.lens[t++]=8;while(t<256)e.lens[t++]=9;while(t<280)e.lens[t++]=7;while(t<288)e.lens[t++]=8;Hr(Ol,e.lens,0,288,Fa,0,e.work,{bits:9}),t=0;while(t<32)e.lens[t++]=5;Hr(Pl,e.lens,0,32,Ma,0,e.work,{bits:5}),Dl=!1}e.lencode=Fa,e.lenbits=9,e.distcode=Ma,e.distbits=5}function Ll(e,t,r,n){var i,a=e.state;if(a.window===null)a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new me.Buf8(a.wsize);if(n>=a.wsize)me.arraySet(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize;else{if(i=a.wsize-a.wnext,i>n)i=n;if(me.arraySet(a.window,t,r-n,i,a.wnext),n-=i,n)me.arraySet(a.window,t,r-n,n,0),a.wnext=n,a.whave=a.wsize;else{if(a.wnext+=i,a.wnext===a.wsize)a.wnext=0;if(a.whave<a.wsize)a.whave+=i}}return 0}function Zm(e,t){var r,n,i,a,s,o,h,l,c,p,m,_,w,v,b=0,S,T,k,x,A,O,C,D,d=new me.Buf8(4),R,E,B=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return we;if(r=e.state,r.mode===Ke)r.mode=Pa;s=e.next_out,i=e.output,h=e.avail_out,a=e.next_in,n=e.input,o=e.avail_in,l=r.hold,c=r.bits,p=o,m=h,D=Tt;e:for(;;)switch(r.mode){case Nl:if(r.wrap===0){r.mode=Pa;break}while(c<16){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(r.wrap&2&&l===35615){r.check=0,d[0]=l&255,d[1]=l>>>8&255,r.check=Be(r.check,d,2,0),l=0,c=0,r.mode=fl;break}if(r.flags=0,r.head)r.head.done=!1;if(!(r.wrap&1)||(((l&255)<<8)+(l>>8))%31){e.msg="incorrect header check",r.mode=H;break}if((l&15)!==ol){e.msg="unknown compression method",r.mode=H;break}if(l>>>=4,c-=4,C=(l&15)+8,r.wbits===0)r.wbits=C;else if(C>r.wbits){e.msg="invalid window size",r.mode=H;break}r.dmax=1<<C,e.adler=r.check=1,r.mode=l&512?ml:Ke,l=0,c=0;break;case fl:while(c<16){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(r.flags=l,(r.flags&255)!==ol){e.msg="unknown compression method",r.mode=H;break}if(r.flags&57344){e.msg="unknown header flags set",r.mode=H;break}if(r.head)r.head.text=l>>8&1;if(r.flags&512)d[0]=l&255,d[1]=l>>>8&255,r.check=Be(r.check,d,2,0);l=0,c=0,r.mode=ll;case ll:while(c<32){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(r.head)r.head.time=l;if(r.flags&512)d[0]=l&255,d[1]=l>>>8&255,d[2]=l>>>16&255,d[3]=l>>>24&255,r.check=Be(r.check,d,4,0);l=0,c=0,r.mode=ul;case ul:while(c<16){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(r.head)r.head.xflags=l&255,r.head.os=l>>8;if(r.flags&512)d[0]=l&255,d[1]=l>>>8&255,r.check=Be(r.check,d,2,0);l=0,c=0,r.mode=cl;case cl:if(r.flags&1024){while(c<16){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(r.length=l,r.head)r.head.extra_len=l;if(r.flags&512)d[0]=l&255,d[1]=l>>>8&255,r.check=Be(r.check,d,2,0);l=0,c=0}else if(r.head)r.head.extra=null;r.mode=hl;case hl:if(r.flags&1024){if(_=r.length,_>o)_=o;if(_){if(r.head){if(C=r.head.extra_len-r.length,!r.head.extra)r.head.extra=Array(r.head.extra_len);me.arraySet(r.head.extra,n,a,_,C)}if(r.flags&512)r.check=Be(r.check,n,_,a);o-=_,a+=_,r.length-=_}if(r.length)break e}r.length=0,r.mode=dl;case dl:if(r.flags&2048){if(o===0)break e;_=0;do if(C=n[a+_++],r.head&&C&&r.length<65536)r.head.name+=String.fromCharCode(C);while(C&&_<o);if(r.flags&512)r.check=Be(r.check,n,_,a);if(o-=_,a+=_,C)break e}else if(r.head)r.head.name=null;r.length=0,r.mode=pl;case pl:if(r.flags&4096){if(o===0)break e;_=0;do if(C=n[a+_++],r.head&&C&&r.length<65536)r.head.comment+=String.fromCharCode(C);while(C&&_<o);if(r.flags&512)r.check=Be(r.check,n,_,a);if(o-=_,a+=_,C)break e}else if(r.head)r.head.comment=null;r.mode=gl;case gl:if(r.flags&512){while(c<16){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(l!==(r.check&65535)){e.msg="header crc mismatch",r.mode=H;break}l=0,c=0}if(r.head)r.head.hcrc=r.flags>>9&1,r.head.done=!0;e.adler=r.check=0,r.mode=Ke;break;case ml:while(c<32){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}e.adler=r.check=Cl(l),l=0,c=0,r.mode=Vn;case Vn:if(r.havedict===0)return e.next_out=s,e.avail_out=h,e.next_in=a,e.avail_in=o,r.hold=l,r.bits=c,Fm;e.adler=r.check=1,r.mode=Ke;case Ke:if(t===Rm||t===Hn)break e;case Pa:if(r.last){l>>>=c&7,c-=c&7,r.mode=Na;break}while(c<3){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}switch(r.last=l&1,l>>>=1,c-=1,l&3){case 0:r.mode=vl;break;case 1:if($m(r),r.mode=Gn,t===Hn){l>>>=2,c-=2;break e}break;case 2:r.mode=yl;break;case 3:e.msg="invalid block type",r.mode=H}l>>>=2,c-=2;break;case vl:l>>>=c&7,c-=c&7;while(c<32){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if((l&65535)!==(l>>>16^65535)){e.msg="invalid stored block lengths",r.mode=H;break}if(r.length=l&65535,l=0,c=0,r.mode=Ra,t===Hn)break e;case Ra:r.mode=_l;case _l:if(_=r.length,_){if(_>o)_=o;if(_>h)_=h;if(_===0)break e;me.arraySet(i,n,a,_,s),o-=_,a+=_,h-=_,s+=_,r.length-=_;break}r.mode=Ke;break;case yl:while(c<14){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(r.nlen=(l&31)+257,l>>>=5,c-=5,r.ndist=(l&31)+1,l>>>=5,c-=5,r.ncode=(l&15)+4,l>>>=4,c-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=H;break}r.have=0,r.mode=wl;case wl:while(r.have<r.ncode){while(c<3){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}r.lens[B[r.have++]]=l&7,l>>>=3,c-=3}while(r.have<19)r.lens[B[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,R={bits:r.lenbits},D=Hr(Pm,r.lens,0,19,r.lencode,0,r.work,R),r.lenbits=R.bits,D){e.msg="invalid code lengths set",r.mode=H;break}r.have=0,r.mode=bl;case bl:while(r.have<r.nlen+r.ndist){for(;;){if(b=r.lencode[l&(1<<r.lenbits)-1],S=b>>>24,T=b>>>16&255,k=b&65535,S<=c)break;if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(k<16)l>>>=S,c-=S,r.lens[r.have++]=k;else{if(k===16){E=S+2;while(c<E){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(l>>>=S,c-=S,r.have===0){e.msg="invalid bit length repeat",r.mode=H;break}C=r.lens[r.have-1],_=3+(l&3),l>>>=2,c-=2}else if(k===17){E=S+3;while(c<E){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}l>>>=S,c-=S,C=0,_=3+(l&7),l>>>=3,c-=3}else{E=S+7;while(c<E){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}l>>>=S,c-=S,C=0,_=11+(l&127),l>>>=7,c-=7}if(r.have+_>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=H;break}while(_--)r.lens[r.have++]=C}}if(r.mode===H)break;if(r.lens[256]===0){e.msg="invalid code -- missing end-of-block",r.mode=H;break}if(r.lenbits=9,R={bits:r.lenbits},D=Hr(Ol,r.lens,0,r.nlen,r.lencode,0,r.work,R),r.lenbits=R.bits,D){e.msg="invalid literal/lengths set",r.mode=H;break}if(r.distbits=6,r.distcode=r.distdyn,R={bits:r.distbits},D=Hr(Pl,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,R),r.distbits=R.bits,D){e.msg="invalid distances set",r.mode=H;break}if(r.mode=Gn,t===Hn)break e;case Gn:r.mode=Xn;case Xn:if(o>=6&&h>=258){if(e.next_out=s,e.avail_out=h,e.next_in=a,e.avail_in=o,r.hold=l,r.bits=c,Om(e,m),s=e.next_out,i=e.output,h=e.avail_out,a=e.next_in,n=e.input,o=e.avail_in,l=r.hold,c=r.bits,r.mode===Ke)r.back=-1;break}r.back=0;for(;;){if(b=r.lencode[l&(1<<r.lenbits)-1],S=b>>>24,T=b>>>16&255,k=b&65535,S<=c)break;if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(T&&(T&240)===0){x=S,A=T,O=k;for(;;){if(b=r.lencode[O+((l&(1<<x+A)-1)>>x)],S=b>>>24,T=b>>>16&255,k=b&65535,x+S<=c)break;if(o===0)break e;o--,l+=n[a++]<<c,c+=8}l>>>=x,c-=x,r.back+=x}if(l>>>=S,c-=S,r.back+=S,r.length=k,T===0){r.mode=kl;break}if(T&32){r.back=-1,r.mode=Ke;break}if(T&64){e.msg="invalid literal/length code",r.mode=H;break}r.extra=T&15,r.mode=xl;case xl:if(r.extra){E=r.extra;while(c<E){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}r.length+=l&(1<<r.extra)-1,l>>>=r.extra,c-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=El;case El:for(;;){if(b=r.distcode[l&(1<<r.distbits)-1],S=b>>>24,T=b>>>16&255,k=b&65535,S<=c)break;if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if((T&240)===0){x=S,A=T,O=k;for(;;){if(b=r.distcode[O+((l&(1<<x+A)-1)>>x)],S=b>>>24,T=b>>>16&255,k=b&65535,x+S<=c)break;if(o===0)break e;o--,l+=n[a++]<<c,c+=8}l>>>=x,c-=x,r.back+=x}if(l>>>=S,c-=S,r.back+=S,T&64){e.msg="invalid distance code",r.mode=H;break}r.offset=k,r.extra=T&15,r.mode=Tl;case Tl:if(r.extra){E=r.extra;while(c<E){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}r.offset+=l&(1<<r.extra)-1,l>>>=r.extra,c-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=H;break}r.mode=Sl;case Sl:if(h===0)break e;if(_=m-h,r.offset>_){if(_=r.offset-_,_>r.whave){if(r.sane){e.msg="invalid distance too far back",r.mode=H;break}}if(_>r.wnext)_-=r.wnext,w=r.wsize-_;else w=r.wnext-_;if(_>r.length)_=r.length;v=r.window}else v=i,w=s-r.offset,_=r.length;if(_>h)_=h;h-=_,r.length-=_;do i[s++]=v[w++];while(--_);if(r.length===0)r.mode=Xn;break;case kl:if(h===0)break e;i[s++]=r.length,h--,r.mode=Xn;break;case Na:if(r.wrap){while(c<32){if(o===0)break e;o--,l|=n[a++]<<c,c+=8}if(m-=h,e.total_out+=m,r.total+=m,m)e.adler=r.check=r.flags?Be(r.check,i,m,s-m):Ba(r.check,i,m,s-m);if(m=h,(r.flags?l:Cl(l))!==r.check){e.msg="incorrect data check",r.mode=H;break}l=0,c=0}r.mode=Al;case Al:if(r.wrap&&r.flags){while(c<32){if(o===0)break e;o--,l+=n[a++]<<c,c+=8}if(l!==(r.total&4294967295)){e.msg="incorrect length check",r.mode=H;break}l=0,c=0}r.mode=Il;case Il:D=Nm;break e;case H:D=Rl;break e;case La:return za;case Bm:default:return we}if(e.next_out=s,e.avail_out=h,e.next_in=a,e.avail_in=o,r.hold=l,r.bits=c,r.wsize||m!==e.avail_out&&r.mode<H&&(r.mode<Na||t!==sl)){if(Ll(e,e.output,e.next_out,m-e.avail_out))return r.mode=La,za}if(p-=e.avail_in,m-=e.avail_out,e.total_in+=p,e.total_out+=m,r.total+=m,r.wrap&&m)e.adler=r.check=r.flags?Be(r.check,i,m,e.next_out-m):Ba(r.check,i,m,e.next_out-m);if(e.data_type=r.bits+(r.last?64:0)+(r.mode===Ke?128:0)+(r.mode===Gn||r.mode===Ra?256:0),(p===0&&m===0||t===sl)&&D===Tt)D=Mm;return D}function Hm(e){if(!e||!e.state)return we;var t=e.state;if(t.window)t.window=null;return e.state=null,Tt}function Gm(e,t){var r;if(!e||!e.state)return we;if(r=e.state,(r.wrap&2)===0)return we;return r.head=t,t.done=!1,Tt}function Xm(e,t){var r=t.length,n,i,a;if(!e||!e.state)return we;if(n=e.state,n.wrap!==0&&n.mode!==Vn)return we;if(n.mode===Vn){if(i=1,i=Ba(i,t,r,0),i!==n.check)return Rl}if(a=Ll(e,t,r,r),a)return n.mode=La,za;return n.havedict=1,Tt}Vm.inflateReset=Ml;Vm.inflateReset2=Bl;Vm.inflateResetKeep=Fl;Vm.inflateInit=Wm;Vm.inflateInit2=zl;Vm.inflate=Zm;Vm.inflateEnd=Hm;Vm.inflateGetHeader=Gm;Vm.inflateSetDictionary=Xm;Vm.inflateInfo="pako inflate (from Nodeca project)"});var Ua=I(function($b,jl){jl.exports={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}});var Wl=I(function(Zb,ql){function sv(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}ql.exports=sv});var Zl=I(function(uv){var Qt=Ul(),Gr=Xe(),Kn=Sa(),Y=Ua(),ja=Bn(),ov=ka(),fv=Wl(),$l=Object.prototype.toString;function St(e){if(!(this instanceof St))return new St(e);this.options=Gr.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;if(t.raw&&t.windowBits>=0&&t.windowBits<16){if(t.windowBits=-t.windowBits,t.windowBits===0)t.windowBits=-15}if(t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits))t.windowBits+=32;if(t.windowBits>15&&t.windowBits<48){if((t.windowBits&15)===0)t.windowBits|=15}this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ov,this.strm.avail_out=0;var r=Qt.inflateInit2(this.strm,t.windowBits);if(r!==Y.Z_OK)throw Error(ja[r]);if(this.header=new fv,Qt.inflateGetHeader(this.strm,this.header),t.dictionary){if(typeof t.dictionary==="string")t.dictionary=Kn.string2buf(t.dictionary);else if($l.call(t.dictionary)==="[object ArrayBuffer]")t.dictionary=new Uint8Array(t.dictionary);if(t.raw){if(r=Qt.inflateSetDictionary(this.strm,t.dictionary),r!==Y.Z_OK)throw Error(ja[r])}}}St.prototype.push=function(e,t){var r=this.strm,n=this.options.chunkSize,i=this.options.dictionary,a,s,o,h,l,c=!1;if(this.ended)return!1;if(s=t===~~t?t:t===!0?Y.Z_FINISH:Y.Z_NO_FLUSH,typeof e==="string")r.input=Kn.binstring2buf(e);else if($l.call(e)==="[object ArrayBuffer]")r.input=new Uint8Array(e);else r.input=e;r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0)r.output=new Gr.Buf8(n),r.next_out=0,r.avail_out=n;if(a=Qt.inflate(r,Y.Z_NO_FLUSH),a===Y.Z_NEED_DICT&&i)a=Qt.inflateSetDictionary(this.strm,i);if(a===Y.Z_BUF_ERROR&&c===!0)a=Y.Z_OK,c=!1;if(a!==Y.Z_STREAM_END&&a!==Y.Z_OK)return this.onEnd(a),this.ended=!0,!1;if(r.next_out){if(r.avail_out===0||a===Y.Z_STREAM_END||r.avail_in===0&&(s===Y.Z_FINISH||s===Y.Z_SYNC_FLUSH))if(this.options.to==="string"){if(o=Kn.utf8border(r.output,r.next_out),h=r.next_out-o,l=Kn.buf2string(r.output,o),r.next_out=h,r.avail_out=n-h,h)Gr.arraySet(r.output,r.output,o,h,0);this.onData(l)}else this.onData(Gr.shrinkBuf(r.output,r.next_out))}if(r.avail_in===0&&r.avail_out===0)c=!0}while((r.avail_in>0||r.avail_out===0)&&a!==Y.Z_STREAM_END);if(a===Y.Z_STREAM_END)s=Y.Z_FINISH;if(s===Y.Z_FINISH)return a=Qt.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===Y.Z_OK;if(s===Y.Z_SYNC_FLUSH)return this.onEnd(Y.Z_OK),r.avail_out=0,!0;return!0};St.prototype.onData=function(e){this.chunks.push(e)};St.prototype.onEnd=function(e){if(e===Y.Z_OK)if(this.options.to==="string")this.result=this.chunks.join("");else this.result=Gr.flattenChunks(this.chunks);this.chunks=[],this.err=e,this.msg=this.strm.msg};function qa(e,t){var r=new St(t);if(r.push(e,!0),r.err)throw r.msg||ja[r.err];return r.result}function lv(e,t){return t=t||{},t.raw=!0,qa(e,t)}uv.Inflate=St;uv.inflate=qa;uv.inflateRaw=lv;uv.ungzip=qa});var Xl=I(function(Gb,Gl){var gv=Xe().assign,mv=Kf(),vv=Zl(),_v=Ua(),Hl={};gv(Hl,mv,vv,_v);Gl.exports=Hl});var Kl=I(function(xv){var yv=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",wv=Xl(),Vl=X(),Yn=ge(),bv=yv?"uint8array":"array";xv.magic="\b\x00";function kt(e,t){Yn.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}Vl.inherits(kt,Yn);kt.prototype.processChunk=function(e){if(this.meta=e.meta,this._pako===null)this._createPako();this._pako.push(Vl.transformTo(bv,e.data),!1)};kt.prototype.flush=function(){if(Yn.prototype.flush.call(this),this._pako===null)this._createPako();this._pako.push([],!0)};kt.prototype.cleanUp=function(){Yn.prototype.cleanUp.call(this),this._pako=null};kt.prototype._createPako=function(){this._pako=new wv[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}};xv.compressWorker=function(e){return new kt("Deflate",e)};xv.uncompressWorker=function(){return new kt("Inflate",{})}});var Wa=I(function(kv){var Yl=ge();kv.STORE={magic:"\x00\x00",compressWorker:function(){return new Yl("STORE compression")},uncompressWorker:function(){return new Yl("STORE decompression")}};kv.DEFLATE=Kl()});var $a=I(function(Cv){Cv.LOCAL_FILE_HEADER="PK\x03\x04";Cv.CENTRAL_FILE_HEADER="PK\x01\x02";Cv.CENTRAL_DIRECTORY_END="PK\x05\x06";Cv.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x06\x07";Cv.ZIP64_CENTRAL_DIRECTORY_END="PK\x06\x06";Cv.DATA_DESCRIPTOR="PK\x07\b"});var tu=I(function(Yb,eu){var er=X(),tr=ge(),Za=Wt(),Jl=Rn(),Jn=$a(),W=function(e,t){var r="",n;for(n=0;n<t;n++)r+=String.fromCharCode(e&255),e=e>>>8;return r},Mv=function(e,t){var r=e;if(!e)r=t?16893:33204;return(r&65535)<<16},Bv=function(e){return(e||0)&63},Ql=function(e,t,r,n,i,a){var{file:s,compression:o}=e,h=a!==Za.utf8encode,l=er.transformTo("string",a(s.name)),c=er.transformTo("string",Za.utf8encode(s.name)),p=s.comment,m=er.transformTo("string",a(p)),_=er.transformTo("string",Za.utf8encode(p)),w=c.length!==s.name.length,v=_.length!==p.length,b,S,T="",k="",x="",{dir:A,date:O}=s,C={crc32:0,compressedSize:0,uncompressedSize:0};if(!t||r)C.crc32=e.crc32,C.compressedSize=e.compressedSize,C.uncompressedSize=e.uncompressedSize;var D=0;if(t)D|=8;if(!h&&(w||v))D|=2048;var d=0,R=0;if(A)d|=16;if(i==="UNIX")R=798,d|=Mv(s.unixPermissions,A);else R=20,d|=Bv(s.dosPermissions,A);if(b=O.getUTCHours(),b=b<<6,b=b|O.getUTCMinutes(),b=b<<5,b=b|O.getUTCSeconds()/2,S=O.getUTCFullYear()-1980,S=S<<4,S=S|O.getUTCMonth()+1,S=S<<5,S=S|O.getUTCDate(),w)k=W(1,1)+W(Jl(l),4)+c,T+="up"+W(k.length,2)+k;if(v)x=W(1,1)+W(Jl(m),4)+_,T+="uc"+W(x.length,2)+x;var E="";E+=`
12
+ \x00`,E+=W(D,2),E+=o.magic,E+=W(b,2),E+=W(S,2),E+=W(C.crc32,4),E+=W(C.compressedSize,4),E+=W(C.uncompressedSize,4),E+=W(l.length,2),E+=W(T.length,2);var B=Jn.LOCAL_FILE_HEADER+E+l+T,G=Jn.CENTRAL_FILE_HEADER+W(R,2)+E+W(m.length,2)+"\x00\x00\x00\x00"+W(d,4)+W(n,4)+l+T+m;return{fileRecord:B,dirRecord:G}},zv=function(e,t,r,n,i){var a="",s=er.transformTo("string",i(n));return a=Jn.CENTRAL_DIRECTORY_END+"\x00\x00\x00\x00"+W(e,2)+W(e,2)+W(t,4)+W(r,4)+W(s.length,2)+s,a},Lv=function(e){var t="";return t=Jn.DATA_DESCRIPTOR+W(e.crc32,4)+W(e.compressedSize,4)+W(e.uncompressedSize,4),t};function Se(e,t,r,n){tr.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=r,this.encodeFileName=n,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}er.inherits(Se,tr);Se.prototype.push=function(e){var t=e.meta.percent||0,r=this.entriesCount,n=this._sources.length;if(this.accumulate)this.contentBuffer.push(e);else this.bytesWritten+=e.data.length,tr.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:r?(t+100*(r-n-1))/r:100}})};Se.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var r=Ql(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0};Se.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,r=Ql(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),t)this.push({data:Lv(e),meta:{percent:100}});else{this.push({data:r.fileRecord,meta:{percent:0}});while(this.contentBuffer.length)this.push(this.contentBuffer.shift())}this.currentFile=null};Se.prototype.flush=function(){var e=this.bytesWritten;for(var t=0;t<this.dirRecords.length;t++)this.push({data:this.dirRecords[t],meta:{percent:100}});var r=this.bytesWritten-e,n=zv(this.dirRecords.length,r,e,this.zipComment,this.encodeFileName);this.push({data:n,meta:{percent:100}})};Se.prototype.prepareNextSource=function(){if(this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused)this.previous.pause();else this.previous.resume()};Se.prototype.registerPrevious=function(e){this._sources.push(e);var t=this;return e.on("data",function(r){t.processChunk(r)}),e.on("end",function(){if(t.closedSource(t.previous.streamInfo),t._sources.length)t.prepareNextSource();else t.end()}),e.on("error",function(r){t.error(r)}),this};Se.prototype.resume=function(){if(!tr.prototype.resume.call(this))return!1;if(!this.previous&&this._sources.length)return this.prepareNextSource(),!0;if(!this.previous&&!this._sources.length&&!this.generatedError)return this.end(),!0};Se.prototype.error=function(e){var t=this._sources;if(!tr.prototype.error.call(this,e))return!1;for(var r=0;r<t.length;r++)try{t[r].error(e)}catch(n){}return!0};Se.prototype.lock=function(){tr.prototype.lock.call(this);var e=this._sources;for(var t=0;t<e.length;t++)e[t].lock()};eu.exports=Se});var ru=I(function(Wv){var Uv=Wa(),jv=tu(),qv=function(e,t){var r=e||t,n=Uv[r];if(!n)throw Error(r+" is not a valid compression method !");return n};Wv.generateWorker=function(e,t,r){var n=new jv(t.streamFiles,r,t.platform,t.encodeFileName),i=0;try{e.forEach(function(a,s){i++;var o=qv(s.options.compression,t.compression),h=s.options.compressionOptions||t.compressionOptions||{},{dir:l,date:c}=s;s._compressWorker(o,h).withStreamInfo("file",{name:a,dir:l,date:c,comment:s.comment||"",unixPermissions:s.unixPermissions,dosPermissions:s.dosPermissions}).pipe(n)}),n.entriesCount=i}catch(a){n.error(a)}return n}});var iu=I(function(Qb,nu){var Zv=X(),Qn=ge();function Xr(e,t){Qn.call(this,"Nodejs stream input adapter for "+e),this._upstreamEnded=!1,this._bindStream(t)}Zv.inherits(Xr,Qn);Xr.prototype._bindStream=function(e){var t=this;this._stream=e,e.pause(),e.on("data",function(r){t.push({data:r,meta:{percent:0}})}).on("error",function(r){if(t.isPaused)this.generatedError=r;else t.error(r)}).on("end",function(){if(t.isPaused)t._upstreamEnded=!0;else t.end()})};Xr.prototype.pause=function(){if(!Qn.prototype.pause.call(this))return!1;return this._stream.pause(),!0};Xr.prototype.resume=function(){if(!Qn.prototype.resume.call(this))return!1;if(this._upstreamEnded)this.end();else this._stream.resume();return!0};nu.exports=Xr});var pu=I(function(ex,du){var Hv=Wt(),Vr=X(),fu=ge(),Gv=Ki(),lu=Yi(),au=Nn(),Xv=sf(),Vv=ru(),su=Ar(),Kv=iu(),uu=function(e,t,r){var n=Vr.getTypeOf(t),i,a=Vr.extend(r||{},lu);if(a.date=a.date||new Date,a.compression!==null)a.compression=a.compression.toUpperCase();if(typeof a.unixPermissions==="string")a.unixPermissions=parseInt(a.unixPermissions,8);if(a.unixPermissions&&a.unixPermissions&16384)a.dir=!0;if(a.dosPermissions&&a.dosPermissions&16)a.dir=!0;if(a.dir)e=cu(e);if(a.createFolders&&(i=Yv(e)))hu.call(this,i,!0);var s=n==="string"&&a.binary===!1&&a.base64===!1;if(!r||typeof r.binary>"u")a.binary=!s;var o=t instanceof au&&t.uncompressedSize===0;if(o||a.dir||!t||t.length===0)a.base64=!1,a.binary=!0,t="",a.compression="STORE",n="string";var h=null;if(t instanceof au||t instanceof fu)h=t;else if(su.isNode&&su.isStream(t))h=new Kv(e,t);else h=Vr.prepareContent(e,t,a.binary,a.optimizedBinaryString,a.base64);var l=new Xv(e,h,a);this.files[e]=l},Yv=function(e){if(e.slice(-1)==="/")e=e.substring(0,e.length-1);var t=e.lastIndexOf("/");return t>0?e.substring(0,t):""},cu=function(e){if(e.slice(-1)!=="/")e+="/";return e},hu=function(e,t){if(t=typeof t<"u"?t:lu.createFolders,e=cu(e),!this.files[e])uu.call(this,e,null,{dir:!0,createFolders:t});return this.files[e]};function ou(e){return Object.prototype.toString.call(e)==="[object RegExp]"}var Jv={load:function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(e){var t,r,n;for(t in this.files)if(n=this.files[t],r=t.slice(this.root.length,t.length),r&&t.slice(0,this.root.length)===this.root)e(r,n)},filter:function(e){var t=[];return this.forEach(function(r,n){if(e(r,n))t.push(n)}),t},file:function(e,t,r){if(arguments.length===1)if(ou(e)){var n=e;return this.filter(function(a,s){return!s.dir&&n.test(a)})}else{var i=this.files[this.root+e];if(i&&!i.dir)return i;else return null}else e=this.root+e,uu.call(this,e,t,r);return this},folder:function(e){if(!e)return this;if(ou(e))return this.filter(function(i,a){return a.dir&&e.test(i)});var t=this.root+e,r=hu.call(this,t),n=this.clone();return n.root=r.name,n},remove:function(e){e=this.root+e;var t=this.files[e];if(!t){if(e.slice(-1)!=="/")e+="/";t=this.files[e]}if(t&&!t.dir)delete this.files[e];else{var r=this.filter(function(i,a){return a.name.slice(0,e.length)===e});for(var n=0;n<r.length;n++)delete this.files[r[n].name]}return this},generate:function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(e){var t,r={};try{if(r=Vr.extend(e||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:Hv.utf8encode}),r.type=r.type.toLowerCase(),r.compression=r.compression.toUpperCase(),r.type==="binarystring")r.type="string";if(!r.type)throw Error("No output type specified.");if(Vr.checkSupport(r.type),r.platform==="darwin"||r.platform==="freebsd"||r.platform==="linux"||r.platform==="sunos")r.platform="UNIX";if(r.platform==="win32")r.platform="DOS";var n=r.comment||this.comment||"";t=Vv.generateWorker(this,r,n)}catch(i){t=new fu("error"),t.error(i)}return new Gv(t,r.type||"string",r.mimeType)},generateAsync:function(e,t){return this.generateInternalStream(e).accumulate(t)},generateNodeStream:function(e,t){if(e=e||{},!e.type)e.type="nodebuffer";return this.generateInternalStream(e).toNodejsStream(t)}};du.exports=Jv});var Ha=I(function(tx,mu){var Qv=X();function gu(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}gu.prototype={checkOffset:function(e){this.checkIndex(this.index+e)},checkIndex:function(e){if(this.length<this.zero+e||e<0)throw Error("End of data reached (data length = "+this.length+", asked index = "+e+"). Corrupted zip ?")},setIndex:function(e){this.checkIndex(e),this.index=e},skip:function(e){this.setIndex(this.index+e)},byteAt:function(){},readInt:function(e){var t=0,r;this.checkOffset(e);for(r=this.index+e-1;r>=this.index;r--)t=(t<<8)+this.byteAt(r);return this.index+=e,t},readString:function(e){return Qv.transformTo("string",this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC((e>>25&127)+1980,(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(e&31)<<1))}};mu.exports=gu});var Ga=I(function(rx,_u){var vu=Ha(),e_=X();function rr(e){vu.call(this,e);for(var t=0;t<this.data.length;t++)e[t]=e[t]&255}e_.inherits(rr,vu);rr.prototype.byteAt=function(e){return this.data[this.zero+e]};rr.prototype.lastIndexOfSignature=function(e){var t=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2),i=e.charCodeAt(3);for(var a=this.length-4;a>=0;--a)if(this.data[a]===t&&this.data[a+1]===r&&this.data[a+2]===n&&this.data[a+3]===i)return a-this.zero;return-1};rr.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2),i=e.charCodeAt(3),a=this.readData(4);return t===a[0]&&r===a[1]&&n===a[2]&&i===a[3]};rr.prototype.readData=function(e){if(this.checkOffset(e),e===0)return[];var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};_u.exports=rr});var bu=I(function(nx,wu){var yu=Ha(),t_=X();function nr(e){yu.call(this,e)}t_.inherits(nr,yu);nr.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)};nr.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero};nr.prototype.readAndCheckSignature=function(e){var t=this.readData(4);return e===t};nr.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};wu.exports=nr});var Va=I(function(ix,Eu){var xu=Ga(),r_=X();function Xa(e){xu.call(this,e)}r_.inherits(Xa,xu);Xa.prototype.readData=function(e){if(this.checkOffset(e),e===0)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};Eu.exports=Xa});var ku=I(function(ax,Su){var Tu=Va(),n_=X();function Ka(e){Tu.call(this,e)}n_.inherits(Ka,Tu);Ka.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t};Su.exports=Ka});var Ya=I(function(sx,Iu){var ei=X(),Au=Ge(),i_=Ga(),a_=bu(),s_=ku(),o_=Va();Iu.exports=function(e){var t=ei.getTypeOf(e);if(ei.checkSupport(t),t==="string"&&!Au.uint8array)return new a_(e);if(t==="nodebuffer")return new s_(e);if(Au.uint8array)return new o_(ei.transformTo("uint8array",e));return new i_(ei.transformTo("array",e))}});var Pu=I(function(ox,Ou){var Ja=Ya(),lt=X(),f_=Nn(),Cu=Rn(),ti=Wt(),ri=Wa(),l_=Ge(),u_=0,c_=3,h_=function(e){for(var t in ri){if(!Object.prototype.hasOwnProperty.call(ri,t))continue;if(ri[t].magic===e)return ri[t]}return null};function Du(e,t){this.options=e,this.loadOptions=t}Du.prototype={isEncrypted:function(){return(this.bitFlag&1)===1},useUTF8:function(){return(this.bitFlag&2048)===2048},readLocalPart:function(e){var t,r;if(e.skip(22),this.fileNameLength=e.readInt(2),r=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(r),this.compressedSize===-1||this.uncompressedSize===-1)throw Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(t=h_(this.compressionMethod),t===null)throw Error("Corrupted zip : compression "+lt.pretty(this.compressionMethod)+" unknown (inner file : "+lt.transformTo("string",this.fileName)+")");this.decompressed=new f_(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw Error("Encrypted zip are not supported");e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;if(this.dir=this.externalFileAttributes&16?!0:!1,e===u_)this.dosPermissions=this.externalFileAttributes&63;if(e===c_)this.unixPermissions=this.externalFileAttributes>>16&65535;if(!this.dir&&this.fileNameStr.slice(-1)==="/")this.dir=!0},parseZIP64ExtraField:function(){if(!this.extraFields[1])return;var e=Ja(this.extraFields[1].value);if(this.uncompressedSize===lt.MAX_VALUE_32BITS)this.uncompressedSize=e.readInt(8);if(this.compressedSize===lt.MAX_VALUE_32BITS)this.compressedSize=e.readInt(8);if(this.localHeaderOffset===lt.MAX_VALUE_32BITS)this.localHeaderOffset=e.readInt(8);if(this.diskNumberStart===lt.MAX_VALUE_32BITS)this.diskNumberStart=e.readInt(4)},readExtraFields:function(e){var t=e.index+this.extraFieldsLength,r,n,i;if(!this.extraFields)this.extraFields={};while(e.index+4<t)r=e.readInt(2),n=e.readInt(2),i=e.readData(n),this.extraFields[r]={id:r,length:n,value:i};e.setIndex(t)},handleUTF8:function(){var e=l_.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=ti.utf8decode(this.fileName),this.fileCommentStr=ti.utf8decode(this.fileComment);else{var t=this.findExtraFieldUnicodePath();if(t!==null)this.fileNameStr=t;else{var r=lt.transformTo(e,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(r)}var n=this.findExtraFieldUnicodeComment();if(n!==null)this.fileCommentStr=n;else{var i=lt.transformTo(e,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(i)}}},findExtraFieldUnicodePath:function(){var e=this.extraFields[28789];if(e){var t=Ja(e.value);if(t.readInt(1)!==1)return null;if(Cu(this.fileName)!==t.readInt(4))return null;return ti.utf8decode(t.readData(e.length-5))}return null},findExtraFieldUnicodeComment:function(){var e=this.extraFields[25461];if(e){var t=Ja(e.value);if(t.readInt(1)!==1)return null;if(Cu(this.fileComment)!==t.readInt(4))return null;return ti.utf8decode(t.readData(e.length-5))}return null}};Ou.exports=Du});var Fu=I(function(fx,Nu){var d_=Ya(),Ye=X(),ke=$a(),p_=Pu(),g_=Ge();function Ru(e){this.files=[],this.loadOptions=e}Ru.prototype={checkSignature:function(e){if(!this.reader.readAndCheckSignature(e)){this.reader.index-=4;var t=this.reader.readString(4);throw Error("Corrupted zip or bug: unexpected signature ("+Ye.pretty(t)+", expected "+Ye.pretty(e)+")")}},isSignature:function(e,t){var r=this.reader.index;this.reader.setIndex(e);var n=this.reader.readString(4),i=n===t;return this.reader.setIndex(r),i},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var e=this.reader.readData(this.zipCommentLength),t=g_.uint8array?"uint8array":"array",r=Ye.transformTo(t,e);this.zipComment=this.loadOptions.decodeFileName(r)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};var e=this.zip64EndOfCentralSize-44,t=0,r,n,i;while(t<e)r=this.reader.readInt(2),n=this.reader.readInt(4),i=this.reader.readData(n),this.zip64ExtensibleData[r]={id:r,length:n,value:i}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var e,t;for(e=0;e<this.files.length;e++)t=this.files[e],this.reader.setIndex(t.localHeaderOffset),this.checkSignature(ke.LOCAL_FILE_HEADER),t.readLocalPart(this.reader),t.handleUTF8(),t.processAttributes()},readCentralDir:function(){var e;this.reader.setIndex(this.centralDirOffset);while(this.reader.readAndCheckSignature(ke.CENTRAL_FILE_HEADER))e=new p_({zip64:this.zip64},this.loadOptions),e.readCentralPart(this.reader),this.files.push(e);if(this.centralDirRecords!==this.files.length){if(this.centralDirRecords!==0&&this.files.length===0)throw Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)}},readEndOfCentral:function(){var e=this.reader.lastIndexOfSignature(ke.CENTRAL_DIRECTORY_END);if(e<0){var t=!this.isSignature(0,ke.LOCAL_FILE_HEADER);if(t)throw Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");else throw Error("Corrupted zip: can't find end of central directory")}this.reader.setIndex(e);var r=e;if(this.checkSignature(ke.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===Ye.MAX_VALUE_16BITS||this.diskWithCentralDirStart===Ye.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===Ye.MAX_VALUE_16BITS||this.centralDirRecords===Ye.MAX_VALUE_16BITS||this.centralDirSize===Ye.MAX_VALUE_32BITS||this.centralDirOffset===Ye.MAX_VALUE_32BITS){if(this.zip64=!0,e=this.reader.lastIndexOfSignature(ke.ZIP64_CENTRAL_DIRECTORY_LOCATOR),e<0)throw Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(e),this.checkSignature(ke.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,ke.ZIP64_CENTRAL_DIRECTORY_END)){if(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(ke.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0)throw Error("Corrupted zip: can't find the ZIP64 end of central directory")}this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(ke.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var n=this.centralDirOffset+this.centralDirSize;if(this.zip64)n+=20,n+=12+this.zip64EndOfCentralSize;var i=r-n;if(i>0)if(this.isSignature(r,ke.CENTRAL_FILE_HEADER));else this.reader.zero=i;else if(i<0)throw Error("Corrupted zip: missing "+Math.abs(i)+" bytes.")},prepareReader:function(e){this.reader=d_(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}};Nu.exports=Ru});var zu=I(function(lx,Bu){var Qa=X(),ni=Ut(),m_=Wt(),v_=Fu(),__=ea(),Mu=Ar();function y_(e){return new ni.Promise(function(t,r){var n=e.decompressed.getContentWorker().pipe(new __);n.on("error",function(i){r(i)}).on("end",function(){if(n.streamInfo.crc32!==e.decompressed.crc32)r(Error("Corrupted zip : CRC32 mismatch"));else t()}).resume()})}Bu.exports=function(e,t){var r=this;if(t=Qa.extend(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:m_.utf8decode}),Mu.isNode&&Mu.isStream(e))return ni.Promise.reject(Error("JSZip can't accept a stream when loading a zip file."));return Qa.prepareContent("the loaded zip file",e,!0,t.optimizedBinaryString,t.base64).then(function(n){var i=new v_(t);return i.load(n),i}).then(function(i){var a=[ni.Promise.resolve(i)],s=i.files;if(t.checkCRC32)for(var o=0;o<s.length;o++)a.push(y_(s[o]));return ni.Promise.all(a)}).then(function(i){var a=i.shift(),s=a.files;for(var o=0;o<s.length;o++){var h=s[o],l=h.fileNameStr,c=Qa.resolve(h.fileNameStr);if(r.file(c,h.decompressed,{binary:!0,optimizedBinaryString:!0,date:h.date,dir:h.dir,comment:h.fileCommentStr.length?h.fileCommentStr:null,unixPermissions:h.unixPermissions,dosPermissions:h.dosPermissions,createFolders:t.createFolders}),!h.dir)r.file(c).unsafeOriginalName=l}if(a.zipComment.length)r.comment=a.zipComment;return r})}});var Uu=I(function(ux,Lu){function be(){if(!(this instanceof be))return new be;if(arguments.length)throw Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var e=new be;for(var t in this)if(typeof this[t]!=="function")e[t]=this[t];return e}}be.prototype=pu();be.prototype.loadAsync=zu();be.support=Ge();be.defaults=Yi();be.version="3.10.1";be.loadAsync=function(e,t){return new be().loadAsync(e,t)};be.external=Ut();Lu.exports=be});import{createRequire as w_}from"module";function Gu(e,t){return R_(e,{i:2},t&&t.out,t&&t.dictionary)}var b_,ar,x_,E_,xe,ir,T_,ju,qu,S_,Wu=function(e,t){var r=new ir(31);for(var n=0;n<31;++n)r[n]=t+=1<<e[n-1];var i=new T_(r[30]);for(var n=1;n<30;++n)for(var a=r[n];a<r[n+1];++a)i[a]=a-r[n]<<5|n;return{b:r,r:i}},ar,$u,k_,Zu,A_,hx,rs,ze,F,Kr=function(e,t,r){var n=e.length,i=0,a=new ir(t);for(;i<n;++i)if(e[i])++a[e[i]-1];var s=new ir(t);for(i=1;i<t;++i)s[i]=s[i-1]+a[i-1]<<1;var o;if(r){o=new ir(1<<t);var h=15-t;for(i=0;i<n;++i)if(e[i]){var l=i<<4|e[i],c=t-e[i],p=s[e[i]-1]++<<c;for(var m=p|(1<<c)-1;p<=m;++p)o[rs[p]>>h]=l}}else{o=new ir(n);for(i=0;i<n;++i)if(e[i])o[i]=rs[s[e[i]-1]++]>>15-e[i]}return o},Yr,F,F,F,F,Hu,F,I_,C_,es=function(e){var t=e[0];for(var r=1;r<e.length;++r)if(e[r]>t)t=e[r];return t},Ae=function(e,t,r){var n=t/8|0;return(e[n]|e[n+1]<<8)>>(t&7)&r},ts=function(e,t){var r=t/8|0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>(t&7)},D_=function(e){return(e+7)/8|0},O_=function(e,t,r){if(t==null||t<0)t=0;if(r==null||r>e.length)r=e.length;return new xe(e.subarray(t,r))},P_,Je=function(e,t,r){var n=Error(t||P_[e]);if(n.code=e,Error.captureStackTrace)Error.captureStackTrace(n,Je);if(!r)throw n;return n},R_=function(e,t,r,n){var i=e.length,a=n?n.length:0;if(!i||t.f&&!t.l)return r||new xe(0);var s=!r,o=s||t.i!=2,h=t.i;if(s)r=new xe(i*3);var l=function(ln){var u=r.length;if(ln>u){var f=new xe(Math.max(u*2,ln));f.set(r),r=f}},c=t.f||0,p=t.p||0,m=t.b||0,{l:_,d:w,m:v,n:b}=t,S=i*8;do{if(!_){c=Ae(e,p,1);var T=Ae(e,p+1,3);if(p+=3,!T){var k=D_(p)+4,x=e[k-4]|e[k-3]<<8,A=k+x;if(A>i){if(h)Je(0);break}if(o)l(m+x);r.set(e.subarray(k,A),m),t.b=m+=x,t.p=p=A*8,t.f=c;continue}else if(T==1)_=I_,w=C_,v=9,b=5;else if(T==2){var O=Ae(e,p,31)+257,C=Ae(e,p+10,15)+4,D=O+Ae(e,p+5,31)+1;p+=14;var d=new xe(D),R=new xe(19);for(var E=0;E<C;++E)R[S_[E]]=Ae(e,p+E*3,7);p+=C*3;var B=es(R),G=(1<<B)-1,V=Kr(R,B,1);for(var E=0;E<D;){var Ie=V[Ae(e,p,G)];p+=Ie&15;var k=Ie>>4;if(k<16)d[E++]=k;else{var N=0,ne=0;if(k==16)ne=3+Ae(e,p,3),p+=2,N=d[E-1];else if(k==17)ne=3+Ae(e,p,7),p+=3;else if(k==18)ne=11+Ae(e,p,127),p+=7;while(ne--)d[E++]=N}}var ue=d.subarray(0,O),ee=d.subarray(O);v=es(ue),b=es(ee),_=Kr(ue,v,1),w=Kr(ee,b,1)}else Je(1);if(p>S){if(h)Je(0);break}}if(o)l(m+131072);var on=(1<<v)-1,U=(1<<b)-1,hr=p;for(;;hr=p){var N=_[ts(e,p)&on],Ce=N>>4;if(p+=N&15,p>S){if(h)Je(0);break}if(!N)Je(2);if(Ce<256)r[m++]=Ce;else if(Ce==256){hr=p,_=null;break}else{var Ct=Ce-254;if(Ce>264){var E=Ce-257,pe=ju[E];Ct=Ae(e,p,(1<<pe)-1)+$u[E],p+=pe}var ht=w[ts(e,p)&U],dr=ht>>4;if(!ht)Je(3);p+=ht&15;var ee=A_[dr];if(dr>3){var pe=qu[dr];ee+=ts(e,p)&(1<<pe)-1,p+=pe}if(p>S){if(h)Je(0);break}if(o)l(m+131072);var fn=m+Ct;if(m<ee){var pr=a-ee,gr=Math.min(ee,fn);if(pr+m<0)Je(3);for(;m<gr;++m)r[m]=n[pr+m]}for(;m<fn;++m)r[m]=r[m-ee]}}if(t.l=_,t.p=hr,t.b=m,t.f=c,_)c=1,t.m=v,t.d=w,t.n=b}while(!c);return m!=r.length&&s?O_(r,0,m):r.subarray(0,m)},N_,F_,M_=0;var Xu=pi(()=>{b_=w_("/");try{ar=b_("worker_threads"),x_=ar.Worker,E_=ar.isMarkedAsUntransferable}catch(e){}xe=Uint8Array,ir=Uint16Array,T_=Int32Array,ju=new xe([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,0,0,0]),qu=new xe([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,0,0]),S_=new xe([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ar=Wu(ju,2),$u=ar.b,k_=ar.r;$u[28]=258,k_[258]=28;Zu=Wu(qu,0),A_=Zu.b,hx=Zu.r,rs=new ir(32768);for(F=0;F<32768;++F)ze=(F&43690)>>1|(F&21845)<<1,ze=(ze&52428)>>2|(ze&13107)<<2,ze=(ze&61680)>>4|(ze&3855)<<4,rs[F]=((ze&65280)>>8|(ze&255)<<8)>>1;Yr=new xe(288);for(F=0;F<144;++F)Yr[F]=8;for(F=144;F<256;++F)Yr[F]=9;for(F=256;F<280;++F)Yr[F]=7;for(F=280;F<288;++F)Yr[F]=8;Hu=new xe(32);for(F=0;F<32;++F)Hu[F]=5;I_=Kr(Yr,9,1),C_=Kr(Hu,5,1),P_=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],N_=new xe(0);F_=typeof TextDecoder<"u"&&new TextDecoder;try{F_.decode(N_,{stream:!0}),M_=1}catch(e){}});import B_,{writeFileSync as z_,existsSync as L_,mkdirSync as U_,unlink as j_,readFileSync as q_}from"node:fs";import{Buffer as as}from"node:buffer";import ii from"node:crypto";function Qu(e,t,r){z_(e,t,r)}function W_(e,t){return q_(e)}function Vu(e){return L_(e)}function $_(e,t){return U_(e,t)}function Z_(e){j_(e,()=>{})}async function X_(e){let t=new ec(e);return await t.loadZip(),t}class ec{constructor(e){this.filePath=e,ns(this,"jsZip"),ns(this,"names"),ns(this,"pathToProcessors",{})}getNames(){return[...this.names.values()]}useDeprocessors(e){this.pathToProcessors={...this.pathToProcessors,...e}}async loadZip(){this.jsZip=await this.readZip(this.filePath),this.names=new Map(Object.keys(this.jsZip.files).map((e)=>[e.toLowerCase(),e]))}async readZip(e){return new Promise((t,r)=>{{let n=typeof e==="string"?new Uint8Array(B_.readFileSync(e)):e;new Ju.default().loadAsync(n).then((i)=>{t(i)})}})}async readFile(e){let t=await this.readResource(e);return new TextDecoder().decode(t)}async readResource(e){if(!this.hasFile(e))return console.warn(`${e} file was not exit in ${this.filePath}, return an empty uint8 array`),new Uint8Array;let t=this.getFileName(e),r=await this.jsZip.file(t).async("uint8array");if(this.pathToProcessors[t])for(let n of this.pathToProcessors[t])r=await n(r);return r}hasFile(e){return this.names.has(e.toLowerCase())}getFileName(e){return this.names.get(e.toLowerCase())}}function is(e){let t=new Set;for(let r of String(e).matchAll(/xmlns:([\w.-]+)\s*=\s*["']([^"']*)["']/g))if(J_.has(r[2].trim().replace(/\/+$/,"")))t.add(r[1]);return{tagNameProcessors:[(r)=>{let n=r.indexOf(":");return n>0&&t.has(r.slice(0,n))?r.slice(n+1):r}]}}function Q_(e){let t={};if(e.rsaPrivateKey)t.rsaPrivateKey=typeof e.rsaPrivateKey==="string"?Uint8Array.from(atob(e.rsaPrivateKey),(r)=>r.charCodeAt(0)):e.rsaPrivateKey;if(e.aesSymmetricKey)t.aesSymmetricKey=typeof e.aesSymmetricKey==="string"?Uint8Array.from(atob(e.aesSymmetricKey),(r)=>r.charCodeAt(0)):e.aesSymmetricKey;return t}function ey(e){let t=new Map;return(...r)=>{let n=JSON.stringify(r);if(t.has(n))return t.get(n);let i=e(...r);return t.set(n,i),i}}function ty(e){if(e.endsWith("s"))return Number.parseFloat(e);let t=e.split(":").map(Number);if(t.length===3){let[r,n,i]=t;return r*3600+n*60+i}else if(t.length===2){let[r,n]=t;return r*60+n}else return Number(e)}async function ry(e,t,r="sha256"){{let n=as.from(t,"base64"),i=ii.createPrivateKey({key:as.from(e),format:"der",type:"pkcs8"}),a=ii.privateDecrypt({key:i,padding:ii.constants.RSA_PKCS1_OAEP_PADDING,oaepHash:r},n);return new Uint8Array(a)}}async function Yu(e,t,r){{let n=e.endsWith("gcm"),i=n?12:16,a=n?16:0,s=r.slice(0,i),o=n?r.slice(r.length-a):void 0,h=r.slice(i,r.length-a),l=ii.createDecipheriv(e,t,s);if(n&&o)l.setAuthTag(o);let c=as.concat([l.update(h),l.final()]);return new Uint8Array(c)}}function ny(e){let t=e.trim().toLowerCase();if(t!=="application/epub+zip")throw Error("Unsupported mime type. The mimetype file must be the application/epub+zip");return t}function iy(e){let t=e.container;if(!t||!t.rootfiles||t.rootfiles.length===0)throw Error("No <rootfiles></rootfiles> tag found in meta-inf/container.xml");let r=t.rootfiles[0].rootfile[0];if(r.$["media-type"]!=="application/oebps-package+xml")throw Error("media-type of <rootfile/> application/oebps-package+xml");let i=r.$["full-path"];if(J.isAbsolutePosix(i))throw Error("full-path must be a relative path");return i}function ay(e){let t={title:"",language:"",identifier:{id:""},packageIdentifier:{id:""},metas:{}},r=new Map;for(let s in e){let o=e[s],h=s.split(":").pop();switch(h){case"title":case"language":case"description":case"publisher":case"type":case"format":case"source":case"relation":case"coverage":case"rights":{t[h]=o[0]._??o[0];break}case"date":{t.date={};for(let l of o){let c=l.$?.["opf:event"]??"publication";t.date[c]=l._??l}break}case"identifier":{for(let l of o){let c={id:l._,scheme:l.$?.["opf:scheme"]??""},p=l.$&&l.$.id;if(p)t.packageIdentifier=c,r.set(p,c);else t.identifier=c}break}case"subject":{t.subject=[];for(let l of o){let c=l.$,p={subject:l._??l,authority:c?.authority??"",term:c?.term??""};if(t.subject.push(p),l.$?.id)r.set(l.$.id,p)}break}case"creator":case"contributor":{t[h]=[];for(let l of o){let c=l.$,p={contributor:l._??l,fileAs:c?.["opf:file-as"]??"",role:c?.["opf:role"]??""};if(t[h].push(p),c?.id)r.set(c.id,p)}break}}}let n=e.meta??[];for(let s of n){let o=s.$;if(s._)if(o.refines){let h=o.refines.slice(1),l=r.get(h);if(!l){console.warn(`No element with id "${h}" found when parsing <metadata>`);continue}let c=hn(o.property);if("contributor"in l)l[c]||(l[c]=s._);else if("subject"in l)l[c]||(l[c]=s._);else if("id"in l)l[c]||(l[c]=s._),l.scheme=l.scheme||o.scheme}else{let h=o.property;t.metas[h]=s._}else{let h=o.name;t.metas[h]=o.content}}let i=e.link??[],a=[];for(let s of i){let o=s.$;if(!o.refines){let h={href:"",rel:""};for(let l in o)h[hn(l)]=o[l];a.push(h)}else{let h=o.refines.slice(1),l=r.get(h);if(!l){console.warn(`No element with id "${h}" found when parsing <metadata>`);continue}let c=hn(o.rel),p=o.href;l[c]=p}}return t.links=a,t}function sy(e,t){let r=e.item;if(!r)throw Error("The manifest element must contain one or more item elements");let n={},i=[];for(let a of r){let s=a.$,{id:o,href:h,"media-type":l,"media-overlay":c,properties:p}=s;if(!s||!o||!h||!l){console.warn("The item in manifest must have attributes id, href and mediaType. So skip this item.");continue}if(n[o]={id:o,href:J.joinPosix(t,h),mediaType:l,properties:p||"",mediaOverlay:c||""},s.fallback)n[o].fallback=[s.fallback],i.push(n[o])}for(let a of i){let s=new Set;s.add(a.id);let o=n[a.fallback[0]];while(o&&o.fallback){s.add(o.id);let h=o.fallback;if(h.length>1){a.fallback.push(...h);break}let l=h[0];if(s.has(l)){console.warn(`Cycle references have appeard when next item id is "${l}". Therefore stop parsing.`);break}a.fallback.push(l),o=n[l]}}return n}function oy(e,t){let r="";if(e.$?.toc)r=t[e.$.toc]?.href??"";let n=[],i=e.itemref;if(!i)throw Error("The spine element must contain one or more itemref elements");for(let a of i){let s=a.$;if(s.idref){let o=t[s.idref];if(!o)continue;n.push({...o,href:`epub:${o.href}`,linear:s.linear||"yes"})}}return{tocPath:r,spine:n}}function fy(e,t){let r=[],n=e.reference;if(!n)return r;for(let i of n){let a=i.$;if(a.href&&a.href.length>0)a.href=or+J.joinPosix(t,a.href);r.push(a)}return r}function ly(e,t){let r=[];for(let n of e){let i=n.$.role,a=[];for(let s of n.link)a.push(J.joinPosix(t,s.$.href));r.push({role:i,links:a})}return r}function uy(e,t,r){let n=[];return tc(n,e?.navPoint??[],t,r),n}function tc(e,t,r,n){for(let i of t){let a={label:"",href:"",id:"",playOrder:""};if(i.navLabel){let s=J.joinPosix(n,decodeURIComponent(i.content[0].$?.src)),o=s.split("#")[0];a={label:i.navLabel[0].text?.[0]??"",href:or+s,id:r[o],playOrder:i.$?.playOrder??""},e.push(a)}if(i.navPoint)a.children=[],tc(a.children,i.navPoint,r,n)}}function cy(e,t,r){let n="";if(e.navLabel)n=e.navLabel[0].text[0];let i=[];for(let a of e.pageTarget){let s=J.joinPosix(r,decodeURIComponent(a.content[0].$?.src)),o=s.split("#")[0],h=a.$,l={label:a.navLabel[0].text[0]||"",value:h.value||"",href:or+s,playOrder:h.playOrder||"",type:h.type||"",correspondId:t[o]};i.push(l)}return{label:n,pageTargets:i}}function hy(e,t,r){let n="";if(e.navLabel)n=e.navLabel[0].text[0];let i=[];for(let a of e.navTarget){let s=J.joinPosix(r,decodeURIComponent(a.content[0].$?.src)),o=s.split("#")[0],h={label:a.navLabel[0]?.text?.[0]||"",href:or+s,correspondId:t[o]};i.push(h)}return{label:n,navTargets:i}}async function dy(e,t){if(!e)return{};let r={};for(let n of e){let i=n.$.Id,a=n.EncryptionMethod[0],s=a.$.Algorithm.split("#")[1];if(!s.startsWith("rsa"))throw Error(`Unsupported encryption algorithm: ${s}. Only RSA and AES algorithms are supported.`);let o="sha1";if(s==="rsa-oaep")o=a.DigestMethod[0].$.Algorithm.split("#")[1];let h=n.CipherData[0].CipherValue[0].trim(),l=await ry(t,h,o);r[i]=l}return r}function py(e=[],t,r){let n={};for(let i of e){let a=i.EncryptionMethod[0].$.Algorithm.split("#")[1];if(!a.startsWith("aes")){console.warn(`Unsupported encryption algorithm: ${a}. Only AES and RSA algorithms are supported.`);continue}let s=a.replace("aes","aes-"),o=i.CipherData[0].CipherReference[0].$.URI;n[o]=[];let h=n[o],l=i.KeyInfo?.[0];if(l&&l.RetrievalMethod){let p=l.RetrievalMethod[0].$.URI.slice(1),m=t[p];if(!m)throw Error(`No symmetric key found for id "${p}". Skipping decryption for file "${o}".`);let _=async(w)=>await Yu(s,m,w);h.push(_)}else{let p=async(m)=>await Yu(s,r,m);h.push(p)}let c=i.EncryptionProperties?.[0].EncryptionProperty;if(c)for(let p of c){let m=p.Compression[0];if(m&&m.$.Method==="8")h.push(Gu)}n[o]=h}return n}function my(e){let t=e.EncryptionMethod?.[0]?.$?.Algorithm;return!gy.includes(t)}async function vy(e,t){let r=e.encryption,n=r.EncryptedKey,i=r.EncryptedData??[],a=i?.filter(my);if(i.length!==a.length){if(console.warn("lingo-reader doesn't handle font obfuscation and it doesn't read the font file."),a.length===0)return{}}if(n&&!t.rsaPrivateKey)throw Error("Please provide the RSA private key to decrypt the encrypted AES keys.");if(!n&&a&&!t.aesSymmetricKey)throw Error("The file is encrypted with AES, but no symmetric key is provided. ");let s=await dy(n,t.rsaPrivateKey);return py(a,s,t.aesSymmetricKey)}function sr(e,t,r){let n=J.joinPosix(t,e).replace(/\//g,"_");return J.resolve(r,n)}function _y(e,t,r){return e=e.replace(/<(img|video|audio|source)[^>]*>/g,(n)=>{let i=n.match(/src="([^"]*)"/)?.[1];if(i){let s=sr(i,t,r);n=n.replace(i,s)}let a=n.match(/poster="([^"]*)"/)?.[1];if(a){let s=sr(a,t,r);n=n.replace(a,s)}return n}),e=e.replace(/<image[^>]*>/g,(n)=>{let i=n.match(/href="([^"]*)"/)?.[1];if(i){let a=sr(i,t,r);n=n.replace(i,a)}return n}),e=e.replace(/<a[^>]*>/g,(n)=>{let i=n.match(/href="([^"]*)"/)?.[1];if(i&&!/^https?|mailto/.test(i)){let a=J.joinPosix(t,i);n=n.replace(i,or+decodeURIComponent(a))}return n}),e}function yy(e,t,r){let n=e.match(/<head[^>]*>([\s\S]*)<\/head>/i),i=[];if(n){let o=n[1].match(/<link[^>]*>/g);if(o)for(let h of o){let l=h.match(/href=["']([^"']*)["']/)?.[1];if(!l)continue;if(l.endsWith(".css")){let c=J.joinPosix(t,l),p=c.replace(/\//g,"_"),m=J.resolve(r,p),_;try{_=new TextDecoder().decode(W_(m))}catch{continue}_=_.replace(/url\(([^)]*)\)/g,(w,v)=>(v=v.replace(/['"]/g,""),`url(${sr(v.trim(),J.dirname(c),r)})`)),Qu(m,new TextEncoder().encode(_)),i.push({id:p,href:m})}}}let a=e.match(/<body[^>]*>(.*?)<\/body>/is),s=a?_y(a[1],t,r):"";return{css:i,html:s}}function rc(e,t,r,n){for(let i of e)if(i["#name"]==="par"){let a=i.text[0].$.src.split("#")[1],s=i.audio[0].$,o=sr(s.src,t,r),h=Ku(s.clipBegin),l=Ku(s.clipEnd);if(!n[o])n[o]={audioSrc:o,pars:[]};n[o].pars.push({textDOMId:a,clipBegin:h,clipEnd:l})}else rc(i.children,t,r,n)}function wy(e,t,r){let n={},i=e.smil.body[0].children;return rc(i,t,r,n),Object.values(n)}async function nc(e,t="./images",r={}){let n=new ic(e,t,r);return await n.loadEpub(),await n.parse(),n}class ic{constructor(e,t="./images",r={}){if(this.epub=e,this.options=r,ie(this,"fileName",""),ie(this,"mimeType",""),ie(this,"metadata"),ie(this,"manifest",{}),ie(this,"spine",[]),ie(this,"guide",[]),ie(this,"collections",[]),ie(this,"navMap",[]),ie(this,"pageList"),ie(this,"navList"),ie(this,"zip"),ie(this,"opfPath",""),ie(this,"opfDir",""),ie(this,"resourceSaveDir"),ie(this,"encryptionKeys",{}),ie(this,"savedResourcePath",[]),ie(this,"hrefToIdMap",{}),ie(this,"chapterCache",new Map),typeof e==="string")this.fileName=J.basename(e);else if(e instanceof Uint8Array)this.fileName="";else this.fileName=e.name;if(this.resourceSaveDir=t,!Vu(this.resourceSaveDir))$_(this.resourceSaveDir,{recursive:!0});this.encryptionKeys=Q_(this.options)}getFileInfo(){return{fileName:this.fileName,mimetype:this.mimeType}}getMetadata(){return this.metadata}getManifest(){return this.manifest}getSpine(){return this.spine}getGuide(){return this.guide}getCollection(){return this.collections}getToc(){return this.navMap}getPageList(){return this.pageList}getNavList(){return this.navList}async loadEpub(){this.zip=await X_(this.epub)}async parse(){let e=await this.zip.readFile("mimetype");this.mimeType=ny(e);let t=await this.zip.readFile("meta-inf/container.xml"),r=await Ot(t,is(t));if(this.opfPath=iy(r),this.opfDir=J.dirname(this.opfPath),this.zip.hasFile("meta-inf/encryption.xml")){let n=await this.zip.readFile("meta-inf/encryption.xml"),i=await Ot(n,{tagNameProcessors:[(s)=>s.replace(Y_,"")]}),a=await vy(i,this.encryptionKeys);this.zip.useDeprocessors(a)}await this.parseRootFile()}async parseRootFile(){let e=await this.zip.readFile(this.opfPath),r=(await Ot(e,is(e))).package,n="";if(r.metadata)this.metadata=ay(r.metadata[0]);if(r.manifest){this.manifest=sy(r.manifest[0],this.opfDir);for(let i in this.manifest){let a=this.manifest[i];if(this.hrefToIdMap[a.href]=a.id,K_.has(a.mediaType)||a.mediaType.startsWith("text/css")){let s=a.href.replace(/\//g,"_"),o=J.resolve(this.resourceSaveDir,s);this.savedResourcePath.push(o),Qu(o,await this.zip.readResource(a.href))}}}if(r.spine){let i=oy(r.spine[0],this.manifest);n=i.tocPath,this.spine=i.spine}if(r.guide)this.guide=fy(r.guide[0],this.opfDir);if(r.collection)this.collections=ly(r.collection,this.opfDir);if(n.length>0){let i=J.dirname(n),a=await this.zip.readFile(n),s=(await Ot(a,is(a))).ncx;if(s.navMap)this.navMap=uy(s.navMap[0],this.hrefToIdMap,i);if(s.pageList)this.pageList=cy(s.pageList[0],this.hrefToIdMap,i);if(s.navList)this.navList=hy(s.navList[0],this.hrefToIdMap,i)}}async loadChapter(e){if(this.chapterCache.has(e))return this.chapterCache.get(e);let t=this.manifest[e],r=t.href,n=J.dirname(r),i=yy(await this.zip.readFile(r),n,this.resourceSaveDir),a=t.mediaOverlay;if(a){let o=this.manifest[a].href,h=wy(await Ot(await this.zip.readFile(o),{preserveChildrenOrder:!0,explicitChildren:!0,childkey:"children"}),J.dirname(o),this.resourceSaveDir);i.mediaOverlays=h}return this.chapterCache.set(e,i),i}resolveHref(e){if(!e.startsWith(or))return;e=e.slice(5).trim();let[t,r]=e.split("#"),n="";if(this.hrefToIdMap[t])n=this.hrefToIdMap[t];else return;let i="";if(r)i=`[id="${r}"]`;return{id:n,selector:i}}getCoverImage(){let e=this.guide.find((t)=>t.type==="cover");if(e){let t=this.resolveHref(e.href).id,r=this.manifest[t];return sr(r.href,"",this.resourceSaveDir)}return""}destroy(){this.savedResourcePath.forEach((e)=>{if(Vu(e))Z_(e)}),this.savedResourcePath.length=0}}var Ju,H_,G_=(e,t,r)=>(t in e)?H_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ns=(e,t,r)=>G_(e,typeof t!=="symbol"?t+"":t,r),V_,K_,Y_,J_,Ku,or="epub:",gy,by,xy=(e,t,r)=>(t in e)?by(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ie=(e,t,r)=>xy(e,typeof t!=="symbol"?t+"":t,r);var ac=pi(()=>{As();Xu();Ju=bs(Uu(),1);H_=Object.defineProperty;V_={jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",bmp:"image/bmp",ico:"image/x-icon",tiff:"image/tiff",tif:"image/tiff",heic:"image/heic",avif:"image/avif",css:"text/css",mp4:"video/mp4",mkv:"video/mkv",webm:"video/webm",mp3:"audio/mp3",wav:"audio/wav",ogg:"audio/ogg",ttf:"font/ttf",otf:"font/otf",woff:"font/woff",woff2:"font/woff2",eot:"font/eot"},K_=new Set(Object.values(V_)),Y_=/(?!xmlns)^.*:/,J_=new Set(["http://www.idpf.org/2007/opf","http://www.daisy.org/z3986/2005/ncx","urn:oasis:names:tc:opendocument:xmlns:container"]);Ku=ey(ty);gy=["http://www.idpf.org/2008/embedding","http://ns.adobe.com/pdf/enc#RC"];by=Object.defineProperty});import{mkdir as Nw,writeFile as Fw}from"node:fs/promises";import{join as Hc}from"node:path";import Pw from"node:fs/promises";import{existsSync as sc,readdirSync as Ey,readFileSync as oc,statSync as Ty}from"node:fs";import*as At from"node:path";import{createHash as ih}from"node:crypto";import{inflateSync as ah}from"node:zlib";var sh=new Set(["image/png","image/jpeg","image/gif","image/webp"]),oh={"image/png":"png","image/jpeg":"jpg","image/gif":"gif","image/webp":"webp","image/bmp":"bmp","image/tiff":"tif","image/svg+xml":"svg","image/emf":"emf","image/wmf":"wmf","image/x-pict":"pict"};function fh(e){let t=(n,...i)=>i.every((a,s)=>e[n+s]===a);if(t(0,137,80,78,71))return"image/png";if(t(0,255,216,255))return"image/jpeg";if(t(0,71,73,70,56))return"image/gif";if(t(0,82,73,70,70)&&t(8,87,69,66,80))return"image/webp";if(t(0,66,77))return"image/bmp";if(t(0,73,73,42,0)||t(0,77,77,0,42))return"image/tiff";if(t(40,32,69,77,70))return"image/emf";if(t(0,215,205,198,154)||t(0,1,0,9,0))return"image/wmf";if(t(10,0,17,2,255))return"image/x-pict";let r=Buffer.from(e.subarray(0,256)).toString("utf8").trimStart();if(r.startsWith("<svg")||r.startsWith("<?xml")&&r.includes("<svg"))return"image/svg+xml";return}function lh(e){if(e[0]!==120||![1,94,156,218].includes(e[1]??0))return e;try{return new Uint8Array(ah(e))}catch{return e}}class gi{linkDir;byHash=new Map;names=new Set;pending=[];constructor(e="images"){this.linkDir=e}add(e){if(e.data.byteLength===0)return;let t=lh(e.data),r=ih("sha1").update(t).digest("hex"),n=this.byHash.get(r);if(n)return n;let i=fh(t)??e.mediaType??"application/octet-stream",a=oh[i]??"bin",s=this.uniqueName(uh(e.stem),a),o={file:s,link:`${this.linkDir}/${s}`,mediaType:i,bytes:t.byteLength,...e.width?{width:e.width}:{},...e.height?{height:e.height}:{},...e.source?{source:e.source}:{},...e.alt?.trim()?{alt:e.alt.trim()}:{},...sh.has(i)||i==="image/svg+xml"?{}:{notViewable:!0},sha1:r};return this.byHash.set(r,o),this.pending.push({image:o,data:t}),o}get images(){return this.pending.map((e)=>e.image)}entries(){return this.pending}uniqueName(e,t){let r=`${e}.${t}`;for(let n=2;this.names.has(r);n++)r=`${e}-${n}.${t}`;return this.names.add(r),r}}function uh(e){return e.replace(/\.[a-z0-9]{2,4}$/i,"").replace(/[^a-zA-Z0-9._-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,60)||"image"}function We(e){return`![${(e.alt??"").replace(/[[\]\n]/g," ").trim()}](${e.link})`}var Sy=/\.(png|jpe?g|gif|webp|bmp|svg|tiff?)$/i;function ky(e){if(e.length<90)return 0;let t=new DataView(e.buffer,e.byteOffset,e.byteLength),r=t.getUint32(78);if(r+14>e.length)return 0;return t.getUint16(r+12)}function Ay(e){let t=Buffer.from(e.buffer,e.byteOffset,e.byteLength);return t.includes("META-INF/rights.xml")||t.includes("META-INF/license.lcpl")}function Iy(e){let t=Buffer.from(e.buffer,e.byteOffset,e.byteLength);if(t.length<22||t.readUInt32LE(0)!==67324752)return"it does not start as a ZIP archive, which every EPUB is";let r=t.lastIndexOf(Buffer.from([80,75,5,6]),t.length-22);if(r<0||r<t.length-22-65535)return`it ends before its index (${t.length.toLocaleString("en-US")} bytes), so it was cut short when it was copied, downloaded or unpacked`;let n=t.readUInt32LE(r+12),i=t.readUInt32LE(r+16);if(i!==4294967295&&n!==4294967295&&i+n>r)return"its index points past the end of the file, so part of it is missing";return}var fc=120000;async function ai(e){let t;try{return await Promise.race([e,new Promise((r,n)=>{t=setTimeout(()=>n(Error(`The book could not be opened: the reader gave no answer in ${fc/1000}s, which is what it does with a damaged file. Check that the file is complete.`)),fc)})])}finally{clearTimeout(t)}}function lc(e,t=0,r=[]){for(let n of e){if(r.length>=200)break;let i=String(n.label??"").trim();if(i)r.push(`${" ".repeat(t)}${i}`);if(Array.isArray(n.children))lc(n.children,t+1,r)}return r}function si(e){if(typeof e==="string")return e.trim()||void 0;if(Array.isArray(e))for(let t of e){let r=si(typeof t==="object"&&t!==null?t.contributor??t.name:t);if(r)return r}if(typeof e==="object"&&e!==null){let t=e;return si(t.contributor??t.name??t.value)}return}async function Cy(e){let{default:t}=await import("turndown"),{gfm:r}=await import("@joplin/turndown-plugin-gfm"),n=new t({headingStyle:"atx",codeBlockStyle:"fenced",bulletListMarker:"-"});return n.use(r),n.remove(["script","style","head"]),n.addRule("image",{filter:"img",replacement:(i,a)=>{let s=a,o=s.getAttribute("src")??"";return e(o,s.getAttribute("alt")??"")??""}}),n.addRule("svgImage",{filter:(i)=>i.nodeName.toLowerCase()==="image",replacement:(i,a)=>{let s=a,o=s.getAttribute("xlink:href")??s.getAttribute("href")??"";return e(o,"")??""}}),n}async function uc(e,t,r,n){if((r==="mobi"||r==="azw3")&&ky(t)>1)throw Error("This Kindle book is DRM-protected. It can be read only in a Kindle app; nothing here can remove the protection.");if(r==="epub"&&Ay(t))throw Error("This EPUB is DRM-protected (Adobe ADEPT or Readium LCP). It can be read only in a reader app licensed for it.");if(r==="epub"){let p=Iy(t);if(p)throw Error(`This EPUB is damaged: ${p}. Nothing can be read from it; get the file again.`)}let i=n.scratchDir;await Promise.resolve().then(() => ac());let{initFb2File:s}=await import("@lingo-reader/fb2-parser"),{initKf8File:o,initMobiFile:h}=await import("@lingo-reader/mobi-parser"),l,c;if(r==="epub")l=await ai(nc(e,i)),c="lingo-reader (EPUB)";else if(r==="fb2")l=await ai(s(e,i)),c="lingo-reader (FB2)";else{let[p,m]=r==="azw3"?[o,h]:[h,o];try{l=await ai(p(e,i)),c=`lingo-reader (${p===o?"KF8":"MOBI"})`}catch{l=await ai(m(e,i)),c=`lingo-reader (${m===o?"KF8":"MOBI"})`}}try{let p=new Map,m=0,w=await Cy((O,C)=>{if(!n.wantImages||!O||/^(data:|https?:)/i.test(O))return;let D=O;try{D=decodeURI(O.replace(/^file:\/\//,""))}catch{}if(!At.isAbsolute(D)||!sc(D))return;if(!p.has(D))p.set(D,n.images.add({data:oc(D),stem:At.basename(D),source:`chapter ${m}`,...C?{alt:C}:{}}));let d=p.get(D);return d?We(d):void 0}),v=l.getSpine(),b=[],S=[];for(let O=0;O<v.length;O++){let C=O+1;if(n.selects&&!n.selects(C))continue;n.signal?.throwIfAborted(),m=C,n.onProgress?.({unit:"chapter",at:C,total:v.length,pictures:p.size}),b.push(C);let d=(await l.loadChapter(v[O].id))?.html??"",R=d?w.turndown(d).trim():"";if(R)S.push(R)}if(n.wantImages&&sc(i))for(let O of Ey(i,{recursive:!0})){let C=At.join(i,O);if(!Sy.test(O)||p.has(C)||!Ty(C).isFile())continue;p.set(C,n.images.add({data:oc(C),stem:At.basename(O)}))}let T=l.getMetadata()??{},k=si(T.title),x=si(T.creator??T.author),A=lc(l.getToc()??[]);return{markdown:S.join(`
13
+
14
+ `),reader:c,...k&&k!=="Unknown"?{title:k}:{},...x&&x!=="Unknown"?{author:x}:{},units:{name:"chapter",total:v.length,read:b},...A.length?{contents:A}:{}}}finally{l.destroy()}}import*as ss from"node:path";var Dy={pdf:"PDF",docx:"Word document (DOCX)",pptx:"PowerPoint presentation (PPTX)",xlsx:"Excel workbook (XLSX)",odt:"OpenDocument text (ODT)",odp:"OpenDocument presentation (ODP)",ods:"OpenDocument spreadsheet (ODS)",odg:"OpenDocument drawing (ODG)",rtf:"Rich Text (RTF)",csv:"CSV",html:"HTML",epub:"EPUB ebook",mobi:"Mobipocket / Kindle ebook (MOBI)",azw3:"Kindle KF8 ebook (AZW3)",fb2:"FictionBook (FB2)",doc:"Word 97-2003 document (DOC)",xls:"Excel 97-2003 workbook (XLS)",ppt:"PowerPoint 97-2003 presentation (PPT)"},cc={".pdf":"pdf",".docx":"docx",".docm":"docx",".dotx":"docx",".pptx":"pptx",".pptm":"pptx",".ppsx":"pptx",".xlsx":"xlsx",".xlsm":"xlsx",".odt":"odt",".odp":"odp",".ods":"ods",".odg":"odg",".rtf":"rtf",".csv":"csv",".html":"html",".htm":"html",".xhtml":"html",".epub":"epub",".mobi":"mobi",".prc":"mobi",".azw":"mobi",".azw3":"azw3",".kf8":"azw3",".fb2":"fb2",".doc":"doc",".dot":"doc",".xls":"xls",".ppt":"ppt",".pps":"ppt"},Oy={".djvu":"DjVu has no JavaScript reader.",".djv":"DjVu has no JavaScript reader.",".chm":"Compiled HTML Help (CHM) has no JavaScript reader.",".lit":"Microsoft Reader (LIT) has no JavaScript reader.",".lrf":"Sony BBeB (LRF) has no JavaScript reader.",".kfx":"KFX is Amazon's DRM-bound format and cannot be read.",".pages":"Apple Pages files have no JavaScript reader; export them as DOCX or PDF.",".key":"Apple Keynote files have no JavaScript reader; export them as PPTX or PDF.",".numbers":"Apple Numbers files have no JavaScript reader; export them as XLSX or CSV.",".xlsb":"Binary Excel workbooks (XLSB) are not read; save the workbook as XLSX.",".wps":"Microsoft Works documents are not read; save them as DOCX.",".cbz":"Comic archives are not read yet.",".cbr":"Comic archives are not read yet."},Ex=Object.keys(cc);function hc(e,t){let r=ss.extname(e).toLowerCase(),n=Oy[r];if(n)return{unsupported:n};let i=Buffer.from(t.subarray(0,512)).toString("latin1"),a=cc[r];if(i.startsWith("%PDF"))return{format:"pdf"};if(i.startsWith("{\\rtf"))return{format:"rtf"};if(i.slice(60,68)==="BOOKMOBI")return{format:a==="azw3"?"azw3":"mobi"};let s=i.startsWith("PK\x03\x04"),o=i.startsWith("ÐÏ\x11ࡱ\x1Aá");if(s){if(i.includes("mimetypeapplication/epub+zip"))return{format:"epub"};let h=/mimetypeapplication\/vnd\.oasis\.opendocument\.(text|presentation|spreadsheet|graphics)/.exec(i);if(h)return{format:{text:"odt",presentation:"odp",spreadsheet:"ods",graphics:"odg"}[h[1]]};if(a&&["docx","pptx","xlsx","epub","odt","odp","ods","odg"].includes(a))return{format:a};if(a==="doc")return{format:"docx"};if(a==="xls")return{format:"xlsx"};if(a==="ppt")return{format:"pptx"}}if(o){if(a==="doc"||a==="xls"||a==="ppt")return{format:a};if(a==="docx")return{format:"doc"};if(a==="xlsx")return{format:"xls"};if(a==="pptx")return{format:"ppt"};return{unsupported:"This is an OLE compound file, but its extension does not say which Office program wrote it; rename it to .doc, .xls or .ppt."}}if(a==="fb2"||/<FictionBook[\s>]/.test(i))return{format:"fb2"};if(a==="html"||a==="csv")return{format:a};if(a)return{unsupported:`The file is named as ${Dy[a]} but its contents are not; it may be damaged or a different format.`};return{unsupported:`No reader for ${r||"files without an extension"}. Readable: PDF, DOCX/DOC, PPTX/PPT, XLSX/XLS, ODT/ODP/ODS/ODG, RTF, CSV, HTML, EPUB, MOBI/AZW/AZW3, FB2.`}}import{existsSync as vc,readFileSync as Uy}from"node:fs";import{dirname as bc,join as _c}from"node:path";import{fileURLToPath as jy}from"node:url";class nn{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,dc.unregister(this),e}free(){let e=this.__destroy_into_raw();P.__wbg_wasmdocument_free(e,0)}formatName(){let e,t;try{let i=P.__wbindgen_add_to_stack_pointer(-16);P.wasmdocument_formatName(i,this.__wbg_ptr);var r=q().getInt32(i+0,!0),n=q().getInt32(i+4,!0);return e=r,t=n,ct(r,n)}finally{P.__wbindgen_add_to_stack_pointer(16),P.__wbindgen_export3(e,t,1)}}constructor(e,t){try{let a=P.__wbindgen_add_to_stack_pointer(-16),s=gc(e,P.__wbindgen_export),o=Ue,h=tn(t,P.__wbindgen_export,P.__wbindgen_export2),l=Ue;P.wasmdocument_new(a,s,o,h,l);var r=q().getInt32(a+0,!0),n=q().getInt32(a+4,!0),i=q().getInt32(a+8,!0);if(i)throw Le(n);return this.__wbg_ptr=r,dc.register(this,this.__wbg_ptr,this),this}finally{P.__wbindgen_add_to_stack_pointer(16)}}plainText(){let e,t;try{let i=P.__wbindgen_add_to_stack_pointer(-16);P.wasmdocument_plainText(i,this.__wbg_ptr);var r=q().getInt32(i+0,!0),n=q().getInt32(i+4,!0);return e=r,t=n,ct(r,n)}finally{P.__wbindgen_add_to_stack_pointer(16),P.__wbindgen_export3(e,t,1)}}toHtml(){let e,t;try{let i=P.__wbindgen_add_to_stack_pointer(-16);P.wasmdocument_toHtml(i,this.__wbg_ptr);var r=q().getInt32(i+0,!0),n=q().getInt32(i+4,!0);return e=r,t=n,ct(r,n)}finally{P.__wbindgen_add_to_stack_pointer(16),P.__wbindgen_export3(e,t,1)}}toIr(){try{let n=P.__wbindgen_add_to_stack_pointer(-16);P.wasmdocument_toIr(n,this.__wbg_ptr);var e=q().getInt32(n+0,!0),t=q().getInt32(n+4,!0),r=q().getInt32(n+8,!0);if(r)throw Le(t);return Le(e)}finally{P.__wbindgen_add_to_stack_pointer(16)}}toMarkdownWithImages(){let e,t;try{let i=P.__wbindgen_add_to_stack_pointer(-16);P.wasmdocument_toMarkdownWithImages(i,this.__wbg_ptr);var r=q().getInt32(i+0,!0),n=q().getInt32(i+4,!0);return e=r,t=n,ct(r,n)}finally{P.__wbindgen_add_to_stack_pointer(16),P.__wbindgen_export3(e,t,1)}}toMarkdown(){let e,t;try{let i=P.__wbindgen_add_to_stack_pointer(-16);P.wasmdocument_toMarkdown(i,this.__wbg_ptr);var r=q().getInt32(i+0,!0),n=q().getInt32(i+4,!0);return e=r,t=n,ct(r,n)}finally{P.__wbindgen_add_to_stack_pointer(16),P.__wbindgen_export3(e,t,1)}}}if(Symbol.dispose)nn.prototype[Symbol.dispose]=nn.prototype.free;class fs{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,pc.unregister(this),e}free(){let e=this.__destroy_into_raw();P.__wbg_wasmeditabledocument_free(e,0)}constructor(e,t){try{let a=P.__wbindgen_add_to_stack_pointer(-16),s=gc(e,P.__wbindgen_export),o=Ue,h=tn(t,P.__wbindgen_export,P.__wbindgen_export2),l=Ue;P.wasmeditabledocument_new(a,s,o,h,l);var r=q().getInt32(a+0,!0),n=q().getInt32(a+4,!0),i=q().getInt32(a+8,!0);if(i)throw Le(n);return this.__wbg_ptr=r,pc.register(this,this.__wbg_ptr,this),this}finally{P.__wbindgen_add_to_stack_pointer(16)}}replaceText(e,t){try{let a=P.__wbindgen_add_to_stack_pointer(-16),s=tn(e,P.__wbindgen_export,P.__wbindgen_export2),o=Ue,h=tn(t,P.__wbindgen_export,P.__wbindgen_export2),l=Ue;P.wasmeditabledocument_replaceText(a,this.__wbg_ptr,s,o,h,l);var r=q().getInt32(a+0,!0),n=q().getInt32(a+4,!0),i=q().getInt32(a+8,!0);if(i)throw Le(n);return r>>>0}finally{P.__wbindgen_add_to_stack_pointer(16)}}toBytes(){try{let a=P.__wbindgen_add_to_stack_pointer(-16);P.wasmeditabledocument_toBytes(a,this.__wbg_ptr);var e=q().getInt32(a+0,!0),t=q().getInt32(a+4,!0),r=q().getInt32(a+8,!0),n=q().getInt32(a+12,!0);if(n)throw Le(r);var i=Ny(e,t).slice();return P.__wbindgen_export3(e,t*1,1),i}finally{P.__wbindgen_add_to_stack_pointer(16)}}}if(Symbol.dispose)fs.prototype[Symbol.dispose]=fs.prototype.free;function Py(){return{__proto__:null,"./office_oxide_bg.js":{__proto__:null,__wbg_Error_67e7344beaa85059:function(t,r){let n=Error(ct(t,r));return ut(n)},__wbg_String_8564e559799eccda:function(t,r){let n=String(Qr(r)),i=tn(n,P.__wbindgen_export,P.__wbindgen_export2),a=Ue;q().setInt32(t+4,a,!0),q().setInt32(t+0,i,!0)},__wbg___wbindgen_throw_5d9e815e6fdf150f:function(t,r){throw Error(ct(t,r))},__wbg_new_bebc3f4757acf305:function(){return ut({})},__wbg_new_ffa92086ea89f79c:function(){return ut([])},__wbg_set_13d25b81ab403f5e:function(t,r,n){Qr(t)[r>>>0]=Le(n)},__wbg_set_6be42768c690e380:function(t,r,n){Qr(t)[Le(r)]=Le(n)},__wbindgen_generic_0000000000000001:function(t){return ut(t)},__wbindgen_generic_0000000000000002:function(t){return ut(t)},__wbindgen_generic_0000000000000003:function(t,r){let n=ct(t,r);return ut(n)},__wbindgen_generic_0000000000000004:function(t){let r=BigInt.asUintN(64,t);return ut(r)},__wbindgen_object_clone_ref:function(t){let r=Qr(t);return ut(r)},__wbindgen_object_drop_ref:function(t){Le(t)}}}}var dc=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e)=>P.__wbg_wasmdocument_free(e,1)),pc=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e)=>P.__wbg_wasmeditabledocument_free(e,1));function ut(e){if(en===Qe.length)Qe.push(Qe.length+1);let t=en;return en=Qe[t],Qe[t]=e,t}function Ry(e){if(e<1028)return;Qe[e]=en,en=e}function Ny(e,t){return e=e>>>0,fr().subarray(e/1,e/1+t)}var It=null;function q(){if(It===null||It.buffer.detached===!0||It.buffer.detached===void 0&&It.buffer!==P.memory.buffer)It=new DataView(P.memory.buffer);return It}function ct(e,t){return My(e>>>0,t)}var Jr=null;function fr(){if(Jr===null||Jr.byteLength===0)Jr=new Uint8Array(P.memory.buffer);return Jr}function Qr(e){return Qe[e]}var Qe=Array(1024).fill(void 0);Qe.push(void 0,null,!0,!1);var en=Qe.length;function gc(e,t){let r=t(e.length*1,1)>>>0;return fr().set(e,r/1),Ue=e.length,r}function tn(e,t,r){if(r===void 0){let o=rn.encode(e),h=t(o.length,1)>>>0;return fr().subarray(h,h+o.length).set(o),Ue=o.length,h}let n=e.length,i=t(n,1)>>>0,a=fr(),s=0;for(;s<n;s++){let o=e.charCodeAt(s);if(o>127)break;a[i+s]=o}if(s!==n){if(s!==0)e=e.slice(s);i=r(i,n,n=s+e.length*3,1)>>>0;let o=fr().subarray(i+s,i+n),h=rn.encodeInto(e,o);s+=h.written,i=r(i,n,s,1)>>>0}return Ue=s,i}function Le(e){let t=Qr(e);return Ry(e),t}var oi=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});oi.decode();var Fy=2146435072,os=0;function My(e,t){if(os+=t,os>=Fy)oi=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),oi.decode(),os=t;return oi.decode(fr().subarray(e,e+t))}var rn=new TextEncoder;if(!("encodeInto"in rn))rn.encodeInto=function(e,t){let r=rn.encode(e);return t.set(r),{read:e.length,written:r.length}};var Ue=0,By,zy,P;function Ly(e,t){return zy=e,P=e.exports,By=t,It=null,Jr=null,P}function mc(e){if(P!==void 0)return P;if(e!==void 0)if(Object.getPrototypeOf(e)===Object.prototype)({module:e}=e);else console.warn("using deprecated parameters for `initSync()`; pass a single object instead");let t=Py();if(!(e instanceof WebAssembly.Module))e=new WebAssembly.Module(e);let r=new WebAssembly.Instance(e,t);return Ly(r,e)}var yc="office_oxide_bg.wasm",wc=!1;function qy(e=Wy()){let t=_c(e,"office-oxide",yc);if(vc(t))return t;let r=e;for(let n=0;n<7;n++){let i=_c(r,"assets","office-oxide",yc);if(vc(i))return i;let a=bc(r);if(a===r)break;r=a}return}function Wy(){try{return bc(jy(import.meta.url))}catch{return"."}}function xc(e,t){if(!wc){let r=qy();if(!r)throw Error("The reader for Word, Excel and PowerPoint 97-2003 files is missing from this installation (office_oxide_bg.wasm was not found).");mc({module:Uy(r)}),wc=!0}return new nn(e,t)}var $y=/\[image-base64:([A-Za-z0-9+/=\s]+)\]/g;function Zy(e){return e.replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g,"")}function Hy(e,t){let r=new DataView(e.buffer,e.byteOffset,e.byteLength),n=t+8;while(n+12<=e.length){let i=r.getUint32(n),a=String.fromCharCode(...e.subarray(n+4,n+8));if(n+=12+i,a==="IEND")return n-t;if(i>e.length)return}return}function Gy(e,t){let r=t+2;while(r+4<=e.length){if(e[r]!==255)return;let n=e[r+1];if(n===217)return r+2-t;if(n===218){r+=2+(e[r+2]<<8|e[r+3]);while(r+1<e.length){if(e[r]===255){let i=e[r+1];if(i===217)return r+2-t;if(i!==0&&(i<208||i>215))break}r++}continue}r+=2+(e[r+2]<<8|e[r+3])}return}async function Xy(e){let t=await import("cfb"),r=t.default??t,n;try{n=r.read(Buffer.from(e),{type:"buffer"})}catch{return[]}let i=[];for(let a of n.FileIndex){let s=a.content;if(a.type!==2||!s||s.length<64)continue;let o=s instanceof Uint8Array?s:new Uint8Array(s);for(let h=0;h+8<o.length;h++){let l;if(o[h]===137&&o[h+1]===80&&o[h+2]===78&&o[h+3]===71)l=Hy(o,h);else if(o[h]===255&&o[h+1]===216&&o[h+2]===255)l=Gy(o,h);if(l&&l>64&&h+l<=o.length)i.push(o.slice(h,h+l)),h+=l-1}}return i}async function Ec(e,t,r){let n=xc(e,t),i;try{i=n.toMarkdownWithImages()}finally{n.free()}let a=0;i=i.replace($y,(o,h)=>{if(!r.wantImages)return"";a++;let l=r.images.add({data:Buffer.from(h.replace(/\s/g,""),"base64"),stem:`${t}-image-${a}`});return l?We(l):""}),i=Zy(i).replace(/\n{3,}/g,`
15
+
16
+ `).trim();let s=[];if(r.wantImages&&t==="doc"){let o=[];for(let h of await Xy(e)){let l=r.images.images.length;a++;let c=r.images.add({data:h,stem:`${t}-image-${a}`});if(c&&r.images.images.length>l)o.push(We(c))}if(o.length)i+=`
17
17
 
18
18
  ## Pictures not placed in the text
19
19
 
20
- ${X.join(`
20
+ ${o.join(`
21
21
 
22
- `)}`,K.push(`${X.length} picture(s) were found in the file but not at a place in its text; they are listed at the end.`)}return{markdown:q,reader:"office_oxide",...K.length?{notes:K}:{}}}var rU={maxUncompressedBytes:268435456,maxZipEntries:20000},aU={pptx:{node:"slide",unit:"slide"},odp:{node:"slide",unit:"slide"},xlsx:{node:"sheet",unit:"sheet"},ods:{node:"sheet",unit:"sheet"}};async function sU(){let Q=await import("officeparser");return Q.OfficeParser??Q.default}function tU(Q,J){let Y=Q?.message??"";if(!/password|encrypt/i.test(Y))return;return Error(J?"The document's password is not the one given in `password`.":"The document is password-protected. Ask the user for the password and call again with `password`.")}function eU(Q){return Q.replace(/^\s*---\n[\s\S]*?\n---\n/,"").trim()}async function zK(Q,J,Y){let $=await sU(),q;try{q=await $.parseOffice(Buffer.from(Q),{fileType:J,extractAttachments:Y.wantImages,decompressionLimits:rU,...Y.password?{password:Y.password}:{}})}catch(P){throw tU(P,Y.password)??P}let V=aU[J],K;if(V){let P=q.content.filter((j)=>j.type===V.node),z=[],N=new Set;P.forEach((j,C)=>{if(!Y.selects||Y.selects(C+1))z.push(C+1),N.add(j)}),q.content=q.content.filter((j)=>j.type!==V.node||N.has(j)),K={name:V.unit,total:P.length,read:z}}let X=new Map,Z=(P,z)=>{if(X.has(P))return X.get(P);let N=q.attachments?.find((C)=>C.name===P),j=N?Y.images.add({data:Buffer.from(N.data,"base64"),stem:P,mediaType:N.mimeType,...z?{alt:z}:{}}):void 0;return X.set(P,j),j},H=await q.to("md",{mdConfig:{dialect:"github",fallbackToHtml:{textFormatting:!1,alignment:!1,anchors:!1,tables:!0,embeds:!1,cellLineBreaks:!0}},onNode:(P)=>{if(P.type!=="image")return;if(!Y.wantImages)return!1;let z=P.metadata??{},N=z.attachmentName?Z(z.attachmentName,z.altText):void 0;return N?c0(N):!1}}),U=eU(String(H.value??""));if(J==="rtf")U=U.replace(/^[ ]*\t[ \t]*(?![-*+] |\d+[.)] )/gm,"");if(Y.wantImages){for(let P of q.attachments??[])if(P.type==="image")Z(P.name)}let B=q.metadata??{};return{markdown:U,reader:"officeparser",...B.title?.trim()?{title:B.title.trim()}:{},...B.author?.trim()?{author:B.author.trim()}:{},...K?{units:K}:{}}}import{existsSync as X$}from"node:fs";import{createRequire as QZ}from"node:module";import{dirname as FK,join as K8}from"node:path";import{fileURLToPath as JZ}from"node:url";function G$(){try{return FK(JZ(import.meta.url))}catch{return"."}}function YZ(Q){try{let J=QZ(K8(G$(),"noop.js"));return FK(J.resolve(`${Q}/package.json`))}catch{return}}function H$(Q,J,Y,$){let q=K8(G$(),Q);if(X$(K8(q,$)))return q;let V=YZ(J),K=V?K8(V,Y):void 0;return K&&X$(K8(K,$))?K:void 0}function NK(){return H$("pdfjs/wasm","pdfjs-dist","wasm","jbig2.wasm")}function CK(){return H$("pdfjs/cmaps","pdfjs-dist","cmaps","UniJIS-UCS2-H.bcmap")}function RK(){let Q=K8(G$(),"tesseract","worker.cjs");return X$(Q)?Q:void 0}function IK(){return H$("tessdata","@tesseract.js-data/eng","4.0.0_best_int","eng.traineddata.gz")}var qJ;function AK(){return qJ??=(async()=>{qZ();let Q=globalThis;if(!Q.pdfjsWorker)Q.pdfjsWorker=await import("pdfjs-dist/legacy/build/pdf.worker.mjs");return await $Z(()=>import("pdfjs-dist/legacy/build/pdf.mjs"))})(),qJ.catch(()=>{qJ=void 0}),qJ}async function $Z(Q){let J=console.warn;console.warn=(...Y)=>{let $=String(Y[0]??"");if(/^Warning: Cannot (load "@napi-rs\/canvas"|polyfill `(Path2D|DOMMatrix|ImageData)`)/.test($))return;J(...Y)};try{return await Q()}finally{console.warn=J}}function qZ(){let Q=globalThis;if(Q.DOMMatrix)return;class J{a=1;b=0;c=0;d=1;e=0;f=0;constructor(Y){if(Y&&Y.length>=6)[this.a,this.b,this.c,this.d,this.e,this.f]=Array.from(Y).slice(0,6)}set(Y){return[this.a,this.b,this.c,this.d,this.e,this.f]=Y,this}product(Y,$){return[Y.a*$.a+Y.c*$.b,Y.b*$.a+Y.d*$.b,Y.a*$.c+Y.c*$.d,Y.b*$.c+Y.d*$.d,Y.a*$.e+Y.c*$.f+Y.e,Y.b*$.e+Y.d*$.f+Y.f]}multiplySelf(Y=new J){let $=Y instanceof J?Y:new J(Y);return this.set(this.product(this,$))}preMultiplySelf(Y=new J){let $=Y instanceof J?Y:new J(Y);return this.set(this.product($,this))}multiply(Y){return new J(this.toArray()).multiplySelf(Y)}translateSelf(Y=0,$=0){return this.multiplySelf([1,0,0,1,Y,$])}translate(Y=0,$=0){return new J(this.toArray()).translateSelf(Y,$)}scaleSelf(Y=1,$=Y){return this.multiplySelf([Y,0,0,$,0,0])}scale(Y=1,$=Y){return new J(this.toArray()).scaleSelf(Y,$)}invertSelf(){let Y=this.a*this.d-this.b*this.c;if(!Y)return this.set([Number.NaN,Number.NaN,Number.NaN,Number.NaN,Number.NaN,Number.NaN]);return this.set([this.d/Y,-this.b/Y,-this.c/Y,this.a/Y,(this.c*this.f-this.d*this.e)/Y,(this.b*this.e-this.a*this.f)/Y])}inverse(){return new J(this.toArray()).invertSelf()}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}}Q.DOMMatrix=J}function MK(Q){return Q?`${Q.replace(/[\\/]+$/,"")}/`:void 0}function TK(){let Q=MK(NK()),J=MK(CK());return{disableFontFace:!0,useSystemFonts:!1,isEvalSupported:!1,verbosity:0,...Q?{wasmUrl:Q}:{},...J?{cMapUrl:J,cMapPacked:!0}:{}}}var VZ=100,KZ=0.5,XZ=200,DK=4,GZ=0.1,HZ=1,WZ=2,UZ=3;function ZZ(Q,J){let[Y=1,$=0,q=0,V=1,K=0,X=0]=J;return[Q[0]*Y+Q[2]*$,Q[1]*Y+Q[3]*$,Q[0]*q+Q[2]*V,Q[1]*q+Q[3]*V,Q[0]*K+Q[2]*X+Q[4],Q[1]*K+Q[3]*X+Q[5]]}async function LZ(Q,J){let[Y,$,q,V]=Q.view,K=Math.abs((q-Y)*(V-$))||1,X=await Q.getOperatorList(),Z=[1,0,0,1,0,0],H=[],U=0,B=!1,P=0,z=[];for(let N=0;N<X.fnArray.length;N++){let j=X.fnArray[N],C=X.argsArray[N],A=()=>Math.abs(Z[0]*Z[3]-Z[1]*Z[2]);if(j===J.save)H.push(Z);else if(j===J.restore)Z=H.pop()??Z;else if(j===J.transform)Z=ZZ(Z,C);else if(j===J.setTextRenderingMode){if(C[0]===3)B=!0}else if(j===J.paintImageXObject||j===J.paintImageXObjectRepeat){if(U+=A(),typeof C[0]==="string")z.push({key:C[0],area:A()/K})}else if(j===J.paintInlineImageXObject)U+=A(),z.push({image:C[0],mask:!1,area:A()/K});else if(j===J.paintImageMaskXObject)U+=A(),z.push({image:C[0],mask:!0,area:A()/K});else if(j===J.constructPath)P++}return{coverage:Math.min(1,U/K),invisibleText:B,pathOps:P,pageArea:K,draws:z}}function EK(Q){let J=Q.replace(/\s/g,"");if(J.length<20)return!1;return(J.match(/[-�\u0000-\u0008]/g)?.length??0)/J.length>0.3}var wK=20000,vK=60000,VJ=new Set,JQ;function BZ(Q){if(VJ.add(Q),!JQ){let J=console.log;JQ=J,console.log=(...Y)=>{let $=typeof Y[0]==="string"?Y[0]:"";if($.startsWith("Warning: ")){for(let q of VJ)q($.slice(9));return}J(...Y)}}return()=>{if(VJ.delete(Q),VJ.size===0&&JQ)console.log=JQ,JQ=void 0}}function xK(Q,J,Y){let $=J.startsWith("g_")?Q.commonObjs:Q.objs;return new Promise((q)=>{let V=setTimeout(()=>q("no answer"),Y),K=(X)=>{clearTimeout(V),q(X)};try{$.get(J,(X)=>K(X??null))}catch{K(null)}})}function OZ(Q,J,Y){let{width:$,height:q,data:V}=J;if(!V||!$||!q)return;if(Y||J.kind===HZ){let Z=$+7>>3;if(V.length<Z*q)return;let H=new Uint8Array($*q);for(let U=0;U<q;U++){let B=U*Z;for(let P=0;P<$;P++)H[U*$+P]=(V[B+(P>>3)]??0)>>7-(P&7)&1?255:0}return Q({width:$,height:q,data:H,channels:1,depth:8})}let X=J.kind===WZ?3:J.kind===UZ?4:V.length/($*q);if(X!==1&&X!==3&&X!==4)return;return Q({width:$,height:q,data:new Uint8Array(V.buffer,V.byteOffset,$*q*X),channels:X,depth:8})}function PZ(Q,J){let Y=Q?.name,$=Q?.message??"";if(Y!=="PasswordException"&&!/password/i.test($))return;return Error(J?"The PDF's password is not the one given in `password`.":"The PDF is password-protected. Ask the user for the password and call again with `password`.")}async function SK(Q,J){let Y=await AK(),{encode:$}=await import("fast-png"),q=new Set,V=J.onNote?BZ((Z)=>{if(q.size>=60||q.has(Z))return;q.add(Z),J.onNote?.(`pdf.js: ${Z}`)}):void 0,K=Y.getDocument({...TK(),...J.onNote?{verbosity:1}:{},data:Q.slice(),...J.password?{password:J.password}:{}}),X;try{X=await K.promise}catch(Z){throw await K.destroy().catch(()=>{}),V?.(),PZ(Z,J.password)??Z}try{return await jZ(X,Y.OPS,$,J)}finally{await K.destroy().catch(()=>{}),V?.()}}async function jZ(Q,J,Y,$){let V=(await Q.getMetadata().catch(()=>{return}))?.info??{},K=Q.numPages,X=[],Z=[],H=[],U=[],B=[],P=[],z=0,N=(j,C)=>$.onProgress?.({unit:"page",at:j,total:K,pictures:z,...C?{activity:C}:{}});for(let j=1;j<=K;j++){if($.selects&&!$.selects(j))continue;$.signal?.throwIfAborted(),N(j),X.push(j),N(j,"opening the page");let C=await Q.getPage(j);N(j,"reading its text");let A=await C.getTextContent(),M="";for(let I of A.items){if(typeof I.str!=="string")continue;if(M+=I.str,I.hasEOL)M+=`
23
- `}M=M.replace(/[ \t]+\n/g,`
22
+ `)}`,s.push(`${o.length} picture(s) were found in the file but not at a place in its text; they are listed at the end.`)}return{markdown:i,reader:"office_oxide",...s.length?{notes:s}:{}}}var Vy={maxUncompressedBytes:268435456,maxZipEntries:20000},Ky={pptx:{node:"slide",unit:"slide"},odp:{node:"slide",unit:"slide"},xlsx:{node:"sheet",unit:"sheet"},ods:{node:"sheet",unit:"sheet"}};async function Yy(){let e=await import("officeparser");return e.OfficeParser??e.default}function Jy(e,t){let r=e?.message??"";if(!/password|encrypt/i.test(r))return;return Error(t?"The document's password is not the one given in `password`.":"The document is password-protected. Ask the user for the password and call again with `password`.")}function Qy(e){return e.replace(/^\s*---\n[\s\S]*?\n---\n/,"").trim()}async function Tc(e,t,r){let n=await Yy(),i;try{i=await n.parseOffice(Buffer.from(e),{fileType:t,extractAttachments:r.wantImages,decompressionLimits:Vy,...r.password?{password:r.password}:{}})}catch(m){throw Jy(m,r.password)??m}let a=Ky[t],s;if(a){let m=i.content.filter((v)=>v.type===a.node),_=[],w=new Set;m.forEach((v,b)=>{if(!r.selects||r.selects(b+1))_.push(b+1),w.add(v)}),i.content=i.content.filter((v)=>v.type!==a.node||w.has(v)),s={name:a.unit,total:m.length,read:_}}let o=new Map,h=(m,_)=>{if(o.has(m))return o.get(m);let w=i.attachments?.find((b)=>b.name===m),v=w?r.images.add({data:Buffer.from(w.data,"base64"),stem:m,mediaType:w.mimeType,..._?{alt:_}:{}}):void 0;return o.set(m,v),v},l=await i.to("md",{mdConfig:{dialect:"github",fallbackToHtml:{textFormatting:!1,alignment:!1,anchors:!1,tables:!0,embeds:!1,cellLineBreaks:!0}},onNode:(m)=>{if(m.type!=="image")return;if(!r.wantImages)return!1;let _=m.metadata??{},w=_.attachmentName?h(_.attachmentName,_.altText):void 0;return w?We(w):!1}}),c=Qy(String(l.value??""));if(t==="rtf")c=c.replace(/^[ ]*\t[ \t]*(?![-*+] |\d+[.)] )/gm,"");if(r.wantImages){for(let m of i.attachments??[])if(m.type==="image")h(m.name)}let p=i.metadata??{};return{markdown:c,reader:"officeparser",...p.title?.trim()?{title:p.title.trim()}:{},...p.author?.trim()?{author:p.author.trim()}:{},...s?{units:s}:{}}}import{existsSync as ls}from"node:fs";import{createRequire as ew}from"node:module";import{dirname as Sc,join as lr}from"node:path";import{fileURLToPath as tw}from"node:url";function us(){try{return Sc(tw(import.meta.url))}catch{return"."}}function rw(e){try{let t=ew(lr(us(),"noop.js"));return Sc(t.resolve(`${e}/package.json`))}catch{return}}function cs(e,t,r,n){let i=lr(us(),e);if(ls(lr(i,n)))return i;let a=rw(t),s=a?lr(a,r):void 0;return s&&ls(lr(s,n))?s:void 0}function kc(){return cs("pdfjs/wasm","pdfjs-dist","wasm","jbig2.wasm")}function Ac(){return cs("pdfjs/cmaps","pdfjs-dist","cmaps","UniJIS-UCS2-H.bcmap")}function Ic(){let e=lr(us(),"tesseract","worker.cjs");return ls(e)?e:void 0}function Cc(){return cs("tessdata","@tesseract.js-data/eng","4.0.0_best_int","eng.traineddata.gz")}var fi;function Oc(){return fi??=(async()=>{iw();let e=globalThis;if(!e.pdfjsWorker)e.pdfjsWorker=await import("pdfjs-dist/legacy/build/pdf.worker.mjs");return await nw(()=>import("pdfjs-dist/legacy/build/pdf.mjs"))})(),fi.catch(()=>{fi=void 0}),fi}async function nw(e){let t=console.warn;console.warn=(...r)=>{let n=String(r[0]??"");if(/^Warning: Cannot (load "@napi-rs\/canvas"|polyfill `(Path2D|DOMMatrix|ImageData)`)/.test(n))return;t(...r)};try{return await e()}finally{console.warn=t}}function iw(){let e=globalThis;if(e.DOMMatrix)return;class t{a=1;b=0;c=0;d=1;e=0;f=0;constructor(r){if(r&&r.length>=6)[this.a,this.b,this.c,this.d,this.e,this.f]=Array.from(r).slice(0,6)}set(r){return[this.a,this.b,this.c,this.d,this.e,this.f]=r,this}product(r,n){return[r.a*n.a+r.c*n.b,r.b*n.a+r.d*n.b,r.a*n.c+r.c*n.d,r.b*n.c+r.d*n.d,r.a*n.e+r.c*n.f+r.e,r.b*n.e+r.d*n.f+r.f]}multiplySelf(r=new t){let n=r instanceof t?r:new t(r);return this.set(this.product(this,n))}preMultiplySelf(r=new t){let n=r instanceof t?r:new t(r);return this.set(this.product(n,this))}multiply(r){return new t(this.toArray()).multiplySelf(r)}translateSelf(r=0,n=0){return this.multiplySelf([1,0,0,1,r,n])}translate(r=0,n=0){return new t(this.toArray()).translateSelf(r,n)}scaleSelf(r=1,n=r){return this.multiplySelf([r,0,0,n,0,0])}scale(r=1,n=r){return new t(this.toArray()).scaleSelf(r,n)}invertSelf(){let r=this.a*this.d-this.b*this.c;if(!r)return this.set([Number.NaN,Number.NaN,Number.NaN,Number.NaN,Number.NaN,Number.NaN]);return this.set([this.d/r,-this.b/r,-this.c/r,this.a/r,(this.c*this.f-this.d*this.e)/r,(this.b*this.e-this.a*this.f)/r])}inverse(){return new t(this.toArray()).invertSelf()}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}}e.DOMMatrix=t}function Dc(e){return e?`${e.replace(/[\\/]+$/,"")}/`:void 0}function Pc(){let e=Dc(kc()),t=Dc(Ac());return{disableFontFace:!0,useSystemFonts:!1,isEvalSupported:!1,verbosity:0,...e?{wasmUrl:e}:{},...t?{cMapUrl:t,cMapPacked:!0}:{}}}var aw=100,sw=0.5,ow=200,Rc=4,fw=0.1,lw=1,uw=2,cw=3;function hw(e,t){let[r=1,n=0,i=0,a=1,s=0,o=0]=t;return[e[0]*r+e[2]*n,e[1]*r+e[3]*n,e[0]*i+e[2]*a,e[1]*i+e[3]*a,e[0]*s+e[2]*o+e[4],e[1]*s+e[3]*o+e[5]]}async function dw(e,t){let[r,n,i,a]=e.view,s=Math.abs((i-r)*(a-n))||1,o=await e.getOperatorList(),h=[1,0,0,1,0,0],l=[],c=0,p=!1,m=0,_=[];for(let w=0;w<o.fnArray.length;w++){let v=o.fnArray[w],b=o.argsArray[w],S=()=>Math.abs(h[0]*h[3]-h[1]*h[2]);if(v===t.save)l.push(h);else if(v===t.restore)h=l.pop()??h;else if(v===t.transform)h=hw(h,b);else if(v===t.setTextRenderingMode){if(b[0]===3)p=!0}else if(v===t.paintImageXObject||v===t.paintImageXObjectRepeat){if(c+=S(),typeof b[0]==="string")_.push({key:b[0],area:S()/s})}else if(v===t.paintInlineImageXObject)c+=S(),_.push({image:b[0],mask:!1,area:S()/s});else if(v===t.paintImageMaskXObject)c+=S(),_.push({image:b[0],mask:!0,area:S()/s});else if(v===t.constructPath)m++}return{coverage:Math.min(1,c/s),invisibleText:p,pathOps:m,pageArea:s,draws:_}}function Nc(e){let t=e.replace(/\s/g,"");if(t.length<20)return!1;return(t.match(/[-�\u0000-\u0008]/g)?.length??0)/t.length>0.3}var Fc=20000,Mc=60000,li=new Set,an;function pw(e){if(li.add(e),!an){let t=console.log;an=t,console.log=(...r)=>{let n=typeof r[0]==="string"?r[0]:"";if(n.startsWith("Warning: ")){for(let i of li)i(n.slice(9));return}t(...r)}}return()=>{if(li.delete(e),li.size===0&&an)console.log=an,an=void 0}}function Bc(e,t,r){let n=t.startsWith("g_")?e.commonObjs:e.objs;return new Promise((i)=>{let a=setTimeout(()=>i("no answer"),r),s=(o)=>{clearTimeout(a),i(o)};try{n.get(t,(o)=>s(o??null))}catch{s(null)}})}function gw(e,t,r){let{width:n,height:i,data:a}=t;if(!a||!n||!i)return;if(r||t.kind===lw){let h=n+7>>3;if(a.length<h*i)return;let l=new Uint8Array(n*i);for(let c=0;c<i;c++){let p=c*h;for(let m=0;m<n;m++)l[c*n+m]=(a[p+(m>>3)]??0)>>7-(m&7)&1?255:0}return e({width:n,height:i,data:l,channels:1,depth:8})}let o=t.kind===uw?3:t.kind===cw?4:a.length/(n*i);if(o!==1&&o!==3&&o!==4)return;return e({width:n,height:i,data:new Uint8Array(a.buffer,a.byteOffset,n*i*o),channels:o,depth:8})}function mw(e,t){let r=e?.name,n=e?.message??"";if(r!=="PasswordException"&&!/password/i.test(n))return;return Error(t?"The PDF's password is not the one given in `password`.":"The PDF is password-protected. Ask the user for the password and call again with `password`.")}async function zc(e,t){let r=await Oc(),{encode:n}=await import("fast-png"),i=new Set,a=t.onNote?pw((h)=>{if(i.size>=60||i.has(h))return;i.add(h),t.onNote?.(`pdf.js: ${h}`)}):void 0,s=r.getDocument({...Pc(),...t.onNote?{verbosity:1}:{},data:e.slice(),...t.password?{password:t.password}:{}}),o;try{o=await s.promise}catch(h){throw await s.destroy().catch(()=>{}),a?.(),mw(h,t.password)??h}try{return await vw(o,r.OPS,n,t)}finally{await s.destroy().catch(()=>{}),a?.()}}async function vw(e,t,r,n){let a=(await e.getMetadata().catch(()=>{return}))?.info??{},s=e.numPages,o=[],h=[],l=[],c=[],p=[],m=[],_=0,w=(v,b)=>n.onProgress?.({unit:"page",at:v,total:s,pictures:_,...b?{activity:b}:{}});for(let v=1;v<=s;v++){if(n.selects&&!n.selects(v))continue;n.signal?.throwIfAborted(),w(v),o.push(v),w(v,"opening the page");let b=await e.getPage(v);w(v,"reading its text");let S=await b.getTextContent(),T="";for(let E of S.items){if(typeof E.str!=="string")continue;if(T+=E.str,E.hasEOL)T+=`
23
+ `}T=T.replace(/[ \t]+\n/g,`
24
24
  `).replace(/\n{3,}/g,`
25
25
 
26
- `).trim(),N(j,"reading its layout");let T=await LZ(C,J);N(j);let R=M.replace(/\s/g,"").length,D=T.coverage>=KZ,x=!1;if(D&&T.invisibleText&&R>0)U.push(j);else if(D&&(R<VZ||EK(M)))x=!0;else if(R===0&&T.coverage===0&&T.pathOps>=XZ)B.push(j);else if(EK(M))x=!0;if(x)Z.push(j);let w=$.wantImages||x&&!!$.recognize,v=[];if(w){let I=0,_=0;for(let o of T.draws){if(_++,"key"in o)N(j,`decoding picture ${_} of ${T.draws.length}`);let i="key"in o?await xK(C,o.key,wK):o.image;if(i==="no answer"&&"key"in o){let{key:y}=o;$.onNote?.(`page ${j}: picture ${_} of ${T.draws.length} (${y}) did not arrive in ${wK/1000}s; asking for the page's pictures again`),N(j,`decoding picture ${_} of ${T.draws.length} again`),C.cleanup();let $0=await Promise.race([C.getOperatorList().then(()=>!0),new Promise((W0)=>setTimeout(()=>W0(!1),vK))]).catch(()=>!1);if(i=$0?await xK(C,y,vK):"no answer",i==="no answer"){let W0=y.startsWith("g_")?C.commonObjs:C.objs,Q0="unknown";try{Q0=W0.has(y)?"delivered late":"never delivered"}catch{}$.problems?.push(`page ${j}: picture ${_} of ${T.draws.length} (${y}) was left out, the PDF decoder gave no answer for it when asked twice (${$0?Q0:"the page's drawing did not come back either"})`),$.onNote?.(`page ${j}: picture ${_} (${y}) left out after the second request`);continue}$.onNote?.(`page ${j}: picture ${_} (${y}) arrived on the second request`)}if(i==="no answer")continue;if(!i){$.problems?.push(`page ${j}: a picture was left out, the PDF decoder could not decode it`);continue}if(i.width<DK||i.height<DK)continue;let D0=OZ(Y,i,"mask"in o&&o.mask);if(!D0){$.problems?.push(`page ${j}: a ${i.width}x${i.height} picture was left out, its pixel layout is one this cannot write`);continue}I++,z++,v.push({png:D0,width:i.width,height:i.height,coverage:o.area,stem:`p${j}-${I}`})}}let L;if(x&&$.recognize){let I=v.filter((o)=>o.coverage>=GZ);if(I.length>0)N(j,"recognizing text");let _=I.length>0?await $.recognize(j,I):void 0;if(_?.text.trim())H.push(j),L=`[Text recognized from the page image by ${_.by}]
26
+ `).trim(),w(v,"reading its layout");let k=await dw(b,t);w(v);let x=T.replace(/\s/g,"").length,A=k.coverage>=sw,O=!1;if(A&&k.invisibleText&&x>0)c.push(v);else if(A&&(x<aw||Nc(T)))O=!0;else if(x===0&&k.coverage===0&&k.pathOps>=ow)p.push(v);else if(Nc(T))O=!0;if(O)h.push(v);let C=n.wantImages||O&&!!n.recognize,D=[];if(C){let E=0,B=0;for(let G of k.draws){if(B++,"key"in G)w(v,`decoding picture ${B} of ${k.draws.length}`);let V="key"in G?await Bc(b,G.key,Fc):G.image;if(V==="no answer"&&"key"in G){let{key:N}=G;n.onNote?.(`page ${v}: picture ${B} of ${k.draws.length} (${N}) did not arrive in ${Fc/1000}s; asking for the page's pictures again`),w(v,`decoding picture ${B} of ${k.draws.length} again`),b.cleanup();let ne=await Promise.race([b.getOperatorList().then(()=>!0),new Promise((ue)=>setTimeout(()=>ue(!1),Mc))]).catch(()=>!1);if(V=ne?await Bc(b,N,Mc):"no answer",V==="no answer"){let ue=N.startsWith("g_")?b.commonObjs:b.objs,ee="unknown";try{ee=ue.has(N)?"delivered late":"never delivered"}catch{}n.problems?.push(`page ${v}: picture ${B} of ${k.draws.length} (${N}) was left out, the PDF decoder gave no answer for it when asked twice (${ne?ee:"the page's drawing did not come back either"})`),n.onNote?.(`page ${v}: picture ${B} (${N}) left out after the second request`);continue}n.onNote?.(`page ${v}: picture ${B} (${N}) arrived on the second request`)}if(V==="no answer")continue;if(!V){n.problems?.push(`page ${v}: a picture was left out, the PDF decoder could not decode it`);continue}if(V.width<Rc||V.height<Rc)continue;let Ie=gw(r,V,"mask"in G&&G.mask);if(!Ie){n.problems?.push(`page ${v}: a ${V.width}x${V.height} picture was left out, its pixel layout is one this cannot write`);continue}E++,_++,D.push({png:Ie,width:V.width,height:V.height,coverage:G.area,stem:`p${v}-${E}`})}}let d;if(O&&n.recognize){let E=D.filter((G)=>G.coverage>=fw);if(E.length>0)w(v,"recognizing text");let B=E.length>0?await n.recognize(v,E):void 0;if(B?.text.trim())l.push(v),d=`[Text recognized from the page image by ${B.by}]
27
27
 
28
- ${_.text.trim()}`}let k=[];if($.wantImages)for(let I of v){let _=$.images.add({data:I.png,stem:I.stem,mediaType:"image/png",width:I.width,height:I.height,source:`page ${j}`});if(_)k.push(c0(_))}N(j),P.push([`## Page ${j}`,M,L??"",...k].filter((I)=>I.length>0).join(`
28
+ ${B.text.trim()}`}let R=[];if(n.wantImages)for(let E of D){let B=n.images.add({data:E.png,stem:E.stem,mediaType:"image/png",width:E.width,height:E.height,source:`page ${v}`});if(B)R.push(We(B))}w(v),m.push([`## Page ${v}`,T,d??"",...R].filter((E)=>E.length>0).join(`
29
29
 
30
- `)),C.cleanup()}return{markdown:P.join(`
30
+ `)),b.cleanup()}return{markdown:m.join(`
31
31
 
32
- `),reader:"pdf.js",...typeof V.Title==="string"&&V.Title.trim()?{title:V.Title.trim()}:{},...typeof V.Author==="string"&&V.Author.trim()?{author:V.Author.trim()}:{},units:{name:"page",total:K,read:X},...Z.length?{scannedPages:Z}:{},...H.length?{recognizedPages:H}:{},...U.length?{ocrLayerPages:U}:{},...B.length?{vectorPages:B}:{}}}function kK(Q){let J=Q?.trim();if(!J)return;let Y=[];for(let $ of J.split(",")){let q=$.trim();if(!q)continue;let V=/^(\d+)\s*(?:-\s*(\d*))?$/.exec(q);if(!V)throw Error(`range "${Q}" is not understood: use one-based numbers, spans and an open end, like "1-5,9,12-".`);let K=Number(V[1]),X=V[2]===void 0?K:V[2]===""?Number.POSITIVE_INFINITY:Number(V[2]);if(K<1||X<K)throw Error(`range "${q}" is empty: numbers start at 1 and a span runs low to high.`);Y.push([K,X])}if(Y.length===0)return;return{selects:($)=>Y.some(([q,V])=>$>=q&&$<=V),spec:J.replace(/\s+/g,"")}}function X8(Q){let J=[...new Set(Q)].sort(($,q)=>$-q),Y=[];for(let $=0;$<J.length;){let q=$;while(q+1<J.length&&J[q+1]===J[q]+1)q++;Y.push($===q?`${J[$]}`:`${J[$]}-${J[q]}`),$=q+1}return Y.join(", ")}import{existsSync as yK}from"node:fs";import{copyFile as zZ,mkdir as FZ,readdir as iB,rename as rB,rm as aB,writeFile as sB}from"node:fs/promises";import{join as KJ}from"node:path";import{resolveClineDataDir as NZ}from"@cerebriline/shared/storage";var YQ="eng",W$=".traineddata.gz";function Z$(){return KJ(NZ(),"tessdata")}function gK(Q){let Y=(typeof Q==="string"?Q.split(/[+,\s]+/):Q??[]).map(($)=>$.trim().toLowerCase()).filter(Boolean);return[...new Set(Y)]}async function CZ(Q,J){let Y=IK();if(Y&&Q.every((V)=>V===YQ))return Y;let $=Q.filter((V)=>!yK(KJ(J,`${V}${W$}`))&&!(V===YQ&&Y));if($.length>0)throw new XJ($);let q=KJ(J,`${YQ}${W$}`);if(Y&&Q.includes(YQ)&&!yK(q))await FZ(J,{recursive:!0}),await zZ(KJ(Y,`${YQ}${W$}`),q);return J}class XJ extends Error{languages;constructor(Q){super(`OCR language${Q.length===1?"":"s"} ${Q.join(", ")} ${Q.length===1?"is":"are"} not installed.`);this.languages=Q}}var RZ=180000,IZ=120000,MZ=1e4;function U$(Q,J,Y){let $;return Promise.race([Q,new Promise((q,V)=>{$=setTimeout(()=>V(Error(`${Y} gave no answer in ${J/1000}s`)),J)})]).finally(()=>clearTimeout($))}class GJ{worker;languages;failure;dead;constructor(Q,J,Y){this.worker=Q;this.languages=J;this.failure=Y}static async open(Q,J=Z$()){let Y=await CZ(Q,J),$=await import("tesseract.js"),q=$.default??$,V=RK(),K={},X=await U$(q.createWorker(Q.join("+"),q.OEM.LSTM_ONLY,{langPath:Y,gzip:!0,cacheMethod:"none",...V?{workerPath:V}:{},errorHandler:(Z)=>{let H=Z instanceof Error?Z:Error(`the OCR worker failed: ${String(Z)}`);K.error=H,K.raise?.(H)}}),IZ,"Starting the OCR worker");return new GJ(X,Q,K)}async recognize(Q){if(this.dead)throw this.dead;if(this.failure.error)throw this.dead=this.failure.error,this.dead;try{let{data:J}=await U$(Promise.race([this.worker.recognize(Buffer.from(Q)),new Promise((Y,$)=>{this.failure.raise=$})]),RZ,"The OCR worker");return{text:J.text??"",confidence:Math.round(J.confidence??0)}}catch(J){if(this.failure.error||J instanceof Error&&/gave no answer/.test(J.message))this.dead=J instanceof Error?J:Error(String(J));throw J}finally{this.failure.raise=void 0}}async close(){await U$(this.worker.terminate(),MZ,"Stopping the OCR worker").catch(()=>{})}}var AZ=40,TZ=12,DZ=4;var EZ="This is a scanned page from a document. Transcribe all of its text exactly as written, in reading order, keeping paragraphs, headings and lists, and table rows as Markdown tables. Do not describe the page, summarize or add anything. Reply with the text only, or with nothing if the page has no text.";var hK="The user can change this under Settings > Features > Document Reader.";function wZ(Q){let J=Q.settings.ocr??"tesseract";if(Q.request==="none")return{kind:"none",reason:'Text recognition was skipped (ocr: "none").'};if(J==="off")return{kind:"none",reason:`Text recognition (OCR) is turned off. ${hK}`};let Y=!Q.request||Q.request==="auto"?J:Q.request,$=gK(Q.languages??Q.settings.ocrLanguages??["eng"]);if(Y==="tesseract")return{kind:"tesseract",languages:$.length?$:["eng"]};if(Q.describeImages)return{kind:"vision"};if(Q.modelSupportsImages)return{kind:"self",why:"no vision model is configured"};return{kind:"tesseract",languages:$.length?$:["eng"],fallback:"No vision model is configured and this model does not take images, so tesseract read the pages instead."}}function _K(Q){let J=wZ(Q),Y=[],$=[],q=[],V,K=0,X=Q.pageLimit!==void 0?Q.pageLimit:J.kind==="tesseract"?AZ:J.kind==="vision"?TZ:DZ;return{recognize:J.kind==="none"?void 0:async(H,U)=>{if(K>=X){$.push(H);return}K++;let B=[...U].sort((j,C)=>C.coverage-j.coverage);if(J.kind==="self"){let j=B[0];if(j)Y.push({page:H,png:j.png});return}if(J.kind==="vision")return xZ(Q.describeImages,H,B,q);V??=GJ.open(J.languages,Q.settings.ocrDataDir??Z$());let P;try{P=await V}catch(j){if(!q.length)q.push(vZ(j));return}let z=[],N=0;for(let j of B)try{let C=await P.recognize(j.png);if(C.text.trim())z.push(C.text.trim()),N=Math.max(N,C.confidence)}catch(C){q.push(`page ${H}: ${C instanceof Error?C.message:String(C)}`)}if(!z.length)return;return{text:z.join(`
32
+ `),reader:"pdf.js",...typeof a.Title==="string"&&a.Title.trim()?{title:a.Title.trim()}:{},...typeof a.Author==="string"&&a.Author.trim()?{author:a.Author.trim()}:{},units:{name:"page",total:s,read:o},...h.length?{scannedPages:h}:{},...l.length?{recognizedPages:l}:{},...c.length?{ocrLayerPages:c}:{},...p.length?{vectorPages:p}:{}}}function Lc(e){let t=e?.trim();if(!t)return;let r=[];for(let n of t.split(",")){let i=n.trim();if(!i)continue;let a=/^(\d+)\s*(?:-\s*(\d*))?$/.exec(i);if(!a)throw Error(`range "${e}" is not understood: use one-based numbers, spans and an open end, like "1-5,9,12-".`);let s=Number(a[1]),o=a[2]===void 0?s:a[2]===""?Number.POSITIVE_INFINITY:Number(a[2]);if(s<1||o<s)throw Error(`range "${i}" is empty: numbers start at 1 and a span runs low to high.`);r.push([s,o])}if(r.length===0)return;return{selects:(n)=>r.some(([i,a])=>n>=i&&n<=a),spec:t.replace(/\s+/g,"")}}function ur(e){let t=[...new Set(e)].sort((n,i)=>n-i),r=[];for(let n=0;n<t.length;){let i=n;while(i+1<t.length&&t[i+1]===t[i]+1)i++;r.push(n===i?`${t[n]}`:`${t[n]}-${t[i]}`),n=i+1}return r.join(", ")}import{existsSync as Uc}from"node:fs";import{copyFile as _w,mkdir as yw,readdir as Vx,rename as Kx,rm as Yx,writeFile as Jx}from"node:fs/promises";import{join as ui}from"node:path";import{resolveClineDataDir as ww}from"@cerebriline/shared/storage";var sn="eng",hs=".traineddata.gz";function ps(){return ui(ww(),"tessdata")}function jc(e){let r=(typeof e==="string"?e.split(/[+,\s]+/):e??[]).map((n)=>n.trim().toLowerCase()).filter(Boolean);return[...new Set(r)]}async function bw(e,t){let r=Cc();if(r&&e.every((a)=>a===sn))return r;let n=e.filter((a)=>!Uc(ui(t,`${a}${hs}`))&&!(a===sn&&r));if(n.length>0)throw new ci(n);let i=ui(t,`${sn}${hs}`);if(r&&e.includes(sn)&&!Uc(i))await yw(t,{recursive:!0}),await _w(ui(r,`${sn}${hs}`),i);return t}class ci extends Error{languages;constructor(e){super(`OCR language${e.length===1?"":"s"} ${e.join(", ")} ${e.length===1?"is":"are"} not installed.`);this.languages=e}}var xw=180000,Ew=120000,Tw=1e4;function ds(e,t,r){let n;return Promise.race([e,new Promise((i,a)=>{n=setTimeout(()=>a(Error(`${r} gave no answer in ${t/1000}s`)),t)})]).finally(()=>clearTimeout(n))}class hi{worker;languages;failure;dead;constructor(e,t,r){this.worker=e;this.languages=t;this.failure=r}static async open(e,t=ps()){let r=await bw(e,t),n=await import("tesseract.js"),i=n.default??n,a=Ic(),s={},o=await ds(i.createWorker(e.join("+"),i.OEM.LSTM_ONLY,{langPath:r,gzip:!0,cacheMethod:"none",...a?{workerPath:a}:{},errorHandler:(h)=>{let l=h instanceof Error?h:Error(`the OCR worker failed: ${String(h)}`);s.error=l,s.raise?.(l)}}),Ew,"Starting the OCR worker");return new hi(o,e,s)}async recognize(e){if(this.dead)throw this.dead;if(this.failure.error)throw this.dead=this.failure.error,this.dead;try{let{data:t}=await ds(Promise.race([this.worker.recognize(Buffer.from(e)),new Promise((r,n)=>{this.failure.raise=n})]),xw,"The OCR worker");return{text:t.text??"",confidence:Math.round(t.confidence??0)}}catch(t){if(this.failure.error||t instanceof Error&&/gave no answer/.test(t.message))this.dead=t instanceof Error?t:Error(String(t));throw t}finally{this.failure.raise=void 0}}async close(){await ds(this.worker.terminate(),Tw,"Stopping the OCR worker").catch(()=>{})}}var Sw=40,kw=12,Aw=4;var Iw="This is a scanned page from a document. Transcribe all of its text exactly as written, in reading order, keeping paragraphs, headings and lists, and table rows as Markdown tables. Do not describe the page, summarize or add anything. Reply with the text only, or with nothing if the page has no text.";var qc="The user can change this under Settings > Features > Document Reader.";function Cw(e){let t=e.settings.ocr??"tesseract";if(e.request==="none")return{kind:"none",reason:'Text recognition was skipped (ocr: "none").'};if(t==="off")return{kind:"none",reason:`Text recognition (OCR) is turned off. ${qc}`};let r=!e.request||e.request==="auto"?t:e.request,n=jc(e.languages??e.settings.ocrLanguages??["eng"]);if(r==="tesseract")return{kind:"tesseract",languages:n.length?n:["eng"]};if(e.describeImages)return{kind:"vision"};if(e.modelSupportsImages)return{kind:"self",why:"no vision model is configured"};return{kind:"tesseract",languages:n.length?n:["eng"],fallback:"No vision model is configured and this model does not take images, so tesseract read the pages instead."}}function Wc(e){let t=Cw(e),r=[],n=[],i=[],a,s=0,o=e.pageLimit!==void 0?e.pageLimit:t.kind==="tesseract"?Sw:t.kind==="vision"?kw:Aw;return{recognize:t.kind==="none"?void 0:async(l,c)=>{if(s>=o){n.push(l);return}s++;let p=[...c].sort((v,b)=>b.coverage-v.coverage);if(t.kind==="self"){let v=p[0];if(v)r.push({page:l,png:v.png});return}if(t.kind==="vision")return Ow(e.describeImages,l,p,i);a??=hi.open(t.languages,e.settings.ocrDataDir??ps());let m;try{m=await a}catch(v){if(!i.length)i.push(Dw(v));return}let _=[],w=0;for(let v of p)try{let b=await m.recognize(v.png);if(b.text.trim())_.push(b.text.trim()),w=Math.max(w,b.confidence)}catch(b){i.push(`page ${l}: ${b instanceof Error?b.message:String(b)}`)}if(!_.length)return;return{text:_.join(`
33
33
 
34
- `),by:`tesseract (${J.languages.join("+")}, ${N}% confidence)`}},attachments:Y,notes(H,U){if(!H.length)return[];let B=[],P=H.filter((N)=>!U.includes(N));if(J.kind==="none")return B.push(`Scanned pages ${X8(H)}: an image of text with no text layer, so their words are not in this text. ${J.reason}`),B;if(U.length){let N=J.kind==="vision"?"the vision model":`tesseract (${J.kind==="tesseract"?J.languages.join("+"):"eng"})`;B.push(`Scanned pages ${X8(U)}: their text was recognized from the page image by ${N}, and may contain recognition errors.`)}if(J.kind==="tesseract"&&J.fallback)B.push(J.fallback);if(J.kind==="self"&&Y.length)B.push(`Scanned pages ${X8(Y.map((N)=>N.page))} are attached below as images (${J.why}): read their text from them.`);if($.length)B.push(`Scanned pages ${X8($)} were not read: one call reads at most ${X} scanned pages. Call again with range: "${$[0]}-" for the rest.`);let z=P.filter((N)=>!$.includes(N)&&!(J.kind==="self"&&Y.some((j)=>j.page===N)));if(z.length)B.push(`Scanned pages ${X8(z)}: no text could be recognized${q.length?` (${q.slice(0,3).join("; ")})`:""}.`);return B},problems(H,U){let B=[],P=new Map;for(let N of q){let j=/^page (\d+): ([\s\S]*)$/.exec(N);if(j)P.set(Number(j[1]),j[2]??"")}let z=q.filter((N)=>!/^page \d+: /.test(N));for(let N of H){if(U.includes(N))continue;let j=$.includes(N)?`past the ${X} pages recognized in one call`:P.get(N)??z[0]??(J.kind==="none"?J.reason:"nothing readable was found on it");B.push(`page ${N}: a scan with no recognized text, ${j}`)}return B},async close(){if(V)await(await V.catch(()=>{return}))?.close()}}}function vZ(Q){if(Q instanceof XJ)return`${Q.message} ${hK} In the CLI, --ocr-languages installs them`;return`tesseract did not start: ${Q instanceof Error?Q.message:String(Q)}`}async function xZ(Q,J,Y,$){if(!Q)return;let q=Y[0];if(!q)return;try{let[V]=await Q([{image:Buffer.from(q.png).toString("base64"),mediaType:"image/png",instruction:EZ}]);return V?.trim()?{text:V.trim(),by:"the vision model"}:void 0}catch(V){$.push(`page ${J}: ${V instanceof Error?V.message:String(V)}`);return}}function kZ(Q,J,Y,$){switch(Y){case"pdf":return SK(J,$);case"doc":case"xls":case"ppt":return jK(J,Y,$);case"epub":case"mobi":case"azw3":case"fb2":return qK(Q,J,Y,$);default:return zK(J,Y,$)}}async function bK(Q,J={}){let Y=new Uint8Array(await SZ.readFile(Q.filePath)),$=KK(Q.namedAs??Q.filePath,Y.subarray(0,512));if("unsupported"in $)throw Error($.unsupported);let{format:q}=$,V=kK(Q.range),K=q==="pdf"?_K({request:Q.recognition.request,languages:Q.recognition.languages,settings:Q.recognition.settings,describeImages:J.describeImages,modelSupportsImages:Q.recognition.modelSupportsImages,...Q.recognition.everyPage?{pageLimit:Number.POSITIVE_INFINITY}:{}}):void 0,X=[],Z=new ZJ("images"),H;try{H=await kZ(Q.filePath,Y,q,{images:Z,wantImages:Q.wantImages,scratchDir:Q.scratchDir,problems:X,...Q.password?{password:Q.password}:{},...V?{selects:V.selects}:{},...J.signal?{signal:J.signal}:{},...J.onProgress?{onProgress:J.onProgress}:{},...J.onNote?{onNote:J.onNote}:{},...K?.recognize?{recognize:K.recognize}:{}})}finally{await K?.close()}let U=H.scannedPages??[],B=H.recognizedPages??[];return{format:q,result:H,images:[...Z.entries()],recognitionNotes:K?.notes(U,B)??[],recognitionProblems:K?.problems(U,B)??[],attachments:K?.attachments??[],problems:X}}var fK=".out";var uK=process;function G8(Q){return new Promise((J)=>{if(!process.connected||!uK.send){J();return}uK.send(Q,()=>J())})}var L$=new AbortController,B$=new Map,hZ=0;function _Z(Q){let J=hZ++;return new Promise((Y,$)=>{B$.set(J,{resolve:Y,reject:$}),G8({type:"describe",id:J,images:[...Q]})})}async function bZ(Q,J){let Y=Date.now();try{let $=await bK(Q,{signal:L$.signal,onProgress:(K)=>void G8({type:"progress",progress:K}),onNote:(K)=>void G8({type:"note",line:K}),...J?{describeImages:_Z}:{}}),q=mK(Q.scratchDir,fK);await yZ(q,{recursive:!0});let V=[];for(let[K,{image:X,data:Z}]of $.images.entries()){let H=mK(q,String(K));await gZ(H,Z),V.push({image:X,file:H})}await G8({type:"done",format:$.format,result:$.result,images:V,recognitionNotes:$.recognitionNotes,recognitionProblems:$.recognitionProblems,attachments:$.attachments,problems:$.problems,usage:{ms:Date.now()-Y,peakRssMb:Math.round(process.resourceUsage().maxRSS/1024)}})}catch($){await G8({type:"failed",message:$ instanceof Error?$.message:String($),aborted:L$.signal.aborted})}await Promise.race([mZ,new Promise(($)=>setTimeout($,fZ).unref())]),process.exit(0)}var fZ=60000,pK=()=>{},mZ=new Promise((Q)=>{pK=Q}),cK=!1;process.on("message",(Q)=>{if(Q.type==="start"&&!cK)cK=!0,bZ(Q.job,Q.hasVision);else if(Q.type==="received")pK();else if(Q.type==="abort")L$.abort();else if(Q.type==="described"){let J=B$.get(Q.id);if(B$.delete(Q.id),!J)return;if(Q.error!==void 0)J.reject(Error(Q.error));else J.resolve(Q.descriptions??[])}});process.on("disconnect",()=>process.exit(0));G8({type:"ready"});
34
+ `),by:`tesseract (${t.languages.join("+")}, ${w}% confidence)`}},attachments:r,notes(l,c){if(!l.length)return[];let p=[],m=l.filter((w)=>!c.includes(w));if(t.kind==="none")return p.push(`Scanned pages ${ur(l)}: an image of text with no text layer, so their words are not in this text. ${t.reason}`),p;if(c.length){let w=t.kind==="vision"?"the vision model":`tesseract (${t.kind==="tesseract"?t.languages.join("+"):"eng"})`;p.push(`Scanned pages ${ur(c)}: their text was recognized from the page image by ${w}, and may contain recognition errors.`)}if(t.kind==="tesseract"&&t.fallback)p.push(t.fallback);if(t.kind==="self"&&r.length)p.push(`Scanned pages ${ur(r.map((w)=>w.page))} are attached below as images (${t.why}): read their text from them.`);if(n.length)p.push(`Scanned pages ${ur(n)} were not read: one call reads at most ${o} scanned pages. Call again with range: "${n[0]}-" for the rest.`);let _=m.filter((w)=>!n.includes(w)&&!(t.kind==="self"&&r.some((v)=>v.page===w)));if(_.length)p.push(`Scanned pages ${ur(_)}: no text could be recognized${i.length?` (${i.slice(0,3).join("; ")})`:""}.`);return p},problems(l,c){let p=[],m=new Map;for(let w of i){let v=/^page (\d+): ([\s\S]*)$/.exec(w);if(v)m.set(Number(v[1]),v[2]??"")}let _=i.filter((w)=>!/^page \d+: /.test(w));for(let w of l){if(c.includes(w))continue;let v=n.includes(w)?`past the ${o} pages recognized in one call`:m.get(w)??_[0]??(t.kind==="none"?t.reason:"nothing readable was found on it");p.push(`page ${w}: a scan with no recognized text, ${v}`)}return p},async close(){if(a)await(await a.catch(()=>{return}))?.close()}}}function Dw(e){if(e instanceof ci)return`${e.message} ${qc} In the CLI, --ocr-languages installs them`;return`tesseract did not start: ${e instanceof Error?e.message:String(e)}`}async function Ow(e,t,r,n){if(!e)return;let i=r[0];if(!i)return;try{let[a]=await e([{image:Buffer.from(i.png).toString("base64"),mediaType:"image/png",instruction:Iw}]);return a?.trim()?{text:a.trim(),by:"the vision model"}:void 0}catch(a){n.push(`page ${t}: ${a instanceof Error?a.message:String(a)}`);return}}function Rw(e,t,r,n){switch(r){case"pdf":return zc(t,n);case"doc":case"xls":case"ppt":return Ec(t,r,n);case"epub":case"mobi":case"azw3":case"fb2":return uc(e,t,r,n);default:return Tc(t,r,n)}}async function $c(e,t={}){let r=new Uint8Array(await Pw.readFile(e.filePath)),n=hc(e.namedAs??e.filePath,r.subarray(0,512));if("unsupported"in n)throw Error(n.unsupported);let{format:i}=n,a=Lc(e.range),s=i==="pdf"?Wc({request:e.recognition.request,languages:e.recognition.languages,settings:e.recognition.settings,describeImages:t.describeImages,modelSupportsImages:e.recognition.modelSupportsImages,...e.recognition.everyPage?{pageLimit:Number.POSITIVE_INFINITY}:{}}):void 0,o=[],h=new gi("images"),l;try{l=await Rw(e.filePath,r,i,{images:h,wantImages:e.wantImages,scratchDir:e.scratchDir,problems:o,...e.password?{password:e.password}:{},...a?{selects:a.selects}:{},...t.signal?{signal:t.signal}:{},...t.onProgress?{onProgress:t.onProgress}:{},...t.onNote?{onNote:t.onNote}:{},...s?.recognize?{recognize:s.recognize}:{}})}finally{await s?.close()}let c=l.scannedPages??[],p=l.recognizedPages??[];return{format:i,result:l,images:[...h.entries()],recognitionNotes:s?.notes(c,p)??[],recognitionProblems:s?.problems(c,p)??[],attachments:s?.attachments??[],problems:o}}var Zc=".out";var Gc=process;function cr(e){return new Promise((t)=>{if(!process.connected||!Gc.send){t();return}Gc.send(e,()=>t())})}var gs=new AbortController,ms=new Map,Mw=0;function Bw(e){let t=Mw++;return new Promise((r,n)=>{ms.set(t,{resolve:r,reject:n}),cr({type:"describe",id:t,images:[...e]})})}async function zw(e,t){let r=Date.now();try{let n=await $c(e,{signal:gs.signal,onProgress:(s)=>void cr({type:"progress",progress:s}),onNote:(s)=>void cr({type:"note",line:s}),...t?{describeImages:Bw}:{}}),i=Hc(e.scratchDir,Zc);await Nw(i,{recursive:!0});let a=[];for(let[s,{image:o,data:h}]of n.images.entries()){let l=Hc(i,String(s));await Fw(l,h),a.push({image:o,file:l})}await cr({type:"done",format:n.format,result:n.result,images:a,recognitionNotes:n.recognitionNotes,recognitionProblems:n.recognitionProblems,attachments:n.attachments,problems:n.problems,usage:{ms:Date.now()-r,peakRssMb:Math.round(process.resourceUsage().maxRSS/1024)}})}catch(n){await cr({type:"failed",message:n instanceof Error?n.message:String(n),aborted:gs.signal.aborted})}await Promise.race([Uw,new Promise((n)=>setTimeout(n,Lw).unref())]),process.exit(0)}var Lw=60000,Vc=()=>{},Uw=new Promise((e)=>{Vc=e}),Xc=!1;process.on("message",(e)=>{if(e.type==="start"&&!Xc)Xc=!0,zw(e.job,e.hasVision);else if(e.type==="received")Vc();else if(e.type==="abort")gs.abort();else if(e.type==="described"){let t=ms.get(e.id);if(ms.delete(e.id),!t)return;if(e.error!==void 0)t.reject(Error(e.error));else t.resolve(e.descriptions??[])}});process.on("disconnect",()=>process.exit(0));cr({type:"ready"});