This repository has been archived on 2026-07-21. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
crisleo94 6b4c0c43f8 feat: uv config other feats
- add uv configuration for the backend
- update frontend to make auth work
- add new auth endpoints
- add bookmars feat
- add reader feat
2026-06-03 22:06:01 -05:00

23 lines
361 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ReaderToolbar-wmOf7G3U.js","assets/index-BQiEVoRj.js","assets/index-Bc1rr75j.css","assets/TableOfContents-BqoUCglr.js","assets/ReadingSettingsPanel-Bt3-VHc7.js"])))=>i.map(i=>d[i]);
import{g as Yt,c as bt,r as me,R as As,j as we,a as yi,X as wr,u as qn,k as Ds,i as Cs,h as Ss,f as Ts,_ as _r}from"./index-BQiEVoRj.js";import{b as jn}from"./books-BG7wMiRx.js";import{g as ks}from"./errors-bLl0IgZb.js";var ni={exports:{}},Ci={exports:{}},Si,Lr;function Wn(){if(Lr)return Si;Lr=1;var y=void 0;return Si=function(e){return e!==y&&e!==null},Si}var Ti,Br;function Ns(){if(Br)return Ti;Br=1;var y=Wn(),e={object:!0,function:!0,undefined:!0};return Ti=function(t){return y(t)?hasOwnProperty.call(e,typeof t):!1},Ti}var ki,Pr;function Rs(){if(Pr)return ki;Pr=1;var y=Ns();return ki=function(e){if(!y(e))return!1;try{return e.constructor?e.constructor.prototype===e:!1}catch{return!1}},ki}var Ni,Fr;function Is(){if(Fr)return Ni;Fr=1;var y=Rs();return Ni=function(e){if(typeof e!="function"||!hasOwnProperty.call(e,"length"))return!1;try{if(typeof e.length!="number"||typeof e.call!="function"||typeof e.apply!="function")return!1}catch{return!1}return!y(e)},Ni}var Ri,zr;function Os(){if(zr)return Ri;zr=1;var y=Is(),e=/^\s*class[\s{/}]/,t=Function.prototype.toString;return Ri=function(i){return!(!y(i)||e.test(t.call(i)))},Ri}var Ii,Mr;function Ls(){return Mr||(Mr=1,Ii=function(){var y=Object.assign,e;return typeof y!="function"?!1:(e={foo:"raz"},y(e,{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}),Ii}var Oi,Ur;function Bs(){return Ur||(Ur=1,Oi=function(){try{return Object.keys("primitive"),!0}catch{return!1}}),Oi}var Li,qr;function Ps(){return qr||(qr=1,Li=function(){}),Li}var Bi,jr;function Er(){if(jr)return Bi;jr=1;var y=Ps()();return Bi=function(e){return e!==y&&e!==null},Bi}var Pi,Wr;function Fs(){if(Wr)return Pi;Wr=1;var y=Er(),e=Object.keys;return Pi=function(t){return e(y(t)?Object(t):t)},Pi}var Fi,Hr;function zs(){return Hr||(Hr=1,Fi=Bs()()?Object.keys:Fs()),Fi}var zi,Vr;function Ms(){if(Vr)return zi;Vr=1;var y=Er();return zi=function(e){if(!y(e))throw new TypeError("Cannot use null or undefined");return e},zi}var Mi,Gr;function Us(){if(Gr)return Mi;Gr=1;var y=zs(),e=Ms(),t=Math.max;return Mi=function(i,r){var n,s,a=t(arguments.length,2),u;for(i=Object(e(i)),u=function(h){try{i[h]=r[h]}catch(d){n||(n=d)}},s=1;s<a;++s)r=arguments[s],y(r).forEach(u);if(n!==void 0)throw n;return i},Mi}var Ui,Zr;function qs(){return Zr||(Zr=1,Ui=Ls()()?Object.assign:Us()),Ui}var qi,Yr;function js(){if(Yr)return qi;Yr=1;var y=Er(),e=Array.prototype.forEach,t=Object.create,i=function(r,n){var s;for(s in r)n[s]=r[s]};return qi=function(r){var n=t(null);return e.call(arguments,function(s){y(s)&&i(Object(s),n)}),n},qi}var ji,Xr;function Ws(){if(Xr)return ji;Xr=1;var y="razdwatrzy";return ji=function(){return typeof y.contains!="function"?!1:y.contains("dwa")===!0&&y.contains("foo")===!1},ji}var Wi,$r;function Hs(){if($r)return Wi;$r=1;var y=String.prototype.indexOf;return Wi=function(e){return y.call(this,e,arguments[1])>-1},Wi}var Hi,Kr;function Vs(){return Kr||(Kr=1,Hi=Ws()()?String.prototype.contains:Hs()),Hi}var Jr;function Gs(){if(Jr)return Ci.exports;Jr=1;var y=Wn(),e=Os(),t=qs(),i=js(),r=Vs(),n=Ci.exports=function(s,a){var u,h,d,c,w;return arguments.length<2||typeof s!="string"?(c=a,a=s,s=null):c=arguments[2],y(s)?(u=r.call(s,"c"),h=r.call(s,"e"),d=r.call(s,"w")):(u=d=!0,h=!1),w={value:a,configurable:u,enumerable:h,writable:d},c?t(i(c),w):w};return n.gs=function(s,a,u){var h,d,c,w;return typeof s!="string"?(c=u,u=a,a=s,s=null):c=arguments[3],y(a)?e(a)?y(u)?e(u)||(c=u,u=void 0):u=void 0:(c=a,a=u=void 0):a=void 0,y(s)?(h=r.call(s,"c"),d=r.call(s,"e")):(h=!0,d=!1),w={get:a,set:u,configurable:h,enumerable:d},c?t(i(c),w):w},Ci.exports}var Vi,Qr;function Zs(){return Qr||(Qr=1,Vi=function(y){if(typeof y!="function")throw new TypeError(y+" is not a function");return y}),Vi}var en;function Ys(){return en||(en=1,(function(y,e){var t=Gs(),i=Zs(),r=Function.prototype.apply,n=Function.prototype.call,s=Object.create,a=Object.defineProperty,u=Object.defineProperties,h=Object.prototype.hasOwnProperty,d={configurable:!0,enumerable:!1,writable:!0},c,w,m,N,E,f,v;c=function(g,D){var L;return i(D),h.call(this,"__ee__")?L=this.__ee__:(L=d.value=s(null),a(this,"__ee__",d),d.value=null),L[g]?typeof L[g]=="object"?L[g].push(D):L[g]=[L[g],D]:L[g]=D,this},w=function(g,D){var L,b;return i(D),b=this,c.call(this,g,L=function(){m.call(b,g,L),r.call(D,this,arguments)}),L.__eeOnceListener__=D,this},m=function(g,D){var L,b,S,R;if(i(D),!h.call(this,"__ee__"))return this;if(L=this.__ee__,!L[g])return this;if(b=L[g],typeof b=="object")for(R=0;S=b[R];++R)(S===D||S.__eeOnceListener__===D)&&(b.length===2?L[g]=b[R?0:1]:b.splice(R,1));else(b===D||b.__eeOnceListener__===D)&&delete L[g];return this},N=function(g){var D,L,b,S,R;if(h.call(this,"__ee__")&&(S=this.__ee__[g],!!S))if(typeof S=="object"){for(L=arguments.length,R=new Array(L-1),D=1;D<L;++D)R[D-1]=arguments[D];for(S=S.slice(),D=0;b=S[D];++D)r.call(b,this,R)}else switch(arguments.length){case 1:n.call(S,this);break;case 2:n.call(S,this,arguments[1]);break;case 3:n.call(S,this,arguments[1],arguments[2]);break;default:for(L=arguments.length,R=new Array(L-1),D=1;D<L;++D)R[D-1]=arguments[D];r.call(S,this,R)}},E={on:c,once:w,off:m,emit:N},f={on:t(c),once:t(w),off:t(m),emit:t(N)},v=u({},f),y.exports=e=function(g){return g==null?s(v):u(Object(g),f)},e.methods=E})(ni,ni.exports)),ni.exports}var Xs=Ys();const St=Yt(Xs);var Kt={},kt={},zt={},tn;function bi(){if(tn)return zt;tn=1;function y(r,n,s){if(s===void 0&&(s=Array.prototype),r&&typeof s.find=="function")return s.find.call(r,n);for(var a=0;a<r.length;a++)if(Object.prototype.hasOwnProperty.call(r,a)){var u=r[a];if(n.call(void 0,u,a,r))return u}}function e(r,n){return n===void 0&&(n=Object),n&&typeof n.freeze=="function"?n.freeze(r):r}var t=e({HTML:"text/html",isHTML:function(r){return r===t.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),i=e({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(r){return r===i.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});return zt.find=y,zt.freeze=e,zt.MIME_TYPE=t,zt.NAMESPACE=i,zt}var rn;function Hn(){if(rn)return kt;rn=1;var y=bi(),e=y.find,t=y.NAMESPACE;function i(p){return p!==""}function r(p){return p?p.split(/[\t\n\f\r ]+/).filter(i):[]}function n(p,o){return p.hasOwnProperty(o)||(p[o]=!0),p}function s(p){if(!p)return[];var o=r(p);return Object.keys(o.reduce(n,{}))}function a(p){return function(o){return p&&p.indexOf(o)!==-1}}function u(p,o){for(var x in p)Object.prototype.hasOwnProperty.call(p,x)&&(o[x]=p[x])}function h(p,o){var x=p.prototype;if(!(x instanceof o)){let z=function(){};z.prototype=o.prototype,z=new z,u(x,z),p.prototype=x=z}x.constructor!=p&&(typeof p!="function"&&console.error("unknown Class:"+p),x.constructor=p)}var d={},c=d.ELEMENT_NODE=1,w=d.ATTRIBUTE_NODE=2,m=d.TEXT_NODE=3,N=d.CDATA_SECTION_NODE=4,E=d.ENTITY_REFERENCE_NODE=5,f=d.ENTITY_NODE=6,v=d.PROCESSING_INSTRUCTION_NODE=7,g=d.COMMENT_NODE=8,D=d.DOCUMENT_NODE=9,L=d.DOCUMENT_TYPE_NODE=10,b=d.DOCUMENT_FRAGMENT_NODE=11,S=d.NOTATION_NODE=12,R={},I={};R.INDEX_SIZE_ERR=(I[1]="Index size error",1),R.DOMSTRING_SIZE_ERR=(I[2]="DOMString size error",2);var k=R.HIERARCHY_REQUEST_ERR=(I[3]="Hierarchy request error",3);R.WRONG_DOCUMENT_ERR=(I[4]="Wrong document",4),R.INVALID_CHARACTER_ERR=(I[5]="Invalid character",5),R.NO_DATA_ALLOWED_ERR=(I[6]="No data allowed",6),R.NO_MODIFICATION_ALLOWED_ERR=(I[7]="No modification allowed",7);var O=R.NOT_FOUND_ERR=(I[8]="Not found",8);R.NOT_SUPPORTED_ERR=(I[9]="Not supported",9);var G=R.INUSE_ATTRIBUTE_ERR=(I[10]="Attribute in use",10);R.INVALID_STATE_ERR=(I[11]="Invalid state",11),R.SYNTAX_ERR=(I[12]="Syntax error",12),R.INVALID_MODIFICATION_ERR=(I[13]="Invalid modification",13),R.NAMESPACE_ERR=(I[14]="Invalid namespace",14),R.INVALID_ACCESS_ERR=(I[15]="Invalid access",15);function j(p,o){if(o instanceof Error)var x=o;else x=this,Error.call(this,I[p]),this.message=I[p],Error.captureStackTrace&&Error.captureStackTrace(this,j);return x.code=p,o&&(this.message=this.message+": "+o),x}j.prototype=Error.prototype,u(R,j);function Z(){}Z.prototype={length:0,item:function(p){return p>=0&&p<this.length?this[p]:null},toString:function(p,o){for(var x=[],z=0;z<this.length;z++)Q(this[z],x,p,o);return x.join("")},filter:function(p){return Array.prototype.filter.call(this,p)},indexOf:function(p){return Array.prototype.indexOf.call(this,p)}};function Y(p,o){this._node=p,this._refresh=o,X(this)}function X(p){var o=p._node._inc||p._node.ownerDocument._inc;if(p._inc!==o){var x=p._refresh(p._node);if(F(p,"length",x.length),!p.$$length||x.length<p.$$length)for(var z=x.length;z in p;z++)Object.prototype.hasOwnProperty.call(p,z)&&delete p[z];u(x,p),p._inc=o}}Y.prototype.item=function(p){return X(this),this[p]||null},h(Y,Z);function ie(){}function K(p,o){for(var x=p.length;x--;)if(p[x]===o)return x}function $(p,o,x,z){if(z?o[K(o,z)]=x:o[o.length++]=x,p){x.ownerElement=p;var l=p.ownerDocument;l&&(z&&We(l,p,z),Te(l,p,x))}}function ae(p,o,x){var z=K(o,x);if(z>=0){for(var l=o.length-1;z<l;)o[z]=o[++z];if(o.length=l,p){var M=p.ownerDocument;M&&(We(M,p,x),x.ownerElement=null)}}else throw new j(O,new Error(p.tagName+"@"+x))}ie.prototype={length:0,item:Z.prototype.item,getNamedItem:function(p){for(var o=this.length;o--;){var x=this[o];if(x.nodeName==p)return x}},setNamedItem:function(p){var o=p.ownerElement;if(o&&o!=this._ownerElement)throw new j(G);var x=this.getNamedItem(p.nodeName);return $(this._ownerElement,this,p,x),x},setNamedItemNS:function(p){var o=p.ownerElement,x;if(o&&o!=this._ownerElement)throw new j(G);return x=this.getNamedItemNS(p.namespaceURI,p.localName),$(this._ownerElement,this,p,x),x},removeNamedItem:function(p){var o=this.getNamedItem(p);return ae(this._ownerElement,this,o),o},removeNamedItemNS:function(p,o){var x=this.getNamedItemNS(p,o);return ae(this._ownerElement,this,x),x},getNamedItemNS:function(p,o){for(var x=this.length;x--;){var z=this[x];if(z.localName==o&&z.namespaceURI==p)return z}return null}};function pe(){}pe.prototype={hasFeature:function(p,o){return!0},createDocument:function(p,o,x){var z=new ye;if(z.implementation=this,z.childNodes=new Z,z.doctype=x||null,x&&z.appendChild(x),o){var l=z.createElementNS(p,o);z.appendChild(l)}return z},createDocumentType:function(p,o,x){var z=new it;return z.name=p,z.nodeName=p,z.publicId=o||"",z.systemId=x||"",z}};function ne(){}ne.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(p,o){return tt(this,p,o)},replaceChild:function(p,o){tt(this,p,o,Ge),o&&this.removeChild(o)},removeChild:function(p){return be(this,p)},appendChild:function(p){return this.insertBefore(p,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(p){return fe(this.ownerDocument||this,this,p)},normalize:function(){for(var p=this.firstChild;p;){var o=p.nextSibling;o&&o.nodeType==m&&p.nodeType==m?(this.removeChild(o),p.appendData(o.data)):(p.normalize(),p=o)}},isSupported:function(p,o){return this.ownerDocument.implementation.hasFeature(p,o)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(p){for(var o=this;o;){var x=o._nsMap;if(x){for(var z in x)if(Object.prototype.hasOwnProperty.call(x,z)&&x[z]===p)return z}o=o.nodeType==w?o.ownerDocument:o.parentNode}return null},lookupNamespaceURI:function(p){for(var o=this;o;){var x=o._nsMap;if(x&&p in x&&Object.prototype.hasOwnProperty.call(x,p))return x[p];o=o.nodeType==w?o.ownerDocument:o.parentNode}return null},isDefaultNamespace:function(p){var o=this.lookupPrefix(p);return o==null}};function ce(p){return p=="<"&&"&lt;"||p==">"&&"&gt;"||p=="&"&&"&amp;"||p=='"'&&"&quot;"||"&#"+p.charCodeAt()+";"}u(d,ne),u(d,ne.prototype);function Ce(p,o){if(o(p))return!0;if(p=p.firstChild)do if(Ce(p,o))return!0;while(p=p.nextSibling)}function ye(){this.ownerDocument=this}function Te(p,o,x){p&&p._inc++;var z=x.namespaceURI;z===t.XMLNS&&(o._nsMap[x.prefix?x.localName:""]=x.value)}function We(p,o,x,z){p&&p._inc++;var l=x.namespaceURI;l===t.XMLNS&&delete o._nsMap[x.prefix?x.localName:""]}function Fe(p,o,x){if(p&&p._inc){p._inc++;var z=o.childNodes;if(x)z[z.length++]=x;else{for(var l=o.firstChild,M=0;l;)z[M++]=l,l=l.nextSibling;z.length=M,delete z[z.length]}}}function be(p,o){var x=o.previousSibling,z=o.nextSibling;return x?x.nextSibling=z:p.firstChild=z,z?z.previousSibling=x:p.lastChild=x,o.parentNode=null,o.previousSibling=null,o.nextSibling=null,Fe(p.ownerDocument,p),o}function Pe(p){return p&&(p.nodeType===ne.DOCUMENT_NODE||p.nodeType===ne.DOCUMENT_FRAGMENT_NODE||p.nodeType===ne.ELEMENT_NODE)}function Ue(p){return p&&(ke(p)||ve(p)||xe(p)||p.nodeType===ne.DOCUMENT_FRAGMENT_NODE||p.nodeType===ne.COMMENT_NODE||p.nodeType===ne.PROCESSING_INSTRUCTION_NODE)}function xe(p){return p&&p.nodeType===ne.DOCUMENT_TYPE_NODE}function ke(p){return p&&p.nodeType===ne.ELEMENT_NODE}function ve(p){return p&&p.nodeType===ne.TEXT_NODE}function Ie(p,o){var x=p.childNodes||[];if(e(x,ke)||xe(o))return!1;var z=e(x,xe);return!(o&&z&&x.indexOf(z)>x.indexOf(o))}function He(p,o){var x=p.childNodes||[];function z(M){return ke(M)&&M!==o}if(e(x,z))return!1;var l=e(x,xe);return!(o&&l&&x.indexOf(l)>x.indexOf(o))}function ze(p,o,x){if(!Pe(p))throw new j(k,"Unexpected parent node type "+p.nodeType);if(x&&x.parentNode!==p)throw new j(O,"child not in parent");if(!Ue(o)||xe(o)&&p.nodeType!==ne.DOCUMENT_NODE)throw new j(k,"Unexpected node type "+o.nodeType+" for parent node type "+p.nodeType)}function Oe(p,o,x){var z=p.childNodes||[],l=o.childNodes||[];if(o.nodeType===ne.DOCUMENT_FRAGMENT_NODE){var M=l.filter(ke);if(M.length>1||e(l,ve))throw new j(k,"More than one element or text in fragment");if(M.length===1&&!Ie(p,x))throw new j(k,"Element in fragment can not be inserted before doctype")}if(ke(o)&&!Ie(p,x))throw new j(k,"Only one element can be added and only after doctype");if(xe(o)){if(e(z,xe))throw new j(k,"Only one doctype is allowed");var H=e(z,ke);if(x&&z.indexOf(H)<z.indexOf(x))throw new j(k,"Doctype can only be inserted before an element");if(!x&&H)throw new j(k,"Doctype can not be appended since element is present")}}function Ge(p,o,x){var z=p.childNodes||[],l=o.childNodes||[];if(o.nodeType===ne.DOCUMENT_FRAGMENT_NODE){var M=l.filter(ke);if(M.length>1||e(l,ve))throw new j(k,"More than one element or text in fragment");if(M.length===1&&!He(p,x))throw new j(k,"Element in fragment can not be inserted before doctype")}if(ke(o)&&!He(p,x))throw new j(k,"Only one element can be added and only after doctype");if(xe(o)){if(e(z,function(B){return xe(B)&&B!==x}))throw new j(k,"Only one doctype is allowed");var H=e(z,ke);if(x&&z.indexOf(H)<z.indexOf(x))throw new j(k,"Doctype can only be inserted before an element")}}function tt(p,o,x,z){ze(p,o,x),p.nodeType===ne.DOCUMENT_NODE&&(z||Oe)(p,o,x);var l=o.parentNode;if(l&&l.removeChild(o),o.nodeType===b){var M=o.firstChild;if(M==null)return o;var H=o.lastChild}else M=H=o;var _=x?x.previousSibling:p.lastChild;M.previousSibling=_,H.nextSibling=x,_?_.nextSibling=M:p.firstChild=M,x==null?p.lastChild=H:x.previousSibling=H;do M.parentNode=p;while(M!==H&&(M=M.nextSibling));return Fe(p.ownerDocument||p,p),o.nodeType==b&&(o.firstChild=o.lastChild=null),o}function Je(p,o){return o.parentNode&&o.parentNode.removeChild(o),o.parentNode=p,o.previousSibling=p.lastChild,o.nextSibling=null,o.previousSibling?o.previousSibling.nextSibling=o:p.firstChild=o,p.lastChild=o,Fe(p.ownerDocument,p,o),o}ye.prototype={nodeName:"#document",nodeType:D,doctype:null,documentElement:null,_inc:1,insertBefore:function(p,o){if(p.nodeType==b){for(var x=p.firstChild;x;){var z=x.nextSibling;this.insertBefore(x,o),x=z}return p}return tt(this,p,o),p.ownerDocument=this,this.documentElement===null&&p.nodeType===c&&(this.documentElement=p),p},removeChild:function(p){return this.documentElement==p&&(this.documentElement=null),be(this,p)},replaceChild:function(p,o){tt(this,p,o,Ge),p.ownerDocument=this,o&&this.removeChild(o),ke(p)&&(this.documentElement=p)},importNode:function(p,o){return te(this,p,o)},getElementById:function(p){var o=null;return Ce(this.documentElement,function(x){if(x.nodeType==c&&x.getAttribute("id")==p)return o=x,!0}),o},getElementsByClassName:function(p){var o=s(p);return new Y(this,function(x){var z=[];return o.length>0&&Ce(x.documentElement,function(l){if(l!==x&&l.nodeType===c){var M=l.getAttribute("class");if(M){var H=p===M;if(!H){var _=s(M);H=o.every(a(_))}H&&z.push(l)}}}),z})},createElement:function(p){var o=new Ee;o.ownerDocument=this,o.nodeName=p,o.tagName=p,o.localName=p,o.childNodes=new Z;var x=o.attributes=new ie;return x._ownerElement=o,o},createDocumentFragment:function(){var p=new ct;return p.ownerDocument=this,p.childNodes=new Z,p},createTextNode:function(p){var o=new nt;return o.ownerDocument=this,o.appendData(p),o},createComment:function(p){var o=new pt;return o.ownerDocument=this,o.appendData(p),o},createCDATASection:function(p){var o=new lt;return o.ownerDocument=this,o.appendData(p),o},createProcessingInstruction:function(p,o){var x=new ht;return x.ownerDocument=this,x.tagName=x.nodeName=x.target=p,x.nodeValue=x.data=o,x},createAttribute:function(p){var o=new De;return o.ownerDocument=this,o.name=p,o.nodeName=p,o.localName=p,o.specified=!0,o},createEntityReference:function(p){var o=new at;return o.ownerDocument=this,o.nodeName=p,o},createElementNS:function(p,o){var x=new Ee,z=o.split(":"),l=x.attributes=new ie;return x.childNodes=new Z,x.ownerDocument=this,x.nodeName=o,x.tagName=o,x.namespaceURI=p,z.length==2?(x.prefix=z[0],x.localName=z[1]):x.localName=o,l._ownerElement=x,x},createAttributeNS:function(p,o){var x=new De,z=o.split(":");return x.ownerDocument=this,x.nodeName=o,x.name=o,x.namespaceURI=p,x.specified=!0,z.length==2?(x.prefix=z[0],x.localName=z[1]):x.localName=o,x}},h(ye,ne);function Ee(){this._nsMap={}}Ee.prototype={nodeType:c,hasAttribute:function(p){return this.getAttributeNode(p)!=null},getAttribute:function(p){var o=this.getAttributeNode(p);return o&&o.value||""},getAttributeNode:function(p){return this.attributes.getNamedItem(p)},setAttribute:function(p,o){var x=this.ownerDocument.createAttribute(p);x.value=x.nodeValue=""+o,this.setAttributeNode(x)},removeAttribute:function(p){var o=this.getAttributeNode(p);o&&this.removeAttributeNode(o)},appendChild:function(p){return p.nodeType===b?this.insertBefore(p,null):Je(this,p)},setAttributeNode:function(p){return this.attributes.setNamedItem(p)},setAttributeNodeNS:function(p){return this.attributes.setNamedItemNS(p)},removeAttributeNode:function(p){return this.attributes.removeNamedItem(p.nodeName)},removeAttributeNS:function(p,o){var x=this.getAttributeNodeNS(p,o);x&&this.removeAttributeNode(x)},hasAttributeNS:function(p,o){return this.getAttributeNodeNS(p,o)!=null},getAttributeNS:function(p,o){var x=this.getAttributeNodeNS(p,o);return x&&x.value||""},setAttributeNS:function(p,o,x){var z=this.ownerDocument.createAttributeNS(p,o);z.value=z.nodeValue=""+x,this.setAttributeNode(z)},getAttributeNodeNS:function(p,o){return this.attributes.getNamedItemNS(p,o)},getElementsByTagName:function(p){return new Y(this,function(o){var x=[];return Ce(o,function(z){z!==o&&z.nodeType==c&&(p==="*"||z.tagName==p)&&x.push(z)}),x})},getElementsByTagNameNS:function(p,o){return new Y(this,function(x){var z=[];return Ce(x,function(l){l!==x&&l.nodeType===c&&(p==="*"||l.namespaceURI===p)&&(o==="*"||l.localName==o)&&z.push(l)}),z})}},ye.prototype.getElementsByTagName=Ee.prototype.getElementsByTagName,ye.prototype.getElementsByTagNameNS=Ee.prototype.getElementsByTagNameNS,h(Ee,ne);function De(){}De.prototype.nodeType=w,h(De,ne);function _e(){}_e.prototype={data:"",substringData:function(p,o){return this.data.substring(p,p+o)},appendData:function(p){p=this.data+p,this.nodeValue=this.data=p,this.length=p.length},insertData:function(p,o){this.replaceData(p,0,o)},appendChild:function(p){throw new Error(I[k])},deleteData:function(p,o){this.replaceData(p,o,"")},replaceData:function(p,o,x){var z=this.data.substring(0,p),l=this.data.substring(p+o);x=z+x+l,this.nodeValue=this.data=x,this.length=x.length}},h(_e,ne);function nt(){}nt.prototype={nodeName:"#text",nodeType:m,splitText:function(p){var o=this.data,x=o.substring(p);o=o.substring(0,p),this.data=this.nodeValue=o,this.length=o.length;var z=this.ownerDocument.createTextNode(x);return this.parentNode&&this.parentNode.insertBefore(z,this.nextSibling),z}},h(nt,_e);function pt(){}pt.prototype={nodeName:"#comment",nodeType:g},h(pt,_e);function lt(){}lt.prototype={nodeName:"#cdata-section",nodeType:N},h(lt,_e);function it(){}it.prototype.nodeType=L,h(it,ne);function vt(){}vt.prototype.nodeType=S,h(vt,ne);function ft(){}ft.prototype.nodeType=f,h(ft,ne);function at(){}at.prototype.nodeType=E,h(at,ne);function ct(){}ct.prototype.nodeName="#document-fragment",ct.prototype.nodeType=b,h(ct,ne);function ht(){}ht.prototype.nodeType=v,h(ht,ne);function Ye(){}Ye.prototype.serializeToString=function(p,o,x){return ot.call(p,o,x)},ne.prototype.toString=ot;function ot(p,o){var x=[],z=this.nodeType==9&&this.documentElement||this,l=z.prefix,M=z.namespaceURI;if(M&&l==null){var l=z.lookupPrefix(M);if(l==null)var H=[{namespace:M,prefix:null}]}return Q(this,x,p,o,H),x.join("")}function wt(p,o,x){var z=p.prefix||"",l=p.namespaceURI;if(!l||z==="xml"&&l===t.XML||l===t.XMLNS)return!1;for(var M=x.length;M--;){var H=x[M];if(H.prefix===z)return H.namespace!==l}return!0}function C(p,o,x){p.push(" ",o,'="',x.replace(/[<&"]/g,ce),'"')}function Q(p,o,x,z,l){if(l||(l=[]),z)if(p=z(p),p){if(typeof p=="string"){o.push(p);return}}else return;switch(p.nodeType){case c:var M=p.attributes,H=M.length,Ne=p.firstChild,_=p.tagName;x=t.isHTML(p.namespaceURI)||x;var B=_;if(!x&&!p.prefix&&p.namespaceURI){for(var V,de=0;de<M.length;de++)if(M.item(de).name==="xmlns"){V=M.item(de).value;break}if(!V)for(var ue=l.length-1;ue>=0;ue--){var le=l[ue];if(le.prefix===""&&le.namespace===p.namespaceURI){V=le.namespace;break}}if(V!==p.namespaceURI)for(var ue=l.length-1;ue>=0;ue--){var le=l[ue];if(le.namespace===p.namespaceURI){le.prefix&&(B=le.prefix+":"+_);break}}}o.push("<",B);for(var Ae=0;Ae<H;Ae++){var Xe=M.item(Ae);Xe.prefix=="xmlns"?l.push({prefix:Xe.localName,namespace:Xe.value}):Xe.nodeName=="xmlns"&&l.push({prefix:"",namespace:Xe.value})}for(var Ae=0;Ae<H;Ae++){var Xe=M.item(Ae);if(wt(Xe,x,l)){var Me=Xe.prefix||"",Se=Xe.namespaceURI;C(o,Me?"xmlns:"+Me:"xmlns",Se),l.push({prefix:Me,namespace:Se})}Q(Xe,o,x,z,l)}if(_===B&&wt(p,x,l)){var Me=p.prefix||"",Se=p.namespaceURI;C(o,Me?"xmlns:"+Me:"xmlns",Se),l.push({prefix:Me,namespace:Se})}if(Ne||x&&!/^(?:meta|link|img|br|hr|input)$/i.test(_)){if(o.push(">"),x&&/^script$/i.test(_))for(;Ne;)Ne.data?o.push(Ne.data):Q(Ne,o,x,z,l.slice()),Ne=Ne.nextSibling;else for(;Ne;)Q(Ne,o,x,z,l.slice()),Ne=Ne.nextSibling;o.push("</",B,">")}else o.push("/>");return;case D:case b:for(var Ne=p.firstChild;Ne;)Q(Ne,o,x,z,l.slice()),Ne=Ne.nextSibling;return;case w:return C(o,p.name,p.value);case m:return o.push(p.data.replace(/[<&]/g,ce).replace(/]]>/g,"]]&gt;"));case N:return o.push("<![CDATA[",p.data,"]]>");case g:return o.push("<!--",p.data,"-->");case L:var Qe=p.publicId,Ze=p.systemId;if(o.push("<!DOCTYPE ",p.name),Qe)o.push(" PUBLIC ",Qe),Ze&&Ze!="."&&o.push(" ",Ze),o.push(">");else if(Ze&&Ze!=".")o.push(" SYSTEM ",Ze,">");else{var Tt=p.internalSubset;Tt&&o.push(" [",Tt,"]"),o.push(">")}return;case v:return o.push("<?",p.target," ",p.data,"?>");case E:return o.push("&",p.nodeName,";");default:o.push("??",p.nodeName)}}function te(p,o,x){var z;switch(o.nodeType){case c:z=o.cloneNode(!1),z.ownerDocument=p;case b:break;case w:x=!0;break}if(z||(z=o.cloneNode(!1)),z.ownerDocument=p,z.parentNode=null,x)for(var l=o.firstChild;l;)z.appendChild(te(p,l,x)),l=l.nextSibling;return z}function fe(p,o,x){var z=new o.constructor;for(var l in o)if(Object.prototype.hasOwnProperty.call(o,l)){var M=o[l];typeof M!="object"&&M!=z[l]&&(z[l]=M)}switch(o.childNodes&&(z.childNodes=new Z),z.ownerDocument=p,z.nodeType){case c:var H=o.attributes,_=z.attributes=new ie,B=H.length;_._ownerElement=z;for(var V=0;V<B;V++)z.setAttributeNode(fe(p,H.item(V),!0));break;case w:x=!0}if(x)for(var de=o.firstChild;de;)z.appendChild(fe(p,de,x)),de=de.nextSibling;return z}function F(p,o,x){p[o]=x}try{if(Object.defineProperty){let p=function(o){switch(o.nodeType){case c:case b:var x=[];for(o=o.firstChild;o;)o.nodeType!==7&&o.nodeType!==8&&x.push(p(o)),o=o.nextSibling;return x.join("");default:return o.nodeValue}};Object.defineProperty(Y.prototype,"length",{get:function(){return X(this),this.$$length}}),Object.defineProperty(ne.prototype,"textContent",{get:function(){return p(this)},set:function(o){switch(this.nodeType){case c:case b:for(;this.firstChild;)this.removeChild(this.firstChild);(o||String(o))&&this.appendChild(this.ownerDocument.createTextNode(o));break;default:this.data=o,this.value=o,this.nodeValue=o}}}),F=function(o,x,z){o["$$"+x]=z}}}catch{}return kt.DocumentType=it,kt.DOMException=j,kt.DOMImplementation=pe,kt.Element=Ee,kt.Node=ne,kt.NodeList=Z,kt.XMLSerializer=Ye,kt}var Mt={},Gi={},nn;function $s(){return nn||(nn=1,(function(y){var e=bi().freeze;y.XML_ENTITIES=e({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),y.HTML_ENTITIES=e({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"",backsim:"∽",backsimeq:"⋍",Backslash:"",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"",Bernoullis:"",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"",caps:"∩︀",caret:"",caron:"ˇ",Cayleys:"",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"",dd:"",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:"",emsp13:"",emsp14:"",ENG:"Ŋ",eng:"ŋ",ensp:"",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"",escr:"",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"",ExponentialE:"",exponentiale:"",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"",frown:"⌢",Fscr:"",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:"",half:"½",hamilt:"",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"",hfr:"𝔥",HilbertSpace:"",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"",hyphen:"",Iacute:"Í",iacute:"í",ic:"",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"",Imacr:"Ī",imacr:"ī",image:"",ImaginaryI:"",imagline:"",imagpart:"",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"",InvisibleTimes:"",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"",lrtri:"⊿",lsaquo:"",Lscr:"",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"",lsquor:"",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:"",Mellintrf:"",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"",midast:"*",midcir:"⫰",middot:"·",minus:"",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"",NegativeThickSpace:"",NegativeThinSpace:"",NegativeVeryThinSpace:"",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:`
`,nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"",NonBreakingSpace:" ",Nopf:"",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:"",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"",operp:"⦹",oplus:"⊕",Or:"⩔",or:"",orarr:"↻",ord:"⩝",order:"",orderof:"",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"",pointint:"⨕",Popf:"",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"",primes:"",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:"",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"",rationals:"",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"",real:"",realine:"",realpart:"",reals:"",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"",Rscr:"",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"",rsquor:"",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"",setmn:"",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"",smashp:"⨳",smeparsl:"⧤",smid:"",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"",ThickSpace:"",thinsp:"",ThinSpace:"",thkap:"≈",thksim:"",THORN:"Þ",thorn:"þ",Tilde:"",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"",vee:"",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:"",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"",ZeroWidthSpace:"",Zeta:"Ζ",zeta:"ζ",Zfr:"",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"",zwnj:""}),y.entityMap=y.HTML_ENTITIES})(Gi)),Gi}var si={},sn;function Ks(){if(sn)return si;sn=1;var y=bi().NAMESPACE,e=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,t=new RegExp("[\\-\\.0-9"+e.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),i=new RegExp("^"+e.source+t.source+"*(?::"+e.source+t.source+"*)?$"),r=0,n=1,s=2,a=3,u=4,h=5,d=6,c=7;function w(k,O){this.message=k,this.locator=O,Error.captureStackTrace&&Error.captureStackTrace(this,w)}w.prototype=new Error,w.prototype.name=w.name;function m(){}m.prototype={parse:function(k,O,G){var j=this.domBuilder;j.startDocument(),L(O,O={}),N(k,O,G,j,this.errorHandler),j.endDocument()}};function N(k,O,G,j,Z){function Y(Ee){if(Ee>65535){Ee-=65536;var De=55296+(Ee>>10),_e=56320+(Ee&1023);return String.fromCharCode(De,_e)}else return String.fromCharCode(Ee)}function X(Ee){var De=Ee.slice(1,-1);return De in G?G[De]:De.charAt(0)==="#"?Y(parseInt(De.substr(1).replace("x","0x"))):(Z.error("entity not found:"+Ee),Ee)}function ie(Ee){if(Ee>ye){var De=k.substring(ye,Ee).replace(/&#?\w+;/g,X);ne&&K(ye),j.characters(De,0,Ee-ye),ye=Ee}}function K(Ee,De){for(;Ee>=ae&&(De=pe.exec(k));)$=De.index,ae=$+De[0].length,ne.lineNumber++;ne.columnNumber=Ee-$+1}for(var $=0,ae=0,pe=/.*(?:\r\n?|\n)|.*$/g,ne=j.locator,ce=[{currentNSMap:O}],Ce={},ye=0;;){try{var Te=k.indexOf("<",ye);if(Te<0){if(!k.substr(ye).match(/^\s*$/)){var We=j.doc,Fe=We.createTextNode(k.substr(ye));We.appendChild(Fe),j.currentElement=Fe}return}switch(Te>ye&&ie(Te),k.charAt(Te+1)){case"/":var ze=k.indexOf(">",Te+3),be=k.substring(Te+2,ze).replace(/[ \t\n\r]+$/g,""),Pe=ce.pop();ze<0?(be=k.substring(Te+2).replace(/[\s<].*/,""),Z.error("end tag name: "+be+" is not complete:"+Pe.tagName),ze=Te+1+be.length):be.match(/\s</)&&(be=be.replace(/[\s<].*/,""),Z.error("end tag name: "+be+" maybe not complete"),ze=Te+1+be.length);var Ue=Pe.localNSMap,xe=Pe.tagName==be,ke=xe||Pe.tagName&&Pe.tagName.toLowerCase()==be.toLowerCase();if(ke){if(j.endElement(Pe.uri,Pe.localName,be),Ue)for(var ve in Ue)Object.prototype.hasOwnProperty.call(Ue,ve)&&j.endPrefixMapping(ve);xe||Z.fatalError("end tag name: "+be+" is not match the current start tagName:"+Pe.tagName)}else ce.push(Pe);ze++;break;case"?":ne&&K(Te),ze=S(k,Te,j);break;case"!":ne&&K(Te),ze=b(k,Te,j,Z);break;default:ne&&K(Te);var Ie=new R,He=ce[ce.length-1].currentNSMap,ze=f(k,Te,Ie,He,X,Z),Oe=Ie.length;if(!Ie.closed&&D(k,ze,Ie.tagName,Ce)&&(Ie.closed=!0,G.nbsp||Z.warning("unclosed xml attribute")),ne&&Oe){for(var Ge=E(ne,{}),tt=0;tt<Oe;tt++){var Je=Ie[tt];K(Je.offset),Je.locator=E(ne,{})}j.locator=Ge,v(Ie,j,He)&&ce.push(Ie),j.locator=ne}else v(Ie,j,He)&&ce.push(Ie);y.isHTML(Ie.uri)&&!Ie.closed?ze=g(k,ze,Ie.tagName,X,j):ze++}}catch(Ee){if(Ee instanceof w)throw Ee;Z.error("element parse error: "+Ee),ze=-1}ze>ye?ye=ze:ie(Math.max(Te,ye)+1)}}function E(k,O){return O.lineNumber=k.lineNumber,O.columnNumber=k.columnNumber,O}function f(k,O,G,j,Z,Y){function X(ne,ce,Ce){G.attributeNames.hasOwnProperty(ne)&&Y.fatalError("Attribute "+ne+" redefined"),G.addValue(ne,ce,Ce)}for(var ie,K,$=++O,ae=r;;){var pe=k.charAt($);switch(pe){case"=":if(ae===n)ie=k.slice(O,$),ae=a;else if(ae===s)ae=a;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(ae===a||ae===n)if(ae===n&&(Y.warning('attribute value must after "="'),ie=k.slice(O,$)),O=$+1,$=k.indexOf(pe,O),$>0)K=k.slice(O,$).replace(/&#?\w+;/g,Z),X(ie,K,O-1),ae=h;else throw new Error("attribute value no end '"+pe+"' match");else if(ae==u)K=k.slice(O,$).replace(/&#?\w+;/g,Z),X(ie,K,O),Y.warning('attribute "'+ie+'" missed start quot('+pe+")!!"),O=$+1,ae=h;else throw new Error('attribute value must after "="');break;case"/":switch(ae){case r:G.setTagName(k.slice(O,$));case h:case d:case c:ae=c,G.closed=!0;case u:case n:break;case s:G.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return Y.error("unexpected end of input"),ae==r&&G.setTagName(k.slice(O,$)),$;case">":switch(ae){case r:G.setTagName(k.slice(O,$));case h:case d:case c:break;case u:case n:K=k.slice(O,$),K.slice(-1)==="/"&&(G.closed=!0,K=K.slice(0,-1));case s:ae===s&&(K=ie),ae==u?(Y.warning('attribute "'+K+'" missed quot(")!'),X(ie,K.replace(/&#?\w+;/g,Z),O)):((!y.isHTML(j[""])||!K.match(/^(?:disabled|checked|selected)$/i))&&Y.warning('attribute "'+K+'" missed value!! "'+K+'" instead!!'),X(K,K,O));break;case a:throw new Error("attribute value missed!!")}return $;case"€":pe=" ";default:if(pe<=" ")switch(ae){case r:G.setTagName(k.slice(O,$)),ae=d;break;case n:ie=k.slice(O,$),ae=s;break;case u:var K=k.slice(O,$).replace(/&#?\w+;/g,Z);Y.warning('attribute "'+K+'" missed quot(")!!'),X(ie,K,O);case h:ae=d;break}else switch(ae){case s:G.tagName,(!y.isHTML(j[""])||!ie.match(/^(?:disabled|checked|selected)$/i))&&Y.warning('attribute "'+ie+'" missed value!! "'+ie+'" instead2!!'),X(ie,ie,O),O=$,ae=n;break;case h:Y.warning('attribute space is required"'+ie+'"!!');case d:ae=n,O=$;break;case a:ae=u,O=$;break;case c:throw new Error("elements closed character '/' and '>' must be connected to")}}$++}}function v(k,O,G){for(var j=k.tagName,Z=null,pe=k.length;pe--;){var Y=k[pe],X=Y.qName,ie=Y.value,ne=X.indexOf(":");if(ne>0)var K=Y.prefix=X.slice(0,ne),$=X.slice(ne+1),ae=K==="xmlns"&&$;else $=X,K=null,ae=X==="xmlns"&&"";Y.localName=$,ae!==!1&&(Z==null&&(Z={},L(G,G={})),G[ae]=Z[ae]=ie,Y.uri=y.XMLNS,O.startPrefixMapping(ae,ie))}for(var pe=k.length;pe--;){Y=k[pe];var K=Y.prefix;K&&(K==="xml"&&(Y.uri=y.XML),K!=="xmlns"&&(Y.uri=G[K||""]))}var ne=j.indexOf(":");ne>0?(K=k.prefix=j.slice(0,ne),$=k.localName=j.slice(ne+1)):(K=null,$=k.localName=j);var ce=k.uri=G[K||""];if(O.startElement(ce,$,j,k),k.closed){if(O.endElement(ce,$,j),Z)for(K in Z)Object.prototype.hasOwnProperty.call(Z,K)&&O.endPrefixMapping(K)}else return k.currentNSMap=G,k.localNSMap=Z,!0}function g(k,O,G,j,Z){if(/^(?:script|textarea)$/i.test(G)){var Y=k.indexOf("</"+G+">",O),X=k.substring(O+1,Y);if(/[&<]/.test(X))return/^script$/i.test(G)?(Z.characters(X,0,X.length),Y):(X=X.replace(/&#?\w+;/g,j),Z.characters(X,0,X.length),Y)}return O+1}function D(k,O,G,j){var Z=j[G];return Z==null&&(Z=k.lastIndexOf("</"+G+">"),Z<O&&(Z=k.lastIndexOf("</"+G)),j[G]=Z),Z<O}function L(k,O){for(var G in k)Object.prototype.hasOwnProperty.call(k,G)&&(O[G]=k[G])}function b(k,O,G,j){var Z=k.charAt(O+2);switch(Z){case"-":if(k.charAt(O+3)==="-"){var Y=k.indexOf("-->",O+4);return Y>O?(G.comment(k,O+4,Y-O-4),Y+3):(j.error("Unclosed comment"),-1)}else return-1;default:if(k.substr(O+3,6)=="CDATA["){var Y=k.indexOf("]]>",O+9);return G.startCDATA(),G.characters(k,O+9,Y-O-9),G.endCDATA(),Y+3}var X=I(k,O),ie=X.length;if(ie>1&&/!doctype/i.test(X[0][0])){var K=X[1][0],$=!1,ae=!1;ie>3&&(/^public$/i.test(X[2][0])?($=X[3][0],ae=ie>4&&X[4][0]):/^system$/i.test(X[2][0])&&(ae=X[3][0]));var pe=X[ie-1];return G.startDTD(K,$,ae),G.endDTD(),pe.index+pe[0].length}}return-1}function S(k,O,G){var j=k.indexOf("?>",O);if(j){var Z=k.substring(O,j).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return Z?(Z[0].length,G.processingInstruction(Z[1],Z[2]),j+2):-1}return-1}function R(){this.attributeNames={}}R.prototype={setTagName:function(k){if(!i.test(k))throw new Error("invalid tagName:"+k);this.tagName=k},addValue:function(k,O,G){if(!i.test(k))throw new Error("invalid attribute:"+k);this.attributeNames[k]=this.length,this[this.length++]={qName:k,value:O,offset:G}},length:0,getLocalName:function(k){return this[k].localName},getLocator:function(k){return this[k].locator},getQName:function(k){return this[k].qName},getURI:function(k){return this[k].uri},getValue:function(k){return this[k].value}};function I(k,O){var G,j=[],Z=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(Z.lastIndex=O,Z.exec(k);G=Z.exec(k);)if(j.push(G),G[1])return j}return si.XMLReader=m,si.ParseError=w,si}var an;function Js(){if(an)return Mt;an=1;var y=bi(),e=Hn(),t=$s(),i=Ks(),r=e.DOMImplementation,n=y.NAMESPACE,s=i.ParseError,a=i.XMLReader;function u(E){this.options=E||{locator:{}}}u.prototype.parseFromString=function(E,f){var v=this.options,g=new a,D=v.domBuilder||new d,L=v.errorHandler,b=v.locator,S=v.xmlns||{},R=/\/x?html?$/.test(f),I=R?t.HTML_ENTITIES:t.XML_ENTITIES;return b&&D.setDocumentLocator(b),g.errorHandler=h(L,D,b),g.domBuilder=v.domBuilder||D,R&&(S[""]=n.HTML),S.xml=S.xml||n.XML,E&&typeof E=="string"?g.parse(E,S,I):g.errorHandler.error("invalid doc source"),D.doc};function h(E,f,v){if(!E){if(f instanceof d)return f;E=f}var g={},D=E instanceof Function;v=v||{};function L(b){var S=E[b];!S&&D&&(S=E.length==2?function(R){E(b,R)}:E),g[b]=S&&function(R){S("[xmldom "+b+"] "+R+w(v))}||function(){}}return L("warning"),L("error"),L("fatalError"),g}function d(){this.cdata=!1}function c(E,f){f.lineNumber=E.lineNumber,f.columnNumber=E.columnNumber}d.prototype={startDocument:function(){this.doc=new r().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(E,f,v,g){var D=this.doc,L=D.createElementNS(E,v||f),b=g.length;N(this,L),this.currentElement=L,this.locator&&c(this.locator,L);for(var S=0;S<b;S++){var E=g.getURI(S),R=g.getValue(S),v=g.getQName(S),I=D.createAttributeNS(E,v);this.locator&&c(g.getLocator(S),I),I.value=I.nodeValue=R,L.setAttributeNode(I)}},endElement:function(E,f,v){var g=this.currentElement;g.tagName,this.currentElement=g.parentNode},startPrefixMapping:function(E,f){},endPrefixMapping:function(E){},processingInstruction:function(E,f){var v=this.doc.createProcessingInstruction(E,f);this.locator&&c(this.locator,v),N(this,v)},ignorableWhitespace:function(E,f,v){},characters:function(E,f,v){if(E=m.apply(this,arguments),E){if(this.cdata)var g=this.doc.createCDATASection(E);else var g=this.doc.createTextNode(E);this.currentElement?this.currentElement.appendChild(g):/^\s*$/.test(E)&&this.doc.appendChild(g),this.locator&&c(this.locator,g)}},skippedEntity:function(E){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(E){(this.locator=E)&&(E.lineNumber=0)},comment:function(E,f,v){E=m.apply(this,arguments);var g=this.doc.createComment(E);this.locator&&c(this.locator,g),N(this,g)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(E,f,v){var g=this.doc.implementation;if(g&&g.createDocumentType){var D=g.createDocumentType(E,f,v);this.locator&&c(this.locator,D),N(this,D),this.doc.doctype=D}},warning:function(E){console.warn("[xmldom warning] "+E,w(this.locator))},error:function(E){console.error("[xmldom error] "+E,w(this.locator))},fatalError:function(E){throw new s(E,this.locator)}};function w(E){if(E)return`
@`+(E.systemId||"")+"#[line:"+E.lineNumber+",col:"+E.columnNumber+"]"}function m(E,f,v){return typeof E=="string"?E.substr(f,v):E.length>=f+v||f?new java.lang.String(E,f,v)+"":E}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(E){d.prototype[E]=function(){return null}});function N(E,f){E.currentElement?E.currentElement.appendChild(f):E.doc.appendChild(f)}return Mt.__DOMHandler=d,Mt.DOMParser=u,Mt.DOMImplementation=e.DOMImplementation,Mt.XMLSerializer=e.XMLSerializer,Mt}var on;function Qs(){if(on)return Kt;on=1;var y=Hn();return Kt.DOMImplementation=y.DOMImplementation,Kt.XMLSerializer=y.XMLSerializer,Kt.DOMParser=Js().DOMParser,Kt}var Vn=Qs();const xr=typeof window<"u"?window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame:!1,ea=1,ta=3,Gn=typeof URL<"u"?URL:typeof window<"u"?window.URL||window.webkitURL||window.mozURL:void 0;function wi(){var y=new Date().getTime(),e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var i=(y+Math.random()*16)%16|0;return y=Math.floor(y/16),(t=="x"?i:i&7|8).toString(16)});return e}function ia(){return Math.max(document.documentElement.clientHeight,document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight)}function Zn(y){return!!(y&&y.nodeType==1)}function Ke(y){return!isNaN(parseFloat(y))&&isFinite(y)}function Yn(y){let e=parseFloat(y);return Ke(y)===!1?!1:typeof y=="string"&&y.indexOf(".")>-1?!0:Math.floor(e)!==e}function jt(y){var e=["Webkit","webkit","Moz","O","ms"],t=["-webkit-","-webkit-","-moz-","-o-","-ms-"],i=y.toLowerCase(),r=e.length;if(typeof document>"u"||typeof document.body.style[i]<"u")return y;for(var n=0;n<r;n++)if(typeof document.body.style[t[n]+i]<"u")return t[n]+i;return y}function Xn(y){for(var e=1,t=arguments.length;e<t;e++){var i=arguments[e];for(var r in i)y[r]===void 0&&(y[r]=i[r])}return y}function ut(y){var e=[].slice.call(arguments,1);return e.forEach(function(t){t&&Object.getOwnPropertyNames(t).forEach(function(i){Object.defineProperty(y,i,Object.getOwnPropertyDescriptor(t,i))})}),y}function ra(y,e,t){var i=Zt(y,e,t);return e.splice(i,0,y),i}function Zt(y,e,t,i,r){var n=i||0,s=r||e.length,a=parseInt(n+(s-n)/2),u;return t||(t=function(h,d){if(h>d)return 1;if(h<d)return-1;if(h==d)return 0}),s-n<=0?a:(u=t(e[a],y),s-n===1?u>=0?a:a+1:u===0?a:u===-1?Zt(y,e,t,a,s):Zt(y,e,t,n,a))}function hi(y,e,t,i,r){var n=i||0,s=r||e.length,a=parseInt(n+(s-n)/2),u;return t||(t=function(h,d){if(h>d)return 1;if(h<d)return-1;if(h==d)return 0}),s-n<=0?-1:(u=t(e[a],y),s-n===1?u===0?a:-1:u===0?a:u===-1?hi(y,e,t,a,s):hi(y,e,t,n,a))}function ui(y){var e=window.getComputedStyle(y),t=["width","paddingRight","paddingLeft","marginRight","marginLeft","borderRightWidth","borderLeftWidth"],i=["height","paddingTop","paddingBottom","marginTop","marginBottom","borderTopWidth","borderBottomWidth"],r=0,n=0;return t.forEach(function(s){r+=parseFloat(e[s])||0}),i.forEach(function(s){n+=parseFloat(e[s])||0}),{height:n,width:r}}function fi(y){var e=window.getComputedStyle(y),t=["paddingRight","paddingLeft","marginRight","marginLeft","borderRightWidth","borderLeftWidth"],i=["paddingTop","paddingBottom","marginTop","marginBottom","borderTopWidth","borderBottomWidth"],r=0,n=0;return t.forEach(function(s){r+=parseFloat(e[s])||0}),i.forEach(function(s){n+=parseFloat(e[s])||0}),{height:n,width:r}}function pr(y){let e,t=y.ownerDocument;if(y.nodeType==Node.TEXT_NODE){let i=t.createRange();i.selectNodeContents(y),e=i.getBoundingClientRect()}else e=y.getBoundingClientRect();return e}function ci(){var y=window.innerWidth,e=window.innerHeight;return{top:0,left:0,right:y,bottom:e,width:y,height:e}}function Ar(y,e){for(var t=y.parentNode,i=t.childNodes,r,n=-1,s=0;s<i.length&&(r=i[s],r.nodeType===e&&n++,r!=y);s++);return n}function na(y){return Ar(y,ta)}function $n(y){return Ar(y,ea)}function ei(y){return["xml","opf","ncx"].indexOf(y)>-1}function Kn(y,e){return new Blob([y],{type:e})}function di(y,e){var t,i=Kn(y,e);return t=Gn.createObjectURL(i),t}function Jn(y){return Gn.revokeObjectURL(y)}function vr(y,e){var t,i;if(typeof y=="string")return t=btoa(y),i="data:"+e+";base64,"+t,i}function Qn(y){return Object.prototype.toString.call(y).slice(8,-1)}function Ct(y,e,t){var i,r;return typeof DOMParser>"u"||t?r=Vn.DOMParser:r=DOMParser,y.charCodeAt(0)===65279&&(y=y.slice(1)),i=new r().parseFromString(y,e),i}function Ve(y,e){var t;if(!y)throw new Error("No Element Provided");if(typeof y.querySelector<"u")return y.querySelector(e);if(t=y.getElementsByTagName(e),t.length)return t[0]}function Rt(y,e){return typeof y.querySelector<"u"?y.querySelectorAll(e):y.getElementsByTagName(e)}function Wt(y,e,t){var i,r;if(typeof y.querySelector<"u"){e+="[";for(var n in t)e+=n+"~='"+t[n]+"'";return e+="]",y.querySelector(e)}else if(i=y.getElementsByTagName(e),r=Array.prototype.slice.call(i,0).filter(function(s){for(var a in t)if(s.getAttribute(a)===t[a])return!0;return!1}),r)return r[0]}function pi(y,e){var t=y.ownerDocument||y;typeof t.createTreeWalker<"u"?es(y,e,NodeFilter.SHOW_TEXT):Dr(y,function(i){i&&i.nodeType===3&&e(i)})}function es(y,e,t){var i=document.createTreeWalker(y,t,null,!1);let r;for(;r=i.nextNode();)e(r)}function Dr(y,e){if(e(y))return!0;if(y=y.firstChild,y)do{if(Dr(y,e))return!0;y=y.nextSibling}while(y)}function ts(y){return new Promise(function(e,t){var i=new FileReader;i.readAsDataURL(y),i.onloadend=function(){e(i.result)}})}function Le(){this.resolve=null,this.reject=null,this.id=wi(),this.promise=new Promise((y,e)=>{this.resolve=y,this.reject=e}),Object.freeze(this)}function vi(y,e,t){var i;if(typeof y.querySelector<"u"&&(i=y.querySelector(`${e}[*|type="${t}"]`)),!i||i.length===0){i=Rt(y,e);for(var r=0;r<i.length;r++)if(i[r].getAttributeNS("http://www.idpf.org/2007/ops","type")===t||i[r].getAttribute("epub:type")===t)return i[r]}else return i}function gr(y){for(var e=[],t=y.childNodes,i=0;i<t.length;i++){let r=t[i];r.nodeType===1&&e.push(r)}return e}function mr(y){for(var e=[y];y;y=y.parentNode)e.unshift(y);return e}function Ht(y,e,t){for(var i=[],r=y.childNodes,n=0;n<r.length;n++){let s=r[n];if(s.nodeType===1&&s.nodeName.toLowerCase()===e){if(t)return s;i.push(s)}}if(!t)return i}function sa(y,e){let t;if(!(y===null||e===""))for(t=y.parentNode;t.nodeType===1;){if(t.tagName.toLowerCase()===e)return t;t=t.parentNode}}class is{constructor(){this.collapsed=!1,this.commonAncestorContainer=void 0,this.endContainer=void 0,this.endOffset=void 0,this.startContainer=void 0,this.startOffset=void 0}setStart(e,t){this.startContainer=e,this.startOffset=t,this.endContainer?this.commonAncestorContainer=this._commonAncestorContainer():this.collapse(!0),this._checkCollapsed()}setEnd(e,t){this.endContainer=e,this.endOffset=t,this.startContainer?(this.collapsed=!1,this.commonAncestorContainer=this._commonAncestorContainer()):this.collapse(!1),this._checkCollapsed()}collapse(e){this.collapsed=!0,e?(this.endContainer=this.startContainer,this.endOffset=this.startOffset,this.commonAncestorContainer=this.startContainer.parentNode):(this.startContainer=this.endContainer,this.startOffset=this.endOffset,this.commonAncestorContainer=this.endOffset.parentNode)}selectNode(e){let t=e.parentNode,i=Array.prototype.indexOf.call(t.childNodes,e);this.setStart(t,i),this.setEnd(t,i+1)}selectNodeContents(e){e.childNodes[e.childNodes-1];let t=e.nodeType===3?e.textContent.length:parent.childNodes.length;this.setStart(e,0),this.setEnd(e,t)}_commonAncestorContainer(e,t){var i=mr(e||this.startContainer),r=mr(t||this.endContainer);if(i[0]==r[0]){for(var n=0;n<i.length;n++)if(i[n]!=r[n])return i[n-1]}}_checkCollapsed(){this.startContainer===this.endContainer&&this.startOffset===this.endOffset?this.collapsed=!0:this.collapsed=!1}toString(){}}const aa=Object.freeze(Object.defineProperty({__proto__:null,RangeObject:is,blob2base64:ts,borders:fi,bounds:ui,createBase64Url:vr,createBlob:Kn,createBlobUrl:di,defaults:Xn,defer:Le,documentHeight:ia,extend:ut,filterChildren:Ht,findChildren:gr,getParentByTagName:sa,indexOfElementNode:$n,indexOfNode:Ar,indexOfSorted:hi,indexOfTextNode:na,insert:ra,isElement:Zn,isFloat:Yn,isNumber:Ke,isXml:ei,locationOf:Zt,nodeBounds:pr,parents:mr,parse:Ct,prefixed:jt,qs:Ve,qsa:Rt,qsp:Wt,querySelectorByType:vi,requestAnimationFrame:xr,revokeBlobUrl:Jn,sprint:pi,treeWalker:es,type:Qn,uuid:wi,walk:Dr,windowBounds:ci},Symbol.toStringTag,{value:"Module"}));var Zi,un;function oa(){if(un)return Zi;if(un=1,!y)var y={cwd:function(){return"/"}};function e(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+n)}function t(n,s){for(var a="",u=-1,h=0,d,c=0;c<=n.length;++c){if(c<n.length)d=n.charCodeAt(c);else{if(d===47)break;d=47}if(d===47){if(!(u===c-1||h===1))if(u!==c-1&&h===2){if(a.length<2||a.charCodeAt(a.length-1)!==46||a.charCodeAt(a.length-2)!==46){if(a.length>2){for(var w=a.length-1,m=w;m>=0&&a.charCodeAt(m)!==47;--m);if(m!==w){m===-1?a="":a=a.slice(0,m),u=c,h=0;continue}}else if(a.length===2||a.length===1){a="",u=c,h=0;continue}}s&&(a.length>0?a+="/..":a="..")}else a.length>0?a+="/"+n.slice(u+1,c):a=n.slice(u+1,c);u=c,h=0}else d===46&&h!==-1?++h:h=-1}return a}function i(n,s){var a=s.dir||s.root,u=s.base||(s.name||"")+(s.ext||"");return a?a===s.root?a+u:a+n+u:u}var r={resolve:function(){for(var s="",a=!1,u,h=arguments.length-1;h>=-1&&!a;h--){var d;h>=0?d=arguments[h]:(u===void 0&&(u=y.cwd()),d=u),e(d),d.length!==0&&(s=d+"/"+s,a=d.charCodeAt(0)===47)}return s=t(s,!a),a?s.length>0?"/"+s:"/":s.length>0?s:"."},normalize:function(s){if(e(s),s.length===0)return".";var a=s.charCodeAt(0)===47,u=s.charCodeAt(s.length-1)===47;return s=t(s,!a),s.length===0&&!a&&(s="."),s.length>0&&u&&(s+="/"),a?"/"+s:s},isAbsolute:function(s){return e(s),s.length>0&&s.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var s,a=0;a<arguments.length;++a){var u=arguments[a];e(u),u.length>0&&(s===void 0?s=u:s+="/"+u)}return s===void 0?".":r.normalize(s)},relative:function(s,a){if(e(s),e(a),s===a||(s=r.resolve(s),a=r.resolve(a),s===a))return"";for(var u=1;u<s.length&&s.charCodeAt(u)===47;++u);for(var h=s.length,d=h-u,c=1;c<a.length&&a.charCodeAt(c)===47;++c);for(var w=a.length,m=w-c,N=d<m?d:m,E=-1,f=0;f<=N;++f){if(f===N){if(m>N){if(a.charCodeAt(c+f)===47)return a.slice(c+f+1);if(f===0)return a.slice(c+f)}else d>N&&(s.charCodeAt(u+f)===47?E=f:f===0&&(E=0));break}var v=s.charCodeAt(u+f),g=a.charCodeAt(c+f);if(v!==g)break;v===47&&(E=f)}var D="";for(f=u+E+1;f<=h;++f)(f===h||s.charCodeAt(f)===47)&&(D.length===0?D+="..":D+="/..");return D.length>0?D+a.slice(c+E):(c+=E,a.charCodeAt(c)===47&&++c,a.slice(c))},_makeLong:function(s){return s},dirname:function(s){if(e(s),s.length===0)return".";for(var a=s.charCodeAt(0),u=a===47,h=-1,d=!0,c=s.length-1;c>=1;--c)if(a=s.charCodeAt(c),a===47){if(!d){h=c;break}}else d=!1;return h===-1?u?"/":".":u&&h===1?"//":s.slice(0,h)},basename:function(s,a){if(a!==void 0&&typeof a!="string")throw new TypeError('"ext" argument must be a string');e(s);var u=0,h=-1,d=!0,c;if(a!==void 0&&a.length>0&&a.length<=s.length){if(a.length===s.length&&a===s)return"";var w=a.length-1,m=-1;for(c=s.length-1;c>=0;--c){var N=s.charCodeAt(c);if(N===47){if(!d){u=c+1;break}}else m===-1&&(d=!1,m=c+1),w>=0&&(N===a.charCodeAt(w)?--w===-1&&(h=c):(w=-1,h=m))}return u===h?h=m:h===-1&&(h=s.length),s.slice(u,h)}else{for(c=s.length-1;c>=0;--c)if(s.charCodeAt(c)===47){if(!d){u=c+1;break}}else h===-1&&(d=!1,h=c+1);return h===-1?"":s.slice(u,h)}},extname:function(s){e(s);for(var a=-1,u=0,h=-1,d=!0,c=0,w=s.length-1;w>=0;--w){var m=s.charCodeAt(w);if(m===47){if(!d){u=w+1;break}continue}h===-1&&(d=!1,h=w+1),m===46?a===-1?a=w:c!==1&&(c=1):a!==-1&&(c=-1)}return a===-1||h===-1||c===0||c===1&&a===h-1&&a===u+1?"":s.slice(a,h)},format:function(s){if(s===null||typeof s!="object")throw new TypeError('Parameter "pathObject" must be an object, not '+typeof s);return i("/",s)},parse:function(s){e(s);var a={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return a;var u=s.charCodeAt(0),h=u===47,d;h?(a.root="/",d=1):d=0;for(var c=-1,w=0,m=-1,N=!0,E=s.length-1,f=0;E>=d;--E){if(u=s.charCodeAt(E),u===47){if(!N){w=E+1;break}continue}m===-1&&(N=!1,m=E+1),u===46?c===-1?c=E:f!==1&&(f=1):c!==-1&&(f=-1)}return c===-1||m===-1||f===0||f===1&&c===m-1&&c===w+1?m!==-1&&(w===0&&h?a.base=a.name=s.slice(1,m):a.base=a.name=s.slice(w,m)):(w===0&&h?(a.name=s.slice(1,c),a.base=s.slice(1,m)):(a.name=s.slice(w,c),a.base=s.slice(w,m)),a.ext=s.slice(c,m)),w>0?a.dir=s.slice(0,w-1):h&&(a.dir="/"),a},sep:"/",delimiter:":",posix:null};return Zi=r,Zi}var ua=oa();const Ot=Yt(ua);class It{constructor(e){var t,i;t=e.indexOf("://"),t>-1&&(e=new URL(e).pathname),i=this.parse(e),this.path=e,this.isDirectory(e)?this.directory=e:this.directory=i.dir+"/",this.filename=i.base,this.extension=i.ext.slice(1)}parse(e){return Ot.parse(e)}isAbsolute(e){return Ot.isAbsolute(e||this.path)}isDirectory(e){return e.charAt(e.length-1)==="/"}resolve(e){return Ot.resolve(this.directory,e)}relative(e){var t=e&&e.indexOf("://")>-1;return t?e:Ot.relative(this.directory,e)}splitPath(e){return this.splitPathRe.exec(e).slice(1)}toString(){return this.path}}class At{constructor(e,t){var i=e.indexOf("://")>-1,r=e,n;if(this.Url=void 0,this.href=e,this.protocol="",this.origin="",this.hash="",this.hash="",this.search="",this.base=t,!i&&t!==!1&&typeof t!="string"&&window&&window.location&&(this.base=window.location.href),i||this.base)try{this.base?this.Url=new URL(e,this.base):this.Url=new URL(e),this.href=this.Url.href,this.protocol=this.Url.protocol,this.origin=this.Url.origin,this.hash=this.Url.hash,this.search=this.Url.search,r=this.Url.pathname+(this.Url.search?this.Url.search:"")}catch{this.Url=void 0,this.base&&(n=new It(this.base),r=n.resolve(r))}this.Path=new It(r),this.directory=this.Path.directory,this.filename=this.Path.filename,this.extension=this.Path.extension}path(){return this.Path}resolve(e){var t=e.indexOf("://")>-1,i;return t?e:(i=Ot.resolve(this.directory,e),this.origin+i)}relative(e){return Ot.relative(e,this.directory)}toString(){return this.href}}const Ut=1,yt=3,la=9;class Be{constructor(e,t,i){var r;if(this.str="",this.base={},this.spinePos=0,this.range=!1,this.path={},this.start=null,this.end=null,!(this instanceof Be))return new Be(e,t,i);if(typeof t=="string"?this.base=this.parseComponent(t):typeof t=="object"&&t.steps&&(this.base=t),r=this.checkType(e),r==="string")return this.str=e,ut(this,this.parse(e));if(r==="range")return ut(this,this.fromRange(e,this.base,i));if(r==="node")return ut(this,this.fromNode(e,this.base,i));if(r==="EpubCFI"&&e.path)return e;if(e)throw new TypeError("not a valid argument for EpubCFI");return this}checkType(e){return this.isCfiString(e)?"string":e&&typeof e=="object"&&(Qn(e)==="Range"||typeof e.startContainer<"u")?"range":e&&typeof e=="object"&&typeof e.nodeType<"u"?"node":e&&typeof e=="object"&&e instanceof Be?"EpubCFI":!1}parse(e){var t={spinePos:-1,range:!1,base:{},path:{},start:null,end:null},i,r,n;return typeof e!="string"?{spinePos:-1}:(e.indexOf("epubcfi(")===0&&e[e.length-1]===")"&&(e=e.slice(8,e.length-1)),i=this.getChapterComponent(e),i?(t.base=this.parseComponent(i),r=this.getPathComponent(e),t.path=this.parseComponent(r),n=this.getRange(e),n&&(t.range=!0,t.start=this.parseComponent(n[0]),t.end=this.parseComponent(n[1])),t.spinePos=t.base.steps[1].index,t):{spinePos:-1})}parseComponent(e){var t={steps:[],terminal:{offset:null,assertion:null}},i=e.split(":"),r=i[0].split("/"),n;return i.length>1&&(n=i[1],t.terminal=this.parseTerminal(n)),r[0]===""&&r.shift(),t.steps=r.map((function(s){return this.parseStep(s)}).bind(this)),t}parseStep(e){var t,i,r,n,s;if(n=e.match(/\[(.*)\]/),n&&n[1]&&(s=n[1]),i=parseInt(e),!isNaN(i))return i%2===0?(t="element",r=i/2-1):(t="text",r=(i-1)/2),{type:t,index:r,id:s||null}}parseTerminal(e){var t,i,r=e.match(/\[(.*)\]/);return r&&r[1]?(t=parseInt(e.split("[")[0]),i=r[1]):t=parseInt(e),Ke(t)||(t=null),{offset:t,assertion:i}}getChapterComponent(e){var t=e.split("!");return t[0]}getPathComponent(e){var t=e.split("!");if(t[1])return t[1].split(",")[0]}getRange(e){var t=e.split(",");return t.length===3?[t[1],t[2]]:!1}getCharecterOffsetComponent(e){var t=e.split(":");return t[1]||""}joinSteps(e){return e?e.map(function(t){var i="";return t.type==="element"&&(i+=(t.index+1)*2),t.type==="text"&&(i+=1+2*t.index),t.id&&(i+="["+t.id+"]"),i}).join("/"):""}segmentString(e){var t="/";return t+=this.joinSteps(e.steps),e.terminal&&e.terminal.offset!=null&&(t+=":"+e.terminal.offset),e.terminal&&e.terminal.assertion!=null&&(t+="["+e.terminal.assertion+"]"),t}toString(){var e="epubcfi(";return e+=this.segmentString(this.base),e+="!",e+=this.segmentString(this.path),this.range&&this.start&&(e+=",",e+=this.segmentString(this.start)),this.range&&this.end&&(e+=",",e+=this.segmentString(this.end)),e+=")",e}compare(e,t){var i,r,n,s;if(typeof e=="string"&&(e=new Be(e)),typeof t=="string"&&(t=new Be(t)),e.spinePos>t.spinePos)return 1;if(e.spinePos<t.spinePos)return-1;e.range?(i=e.path.steps.concat(e.start.steps),n=e.start.terminal):(i=e.path.steps,n=e.path.terminal),t.range?(r=t.path.steps.concat(t.start.steps),s=t.start.terminal):(r=t.path.steps,s=t.path.terminal);for(var a=0;a<i.length;a++){if(!i[a])return-1;if(!r[a]||i[a].index>r[a].index)return 1;if(i[a].index<r[a].index)return-1}return i.length<r.length?-1:n.offset>s.offset?1:n.offset<s.offset?-1:0}step(e){var t=e.nodeType===yt?"text":"element";return{id:e.id,tagName:e.tagName,type:t,index:this.position(e)}}filteredStep(e,t){var i=this.filter(e,t),r;if(i)return r=i.nodeType===yt?"text":"element",{id:i.id,tagName:i.tagName,type:r,index:this.filteredPosition(i,t)}}pathTo(e,t,i){for(var r={steps:[],terminal:{offset:null,assertion:null}},n=e,s;n&&n.parentNode&&n.parentNode.nodeType!=la;)i?s=this.filteredStep(n,i):s=this.step(n),s&&r.steps.unshift(s),n=n.parentNode;return t!=null&&t>=0&&(r.terminal.offset=t,r.steps[r.steps.length-1].type!="text"&&r.steps.push({type:"text",index:0})),r}equalStep(e,t){return!e||!t?!1:e.index===t.index&&e.id===t.id&&e.type===t.type}fromRange(e,t,i){var r={range:!1,base:{},path:{},start:null,end:null},n=e.startContainer,s=e.endContainer,a=e.startOffset,u=e.endOffset,h=!1;if(i&&(h=n.ownerDocument.querySelector("."+i)!=null),typeof t=="string"?(r.base=this.parseComponent(t),r.spinePos=r.base.steps[1].index):typeof t=="object"&&(r.base=t),e.collapsed)h&&(a=this.patchOffset(n,a,i)),r.path=this.pathTo(n,a,i);else{r.range=!0,h&&(a=this.patchOffset(n,a,i)),r.start=this.pathTo(n,a,i),h&&(u=this.patchOffset(s,u,i)),r.end=this.pathTo(s,u,i),r.path={steps:[],terminal:null};var d=r.start.steps.length,c;for(c=0;c<d&&this.equalStep(r.start.steps[c],r.end.steps[c]);c++)c===d-1?r.start.terminal===r.end.terminal&&(r.path.steps.push(r.start.steps[c]),r.range=!1):r.path.steps.push(r.start.steps[c]);r.start.steps=r.start.steps.slice(r.path.steps.length),r.end.steps=r.end.steps.slice(r.path.steps.length)}return r}fromNode(e,t,i){var r={range:!1,base:{},path:{},start:null,end:null};return typeof t=="string"?(r.base=this.parseComponent(t),r.spinePos=r.base.steps[1].index):typeof t=="object"&&(r.base=t),r.path=this.pathTo(e,null,i),r}filter(e,t){var i,r,n,s,a,u=!1;return e.nodeType===yt?(u=!0,n=e.parentNode,i=e.parentNode.classList.contains(t)):(u=!1,i=e.classList.contains(t)),i&&u?(s=n.previousSibling,a=n.nextSibling,s&&s.nodeType===yt?r=s:a&&a.nodeType===yt&&(r=a),r||e):i&&!u?!1:e}patchOffset(e,t,i){if(e.nodeType!=yt)throw new Error("Anchor must be a text node");var r=e,n=t;for(e.parentNode.classList.contains(i)&&(r=e.parentNode);r.previousSibling;){if(r.previousSibling.nodeType===Ut)if(r.previousSibling.classList.contains(i))n+=r.previousSibling.textContent.length;else break;else n+=r.previousSibling.textContent.length;r=r.previousSibling}return n}normalizedMap(e,t,i){var r={},n=-1,s,a=e.length,u,h;for(s=0;s<a;s++)u=e[s].nodeType,u===Ut&&e[s].classList.contains(i)&&(u=yt),s>0&&u===yt&&h===yt?r[s]=n:t===u&&(n=n+1,r[s]=n),h=u;return r}position(e){var t,i;return e.nodeType===Ut?(t=e.parentNode.children,t||(t=gr(e.parentNode)),i=Array.prototype.indexOf.call(t,e)):(t=this.textNodes(e.parentNode),i=t.indexOf(e)),i}filteredPosition(e,t){var i,r,n;return e.nodeType===Ut?(i=e.parentNode.children,n=this.normalizedMap(i,Ut,t)):(i=e.parentNode.childNodes,e.parentNode.classList.contains(t)&&(e=e.parentNode,i=e.parentNode.childNodes),n=this.normalizedMap(i,yt,t)),r=Array.prototype.indexOf.call(i,e),n[r]}stepsToXpath(e){var t=[".","*"];return e.forEach(function(i){var r=i.index+1;i.id?t.push("*[position()="+r+" and @id='"+i.id+"']"):i.type==="text"?t.push("text()["+r+"]"):t.push("*["+r+"]")}),t.join("/")}stepsToQuerySelector(e){var t=["html"];return e.forEach(function(i){var r=i.index+1;i.id?t.push("#"+i.id):i.type==="text"||t.push("*:nth-child("+r+")")}),t.join(">")}textNodes(e,t){return Array.prototype.slice.call(e.childNodes).filter(function(i){return i.nodeType===yt?!0:!!(t&&i.classList.contains(t))})}walkToNode(e,t,i){var r=t||document,n=r.documentElement,s,a,u=e.length,h;for(h=0;h<u&&(a=e[h],a.type==="element"?a.id?n=r.getElementById(a.id):(s=n.children||gr(n),n=s[a.index]):a.type==="text"&&(n=this.textNodes(n,i)[a.index]),!!n);h++);return n}findNode(e,t,i){var r=t||document,n,s;return!i&&typeof r.evaluate<"u"?(s=this.stepsToXpath(e),n=r.evaluate(s,r,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue):i?n=this.walkToNode(e,r,i):n=this.walkToNode(e,r),n}fixMiss(e,t,i,r){var n=this.findNode(e.slice(0,-1),i,r),s=n.childNodes,a=this.normalizedMap(s,yt,r),u,h,d=e[e.length-1].index;for(let c in a){if(!a.hasOwnProperty(c))return;if(a[c]===d)if(u=s[c],h=u.textContent.length,t>h)t=t-h;else{u.nodeType===Ut?n=u.childNodes[0]:n=u;break}}return{container:n,offset:t}}toRange(e,t){var i=e||document,r,n,s,a,u,h=this,d,c,w=t?i.querySelector("."+t)!=null:!1,m;if(typeof i.createRange<"u"?r=i.createRange():r=new is,h.range?(n=h.start,d=h.path.steps.concat(n.steps),a=this.findNode(d,i,w?t:null),s=h.end,c=h.path.steps.concat(s.steps),u=this.findNode(c,i,w?t:null)):(n=h.path,d=h.path.steps,a=this.findNode(h.path.steps,i,w?t:null)),a)try{n.terminal.offset!=null?r.setStart(a,n.terminal.offset):r.setStart(a,0)}catch{m=this.fixMiss(d,n.terminal.offset,i,w?t:null),r.setStart(m.container,m.offset)}else return console.log("No startContainer found for",this.toString()),null;if(u)try{s.terminal.offset!=null?r.setEnd(u,s.terminal.offset):r.setEnd(u,0)}catch{m=this.fixMiss(c,h.end.terminal.offset,i,w?t:null),r.setEnd(m.container,m.offset)}return r}isCfiString(e){return typeof e=="string"&&e.indexOf("epubcfi(")===0&&e[e.length-1]===")"}generateChapterComponent(e,t,i){var r=parseInt(t),n=(e+1)*2,s="/"+n+"/";return s+=(r+1)*2,i&&(s+="["+i+"]"),s}collapse(e){this.range&&(this.range=!1,e?(this.path.steps=this.path.steps.concat(this.start.steps),this.path.terminal=this.start.terminal):(this.path.steps=this.path.steps.concat(this.end.steps),this.path.terminal=this.end.terminal))}}class Dt{constructor(e){this.context=e||this,this.hooks=[]}register(){for(var e=0;e<arguments.length;++e)if(typeof arguments[e]=="function")this.hooks.push(arguments[e]);else for(var t=0;t<arguments[e].length;++t)this.hooks.push(arguments[e][t])}deregister(e){let t;for(let i=0;i<this.hooks.length;i++)if(t=this.hooks[i],t===e){this.hooks.splice(i,1);break}}trigger(){var e=arguments,t=this.context,i=[];return this.hooks.forEach(function(r){try{var n=r.apply(t,e)}catch(s){console.log(s)}n&&typeof n.then=="function"&&i.push(n)}),Promise.all(i)}list(){return this.hooks}clear(){return this.hooks=[]}}function rs(y,e){var t,i,r=e.url,n=r.indexOf("://")>-1;y&&(i=Ve(y,"head"),t=Ve(i,"base"),t||(t=y.createElement("base"),i.insertBefore(t,i.firstChild)),!n&&window&&window.location&&(r=window.location.origin+r),t.setAttribute("href",r))}function ha(y,e){var t,i,r=e.canonical;y&&(t=Ve(y,"head"),i=Ve(t,"link[rel='canonical']"),i?i.setAttribute("href",r):(i=y.createElement("link"),i.setAttribute("rel","canonical"),i.setAttribute("href",r),t.appendChild(i)))}function fa(y,e){var t,i,r=e.idref;y&&(t=Ve(y,"head"),i=Ve(t,"link[property='dc.identifier']"),i?i.setAttribute("content",r):(i=y.createElement("meta"),i.setAttribute("name","dc.identifier"),i.setAttribute("content",r),t.appendChild(i)))}function ca(y,e){var t=y.querySelectorAll("a[href]");if(t.length)for(var i=Ve(y.ownerDocument,"base"),r=i?i.getAttribute("href"):void 0,n=(function(a){var u=a.getAttribute("href");if(u.indexOf("mailto:")!==0){var h=u.indexOf("://")>-1;if(h)a.setAttribute("target","_blank");else{var d;try{d=new At(u,r)}catch{}a.onclick=function(){return d&&d.hash?e(d.Path.path+d.hash):e(d?d.Path.path:u),!1}}}}).bind(this),s=0;s<t.length;s++)n(t[s])}function ln(y,e,t){return e.forEach(function(i,r){i&&t[r]&&(i=i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),y=y.replace(new RegExp(i,"g"),t[r]))}),y}function ti(y,e,t,i){var r=typeof window<"u"?window.URL:!1,n=r?"blob":"arraybuffer",s=new Le,a=new XMLHttpRequest,u=XMLHttpRequest.prototype,h;"overrideMimeType"in u||Object.defineProperty(u,"overrideMimeType",{value:function(){}}),t&&(a.withCredentials=!0),a.onreadystatechange=c,a.onerror=d,a.open("GET",y,!0);for(h in i)a.setRequestHeader(h,i[h]);e=="json"&&a.setRequestHeader("Accept","application/json"),e||(e=new It(y).extension),e=="blob"&&(a.responseType=n),ei(e)&&a.overrideMimeType("text/xml"),e=="binary"&&(a.responseType="arraybuffer"),a.send();function d(w){s.reject(w)}function c(){if(this.readyState===XMLHttpRequest.DONE){var w=!1;if((this.responseType===""||this.responseType==="document")&&(w=this.responseXML),this.status===200||this.status===0||w){var m;if(!this.response&&!w)return s.reject({status:this.status,message:"Empty Response",stack:new Error().stack}),s.promise;if(this.status===403)return s.reject({status:this.status,response:this.response,message:"Forbidden",stack:new Error().stack}),s.promise;w?m=this.responseXML:ei(e)?m=Ct(this.response,"text/xml"):e=="xhtml"?m=Ct(this.response,"application/xhtml+xml"):e=="html"||e=="htm"?m=Ct(this.response,"text/html"):e=="json"?m=JSON.parse(this.response):e=="blob"?r?m=this.response:m=new Blob([this.response]):m=this.response,s.resolve(m)}else s.reject({status:this.status,message:this.response,stack:new Error().stack})}}return s.promise}class da{constructor(e,t){this.idref=e.idref,this.linear=e.linear==="yes",this.properties=e.properties,this.index=e.index,this.href=e.href,this.url=e.url,this.canonical=e.canonical,this.next=e.next,this.prev=e.prev,this.cfiBase=e.cfiBase,t?this.hooks=t:(this.hooks={},this.hooks.serialize=new Dt(this),this.hooks.content=new Dt(this)),this.document=void 0,this.contents=void 0,this.output=void 0}load(e){var t=e||this.request||ti,i=new Le,r=i.promise;return this.contents?i.resolve(this.contents):t(this.url).then((function(n){return this.document=n,this.contents=n.documentElement,this.hooks.content.trigger(this.document,this)}).bind(this)).then((function(){i.resolve(this.contents)}).bind(this)).catch(function(n){i.reject(n)}),r}base(){return rs(this.document,this)}render(e){var t=new Le,i=t.promise;return this.output,this.load(e).then((function(r){var n=typeof navigator<"u"&&navigator.userAgent||"",s=n.indexOf("Trident")>=0,a;typeof XMLSerializer>"u"||s?a=Vn.DOMParser:a=XMLSerializer;var u=new a;return this.output=u.serializeToString(r),this.output}).bind(this)).then((function(){return this.hooks.serialize.trigger(this.output,this)}).bind(this)).then((function(){t.resolve(this.output)}).bind(this)).catch(function(r){t.reject(r)}),i}find(e){var t=this,i=[],r=e.toLowerCase(),n=function(s){for(var a=s.textContent.toLowerCase(),u=t.document.createRange(),h,d,c=-1,w,m=150;d!=-1;)d=a.indexOf(r,c+1),d!=-1&&(u=t.document.createRange(),u.setStart(s,d),u.setEnd(s,d+r.length),h=t.cfiFromRange(u),s.textContent.length<m?w=s.textContent:(w=s.textContent.substring(d-m/2,d+m/2),w="..."+w+"..."),i.push({cfi:h,excerpt:w})),c=d};return pi(t.document,function(s){n(s)}),i}search(e,t=5){if(typeof document.createTreeWalker>"u")return this.find(e);let i=[];const r=150,n=this,s=e.toLowerCase(),a=function(c){const N=c.reduce((E,f)=>E+f.textContent,"").toLowerCase().indexOf(s);if(N!=-1){const f=N+s.length;let v=0,g=0;if(N<c[0].length){let D;for(;v<c.length-1&&(g+=c[v].length,!(f<=g));)v+=1;let L=c[0],b=c[v],S=n.document.createRange();S.setStart(L,N);let R=c.slice(0,v).reduce((k,O)=>k+O.textContent.length,0);S.setEnd(b,R>f?f:f-R),D=n.cfiFromRange(S);let I=c.slice(0,v+1).reduce((k,O)=>k+O.textContent,"");I.length>r&&(I=I.substring(N-r/2,N+r/2),I="..."+I+"..."),i.push({cfi:D,excerpt:I})}}},u=document.createTreeWalker(n.document,NodeFilter.SHOW_TEXT,null,!1);let h,d=[];for(;h=u.nextNode();)d.push(h),d.length==t&&(a(d.slice(0,t)),d=d.slice(1,t));return d.length>0&&a(d),i}reconcileLayoutSettings(e){var t={layout:e.layout,spread:e.spread,orientation:e.orientation};return this.properties.forEach(function(i){var r=i.replace("rendition:",""),n=r.indexOf("-"),s,a;n!=-1&&(s=r.slice(0,n),a=r.slice(n+1),t[s]=a)}),t}cfiFromRange(e){return new Be(e,this.cfiBase).toString()}cfiFromElement(e){return new Be(e,this.cfiBase).toString()}unload(){this.document=void 0,this.contents=void 0,this.output=void 0}destroy(){this.unload(),this.hooks.serialize.clear(),this.hooks.content.clear(),this.hooks=void 0,this.idref=void 0,this.linear=void 0,this.properties=void 0,this.index=void 0,this.href=void 0,this.url=void 0,this.next=void 0,this.prev=void 0,this.cfiBase=void 0}}class pa{constructor(){this.spineItems=[],this.spineByHref={},this.spineById={},this.hooks={},this.hooks.serialize=new Dt,this.hooks.content=new Dt,this.hooks.content.register(rs),this.hooks.content.register(ha),this.hooks.content.register(fa),this.epubcfi=new Be,this.loaded=!1,this.items=void 0,this.manifest=void 0,this.spineNodeIndex=void 0,this.baseUrl=void 0,this.length=void 0}unpack(e,t,i){this.items=e.spine,this.manifest=e.manifest,this.spineNodeIndex=e.spineNodeIndex,this.baseUrl=e.baseUrl||e.basePath||"",this.length=this.items.length,this.items.forEach((r,n)=>{var s=this.manifest[r.idref],a;r.index=n,r.cfiBase=this.epubcfi.generateChapterComponent(this.spineNodeIndex,r.index,r.id),r.href&&(r.url=t(r.href,!0),r.canonical=i(r.href)),s&&(r.href=s.href,r.url=t(r.href,!0),r.canonical=i(r.href),s.properties.length&&r.properties.push.apply(r.properties,s.properties)),r.linear==="yes"?(r.prev=(function(){let u=r.index;for(;u>0;){let h=this.get(u-1);if(h&&h.linear)return h;u-=1}}).bind(this),r.next=(function(){let u=r.index;for(;u<this.spineItems.length-1;){let h=this.get(u+1);if(h&&h.linear)return h;u+=1}}).bind(this)):(r.prev=function(){},r.next=function(){}),a=new da(r,this.hooks),this.append(a)}),this.loaded=!0}get(e){var t=0;if(typeof e>"u")for(;t<this.spineItems.length;){let i=this.spineItems[t];if(i&&i.linear)break;t+=1}else this.epubcfi.isCfiString(e)?t=new Be(e).spinePos:typeof e=="number"||isNaN(e)===!1?t=e:typeof e=="string"&&e.indexOf("#")===0?t=this.spineById[e.substring(1)]:typeof e=="string"&&(e=e.split("#")[0],t=this.spineByHref[e]||this.spineByHref[encodeURI(e)]);return this.spineItems[t]||null}append(e){var t=this.spineItems.length;return e.index=t,this.spineItems.push(e),this.spineByHref[decodeURI(e.href)]=t,this.spineByHref[encodeURI(e.href)]=t,this.spineByHref[e.href]=t,this.spineById[e.idref]=t,t}prepend(e){return this.spineByHref[e.href]=0,this.spineById[e.idref]=0,this.spineItems.forEach(function(t,i){t.index=i}),0}remove(e){var t=this.spineItems.indexOf(e);if(t>-1)return delete this.spineByHref[e.href],delete this.spineById[e.idref],this.spineItems.splice(t,1)}each(){return this.spineItems.forEach.apply(this.spineItems,arguments)}first(){let e=0;do{let t=this.get(e);if(t&&t.linear)return t;e+=1}while(e<this.spineItems.length)}last(){let e=this.spineItems.length-1;do{let t=this.get(e);if(t&&t.linear)return t;e-=1}while(e>=0)}destroy(){this.each(e=>e.destroy()),this.spineItems=void 0,this.spineByHref=void 0,this.spineById=void 0,this.hooks.serialize.clear(),this.hooks.content.clear(),this.hooks=void 0,this.epubcfi=void 0,this.loaded=!1,this.items=void 0,this.manifest=void 0,this.spineNodeIndex=void 0,this.baseUrl=void 0,this.length=void 0}}class Cr{constructor(e){this._q=[],this.context=e,this.tick=xr,this.running=!1,this.paused=!1}enqueue(){var e,t,i,r=[].shift.call(arguments),n=arguments;if(!r)throw new Error("No Task Provided");return typeof r=="function"?(e=new Le,t=e.promise,i={task:r,args:n,deferred:e,promise:t}):i={promise:r},this._q.push(i),this.paused==!1&&!this.running&&this.run(),i.promise}dequeue(){var e,t,i;if(this._q.length&&!this.paused){if(e=this._q.shift(),t=e.task,t)return i=t.apply(this.context,e.args),i&&typeof i.then=="function"?i.then((function(){e.deferred.resolve.apply(this.context,arguments)}).bind(this),(function(){e.deferred.reject.apply(this.context,arguments)}).bind(this)):(e.deferred.resolve.apply(this.context,i),e.promise);if(e.promise)return e.promise}else return e=new Le,e.deferred.resolve(),e.promise}dump(){for(;this._q.length;)this.dequeue()}run(){return this.running||(this.running=!0,this.defered=new Le),this.tick.call(window,()=>{this._q.length?this.dequeue().then((function(){this.run()}).bind(this)):(this.defered.resolve(),this.running=void 0)}),this.paused==!0&&(this.paused=!1),this.defered.promise}flush(){if(this.running)return this.running;if(this._q.length)return this.running=this.dequeue().then((function(){return this.running=void 0,this.flush()}).bind(this)),this.running}clear(){this._q=[]}length(){return this._q.length}pause(){this.paused=!0}stop(){this._q=[],this.running=!1,this.paused=!0}}const _i="0.3",li=["keydown","keyup","keypressed","mouseup","mousedown","mousemove","click","touchend","touchstart","touchmove"],he={BOOK:{OPEN_FAILED:"openFailed"},CONTENTS:{EXPAND:"expand",RESIZE:"resize",SELECTED:"selected",SELECTED_RANGE:"selectedRange",LINK_CLICKED:"linkClicked"},LOCATIONS:{CHANGED:"changed"},MANAGERS:{RESIZE:"resize",RESIZED:"resized",ORIENTATION_CHANGE:"orientationchange",ADDED:"added",SCROLL:"scroll",SCROLLED:"scrolled",REMOVED:"removed"},VIEWS:{AXIS:"axis",WRITING_MODE:"writingMode",LOAD_ERROR:"loaderror",RENDERED:"rendered",RESIZED:"resized",DISPLAYED:"displayed",SHOWN:"shown",HIDDEN:"hidden",MARK_CLICKED:"markClicked"},RENDITION:{STARTED:"started",ATTACHED:"attached",DISPLAYED:"displayed",DISPLAY_ERROR:"displayerror",RENDERED:"rendered",REMOVED:"removed",RESIZED:"resized",ORIENTATION_CHANGE:"orientationchange",LOCATION_CHANGED:"locationChanged",RELOCATED:"relocated",MARK_CLICKED:"markClicked",SELECTED:"selected",LAYOUT:"layout"},LAYOUT:{UPDATED:"updated"},ANNOTATION:{ATTACH:"attach",DETACH:"detach"}};class ns{constructor(e,t,i){this.spine=e,this.request=t,this.pause=i||100,this.q=new Cr(this),this.epubcfi=new Be,this._locations=[],this._locationsWords=[],this.total=0,this.break=150,this._current=0,this._wordCounter=0,this.currentLocation="",this._currentCfi="",this.processingTimeout=void 0}generate(e){return e&&(this.break=e),this.q.pause(),this.spine.each((function(t){t.linear&&this.q.enqueue(this.process.bind(this),t)}).bind(this)),this.q.run().then((function(){return this.total=this._locations.length-1,this._currentCfi&&(this.currentLocation=this._currentCfi),this._locations}).bind(this))}createRange(){return{startContainer:void 0,startOffset:void 0,endContainer:void 0,endOffset:void 0}}process(e){return e.load(this.request).then((function(t){var i=new Le,r=this.parse(t,e.cfiBase);return this._locations=this._locations.concat(r),e.unload(),this.processingTimeout=setTimeout(()=>i.resolve(r),this.pause),i.promise}).bind(this))}parse(e,t,i){var r=[],n,s=e.ownerDocument,a=Ve(s,"body"),u=0,h,d=i||this.break,c=function(w){var m=w.length,N,E=0;if(w.textContent.trim().length===0)return!1;for(u==0&&(n=this.createRange(),n.startContainer=w,n.startOffset=0),N=d-u,N>m&&(u+=m,E=m);E<m;)if(N=d-u,u===0&&(E+=1,n=this.createRange(),n.startContainer=w,n.startOffset=E),E+N>=m)u+=m-E,E=m;else{E+=N,n.endContainer=w,n.endOffset=E;let f=new Be(n,t).toString();r.push(f),u=0}h=w};if(pi(a,c.bind(this)),n&&n.startContainer&&h){n.endContainer=h,n.endOffset=h.length;let w=new Be(n,t).toString();r.push(w),u=0}return r}generateFromWords(e,t,i){var r=e?new Be(e):void 0;return this.q.pause(),this._locationsWords=[],this._wordCounter=0,this.spine.each((function(n){n.linear&&(r?n.index>=r.spinePos&&this.q.enqueue(this.processWords.bind(this),n,t,r,i):this.q.enqueue(this.processWords.bind(this),n,t,r,i))}).bind(this)),this.q.run().then((function(){return this._currentCfi&&(this.currentLocation=this._currentCfi),this._locationsWords}).bind(this))}processWords(e,t,i,r){return r&&this._locationsWords.length>=r?Promise.resolve():e.load(this.request).then((function(n){var s=new Le,a=this.parseWords(n,e,t,i),u=r-this._locationsWords.length;return this._locationsWords=this._locationsWords.concat(a.length>=r?a.slice(0,u):a),e.unload(),this.processingTimeout=setTimeout(()=>s.resolve(a),this.pause),s.promise}).bind(this))}countWords(e){return e=e.replace(/(^\s*)|(\s*$)/gi,""),e=e.replace(/[ ]{2,}/gi," "),e=e.replace(/\n /,`
`),e.split(" ").length}parseWords(e,t,i,r){var n=t.cfiBase,s=[],a=e.ownerDocument,u=Ve(a,"body"),h=i,d=r?r.spinePos!==t.index:!0,c;r&&t.index===r.spinePos&&(c=r.findNode(r.range?r.path.steps.concat(r.start.steps):r.path.steps,e.ownerDocument));var w=function(m){if(!d)if(m===c)d=!0;else return!1;if(m.textContent.length<10&&m.textContent.trim().length===0)return!1;var N=this.countWords(m.textContent),E,f=0;if(N===0)return!1;for(E=h-this._wordCounter,E>N&&(this._wordCounter+=N,f=N);f<N;)if(E=h-this._wordCounter,f+E>=N)this._wordCounter+=N-f,f=N;else{f+=E;let v=new Be(m,n);s.push({cfi:v.toString(),wordCount:this._wordCounter}),this._wordCounter=0}};return pi(u,w.bind(this)),s}locationFromCfi(e){let t;return Be.prototype.isCfiString(e)&&(e=new Be(e)),this._locations.length===0?-1:(t=Zt(e,this._locations,this.epubcfi.compare),t>this.total?this.total:t)}percentageFromCfi(e){if(this._locations.length===0)return null;var t=this.locationFromCfi(e);return this.percentageFromLocation(t)}percentageFromLocation(e){return!e||!this.total?0:e/this.total}cfiFromLocation(e){var t=-1;return typeof e!="number"&&(e=parseInt(e)),e>=0&&e<this._locations.length&&(t=this._locations[e]),t}cfiFromPercentage(e){let t;if(e>1&&console.warn("Normalize cfiFromPercentage value to between 0 - 1"),e>=1){let i=new Be(this._locations[this.total]);return i.collapse(),i.toString()}return t=Math.ceil(this.total*e),this.cfiFromLocation(t)}load(e){return typeof e=="string"?this._locations=JSON.parse(e):this._locations=e,this.total=this._locations.length-1,this._locations}save(){return JSON.stringify(this._locations)}getCurrent(){return this._current}setCurrent(e){var t;if(typeof e=="string")this._currentCfi=e;else if(typeof e=="number")this._current=e;else return;this._locations.length!==0&&(typeof e=="string"?(t=this.locationFromCfi(e),this._current=t):t=e,this.emit(he.LOCATIONS.CHANGED,{percentage:this.percentageFromLocation(t)}))}get currentLocation(){return this._current}set currentLocation(e){this.setCurrent(e)}length(){return this._locations.length}destroy(){this.spine=void 0,this.request=void 0,this.pause=void 0,this.q.stop(),this.q=void 0,this.epubcfi=void 0,this._locations=void 0,this.total=void 0,this.break=void 0,this._current=void 0,this.currentLocation=void 0,this._currentCfi=void 0,clearTimeout(this.processingTimeout)}}St(ns.prototype);class va{constructor(e){this.packagePath="",this.directory="",this.encoding="",e&&this.parse(e)}parse(e){var t;if(!e)throw new Error("Container File Not Found");if(t=Ve(e,"rootfile"),!t)throw new Error("No RootFile Found");this.packagePath=t.getAttribute("full-path"),this.directory=Ot.dirname(this.packagePath),this.encoding=e.xmlEncoding}destroy(){this.packagePath=void 0,this.directory=void 0,this.encoding=void 0}}class hn{constructor(e){this.manifest={},this.navPath="",this.ncxPath="",this.coverPath="",this.spineNodeIndex=0,this.spine=[],this.metadata={},e&&this.parse(e)}parse(e){var t,i,r;if(!e)throw new Error("Package File Not Found");if(t=Ve(e,"metadata"),!t)throw new Error("No Metadata Found");if(i=Ve(e,"manifest"),!i)throw new Error("No Manifest Found");if(r=Ve(e,"spine"),!r)throw new Error("No Spine Found");return this.manifest=this.parseManifest(i),this.navPath=this.findNavPath(i),this.ncxPath=this.findNcxPath(i,r),this.coverPath=this.findCoverPath(e),this.spineNodeIndex=$n(r),this.spine=this.parseSpine(r,this.manifest),this.uniqueIdentifier=this.findUniqueIdentifier(e),this.metadata=this.parseMetadata(t),this.metadata.direction=r.getAttribute("page-progression-direction"),{metadata:this.metadata,spine:this.spine,manifest:this.manifest,navPath:this.navPath,ncxPath:this.ncxPath,coverPath:this.coverPath,spineNodeIndex:this.spineNodeIndex}}parseMetadata(e){var t={};return t.title=this.getElementText(e,"title"),t.creator=this.getElementText(e,"creator"),t.description=this.getElementText(e,"description"),t.pubdate=this.getElementText(e,"date"),t.publisher=this.getElementText(e,"publisher"),t.identifier=this.getElementText(e,"identifier"),t.language=this.getElementText(e,"language"),t.rights=this.getElementText(e,"rights"),t.modified_date=this.getPropertyText(e,"dcterms:modified"),t.layout=this.getPropertyText(e,"rendition:layout"),t.orientation=this.getPropertyText(e,"rendition:orientation"),t.flow=this.getPropertyText(e,"rendition:flow"),t.viewport=this.getPropertyText(e,"rendition:viewport"),t.media_active_class=this.getPropertyText(e,"media:active-class"),t.spread=this.getPropertyText(e,"rendition:spread"),t}parseManifest(e){var t={},i=Rt(e,"item"),r=Array.prototype.slice.call(i);return r.forEach(function(n){var s=n.getAttribute("id"),a=n.getAttribute("href")||"",u=n.getAttribute("media-type")||"",h=n.getAttribute("media-overlay")||"",d=n.getAttribute("properties")||"";t[s]={href:a,type:u,overlay:h,properties:d.length?d.split(" "):[]}}),t}parseSpine(e,t){var i=[],r=Rt(e,"itemref"),n=Array.prototype.slice.call(r);return n.forEach(function(s,a){var u=s.getAttribute("idref"),h=s.getAttribute("properties")||"",d=h.length?h.split(" "):[],c={id:s.getAttribute("id"),idref:u,linear:s.getAttribute("linear")||"yes",properties:d,index:a};i.push(c)}),i}findUniqueIdentifier(e){var t=e.documentElement.getAttribute("unique-identifier");if(!t)return"";var i=e.getElementById(t);return i&&i.localName==="identifier"&&i.namespaceURI==="http://purl.org/dc/elements/1.1/"&&i.childNodes.length>0?i.childNodes[0].nodeValue.trim():""}findNavPath(e){var t=Wt(e,"item",{properties:"nav"});return t?t.getAttribute("href"):!1}findNcxPath(e,t){var i=Wt(e,"item",{"media-type":"application/x-dtbncx+xml"}),r;return i||(r=t.getAttribute("toc"),r&&(i=e.querySelector(`#${r}`))),i?i.getAttribute("href"):!1}findCoverPath(e){var t=Ve(e,"package");t.getAttribute("version");var i=Wt(e,"item",{properties:"cover-image"});if(i)return i.getAttribute("href");var r=Wt(e,"meta",{name:"cover"});if(r){var n=r.getAttribute("content"),s=e.getElementById(n);return s?s.getAttribute("href"):""}else return!1}getElementText(e,t){var i=e.getElementsByTagNameNS("http://purl.org/dc/elements/1.1/",t),r;return!i||i.length===0?"":(r=i[0],r.childNodes.length?r.childNodes[0].nodeValue:"")}getPropertyText(e,t){var i=Wt(e,"meta",{property:t});return i&&i.childNodes.length?i.childNodes[0].nodeValue:""}load(e){this.metadata=e.metadata;let t=e.readingOrder||e.spine;return this.spine=t.map((i,r)=>(i.index=r,i.linear=i.linear||"yes",i)),e.resources.forEach((i,r)=>{this.manifest[r]=i,i.rel&&i.rel[0]==="cover"&&(this.coverPath=i.href)}),this.spineNodeIndex=0,this.toc=e.toc.map((i,r)=>(i.label=i.title,i)),{metadata:this.metadata,spine:this.spine,manifest:this.manifest,navPath:this.navPath,ncxPath:this.ncxPath,coverPath:this.coverPath,spineNodeIndex:this.spineNodeIndex,toc:this.toc}}destroy(){this.manifest=void 0,this.navPath=void 0,this.ncxPath=void 0,this.coverPath=void 0,this.spineNodeIndex=void 0,this.spine=void 0,this.metadata=void 0}}class Yi{constructor(e){this.toc=[],this.tocByHref={},this.tocById={},this.landmarks=[],this.landmarksByType={},this.length=0,e&&this.parse(e)}parse(e){let t=e.nodeType,i,r;t&&(i=Ve(e,"html"),r=Ve(e,"ncx")),t?i?(this.toc=this.parseNav(e),this.landmarks=this.parseLandmarks(e)):r&&(this.toc=this.parseNcx(e)):this.toc=this.load(e),this.length=0,this.unpack(this.toc)}unpack(e){for(var t,i=0;i<e.length;i++)t=e[i],t.href&&(this.tocByHref[t.href]=i),t.id&&(this.tocById[t.id]=i),this.length++,t.subitems.length&&this.unpack(t.subitems)}get(e){var t;return e?(e.indexOf("#")===0?t=this.tocById[e.substring(1)]:e in this.tocByHref&&(t=this.tocByHref[e]),this.getByIndex(e,t,this.toc)):this.toc}getByIndex(e,t,i){if(i.length===0)return;const r=i[t];if(r&&(e===r.id||e===r.href))return r;{let n;for(let s=0;s<i.length&&(n=this.getByIndex(e,t,i[s].subitems),!n);++s);return n}}landmark(e){var t;return e?(t=this.landmarksByType[e],this.landmarks[t]):this.landmarks}parseNav(e){var t=vi(e,"nav","toc"),i=[];if(!t)return i;let r=Ht(t,"ol",!0);return r&&(i=this.parseNavList(r)),i}parseNavList(e,t){const i=[];if(!e||!e.children)return i;for(let r=0;r<e.children.length;r++){const n=this.navItem(e.children[r],t);n&&i.push(n)}return i}navItem(e,t){let i=e.getAttribute("id")||void 0,r=Ht(e,"a",!0)||Ht(e,"span",!0);if(!r)return;let n=r.getAttribute("href")||"";i||(i=n);let s=r.textContent||"",a=[],u=Ht(e,"ol",!0);return u&&(a=this.parseNavList(u,i)),{id:i,href:n,label:s,subitems:a,parent:t}}parseLandmarks(e){var t=vi(e,"nav","landmarks"),i=t?Rt(t,"li"):[],r=i.length,n,s=[],a;if(!i||r===0)return s;for(n=0;n<r;++n)a=this.landmarkItem(i[n]),a&&(s.push(a),this.landmarksByType[a.type]=n);return s}landmarkItem(e){let t=Ht(e,"a",!0);if(!t)return;let i=t.getAttributeNS("http://www.idpf.org/2007/ops","type")||void 0,r=t.getAttribute("href")||"",n=t.textContent||"";return{href:r,label:n,type:i}}parseNcx(e){var t=Rt(e,"navPoint"),i=t.length,r,n={},s=[],a,u;if(!t||i===0)return s;for(r=0;r<i;++r)a=this.ncxItem(t[r]),n[a.id]=a,a.parent?(u=n[a.parent],u.subitems.push(a)):s.push(a);return s}ncxItem(e){var t=e.getAttribute("id")||!1,i=Ve(e,"content"),r=i.getAttribute("src"),n=Ve(e,"navLabel"),s=n.textContent?n.textContent:"",a=[],u=e.parentNode,h;return u&&(u.nodeName==="navPoint"||u.nodeName.split(":").slice(-1)[0]==="navPoint")&&(h=u.getAttribute("id")),{id:t,href:r,label:s,subitems:a,parent:h}}load(e){return e.map(t=>(t.label=t.title,t.subitems=t.children?this.load(t.children):[],t))}forEach(e){return this.toc.forEach(e)}}var Jt={application:{ecmascript:["es","ecma"],javascript:"js",ogg:"ogx",pdf:"pdf",postscript:["ps","ai","eps","epsi","epsf","eps2","eps3"],"rdf+xml":"rdf",smil:["smi","smil"],"xhtml+xml":["xhtml","xht"],xml:["xml","xsl","xsd","opf","ncx"],zip:"zip","x-httpd-eruby":"rhtml","x-latex":"latex","x-maker":["frm","maker","frame","fm","fb","book","fbdoc"],"x-object":"o","x-shockwave-flash":["swf","swfl"],"x-silverlight":"scr","epub+zip":"epub","font-tdpfr":"pfr","inkml+xml":["ink","inkml"],json:"json","jsonml+json":"jsonml","mathml+xml":"mathml","metalink+xml":"metalink",mp4:"mp4s","omdoc+xml":"omdoc",oxps:"oxps","vnd.amazon.ebook":"azw",widget:"wgt","x-dtbook+xml":"dtb","x-dtbresource+xml":"res","x-font-bdf":"bdf","x-font-ghostscript":"gsf","x-font-linux-psf":"psf","x-font-otf":"otf","x-font-pcf":"pcf","x-font-snf":"snf","x-font-ttf":["ttf","ttc"],"x-font-type1":["pfa","pfb","pfm","afm"],"x-font-woff":"woff","x-mobipocket-ebook":["prc","mobi"],"x-mspublisher":"pub","x-nzb":"nzb","x-tgif":"obj","xaml+xml":"xaml","xml-dtd":"dtd","xproc+xml":"xpl","xslt+xml":"xslt","internet-property-stream":"acx","x-compress":"z","x-compressed":"tgz","x-gzip":"gz"},audio:{flac:"flac",midi:["mid","midi","kar","rmi"],mpeg:["mpga","mpega","mp2","mp3","m4a","mp2a","m2a","m3a"],mpegurl:"m3u",ogg:["oga","ogg","spx"],"x-aiff":["aif","aiff","aifc"],"x-ms-wma":"wma","x-wav":"wav",adpcm:"adp",mp4:"mp4a",webm:"weba","x-aac":"aac","x-caf":"caf","x-matroska":"mka","x-pn-realaudio-plugin":"rmp",xm:"xm",mid:["mid","rmi"]},image:{gif:"gif",ief:"ief",jpeg:["jpeg","jpg","jpe"],pcx:"pcx",png:"png","svg+xml":["svg","svgz"],tiff:["tiff","tif"],"x-icon":"ico",bmp:"bmp",webp:"webp","x-pict":["pic","pct"],"x-tga":"tga","cis-cod":"cod"},text:{"cache-manifest":["manifest","appcache"],css:"css",csv:"csv",html:["html","htm","shtml","stm"],mathml:"mml",plain:["txt","text","brf","conf","def","list","log","in","bas"],richtext:"rtx","tab-separated-values":"tsv","x-bibtex":"bib"},video:{mpeg:["mpeg","mpg","mpe","m1v","m2v","mp2","mpa","mpv2"],mp4:["mp4","mp4v","mpg4"],quicktime:["qt","mov"],ogg:"ogv","vnd.mpegurl":["mxu","m4u"],"x-flv":"flv","x-la-asf":["lsf","lsx"],"x-mng":"mng","x-ms-asf":["asf","asx","asr"],"x-ms-wm":"wm","x-ms-wmv":"wmv","x-ms-wmx":"wmx","x-ms-wvx":"wvx","x-msvideo":"avi","x-sgi-movie":"movie","x-matroska":["mpv","mkv","mk3d","mks"],"3gpp2":"3g2",h261:"h261",h263:"h263",h264:"h264",jpeg:"jpgv",jpm:["jpm","jpgm"],mj2:["mj2","mjp2"],"vnd.ms-playready.media.pyv":"pyv","vnd.uvvu.mp4":["uvu","uvvu"],"vnd.vivo":"viv",webm:"webm","x-f4v":"f4v","x-m4v":"m4v","x-ms-vob":"vob","x-smv":"smv"}},ga=(function(){var y,e,t,i,r={};for(y in Jt)if(Jt.hasOwnProperty(y)){for(e in Jt[y])if(Jt[y].hasOwnProperty(e))if(t=Jt[y][e],typeof t=="string")r[t]=y+"/"+e;else for(i=0;i<t.length;i++)r[t[i]]=y+"/"+e}return r})(),ma="text/plain";function ya(y){return y&&ga[y.split(".").pop().toLowerCase()]||ma}const Gt={lookup:ya};class ba{constructor(e,t){this.settings={replacements:t&&t.replacements||"base64",archive:t&&t.archive,resolver:t&&t.resolver,request:t&&t.request},this.process(e)}process(e){this.manifest=e,this.resources=Object.keys(e).map(function(t){return e[t]}),this.replacementUrls=[],this.html=[],this.assets=[],this.css=[],this.urls=[],this.cssUrls=[],this.split(),this.splitUrls()}split(){this.html=this.resources.filter(function(e){if(e.type==="application/xhtml+xml"||e.type==="text/html")return!0}),this.assets=this.resources.filter(function(e){if(e.type!=="application/xhtml+xml"&&e.type!=="text/html")return!0}),this.css=this.resources.filter(function(e){if(e.type==="text/css")return!0})}splitUrls(){this.urls=this.assets.map((function(e){return e.href}).bind(this)),this.cssUrls=this.css.map(function(e){return e.href})}createUrl(e){var t=new At(e),i=Gt.lookup(t.filename);return this.settings.archive?this.settings.archive.createUrl(e,{base64:this.settings.replacements==="base64"}):this.settings.replacements==="base64"?this.settings.request(e,"blob").then(r=>ts(r)).then(r=>vr(r,i)):this.settings.request(e,"blob").then(r=>di(r,i))}replacements(){if(this.settings.replacements==="none")return new Promise((function(t){t(this.urls)}).bind(this));var e=this.urls.map(t=>{var i=this.settings.resolver(t);return this.createUrl(i).catch(r=>(console.error(r),null))});return Promise.all(e).then(t=>(this.replacementUrls=t.filter(i=>typeof i=="string"),t))}replaceCss(e,t){var i=[];return e=e||this.settings.archive,t=t||this.settings.resolver,this.cssUrls.forEach((function(r){var n=this.createCssFile(r,e,t).then((function(s){var a=this.urls.indexOf(r);a>-1&&(this.replacementUrls[a]=s)}).bind(this));i.push(n)}).bind(this)),Promise.all(i)}createCssFile(e){var t;if(Ot.isAbsolute(e))return new Promise(function(s){s()});var i=this.settings.resolver(e),r;this.settings.archive?r=this.settings.archive.getText(i):r=this.settings.request(i,"text");var n=this.urls.map(s=>{var a=this.settings.resolver(s),u=new It(i).relative(a);return u});return r?r.then(s=>(s=ln(s,n,this.replacementUrls),this.settings.replacements==="base64"?t=vr(s,"text/css"):t=di(s,"text/css"),t),s=>new Promise(function(a){a()})):new Promise(function(s){s()})}relativeTo(e,t){return t=t||this.settings.resolver,this.urls.map((function(i){var r=t(i),n=new It(e).relative(r);return n}).bind(this))}get(e){var t=this.urls.indexOf(e);if(t!==-1)return this.replacementUrls.length?new Promise((function(i,r){i(this.replacementUrls[t])}).bind(this)):this.createUrl(e)}substitute(e,t){var i;return t?i=this.relativeTo(t):i=this.urls,ln(e,i,this.replacementUrls)}destroy(){this.settings=void 0,this.manifest=void 0,this.resources=void 0,this.replacementUrls=void 0,this.html=void 0,this.assets=void 0,this.css=void 0,this.urls=void 0,this.cssUrls=void 0}}class Xi{constructor(e){this.pages=[],this.locations=[],this.epubcfi=new Be,this.firstPage=0,this.lastPage=0,this.totalPages=0,this.toc=void 0,this.ncx=void 0,e&&(this.pageList=this.parse(e)),this.pageList&&this.pageList.length&&this.process(this.pageList)}parse(e){var t=Ve(e,"html"),i=Ve(e,"ncx");if(t)return this.parseNav(e);if(i)return this.parseNcx(e)}parseNav(e){var t=vi(e,"nav","page-list"),i=t?Rt(t,"li"):[],r=i.length,n,s=[],a;if(!i||r===0)return s;for(n=0;n<r;++n)a=this.item(i[n]),s.push(a);return s}parseNcx(e){var t=[],i=0,r,n,s,a=0;if(n=Ve(e,"pageList"),!n||(s=Rt(n,"pageTarget"),a=s.length,!s||s.length===0))return t;for(i=0;i<a;++i)r=this.ncxItem(s[i]),t.push(r);return t}ncxItem(e){var t=Ve(e,"navLabel"),i=Ve(t,"text"),r=i.textContent,n=Ve(e,"content"),s=n.getAttribute("src"),a=parseInt(r,10);return{href:s,page:a}}item(e){var t=Ve(e,"a"),i=t.getAttribute("href")||"",r=t.textContent||"",n=parseInt(r),s=i.indexOf("epubcfi"),a,u,h;return s!=-1?(a=i.split("#"),u=a[0],h=a.length>1?a[1]:!1,{cfi:h,href:i,packageUrl:u,page:n}):{href:i,page:n}}process(e){e.forEach(function(t){this.pages.push(t.page),t.cfi&&this.locations.push(t.cfi)},this),this.firstPage=parseInt(this.pages[0]),this.lastPage=parseInt(this.pages[this.pages.length-1]),this.totalPages=this.lastPage-this.firstPage}pageFromCfi(e){var t=-1;if(this.locations.length===0)return-1;var i=hi(e,this.locations,this.epubcfi.compare);return i!=-1?t=this.pages[i]:(i=Zt(e,this.locations,this.epubcfi.compare),t=i-1>=0?this.pages[i-1]:this.pages[0],t!==void 0||(t=-1)),t}cfiFromPage(e){var t=-1;typeof e!="number"&&(e=parseInt(e));var i=this.pages.indexOf(e);return i!=-1&&(t=this.locations[i]),t}pageFromPercentage(e){var t=Math.round(this.totalPages*e);return t}percentageFromPage(e){var t=(e-this.firstPage)/this.totalPages;return Math.round(t*1e3)/1e3}percentageFromCfi(e){var t=this.pageFromCfi(e),i=this.percentageFromPage(t);return i}destroy(){this.pages=void 0,this.locations=void 0,this.epubcfi=void 0,this.pageList=void 0,this.toc=void 0,this.ncx=void 0}}class ss{constructor(e){this.settings=e,this.name=e.layout||"reflowable",this._spread=e.spread!=="none",this._minSpreadWidth=e.minSpreadWidth||800,this._evenSpreads=e.evenSpreads||!1,e.flow==="scrolled"||e.flow==="scrolled-continuous"||e.flow==="scrolled-doc"?this._flow="scrolled":this._flow="paginated",this.width=0,this.height=0,this.spreadWidth=0,this.delta=0,this.columnWidth=0,this.gap=0,this.divisor=1,this.props={name:this.name,spread:this._spread,flow:this._flow,width:0,height:0,spreadWidth:0,delta:0,columnWidth:0,gap:0,divisor:1}}flow(e){return typeof e<"u"&&(e==="scrolled"||e==="scrolled-continuous"||e==="scrolled-doc"?this._flow="scrolled":this._flow="paginated",this.update({flow:this._flow})),this._flow}spread(e,t){return e&&(this._spread=e!=="none",this.update({spread:this._spread})),t>=0&&(this._minSpreadWidth=t),this._spread}calculate(e,t,i){var r=1,n=i||0,s=e,a=t,u=Math.floor(s/12),h,d,c,w;this._spread&&s>=this._minSpreadWidth?r=2:r=1,this.name==="reflowable"&&this._flow==="paginated"&&!(i>=0)&&(n=u%2===0?u:u-1),this.name==="pre-paginated"&&(n=0),r>1?(h=s/r-n,c=h+n):(h=s,c=s),this.name==="pre-paginated"&&r>1&&(s=h),d=h*r+n,w=s,this.width=s,this.height=a,this.spreadWidth=d,this.pageWidth=c,this.delta=w,this.columnWidth=h,this.gap=n,this.divisor=r,this.update({width:s,height:a,spreadWidth:d,pageWidth:c,delta:w,columnWidth:h,gap:n,divisor:r})}format(e,t,i){var r;return this.name==="pre-paginated"?r=e.fit(this.columnWidth,this.height,t):this._flow==="paginated"?r=e.columns(this.width,this.height,this.columnWidth,this.gap,this.settings.direction):i&&i==="horizontal"?r=e.size(null,this.height):r=e.size(this.width,null),r}count(e,t){let i,r;return this.name==="pre-paginated"?(i=1,r=1):this._flow==="paginated"?(t=t||this.delta,i=Math.ceil(e/t),r=i*this.divisor):(t=t||this.height,i=Math.ceil(e/t),r=i),{spreads:i,pages:r}}update(e){if(Object.keys(e).forEach(t=>{this.props[t]===e[t]&&delete e[t]}),Object.keys(e).length>0){let t=ut(this.props,e);this.emit(he.LAYOUT.UPDATED,t,e)}}}St(ss.prototype);class wa{constructor(e){this.rendition=e,this._themes={default:{rules:{},url:"",serialized:""}},this._overrides={},this._current="default",this._injected=[],this.rendition.hooks.content.register(this.inject.bind(this)),this.rendition.hooks.content.register(this.overrides.bind(this))}register(){if(arguments.length!==0){if(arguments.length===1&&typeof arguments[0]=="object")return this.registerThemes(arguments[0]);if(arguments.length===1&&typeof arguments[0]=="string")return this.default(arguments[0]);if(arguments.length===2&&typeof arguments[1]=="string")return this.registerUrl(arguments[0],arguments[1]);if(arguments.length===2&&typeof arguments[1]=="object")return this.registerRules(arguments[0],arguments[1])}}default(e){if(e){if(typeof e=="string")return this.registerUrl("default",e);if(typeof e=="object")return this.registerRules("default",e)}}registerThemes(e){for(var t in e)e.hasOwnProperty(t)&&(typeof e[t]=="string"?this.registerUrl(t,e[t]):this.registerRules(t,e[t]))}registerCss(e,t){this._themes[e]={serialized:t},(this._injected[e]||e=="default")&&this.update(e)}registerUrl(e,t){var i=new At(t);this._themes[e]={url:i.toString()},(this._injected[e]||e=="default")&&this.update(e)}registerRules(e,t){this._themes[e]={rules:t},(this._injected[e]||e=="default")&&this.update(e)}select(e){var t=this._current,i;this._current=e,this.update(e),i=this.rendition.getContents(),i.forEach(r=>{r.removeClass(t),r.addClass(e)})}update(e){var t=this.rendition.getContents();t.forEach(i=>{this.add(e,i)})}inject(e){var t=[],i=this._themes,r;for(var n in i)i.hasOwnProperty(n)&&(n===this._current||n==="default")&&(r=i[n],(r.rules&&Object.keys(r.rules).length>0||r.url&&t.indexOf(r.url)===-1)&&this.add(n,e),this._injected.push(n));this._current!="default"&&e.addClass(this._current)}add(e,t){var i=this._themes[e];!i||!t||(i.url?t.addStylesheet(i.url):i.serialized?(t.addStylesheetCss(i.serialized,e),i.injected=!0):i.rules&&(t.addStylesheetRules(i.rules,e),i.injected=!0))}override(e,t,i){var r=this.rendition.getContents();this._overrides[e]={value:t,priority:i===!0},r.forEach(n=>{n.css(e,this._overrides[e].value,this._overrides[e].priority)})}removeOverride(e){var t=this.rendition.getContents();delete this._overrides[e],t.forEach(i=>{i.css(e)})}overrides(e){var t=this._overrides;for(var i in t)t.hasOwnProperty(i)&&e.css(i,t[i].value,t[i].priority)}fontSize(e){this.override("font-size",e)}font(e){this.override("font-family",e,!0)}destroy(){this.rendition=void 0,this._themes=void 0,this._overrides=void 0,this._current=void 0,this._injected=void 0}}class gi{constructor(e,t,i,r=!1){this.layout=e,this.horizontal=i==="horizontal",this.direction=t||"ltr",this._dev=r}section(e){var t=this.findRanges(e),i=this.rangeListToCfiList(e.section.cfiBase,t);return i}page(e,t,i,r){var n=e&&e.document?e.document.body:!1,s;if(n){if(s=this.rangePairToCfiPair(t,{start:this.findStart(n,i,r),end:this.findEnd(n,i,r)}),this._dev===!0){let a=e.document,u=new Be(s.start).toRange(a),h=new Be(s.end).toRange(a),d=a.defaultView.getSelection(),c=a.createRange();d.removeAllRanges(),c.setStart(u.startContainer,u.startOffset),c.setEnd(h.endContainer,h.endOffset),d.addRange(c)}return s}}walk(e,t){if(!(e&&e.nodeType===Node.TEXT_NODE)){var i={acceptNode:function(u){return u.data.trim().length>0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}},r=i.acceptNode;r.acceptNode=i.acceptNode;for(var n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,r,!1),s,a;(s=n.nextNode())&&(a=t(s),!a););return a}}findRanges(e){for(var t=[],i=e.contents.scrollWidth(),r=Math.ceil(i/this.layout.spreadWidth),n=r*this.layout.divisor,s=this.layout.columnWidth,a=this.layout.gap,u,h,d=0;d<n.pages;d++)u=(s+a)*d,h=s*(d+1)+a*d,t.push({start:this.findStart(e.document.body,u,h),end:this.findEnd(e.document.body,u,h)});return t}findStart(e,t,i){for(var r=[e],n,s,a=e;r.length;)if(n=r.shift(),s=this.walk(n,u=>{var h,d,c,w,m;if(m=pr(u),this.horizontal&&this.direction==="ltr"){if(h=this.horizontal?m.left:m.top,d=this.horizontal?m.right:m.bottom,h>=t&&h<=i)return u;if(d>t)return u;a=u,r.push(u)}else if(this.horizontal&&this.direction==="rtl"){if(h=m.left,d=m.right,d<=i&&d>=t)return u;if(h<i)return u;a=u,r.push(u)}else{if(c=m.top,w=m.bottom,c>=t&&c<=i)return u;if(w>t)return u;a=u,r.push(u)}}),s)return this.findTextStartRange(s,t,i);return this.findTextStartRange(a,t,i)}findEnd(e,t,i){for(var r=[e],n,s=e,a;r.length;)if(n=r.shift(),a=this.walk(n,u=>{var h,d,c,w,m;if(m=pr(u),this.horizontal&&this.direction==="ltr"){if(h=Math.round(m.left),d=Math.round(m.right),h>i&&s)return s;if(d>i)return u;s=u,r.push(u)}else if(this.horizontal&&this.direction==="rtl"){if(h=Math.round(this.horizontal?m.left:m.top),d=Math.round(this.horizontal?m.right:m.bottom),d<t&&s)return s;if(h<t)return u;s=u,r.push(u)}else{if(c=Math.round(m.top),w=Math.round(m.bottom),c>i&&s)return s;if(w>i)return u;s=u,r.push(u)}}),a)return this.findTextEndRange(a,t,i);return this.findTextEndRange(s,t,i)}findTextStartRange(e,t,i){for(var r=this.splitTextNodeIntoRanges(e),n,s,a,u,h,d=0;d<r.length;d++)if(n=r[d],s=n.getBoundingClientRect(),this.horizontal&&this.direction==="ltr"){if(a=s.left,a>=t)return n}else if(this.horizontal&&this.direction==="rtl"){if(h=s.right,h<=i)return n}else if(u=s.top,u>=t)return n;return r[0]}findTextEndRange(e,t,i){for(var r=this.splitTextNodeIntoRanges(e),n,s,a,u,h,d,c,w=0;w<r.length;w++){if(s=r[w],a=s.getBoundingClientRect(),this.horizontal&&this.direction==="ltr"){if(u=a.left,h=a.right,u>i&&n)return n;if(h>i)return s}else if(this.horizontal&&this.direction==="rtl"){if(u=a.left,h=a.right,h<t&&n)return n;if(u<t)return s}else{if(d=a.top,c=a.bottom,d>i&&n)return n;if(c>i)return s}n=s}return r[r.length-1]}splitTextNodeIntoRanges(e,t){var i=[],r=e.textContent||"",n=r.trim(),s,a=e.ownerDocument,u=t||" ",h=n.indexOf(u);if(h===-1||e.nodeType!=Node.TEXT_NODE)return s=a.createRange(),s.selectNodeContents(e),[s];for(s=a.createRange(),s.setStart(e,0),s.setEnd(e,h),i.push(s),s=!1;h!=-1;)h=n.indexOf(u,h+1),h>0&&(s&&(s.setEnd(e,h),i.push(s)),s=a.createRange(),s.setStart(e,h+1));return s&&(s.setEnd(e,n.length),i.push(s)),i}rangePairToCfiPair(e,t){var i=t.start,r=t.end;i.collapse(!0),r.collapse(!1);let n=new Be(i,e).toString(),s=new Be(r,e).toString();return{start:n,end:s}}rangeListToCfiList(e,t){for(var i=[],r,n=0;n<t.length;n++)r=this.rangePairToCfiPair(e,t[n]),i.push(r);return i}axis(e){return e&&(this.horizontal=e==="horizontal"),this.horizontal}}const as=typeof navigator<"u",_a=as&&/Chrome/.test(navigator.userAgent),fn=as&&!_a&&/AppleWebKit/.test(navigator.userAgent),Ea=1;class Sr{constructor(e,t,i,r){this.epubcfi=new Be,this.document=e,this.documentElement=this.document.documentElement,this.content=t||this.document.body,this.window=this.document.defaultView,this._size={width:0,height:0},this.sectionIndex=r||0,this.cfiBase=i||"",this.epubReadingSystem("epub.js",_i),this.called=0,this.active=!0,this.listeners()}static get listenedEvents(){return li}width(e){var t=this.content;return e&&Ke(e)&&(e=e+"px"),e&&(t.style.width=e),parseInt(this.window.getComputedStyle(t).width)}height(e){var t=this.content;return e&&Ke(e)&&(e=e+"px"),e&&(t.style.height=e),parseInt(this.window.getComputedStyle(t).height)}contentWidth(e){var t=this.content||this.document.body;return e&&Ke(e)&&(e=e+"px"),e&&(t.style.width=e),parseInt(this.window.getComputedStyle(t).width)}contentHeight(e){var t=this.content||this.document.body;return e&&Ke(e)&&(e=e+"px"),e&&(t.style.height=e),parseInt(this.window.getComputedStyle(t).height)}textWidth(){let e,t,i=this.document.createRange(),r=this.content||this.document.body,n=fi(r);return i.selectNodeContents(r),e=i.getBoundingClientRect(),t=e.width,n&&n.width&&(t+=n.width),Math.round(t)}textHeight(){let e,t,i=this.document.createRange(),r=this.content||this.document.body;return i.selectNodeContents(r),e=i.getBoundingClientRect(),t=e.bottom,Math.round(t)}scrollWidth(){var e=this.documentElement.scrollWidth;return e}scrollHeight(){var e=this.documentElement.scrollHeight;return e}overflow(e){return e&&(this.documentElement.style.overflow=e),this.window.getComputedStyle(this.documentElement).overflow}overflowX(e){return e&&(this.documentElement.style.overflowX=e),this.window.getComputedStyle(this.documentElement).overflowX}overflowY(e){return e&&(this.documentElement.style.overflowY=e),this.window.getComputedStyle(this.documentElement).overflowY}css(e,t,i){var r=this.content||this.document.body;return t?r.style.setProperty(e,t,i?"important":""):r.style.removeProperty(e),this.window.getComputedStyle(r)[e]}viewport(e){var t=this.document.querySelector("meta[name='viewport']"),i={width:void 0,height:void 0,scale:void 0,minimum:void 0,maximum:void 0,scalable:void 0},r=[],n={};if(t&&t.hasAttribute("content")){let s=t.getAttribute("content"),a=s.match(/width\s*=\s*([^,]*)/),u=s.match(/height\s*=\s*([^,]*)/),h=s.match(/initial-scale\s*=\s*([^,]*)/),d=s.match(/minimum-scale\s*=\s*([^,]*)/),c=s.match(/maximum-scale\s*=\s*([^,]*)/),w=s.match(/user-scalable\s*=\s*([^,]*)/);a&&a.length&&typeof a[1]<"u"&&(i.width=a[1]),u&&u.length&&typeof u[1]<"u"&&(i.height=u[1]),h&&h.length&&typeof h[1]<"u"&&(i.scale=h[1]),d&&d.length&&typeof d[1]<"u"&&(i.minimum=d[1]),c&&c.length&&typeof c[1]<"u"&&(i.maximum=c[1]),w&&w.length&&typeof w[1]<"u"&&(i.scalable=w[1])}return n=Xn(e||{},i),e&&(n.width&&r.push("width="+n.width),n.height&&r.push("height="+n.height),n.scale&&r.push("initial-scale="+n.scale),n.scalable==="no"?(r.push("minimum-scale="+n.scale),r.push("maximum-scale="+n.scale),r.push("user-scalable="+n.scalable)):(n.scalable&&r.push("user-scalable="+n.scalable),n.minimum&&r.push("minimum-scale="+n.minimum),n.maximum&&r.push("minimum-scale="+n.maximum)),t||(t=this.document.createElement("meta"),t.setAttribute("name","viewport"),this.document.querySelector("head").appendChild(t)),t.setAttribute("content",r.join(", ")),this.window.scrollTo(0,0)),n}expand(){this.emit(he.CONTENTS.EXPAND)}listeners(){this.imageLoadListeners(),this.mediaQueryListeners(),this.addEventListeners(),this.addSelectionListeners(),typeof ResizeObserver>"u"?(this.resizeListeners(),this.visibilityListeners()):this.resizeObservers(),this.linksHandler()}removeListeners(){this.removeEventListeners(),this.removeSelectionListeners(),this.observer&&this.observer.disconnect(),clearTimeout(this.expanding)}resizeCheck(){let e=this.textWidth(),t=this.textHeight();(e!=this._size.width||t!=this._size.height)&&(this._size={width:e,height:t},this.onResize&&this.onResize(this._size),this.emit(he.CONTENTS.RESIZE,this._size))}resizeListeners(){clearTimeout(this.expanding),requestAnimationFrame(this.resizeCheck.bind(this)),this.expanding=setTimeout(this.resizeListeners.bind(this),350)}visibilityListeners(){document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&this.active===!1?(this.active=!0,this.resizeListeners()):(this.active=!1,clearTimeout(this.expanding))})}transitionListeners(){let e=this.content;e.style.transitionProperty="font, font-size, font-size-adjust, font-stretch, font-variation-settings, font-weight, width, height",e.style.transitionDuration="0.001ms",e.style.transitionTimingFunction="linear",e.style.transitionDelay="0",this._resizeCheck=this.resizeCheck.bind(this),this.document.addEventListener("transitionend",this._resizeCheck)}mediaQueryListeners(){for(var e=this.document.styleSheets,t=(function(a){a.matches&&!this._expanding&&setTimeout(this.expand.bind(this),1)}).bind(this),i=0;i<e.length;i+=1){var r;try{r=e[i].cssRules}catch{return}if(!r)return;for(var n=0;n<r.length;n+=1)if(r[n].media){var s=this.window.matchMedia(r[n].media.mediaText);s.addListener(t)}}}resizeObservers(){this.observer=new ResizeObserver(e=>{requestAnimationFrame(this.resizeCheck.bind(this))}),this.observer.observe(this.document.documentElement)}mutationObservers(){this.observer=new MutationObserver(t=>{this.resizeCheck()});let e={attributes:!0,childList:!0,characterData:!0,subtree:!0};this.observer.observe(this.document,e)}imageLoadListeners(){for(var e=this.document.querySelectorAll("img"),t,i=0;i<e.length;i++)t=e[i],typeof t.naturalWidth<"u"&&t.naturalWidth===0&&(t.onload=this.expand.bind(this))}fontLoadListeners(){!this.document||!this.document.fonts||this.document.fonts.ready.then((function(){this.resizeCheck()}).bind(this))}root(){return this.document?this.document.documentElement:null}locationOf(e,t){var i,r={left:0,top:0};if(!this.document)return r;if(this.epubcfi.isCfiString(e)){let n=new Be(e).toRange(this.document,t);if(n){try{if(!n.endContainer||n.startContainer==n.endContainer&&n.startOffset==n.endOffset){let s=n.startContainer.textContent.indexOf(" ",n.startOffset);s==-1&&(s=n.startContainer.textContent.length),n.setEnd(n.startContainer,s)}}catch(s){console.error("setting end offset to start container length failed",s)}if(n.startContainer.nodeType===Node.ELEMENT_NODE)i=n.startContainer.getBoundingClientRect(),r.left=i.left,r.top=i.top;else if(fn){let s=n.startContainer,a=new Range;try{s.nodeType===Ea?i=s.getBoundingClientRect():n.startOffset+2<s.length?(a.setStart(s,n.startOffset),a.setEnd(s,n.startOffset+2),i=a.getBoundingClientRect()):n.startOffset-2>0?(a.setStart(s,n.startOffset-2),a.setEnd(s,n.startOffset),i=a.getBoundingClientRect()):i=s.parentNode.getBoundingClientRect()}catch(u){console.error(u,u.stack)}}else i=n.getBoundingClientRect()}}else if(typeof e=="string"&&e.indexOf("#")>-1){let n=e.substring(e.indexOf("#")+1),s=this.document.getElementById(n);if(s)if(fn){let a=new Range;a.selectNode(s),i=a.getBoundingClientRect()}else i=s.getBoundingClientRect()}return i&&(r.left=i.left,r.top=i.top),r}addStylesheet(e){return new Promise((function(t,i){var r,n=!1;if(!this.document){t(!1);return}if(r=this.document.querySelector("link[href='"+e+"']"),r){t(!0);return}r=this.document.createElement("link"),r.type="text/css",r.rel="stylesheet",r.href=e,r.onload=r.onreadystatechange=function(){!n&&(!this.readyState||this.readyState=="complete")&&(n=!0,setTimeout(()=>{t(!0)},1))},this.document.head.appendChild(r)}).bind(this))}_getStylesheetNode(e){var t;return e="epubjs-inserted-css-"+(e||""),this.document?(t=this.document.getElementById(e),t||(t=this.document.createElement("style"),t.id=e,this.document.head.appendChild(t)),t):!1}addStylesheetCss(e,t){if(!this.document||!e)return!1;var i;return i=this._getStylesheetNode(t),i.innerHTML=e,!0}addStylesheetRules(e,t){var i;if(!(!this.document||!e||e.length===0))if(i=this._getStylesheetNode(t).sheet,Object.prototype.toString.call(e)==="[object Array]")for(var r=0,n=e.length;r<n;r++){var s=1,a=e[r],u=e[r][0],h="";Object.prototype.toString.call(a[1][0])==="[object Array]"&&(a=a[1],s=0);for(var d=a.length;s<d;s++){var c=a[s];h+=c[0]+":"+c[1]+(c[2]?" !important":"")+`;
`}i.insertRule(u+"{"+h+"}",i.cssRules.length)}else Object.keys(e).forEach(m=>{const N=e[m];if(Array.isArray(N))N.forEach(E=>{const v=Object.keys(E).map(g=>`${g}:${E[g]}`).join(";");i.insertRule(`${m}{${v}}`,i.cssRules.length)});else{const f=Object.keys(N).map(v=>`${v}:${N[v]}`).join(";");i.insertRule(`${m}{${f}}`,i.cssRules.length)}})}addScript(e){return new Promise((function(t,i){var r,n=!1;if(!this.document){t(!1);return}r=this.document.createElement("script"),r.type="text/javascript",r.async=!0,r.src=e,r.onload=r.onreadystatechange=function(){!n&&(!this.readyState||this.readyState=="complete")&&(n=!0,setTimeout(function(){t(!0)},1))},this.document.head.appendChild(r)}).bind(this))}addClass(e){var t;this.document&&(t=this.content||this.document.body,t&&t.classList.add(e))}removeClass(e){var t;this.document&&(t=this.content||this.document.body,t&&t.classList.remove(e))}addEventListeners(){this.document&&(this._triggerEvent=this.triggerEvent.bind(this),li.forEach(function(e){this.document.addEventListener(e,this._triggerEvent,{passive:!0})},this))}removeEventListeners(){this.document&&(li.forEach(function(e){this.document.removeEventListener(e,this._triggerEvent,{passive:!0})},this),this._triggerEvent=void 0)}triggerEvent(e){this.emit(e.type,e)}addSelectionListeners(){this.document&&(this._onSelectionChange=this.onSelectionChange.bind(this),this.document.addEventListener("selectionchange",this._onSelectionChange,{passive:!0}))}removeSelectionListeners(){this.document&&(this.document.removeEventListener("selectionchange",this._onSelectionChange,{passive:!0}),this._onSelectionChange=void 0)}onSelectionChange(e){this.selectionEndTimeout&&clearTimeout(this.selectionEndTimeout),this.selectionEndTimeout=setTimeout((function(){var t=this.window.getSelection();this.triggerSelectedEvent(t)}).bind(this),250)}triggerSelectedEvent(e){var t,i;e&&e.rangeCount>0&&(t=e.getRangeAt(0),t.collapsed||(i=new Be(t,this.cfiBase).toString(),this.emit(he.CONTENTS.SELECTED,i),this.emit(he.CONTENTS.SELECTED_RANGE,t)))}range(e,t){var i=new Be(e);return i.toRange(this.document,t)}cfiFromRange(e,t){return new Be(e,this.cfiBase,t).toString()}cfiFromNode(e,t){return new Be(e,this.cfiBase,t).toString()}map(e){var t=new gi(e);return t.section()}size(e,t){var i={scale:1,scalable:"no"};this.layoutStyle("scrolling"),e>=0&&(this.width(e),i.width=e,this.css("padding","0 "+e/12+"px")),t>=0&&(this.height(t),i.height=t),this.css("margin","0"),this.css("box-sizing","border-box"),this.viewport(i)}columns(e,t,i,r,n){let s=jt("column-axis"),a=jt("column-gap"),u=jt("column-width"),h=jt("column-fill"),c=this.writingMode().indexOf("vertical")===0?"vertical":"horizontal";this.layoutStyle("paginated"),n==="rtl"&&c==="horizontal"&&this.direction(n),this.width(e),this.height(t),this.viewport({width:e,height:t,scale:1,scalable:"no"}),this.css("overflow-y","hidden"),this.css("margin","0",!0),c==="vertical"?(this.css("padding-top",r/2+"px",!0),this.css("padding-bottom",r/2+"px",!0),this.css("padding-left","20px"),this.css("padding-right","20px"),this.css(s,"vertical")):(this.css("padding-top","20px"),this.css("padding-bottom","20px"),this.css("padding-left",r/2+"px",!0),this.css("padding-right",r/2+"px",!0),this.css(s,"horizontal")),this.css("box-sizing","border-box"),this.css("max-width","inherit"),this.css(h,"auto"),this.css(a,r+"px"),this.css(u,i+"px"),this.css("-webkit-line-box-contain","block glyphs replaced")}scaler(e,t,i){var r="scale("+e+")",n="";this.css("transform-origin","top left"),(t>=0||i>=0)&&(n=" translate("+(t||0)+"px, "+(i||0)+"px )"),this.css("transform",r+n)}fit(e,t,i){var r=this.viewport(),n=parseInt(r.width),s=parseInt(r.height),a=e/n,u=t/s,h=a<u?a:u;if(this.layoutStyle("paginated"),this.width(n),this.height(s),this.overflow("hidden"),this.scaler(h,0,0),this.css("background-size",n*h+"px "+s*h+"px"),this.css("background-color","transparent"),i&&i.properties.includes("page-spread-left")){var d=e-n*h;this.css("margin-left",d+"px")}}direction(e){this.documentElement&&(this.documentElement.style.direction=e)}mapPage(e,t,i,r,n){var s=new gi(t,n);return s.page(this,e,i,r)}linksHandler(){ca(this.content,e=>{this.emit(he.CONTENTS.LINK_CLICKED,e)})}writingMode(e){let t=jt("writing-mode");return e&&this.documentElement&&(this.documentElement.style[t]=e),this.window.getComputedStyle(this.documentElement)[t]||""}layoutStyle(e){return e&&(this._layoutStyle=e,navigator.epubReadingSystem.layoutStyle=this._layoutStyle),this._layoutStyle||"paginated"}epubReadingSystem(e,t){return navigator.epubReadingSystem={name:e,version:t,layoutStyle:this.layoutStyle(),hasFeature:function(i){switch(i){case"dom-manipulation":return!0;case"layout-changes":return!0;case"touch-events":return!0;case"mouse-events":return!0;case"keyboard-events":return!0;case"spine-scripting":return!1;default:return!1}}},navigator.epubReadingSystem}destroy(){this.removeListeners()}}St(Sr.prototype);class xa{constructor(e){this.rendition=e,this.highlights=[],this.underlines=[],this.marks=[],this._annotations={},this._annotationsBySectionIndex={},this.rendition.hooks.render.register(this.inject.bind(this)),this.rendition.hooks.unloaded.register(this.clear.bind(this))}add(e,t,i,r,n,s){let a=encodeURI(t+e),h=new Be(t).spinePos,d=new os({type:e,cfiRange:t,data:i,sectionIndex:h,cb:r,className:n,styles:s});return this._annotations[a]=d,h in this._annotationsBySectionIndex?this._annotationsBySectionIndex[h].push(a):this._annotationsBySectionIndex[h]=[a],this.rendition.views().forEach(w=>{d.sectionIndex===w.index&&d.attach(w)}),d}remove(e,t){let i=encodeURI(e+t);if(i in this._annotations){let r=this._annotations[i];if(t&&r.type!==t)return;this.rendition.views().forEach(s=>{this._removeFromAnnotationBySectionIndex(r.sectionIndex,i),r.sectionIndex===s.index&&r.detach(s)}),delete this._annotations[i]}}_removeFromAnnotationBySectionIndex(e,t){this._annotationsBySectionIndex[e]=this._annotationsAt(e).filter(i=>i!==t)}_annotationsAt(e){return this._annotationsBySectionIndex[e]}highlight(e,t,i,r,n){return this.add("highlight",e,t,i,r,n)}underline(e,t,i,r,n){return this.add("underline",e,t,i,r,n)}mark(e,t,i){return this.add("mark",e,t,i)}each(){return this._annotations.forEach.apply(this._annotations,arguments)}inject(e){let t=e.index;t in this._annotationsBySectionIndex&&this._annotationsBySectionIndex[t].forEach(r=>{this._annotations[r].attach(e)})}clear(e){let t=e.index;t in this._annotationsBySectionIndex&&this._annotationsBySectionIndex[t].forEach(r=>{this._annotations[r].detach(e)})}show(){}hide(){}}class os{constructor({type:e,cfiRange:t,data:i,sectionIndex:r,cb:n,className:s,styles:a}){this.type=e,this.cfiRange=t,this.data=i,this.sectionIndex=r,this.mark=void 0,this.cb=n,this.className=s,this.styles=a}update(e){this.data=e}attach(e){let{cfiRange:t,data:i,type:r,mark:n,cb:s,className:a,styles:u}=this,h;return r==="highlight"?h=e.highlight(t,i,s,a,u):r==="underline"?h=e.underline(t,i,s,a,u):r==="mark"&&(h=e.mark(t,i,s)),this.mark=h,this.emit(he.ANNOTATION.ATTACH,h),h}detach(e){let{cfiRange:t,type:i}=this,r;return e&&(i==="highlight"?r=e.unhighlight(t):i==="underline"?r=e.ununderline(t):i==="mark"&&(r=e.unmark(t))),this.mark=void 0,this.emit(he.ANNOTATION.DETACH,r),r}text(){}}St(os.prototype);var Et={},Qt={},cn;function Aa(){if(cn)return Qt;cn=1,Object.defineProperty(Qt,"__esModule",{value:!0}),Qt.createElement=y;function y(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}return Qt.default={createElement:y},Qt}var qt={},dn;function Da(){if(dn)return qt;dn=1,Object.defineProperty(qt,"__esModule",{value:!0}),qt.proxyMouse=y,qt.clone=e,qt.default={proxyMouse:y};function y(i,r){function n(h){for(var d=r.length-1;d>=0;d--){var c=r[d],w=h.clientX,m=h.clientY;if(h.touches&&h.touches.length&&(w=h.touches[0].clientX,m=h.touches[0].clientY),!!t(c,i,w,m)){c.dispatchEvent(e(h));break}}}if(i.nodeName==="iframe"||i.nodeName==="IFRAME")try{this.target=i.contentDocument}catch{this.target=i}else this.target=i;for(var s=["mouseup","mousedown","click","touchstart"],a=0;a<s.length;a++){var u=s[a];this.target.addEventListener(u,function(h){return n(h)},!1)}}function e(i){var r=Object.assign({},i,{bubbles:!1});try{return new MouseEvent(i.type,r)}catch{var n=document.createEvent("MouseEvents");return n.initMouseEvent(i.type,!1,r.cancelable,r.view,r.detail,r.screenX,r.screenY,r.clientX,r.clientY,r.ctrlKey,r.altKey,r.shiftKey,r.metaKey,r.button,r.relatedTarget),n}}function t(i,r,n,s){var a=r.getBoundingClientRect();function u(m,N,E){var f=m.top-a.top,v=m.left-a.left,g=f+m.height,D=v+m.width;return f<=E&&v<=N&&g>E&&D>N}var h=i.getBoundingClientRect();if(!u(h,n,s))return!1;for(var d=i.getClientRects(),c=0,w=d.length;c<w;c++)if(u(d[c],n,s))return!0;return!1}return qt}var pn;function Ca(){if(pn)return Et;pn=1,Object.defineProperty(Et,"__esModule",{value:!0}),Et.Underline=Et.Highlight=Et.Mark=Et.Pane=void 0;var y=function E(f,v,g){f===null&&(f=Function.prototype);var D=Object.getOwnPropertyDescriptor(f,v);if(D===void 0){var L=Object.getPrototypeOf(f);return L===null?void 0:E(L,v,g)}else{if("value"in D)return D.value;var b=D.get;return b===void 0?void 0:b.call(g)}},e=(function(){function E(f,v){for(var g=0;g<v.length;g++){var D=v[g];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(f,D.key,D)}}return function(f,v,g){return v&&E(f.prototype,v),g&&E(f,g),f}})(),t=Aa(),i=s(t),r=Da(),n=s(r);function s(E){return E&&E.__esModule?E:{default:E}}function a(E,f){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:E}function u(E,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);E.prototype=Object.create(f&&f.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(E,f):E.__proto__=f)}function h(E,f){if(!(E instanceof f))throw new TypeError("Cannot call a class as a function")}Et.Pane=(function(){function E(f){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:document.body;h(this,E),this.target=f,this.element=i.default.createElement("svg"),this.marks=[],this.element.style.position="absolute",this.element.setAttribute("pointer-events","none"),n.default.proxyMouse(this.target,this.marks),this.container=v,this.container.appendChild(this.element),this.render()}return e(E,[{key:"addMark",value:function(v){var g=i.default.createElement("g");return this.element.appendChild(g),v.bind(g,this.container),this.marks.push(v),v.render(),v}},{key:"removeMark",value:function(v){var g=this.marks.indexOf(v);if(g!==-1){var D=v.unbind();this.element.removeChild(D),this.marks.splice(g,1)}}},{key:"render",value:function(){m(this.element,w(this.target,this.container));var v=!0,g=!1,D=void 0;try{for(var L=this.marks[Symbol.iterator](),b;!(v=(b=L.next()).done);v=!0){var S=b.value;S.render()}}catch(R){g=!0,D=R}finally{try{!v&&L.return&&L.return()}finally{if(g)throw D}}}}]),E})();var d=Et.Mark=(function(){function E(){h(this,E),this.element=null}return e(E,[{key:"bind",value:function(v,g){this.element=v,this.container=g}},{key:"unbind",value:function(){var v=this.element;return this.element=null,v}},{key:"render",value:function(){}},{key:"dispatchEvent",value:function(v){this.element&&this.element.dispatchEvent(v)}},{key:"getBoundingClientRect",value:function(){return this.element.getBoundingClientRect()}},{key:"getClientRects",value:function(){for(var v=[],g=this.element.firstChild;g;)v.push(g.getBoundingClientRect()),g=g.nextSibling;return v}},{key:"filteredRanges",value:function(){var v=Array.from(this.range.getClientRects());return v.filter(function(g){for(var D=0;D<v.length;D++){if(v[D]===g)return!0;var L=N(v[D],g);if(L)return!1}return!0})}}]),E})(),c=Et.Highlight=(function(E){u(f,E);function f(v,g,D,L){h(this,f);var b=a(this,(f.__proto__||Object.getPrototypeOf(f)).call(this));return b.range=v,b.className=g,b.data=D||{},b.attributes=L||{},b}return e(f,[{key:"bind",value:function(g,D){y(f.prototype.__proto__||Object.getPrototypeOf(f.prototype),"bind",this).call(this,g,D);for(var L in this.data)this.data.hasOwnProperty(L)&&(this.element.dataset[L]=this.data[L]);for(var L in this.attributes)this.attributes.hasOwnProperty(L)&&this.element.setAttribute(L,this.attributes[L]);this.className&&this.element.classList.add(this.className)}},{key:"render",value:function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);for(var g=this.element.ownerDocument.createDocumentFragment(),D=this.filteredRanges(),L=this.element.getBoundingClientRect(),b=this.container.getBoundingClientRect(),S=0,R=D.length;S<R;S++){var I=D[S],k=i.default.createElement("rect");k.setAttribute("x",I.left-L.left+b.left),k.setAttribute("y",I.top-L.top+b.top),k.setAttribute("height",I.height),k.setAttribute("width",I.width),g.appendChild(k)}this.element.appendChild(g)}}]),f})(d);Et.Underline=(function(E){u(f,E);function f(v,g,D,L){return h(this,f),a(this,(f.__proto__||Object.getPrototypeOf(f)).call(this,v,g,D,L))}return e(f,[{key:"render",value:function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);for(var g=this.element.ownerDocument.createDocumentFragment(),D=this.filteredRanges(),L=this.element.getBoundingClientRect(),b=this.container.getBoundingClientRect(),S=0,R=D.length;S<R;S++){var I=D[S],k=i.default.createElement("rect");k.setAttribute("x",I.left-L.left+b.left),k.setAttribute("y",I.top-L.top+b.top),k.setAttribute("height",I.height),k.setAttribute("width",I.width),k.setAttribute("fill","none");var O=i.default.createElement("line");O.setAttribute("x1",I.left-L.left+b.left),O.setAttribute("x2",I.left-L.left+b.left+I.width),O.setAttribute("y1",I.top-L.top+b.top+I.height-1),O.setAttribute("y2",I.top-L.top+b.top+I.height-1),O.setAttribute("stroke-width",1),O.setAttribute("stroke","black"),O.setAttribute("stroke-linecap","square"),g.appendChild(k),g.appendChild(O)}this.element.appendChild(g)}}]),f})(c);function w(E,f){var v=f.getBoundingClientRect(),g=E.getBoundingClientRect();return{top:g.top-v.top,left:g.left-v.left,height:E.scrollHeight,width:E.scrollWidth}}function m(E,f){E.style.setProperty("top",f.top+"px","important"),E.style.setProperty("left",f.left+"px","important"),E.style.setProperty("height",f.height+"px","important"),E.style.setProperty("width",f.width+"px","important")}function N(E,f){return f.right<=E.right&&f.left>=E.left&&f.top>=E.top&&f.bottom<=E.bottom}return Et}var ai=Ca();class us{constructor(e,t){this.settings=ut({ignoreClass:"",axis:void 0,direction:void 0,width:0,height:0,layout:void 0,globalLayoutProperties:{},method:void 0,forceRight:!1,allowScriptedContent:!1,allowPopups:!1},t||{}),this.id="epubjs-view-"+wi(),this.section=e,this.index=e.index,this.element=this.container(this.settings.axis),this.added=!1,this.displayed=!1,this.rendered=!1,this.fixedWidth=0,this.fixedHeight=0,this.epubcfi=new Be,this.layout=this.settings.layout,this.pane=void 0,this.highlights={},this.underlines={},this.marks={}}container(e){var t=document.createElement("div");return t.classList.add("epub-view"),t.style.height="0px",t.style.width="0px",t.style.overflow="hidden",t.style.position="relative",t.style.display="block",e&&e=="horizontal"?t.style.flex="none":t.style.flex="initial",t}create(){return this.iframe?this.iframe:(this.element||(this.element=this.createContainer()),this.iframe=document.createElement("iframe"),this.iframe.id=this.id,this.iframe.scrolling="no",this.iframe.style.overflow="hidden",this.iframe.seamless="seamless",this.iframe.style.border="none",this.iframe.sandbox="allow-same-origin",this.settings.allowScriptedContent&&(this.iframe.sandbox+=" allow-scripts"),this.settings.allowPopups&&(this.iframe.sandbox+=" allow-popups"),this.iframe.setAttribute("enable-annotation","true"),this.resizing=!0,this.element.style.visibility="hidden",this.iframe.style.visibility="hidden",this.iframe.style.width="0",this.iframe.style.height="0",this._width=0,this._height=0,this.element.setAttribute("ref",this.index),this.added=!0,this.elementBounds=ui(this.element),"srcdoc"in this.iframe?this.supportsSrcdoc=!0:this.supportsSrcdoc=!1,this.settings.method||(this.settings.method=this.supportsSrcdoc?"srcdoc":"write"),this.iframe)}render(e,t){return this.create(),this.size(),this.sectionRender||(this.sectionRender=this.section.render(e)),this.sectionRender.then((function(i){return this.load(i)}).bind(this)).then((function(){let i=this.contents.writingMode(),r;return this.settings.flow==="scrolled"?r=i.indexOf("vertical")===0?"horizontal":"vertical":r=i.indexOf("vertical")===0?"vertical":"horizontal",i.indexOf("vertical")===0&&this.settings.flow==="paginated"&&(this.layout.delta=this.layout.height),this.setAxis(r),this.emit(he.VIEWS.AXIS,r),this.setWritingMode(i),this.emit(he.VIEWS.WRITING_MODE,i),this.layout.format(this.contents,this.section,this.axis),this.addListeners(),new Promise((n,s)=>{this.expand(),this.settings.forceRight&&(this.element.style.marginLeft=this.width()+"px"),n()})}).bind(this),(function(i){return this.emit(he.VIEWS.LOAD_ERROR,i),new Promise((r,n)=>{n(i)})}).bind(this)).then((function(){this.emit(he.VIEWS.RENDERED,this.section)}).bind(this))}reset(){this.iframe&&(this.iframe.style.width="0",this.iframe.style.height="0",this._width=0,this._height=0,this._textWidth=void 0,this._contentWidth=void 0,this._textHeight=void 0,this._contentHeight=void 0),this._needsReframe=!0}size(e,t){var i=e||this.settings.width,r=t||this.settings.height;this.layout.name==="pre-paginated"?this.lock("both",i,r):this.settings.axis==="horizontal"?this.lock("height",i,r):this.lock("width",i,r),this.settings.width=i,this.settings.height=r}lock(e,t,i){var r=fi(this.element),n;this.iframe?n=fi(this.iframe):n={width:0,height:0},e=="width"&&Ke(t)&&(this.lockedWidth=t-r.width-n.width),e=="height"&&Ke(i)&&(this.lockedHeight=i-r.height-n.height),e==="both"&&Ke(t)&&Ke(i)&&(this.lockedWidth=t-r.width-n.width,this.lockedHeight=i-r.height-n.height),this.displayed&&this.iframe&&this.expand()}expand(e){var t=this.lockedWidth,i=this.lockedHeight,r;!this.iframe||this._expanding||(this._expanding=!0,this.layout.name==="pre-paginated"?(t=this.layout.columnWidth,i=this.layout.height):this.settings.axis==="horizontal"?(t=this.contents.textWidth(),t%this.layout.pageWidth>0&&(t=Math.ceil(t/this.layout.pageWidth)*this.layout.pageWidth),this.settings.forceEvenPages&&(r=t/this.layout.pageWidth,this.layout.divisor>1&&this.layout.name==="reflowable"&&r%2>0&&(t+=this.layout.pageWidth))):this.settings.axis==="vertical"&&(i=this.contents.textHeight(),this.settings.flow==="paginated"&&i%this.layout.height>0&&(i=Math.ceil(i/this.layout.height)*this.layout.height)),(this._needsReframe||t!=this._width||i!=this._height)&&this.reframe(t,i),this._expanding=!1)}reframe(e,t){var i;Ke(e)&&(this.element.style.width=e+"px",this.iframe.style.width=e+"px",this._width=e),Ke(t)&&(this.element.style.height=t+"px",this.iframe.style.height=t+"px",this._height=t);let r=this.prevBounds?e-this.prevBounds.width:e,n=this.prevBounds?t-this.prevBounds.height:t;i={width:e,height:t,widthDelta:r,heightDelta:n},this.pane&&this.pane.render(),requestAnimationFrame(()=>{let s;for(let a in this.marks)this.marks.hasOwnProperty(a)&&(s=this.marks[a],this.placeMark(s.element,s.range))}),this.onResize(this,i),this.emit(he.VIEWS.RESIZED,i),this.prevBounds=i,this.elementBounds=ui(this.element)}load(e){var t=new Le,i=t.promise;if(!this.iframe)return t.reject(new Error("No Iframe Available")),i;if(this.iframe.onload=(function(n){this.onLoad(n,t)}).bind(this),this.settings.method==="blobUrl")this.blobUrl=di(e,"application/xhtml+xml"),this.iframe.src=this.blobUrl,this.element.appendChild(this.iframe);else if(this.settings.method==="srcdoc")this.iframe.srcdoc=e,this.element.appendChild(this.iframe);else{if(this.element.appendChild(this.iframe),this.document=this.iframe.contentDocument,!this.document)return t.reject(new Error("No Document Available")),i;if(this.iframe.contentDocument.open(),window.MSApp&&MSApp.execUnsafeLocalFunction){var r=this;MSApp.execUnsafeLocalFunction(function(){r.iframe.contentDocument.write(e)})}else this.iframe.contentDocument.write(e);this.iframe.contentDocument.close()}return i}onLoad(e,t){this.window=this.iframe.contentWindow,this.document=this.iframe.contentDocument,this.contents=new Sr(this.document,this.document.body,this.section.cfiBase,this.section.index),this.rendering=!1;var i=this.document.querySelector("link[rel='canonical']");i?i.setAttribute("href",this.section.canonical):(i=this.document.createElement("link"),i.setAttribute("rel","canonical"),i.setAttribute("href",this.section.canonical),this.document.querySelector("head").appendChild(i)),this.contents.on(he.CONTENTS.EXPAND,()=>{this.displayed&&this.iframe&&(this.expand(),this.contents&&this.layout.format(this.contents))}),this.contents.on(he.CONTENTS.RESIZE,r=>{this.displayed&&this.iframe&&(this.expand(),this.contents&&this.layout.format(this.contents))}),t.resolve(this.contents)}setLayout(e){this.layout=e,this.contents&&(this.layout.format(this.contents),this.expand())}setAxis(e){this.settings.axis=e,e=="horizontal"?this.element.style.flex="none":this.element.style.flex="initial",this.size()}setWritingMode(e){this.writingMode=e}addListeners(){}removeListeners(e){}display(e){var t=new Le;return this.displayed?t.resolve(this):this.render(e).then((function(){this.emit(he.VIEWS.DISPLAYED,this),this.onDisplayed(this),this.displayed=!0,t.resolve(this)}).bind(this),function(i){t.reject(i,this)}),t.promise}show(){this.element.style.visibility="visible",this.iframe&&(this.iframe.style.visibility="visible",this.iframe.style.transform="translateZ(0)",this.iframe.offsetWidth,this.iframe.style.transform=null),this.emit(he.VIEWS.SHOWN,this)}hide(){this.element.style.visibility="hidden",this.iframe.style.visibility="hidden",this.stopExpanding=!0,this.emit(he.VIEWS.HIDDEN,this)}offset(){return{top:this.element.offsetTop,left:this.element.offsetLeft}}width(){return this._width}height(){return this._height}position(){return this.element.getBoundingClientRect()}locationOf(e){this.iframe.getBoundingClientRect();var t=this.contents.locationOf(e,this.settings.ignoreClass);return{left:t.left,top:t.top}}onDisplayed(e){}onResize(e,t){}bounds(e){return(e||!this.elementBounds)&&(this.elementBounds=ui(this.element)),this.elementBounds}highlight(e,t={},i,r="epubjs-hl",n={}){if(!this.contents)return;const s=Object.assign({fill:"yellow","fill-opacity":"0.3","mix-blend-mode":"multiply"},n);let a=this.contents.range(e),u=()=>{this.emit(he.VIEWS.MARK_CLICKED,e,t)};t.epubcfi=e,this.pane||(this.pane=new ai.Pane(this.iframe,this.element));let h=new ai.Highlight(a,r,t,s),d=this.pane.addMark(h);return this.highlights[e]={mark:d,element:d.element,listeners:[u,i]},d.element.setAttribute("ref",r),d.element.addEventListener("click",u),d.element.addEventListener("touchstart",u),i&&(d.element.addEventListener("click",i),d.element.addEventListener("touchstart",i)),d}underline(e,t={},i,r="epubjs-ul",n={}){if(!this.contents)return;const s=Object.assign({stroke:"black","stroke-opacity":"0.3","mix-blend-mode":"multiply"},n);let a=this.contents.range(e),u=()=>{this.emit(he.VIEWS.MARK_CLICKED,e,t)};t.epubcfi=e,this.pane||(this.pane=new ai.Pane(this.iframe,this.element));let h=new ai.Underline(a,r,t,s),d=this.pane.addMark(h);return this.underlines[e]={mark:d,element:d.element,listeners:[u,i]},d.element.setAttribute("ref",r),d.element.addEventListener("click",u),d.element.addEventListener("touchstart",u),i&&(d.element.addEventListener("click",i),d.element.addEventListener("touchstart",i)),d}mark(e,t={},i){if(!this.contents)return;if(e in this.marks)return this.marks[e];let r=this.contents.range(e);if(!r)return;let n=r.commonAncestorContainer,s=n.nodeType===1?n:n.parentNode,a=h=>{this.emit(he.VIEWS.MARK_CLICKED,e,t)};r.collapsed&&n.nodeType===1?(r=new Range,r.selectNodeContents(n)):r.collapsed&&(r=new Range,r.selectNodeContents(s));let u=this.document.createElement("a");return u.setAttribute("ref","epubjs-mk"),u.style.position="absolute",u.dataset.epubcfi=e,t&&Object.keys(t).forEach(h=>{u.dataset[h]=t[h]}),i&&(u.addEventListener("click",i),u.addEventListener("touchstart",i)),u.addEventListener("click",a),u.addEventListener("touchstart",a),this.placeMark(u,r),this.element.appendChild(u),this.marks[e]={element:u,range:r,listeners:[a,i]},s}placeMark(e,t){let i,r,n;if(this.layout.name==="pre-paginated"||this.settings.axis!=="horizontal"){let a=t.getBoundingClientRect();i=a.top,r=a.right}else{let a=t.getClientRects(),u;for(var s=0;s!=a.length;s++)u=a[s],(!n||u.left<n)&&(n=u.left,r=Math.ceil(n/this.layout.props.pageWidth)*this.layout.props.pageWidth-this.layout.gap/2,i=u.top)}e.style.top=`${i}px`,e.style.left=`${r}px`}unhighlight(e){let t;e in this.highlights&&(t=this.highlights[e],this.pane.removeMark(t.mark),t.listeners.forEach(i=>{i&&(t.element.removeEventListener("click",i),t.element.removeEventListener("touchstart",i))}),delete this.highlights[e])}ununderline(e){let t;e in this.underlines&&(t=this.underlines[e],this.pane.removeMark(t.mark),t.listeners.forEach(i=>{i&&(t.element.removeEventListener("click",i),t.element.removeEventListener("touchstart",i))}),delete this.underlines[e])}unmark(e){let t;e in this.marks&&(t=this.marks[e],this.element.removeChild(t.element),t.listeners.forEach(i=>{i&&(t.element.removeEventListener("click",i),t.element.removeEventListener("touchstart",i))}),delete this.marks[e])}destroy(){for(let e in this.highlights)this.unhighlight(e);for(let e in this.underlines)this.ununderline(e);for(let e in this.marks)this.unmark(e);this.blobUrl&&Jn(this.blobUrl),this.displayed&&(this.displayed=!1,this.removeListeners(),this.contents.destroy(),this.stopExpanding=!0,this.element.removeChild(this.iframe),this.pane&&(this.pane.element.remove(),this.pane=void 0),this.iframe=void 0,this.contents=void 0,this._textWidth=null,this._textHeight=null,this._width=null,this._height=null)}}St(us.prototype);function Sa(){var y="reverse",e=Ta();return document.body.appendChild(e),e.scrollLeft>0?y="default":typeof Element<"u"&&Element.prototype.scrollIntoView?(e.children[0].children[1].scrollIntoView(),e.scrollLeft<0&&(y="negative")):(e.scrollLeft=1,e.scrollLeft===0&&(y="negative")),document.body.removeChild(e),y}function Ta(){var y=document.createElement("div");y.dir="rtl",y.style.position="fixed",y.style.width="1px",y.style.height="1px",y.style.top="0px",y.style.left="0px",y.style.overflow="hidden";var e=document.createElement("div");e.style.width="2px";var t=document.createElement("span");t.style.width="1px",t.style.display="inline-block";var i=document.createElement("span");return i.style.width="1px",i.style.display="inline-block",e.appendChild(t),e.appendChild(i),y.appendChild(e),y}var $i,vn;function Tr(){if(vn)return $i;vn=1;function y(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return $i=y,$i}var Ki,gn;function ka(){if(gn)return Ki;gn=1;var y=typeof bt=="object"&&bt&&bt.Object===Object&&bt;return Ki=y,Ki}var Ji,mn;function ls(){if(mn)return Ji;mn=1;var y=ka(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=y||e||Function("return this")();return Ji=t,Ji}var Qi,yn;function Na(){if(yn)return Qi;yn=1;var y=ls(),e=function(){return y.Date.now()};return Qi=e,Qi}var er,bn;function Ra(){if(bn)return er;bn=1;var y=/\s/;function e(t){for(var i=t.length;i--&&y.test(t.charAt(i)););return i}return er=e,er}var tr,wn;function Ia(){if(wn)return tr;wn=1;var y=Ra(),e=/^\s+/;function t(i){return i&&i.slice(0,y(i)+1).replace(e,"")}return tr=t,tr}var ir,_n;function hs(){if(_n)return ir;_n=1;var y=ls(),e=y.Symbol;return ir=e,ir}var rr,En;function Oa(){if(En)return rr;En=1;var y=hs(),e=Object.prototype,t=e.hasOwnProperty,i=e.toString,r=y?y.toStringTag:void 0;function n(s){var a=t.call(s,r),u=s[r];try{s[r]=void 0;var h=!0}catch{}var d=i.call(s);return h&&(a?s[r]=u:delete s[r]),d}return rr=n,rr}var nr,xn;function La(){if(xn)return nr;xn=1;var y=Object.prototype,e=y.toString;function t(i){return e.call(i)}return nr=t,nr}var sr,An;function Ba(){if(An)return sr;An=1;var y=hs(),e=Oa(),t=La(),i="[object Null]",r="[object Undefined]",n=y?y.toStringTag:void 0;function s(a){return a==null?a===void 0?r:i:n&&n in Object(a)?e(a):t(a)}return sr=s,sr}var ar,Dn;function Pa(){if(Dn)return ar;Dn=1;function y(e){return e!=null&&typeof e=="object"}return ar=y,ar}var or,Cn;function Fa(){if(Cn)return or;Cn=1;var y=Ba(),e=Pa(),t="[object Symbol]";function i(r){return typeof r=="symbol"||e(r)&&y(r)==t}return or=i,or}var ur,Sn;function za(){if(Sn)return ur;Sn=1;var y=Ia(),e=Tr(),t=Fa(),i=NaN,r=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=parseInt;function u(h){if(typeof h=="number")return h;if(t(h))return i;if(e(h)){var d=typeof h.valueOf=="function"?h.valueOf():h;h=e(d)?d+"":d}if(typeof h!="string")return h===0?h:+h;h=y(h);var c=n.test(h);return c||s.test(h)?a(h.slice(2),c?2:8):r.test(h)?i:+h}return ur=u,ur}var lr,Tn;function fs(){if(Tn)return lr;Tn=1;var y=Tr(),e=Na(),t=za(),i="Expected a function",r=Math.max,n=Math.min;function s(a,u,h){var d,c,w,m,N,E,f=0,v=!1,g=!1,D=!0;if(typeof a!="function")throw new TypeError(i);u=t(u)||0,y(h)&&(v=!!h.leading,g="maxWait"in h,w=g?r(t(h.maxWait)||0,u):w,D="trailing"in h?!!h.trailing:D);function L(Z){var Y=d,X=c;return d=c=void 0,f=Z,m=a.apply(X,Y),m}function b(Z){return f=Z,N=setTimeout(I,u),v?L(Z):m}function S(Z){var Y=Z-E,X=Z-f,ie=u-Y;return g?n(ie,w-X):ie}function R(Z){var Y=Z-E,X=Z-f;return E===void 0||Y>=u||Y<0||g&&X>=w}function I(){var Z=e();if(R(Z))return k(Z);N=setTimeout(I,S(Z))}function k(Z){return N=void 0,D&&d?L(Z):(d=c=void 0,m)}function O(){N!==void 0&&clearTimeout(N),f=0,d=E=c=N=void 0}function G(){return N===void 0?m:k(e())}function j(){var Z=e(),Y=R(Z);if(d=arguments,c=this,E=Z,Y){if(N===void 0)return b(E);if(g)return clearTimeout(N),N=setTimeout(I,u),L(E)}return N===void 0&&(N=setTimeout(I,u)),m}return j.cancel=O,j.flush=G,j}return lr=s,lr}var hr,kn;function Ma(){if(kn)return hr;kn=1;var y=fs(),e=Tr(),t="Expected a function";function i(r,n,s){var a=!0,u=!0;if(typeof r!="function")throw new TypeError(t);return e(s)&&(a="leading"in s?!!s.leading:a,u="trailing"in s?!!s.trailing:u),y(r,n,{leading:a,maxWait:n,trailing:u})}return hr=i,hr}var Ua=Ma();const qa=Yt(Ua);class ja{constructor(e){this.settings=e||{},this.id="epubjs-container-"+wi(),this.container=this.create(this.settings),this.settings.hidden&&(this.wrapper=this.wrap(this.container))}create(e){let t=e.height,i=e.width,r=e.overflow||!1,n=e.axis||"vertical",s=e.direction;ut(this.settings,e),e.height&&Ke(e.height)&&(t=e.height+"px"),e.width&&Ke(e.width)&&(i=e.width+"px");let a=document.createElement("div");return a.id=this.id,a.classList.add("epub-container"),a.style.wordSpacing="0",a.style.lineHeight="0",a.style.verticalAlign="top",a.style.position="relative",n==="horizontal"&&(a.style.display="flex",a.style.flexDirection="row",a.style.flexWrap="nowrap"),i&&(a.style.width=i),t&&(a.style.height=t),r&&(r==="scroll"&&n==="vertical"?(a.style["overflow-y"]=r,a.style["overflow-x"]="hidden"):r==="scroll"&&n==="horizontal"?(a.style["overflow-y"]="hidden",a.style["overflow-x"]=r):a.style.overflow=r),s&&(a.dir=s,a.style.direction=s),s&&this.settings.fullsize&&(document.body.style.direction=s),a}wrap(e){var t=document.createElement("div");return t.style.visibility="hidden",t.style.overflow="hidden",t.style.width="0",t.style.height="0",t.appendChild(e),t}getElement(e){var t;if(Zn(e)?t=e:typeof e=="string"&&(t=document.getElementById(e)),!t)throw new Error("Not an Element");return t}attachTo(e){var t=this.getElement(e),i;if(t)return this.settings.hidden?i=this.wrapper:i=this.container,t.appendChild(i),this.element=t,t}getContainer(){return this.container}onResize(e){(!Ke(this.settings.width)||!Ke(this.settings.height))&&(this.resizeFunc=qa(e,50),window.addEventListener("resize",this.resizeFunc,!1))}onOrientationChange(e){this.orientationChangeFunc=e,window.addEventListener("orientationchange",this.orientationChangeFunc,!1)}size(e,t){var i;let r=e||this.settings.width,n=t||this.settings.height;e===null?(i=this.element.getBoundingClientRect(),i.width&&(e=Math.floor(i.width),this.container.style.width=e+"px")):Ke(e)?this.container.style.width=e+"px":this.container.style.width=e,t===null?(i=i||this.element.getBoundingClientRect(),i.height&&(t=i.height,this.container.style.height=t+"px")):Ke(t)?this.container.style.height=t+"px":this.container.style.height=t,Ke(e)||(e=this.container.clientWidth),Ke(t)||(t=this.container.clientHeight),this.containerStyles=window.getComputedStyle(this.container),this.containerPadding={left:parseFloat(this.containerStyles["padding-left"])||0,right:parseFloat(this.containerStyles["padding-right"])||0,top:parseFloat(this.containerStyles["padding-top"])||0,bottom:parseFloat(this.containerStyles["padding-bottom"])||0};let s=ci(),a=window.getComputedStyle(document.body),u={left:parseFloat(a["padding-left"])||0,right:parseFloat(a["padding-right"])||0,top:parseFloat(a["padding-top"])||0,bottom:parseFloat(a["padding-bottom"])||0};return r||(e=s.width-u.left-u.right),(this.settings.fullsize&&!n||!n)&&(t=s.height-u.top-u.bottom),{width:e-this.containerPadding.left-this.containerPadding.right,height:t-this.containerPadding.top-this.containerPadding.bottom}}bounds(){let e;return this.container.style.overflow!=="visible"&&(e=this.container&&this.container.getBoundingClientRect()),!e||!e.width||!e.height?ci():e}getSheet(){var e=document.createElement("style");return e.appendChild(document.createTextNode("")),document.head.appendChild(e),e.sheet}addStyleRules(e,t){var i="#"+this.id+" ",r="";this.sheet||(this.sheet=this.getSheet()),t.forEach(function(n){for(var s in n)n.hasOwnProperty(s)&&(r+=s+":"+n[s]+";")}),this.sheet.insertRule(i+e+" {"+r+"}",0)}axis(e){e==="horizontal"?(this.container.style.display="flex",this.container.style.flexDirection="row",this.container.style.flexWrap="nowrap"):this.container.style.display="block",this.settings.axis=e}direction(e){this.container&&(this.container.dir=e,this.container.style.direction=e),this.settings.fullsize&&(document.body.style.direction=e),this.settings.dir=e}overflow(e){this.container&&(e==="scroll"&&this.settings.axis==="vertical"?(this.container.style["overflow-y"]=e,this.container.style["overflow-x"]="hidden"):e==="scroll"&&this.settings.axis==="horizontal"?(this.container.style["overflow-y"]="hidden",this.container.style["overflow-x"]=e):this.container.style.overflow=e),this.settings.overflow=e}destroy(){this.element&&(this.settings.hidden?this.wrapper:this.container,this.element.contains(this.container)&&this.element.removeChild(this.container),window.removeEventListener("resize",this.resizeFunc),window.removeEventListener("orientationChange",this.orientationChangeFunc))}}class Wa{constructor(e){this.container=e,this._views=[],this.length=0,this.hidden=!1}all(){return this._views}first(){return this._views[0]}last(){return this._views[this._views.length-1]}indexOf(e){return this._views.indexOf(e)}slice(){return this._views.slice.apply(this._views,arguments)}get(e){return this._views[e]}append(e){return this._views.push(e),this.container&&this.container.appendChild(e.element),this.length++,e}prepend(e){return this._views.unshift(e),this.container&&this.container.insertBefore(e.element,this.container.firstChild),this.length++,e}insert(e,t){return this._views.splice(t,0,e),this.container&&(t<this.container.children.length?this.container.insertBefore(e.element,this.container.children[t]):this.container.appendChild(e.element)),this.length++,e}remove(e){var t=this._views.indexOf(e);t>-1&&this._views.splice(t,1),this.destroy(e),this.length--}destroy(e){e.displayed&&e.destroy(),this.container&&this.container.removeChild(e.element),e=null}forEach(){return this._views.forEach.apply(this._views,arguments)}clear(){var e,t=this.length;if(this.length){for(var i=0;i<t;i++)e=this._views[i],this.destroy(e);this._views=[],this.length=0}}find(e){for(var t,i=this.length,r=0;r<i;r++)if(t=this._views[r],t.displayed&&t.section.index==e.index)return t}displayed(){for(var e=[],t,i=this.length,r=0;r<i;r++)t=this._views[r],t.displayed&&e.push(t);return e}show(){for(var e,t=this.length,i=0;i<t;i++)e=this._views[i],e.displayed&&e.show();this.hidden=!1}hide(){for(var e,t=this.length,i=0;i<t;i++)e=this._views[i],e.displayed&&e.hide();this.hidden=!0}}class mi{constructor(e){this.name="default",this.optsSettings=e.settings,this.View=e.view,this.request=e.request,this.renditionQueue=e.queue,this.q=new Cr(this),this.settings=ut(this.settings||{},{infinite:!0,hidden:!1,width:void 0,height:void 0,axis:void 0,writingMode:void 0,flow:"scrolled",ignoreClass:"",fullsize:void 0,allowScriptedContent:!1,allowPopups:!1}),ut(this.settings,e.settings||{}),this.viewSettings={ignoreClass:this.settings.ignoreClass,axis:this.settings.axis,flow:this.settings.flow,layout:this.layout,method:this.settings.method,width:0,height:0,forceEvenPages:!0,allowScriptedContent:this.settings.allowScriptedContent,allowPopups:this.settings.allowPopups},this.rendered=!1}render(e,t){let i=e.tagName;typeof this.settings.fullsize>"u"&&i&&(i.toLowerCase()=="body"||i.toLowerCase()=="html")&&(this.settings.fullsize=!0),this.settings.fullsize&&(this.settings.overflow="visible",this.overflow=this.settings.overflow),this.settings.size=t,this.settings.rtlScrollType=Sa(),this.stage=new ja({width:t.width,height:t.height,overflow:this.overflow,hidden:this.settings.hidden,axis:this.settings.axis,fullsize:this.settings.fullsize,direction:this.settings.direction}),this.stage.attachTo(e),this.container=this.stage.getContainer(),this.views=new Wa(this.container),this._bounds=this.bounds(),this._stageSize=this.stage.size(),this.viewSettings.width=this._stageSize.width,this.viewSettings.height=this._stageSize.height,this.stage.onResize(this.onResized.bind(this)),this.stage.onOrientationChange(this.onOrientationChange.bind(this)),this.addEventListeners(),this.layout&&this.updateLayout(),this.rendered=!0}addEventListeners(){var e;window.addEventListener("unload",(function(t){this.destroy()}).bind(this)),this.settings.fullsize?e=window:e=this.container,this._onScroll=this.onScroll.bind(this),e.addEventListener("scroll",this._onScroll)}removeEventListeners(){var e;this.settings.fullsize?e=window:e=this.container,e.removeEventListener("scroll",this._onScroll),this._onScroll=void 0}destroy(){clearTimeout(this.orientationTimeout),clearTimeout(this.resizeTimeout),clearTimeout(this.afterScrolled),this.clear(),this.removeEventListeners(),this.stage.destroy(),this.rendered=!1}onOrientationChange(e){let{orientation:t}=window;this.optsSettings.resizeOnOrientationChange&&this.resize(),clearTimeout(this.orientationTimeout),this.orientationTimeout=setTimeout((function(){this.orientationTimeout=void 0,this.optsSettings.resizeOnOrientationChange&&this.resize(),this.emit(he.MANAGERS.ORIENTATION_CHANGE,t)}).bind(this),500)}onResized(e){this.resize()}resize(e,t,i){let r=this.stage.size(e,t);if(this.winBounds=ci(),this.orientationTimeout&&this.winBounds.width===this.winBounds.height){this._stageSize=void 0;return}this._stageSize&&this._stageSize.width===r.width&&this._stageSize.height===r.height||(this._stageSize=r,this._bounds=this.bounds(),this.clear(),this.viewSettings.width=this._stageSize.width,this.viewSettings.height=this._stageSize.height,this.updateLayout(),this.emit(he.MANAGERS.RESIZED,{width:this._stageSize.width,height:this._stageSize.height},i))}createView(e,t){return new this.View(e,ut(this.viewSettings,{forceRight:t}))}handleNextPrePaginated(e,t,i){let r;if(this.layout.name==="pre-paginated"&&this.layout.divisor>1){if(e||t.index===0)return;if(r=t.next(),r&&!r.properties.includes("page-spread-left"))return i.call(this,r)}}display(e,t){var i=new Le,r=i.promise;(t===e.href||Ke(t))&&(t=void 0);var n=this.views.find(e);if(n&&e&&this.layout.name!=="pre-paginated"){let a=n.offset();if(this.settings.direction==="ltr")this.scrollTo(a.left,a.top,!0);else{let u=n.width();this.scrollTo(a.left+u,a.top,!0)}if(t){let u=n.locationOf(t),h=n.width();this.moveTo(u,h)}return i.resolve(),r}this.clear();let s=!1;return this.layout.name==="pre-paginated"&&this.layout.divisor===2&&e.properties.includes("page-spread-right")&&(s=!0),this.add(e,s).then((function(a){if(t){let u=a.locationOf(t),h=a.width();this.moveTo(u,h)}}).bind(this),a=>{i.reject(a)}).then((function(){return this.handleNextPrePaginated(s,e,this.add)}).bind(this)).then((function(){this.views.show(),i.resolve()}).bind(this)),r}afterDisplayed(e){this.emit(he.MANAGERS.ADDED,e)}afterResized(e){this.emit(he.MANAGERS.RESIZE,e.section)}moveTo(e,t){var i=0,r=0;this.isPaginated?(i=Math.floor(e.left/this.layout.delta)*this.layout.delta,i+this.layout.delta>this.container.scrollWidth&&(i=this.container.scrollWidth-this.layout.delta),r=Math.floor(e.top/this.layout.delta)*this.layout.delta,r+this.layout.delta>this.container.scrollHeight&&(r=this.container.scrollHeight-this.layout.delta)):r=e.top,this.settings.direction==="rtl"&&(i=i+this.layout.delta,i=i-t),this.scrollTo(i,r,!0)}add(e,t){var i=this.createView(e,t);return this.views.append(i),i.onDisplayed=this.afterDisplayed.bind(this),i.onResize=this.afterResized.bind(this),i.on(he.VIEWS.AXIS,r=>{this.updateAxis(r)}),i.on(he.VIEWS.WRITING_MODE,r=>{this.updateWritingMode(r)}),i.display(this.request)}append(e,t){var i=this.createView(e,t);return this.views.append(i),i.onDisplayed=this.afterDisplayed.bind(this),i.onResize=this.afterResized.bind(this),i.on(he.VIEWS.AXIS,r=>{this.updateAxis(r)}),i.on(he.VIEWS.WRITING_MODE,r=>{this.updateWritingMode(r)}),i.display(this.request)}prepend(e,t){var i=this.createView(e,t);return i.on(he.VIEWS.RESIZED,r=>{this.counter(r)}),this.views.prepend(i),i.onDisplayed=this.afterDisplayed.bind(this),i.onResize=this.afterResized.bind(this),i.on(he.VIEWS.AXIS,r=>{this.updateAxis(r)}),i.on(he.VIEWS.WRITING_MODE,r=>{this.updateWritingMode(r)}),i.display(this.request)}counter(e){this.settings.axis==="vertical"?this.scrollBy(0,e.heightDelta,!0):this.scrollBy(e.widthDelta,0,!0)}next(){var e,t;let i=this.settings.direction;if(this.views.length&&(this.isPaginated&&this.settings.axis==="horizontal"&&(!i||i==="ltr")?(this.scrollLeft=this.container.scrollLeft,t=this.container.scrollLeft+this.container.offsetWidth+this.layout.delta,t<=this.container.scrollWidth?this.scrollBy(this.layout.delta,0,!0):e=this.views.last().section.next()):this.isPaginated&&this.settings.axis==="horizontal"&&i==="rtl"?(this.scrollLeft=this.container.scrollLeft,this.settings.rtlScrollType==="default"?(t=this.container.scrollLeft,t>0?this.scrollBy(this.layout.delta,0,!0):e=this.views.last().section.next()):(t=this.container.scrollLeft+this.layout.delta*-1,t>this.container.scrollWidth*-1?this.scrollBy(this.layout.delta,0,!0):e=this.views.last().section.next())):this.isPaginated&&this.settings.axis==="vertical"?(this.scrollTop=this.container.scrollTop,this.container.scrollTop+this.container.offsetHeight<this.container.scrollHeight?this.scrollBy(0,this.layout.height,!0):e=this.views.last().section.next()):e=this.views.last().section.next(),e)){this.clear(),this.updateLayout();let r=!1;return this.layout.name==="pre-paginated"&&this.layout.divisor===2&&e.properties.includes("page-spread-right")&&(r=!0),this.append(e,r).then((function(){return this.handleNextPrePaginated(r,e,this.append)}).bind(this),n=>n).then((function(){!this.isPaginated&&this.settings.axis==="horizontal"&&this.settings.direction==="rtl"&&this.settings.rtlScrollType==="default"&&this.scrollTo(this.container.scrollWidth,0,!0),this.views.show()}).bind(this))}}prev(){var e,t;let i=this.settings.direction;if(this.views.length&&(this.isPaginated&&this.settings.axis==="horizontal"&&(!i||i==="ltr")?(this.scrollLeft=this.container.scrollLeft,t=this.container.scrollLeft,t>0?this.scrollBy(-this.layout.delta,0,!0):e=this.views.first().section.prev()):this.isPaginated&&this.settings.axis==="horizontal"&&i==="rtl"?(this.scrollLeft=this.container.scrollLeft,this.settings.rtlScrollType==="default"?(t=this.container.scrollLeft+this.container.offsetWidth,t<this.container.scrollWidth?this.scrollBy(-this.layout.delta,0,!0):e=this.views.first().section.prev()):(t=this.container.scrollLeft,t<0?this.scrollBy(-this.layout.delta,0,!0):e=this.views.first().section.prev())):this.isPaginated&&this.settings.axis==="vertical"?(this.scrollTop=this.container.scrollTop,this.container.scrollTop>0?this.scrollBy(0,-this.layout.height,!0):e=this.views.first().section.prev()):e=this.views.first().section.prev(),e)){this.clear(),this.updateLayout();let r=!1;return this.layout.name==="pre-paginated"&&this.layout.divisor===2&&typeof e.prev()!="object"&&(r=!0),this.prepend(e,r).then((function(){var n;if(this.layout.name==="pre-paginated"&&this.layout.divisor>1&&(n=e.prev(),n))return this.prepend(n)}).bind(this),n=>n).then((function(){this.isPaginated&&this.settings.axis==="horizontal"&&(this.settings.direction==="rtl"?this.settings.rtlScrollType==="default"?this.scrollTo(0,0,!0):this.scrollTo(this.container.scrollWidth*-1+this.layout.delta,0,!0):this.scrollTo(this.container.scrollWidth-this.layout.delta,0,!0)),this.views.show()}).bind(this))}}current(){var e=this.visible();return e.length?e[e.length-1]:null}clear(){this.views&&(this.views.hide(),this.scrollTo(0,0,!0),this.views.clear())}currentLocation(){return this.updateLayout(),this.isPaginated&&this.settings.axis==="horizontal"?this.location=this.paginatedLocation():this.location=this.scrolledLocation(),this.location}scrolledLocation(){let e=this.visible(),t=this.container.getBoundingClientRect(),i=t.height<window.innerHeight?t.height:window.innerHeight,r=t.width<window.innerWidth?t.width:window.innerWidth,n=this.settings.axis==="vertical";this.settings.direction;let s=0,a=0;return this.settings.fullsize&&(s=n?window.scrollY:window.scrollX),e.map(h=>{let{index:d,href:c}=h.section,w=h.position(),m=h.width(),N=h.height(),E,f,v,g;n?(E=s+t.top-w.top+a,f=E+i-a,g=this.layout.count(N,i).pages,v=i):(E=s+t.left-w.left+a,f=E+r-a,g=this.layout.count(m,r).pages,v=r);let D=Math.ceil(E/v),L=[],b=Math.ceil(f/v);if(this.settings.direction==="rtl"&&!n){let I=D;D=g-b,b=g-I}L=[];for(var S=D;S<=b;S++){let I=S+1;L.push(I)}let R=this.mapping.page(h.contents,h.section.cfiBase,E,f);return{index:d,href:c,pages:L,totalPages:g,mapping:R}})}paginatedLocation(){let e=this.visible(),t=this.container.getBoundingClientRect(),i=0,r=0;return this.settings.fullsize&&(i=window.scrollX),e.map(s=>{let{index:a,href:u}=s.section,h,d=s.position(),c=s.width(),w,m,N;this.settings.direction==="rtl"?(h=t.right-i,N=Math.min(Math.abs(h-d.left),this.layout.width)-r,m=d.width-(d.right-h)-r,w=m-N):(h=t.left+i,N=Math.min(d.right-h,this.layout.width)-r,w=h-d.left+r,m=w+N),r+=N;let E=this.mapping.page(s.contents,s.section.cfiBase,w,m),f=this.layout.count(c).pages,v=Math.floor(w/this.layout.pageWidth),g=[],D=Math.floor(m/this.layout.pageWidth);if(v<0&&(v=0,D=D+1),this.settings.direction==="rtl"){let b=v;v=f-D,D=f-b}for(var L=v+1;L<=D;L++){let b=L;g.push(b)}return{index:a,href:u,pages:g,totalPages:f,mapping:E}})}isVisible(e,t,i,r){var n=e.position(),s=r||this.bounds();return this.settings.axis==="horizontal"&&n.right>s.left-t&&n.left<s.right+i?!0:this.settings.axis==="vertical"&&n.bottom>s.top-t&&n.top<s.bottom+i}visible(){for(var e=this.bounds(),t=this.views.displayed(),i=t.length,r=[],n,s,a=0;a<i;a++)s=t[a],n=this.isVisible(s,0,0,e),n===!0&&r.push(s);return r}scrollBy(e,t,i){let r=this.settings.direction==="rtl"?-1:1;i&&(this.ignore=!0),this.settings.fullsize?window.scrollBy(e*r,t*r):(e&&(this.container.scrollLeft+=e*r),t&&(this.container.scrollTop+=t)),this.scrolled=!0}scrollTo(e,t,i){i&&(this.ignore=!0),this.settings.fullsize?window.scrollTo(e,t):(this.container.scrollLeft=e,this.container.scrollTop=t),this.scrolled=!0}onScroll(){let e,t;this.settings.fullsize?(e=window.scrollY,t=window.scrollX):(e=this.container.scrollTop,t=this.container.scrollLeft),this.scrollTop=e,this.scrollLeft=t,this.ignore?this.ignore=!1:(this.emit(he.MANAGERS.SCROLL,{top:e,left:t}),clearTimeout(this.afterScrolled),this.afterScrolled=setTimeout((function(){this.emit(he.MANAGERS.SCROLLED,{top:this.scrollTop,left:this.scrollLeft})}).bind(this),20))}bounds(){var e;return e=this.stage.bounds(),e}applyLayout(e){this.layout=e,this.updateLayout(),this.views&&this.views.length>0&&this.layout.name==="pre-paginated"&&this.display(this.views.first().section)}updateLayout(){this.stage&&(this._stageSize=this.stage.size(),this.isPaginated?(this.layout.calculate(this._stageSize.width,this._stageSize.height,this.settings.gap),this.settings.offset=this.layout.delta/this.layout.divisor):this.layout.calculate(this._stageSize.width,this._stageSize.height),this.viewSettings.width=this.layout.width,this.viewSettings.height=this.layout.height,this.setLayout(this.layout))}setLayout(e){this.viewSettings.layout=e,this.mapping=new gi(e.props,this.settings.direction,this.settings.axis),this.views&&this.views.forEach(function(t){t&&t.setLayout(e)})}updateWritingMode(e){this.writingMode=e}updateAxis(e,t){!t&&e===this.settings.axis||(this.settings.axis=e,this.stage&&this.stage.axis(e),this.viewSettings.axis=e,this.mapping&&(this.mapping=new gi(this.layout.props,this.settings.direction,this.settings.axis)),this.layout&&(e==="vertical"?this.layout.spread("none"):this.layout.spread(this.layout.settings.spread)))}updateFlow(e,t="auto"){let i=e==="paginated"||e==="auto";this.isPaginated=i,e==="scrolled-doc"||e==="scrolled-continuous"||e==="scrolled"?this.updateAxis("vertical"):this.updateAxis("horizontal"),this.viewSettings.flow=e,this.settings.overflow?this.overflow=this.settings.overflow:this.overflow=i?"hidden":t,this.stage&&this.stage.overflow(this.overflow),this.updateLayout()}getContents(){var e=[];return this.views&&this.views.forEach(function(t){const i=t&&t.contents;i&&e.push(i)}),e}direction(e="ltr"){this.settings.direction=e,this.stage&&this.stage.direction(e),this.viewSettings.direction=e,this.updateLayout()}isRendered(){return this.rendered}}St(mi.prototype);const Ha={easeInCubic:function(y){return Math.pow(y,3)}};class yr{constructor(e,t){this.settings=ut({duration:80,minVelocity:.2,minDistance:10,easing:Ha.easeInCubic},t||{}),this.supportsTouch=this.supportsTouch(),this.supportsTouch&&this.setup(e)}setup(e){this.manager=e,this.layout=this.manager.layout,this.fullsize=this.manager.settings.fullsize,this.fullsize?(this.element=this.manager.stage.element,this.scroller=window,this.disableScroll()):(this.element=this.manager.stage.container,this.scroller=this.element,this.element.style.WebkitOverflowScrolling="touch"),this.manager.settings.offset=this.layout.width,this.manager.settings.afterScrolledTimeout=this.settings.duration*2,this.isVertical=this.manager.settings.axis==="vertical",!(!this.manager.isPaginated||this.isVertical)&&(this.touchCanceler=!1,this.resizeCanceler=!1,this.snapping=!1,this.scrollLeft,this.scrollTop,this.startTouchX=void 0,this.startTouchY=void 0,this.startTime=void 0,this.endTouchX=void 0,this.endTouchY=void 0,this.endTime=void 0,this.addListeners())}supportsTouch(){return!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)}disableScroll(){this.element.style.overflow="hidden"}enableScroll(){this.element.style.overflow=""}addListeners(){this._onResize=this.onResize.bind(this),window.addEventListener("resize",this._onResize),this._onScroll=this.onScroll.bind(this),this.scroller.addEventListener("scroll",this._onScroll),this._onTouchStart=this.onTouchStart.bind(this),this.scroller.addEventListener("touchstart",this._onTouchStart,{passive:!0}),this.on("touchstart",this._onTouchStart),this._onTouchMove=this.onTouchMove.bind(this),this.scroller.addEventListener("touchmove",this._onTouchMove,{passive:!0}),this.on("touchmove",this._onTouchMove),this._onTouchEnd=this.onTouchEnd.bind(this),this.scroller.addEventListener("touchend",this._onTouchEnd,{passive:!0}),this.on("touchend",this._onTouchEnd),this._afterDisplayed=this.afterDisplayed.bind(this),this.manager.on(he.MANAGERS.ADDED,this._afterDisplayed)}removeListeners(){window.removeEventListener("resize",this._onResize),this._onResize=void 0,this.scroller.removeEventListener("scroll",this._onScroll),this._onScroll=void 0,this.scroller.removeEventListener("touchstart",this._onTouchStart,{passive:!0}),this.off("touchstart",this._onTouchStart),this._onTouchStart=void 0,this.scroller.removeEventListener("touchmove",this._onTouchMove,{passive:!0}),this.off("touchmove",this._onTouchMove),this._onTouchMove=void 0,this.scroller.removeEventListener("touchend",this._onTouchEnd,{passive:!0}),this.off("touchend",this._onTouchEnd),this._onTouchEnd=void 0,this.manager.off(he.MANAGERS.ADDED,this._afterDisplayed),this._afterDisplayed=void 0}afterDisplayed(e){let t=e.contents;["touchstart","touchmove","touchend"].forEach(i=>{t.on(i,r=>this.triggerViewEvent(r,t))})}triggerViewEvent(e,t){this.emit(e.type,e,t)}onScroll(e){this.scrollLeft=this.fullsize?window.scrollX:this.scroller.scrollLeft,this.scrollTop=this.fullsize?window.scrollY:this.scroller.scrollTop}onResize(e){this.resizeCanceler=!0}onTouchStart(e){let{screenX:t,screenY:i}=e.touches[0];this.fullsize&&this.enableScroll(),this.touchCanceler=!0,this.startTouchX||(this.startTouchX=t,this.startTouchY=i,this.startTime=this.now()),this.endTouchX=t,this.endTouchY=i,this.endTime=this.now()}onTouchMove(e){let{screenX:t,screenY:i}=e.touches[0],r=Math.abs(i-this.endTouchY);this.touchCanceler=!0,!this.fullsize&&r<10&&(this.element.scrollLeft-=t-this.endTouchX),this.endTouchX=t,this.endTouchY=i,this.endTime=this.now()}onTouchEnd(e){this.fullsize&&this.disableScroll(),this.touchCanceler=!1;let t=this.wasSwiped();t!==0?this.snap(t):this.snap(),this.startTouchX=void 0,this.startTouchY=void 0,this.startTime=void 0,this.endTouchX=void 0,this.endTouchY=void 0,this.endTime=void 0}wasSwiped(){let e=this.layout.pageWidth*this.layout.divisor,t=this.endTouchX-this.startTouchX,i=Math.abs(t),r=this.endTime-this.startTime,n=t/r,s=this.settings.minVelocity;if(i<=this.settings.minDistance||i>=e)return 0;if(n>s)return-1;if(n<-s)return 1}needsSnap(){let e=this.scrollLeft,t=this.layout.pageWidth*this.layout.divisor;return e%t!==0}snap(e=0){let t=this.scrollLeft,i=this.layout.pageWidth*this.layout.divisor,r=Math.round(t/i)*i;return e&&(r+=e*i),this.smoothScrollTo(r)}smoothScrollTo(e){const t=new Le,i=this.scrollLeft,r=this.now(),n=this.settings.duration,s=this.settings.easing;this.snapping=!0;function a(){const u=this.now(),h=Math.min(1,(u-r)/n);if(s(h),this.touchCanceler||this.resizeCanceler){this.resizeCanceler=!1,this.snapping=!1,t.resolve();return}h<1?(window.requestAnimationFrame(a.bind(this)),this.scrollTo(i+(e-i)*h,0)):(this.scrollTo(e,0),this.snapping=!1,t.resolve())}return a.call(this),t.promise}scrollTo(e=0,t=0){this.fullsize?window.scroll(e,t):(this.scroller.scrollLeft=e,this.scroller.scrollTop=t)}now(){return"now"in window.performance?performance.now():new Date().getTime()}destroy(){this.scroller&&(this.fullsize&&this.enableScroll(),this.removeListeners(),this.scroller=void 0)}}St(yr.prototype);var Va=fs();const Ga=Yt(Va);class Za extends mi{constructor(e){super(e),this.name="continuous",this.settings=ut(this.settings||{},{infinite:!0,overflow:void 0,axis:void 0,writingMode:void 0,flow:"scrolled",offset:500,offsetDelta:250,width:void 0,height:void 0,snap:!1,afterScrolledTimeout:10,allowScriptedContent:!1,allowPopups:!1}),ut(this.settings,e.settings||{}),e.settings.gap!="undefined"&&e.settings.gap===0&&(this.settings.gap=e.settings.gap),this.viewSettings={ignoreClass:this.settings.ignoreClass,axis:this.settings.axis,flow:this.settings.flow,layout:this.layout,width:0,height:0,forceEvenPages:!1,allowScriptedContent:this.settings.allowScriptedContent,allowPopups:this.settings.allowPopups},this.scrollTop=0,this.scrollLeft=0}display(e,t){return mi.prototype.display.call(this,e,t).then((function(){return this.fill()}).bind(this))}fill(e){var t=e||new Le;return this.q.enqueue(()=>this.check()).then(i=>{i?this.fill(t):t.resolve()}),t.promise}moveTo(e){var t=0,i=0;this.isPaginated?(t=Math.floor(e.left/this.layout.delta)*this.layout.delta,t+this.settings.offsetDelta):(i=e.top,e.top+this.settings.offsetDelta),(t>0||i>0)&&this.scrollBy(t,i,!0)}afterResized(e){this.emit(he.MANAGERS.RESIZE,e.section)}removeShownListeners(e){e.onDisplayed=function(){}}add(e){var t=this.createView(e);return this.views.append(t),t.on(he.VIEWS.RESIZED,i=>{t.expanded=!0}),t.on(he.VIEWS.AXIS,i=>{this.updateAxis(i)}),t.on(he.VIEWS.WRITING_MODE,i=>{this.updateWritingMode(i)}),t.onDisplayed=this.afterDisplayed.bind(this),t.onResize=this.afterResized.bind(this),t.display(this.request)}append(e){var t=this.createView(e);return t.on(he.VIEWS.RESIZED,i=>{t.expanded=!0}),t.on(he.VIEWS.AXIS,i=>{this.updateAxis(i)}),t.on(he.VIEWS.WRITING_MODE,i=>{this.updateWritingMode(i)}),this.views.append(t),t.onDisplayed=this.afterDisplayed.bind(this),t}prepend(e){var t=this.createView(e);return t.on(he.VIEWS.RESIZED,i=>{this.counter(i),t.expanded=!0}),t.on(he.VIEWS.AXIS,i=>{this.updateAxis(i)}),t.on(he.VIEWS.WRITING_MODE,i=>{this.updateWritingMode(i)}),this.views.prepend(t),t.onDisplayed=this.afterDisplayed.bind(this),t}counter(e){this.settings.axis==="vertical"?this.scrollBy(0,e.heightDelta,!0):this.scrollBy(e.widthDelta,0,!0)}update(e){for(var t=this.bounds(),i=this.views.all(),r=i.length,n=typeof e<"u"?e:this.settings.offset||0,s,a,u=new Le,h=[],d=0;d<r;d++)if(a=i[d],s=this.isVisible(a,n,n,t),s===!0)if(a.displayed)a.show();else{let c=a.display(this.request).then(function(w){w.show()},w=>{a.hide()});h.push(c)}else this.q.enqueue(a.destroy.bind(a)),clearTimeout(this.trimTimeout),this.trimTimeout=setTimeout((function(){this.q.enqueue(this.trim.bind(this))}).bind(this),250);return h.length?Promise.all(h).catch(c=>{u.reject(c)}):(u.resolve(),u.promise)}check(e,t){var i=new Le,r=[],n=this.settings.axis==="horizontal",s=this.settings.offset||0;e&&n&&(s=e),t&&!n&&(s=t);var a=this._bounds;let u=n?this.scrollLeft:this.scrollTop,h=n?Math.floor(a.width):a.height,d=n?this.container.scrollWidth:this.container.scrollHeight,c=this.writingMode&&this.writingMode.indexOf("vertical")===0?"vertical":"horizontal",w=this.settings.rtlScrollType,m=this.settings.direction==="rtl";this.settings.fullsize?(n&&m&&w==="negative"||!n&&m&&w==="default")&&(u=u*-1):(m&&w==="default"&&c==="horizontal"&&(u=d-h-u),m&&w==="negative"&&c==="horizontal"&&(u=u*-1));let N=()=>{let D=this.views.first(),L=D&&D.section.prev();L&&r.push(this.prepend(L))},E=()=>{let D=this.views.last(),L=D&&D.section.next();L&&r.push(this.append(L))},f=u+h+s,v=u-s;f>=d&&E(),v<0&&N();let g=r.map(D=>D.display(this.request));return r.length?Promise.all(g).then(()=>this.check()).then(()=>this.update(s),D=>D):(this.q.enqueue((function(){this.update()}).bind(this)),i.resolve(!1),i.promise)}trim(){for(var e=new Le,t=this.views.displayed(),i=t[0],r=t[t.length-1],n=this.views.indexOf(i),s=this.views.indexOf(r),a=this.views.slice(0,n),u=this.views.slice(s+1),h=0;h<a.length-1;h++)this.erase(a[h],a);for(var d=1;d<u.length;d++)this.erase(u[d]);return e.resolve(),e.promise}erase(e,t){var i,r;this.settings.fullsize?(i=window.scrollY,r=window.scrollX):(i=this.container.scrollTop,r=this.container.scrollLeft);var n=e.bounds();this.views.remove(e),t&&(this.settings.axis==="vertical"?this.scrollTo(0,i-n.height,!0):this.settings.direction==="rtl"?this.settings.fullsize?this.scrollTo(r+Math.floor(n.width),0,!0):this.scrollTo(r,0,!0):this.scrollTo(r-Math.floor(n.width),0,!0))}addEventListeners(e){window.addEventListener("unload",(function(t){this.ignore=!0,this.destroy()}).bind(this)),this.addScrollListeners(),this.isPaginated&&this.settings.snap&&(this.snapper=new yr(this,this.settings.snap&&typeof this.settings.snap=="object"&&this.settings.snap))}addScrollListeners(){var e;this.tick=xr;let t=this.settings.direction==="rtl"&&this.settings.rtlScrollType==="default"?-1:1;this.scrollDeltaVert=0,this.scrollDeltaHorz=0,this.settings.fullsize?(e=window,this.scrollTop=window.scrollY*t,this.scrollLeft=window.scrollX*t):(e=this.container,this.scrollTop=this.container.scrollTop,this.scrollLeft=this.container.scrollLeft),this._onScroll=this.onScroll.bind(this),e.addEventListener("scroll",this._onScroll),this._scrolled=Ga(this.scrolled.bind(this),30),this.didScroll=!1}removeEventListeners(){var e;this.settings.fullsize?e=window:e=this.container,e.removeEventListener("scroll",this._onScroll),this._onScroll=void 0}onScroll(){let e,t,i=this.settings.direction==="rtl"&&this.settings.rtlScrollType==="default"?-1:1;this.settings.fullsize?(e=window.scrollY*i,t=window.scrollX*i):(e=this.container.scrollTop,t=this.container.scrollLeft),this.scrollTop=e,this.scrollLeft=t,this.ignore?this.ignore=!1:this._scrolled(),this.scrollDeltaVert+=Math.abs(e-this.prevScrollTop),this.scrollDeltaHorz+=Math.abs(t-this.prevScrollLeft),this.prevScrollTop=e,this.prevScrollLeft=t,clearTimeout(this.scrollTimeout),this.scrollTimeout=setTimeout((function(){this.scrollDeltaVert=0,this.scrollDeltaHorz=0}).bind(this),150),clearTimeout(this.afterScrolled),this.didScroll=!1}scrolled(){this.q.enqueue((function(){return this.check()}).bind(this)),this.emit(he.MANAGERS.SCROLL,{top:this.scrollTop,left:this.scrollLeft}),clearTimeout(this.afterScrolled),this.afterScrolled=setTimeout((function(){this.snapper&&this.snapper.supportsTouch&&this.snapper.needsSnap()||this.emit(he.MANAGERS.SCROLLED,{top:this.scrollTop,left:this.scrollLeft})}).bind(this),this.settings.afterScrolledTimeout)}next(){let e=this.layout.props.name==="pre-paginated"&&this.layout.props.spread?this.layout.props.delta*2:this.layout.props.delta;this.views.length&&(this.isPaginated&&this.settings.axis==="horizontal"?this.scrollBy(e,0,!0):this.scrollBy(0,this.layout.height,!0),this.q.enqueue((function(){return this.check()}).bind(this)))}prev(){let e=this.layout.props.name==="pre-paginated"&&this.layout.props.spread?this.layout.props.delta*2:this.layout.props.delta;this.views.length&&(this.isPaginated&&this.settings.axis==="horizontal"?this.scrollBy(-e,0,!0):this.scrollBy(0,-this.layout.height,!0),this.q.enqueue((function(){return this.check()}).bind(this)))}updateFlow(e){this.rendered&&this.snapper&&(this.snapper.destroy(),this.snapper=void 0),super.updateFlow(e,"scroll"),this.rendered&&this.isPaginated&&this.settings.snap&&(this.snapper=new yr(this,this.settings.snap&&typeof this.settings.snap=="object"&&this.settings.snap))}destroy(){super.destroy(),this.snapper&&this.snapper.destroy()}}class kr{constructor(e,t){this.settings=ut(this.settings||{},{width:null,height:null,ignoreClass:"",manager:"default",view:"iframe",flow:null,layout:null,spread:null,minSpreadWidth:800,stylesheet:null,resizeOnOrientationChange:!0,script:null,snap:!1,defaultDirection:"ltr",allowScriptedContent:!1,allowPopups:!1}),ut(this.settings,t),typeof this.settings.manager=="object"&&(this.manager=this.settings.manager),this.book=e,this.hooks={},this.hooks.display=new Dt(this),this.hooks.serialize=new Dt(this),this.hooks.content=new Dt(this),this.hooks.unloaded=new Dt(this),this.hooks.layout=new Dt(this),this.hooks.render=new Dt(this),this.hooks.show=new Dt(this),this.hooks.content.register(this.handleLinks.bind(this)),this.hooks.content.register(this.passEvents.bind(this)),this.hooks.content.register(this.adjustImages.bind(this)),this.book.spine.hooks.content.register(this.injectIdentifier.bind(this)),this.settings.stylesheet&&this.book.spine.hooks.content.register(this.injectStylesheet.bind(this)),this.settings.script&&this.book.spine.hooks.content.register(this.injectScript.bind(this)),this.themes=new wa(this),this.annotations=new xa(this),this.epubcfi=new Be,this.q=new Cr(this),this.location=void 0,this.q.enqueue(this.book.opened),this.starting=new Le,this.started=this.starting.promise,this.q.enqueue(this.start)}setManager(e){this.manager=e}requireManager(e){var t;return typeof e=="string"&&e==="default"?t=mi:typeof e=="string"&&e==="continuous"?t=Za:t=e,t}requireView(e){var t;return typeof e=="string"&&e==="iframe"?t=us:t=e,t}start(){switch(!this.settings.layout&&(this.book.package.metadata.layout==="pre-paginated"||this.book.displayOptions.fixedLayout==="true")&&(this.settings.layout="pre-paginated"),this.book.package.metadata.spread){case"none":this.settings.spread="none";break;case"both":this.settings.spread=!0;break}this.manager||(this.ViewManager=this.requireManager(this.settings.manager),this.View=this.requireView(this.settings.view),this.manager=new this.ViewManager({view:this.View,queue:this.q,request:this.book.load.bind(this.book),settings:this.settings})),this.direction(this.book.package.metadata.direction||this.settings.defaultDirection),this.settings.globalLayoutProperties=this.determineLayoutProperties(this.book.package.metadata),this.flow(this.settings.globalLayoutProperties.flow),this.layout(this.settings.globalLayoutProperties),this.manager.on(he.MANAGERS.ADDED,this.afterDisplayed.bind(this)),this.manager.on(he.MANAGERS.REMOVED,this.afterRemoved.bind(this)),this.manager.on(he.MANAGERS.RESIZED,this.onResized.bind(this)),this.manager.on(he.MANAGERS.ORIENTATION_CHANGE,this.onOrientationChange.bind(this)),this.manager.on(he.MANAGERS.SCROLLED,this.reportLocation.bind(this)),this.emit(he.RENDITION.STARTED),this.starting.resolve()}attachTo(e){return this.q.enqueue((function(){this.manager.render(e,{width:this.settings.width,height:this.settings.height}),this.emit(he.RENDITION.ATTACHED)}).bind(this))}display(e){return this.displaying&&this.displaying.resolve(),this.q.enqueue(this._display,e)}_display(e){if(this.book){this.epubcfi.isCfiString(e);var t=new Le,i=t.promise,r;return this.displaying=t,this.book.locations.length()&&Yn(e)&&(e=this.book.locations.cfiFromPercentage(parseFloat(e))),r=this.book.spine.get(e),r?(this.manager.display(r,e).then(()=>{t.resolve(r),this.displaying=void 0,this.emit(he.RENDITION.DISPLAYED,r),this.reportLocation()},n=>{this.emit(he.RENDITION.DISPLAY_ERROR,n)}),i):(t.reject(new Error("No Section Found")),i)}}afterDisplayed(e){e.on(he.VIEWS.MARK_CLICKED,(t,i)=>this.triggerMarkEvent(t,i,e.contents)),this.hooks.render.trigger(e,this).then(()=>{e.contents?this.hooks.content.trigger(e.contents,this).then(()=>{this.emit(he.RENDITION.RENDERED,e.section,e)}):this.emit(he.RENDITION.RENDERED,e.section,e)})}afterRemoved(e){this.hooks.unloaded.trigger(e,this).then(()=>{this.emit(he.RENDITION.REMOVED,e.section,e)})}onResized(e,t){this.emit(he.RENDITION.RESIZED,{width:e.width,height:e.height},t),this.location&&this.location.start&&this.display(t||this.location.start.cfi)}onOrientationChange(e){this.emit(he.RENDITION.ORIENTATION_CHANGE,e)}moveTo(e){this.manager.moveTo(e)}resize(e,t,i){e&&(this.settings.width=e),t&&(this.settings.height=t),this.manager.resize(e,t,i)}clear(){this.manager.clear()}next(){return this.q.enqueue(this.manager.next.bind(this.manager)).then(this.reportLocation.bind(this))}prev(){return this.q.enqueue(this.manager.prev.bind(this.manager)).then(this.reportLocation.bind(this))}determineLayoutProperties(e){var t,i=this.settings.layout||e.layout||"reflowable",r=this.settings.spread||e.spread||"auto",n=this.settings.orientation||e.orientation||"auto",s=this.settings.flow||e.flow||"auto",a=e.viewport||"",u=this.settings.minSpreadWidth||e.minSpreadWidth||800,h=this.settings.direction||e.direction||"ltr";return(this.settings.width===0||this.settings.width>0)&&(this.settings.height===0||this.settings.height>0),t={layout:i,spread:r,orientation:n,flow:s,viewport:a,minSpreadWidth:u,direction:h},t}flow(e){var t=e;(e==="scrolled"||e==="scrolled-doc"||e==="scrolled-continuous")&&(t="scrolled"),(e==="auto"||e==="paginated")&&(t="paginated"),this.settings.flow=e,this._layout&&this._layout.flow(t),this.manager&&this._layout&&this.manager.applyLayout(this._layout),this.manager&&this.manager.updateFlow(t),this.manager&&this.manager.isRendered()&&this.location&&(this.manager.clear(),this.display(this.location.start.cfi))}layout(e){return e&&(this._layout=new ss(e),this._layout.spread(e.spread,this.settings.minSpreadWidth),this._layout.on(he.LAYOUT.UPDATED,(t,i)=>{this.emit(he.RENDITION.LAYOUT,t,i)})),this.manager&&this._layout&&this.manager.applyLayout(this._layout),this._layout}spread(e,t){this.settings.spread=e,t&&(this.settings.minSpreadWidth=t),this._layout&&this._layout.spread(e,t),this.manager&&this.manager.isRendered()&&this.manager.updateLayout()}direction(e){this.settings.direction=e||"ltr",this.manager&&this.manager.direction(this.settings.direction),this.manager&&this.manager.isRendered()&&this.location&&(this.manager.clear(),this.display(this.location.start.cfi))}reportLocation(){return this.q.enqueue((function(){requestAnimationFrame((function(){var i=this.manager.currentLocation();if(i&&i.then&&typeof i.then=="function")i.then((function(r){let n=this.located(r);!n||!n.start||!n.end||(this.location=n,this.emit(he.RENDITION.LOCATION_CHANGED,{index:this.location.start.index,href:this.location.start.href,start:this.location.start.cfi,end:this.location.end.cfi,percentage:this.location.start.percentage}),this.emit(he.RENDITION.RELOCATED,this.location))}).bind(this));else if(i){let r=this.located(i);if(!r||!r.start||!r.end)return;this.location=r,this.emit(he.RENDITION.LOCATION_CHANGED,{index:this.location.start.index,href:this.location.start.href,start:this.location.start.cfi,end:this.location.end.cfi,percentage:this.location.start.percentage}),this.emit(he.RENDITION.RELOCATED,this.location)}}).bind(this))}).bind(this))}currentLocation(){var e=this.manager.currentLocation();if(e&&e.then&&typeof e.then=="function")e.then((function(t){return this.located(t)}).bind(this));else if(e)return this.located(e)}located(e){if(!e.length)return{};let t=e[0],i=e[e.length-1],r={start:{index:t.index,href:t.href,cfi:t.mapping.start,displayed:{page:t.pages[0]||1,total:t.totalPages}},end:{index:i.index,href:i.href,cfi:i.mapping.end,displayed:{page:i.pages[i.pages.length-1]||1,total:i.totalPages}}},n=this.book.locations.locationFromCfi(t.mapping.start),s=this.book.locations.locationFromCfi(i.mapping.end);n!=null&&(r.start.location=n,r.start.percentage=this.book.locations.percentageFromLocation(n)),s!=null&&(r.end.location=s,r.end.percentage=this.book.locations.percentageFromLocation(s));let a=this.book.pageList.pageFromCfi(t.mapping.start),u=this.book.pageList.pageFromCfi(i.mapping.end);return a!=-1&&(r.start.page=a),u!=-1&&(r.end.page=u),i.index===this.book.spine.last().index&&r.end.displayed.page>=r.end.displayed.total&&(r.atEnd=!0),t.index===this.book.spine.first().index&&r.start.displayed.page===1&&(r.atStart=!0),r}destroy(){this.manager&&this.manager.destroy(),this.book=void 0}passEvents(e){li.forEach(t=>{e.on(t,i=>this.triggerViewEvent(i,e))}),e.on(he.CONTENTS.SELECTED,t=>this.triggerSelectedEvent(t,e))}triggerViewEvent(e,t){this.emit(e.type,e,t)}triggerSelectedEvent(e,t){this.emit(he.RENDITION.SELECTED,e,t)}triggerMarkEvent(e,t,i){this.emit(he.RENDITION.MARK_CLICKED,e,t,i)}getRange(e,t){var i=new Be(e),r=this.manager.visible().filter(function(n){if(i.spinePos===n.index)return!0});if(r.length)return r[0].contents.range(i,t)}adjustImages(e){if(this._layout.name==="pre-paginated")return new Promise(function(n){n()});let t=e.window.getComputedStyle(e.content,null),i=(e.content.offsetHeight-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)))*.95,r=parseFloat(t.paddingLeft)+parseFloat(t.paddingRight);return e.addStylesheetRules({img:{"max-width":(this._layout.columnWidth?this._layout.columnWidth-r+"px":"100%")+"!important","max-height":i+"px!important","object-fit":"contain","page-break-inside":"avoid","break-inside":"avoid","box-sizing":"border-box"},svg:{"max-width":(this._layout.columnWidth?this._layout.columnWidth-r+"px":"100%")+"!important","max-height":i+"px!important","page-break-inside":"avoid","break-inside":"avoid"}}),new Promise(function(n,s){setTimeout(function(){n()},1)})}getContents(){return this.manager?this.manager.getContents():[]}views(){return(this.manager?this.manager.views:void 0)||[]}handleLinks(e){e&&e.on(he.CONTENTS.LINK_CLICKED,t=>{let i=this.book.path.relative(t);this.display(i)})}injectStylesheet(e,t){let i=e.createElement("link");i.setAttribute("type","text/css"),i.setAttribute("rel","stylesheet"),i.setAttribute("href",this.settings.stylesheet),e.getElementsByTagName("head")[0].appendChild(i)}injectScript(e,t){let i=e.createElement("script");i.setAttribute("type","text/javascript"),i.setAttribute("src",this.settings.script),i.textContent=" ",e.getElementsByTagName("head")[0].appendChild(i)}injectIdentifier(e,t){let i=this.book.packaging.metadata.identifier,r=e.createElement("meta");r.setAttribute("name","dc.relation.ispartof"),i&&r.setAttribute("content",i),e.getElementsByTagName("head")[0].appendChild(r)}}St(kr.prototype);function Lt(y){throw new Error('Could not dynamically require "'+y+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var fr={exports:{}};/*!
JSZip v3.10.1 - A JavaScript class for generating and reading zip files
<http://stuartk.com/jszip>
(c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown.
JSZip uses the library pako released under the MIT license :
https://github.com/nodeca/pako/blob/main/LICENSE
*/var Nn;function Ya(){return Nn||(Nn=1,(function(y,e){(function(t){y.exports=t()})(function(){return(function t(i,r,n){function s(h,d){if(!r[h]){if(!i[h]){var c=typeof Lt=="function"&&Lt;if(!d&&c)return c(h,!0);if(a)return a(h,!0);var w=new Error("Cannot find module '"+h+"'");throw w.code="MODULE_NOT_FOUND",w}var m=r[h]={exports:{}};i[h][0].call(m.exports,function(N){var E=i[h][1][N];return s(E||N)},m,m.exports,t,i,r,n)}return r[h].exports}for(var a=typeof Lt=="function"&&Lt,u=0;u<n.length;u++)s(n[u]);return s})({1:[function(t,i,r){var n=t("./utils"),s=t("./support"),a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";r.encode=function(u){for(var h=[],d,c,w,m,N,E,f,v=0,g=u.length,D=g,L=n.getTypeOf(u)!=="string";v<u.length;)D=g-v,L?(d=u[v++],c=v<g?u[v++]:0,w=v<g?u[v++]:0):(d=u.charCodeAt(v++),c=v<g?u.charCodeAt(v++):0,w=v<g?u.charCodeAt(v++):0),m=d>>2,N=(d&3)<<4|c>>4,E=D>1?(c&15)<<2|w>>6:64,f=D>2?w&63:64,h.push(a.charAt(m)+a.charAt(N)+a.charAt(E)+a.charAt(f));return h.join("")},r.decode=function(u){var h,d,c,w,m,N,E,f=0,v=0,g="data:";if(u.substr(0,g.length)===g)throw new Error("Invalid base64 input, it looks like a data url.");u=u.replace(/[^A-Za-z0-9+/=]/g,"");var D=u.length*3/4;if(u.charAt(u.length-1)===a.charAt(64)&&D--,u.charAt(u.length-2)===a.charAt(64)&&D--,D%1!==0)throw new Error("Invalid base64 input, bad content length.");var L;for(s.uint8array?L=new Uint8Array(D|0):L=new Array(D|0);f<u.length;)w=a.indexOf(u.charAt(f++)),m=a.indexOf(u.charAt(f++)),N=a.indexOf(u.charAt(f++)),E=a.indexOf(u.charAt(f++)),h=w<<2|m>>4,d=(m&15)<<4|N>>2,c=(N&3)<<6|E,L[v++]=h,N!==64&&(L[v++]=d),E!==64&&(L[v++]=c);return L}},{"./support":30,"./utils":32}],2:[function(t,i,r){var n=t("./external"),s=t("./stream/DataWorker"),a=t("./stream/Crc32Probe"),u=t("./stream/DataLengthProbe");function h(d,c,w,m,N){this.compressedSize=d,this.uncompressedSize=c,this.crc32=w,this.compression=m,this.compressedContent=N}h.prototype={getContentWorker:function(){var d=new s(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new u("data_length")),c=this;return d.on("end",function(){if(this.streamInfo.data_length!==c.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),d},getCompressedWorker:function(){return new s(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},h.createWorkerFrom=function(d,c,w){return d.pipe(new a).pipe(new u("uncompressedSize")).pipe(c.compressWorker(w)).pipe(new u("compressedSize")).withStreamInfo("compression",c)},i.exports=h},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,i,r){var n=t("./stream/GenericWorker");r.STORE={magic:"\0\0",compressWorker:function(){return new n("STORE compression")},uncompressWorker:function(){return new n("STORE decompression")}},r.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,i,r){var n=t("./utils");function s(){for(var d,c=[],w=0;w<256;w++){d=w;for(var m=0;m<8;m++)d=d&1?3988292384^d>>>1:d>>>1;c[w]=d}return c}var a=s();function u(d,c,w,m){var N=a,E=m+w;d=d^-1;for(var f=m;f<E;f++)d=d>>>8^N[(d^c[f])&255];return d^-1}function h(d,c,w,m){var N=a,E=m+w;d=d^-1;for(var f=m;f<E;f++)d=d>>>8^N[(d^c.charCodeAt(f))&255];return d^-1}i.exports=function(c,w){if(typeof c>"u"||!c.length)return 0;var m=n.getTypeOf(c)!=="string";return m?u(w|0,c,c.length,0):h(w|0,c,c.length,0)}},{"./utils":32}],5:[function(t,i,r){r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},{}],6:[function(t,i,r){var n=null;typeof Promise<"u"?n=Promise:n=t("lie"),i.exports={Promise:n}},{lie:37}],7:[function(t,i,r){var n=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",s=t("pako"),a=t("./utils"),u=t("./stream/GenericWorker"),h=n?"uint8array":"array";r.magic="\b\0";function d(c,w){u.call(this,"FlateWorker/"+c),this._pako=null,this._pakoAction=c,this._pakoOptions=w,this.meta={}}a.inherits(d,u),d.prototype.processChunk=function(c){this.meta=c.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(h,c.data),!1)},d.prototype.flush=function(){u.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},d.prototype.cleanUp=function(){u.prototype.cleanUp.call(this),this._pako=null},d.prototype._createPako=function(){this._pako=new s[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var c=this;this._pako.onData=function(w){c.push({data:w,meta:c.meta})}},r.compressWorker=function(c){return new d("Deflate",c)},r.uncompressWorker=function(){return new d("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,i,r){var n=t("../utils"),s=t("../stream/GenericWorker"),a=t("../utf8"),u=t("../crc32"),h=t("../signature"),d=function(v,g){var D="",L;for(L=0;L<g;L++)D+=String.fromCharCode(v&255),v=v>>>8;return D},c=function(v,g){var D=v;return v||(D=g?16893:33204),(D&65535)<<16},w=function(v){return(v||0)&63},m=function(v,g,D,L,b,S){var R=v.file,I=v.compression,k=S!==a.utf8encode,O=n.transformTo("string",S(R.name)),G=n.transformTo("string",a.utf8encode(R.name)),j=R.comment,Z=n.transformTo("string",S(j)),Y=n.transformTo("string",a.utf8encode(j)),X=G.length!==R.name.length,ie=Y.length!==j.length,K,$,ae="",pe="",ne="",ce=R.dir,Ce=R.date,ye={crc32:0,compressedSize:0,uncompressedSize:0};(!g||D)&&(ye.crc32=v.crc32,ye.compressedSize=v.compressedSize,ye.uncompressedSize=v.uncompressedSize);var Te=0;g&&(Te|=8),!k&&(X||ie)&&(Te|=2048);var We=0,Fe=0;ce&&(We|=16),b==="UNIX"?(Fe=798,We|=c(R.unixPermissions,ce)):(Fe=20,We|=w(R.dosPermissions)),K=Ce.getUTCHours(),K=K<<6,K=K|Ce.getUTCMinutes(),K=K<<5,K=K|Ce.getUTCSeconds()/2,$=Ce.getUTCFullYear()-1980,$=$<<4,$=$|Ce.getUTCMonth()+1,$=$<<5,$=$|Ce.getUTCDate(),X&&(pe=d(1,1)+d(u(O),4)+G,ae+="up"+d(pe.length,2)+pe),ie&&(ne=d(1,1)+d(u(Z),4)+Y,ae+="uc"+d(ne.length,2)+ne);var be="";be+=`
\0`,be+=d(Te,2),be+=I.magic,be+=d(K,2),be+=d($,2),be+=d(ye.crc32,4),be+=d(ye.compressedSize,4),be+=d(ye.uncompressedSize,4),be+=d(O.length,2),be+=d(ae.length,2);var Pe=h.LOCAL_FILE_HEADER+be+O+ae,Ue=h.CENTRAL_FILE_HEADER+d(Fe,2)+be+d(Z.length,2)+"\0\0\0\0"+d(We,4)+d(L,4)+O+ae+Z;return{fileRecord:Pe,dirRecord:Ue}},N=function(v,g,D,L,b){var S="",R=n.transformTo("string",b(L));return S=h.CENTRAL_DIRECTORY_END+"\0\0\0\0"+d(v,2)+d(v,2)+d(g,4)+d(D,4)+d(R.length,2)+R,S},E=function(v){var g="";return g=h.DATA_DESCRIPTOR+d(v.crc32,4)+d(v.compressedSize,4)+d(v.uncompressedSize,4),g};function f(v,g,D,L){s.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=g,this.zipPlatform=D,this.encodeFileName=L,this.streamFiles=v,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}n.inherits(f,s),f.prototype.push=function(v){var g=v.meta.percent||0,D=this.entriesCount,L=this._sources.length;this.accumulate?this.contentBuffer.push(v):(this.bytesWritten+=v.data.length,s.prototype.push.call(this,{data:v.data,meta:{currentFile:this.currentFile,percent:D?(g+100*(D-L-1))/D:100}}))},f.prototype.openedSource=function(v){this.currentSourceOffset=this.bytesWritten,this.currentFile=v.file.name;var g=this.streamFiles&&!v.file.dir;if(g){var D=m(v,g,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:D.fileRecord,meta:{percent:0}})}else this.accumulate=!0},f.prototype.closedSource=function(v){this.accumulate=!1;var g=this.streamFiles&&!v.file.dir,D=m(v,g,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(D.dirRecord),g)this.push({data:E(v),meta:{percent:100}});else for(this.push({data:D.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},f.prototype.flush=function(){for(var v=this.bytesWritten,g=0;g<this.dirRecords.length;g++)this.push({data:this.dirRecords[g],meta:{percent:100}});var D=this.bytesWritten-v,L=N(this.dirRecords.length,D,v,this.zipComment,this.encodeFileName);this.push({data:L,meta:{percent:100}})},f.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},f.prototype.registerPrevious=function(v){this._sources.push(v);var g=this;return v.on("data",function(D){g.processChunk(D)}),v.on("end",function(){g.closedSource(g.previous.streamInfo),g._sources.length?g.prepareNextSource():g.end()}),v.on("error",function(D){g.error(D)}),this},f.prototype.resume=function(){if(!s.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},f.prototype.error=function(v){var g=this._sources;if(!s.prototype.error.call(this,v))return!1;for(var D=0;D<g.length;D++)try{g[D].error(v)}catch{}return!0},f.prototype.lock=function(){s.prototype.lock.call(this);for(var v=this._sources,g=0;g<v.length;g++)v[g].lock()},i.exports=f},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(t,i,r){var n=t("../compressions"),s=t("./ZipFileWorker"),a=function(u,h){var d=u||h,c=n[d];if(!c)throw new Error(d+" is not a valid compression method !");return c};r.generateWorker=function(u,h,d){var c=new s(h.streamFiles,d,h.platform,h.encodeFileName),w=0;try{u.forEach(function(m,N){w++;var E=a(N.options.compression,h.compression),f=N.options.compressionOptions||h.compressionOptions||{},v=N.dir,g=N.date;N._compressWorker(E,f).withStreamInfo("file",{name:m,dir:v,date:g,comment:N.comment||"",unixPermissions:N.unixPermissions,dosPermissions:N.dosPermissions}).pipe(c)}),c.entriesCount=w}catch(m){c.error(m)}return c}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(t,i,r){function n(){if(!(this instanceof n))return new n;if(arguments.length)throw new 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 s=new n;for(var a in this)typeof this[a]!="function"&&(s[a]=this[a]);return s}}n.prototype=t("./object"),n.prototype.loadAsync=t("./load"),n.support=t("./support"),n.defaults=t("./defaults"),n.version="3.10.1",n.loadAsync=function(s,a){return new n().loadAsync(s,a)},n.external=t("./external"),i.exports=n},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(t,i,r){var n=t("./utils"),s=t("./external"),a=t("./utf8"),u=t("./zipEntries"),h=t("./stream/Crc32Probe"),d=t("./nodejsUtils");function c(w){return new s.Promise(function(m,N){var E=w.decompressed.getContentWorker().pipe(new h);E.on("error",function(f){N(f)}).on("end",function(){E.streamInfo.crc32!==w.decompressed.crc32?N(new Error("Corrupted zip : CRC32 mismatch")):m()}).resume()})}i.exports=function(w,m){var N=this;return m=n.extend(m||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:a.utf8decode}),d.isNode&&d.isStream(w)?s.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):n.prepareContent("the loaded zip file",w,!0,m.optimizedBinaryString,m.base64).then(function(E){var f=new u(m);return f.load(E),f}).then(function(f){var v=[s.Promise.resolve(f)],g=f.files;if(m.checkCRC32)for(var D=0;D<g.length;D++)v.push(c(g[D]));return s.Promise.all(v)}).then(function(f){for(var v=f.shift(),g=v.files,D=0;D<g.length;D++){var L=g[D],b=L.fileNameStr,S=n.resolve(L.fileNameStr);N.file(S,L.decompressed,{binary:!0,optimizedBinaryString:!0,date:L.date,dir:L.dir,comment:L.fileCommentStr.length?L.fileCommentStr:null,unixPermissions:L.unixPermissions,dosPermissions:L.dosPermissions,createFolders:m.createFolders}),L.dir||(N.file(S).unsafeOriginalName=b)}return v.zipComment.length&&(N.comment=v.zipComment),N})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(t,i,r){var n=t("../utils"),s=t("../stream/GenericWorker");function a(u,h){s.call(this,"Nodejs stream input adapter for "+u),this._upstreamEnded=!1,this._bindStream(h)}n.inherits(a,s),a.prototype._bindStream=function(u){var h=this;this._stream=u,u.pause(),u.on("data",function(d){h.push({data:d,meta:{percent:0}})}).on("error",function(d){h.isPaused?this.generatedError=d:h.error(d)}).on("end",function(){h.isPaused?h._upstreamEnded=!0:h.end()})},a.prototype.pause=function(){return s.prototype.pause.call(this)?(this._stream.pause(),!0):!1},a.prototype.resume=function(){return s.prototype.resume.call(this)?(this._upstreamEnded?this.end():this._stream.resume(),!0):!1},i.exports=a},{"../stream/GenericWorker":28,"../utils":32}],13:[function(t,i,r){var n=t("readable-stream").Readable,s=t("../utils");s.inherits(a,n);function a(u,h,d){n.call(this,h),this._helper=u;var c=this;u.on("data",function(w,m){c.push(w)||c._helper.pause(),d&&d(m)}).on("error",function(w){c.emit("error",w)}).on("end",function(){c.push(null)})}a.prototype._read=function(){this._helper.resume()},i.exports=a},{"../utils":32,"readable-stream":16}],14:[function(t,i,r){i.exports={isNode:typeof Buffer<"u",newBufferFrom:function(n,s){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(n,s);if(typeof n=="number")throw new Error('The "data" argument must not be a number');return new Buffer(n,s)},allocBuffer:function(n){if(Buffer.alloc)return Buffer.alloc(n);var s=new Buffer(n);return s.fill(0),s},isBuffer:function(n){return Buffer.isBuffer(n)},isStream:function(n){return n&&typeof n.on=="function"&&typeof n.pause=="function"&&typeof n.resume=="function"}}},{}],15:[function(t,i,r){var n=t("./utf8"),s=t("./utils"),a=t("./stream/GenericWorker"),u=t("./stream/StreamHelper"),h=t("./defaults"),d=t("./compressedObject"),c=t("./zipObject"),w=t("./generate"),m=t("./nodejsUtils"),N=t("./nodejs/NodejsStreamInputAdapter"),E=function(b,S,R){var I=s.getTypeOf(S),k,O=s.extend(R||{},h);O.date=O.date||new Date,O.compression!==null&&(O.compression=O.compression.toUpperCase()),typeof O.unixPermissions=="string"&&(O.unixPermissions=parseInt(O.unixPermissions,8)),O.unixPermissions&&O.unixPermissions&16384&&(O.dir=!0),O.dosPermissions&&O.dosPermissions&16&&(O.dir=!0),O.dir&&(b=v(b)),O.createFolders&&(k=f(b))&&g.call(this,k,!0);var G=I==="string"&&O.binary===!1&&O.base64===!1;(!R||typeof R.binary>"u")&&(O.binary=!G);var j=S instanceof d&&S.uncompressedSize===0;(j||O.dir||!S||S.length===0)&&(O.base64=!1,O.binary=!0,S="",O.compression="STORE",I="string");var Z=null;S instanceof d||S instanceof a?Z=S:m.isNode&&m.isStream(S)?Z=new N(b,S):Z=s.prepareContent(b,S,O.binary,O.optimizedBinaryString,O.base64);var Y=new c(b,Z,O);this.files[b]=Y},f=function(b){b.slice(-1)==="/"&&(b=b.substring(0,b.length-1));var S=b.lastIndexOf("/");return S>0?b.substring(0,S):""},v=function(b){return b.slice(-1)!=="/"&&(b+="/"),b},g=function(b,S){return S=typeof S<"u"?S:h.createFolders,b=v(b),this.files[b]||E.call(this,b,null,{dir:!0,createFolders:S}),this.files[b]};function D(b){return Object.prototype.toString.call(b)==="[object RegExp]"}var L={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(b){var S,R,I;for(S in this.files)I=this.files[S],R=S.slice(this.root.length,S.length),R&&S.slice(0,this.root.length)===this.root&&b(R,I)},filter:function(b){var S=[];return this.forEach(function(R,I){b(R,I)&&S.push(I)}),S},file:function(b,S,R){if(arguments.length===1)if(D(b)){var I=b;return this.filter(function(O,G){return!G.dir&&I.test(O)})}else{var k=this.files[this.root+b];return k&&!k.dir?k:null}else b=this.root+b,E.call(this,b,S,R);return this},folder:function(b){if(!b)return this;if(D(b))return this.filter(function(k,O){return O.dir&&b.test(k)});var S=this.root+b,R=g.call(this,S),I=this.clone();return I.root=R.name,I},remove:function(b){b=this.root+b;var S=this.files[b];if(S||(b.slice(-1)!=="/"&&(b+="/"),S=this.files[b]),S&&!S.dir)delete this.files[b];else for(var R=this.filter(function(k,O){return O.name.slice(0,b.length)===b}),I=0;I<R.length;I++)delete this.files[R[I].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(b){var S,R={};try{if(R=s.extend(b||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:n.utf8encode}),R.type=R.type.toLowerCase(),R.compression=R.compression.toUpperCase(),R.type==="binarystring"&&(R.type="string"),!R.type)throw new Error("No output type specified.");s.checkSupport(R.type),(R.platform==="darwin"||R.platform==="freebsd"||R.platform==="linux"||R.platform==="sunos")&&(R.platform="UNIX"),R.platform==="win32"&&(R.platform="DOS");var I=R.comment||this.comment||"";S=w.generateWorker(this,R,I)}catch(k){S=new a("error"),S.error(k)}return new u(S,R.type||"string",R.mimeType)},generateAsync:function(b,S){return this.generateInternalStream(b).accumulate(S)},generateNodeStream:function(b,S){return b=b||{},b.type||(b.type="nodebuffer"),this.generateInternalStream(b).toNodejsStream(S)}};i.exports=L},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(t,i,r){i.exports=t("stream")},{stream:void 0}],17:[function(t,i,r){var n=t("./DataReader"),s=t("../utils");function a(u){n.call(this,u);for(var h=0;h<this.data.length;h++)u[h]=u[h]&255}s.inherits(a,n),a.prototype.byteAt=function(u){return this.data[this.zero+u]},a.prototype.lastIndexOfSignature=function(u){for(var h=u.charCodeAt(0),d=u.charCodeAt(1),c=u.charCodeAt(2),w=u.charCodeAt(3),m=this.length-4;m>=0;--m)if(this.data[m]===h&&this.data[m+1]===d&&this.data[m+2]===c&&this.data[m+3]===w)return m-this.zero;return-1},a.prototype.readAndCheckSignature=function(u){var h=u.charCodeAt(0),d=u.charCodeAt(1),c=u.charCodeAt(2),w=u.charCodeAt(3),m=this.readData(4);return h===m[0]&&d===m[1]&&c===m[2]&&w===m[3]},a.prototype.readData=function(u){if(this.checkOffset(u),u===0)return[];var h=this.data.slice(this.zero+this.index,this.zero+this.index+u);return this.index+=u,h},i.exports=a},{"../utils":32,"./DataReader":18}],18:[function(t,i,r){var n=t("../utils");function s(a){this.data=a,this.length=a.length,this.index=0,this.zero=0}s.prototype={checkOffset:function(a){this.checkIndex(this.index+a)},checkIndex:function(a){if(this.length<this.zero+a||a<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+a+"). Corrupted zip ?")},setIndex:function(a){this.checkIndex(a),this.index=a},skip:function(a){this.setIndex(this.index+a)},byteAt:function(){},readInt:function(a){var u=0,h;for(this.checkOffset(a),h=this.index+a-1;h>=this.index;h--)u=(u<<8)+this.byteAt(h);return this.index+=a,u},readString:function(a){return n.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC((a>>25&127)+1980,(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(a&31)<<1))}},i.exports=s},{"../utils":32}],19:[function(t,i,r){var n=t("./Uint8ArrayReader"),s=t("../utils");function a(u){n.call(this,u)}s.inherits(a,n),a.prototype.readData=function(u){this.checkOffset(u);var h=this.data.slice(this.zero+this.index,this.zero+this.index+u);return this.index+=u,h},i.exports=a},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,i,r){var n=t("./DataReader"),s=t("../utils");function a(u){n.call(this,u)}s.inherits(a,n),a.prototype.byteAt=function(u){return this.data.charCodeAt(this.zero+u)},a.prototype.lastIndexOfSignature=function(u){return this.data.lastIndexOf(u)-this.zero},a.prototype.readAndCheckSignature=function(u){var h=this.readData(4);return u===h},a.prototype.readData=function(u){this.checkOffset(u);var h=this.data.slice(this.zero+this.index,this.zero+this.index+u);return this.index+=u,h},i.exports=a},{"../utils":32,"./DataReader":18}],21:[function(t,i,r){var n=t("./ArrayReader"),s=t("../utils");function a(u){n.call(this,u)}s.inherits(a,n),a.prototype.readData=function(u){if(this.checkOffset(u),u===0)return new Uint8Array(0);var h=this.data.subarray(this.zero+this.index,this.zero+this.index+u);return this.index+=u,h},i.exports=a},{"../utils":32,"./ArrayReader":17}],22:[function(t,i,r){var n=t("../utils"),s=t("../support"),a=t("./ArrayReader"),u=t("./StringReader"),h=t("./NodeBufferReader"),d=t("./Uint8ArrayReader");i.exports=function(c){var w=n.getTypeOf(c);return n.checkSupport(w),w==="string"&&!s.uint8array?new u(c):w==="nodebuffer"?new h(c):s.uint8array?new d(n.transformTo("uint8array",c)):new a(n.transformTo("array",c))}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,i,r){r.LOCAL_FILE_HEADER="PK",r.CENTRAL_FILE_HEADER="PK",r.CENTRAL_DIRECTORY_END="PK",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",r.ZIP64_CENTRAL_DIRECTORY_END="PK",r.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(t,i,r){var n=t("./GenericWorker"),s=t("../utils");function a(u){n.call(this,"ConvertWorker to "+u),this.destType=u}s.inherits(a,n),a.prototype.processChunk=function(u){this.push({data:s.transformTo(this.destType,u.data),meta:u.meta})},i.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(t,i,r){var n=t("./GenericWorker"),s=t("../crc32"),a=t("../utils");function u(){n.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}a.inherits(u,n),u.prototype.processChunk=function(h){this.streamInfo.crc32=s(h.data,this.streamInfo.crc32||0),this.push(h)},i.exports=u},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,i,r){var n=t("../utils"),s=t("./GenericWorker");function a(u){s.call(this,"DataLengthProbe for "+u),this.propName=u,this.withStreamInfo(u,0)}n.inherits(a,s),a.prototype.processChunk=function(u){if(u){var h=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=h+u.data.length}s.prototype.processChunk.call(this,u)},i.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(t,i,r){var n=t("../utils"),s=t("./GenericWorker"),a=16*1024;function u(h){s.call(this,"DataWorker");var d=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,h.then(function(c){d.dataIsReady=!0,d.data=c,d.max=c&&c.length||0,d.type=n.getTypeOf(c),d.isPaused||d._tickAndRepeat()},function(c){d.error(c)})}n.inherits(u,s),u.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this.data=null},u.prototype.resume=function(){return s.prototype.resume.call(this)?(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0):!1},u.prototype._tickAndRepeat=function(){this._tickScheduled=!1,!(this.isPaused||this.isFinished)&&(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},u.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var h=a,d=null,c=Math.min(this.max,this.index+h);if(this.index>=this.max)return this.end();switch(this.type){case"string":d=this.data.substring(this.index,c);break;case"uint8array":d=this.data.subarray(this.index,c);break;case"array":case"nodebuffer":d=this.data.slice(this.index,c);break}return this.index=c,this.push({data:d,meta:{percent:this.max?this.index/this.max*100:0}})},i.exports=u},{"../utils":32,"./GenericWorker":28}],28:[function(t,i,r){function n(s){this.name=s||"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}n.prototype={push:function(s){this.emit("data",s)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(s){this.emit("error",s)}return!0},error:function(s){return this.isFinished?!1:(this.isPaused?this.generatedError=s:(this.isFinished=!0,this.emit("error",s),this.previous&&this.previous.error(s),this.cleanUp()),!0)},on:function(s,a){return this._listeners[s].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(s,a){if(this._listeners[s])for(var u=0;u<this._listeners[s].length;u++)this._listeners[s][u].call(this,a)},pipe:function(s){return s.registerPrevious(this)},registerPrevious:function(s){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=s.streamInfo,this.mergeStreamInfo(),this.previous=s;var a=this;return s.on("data",function(u){a.processChunk(u)}),s.on("end",function(){a.end()}),s.on("error",function(u){a.error(u)}),this},pause:function(){return this.isPaused||this.isFinished?!1:(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;this.isPaused=!1;var s=!1;return this.generatedError&&(this.error(this.generatedError),s=!0),this.previous&&this.previous.resume(),!s},flush:function(){},processChunk:function(s){this.push(s)},withStreamInfo:function(s,a){return this.extraStreamInfo[s]=a,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var s in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,s)&&(this.streamInfo[s]=this.extraStreamInfo[s])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var s="Worker "+this.name;return this.previous?this.previous+" -> "+s:s}},i.exports=n},{}],29:[function(t,i,r){var n=t("../utils"),s=t("./ConvertWorker"),a=t("./GenericWorker"),u=t("../base64"),h=t("../support"),d=t("../external"),c=null;if(h.nodestream)try{c=t("../nodejs/NodejsStreamOutputAdapter")}catch{}function w(f,v,g){switch(f){case"blob":return n.newBlob(n.transformTo("arraybuffer",v),g);case"base64":return u.encode(v);default:return n.transformTo(f,v)}}function m(f,v){var g,D=0,L=null,b=0;for(g=0;g<v.length;g++)b+=v[g].length;switch(f){case"string":return v.join("");case"array":return Array.prototype.concat.apply([],v);case"uint8array":for(L=new Uint8Array(b),g=0;g<v.length;g++)L.set(v[g],D),D+=v[g].length;return L;case"nodebuffer":return Buffer.concat(v);default:throw new Error("concat : unsupported type '"+f+"'")}}function N(f,v){return new d.Promise(function(g,D){var L=[],b=f._internalType,S=f._outputType,R=f._mimeType;f.on("data",function(I,k){L.push(I),v&&v(k)}).on("error",function(I){L=[],D(I)}).on("end",function(){try{var I=w(S,m(b,L),R);g(I)}catch(k){D(k)}L=[]}).resume()})}function E(f,v,g){var D=v;switch(v){case"blob":case"arraybuffer":D="uint8array";break;case"base64":D="string";break}try{this._internalType=D,this._outputType=v,this._mimeType=g,n.checkSupport(D),this._worker=f.pipe(new s(D)),f.lock()}catch(L){this._worker=new a("error"),this._worker.error(L)}}E.prototype={accumulate:function(f){return N(this,f)},on:function(f,v){var g=this;return f==="data"?this._worker.on(f,function(D){v.call(g,D.data,D.meta)}):this._worker.on(f,function(){n.delay(v,arguments,g)}),this},resume:function(){return n.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(f){if(n.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new c(this,{objectMode:this._outputType!=="nodebuffer"},f)}},i.exports=E},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(t,i,r){if(r.base64=!0,r.array=!0,r.string=!0,r.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",r.nodebuffer=typeof Buffer<"u",r.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")r.blob=!1;else{var n=new ArrayBuffer(0);try{r.blob=new Blob([n],{type:"application/zip"}).size===0}catch{try{var s=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,a=new s;a.append(n),r.blob=a.getBlob("application/zip").size===0}catch{r.blob=!1}}}try{r.nodestream=!!t("readable-stream").Readable}catch{r.nodestream=!1}},{"readable-stream":16}],31:[function(t,i,r){for(var n=t("./utils"),s=t("./support"),a=t("./nodejsUtils"),u=t("./stream/GenericWorker"),h=new Array(256),d=0;d<256;d++)h[d]=d>=252?6:d>=248?5:d>=240?4:d>=224?3:d>=192?2:1;h[254]=h[254]=1;var c=function(f){var v,g,D,L,b,S=f.length,R=0;for(L=0;L<S;L++)g=f.charCodeAt(L),(g&64512)===55296&&L+1<S&&(D=f.charCodeAt(L+1),(D&64512)===56320&&(g=65536+(g-55296<<10)+(D-56320),L++)),R+=g<128?1:g<2048?2:g<65536?3:4;for(s.uint8array?v=new Uint8Array(R):v=new Array(R),b=0,L=0;b<R;L++)g=f.charCodeAt(L),(g&64512)===55296&&L+1<S&&(D=f.charCodeAt(L+1),(D&64512)===56320&&(g=65536+(g-55296<<10)+(D-56320),L++)),g<128?v[b++]=g:g<2048?(v[b++]=192|g>>>6,v[b++]=128|g&63):g<65536?(v[b++]=224|g>>>12,v[b++]=128|g>>>6&63,v[b++]=128|g&63):(v[b++]=240|g>>>18,v[b++]=128|g>>>12&63,v[b++]=128|g>>>6&63,v[b++]=128|g&63);return v},w=function(f,v){var g;for(v=v||f.length,v>f.length&&(v=f.length),g=v-1;g>=0&&(f[g]&192)===128;)g--;return g<0||g===0?v:g+h[f[g]]>v?g:v},m=function(f){var v,g,D,L,b=f.length,S=new Array(b*2);for(g=0,v=0;v<b;){if(D=f[v++],D<128){S[g++]=D;continue}if(L=h[D],L>4){S[g++]=65533,v+=L-1;continue}for(D&=L===2?31:L===3?15:7;L>1&&v<b;)D=D<<6|f[v++]&63,L--;if(L>1){S[g++]=65533;continue}D<65536?S[g++]=D:(D-=65536,S[g++]=55296|D>>10&1023,S[g++]=56320|D&1023)}return S.length!==g&&(S.subarray?S=S.subarray(0,g):S.length=g),n.applyFromCharCode(S)};r.utf8encode=function(v){return s.nodebuffer?a.newBufferFrom(v,"utf-8"):c(v)},r.utf8decode=function(v){return s.nodebuffer?n.transformTo("nodebuffer",v).toString("utf-8"):(v=n.transformTo(s.uint8array?"uint8array":"array",v),m(v))};function N(){u.call(this,"utf-8 decode"),this.leftOver=null}n.inherits(N,u),N.prototype.processChunk=function(f){var v=n.transformTo(s.uint8array?"uint8array":"array",f.data);if(this.leftOver&&this.leftOver.length){if(s.uint8array){var g=v;v=new Uint8Array(g.length+this.leftOver.length),v.set(this.leftOver,0),v.set(g,this.leftOver.length)}else v=this.leftOver.concat(v);this.leftOver=null}var D=w(v),L=v;D!==v.length&&(s.uint8array?(L=v.subarray(0,D),this.leftOver=v.subarray(D,v.length)):(L=v.slice(0,D),this.leftOver=v.slice(D,v.length))),this.push({data:r.utf8decode(L),meta:f.meta})},N.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:r.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},r.Utf8DecodeWorker=N;function E(){u.call(this,"utf-8 encode")}n.inherits(E,u),E.prototype.processChunk=function(f){this.push({data:r.utf8encode(f.data),meta:f.meta})},r.Utf8EncodeWorker=E},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,i,r){var n=t("./support"),s=t("./base64"),a=t("./nodejsUtils"),u=t("./external");t("setimmediate");function h(f){var v=null;return n.uint8array?v=new Uint8Array(f.length):v=new Array(f.length),c(f,v)}r.newBlob=function(f,v){r.checkSupport("blob");try{return new Blob([f],{type:v})}catch{try{var g=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,D=new g;return D.append(f),D.getBlob(v)}catch{throw new Error("Bug : can't construct the Blob.")}}};function d(f){return f}function c(f,v){for(var g=0;g<f.length;++g)v[g]=f.charCodeAt(g)&255;return v}var w={stringifyByChunk:function(f,v,g){var D=[],L=0,b=f.length;if(b<=g)return String.fromCharCode.apply(null,f);for(;L<b;)v==="array"||v==="nodebuffer"?D.push(String.fromCharCode.apply(null,f.slice(L,Math.min(L+g,b)))):D.push(String.fromCharCode.apply(null,f.subarray(L,Math.min(L+g,b)))),L+=g;return D.join("")},stringifyByChar:function(f){for(var v="",g=0;g<f.length;g++)v+=String.fromCharCode(f[g]);return v},applyCanBeUsed:{uint8array:(function(){try{return n.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return n.nodebuffer&&String.fromCharCode.apply(null,a.allocBuffer(1)).length===1}catch{return!1}})()}};function m(f){var v=65536,g=r.getTypeOf(f),D=!0;if(g==="uint8array"?D=w.applyCanBeUsed.uint8array:g==="nodebuffer"&&(D=w.applyCanBeUsed.nodebuffer),D)for(;v>1;)try{return w.stringifyByChunk(f,g,v)}catch{v=Math.floor(v/2)}return w.stringifyByChar(f)}r.applyFromCharCode=m;function N(f,v){for(var g=0;g<f.length;g++)v[g]=f[g];return v}var E={};E.string={string:d,array:function(f){return c(f,new Array(f.length))},arraybuffer:function(f){return E.string.uint8array(f).buffer},uint8array:function(f){return c(f,new Uint8Array(f.length))},nodebuffer:function(f){return c(f,a.allocBuffer(f.length))}},E.array={string:m,array:d,arraybuffer:function(f){return new Uint8Array(f).buffer},uint8array:function(f){return new Uint8Array(f)},nodebuffer:function(f){return a.newBufferFrom(f)}},E.arraybuffer={string:function(f){return m(new Uint8Array(f))},array:function(f){return N(new Uint8Array(f),new Array(f.byteLength))},arraybuffer:d,uint8array:function(f){return new Uint8Array(f)},nodebuffer:function(f){return a.newBufferFrom(new Uint8Array(f))}},E.uint8array={string:m,array:function(f){return N(f,new Array(f.length))},arraybuffer:function(f){return f.buffer},uint8array:d,nodebuffer:function(f){return a.newBufferFrom(f)}},E.nodebuffer={string:m,array:function(f){return N(f,new Array(f.length))},arraybuffer:function(f){return E.nodebuffer.uint8array(f).buffer},uint8array:function(f){return N(f,new Uint8Array(f.length))},nodebuffer:d},r.transformTo=function(f,v){if(v||(v=""),!f)return v;r.checkSupport(f);var g=r.getTypeOf(v),D=E[g][f](v);return D},r.resolve=function(f){for(var v=f.split("/"),g=[],D=0;D<v.length;D++){var L=v[D];L==="."||L===""&&D!==0&&D!==v.length-1||(L===".."?g.pop():g.push(L))}return g.join("/")},r.getTypeOf=function(f){if(typeof f=="string")return"string";if(Object.prototype.toString.call(f)==="[object Array]")return"array";if(n.nodebuffer&&a.isBuffer(f))return"nodebuffer";if(n.uint8array&&f instanceof Uint8Array)return"uint8array";if(n.arraybuffer&&f instanceof ArrayBuffer)return"arraybuffer"},r.checkSupport=function(f){var v=n[f.toLowerCase()];if(!v)throw new Error(f+" is not supported by this platform")},r.MAX_VALUE_16BITS=65535,r.MAX_VALUE_32BITS=-1,r.pretty=function(f){var v="",g,D;for(D=0;D<(f||"").length;D++)g=f.charCodeAt(D),v+="\\x"+(g<16?"0":"")+g.toString(16).toUpperCase();return v},r.delay=function(f,v,g){setImmediate(function(){f.apply(g||null,v||[])})},r.inherits=function(f,v){var g=function(){};g.prototype=v.prototype,f.prototype=new g},r.extend=function(){var f={},v,g;for(v=0;v<arguments.length;v++)for(g in arguments[v])Object.prototype.hasOwnProperty.call(arguments[v],g)&&typeof f[g]>"u"&&(f[g]=arguments[v][g]);return f},r.prepareContent=function(f,v,g,D,L){var b=u.Promise.resolve(v).then(function(S){var R=n.blob&&(S instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(S))!==-1);return R&&typeof FileReader<"u"?new u.Promise(function(I,k){var O=new FileReader;O.onload=function(G){I(G.target.result)},O.onerror=function(G){k(G.target.error)},O.readAsArrayBuffer(S)}):S});return b.then(function(S){var R=r.getTypeOf(S);return R?(R==="arraybuffer"?S=r.transformTo("uint8array",S):R==="string"&&(L?S=s.decode(S):g&&D!==!0&&(S=h(S))),S):u.Promise.reject(new Error("Can't read the data of '"+f+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(t,i,r){var n=t("./reader/readerFor"),s=t("./utils"),a=t("./signature"),u=t("./zipEntry"),h=t("./support");function d(c){this.files=[],this.loadOptions=c}d.prototype={checkSignature:function(c){if(!this.reader.readAndCheckSignature(c)){this.reader.index-=4;var w=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+s.pretty(w)+", expected "+s.pretty(c)+")")}},isSignature:function(c,w){var m=this.reader.index;this.reader.setIndex(c);var N=this.reader.readString(4),E=N===w;return this.reader.setIndex(m),E},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 c=this.reader.readData(this.zipCommentLength),w=h.uint8array?"uint8array":"array",m=s.transformTo(w,c);this.zipComment=this.loadOptions.decodeFileName(m)},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={};for(var c=this.zip64EndOfCentralSize-44,w=0,m,N,E;w<c;)m=this.reader.readInt(2),N=this.reader.readInt(4),E=this.reader.readData(N),this.zip64ExtensibleData[m]={id:m,length:N,value:E}},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 new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var c,w;for(c=0;c<this.files.length;c++)w=this.files[c],this.reader.setIndex(w.localHeaderOffset),this.checkSignature(a.LOCAL_FILE_HEADER),w.readLocalPart(this.reader),w.handleUTF8(),w.processAttributes()},readCentralDir:function(){var c;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(a.CENTRAL_FILE_HEADER);)c=new u({zip64:this.zip64},this.loadOptions),c.readCentralPart(this.reader),this.files.push(c);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var c=this.reader.lastIndexOfSignature(a.CENTRAL_DIRECTORY_END);if(c<0){var w=!this.isSignature(0,a.LOCAL_FILE_HEADER);throw w?new 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"):new Error("Corrupted zip: can't find end of central directory")}this.reader.setIndex(c);var m=c;if(this.checkSignature(a.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===s.MAX_VALUE_16BITS||this.diskWithCentralDirStart===s.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===s.MAX_VALUE_16BITS||this.centralDirRecords===s.MAX_VALUE_16BITS||this.centralDirSize===s.MAX_VALUE_32BITS||this.centralDirOffset===s.MAX_VALUE_32BITS){if(this.zip64=!0,c=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR),c<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(c),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,a.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var N=this.centralDirOffset+this.centralDirSize;this.zip64&&(N+=20,N+=12+this.zip64EndOfCentralSize);var E=m-N;if(E>0)this.isSignature(m,a.CENTRAL_FILE_HEADER)||(this.reader.zero=E);else if(E<0)throw new Error("Corrupted zip: missing "+Math.abs(E)+" bytes.")},prepareReader:function(c){this.reader=n(c)},load:function(c){this.prepareReader(c),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},i.exports=d},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(t,i,r){var n=t("./reader/readerFor"),s=t("./utils"),a=t("./compressedObject"),u=t("./crc32"),h=t("./utf8"),d=t("./compressions"),c=t("./support"),w=0,m=3,N=function(f){for(var v in d)if(Object.prototype.hasOwnProperty.call(d,v)&&d[v].magic===f)return d[v];return null};function E(f,v){this.options=f,this.loadOptions=v}E.prototype={isEncrypted:function(){return(this.bitFlag&1)===1},useUTF8:function(){return(this.bitFlag&2048)===2048},readLocalPart:function(f){var v,g;if(f.skip(22),this.fileNameLength=f.readInt(2),g=f.readInt(2),this.fileName=f.readData(this.fileNameLength),f.skip(g),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(v=N(this.compressionMethod),v===null)throw new Error("Corrupted zip : compression "+s.pretty(this.compressionMethod)+" unknown (inner file : "+s.transformTo("string",this.fileName)+")");this.decompressed=new a(this.compressedSize,this.uncompressedSize,this.crc32,v,f.readData(this.compressedSize))},readCentralPart:function(f){this.versionMadeBy=f.readInt(2),f.skip(2),this.bitFlag=f.readInt(2),this.compressionMethod=f.readString(2),this.date=f.readDate(),this.crc32=f.readInt(4),this.compressedSize=f.readInt(4),this.uncompressedSize=f.readInt(4);var v=f.readInt(2);if(this.extraFieldsLength=f.readInt(2),this.fileCommentLength=f.readInt(2),this.diskNumberStart=f.readInt(2),this.internalFileAttributes=f.readInt(2),this.externalFileAttributes=f.readInt(4),this.localHeaderOffset=f.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");f.skip(v),this.readExtraFields(f),this.parseZIP64ExtraField(f),this.fileComment=f.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var f=this.versionMadeBy>>8;this.dir=!!(this.externalFileAttributes&16),f===w&&(this.dosPermissions=this.externalFileAttributes&63),f===m&&(this.unixPermissions=this.externalFileAttributes>>16&65535),!this.dir&&this.fileNameStr.slice(-1)==="/"&&(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var f=n(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=f.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=f.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=f.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=f.readInt(4))}},readExtraFields:function(f){var v=f.index+this.extraFieldsLength,g,D,L;for(this.extraFields||(this.extraFields={});f.index+4<v;)g=f.readInt(2),D=f.readInt(2),L=f.readData(D),this.extraFields[g]={id:g,length:D,value:L};f.setIndex(v)},handleUTF8:function(){var f=c.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=h.utf8decode(this.fileName),this.fileCommentStr=h.utf8decode(this.fileComment);else{var v=this.findExtraFieldUnicodePath();if(v!==null)this.fileNameStr=v;else{var g=s.transformTo(f,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(g)}var D=this.findExtraFieldUnicodeComment();if(D!==null)this.fileCommentStr=D;else{var L=s.transformTo(f,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(L)}}},findExtraFieldUnicodePath:function(){var f=this.extraFields[28789];if(f){var v=n(f.value);return v.readInt(1)!==1||u(this.fileName)!==v.readInt(4)?null:h.utf8decode(v.readData(f.length-5))}return null},findExtraFieldUnicodeComment:function(){var f=this.extraFields[25461];if(f){var v=n(f.value);return v.readInt(1)!==1||u(this.fileComment)!==v.readInt(4)?null:h.utf8decode(v.readData(f.length-5))}return null}},i.exports=E},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(t,i,r){var n=t("./stream/StreamHelper"),s=t("./stream/DataWorker"),a=t("./utf8"),u=t("./compressedObject"),h=t("./stream/GenericWorker"),d=function(N,E,f){this.name=N,this.dir=f.dir,this.date=f.date,this.comment=f.comment,this.unixPermissions=f.unixPermissions,this.dosPermissions=f.dosPermissions,this._data=E,this._dataBinary=f.binary,this.options={compression:f.compression,compressionOptions:f.compressionOptions}};d.prototype={internalStream:function(N){var E=null,f="string";try{if(!N)throw new Error("No output type specified.");f=N.toLowerCase();var v=f==="string"||f==="text";(f==="binarystring"||f==="text")&&(f="string"),E=this._decompressWorker();var g=!this._dataBinary;g&&!v&&(E=E.pipe(new a.Utf8EncodeWorker)),!g&&v&&(E=E.pipe(new a.Utf8DecodeWorker))}catch(D){E=new h("error"),E.error(D)}return new n(E,f,"")},async:function(N,E){return this.internalStream(N).accumulate(E)},nodeStream:function(N,E){return this.internalStream(N||"nodebuffer").toNodejsStream(E)},_compressWorker:function(N,E){if(this._data instanceof u&&this._data.compression.magic===N.magic)return this._data.getCompressedWorker();var f=this._decompressWorker();return this._dataBinary||(f=f.pipe(new a.Utf8EncodeWorker)),u.createWorkerFrom(f,N,E)},_decompressWorker:function(){return this._data instanceof u?this._data.getContentWorker():this._data instanceof h?this._data:new s(this._data)}};for(var c=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],w=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},m=0;m<c.length;m++)d.prototype[c[m]]=w;i.exports=d},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(t,i,r){(function(n){var s=n.MutationObserver||n.WebKitMutationObserver,a;if(s){var u=0,h=new s(N),d=n.document.createTextNode("");h.observe(d,{characterData:!0}),a=function(){d.data=u=++u%2}}else if(!n.setImmediate&&typeof n.MessageChannel<"u"){var c=new n.MessageChannel;c.port1.onmessage=N,a=function(){c.port2.postMessage(0)}}else"document"in n&&"onreadystatechange"in n.document.createElement("script")?a=function(){var f=n.document.createElement("script");f.onreadystatechange=function(){N(),f.onreadystatechange=null,f.parentNode.removeChild(f),f=null},n.document.documentElement.appendChild(f)}:a=function(){setTimeout(N,0)};var w,m=[];function N(){w=!0;for(var f,v,g=m.length;g;){for(v=m,m=[],f=-1;++f<g;)v[f]();g=m.length}w=!1}i.exports=E;function E(f){m.push(f)===1&&!w&&a()}}).call(this,typeof bt<"u"?bt:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(t,i,r){var n=t("immediate");function s(){}var a={},u=["REJECTED"],h=["FULFILLED"],d=["PENDING"];i.exports=c;function c(b){if(typeof b!="function")throw new TypeError("resolver must be a function");this.state=d,this.queue=[],this.outcome=void 0,b!==s&&E(this,b)}c.prototype.finally=function(b){if(typeof b!="function")return this;var S=this.constructor;return this.then(R,I);function R(k){function O(){return k}return S.resolve(b()).then(O)}function I(k){function O(){throw k}return S.resolve(b()).then(O)}},c.prototype.catch=function(b){return this.then(null,b)},c.prototype.then=function(b,S){if(typeof b!="function"&&this.state===h||typeof S!="function"&&this.state===u)return this;var R=new this.constructor(s);if(this.state!==d){var I=this.state===h?b:S;m(R,I,this.outcome)}else this.queue.push(new w(R,b,S));return R};function w(b,S,R){this.promise=b,typeof S=="function"&&(this.onFulfilled=S,this.callFulfilled=this.otherCallFulfilled),typeof R=="function"&&(this.onRejected=R,this.callRejected=this.otherCallRejected)}w.prototype.callFulfilled=function(b){a.resolve(this.promise,b)},w.prototype.otherCallFulfilled=function(b){m(this.promise,this.onFulfilled,b)},w.prototype.callRejected=function(b){a.reject(this.promise,b)},w.prototype.otherCallRejected=function(b){m(this.promise,this.onRejected,b)};function m(b,S,R){n(function(){var I;try{I=S(R)}catch(k){return a.reject(b,k)}I===b?a.reject(b,new TypeError("Cannot resolve promise with itself")):a.resolve(b,I)})}a.resolve=function(b,S){var R=f(N,S);if(R.status==="error")return a.reject(b,R.value);var I=R.value;if(I)E(b,I);else{b.state=h,b.outcome=S;for(var k=-1,O=b.queue.length;++k<O;)b.queue[k].callFulfilled(S)}return b},a.reject=function(b,S){b.state=u,b.outcome=S;for(var R=-1,I=b.queue.length;++R<I;)b.queue[R].callRejected(S);return b};function N(b){var S=b&&b.then;if(b&&(typeof b=="object"||typeof b=="function")&&typeof S=="function")return function(){S.apply(b,arguments)}}function E(b,S){var R=!1;function I(j){R||(R=!0,a.reject(b,j))}function k(j){R||(R=!0,a.resolve(b,j))}function O(){S(k,I)}var G=f(O);G.status==="error"&&I(G.value)}function f(b,S){var R={};try{R.value=b(S),R.status="success"}catch(I){R.status="error",R.value=I}return R}c.resolve=v;function v(b){return b instanceof this?b:a.resolve(new this(s),b)}c.reject=g;function g(b){var S=new this(s);return a.reject(S,b)}c.all=D;function D(b){var S=this;if(Object.prototype.toString.call(b)!=="[object Array]")return this.reject(new TypeError("must be an array"));var R=b.length,I=!1;if(!R)return this.resolve([]);for(var k=new Array(R),O=0,G=-1,j=new this(s);++G<R;)Z(b[G],G);return j;function Z(Y,X){S.resolve(Y).then(ie,function(K){I||(I=!0,a.reject(j,K))});function ie(K){k[X]=K,++O===R&&!I&&(I=!0,a.resolve(j,k))}}}c.race=L;function L(b){var S=this;if(Object.prototype.toString.call(b)!=="[object Array]")return this.reject(new TypeError("must be an array"));var R=b.length,I=!1;if(!R)return this.resolve([]);for(var k=-1,O=new this(s);++k<R;)G(b[k]);return O;function G(j){S.resolve(j).then(function(Z){I||(I=!0,a.resolve(O,Z))},function(Z){I||(I=!0,a.reject(O,Z))})}}},{immediate:36}],38:[function(t,i,r){var n=t("./lib/utils/common").assign,s=t("./lib/deflate"),a=t("./lib/inflate"),u=t("./lib/zlib/constants"),h={};n(h,s,a,u),i.exports=h},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(t,i,r){var n=t("./zlib/deflate"),s=t("./utils/common"),a=t("./utils/strings"),u=t("./zlib/messages"),h=t("./zlib/zstream"),d=Object.prototype.toString,c=0,w=4,m=0,N=1,E=2,f=-1,v=0,g=8;function D(R){if(!(this instanceof D))return new D(R);this.options=s.assign({level:f,method:g,chunkSize:16384,windowBits:15,memLevel:8,strategy:v,to:""},R||{});var I=this.options;I.raw&&I.windowBits>0?I.windowBits=-I.windowBits:I.gzip&&I.windowBits>0&&I.windowBits<16&&(I.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new h,this.strm.avail_out=0;var k=n.deflateInit2(this.strm,I.level,I.method,I.windowBits,I.memLevel,I.strategy);if(k!==m)throw new Error(u[k]);if(I.header&&n.deflateSetHeader(this.strm,I.header),I.dictionary){var O;if(typeof I.dictionary=="string"?O=a.string2buf(I.dictionary):d.call(I.dictionary)==="[object ArrayBuffer]"?O=new Uint8Array(I.dictionary):O=I.dictionary,k=n.deflateSetDictionary(this.strm,O),k!==m)throw new Error(u[k]);this._dict_set=!0}}D.prototype.push=function(R,I){var k=this.strm,O=this.options.chunkSize,G,j;if(this.ended)return!1;j=I===~~I?I:I===!0?w:c,typeof R=="string"?k.input=a.string2buf(R):d.call(R)==="[object ArrayBuffer]"?k.input=new Uint8Array(R):k.input=R,k.next_in=0,k.avail_in=k.input.length;do{if(k.avail_out===0&&(k.output=new s.Buf8(O),k.next_out=0,k.avail_out=O),G=n.deflate(k,j),G!==N&&G!==m)return this.onEnd(G),this.ended=!0,!1;(k.avail_out===0||k.avail_in===0&&(j===w||j===E))&&(this.options.to==="string"?this.onData(a.buf2binstring(s.shrinkBuf(k.output,k.next_out))):this.onData(s.shrinkBuf(k.output,k.next_out)))}while((k.avail_in>0||k.avail_out===0)&&G!==N);return j===w?(G=n.deflateEnd(this.strm),this.onEnd(G),this.ended=!0,G===m):(j===E&&(this.onEnd(m),k.avail_out=0),!0)},D.prototype.onData=function(R){this.chunks.push(R)},D.prototype.onEnd=function(R){R===m&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=R,this.msg=this.strm.msg};function L(R,I){var k=new D(I);if(k.push(R,!0),k.err)throw k.msg||u[k.err];return k.result}function b(R,I){return I=I||{},I.raw=!0,L(R,I)}function S(R,I){return I=I||{},I.gzip=!0,L(R,I)}r.Deflate=D,r.deflate=L,r.deflateRaw=b,r.gzip=S},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(t,i,r){var n=t("./zlib/inflate"),s=t("./utils/common"),a=t("./utils/strings"),u=t("./zlib/constants"),h=t("./zlib/messages"),d=t("./zlib/zstream"),c=t("./zlib/gzheader"),w=Object.prototype.toString;function m(f){if(!(this instanceof m))return new m(f);this.options=s.assign({chunkSize:16384,windowBits:0,to:""},f||{});var v=this.options;v.raw&&v.windowBits>=0&&v.windowBits<16&&(v.windowBits=-v.windowBits,v.windowBits===0&&(v.windowBits=-15)),v.windowBits>=0&&v.windowBits<16&&!(f&&f.windowBits)&&(v.windowBits+=32),v.windowBits>15&&v.windowBits<48&&(v.windowBits&15)===0&&(v.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new d,this.strm.avail_out=0;var g=n.inflateInit2(this.strm,v.windowBits);if(g!==u.Z_OK)throw new Error(h[g]);this.header=new c,n.inflateGetHeader(this.strm,this.header)}m.prototype.push=function(f,v){var g=this.strm,D=this.options.chunkSize,L=this.options.dictionary,b,S,R,I,k,O,G=!1;if(this.ended)return!1;S=v===~~v?v:v===!0?u.Z_FINISH:u.Z_NO_FLUSH,typeof f=="string"?g.input=a.binstring2buf(f):w.call(f)==="[object ArrayBuffer]"?g.input=new Uint8Array(f):g.input=f,g.next_in=0,g.avail_in=g.input.length;do{if(g.avail_out===0&&(g.output=new s.Buf8(D),g.next_out=0,g.avail_out=D),b=n.inflate(g,u.Z_NO_FLUSH),b===u.Z_NEED_DICT&&L&&(typeof L=="string"?O=a.string2buf(L):w.call(L)==="[object ArrayBuffer]"?O=new Uint8Array(L):O=L,b=n.inflateSetDictionary(this.strm,O)),b===u.Z_BUF_ERROR&&G===!0&&(b=u.Z_OK,G=!1),b!==u.Z_STREAM_END&&b!==u.Z_OK)return this.onEnd(b),this.ended=!0,!1;g.next_out&&(g.avail_out===0||b===u.Z_STREAM_END||g.avail_in===0&&(S===u.Z_FINISH||S===u.Z_SYNC_FLUSH))&&(this.options.to==="string"?(R=a.utf8border(g.output,g.next_out),I=g.next_out-R,k=a.buf2string(g.output,R),g.next_out=I,g.avail_out=D-I,I&&s.arraySet(g.output,g.output,R,I,0),this.onData(k)):this.onData(s.shrinkBuf(g.output,g.next_out))),g.avail_in===0&&g.avail_out===0&&(G=!0)}while((g.avail_in>0||g.avail_out===0)&&b!==u.Z_STREAM_END);return b===u.Z_STREAM_END&&(S=u.Z_FINISH),S===u.Z_FINISH?(b=n.inflateEnd(this.strm),this.onEnd(b),this.ended=!0,b===u.Z_OK):(S===u.Z_SYNC_FLUSH&&(this.onEnd(u.Z_OK),g.avail_out=0),!0)},m.prototype.onData=function(f){this.chunks.push(f)},m.prototype.onEnd=function(f){f===u.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=f,this.msg=this.strm.msg};function N(f,v){var g=new m(v);if(g.push(f,!0),g.err)throw g.msg||h[g.err];return g.result}function E(f,v){return v=v||{},v.raw=!0,N(f,v)}r.Inflate=m,r.inflate=N,r.inflateRaw=E,r.ungzip=N},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(t,i,r){var n=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";r.assign=function(u){for(var h=Array.prototype.slice.call(arguments,1);h.length;){var d=h.shift();if(d){if(typeof d!="object")throw new TypeError(d+"must be non-object");for(var c in d)d.hasOwnProperty(c)&&(u[c]=d[c])}}return u},r.shrinkBuf=function(u,h){return u.length===h?u:u.subarray?u.subarray(0,h):(u.length=h,u)};var s={arraySet:function(u,h,d,c,w){if(h.subarray&&u.subarray){u.set(h.subarray(d,d+c),w);return}for(var m=0;m<c;m++)u[w+m]=h[d+m]},flattenChunks:function(u){var h,d,c,w,m,N;for(c=0,h=0,d=u.length;h<d;h++)c+=u[h].length;for(N=new Uint8Array(c),w=0,h=0,d=u.length;h<d;h++)m=u[h],N.set(m,w),w+=m.length;return N}},a={arraySet:function(u,h,d,c,w){for(var m=0;m<c;m++)u[w+m]=h[d+m]},flattenChunks:function(u){return[].concat.apply([],u)}};r.setTyped=function(u){u?(r.Buf8=Uint8Array,r.Buf16=Uint16Array,r.Buf32=Int32Array,r.assign(r,s)):(r.Buf8=Array,r.Buf16=Array,r.Buf32=Array,r.assign(r,a))},r.setTyped(n)},{}],42:[function(t,i,r){var n=t("./common"),s=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch{s=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{a=!1}for(var u=new n.Buf8(256),h=0;h<256;h++)u[h]=h>=252?6:h>=248?5:h>=240?4:h>=224?3:h>=192?2:1;u[254]=u[254]=1,r.string2buf=function(c){var w,m,N,E,f,v=c.length,g=0;for(E=0;E<v;E++)m=c.charCodeAt(E),(m&64512)===55296&&E+1<v&&(N=c.charCodeAt(E+1),(N&64512)===56320&&(m=65536+(m-55296<<10)+(N-56320),E++)),g+=m<128?1:m<2048?2:m<65536?3:4;for(w=new n.Buf8(g),f=0,E=0;f<g;E++)m=c.charCodeAt(E),(m&64512)===55296&&E+1<v&&(N=c.charCodeAt(E+1),(N&64512)===56320&&(m=65536+(m-55296<<10)+(N-56320),E++)),m<128?w[f++]=m:m<2048?(w[f++]=192|m>>>6,w[f++]=128|m&63):m<65536?(w[f++]=224|m>>>12,w[f++]=128|m>>>6&63,w[f++]=128|m&63):(w[f++]=240|m>>>18,w[f++]=128|m>>>12&63,w[f++]=128|m>>>6&63,w[f++]=128|m&63);return w};function d(c,w){if(w<65537&&(c.subarray&&a||!c.subarray&&s))return String.fromCharCode.apply(null,n.shrinkBuf(c,w));for(var m="",N=0;N<w;N++)m+=String.fromCharCode(c[N]);return m}r.buf2binstring=function(c){return d(c,c.length)},r.binstring2buf=function(c){for(var w=new n.Buf8(c.length),m=0,N=w.length;m<N;m++)w[m]=c.charCodeAt(m);return w},r.buf2string=function(c,w){var m,N,E,f,v=w||c.length,g=new Array(v*2);for(N=0,m=0;m<v;){if(E=c[m++],E<128){g[N++]=E;continue}if(f=u[E],f>4){g[N++]=65533,m+=f-1;continue}for(E&=f===2?31:f===3?15:7;f>1&&m<v;)E=E<<6|c[m++]&63,f--;if(f>1){g[N++]=65533;continue}E<65536?g[N++]=E:(E-=65536,g[N++]=55296|E>>10&1023,g[N++]=56320|E&1023)}return d(g,N)},r.utf8border=function(c,w){var m;for(w=w||c.length,w>c.length&&(w=c.length),m=w-1;m>=0&&(c[m]&192)===128;)m--;return m<0||m===0?w:m+u[c[m]]>w?m:w}},{"./common":41}],43:[function(t,i,r){function n(s,a,u,h){for(var d=s&65535|0,c=s>>>16&65535|0,w=0;u!==0;){w=u>2e3?2e3:u,u-=w;do d=d+a[h++]|0,c=c+d|0;while(--w);d%=65521,c%=65521}return d|c<<16|0}i.exports=n},{}],44:[function(t,i,r){i.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}},{}],45:[function(t,i,r){function n(){for(var u,h=[],d=0;d<256;d++){u=d;for(var c=0;c<8;c++)u=u&1?3988292384^u>>>1:u>>>1;h[d]=u}return h}var s=n();function a(u,h,d,c){var w=s,m=c+d;u^=-1;for(var N=c;N<m;N++)u=u>>>8^w[(u^h[N])&255];return u^-1}i.exports=a},{}],46:[function(t,i,r){var n=t("../utils/common"),s=t("./trees"),a=t("./adler32"),u=t("./crc32"),h=t("./messages"),d=0,c=1,w=3,m=4,N=5,E=0,f=1,v=-2,g=-3,D=-5,L=-1,b=1,S=2,R=3,I=4,k=0,O=2,G=8,j=9,Z=15,Y=8,X=29,ie=256,K=ie+1+X,$=30,ae=19,pe=2*K+1,ne=15,ce=3,Ce=258,ye=Ce+ce+1,Te=32,We=42,Fe=69,be=73,Pe=91,Ue=103,xe=113,ke=666,ve=1,Ie=2,He=3,ze=4,Oe=3;function Ge(l,M){return l.msg=h[M],M}function tt(l){return(l<<1)-(l>4?9:0)}function Je(l){for(var M=l.length;--M>=0;)l[M]=0}function Ee(l){var M=l.state,H=M.pending;H>l.avail_out&&(H=l.avail_out),H!==0&&(n.arraySet(l.output,M.pending_buf,M.pending_out,H,l.next_out),l.next_out+=H,M.pending_out+=H,l.total_out+=H,l.avail_out-=H,M.pending-=H,M.pending===0&&(M.pending_out=0))}function De(l,M){s._tr_flush_block(l,l.block_start>=0?l.block_start:-1,l.strstart-l.block_start,M),l.block_start=l.strstart,Ee(l.strm)}function _e(l,M){l.pending_buf[l.pending++]=M}function nt(l,M){l.pending_buf[l.pending++]=M>>>8&255,l.pending_buf[l.pending++]=M&255}function pt(l,M,H,_){var B=l.avail_in;return B>_&&(B=_),B===0?0:(l.avail_in-=B,n.arraySet(M,l.input,l.next_in,B,H),l.state.wrap===1?l.adler=a(l.adler,M,B,H):l.state.wrap===2&&(l.adler=u(l.adler,M,B,H)),l.next_in+=B,l.total_in+=B,B)}function lt(l,M){var H=l.max_chain_length,_=l.strstart,B,V,de=l.prev_length,ue=l.nice_match,le=l.strstart>l.w_size-ye?l.strstart-(l.w_size-ye):0,Ae=l.window,Xe=l.w_mask,Me=l.prev,Se=l.strstart+Ce,Ne=Ae[_+de-1],Qe=Ae[_+de];l.prev_length>=l.good_match&&(H>>=2),ue>l.lookahead&&(ue=l.lookahead);do if(B=M,!(Ae[B+de]!==Qe||Ae[B+de-1]!==Ne||Ae[B]!==Ae[_]||Ae[++B]!==Ae[_+1])){_+=2,B++;do;while(Ae[++_]===Ae[++B]&&Ae[++_]===Ae[++B]&&Ae[++_]===Ae[++B]&&Ae[++_]===Ae[++B]&&Ae[++_]===Ae[++B]&&Ae[++_]===Ae[++B]&&Ae[++_]===Ae[++B]&&Ae[++_]===Ae[++B]&&_<Se);if(V=Ce-(Se-_),_=Se-Ce,V>de){if(l.match_start=M,de=V,V>=ue)break;Ne=Ae[_+de-1],Qe=Ae[_+de]}}while((M=Me[M&Xe])>le&&--H!==0);return de<=l.lookahead?de:l.lookahead}function it(l){var M=l.w_size,H,_,B,V,de;do{if(V=l.window_size-l.lookahead-l.strstart,l.strstart>=M+(M-ye)){n.arraySet(l.window,l.window,M,M,0),l.match_start-=M,l.strstart-=M,l.block_start-=M,_=l.hash_size,H=_;do B=l.head[--H],l.head[H]=B>=M?B-M:0;while(--_);_=M,H=_;do B=l.prev[--H],l.prev[H]=B>=M?B-M:0;while(--_);V+=M}if(l.strm.avail_in===0)break;if(_=pt(l.strm,l.window,l.strstart+l.lookahead,V),l.lookahead+=_,l.lookahead+l.insert>=ce)for(de=l.strstart-l.insert,l.ins_h=l.window[de],l.ins_h=(l.ins_h<<l.hash_shift^l.window[de+1])&l.hash_mask;l.insert&&(l.ins_h=(l.ins_h<<l.hash_shift^l.window[de+ce-1])&l.hash_mask,l.prev[de&l.w_mask]=l.head[l.ins_h],l.head[l.ins_h]=de,de++,l.insert--,!(l.lookahead+l.insert<ce)););}while(l.lookahead<ye&&l.strm.avail_in!==0)}function vt(l,M){var H=65535;for(H>l.pending_buf_size-5&&(H=l.pending_buf_size-5);;){if(l.lookahead<=1){if(it(l),l.lookahead===0&&M===d)return ve;if(l.lookahead===0)break}l.strstart+=l.lookahead,l.lookahead=0;var _=l.block_start+H;if((l.strstart===0||l.strstart>=_)&&(l.lookahead=l.strstart-_,l.strstart=_,De(l,!1),l.strm.avail_out===0)||l.strstart-l.block_start>=l.w_size-ye&&(De(l,!1),l.strm.avail_out===0))return ve}return l.insert=0,M===m?(De(l,!0),l.strm.avail_out===0?He:ze):(l.strstart>l.block_start&&(De(l,!1),l.strm.avail_out===0),ve)}function ft(l,M){for(var H,_;;){if(l.lookahead<ye){if(it(l),l.lookahead<ye&&M===d)return ve;if(l.lookahead===0)break}if(H=0,l.lookahead>=ce&&(l.ins_h=(l.ins_h<<l.hash_shift^l.window[l.strstart+ce-1])&l.hash_mask,H=l.prev[l.strstart&l.w_mask]=l.head[l.ins_h],l.head[l.ins_h]=l.strstart),H!==0&&l.strstart-H<=l.w_size-ye&&(l.match_length=lt(l,H)),l.match_length>=ce)if(_=s._tr_tally(l,l.strstart-l.match_start,l.match_length-ce),l.lookahead-=l.match_length,l.match_length<=l.max_lazy_match&&l.lookahead>=ce){l.match_length--;do l.strstart++,l.ins_h=(l.ins_h<<l.hash_shift^l.window[l.strstart+ce-1])&l.hash_mask,H=l.prev[l.strstart&l.w_mask]=l.head[l.ins_h],l.head[l.ins_h]=l.strstart;while(--l.match_length!==0);l.strstart++}else l.strstart+=l.match_length,l.match_length=0,l.ins_h=l.window[l.strstart],l.ins_h=(l.ins_h<<l.hash_shift^l.window[l.strstart+1])&l.hash_mask;else _=s._tr_tally(l,0,l.window[l.strstart]),l.lookahead--,l.strstart++;if(_&&(De(l,!1),l.strm.avail_out===0))return ve}return l.insert=l.strstart<ce-1?l.strstart:ce-1,M===m?(De(l,!0),l.strm.avail_out===0?He:ze):l.last_lit&&(De(l,!1),l.strm.avail_out===0)?ve:Ie}function at(l,M){for(var H,_,B;;){if(l.lookahead<ye){if(it(l),l.lookahead<ye&&M===d)return ve;if(l.lookahead===0)break}if(H=0,l.lookahead>=ce&&(l.ins_h=(l.ins_h<<l.hash_shift^l.window[l.strstart+ce-1])&l.hash_mask,H=l.prev[l.strstart&l.w_mask]=l.head[l.ins_h],l.head[l.ins_h]=l.strstart),l.prev_length=l.match_length,l.prev_match=l.match_start,l.match_length=ce-1,H!==0&&l.prev_length<l.max_lazy_match&&l.strstart-H<=l.w_size-ye&&(l.match_length=lt(l,H),l.match_length<=5&&(l.strategy===b||l.match_length===ce&&l.strstart-l.match_start>4096)&&(l.match_length=ce-1)),l.prev_length>=ce&&l.match_length<=l.prev_length){B=l.strstart+l.lookahead-ce,_=s._tr_tally(l,l.strstart-1-l.prev_match,l.prev_length-ce),l.lookahead-=l.prev_length-1,l.prev_length-=2;do++l.strstart<=B&&(l.ins_h=(l.ins_h<<l.hash_shift^l.window[l.strstart+ce-1])&l.hash_mask,H=l.prev[l.strstart&l.w_mask]=l.head[l.ins_h],l.head[l.ins_h]=l.strstart);while(--l.prev_length!==0);if(l.match_available=0,l.match_length=ce-1,l.strstart++,_&&(De(l,!1),l.strm.avail_out===0))return ve}else if(l.match_available){if(_=s._tr_tally(l,0,l.window[l.strstart-1]),_&&De(l,!1),l.strstart++,l.lookahead--,l.strm.avail_out===0)return ve}else l.match_available=1,l.strstart++,l.lookahead--}return l.match_available&&(_=s._tr_tally(l,0,l.window[l.strstart-1]),l.match_available=0),l.insert=l.strstart<ce-1?l.strstart:ce-1,M===m?(De(l,!0),l.strm.avail_out===0?He:ze):l.last_lit&&(De(l,!1),l.strm.avail_out===0)?ve:Ie}function ct(l,M){for(var H,_,B,V,de=l.window;;){if(l.lookahead<=Ce){if(it(l),l.lookahead<=Ce&&M===d)return ve;if(l.lookahead===0)break}if(l.match_length=0,l.lookahead>=ce&&l.strstart>0&&(B=l.strstart-1,_=de[B],_===de[++B]&&_===de[++B]&&_===de[++B])){V=l.strstart+Ce;do;while(_===de[++B]&&_===de[++B]&&_===de[++B]&&_===de[++B]&&_===de[++B]&&_===de[++B]&&_===de[++B]&&_===de[++B]&&B<V);l.match_length=Ce-(V-B),l.match_length>l.lookahead&&(l.match_length=l.lookahead)}if(l.match_length>=ce?(H=s._tr_tally(l,1,l.match_length-ce),l.lookahead-=l.match_length,l.strstart+=l.match_length,l.match_length=0):(H=s._tr_tally(l,0,l.window[l.strstart]),l.lookahead--,l.strstart++),H&&(De(l,!1),l.strm.avail_out===0))return ve}return l.insert=0,M===m?(De(l,!0),l.strm.avail_out===0?He:ze):l.last_lit&&(De(l,!1),l.strm.avail_out===0)?ve:Ie}function ht(l,M){for(var H;;){if(l.lookahead===0&&(it(l),l.lookahead===0)){if(M===d)return ve;break}if(l.match_length=0,H=s._tr_tally(l,0,l.window[l.strstart]),l.lookahead--,l.strstart++,H&&(De(l,!1),l.strm.avail_out===0))return ve}return l.insert=0,M===m?(De(l,!0),l.strm.avail_out===0?He:ze):l.last_lit&&(De(l,!1),l.strm.avail_out===0)?ve:Ie}function Ye(l,M,H,_,B){this.good_length=l,this.max_lazy=M,this.nice_length=H,this.max_chain=_,this.func=B}var ot;ot=[new Ye(0,0,0,0,vt),new Ye(4,4,8,4,ft),new Ye(4,5,16,8,ft),new Ye(4,6,32,32,ft),new Ye(4,4,16,16,at),new Ye(8,16,32,32,at),new Ye(8,16,128,128,at),new Ye(8,32,128,256,at),new Ye(32,128,258,1024,at),new Ye(32,258,258,4096,at)];function wt(l){l.window_size=2*l.w_size,Je(l.head),l.max_lazy_match=ot[l.level].max_lazy,l.good_match=ot[l.level].good_length,l.nice_match=ot[l.level].nice_length,l.max_chain_length=ot[l.level].max_chain,l.strstart=0,l.block_start=0,l.lookahead=0,l.insert=0,l.match_length=l.prev_length=ce-1,l.match_available=0,l.ins_h=0}function C(){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=G,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 n.Buf16(pe*2),this.dyn_dtree=new n.Buf16((2*$+1)*2),this.bl_tree=new n.Buf16((2*ae+1)*2),Je(this.dyn_ltree),Je(this.dyn_dtree),Je(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new n.Buf16(ne+1),this.heap=new n.Buf16(2*K+1),Je(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new n.Buf16(2*K+1),Je(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 Q(l){var M;return!l||!l.state?Ge(l,v):(l.total_in=l.total_out=0,l.data_type=O,M=l.state,M.pending=0,M.pending_out=0,M.wrap<0&&(M.wrap=-M.wrap),M.status=M.wrap?We:xe,l.adler=M.wrap===2?0:1,M.last_flush=d,s._tr_init(M),E)}function te(l){var M=Q(l);return M===E&&wt(l.state),M}function fe(l,M){return!l||!l.state||l.state.wrap!==2?v:(l.state.gzhead=M,E)}function F(l,M,H,_,B,V){if(!l)return v;var de=1;if(M===L&&(M=6),_<0?(de=0,_=-_):_>15&&(de=2,_-=16),B<1||B>j||H!==G||_<8||_>15||M<0||M>9||V<0||V>I)return Ge(l,v);_===8&&(_=9);var ue=new C;return l.state=ue,ue.strm=l,ue.wrap=de,ue.gzhead=null,ue.w_bits=_,ue.w_size=1<<ue.w_bits,ue.w_mask=ue.w_size-1,ue.hash_bits=B+7,ue.hash_size=1<<ue.hash_bits,ue.hash_mask=ue.hash_size-1,ue.hash_shift=~~((ue.hash_bits+ce-1)/ce),ue.window=new n.Buf8(ue.w_size*2),ue.head=new n.Buf16(ue.hash_size),ue.prev=new n.Buf16(ue.w_size),ue.lit_bufsize=1<<B+6,ue.pending_buf_size=ue.lit_bufsize*4,ue.pending_buf=new n.Buf8(ue.pending_buf_size),ue.d_buf=1*ue.lit_bufsize,ue.l_buf=3*ue.lit_bufsize,ue.level=M,ue.strategy=V,ue.method=H,te(l)}function p(l,M){return F(l,M,G,Z,Y,k)}function o(l,M){var H,_,B,V;if(!l||!l.state||M>N||M<0)return l?Ge(l,v):v;if(_=l.state,!l.output||!l.input&&l.avail_in!==0||_.status===ke&&M!==m)return Ge(l,l.avail_out===0?D:v);if(_.strm=l,H=_.last_flush,_.last_flush=M,_.status===We)if(_.wrap===2)l.adler=0,_e(_,31),_e(_,139),_e(_,8),_.gzhead?(_e(_,(_.gzhead.text?1:0)+(_.gzhead.hcrc?2:0)+(_.gzhead.extra?4:0)+(_.gzhead.name?8:0)+(_.gzhead.comment?16:0)),_e(_,_.gzhead.time&255),_e(_,_.gzhead.time>>8&255),_e(_,_.gzhead.time>>16&255),_e(_,_.gzhead.time>>24&255),_e(_,_.level===9?2:_.strategy>=S||_.level<2?4:0),_e(_,_.gzhead.os&255),_.gzhead.extra&&_.gzhead.extra.length&&(_e(_,_.gzhead.extra.length&255),_e(_,_.gzhead.extra.length>>8&255)),_.gzhead.hcrc&&(l.adler=u(l.adler,_.pending_buf,_.pending,0)),_.gzindex=0,_.status=Fe):(_e(_,0),_e(_,0),_e(_,0),_e(_,0),_e(_,0),_e(_,_.level===9?2:_.strategy>=S||_.level<2?4:0),_e(_,Oe),_.status=xe);else{var de=G+(_.w_bits-8<<4)<<8,ue=-1;_.strategy>=S||_.level<2?ue=0:_.level<6?ue=1:_.level===6?ue=2:ue=3,de|=ue<<6,_.strstart!==0&&(de|=Te),de+=31-de%31,_.status=xe,nt(_,de),_.strstart!==0&&(nt(_,l.adler>>>16),nt(_,l.adler&65535)),l.adler=1}if(_.status===Fe)if(_.gzhead.extra){for(B=_.pending;_.gzindex<(_.gzhead.extra.length&65535)&&!(_.pending===_.pending_buf_size&&(_.gzhead.hcrc&&_.pending>B&&(l.adler=u(l.adler,_.pending_buf,_.pending-B,B)),Ee(l),B=_.pending,_.pending===_.pending_buf_size));)_e(_,_.gzhead.extra[_.gzindex]&255),_.gzindex++;_.gzhead.hcrc&&_.pending>B&&(l.adler=u(l.adler,_.pending_buf,_.pending-B,B)),_.gzindex===_.gzhead.extra.length&&(_.gzindex=0,_.status=be)}else _.status=be;if(_.status===be)if(_.gzhead.name){B=_.pending;do{if(_.pending===_.pending_buf_size&&(_.gzhead.hcrc&&_.pending>B&&(l.adler=u(l.adler,_.pending_buf,_.pending-B,B)),Ee(l),B=_.pending,_.pending===_.pending_buf_size)){V=1;break}_.gzindex<_.gzhead.name.length?V=_.gzhead.name.charCodeAt(_.gzindex++)&255:V=0,_e(_,V)}while(V!==0);_.gzhead.hcrc&&_.pending>B&&(l.adler=u(l.adler,_.pending_buf,_.pending-B,B)),V===0&&(_.gzindex=0,_.status=Pe)}else _.status=Pe;if(_.status===Pe)if(_.gzhead.comment){B=_.pending;do{if(_.pending===_.pending_buf_size&&(_.gzhead.hcrc&&_.pending>B&&(l.adler=u(l.adler,_.pending_buf,_.pending-B,B)),Ee(l),B=_.pending,_.pending===_.pending_buf_size)){V=1;break}_.gzindex<_.gzhead.comment.length?V=_.gzhead.comment.charCodeAt(_.gzindex++)&255:V=0,_e(_,V)}while(V!==0);_.gzhead.hcrc&&_.pending>B&&(l.adler=u(l.adler,_.pending_buf,_.pending-B,B)),V===0&&(_.status=Ue)}else _.status=Ue;if(_.status===Ue&&(_.gzhead.hcrc?(_.pending+2>_.pending_buf_size&&Ee(l),_.pending+2<=_.pending_buf_size&&(_e(_,l.adler&255),_e(_,l.adler>>8&255),l.adler=0,_.status=xe)):_.status=xe),_.pending!==0){if(Ee(l),l.avail_out===0)return _.last_flush=-1,E}else if(l.avail_in===0&&tt(M)<=tt(H)&&M!==m)return Ge(l,D);if(_.status===ke&&l.avail_in!==0)return Ge(l,D);if(l.avail_in!==0||_.lookahead!==0||M!==d&&_.status!==ke){var le=_.strategy===S?ht(_,M):_.strategy===R?ct(_,M):ot[_.level].func(_,M);if((le===He||le===ze)&&(_.status=ke),le===ve||le===He)return l.avail_out===0&&(_.last_flush=-1),E;if(le===Ie&&(M===c?s._tr_align(_):M!==N&&(s._tr_stored_block(_,0,0,!1),M===w&&(Je(_.head),_.lookahead===0&&(_.strstart=0,_.block_start=0,_.insert=0))),Ee(l),l.avail_out===0))return _.last_flush=-1,E}return M!==m?E:_.wrap<=0?f:(_.wrap===2?(_e(_,l.adler&255),_e(_,l.adler>>8&255),_e(_,l.adler>>16&255),_e(_,l.adler>>24&255),_e(_,l.total_in&255),_e(_,l.total_in>>8&255),_e(_,l.total_in>>16&255),_e(_,l.total_in>>24&255)):(nt(_,l.adler>>>16),nt(_,l.adler&65535)),Ee(l),_.wrap>0&&(_.wrap=-_.wrap),_.pending!==0?E:f)}function x(l){var M;return!l||!l.state?v:(M=l.state.status,M!==We&&M!==Fe&&M!==be&&M!==Pe&&M!==Ue&&M!==xe&&M!==ke?Ge(l,v):(l.state=null,M===xe?Ge(l,g):E))}function z(l,M){var H=M.length,_,B,V,de,ue,le,Ae,Xe;if(!l||!l.state||(_=l.state,de=_.wrap,de===2||de===1&&_.status!==We||_.lookahead))return v;for(de===1&&(l.adler=a(l.adler,M,H,0)),_.wrap=0,H>=_.w_size&&(de===0&&(Je(_.head),_.strstart=0,_.block_start=0,_.insert=0),Xe=new n.Buf8(_.w_size),n.arraySet(Xe,M,H-_.w_size,_.w_size,0),M=Xe,H=_.w_size),ue=l.avail_in,le=l.next_in,Ae=l.input,l.avail_in=H,l.next_in=0,l.input=M,it(_);_.lookahead>=ce;){B=_.strstart,V=_.lookahead-(ce-1);do _.ins_h=(_.ins_h<<_.hash_shift^_.window[B+ce-1])&_.hash_mask,_.prev[B&_.w_mask]=_.head[_.ins_h],_.head[_.ins_h]=B,B++;while(--V);_.strstart=B,_.lookahead=ce-1,it(_)}return _.strstart+=_.lookahead,_.block_start=_.strstart,_.insert=_.lookahead,_.lookahead=0,_.match_length=_.prev_length=ce-1,_.match_available=0,l.next_in=le,l.input=Ae,l.avail_in=ue,_.wrap=de,E}r.deflateInit=p,r.deflateInit2=F,r.deflateReset=te,r.deflateResetKeep=Q,r.deflateSetHeader=fe,r.deflate=o,r.deflateEnd=x,r.deflateSetDictionary=z,r.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(t,i,r){function n(){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}i.exports=n},{}],48:[function(t,i,r){var n=30,s=12;i.exports=function(u,h){var d,c,w,m,N,E,f,v,g,D,L,b,S,R,I,k,O,G,j,Z,Y,X,ie,K,$;d=u.state,c=u.next_in,K=u.input,w=c+(u.avail_in-5),m=u.next_out,$=u.output,N=m-(h-u.avail_out),E=m+(u.avail_out-257),f=d.dmax,v=d.wsize,g=d.whave,D=d.wnext,L=d.window,b=d.hold,S=d.bits,R=d.lencode,I=d.distcode,k=(1<<d.lenbits)-1,O=(1<<d.distbits)-1;e:do{S<15&&(b+=K[c++]<<S,S+=8,b+=K[c++]<<S,S+=8),G=R[b&k];t:for(;;){if(j=G>>>24,b>>>=j,S-=j,j=G>>>16&255,j===0)$[m++]=G&65535;else if(j&16){Z=G&65535,j&=15,j&&(S<j&&(b+=K[c++]<<S,S+=8),Z+=b&(1<<j)-1,b>>>=j,S-=j),S<15&&(b+=K[c++]<<S,S+=8,b+=K[c++]<<S,S+=8),G=I[b&O];i:for(;;){if(j=G>>>24,b>>>=j,S-=j,j=G>>>16&255,j&16){if(Y=G&65535,j&=15,S<j&&(b+=K[c++]<<S,S+=8,S<j&&(b+=K[c++]<<S,S+=8)),Y+=b&(1<<j)-1,Y>f){u.msg="invalid distance too far back",d.mode=n;break e}if(b>>>=j,S-=j,j=m-N,Y>j){if(j=Y-j,j>g&&d.sane){u.msg="invalid distance too far back",d.mode=n;break e}if(X=0,ie=L,D===0){if(X+=v-j,j<Z){Z-=j;do $[m++]=L[X++];while(--j);X=m-Y,ie=$}}else if(D<j){if(X+=v+D-j,j-=D,j<Z){Z-=j;do $[m++]=L[X++];while(--j);if(X=0,D<Z){j=D,Z-=j;do $[m++]=L[X++];while(--j);X=m-Y,ie=$}}}else if(X+=D-j,j<Z){Z-=j;do $[m++]=L[X++];while(--j);X=m-Y,ie=$}for(;Z>2;)$[m++]=ie[X++],$[m++]=ie[X++],$[m++]=ie[X++],Z-=3;Z&&($[m++]=ie[X++],Z>1&&($[m++]=ie[X++]))}else{X=m-Y;do $[m++]=$[X++],$[m++]=$[X++],$[m++]=$[X++],Z-=3;while(Z>2);Z&&($[m++]=$[X++],Z>1&&($[m++]=$[X++]))}}else if((j&64)===0){G=I[(G&65535)+(b&(1<<j)-1)];continue i}else{u.msg="invalid distance code",d.mode=n;break e}break}}else if((j&64)===0){G=R[(G&65535)+(b&(1<<j)-1)];continue t}else if(j&32){d.mode=s;break e}else{u.msg="invalid literal/length code",d.mode=n;break e}break}}while(c<w&&m<E);Z=S>>3,c-=Z,S-=Z<<3,b&=(1<<S)-1,u.next_in=c,u.next_out=m,u.avail_in=c<w?5+(w-c):5-(c-w),u.avail_out=m<E?257+(E-m):257-(m-E),d.hold=b,d.bits=S}},{}],49:[function(t,i,r){var n=t("../utils/common"),s=t("./adler32"),a=t("./crc32"),u=t("./inffast"),h=t("./inftrees"),d=0,c=1,w=2,m=4,N=5,E=6,f=0,v=1,g=2,D=-2,L=-3,b=-4,S=-5,R=8,I=1,k=2,O=3,G=4,j=5,Z=6,Y=7,X=8,ie=9,K=10,$=11,ae=12,pe=13,ne=14,ce=15,Ce=16,ye=17,Te=18,We=19,Fe=20,be=21,Pe=22,Ue=23,xe=24,ke=25,ve=26,Ie=27,He=28,ze=29,Oe=30,Ge=31,tt=32,Je=852,Ee=592,De=15,_e=De;function nt(F){return(F>>>24&255)+(F>>>8&65280)+((F&65280)<<8)+((F&255)<<24)}function pt(){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 n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function lt(F){var p;return!F||!F.state?D:(p=F.state,F.total_in=F.total_out=p.total=0,F.msg="",p.wrap&&(F.adler=p.wrap&1),p.mode=I,p.last=0,p.havedict=0,p.dmax=32768,p.head=null,p.hold=0,p.bits=0,p.lencode=p.lendyn=new n.Buf32(Je),p.distcode=p.distdyn=new n.Buf32(Ee),p.sane=1,p.back=-1,f)}function it(F){var p;return!F||!F.state?D:(p=F.state,p.wsize=0,p.whave=0,p.wnext=0,lt(F))}function vt(F,p){var o,x;return!F||!F.state||(x=F.state,p<0?(o=0,p=-p):(o=(p>>4)+1,p<48&&(p&=15)),p&&(p<8||p>15))?D:(x.window!==null&&x.wbits!==p&&(x.window=null),x.wrap=o,x.wbits=p,it(F))}function ft(F,p){var o,x;return F?(x=new pt,F.state=x,x.window=null,o=vt(F,p),o!==f&&(F.state=null),o):D}function at(F){return ft(F,_e)}var ct=!0,ht,Ye;function ot(F){if(ct){var p;for(ht=new n.Buf32(512),Ye=new n.Buf32(32),p=0;p<144;)F.lens[p++]=8;for(;p<256;)F.lens[p++]=9;for(;p<280;)F.lens[p++]=7;for(;p<288;)F.lens[p++]=8;for(h(c,F.lens,0,288,ht,0,F.work,{bits:9}),p=0;p<32;)F.lens[p++]=5;h(w,F.lens,0,32,Ye,0,F.work,{bits:5}),ct=!1}F.lencode=ht,F.lenbits=9,F.distcode=Ye,F.distbits=5}function wt(F,p,o,x){var z,l=F.state;return l.window===null&&(l.wsize=1<<l.wbits,l.wnext=0,l.whave=0,l.window=new n.Buf8(l.wsize)),x>=l.wsize?(n.arraySet(l.window,p,o-l.wsize,l.wsize,0),l.wnext=0,l.whave=l.wsize):(z=l.wsize-l.wnext,z>x&&(z=x),n.arraySet(l.window,p,o-x,z,l.wnext),x-=z,x?(n.arraySet(l.window,p,o-x,x,0),l.wnext=x,l.whave=l.wsize):(l.wnext+=z,l.wnext===l.wsize&&(l.wnext=0),l.whave<l.wsize&&(l.whave+=z))),0}function C(F,p){var o,x,z,l,M,H,_,B,V,de,ue,le,Ae,Xe,Me=0,Se,Ne,Qe,Ze,Tt,Pt,$e,dt,st=new n.Buf8(4),_t,gt,ii=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!F||!F.state||!F.output||!F.input&&F.avail_in!==0)return D;o=F.state,o.mode===ae&&(o.mode=pe),M=F.next_out,z=F.output,_=F.avail_out,l=F.next_in,x=F.input,H=F.avail_in,B=o.hold,V=o.bits,de=H,ue=_,dt=f;e:for(;;)switch(o.mode){case I:if(o.wrap===0){o.mode=pe;break}for(;V<16;){if(H===0)break e;H--,B+=x[l++]<<V,V+=8}if(o.wrap&2&&B===35615){o.check=0,st[0]=B&255,st[1]=B>>>8&255,o.check=a(o.check,st,2,0),B=0,V=0,o.mode=k;break}if(o.flags=0,o.head&&(o.head.done=!1),!(o.wrap&1)||(((B&255)<<8)+(B>>8))%31){F.msg="incorrect header check",o.mode=Oe;break}if((B&15)!==R){F.msg="unknown compression method",o.mode=Oe;break}if(B>>>=4,V-=4,$e=(B&15)+8,o.wbits===0)o.wbits=$e;else if($e>o.wbits){F.msg="invalid window size",o.mode=Oe;break}o.dmax=1<<$e,F.adler=o.check=1,o.mode=B&512?K:ae,B=0,V=0;break;case k:for(;V<16;){if(H===0)break e;H--,B+=x[l++]<<V,V+=8}if(o.flags=B,(o.flags&255)!==R){F.msg="unknown compression method",o.mode=Oe;break}if(o.flags&57344){F.msg="unknown header flags set",o.mode=Oe;break}o.head&&(o.head.text=B>>8&1),o.flags&512&&(st[0]=B&255,st[1]=B>>>8&255,o.check=a(o.check,st,2,0)),B=0,V=0,o.mode=O;case O:for(;V<32;){if(H===0)break e;H--,B+=x[l++]<<V,V+=8}o.head&&(o.head.time=B),o.flags&512&&(st[0]=B&255,st[1]=B>>>8&255,st[2]=B>>>16&255,st[3]=B>>>24&255,o.check=a(o.check,st,4,0)),B=0,V=0,o.mode=G;case G:for(;V<16;){if(H===0)break e;H--,B+=x[l++]<<V,V+=8}o.head&&(o.head.xflags=B&255,o.head.os=B>>8),o.flags&512&&(st[0]=B&255,st[1]=B>>>8&255,o.check=a(o.check,st,2,0)),B=0,V=0,o.mode=j;case j:if(o.flags&1024){for(;V<16;){if(H===0)break e;H--,B+=x[l++]<<V,V+=8}o.length=B,o.head&&(o.head.extra_len=B),o.flags&512&&(st[0]=B&255,st[1]=B>>>8&255,o.check=a(o.check,st,2,0)),B=0,V=0}else o.head&&(o.head.extra=null);o.mode=Z;case Z:if(o.flags&1024&&(le=o.length,le>H&&(le=H),le&&(o.head&&($e=o.head.extra_len-o.length,o.head.extra||(o.head.extra=new Array(o.head.extra_len)),n.arraySet(o.head.extra,x,l,le,$e)),o.flags&512&&(o.check=a(o.check,x,le,l)),H-=le,l+=le,o.length-=le),o.length))break e;o.length=0,o.mode=Y;case Y:if(o.flags&2048){if(H===0)break e;le=0;do $e=x[l+le++],o.head&&$e&&o.length<65536&&(o.head.name+=String.fromCharCode($e));while($e&&le<H);if(o.flags&512&&(o.check=a(o.check,x,le,l)),H-=le,l+=le,$e)break e}else o.head&&(o.head.name=null);o.length=0,o.mode=X;case X:if(o.flags&4096){if(H===0)break e;le=0;do $e=x[l+le++],o.head&&$e&&o.length<65536&&(o.head.comment+=String.fromCharCode($e));while($e&&le<H);if(o.flags&512&&(o.check=a(o.check,x,le,l)),H-=le,l+=le,$e)break e}else o.head&&(o.head.comment=null);o.mode=ie;case ie:if(o.flags&512){for(;V<16;){if(H===0)break e;H--,B+=x[l++]<<V,V+=8}if(B!==(o.check&65535)){F.msg="header crc mismatch",o.mode=Oe;break}B=0,V=0}o.head&&(o.head.hcrc=o.flags>>9&1,o.head.done=!0),F.adler=o.check=0,o.mode=ae;break;case K:for(;V<32;){if(H===0)break e;H--,B+=x[l++]<<V,V+=8}F.adler=o.check=nt(B),B=0,V=0,o.mode=$;case $:if(o.havedict===0)return F.next_out=M,F.avail_out=_,F.next_in=l,F.avail_in=H,o.hold=B,o.bits=V,g;F.adler=o.check=1,o.mode=ae;case ae:if(p===N||p===E)break e;case pe:if(o.last){B>>>=V&7,V-=V&7,o.mode=Ie;break}for(;V<3;){if(H===0)break e;H--,B+=x[l++]<<V,V+=8}switch(o.last=B&1,B>>>=1,V-=1,B&3){case 0:o.mode=ne;break;case 1:if(ot(o),o.mode=Fe,p===E){B>>>=2,V-=2;break e}break;case 2:o.mode=ye;break;case 3:F.msg="invalid block type",o.mode=Oe}B>>>=2,V-=2;break;case ne:for(B>>>=V&7,V-=V&7;V<32;){if(H===0)break e;H--,B+=x[l++]<<V,V+=8}if((B&65535)!==(B>>>16^65535)){F.msg="invalid stored block lengths",o.mode=Oe;break}if(o.length=B&65535,B=0,V=0,o.mode=ce,p===E)break e;case ce:o.mode=Ce;case Ce:if(le=o.length,le){if(le>H&&(le=H),le>_&&(le=_),le===0)break e;n.arraySet(z,x,l,le,M),H-=le,l+=le,_-=le,M+=le,o.length-=le;break}o.mode=ae;break;case ye:for(;V<14;){if(H===0)break e;H--,B+=x[l++]<<V,V+=8}if(o.nlen=(B&31)+257,B>>>=5,V-=5,o.ndist=(B&31)+1,B>>>=5,V-=5,o.ncode=(B&15)+4,B>>>=4,V-=4,o.nlen>286||o.ndist>30){F.msg="too many length or distance symbols",o.mode=Oe;break}o.have=0,o.mode=Te;case Te:for(;o.have<o.ncode;){for(;V<3;){if(H===0)break e;H--,B+=x[l++]<<V,V+=8}o.lens[ii[o.have++]]=B&7,B>>>=3,V-=3}for(;o.have<19;)o.lens[ii[o.have++]]=0;if(o.lencode=o.lendyn,o.lenbits=7,_t={bits:o.lenbits},dt=h(d,o.lens,0,19,o.lencode,0,o.work,_t),o.lenbits=_t.bits,dt){F.msg="invalid code lengths set",o.mode=Oe;break}o.have=0,o.mode=We;case We:for(;o.have<o.nlen+o.ndist;){for(;Me=o.lencode[B&(1<<o.lenbits)-1],Se=Me>>>24,Ne=Me>>>16&255,Qe=Me&65535,!(Se<=V);){if(H===0)break e;H--,B+=x[l++]<<V,V+=8}if(Qe<16)B>>>=Se,V-=Se,o.lens[o.have++]=Qe;else{if(Qe===16){for(gt=Se+2;V<gt;){if(H===0)break e;H--,B+=x[l++]<<V,V+=8}if(B>>>=Se,V-=Se,o.have===0){F.msg="invalid bit length repeat",o.mode=Oe;break}$e=o.lens[o.have-1],le=3+(B&3),B>>>=2,V-=2}else if(Qe===17){for(gt=Se+3;V<gt;){if(H===0)break e;H--,B+=x[l++]<<V,V+=8}B>>>=Se,V-=Se,$e=0,le=3+(B&7),B>>>=3,V-=3}else{for(gt=Se+7;V<gt;){if(H===0)break e;H--,B+=x[l++]<<V,V+=8}B>>>=Se,V-=Se,$e=0,le=11+(B&127),B>>>=7,V-=7}if(o.have+le>o.nlen+o.ndist){F.msg="invalid bit length repeat",o.mode=Oe;break}for(;le--;)o.lens[o.have++]=$e}}if(o.mode===Oe)break;if(o.lens[256]===0){F.msg="invalid code -- missing end-of-block",o.mode=Oe;break}if(o.lenbits=9,_t={bits:o.lenbits},dt=h(c,o.lens,0,o.nlen,o.lencode,0,o.work,_t),o.lenbits=_t.bits,dt){F.msg="invalid literal/lengths set",o.mode=Oe;break}if(o.distbits=6,o.distcode=o.distdyn,_t={bits:o.distbits},dt=h(w,o.lens,o.nlen,o.ndist,o.distcode,0,o.work,_t),o.distbits=_t.bits,dt){F.msg="invalid distances set",o.mode=Oe;break}if(o.mode=Fe,p===E)break e;case Fe:o.mode=be;case be:if(H>=6&&_>=258){F.next_out=M,F.avail_out=_,F.next_in=l,F.avail_in=H,o.hold=B,o.bits=V,u(F,ue),M=F.next_out,z=F.output,_=F.avail_out,l=F.next_in,x=F.input,H=F.avail_in,B=o.hold,V=o.bits,o.mode===ae&&(o.back=-1);break}for(o.back=0;Me=o.lencode[B&(1<<o.lenbits)-1],Se=Me>>>24,Ne=Me>>>16&255,Qe=Me&65535,!(Se<=V);){if(H===0)break e;H--,B+=x[l++]<<V,V+=8}if(Ne&&(Ne&240)===0){for(Ze=Se,Tt=Ne,Pt=Qe;Me=o.lencode[Pt+((B&(1<<Ze+Tt)-1)>>Ze)],Se=Me>>>24,Ne=Me>>>16&255,Qe=Me&65535,!(Ze+Se<=V);){if(H===0)break e;H--,B+=x[l++]<<V,V+=8}B>>>=Ze,V-=Ze,o.back+=Ze}if(B>>>=Se,V-=Se,o.back+=Se,o.length=Qe,Ne===0){o.mode=ve;break}if(Ne&32){o.back=-1,o.mode=ae;break}if(Ne&64){F.msg="invalid literal/length code",o.mode=Oe;break}o.extra=Ne&15,o.mode=Pe;case Pe:if(o.extra){for(gt=o.extra;V<gt;){if(H===0)break e;H--,B+=x[l++]<<V,V+=8}o.length+=B&(1<<o.extra)-1,B>>>=o.extra,V-=o.extra,o.back+=o.extra}o.was=o.length,o.mode=Ue;case Ue:for(;Me=o.distcode[B&(1<<o.distbits)-1],Se=Me>>>24,Ne=Me>>>16&255,Qe=Me&65535,!(Se<=V);){if(H===0)break e;H--,B+=x[l++]<<V,V+=8}if((Ne&240)===0){for(Ze=Se,Tt=Ne,Pt=Qe;Me=o.distcode[Pt+((B&(1<<Ze+Tt)-1)>>Ze)],Se=Me>>>24,Ne=Me>>>16&255,Qe=Me&65535,!(Ze+Se<=V);){if(H===0)break e;H--,B+=x[l++]<<V,V+=8}B>>>=Ze,V-=Ze,o.back+=Ze}if(B>>>=Se,V-=Se,o.back+=Se,Ne&64){F.msg="invalid distance code",o.mode=Oe;break}o.offset=Qe,o.extra=Ne&15,o.mode=xe;case xe:if(o.extra){for(gt=o.extra;V<gt;){if(H===0)break e;H--,B+=x[l++]<<V,V+=8}o.offset+=B&(1<<o.extra)-1,B>>>=o.extra,V-=o.extra,o.back+=o.extra}if(o.offset>o.dmax){F.msg="invalid distance too far back",o.mode=Oe;break}o.mode=ke;case ke:if(_===0)break e;if(le=ue-_,o.offset>le){if(le=o.offset-le,le>o.whave&&o.sane){F.msg="invalid distance too far back",o.mode=Oe;break}le>o.wnext?(le-=o.wnext,Ae=o.wsize-le):Ae=o.wnext-le,le>o.length&&(le=o.length),Xe=o.window}else Xe=z,Ae=M-o.offset,le=o.length;le>_&&(le=_),_-=le,o.length-=le;do z[M++]=Xe[Ae++];while(--le);o.length===0&&(o.mode=be);break;case ve:if(_===0)break e;z[M++]=o.length,_--,o.mode=be;break;case Ie:if(o.wrap){for(;V<32;){if(H===0)break e;H--,B|=x[l++]<<V,V+=8}if(ue-=_,F.total_out+=ue,o.total+=ue,ue&&(F.adler=o.check=o.flags?a(o.check,z,ue,M-ue):s(o.check,z,ue,M-ue)),ue=_,(o.flags?B:nt(B))!==o.check){F.msg="incorrect data check",o.mode=Oe;break}B=0,V=0}o.mode=He;case He:if(o.wrap&&o.flags){for(;V<32;){if(H===0)break e;H--,B+=x[l++]<<V,V+=8}if(B!==(o.total&4294967295)){F.msg="incorrect length check",o.mode=Oe;break}B=0,V=0}o.mode=ze;case ze:dt=v;break e;case Oe:dt=L;break e;case Ge:return b;case tt:default:return D}return F.next_out=M,F.avail_out=_,F.next_in=l,F.avail_in=H,o.hold=B,o.bits=V,(o.wsize||ue!==F.avail_out&&o.mode<Oe&&(o.mode<Ie||p!==m))&&wt(F,F.output,F.next_out,ue-F.avail_out),de-=F.avail_in,ue-=F.avail_out,F.total_in+=de,F.total_out+=ue,o.total+=ue,o.wrap&&ue&&(F.adler=o.check=o.flags?a(o.check,z,ue,F.next_out-ue):s(o.check,z,ue,F.next_out-ue)),F.data_type=o.bits+(o.last?64:0)+(o.mode===ae?128:0)+(o.mode===Fe||o.mode===ce?256:0),(de===0&&ue===0||p===m)&&dt===f&&(dt=S),dt}function Q(F){if(!F||!F.state)return D;var p=F.state;return p.window&&(p.window=null),F.state=null,f}function te(F,p){var o;return!F||!F.state||(o=F.state,(o.wrap&2)===0)?D:(o.head=p,p.done=!1,f)}function fe(F,p){var o=p.length,x,z,l;return!F||!F.state||(x=F.state,x.wrap!==0&&x.mode!==$)?D:x.mode===$&&(z=1,z=s(z,p,o,0),z!==x.check)?L:(l=wt(F,p,o,o),l?(x.mode=Ge,b):(x.havedict=1,f))}r.inflateReset=it,r.inflateReset2=vt,r.inflateResetKeep=lt,r.inflateInit=at,r.inflateInit2=ft,r.inflate=C,r.inflateEnd=Q,r.inflateGetHeader=te,r.inflateSetDictionary=fe,r.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(t,i,r){var n=t("../utils/common"),s=15,a=852,u=592,h=0,d=1,c=2,w=[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],m=[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],N=[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],E=[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];i.exports=function(v,g,D,L,b,S,R,I){var k=I.bits,O=0,G=0,j=0,Z=0,Y=0,X=0,ie=0,K=0,$=0,ae=0,pe,ne,ce,Ce,ye,Te=null,We=0,Fe,be=new n.Buf16(s+1),Pe=new n.Buf16(s+1),Ue=null,xe=0,ke,ve,Ie;for(O=0;O<=s;O++)be[O]=0;for(G=0;G<L;G++)be[g[D+G]]++;for(Y=k,Z=s;Z>=1&&be[Z]===0;Z--);if(Y>Z&&(Y=Z),Z===0)return b[S++]=1<<24|64<<16|0,b[S++]=1<<24|64<<16|0,I.bits=1,0;for(j=1;j<Z&&be[j]===0;j++);for(Y<j&&(Y=j),K=1,O=1;O<=s;O++)if(K<<=1,K-=be[O],K<0)return-1;if(K>0&&(v===h||Z!==1))return-1;for(Pe[1]=0,O=1;O<s;O++)Pe[O+1]=Pe[O]+be[O];for(G=0;G<L;G++)g[D+G]!==0&&(R[Pe[g[D+G]]++]=G);if(v===h?(Te=Ue=R,Fe=19):v===d?(Te=w,We-=257,Ue=m,xe-=257,Fe=256):(Te=N,Ue=E,Fe=-1),ae=0,G=0,O=j,ye=S,X=Y,ie=0,ce=-1,$=1<<Y,Ce=$-1,v===d&&$>a||v===c&&$>u)return 1;for(;;){ke=O-ie,R[G]<Fe?(ve=0,Ie=R[G]):R[G]>Fe?(ve=Ue[xe+R[G]],Ie=Te[We+R[G]]):(ve=96,Ie=0),pe=1<<O-ie,ne=1<<X,j=ne;do ne-=pe,b[ye+(ae>>ie)+ne]=ke<<24|ve<<16|Ie|0;while(ne!==0);for(pe=1<<O-1;ae&pe;)pe>>=1;if(pe!==0?(ae&=pe-1,ae+=pe):ae=0,G++,--be[O]===0){if(O===Z)break;O=g[D+R[G]]}if(O>Y&&(ae&Ce)!==ce){for(ie===0&&(ie=Y),ye+=j,X=O-ie,K=1<<X;X+ie<Z&&(K-=be[X+ie],!(K<=0));)X++,K<<=1;if($+=1<<X,v===d&&$>a||v===c&&$>u)return 1;ce=ae&Ce,b[ce]=Y<<24|X<<16|ye-S|0}}return ae!==0&&(b[ye+ae]=O-ie<<24|64<<16|0),I.bits=Y,0}},{"../utils/common":41}],51:[function(t,i,r){i.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"}},{}],52:[function(t,i,r){var n=t("../utils/common"),s=4,a=0,u=1,h=2;function d(C){for(var Q=C.length;--Q>=0;)C[Q]=0}var c=0,w=1,m=2,N=3,E=258,f=29,v=256,g=v+1+f,D=30,L=19,b=2*g+1,S=15,R=16,I=7,k=256,O=16,G=17,j=18,Z=[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],Y=[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],X=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],ie=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],K=512,$=new Array((g+2)*2);d($);var ae=new Array(D*2);d(ae);var pe=new Array(K);d(pe);var ne=new Array(E-N+1);d(ne);var ce=new Array(f);d(ce);var Ce=new Array(D);d(Ce);function ye(C,Q,te,fe,F){this.static_tree=C,this.extra_bits=Q,this.extra_base=te,this.elems=fe,this.max_length=F,this.has_stree=C&&C.length}var Te,We,Fe;function be(C,Q){this.dyn_tree=C,this.max_code=0,this.stat_desc=Q}function Pe(C){return C<256?pe[C]:pe[256+(C>>>7)]}function Ue(C,Q){C.pending_buf[C.pending++]=Q&255,C.pending_buf[C.pending++]=Q>>>8&255}function xe(C,Q,te){C.bi_valid>R-te?(C.bi_buf|=Q<<C.bi_valid&65535,Ue(C,C.bi_buf),C.bi_buf=Q>>R-C.bi_valid,C.bi_valid+=te-R):(C.bi_buf|=Q<<C.bi_valid&65535,C.bi_valid+=te)}function ke(C,Q,te){xe(C,te[Q*2],te[Q*2+1])}function ve(C,Q){var te=0;do te|=C&1,C>>>=1,te<<=1;while(--Q>0);return te>>>1}function Ie(C){C.bi_valid===16?(Ue(C,C.bi_buf),C.bi_buf=0,C.bi_valid=0):C.bi_valid>=8&&(C.pending_buf[C.pending++]=C.bi_buf&255,C.bi_buf>>=8,C.bi_valid-=8)}function He(C,Q){var te=Q.dyn_tree,fe=Q.max_code,F=Q.stat_desc.static_tree,p=Q.stat_desc.has_stree,o=Q.stat_desc.extra_bits,x=Q.stat_desc.extra_base,z=Q.stat_desc.max_length,l,M,H,_,B,V,de=0;for(_=0;_<=S;_++)C.bl_count[_]=0;for(te[C.heap[C.heap_max]*2+1]=0,l=C.heap_max+1;l<b;l++)M=C.heap[l],_=te[te[M*2+1]*2+1]+1,_>z&&(_=z,de++),te[M*2+1]=_,!(M>fe)&&(C.bl_count[_]++,B=0,M>=x&&(B=o[M-x]),V=te[M*2],C.opt_len+=V*(_+B),p&&(C.static_len+=V*(F[M*2+1]+B)));if(de!==0){do{for(_=z-1;C.bl_count[_]===0;)_--;C.bl_count[_]--,C.bl_count[_+1]+=2,C.bl_count[z]--,de-=2}while(de>0);for(_=z;_!==0;_--)for(M=C.bl_count[_];M!==0;)H=C.heap[--l],!(H>fe)&&(te[H*2+1]!==_&&(C.opt_len+=(_-te[H*2+1])*te[H*2],te[H*2+1]=_),M--)}}function ze(C,Q,te){var fe=new Array(S+1),F=0,p,o;for(p=1;p<=S;p++)fe[p]=F=F+te[p-1]<<1;for(o=0;o<=Q;o++){var x=C[o*2+1];x!==0&&(C[o*2]=ve(fe[x]++,x))}}function Oe(){var C,Q,te,fe,F,p=new Array(S+1);for(te=0,fe=0;fe<f-1;fe++)for(ce[fe]=te,C=0;C<1<<Z[fe];C++)ne[te++]=fe;for(ne[te-1]=fe,F=0,fe=0;fe<16;fe++)for(Ce[fe]=F,C=0;C<1<<Y[fe];C++)pe[F++]=fe;for(F>>=7;fe<D;fe++)for(Ce[fe]=F<<7,C=0;C<1<<Y[fe]-7;C++)pe[256+F++]=fe;for(Q=0;Q<=S;Q++)p[Q]=0;for(C=0;C<=143;)$[C*2+1]=8,C++,p[8]++;for(;C<=255;)$[C*2+1]=9,C++,p[9]++;for(;C<=279;)$[C*2+1]=7,C++,p[7]++;for(;C<=287;)$[C*2+1]=8,C++,p[8]++;for(ze($,g+1,p),C=0;C<D;C++)ae[C*2+1]=5,ae[C*2]=ve(C,5);Te=new ye($,Z,v+1,g,S),We=new ye(ae,Y,0,D,S),Fe=new ye(new Array(0),X,0,L,I)}function Ge(C){var Q;for(Q=0;Q<g;Q++)C.dyn_ltree[Q*2]=0;for(Q=0;Q<D;Q++)C.dyn_dtree[Q*2]=0;for(Q=0;Q<L;Q++)C.bl_tree[Q*2]=0;C.dyn_ltree[k*2]=1,C.opt_len=C.static_len=0,C.last_lit=C.matches=0}function tt(C){C.bi_valid>8?Ue(C,C.bi_buf):C.bi_valid>0&&(C.pending_buf[C.pending++]=C.bi_buf),C.bi_buf=0,C.bi_valid=0}function Je(C,Q,te,fe){tt(C),Ue(C,te),Ue(C,~te),n.arraySet(C.pending_buf,C.window,Q,te,C.pending),C.pending+=te}function Ee(C,Q,te,fe){var F=Q*2,p=te*2;return C[F]<C[p]||C[F]===C[p]&&fe[Q]<=fe[te]}function De(C,Q,te){for(var fe=C.heap[te],F=te<<1;F<=C.heap_len&&(F<C.heap_len&&Ee(Q,C.heap[F+1],C.heap[F],C.depth)&&F++,!Ee(Q,fe,C.heap[F],C.depth));)C.heap[te]=C.heap[F],te=F,F<<=1;C.heap[te]=fe}function _e(C,Q,te){var fe,F,p=0,o,x;if(C.last_lit!==0)do fe=C.pending_buf[C.d_buf+p*2]<<8|C.pending_buf[C.d_buf+p*2+1],F=C.pending_buf[C.l_buf+p],p++,fe===0?ke(C,F,Q):(o=ne[F],ke(C,o+v+1,Q),x=Z[o],x!==0&&(F-=ce[o],xe(C,F,x)),fe--,o=Pe(fe),ke(C,o,te),x=Y[o],x!==0&&(fe-=Ce[o],xe(C,fe,x)));while(p<C.last_lit);ke(C,k,Q)}function nt(C,Q){var te=Q.dyn_tree,fe=Q.stat_desc.static_tree,F=Q.stat_desc.has_stree,p=Q.stat_desc.elems,o,x,z=-1,l;for(C.heap_len=0,C.heap_max=b,o=0;o<p;o++)te[o*2]!==0?(C.heap[++C.heap_len]=z=o,C.depth[o]=0):te[o*2+1]=0;for(;C.heap_len<2;)l=C.heap[++C.heap_len]=z<2?++z:0,te[l*2]=1,C.depth[l]=0,C.opt_len--,F&&(C.static_len-=fe[l*2+1]);for(Q.max_code=z,o=C.heap_len>>1;o>=1;o--)De(C,te,o);l=p;do o=C.heap[1],C.heap[1]=C.heap[C.heap_len--],De(C,te,1),x=C.heap[1],C.heap[--C.heap_max]=o,C.heap[--C.heap_max]=x,te[l*2]=te[o*2]+te[x*2],C.depth[l]=(C.depth[o]>=C.depth[x]?C.depth[o]:C.depth[x])+1,te[o*2+1]=te[x*2+1]=l,C.heap[1]=l++,De(C,te,1);while(C.heap_len>=2);C.heap[--C.heap_max]=C.heap[1],He(C,Q),ze(te,z,C.bl_count)}function pt(C,Q,te){var fe,F=-1,p,o=Q[1],x=0,z=7,l=4;for(o===0&&(z=138,l=3),Q[(te+1)*2+1]=65535,fe=0;fe<=te;fe++)p=o,o=Q[(fe+1)*2+1],!(++x<z&&p===o)&&(x<l?C.bl_tree[p*2]+=x:p!==0?(p!==F&&C.bl_tree[p*2]++,C.bl_tree[O*2]++):x<=10?C.bl_tree[G*2]++:C.bl_tree[j*2]++,x=0,F=p,o===0?(z=138,l=3):p===o?(z=6,l=3):(z=7,l=4))}function lt(C,Q,te){var fe,F=-1,p,o=Q[1],x=0,z=7,l=4;for(o===0&&(z=138,l=3),fe=0;fe<=te;fe++)if(p=o,o=Q[(fe+1)*2+1],!(++x<z&&p===o)){if(x<l)do ke(C,p,C.bl_tree);while(--x!==0);else p!==0?(p!==F&&(ke(C,p,C.bl_tree),x--),ke(C,O,C.bl_tree),xe(C,x-3,2)):x<=10?(ke(C,G,C.bl_tree),xe(C,x-3,3)):(ke(C,j,C.bl_tree),xe(C,x-11,7));x=0,F=p,o===0?(z=138,l=3):p===o?(z=6,l=3):(z=7,l=4)}}function it(C){var Q;for(pt(C,C.dyn_ltree,C.l_desc.max_code),pt(C,C.dyn_dtree,C.d_desc.max_code),nt(C,C.bl_desc),Q=L-1;Q>=3&&C.bl_tree[ie[Q]*2+1]===0;Q--);return C.opt_len+=3*(Q+1)+5+5+4,Q}function vt(C,Q,te,fe){var F;for(xe(C,Q-257,5),xe(C,te-1,5),xe(C,fe-4,4),F=0;F<fe;F++)xe(C,C.bl_tree[ie[F]*2+1],3);lt(C,C.dyn_ltree,Q-1),lt(C,C.dyn_dtree,te-1)}function ft(C){var Q=4093624447,te;for(te=0;te<=31;te++,Q>>>=1)if(Q&1&&C.dyn_ltree[te*2]!==0)return a;if(C.dyn_ltree[18]!==0||C.dyn_ltree[20]!==0||C.dyn_ltree[26]!==0)return u;for(te=32;te<v;te++)if(C.dyn_ltree[te*2]!==0)return u;return a}var at=!1;function ct(C){at||(Oe(),at=!0),C.l_desc=new be(C.dyn_ltree,Te),C.d_desc=new be(C.dyn_dtree,We),C.bl_desc=new be(C.bl_tree,Fe),C.bi_buf=0,C.bi_valid=0,Ge(C)}function ht(C,Q,te,fe){xe(C,(c<<1)+(fe?1:0),3),Je(C,Q,te)}function Ye(C){xe(C,w<<1,3),ke(C,k,$),Ie(C)}function ot(C,Q,te,fe){var F,p,o=0;C.level>0?(C.strm.data_type===h&&(C.strm.data_type=ft(C)),nt(C,C.l_desc),nt(C,C.d_desc),o=it(C),F=C.opt_len+3+7>>>3,p=C.static_len+3+7>>>3,p<=F&&(F=p)):F=p=te+5,te+4<=F&&Q!==-1?ht(C,Q,te,fe):C.strategy===s||p===F?(xe(C,(w<<1)+(fe?1:0),3),_e(C,$,ae)):(xe(C,(m<<1)+(fe?1:0),3),vt(C,C.l_desc.max_code+1,C.d_desc.max_code+1,o+1),_e(C,C.dyn_ltree,C.dyn_dtree)),Ge(C),fe&&tt(C)}function wt(C,Q,te){return C.pending_buf[C.d_buf+C.last_lit*2]=Q>>>8&255,C.pending_buf[C.d_buf+C.last_lit*2+1]=Q&255,C.pending_buf[C.l_buf+C.last_lit]=te&255,C.last_lit++,Q===0?C.dyn_ltree[te*2]++:(C.matches++,Q--,C.dyn_ltree[(ne[te]+v+1)*2]++,C.dyn_dtree[Pe(Q)*2]++),C.last_lit===C.lit_bufsize-1}r._tr_init=ct,r._tr_stored_block=ht,r._tr_flush_block=ot,r._tr_tally=wt,r._tr_align=Ye},{"../utils/common":41}],53:[function(t,i,r){function n(){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}i.exports=n},{}],54:[function(t,i,r){(function(n){(function(s,a){if(s.setImmediate)return;var u=1,h={},d=!1,c=s.document,w;function m(I){typeof I!="function"&&(I=new Function(""+I));for(var k=new Array(arguments.length-1),O=0;O<k.length;O++)k[O]=arguments[O+1];var G={callback:I,args:k};return h[u]=G,w(u),u++}function N(I){delete h[I]}function E(I){var k=I.callback,O=I.args;switch(O.length){case 0:k();break;case 1:k(O[0]);break;case 2:k(O[0],O[1]);break;case 3:k(O[0],O[1],O[2]);break;default:k.apply(a,O);break}}function f(I){if(d)setTimeout(f,0,I);else{var k=h[I];if(k){d=!0;try{E(k)}finally{N(I),d=!1}}}}function v(){w=function(I){process.nextTick(function(){f(I)})}}function g(){if(s.postMessage&&!s.importScripts){var I=!0,k=s.onmessage;return s.onmessage=function(){I=!1},s.postMessage("","*"),s.onmessage=k,I}}function D(){var I="setImmediate$"+Math.random()+"$",k=function(O){O.source===s&&typeof O.data=="string"&&O.data.indexOf(I)===0&&f(+O.data.slice(I.length))};s.addEventListener?s.addEventListener("message",k,!1):s.attachEvent("onmessage",k),w=function(O){s.postMessage(I+O,"*")}}function L(){var I=new MessageChannel;I.port1.onmessage=function(k){var O=k.data;f(O)},w=function(k){I.port2.postMessage(k)}}function b(){var I=c.documentElement;w=function(k){var O=c.createElement("script");O.onreadystatechange=function(){f(k),O.onreadystatechange=null,I.removeChild(O),O=null},I.appendChild(O)}}function S(){w=function(I){setTimeout(f,0,I)}}var R=Object.getPrototypeOf&&Object.getPrototypeOf(s);R=R&&R.setTimeout?R:s,{}.toString.call(s.process)==="[object process]"?v():g()?D():s.MessageChannel?L():c&&"onreadystatechange"in c.createElement("script")?b():S(),R.setImmediate=m,R.clearImmediate=N})(typeof self>"u"?typeof n>"u"?this:n:self)}).call(this,typeof bt<"u"?bt:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(fr)),fr.exports}var Xa=Ya();const $a=Yt(Xa);class Ka{constructor(){this.zip=void 0,this.urlCache={},this.checkRequirements()}checkRequirements(){try{this.zip=new $a}catch{throw new Error("JSZip lib not loaded")}}open(e,t){return this.zip.loadAsync(e,{base64:t})}openUrl(e,t){return ti(e,"binary").then((function(i){return this.zip.loadAsync(i,{base64:t})}).bind(this))}request(e,t){var i=new Le,r,n=new It(e);return t||(t=n.extension),t=="blob"?r=this.getBlob(e):r=this.getText(e),r?r.then((function(s){let a=this.handleResponse(s,t);i.resolve(a)}).bind(this)):i.reject({message:"File not found in the epub: "+e,stack:new Error().stack}),i.promise}handleResponse(e,t){var i;return t=="json"?i=JSON.parse(e):ei(t)?i=Ct(e,"text/xml"):t=="xhtml"?i=Ct(e,"application/xhtml+xml"):t=="html"||t=="htm"?i=Ct(e,"text/html"):i=e,i}getBlob(e,t){var i=window.decodeURIComponent(e.substr(1)),r=this.zip.file(i);if(r)return t=t||Gt.lookup(r.name),r.async("uint8array").then(function(n){return new Blob([n],{type:t})})}getText(e,t){var i=window.decodeURIComponent(e.substr(1)),r=this.zip.file(i);if(r)return r.async("string").then(function(n){return n})}getBase64(e,t){var i=window.decodeURIComponent(e.substr(1)),r=this.zip.file(i);if(r)return t=t||Gt.lookup(r.name),r.async("base64").then(function(n){return"data:"+t+";base64,"+n})}createUrl(e,t){var i=new Le,r=window.URL||window.webkitURL||window.mozURL,n,s,a=t&&t.base64;return e in this.urlCache?(i.resolve(this.urlCache[e]),i.promise):(a?(s=this.getBase64(e),s&&s.then((function(u){this.urlCache[e]=u,i.resolve(u)}).bind(this))):(s=this.getBlob(e),s&&s.then((function(u){n=r.createObjectURL(u),this.urlCache[e]=n,i.resolve(n)}).bind(this))),s||i.reject({message:"File not found in the epub: "+e,stack:new Error().stack}),i.promise)}revokeUrl(e){var t=window.URL||window.webkitURL||window.mozURL,i=this.urlCache[e];i&&t.revokeObjectURL(i)}destroy(){var e=window.URL||window.webkitURL||window.mozURL;for(let t in this.urlCache)e.revokeObjectURL(t);this.zip=void 0,this.urlCache={}}}var cr={exports:{}};/*!
localForage -- Offline Storage, Improved
Version 1.10.0
https://localforage.github.io/localForage
(c) 2013-2017 Mozilla, Apache License 2.0
*/var Rn;function Ja(){return Rn||(Rn=1,(function(y,e){(function(t){y.exports=t()})(function(){return(function t(i,r,n){function s(h,d){if(!r[h]){if(!i[h]){var c=typeof Lt=="function"&&Lt;if(!d&&c)return c(h,!0);if(a)return a(h,!0);var w=new Error("Cannot find module '"+h+"'");throw w.code="MODULE_NOT_FOUND",w}var m=r[h]={exports:{}};i[h][0].call(m.exports,function(N){var E=i[h][1][N];return s(E||N)},m,m.exports,t,i,r,n)}return r[h].exports}for(var a=typeof Lt=="function"&&Lt,u=0;u<n.length;u++)s(n[u]);return s})({1:[function(t,i,r){(function(n){var s=n.MutationObserver||n.WebKitMutationObserver,a;if(s){var u=0,h=new s(N),d=n.document.createTextNode("");h.observe(d,{characterData:!0}),a=function(){d.data=u=++u%2}}else if(!n.setImmediate&&typeof n.MessageChannel<"u"){var c=new n.MessageChannel;c.port1.onmessage=N,a=function(){c.port2.postMessage(0)}}else"document"in n&&"onreadystatechange"in n.document.createElement("script")?a=function(){var f=n.document.createElement("script");f.onreadystatechange=function(){N(),f.onreadystatechange=null,f.parentNode.removeChild(f),f=null},n.document.documentElement.appendChild(f)}:a=function(){setTimeout(N,0)};var w,m=[];function N(){w=!0;for(var f,v,g=m.length;g;){for(v=m,m=[],f=-1;++f<g;)v[f]();g=m.length}w=!1}i.exports=E;function E(f){m.push(f)===1&&!w&&a()}}).call(this,typeof bt<"u"?bt:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(t,i,r){var n=t(1);function s(){}var a={},u=["REJECTED"],h=["FULFILLED"],d=["PENDING"];i.exports=c;function c(b){if(typeof b!="function")throw new TypeError("resolver must be a function");this.state=d,this.queue=[],this.outcome=void 0,b!==s&&E(this,b)}c.prototype.catch=function(b){return this.then(null,b)},c.prototype.then=function(b,S){if(typeof b!="function"&&this.state===h||typeof S!="function"&&this.state===u)return this;var R=new this.constructor(s);if(this.state!==d){var I=this.state===h?b:S;m(R,I,this.outcome)}else this.queue.push(new w(R,b,S));return R};function w(b,S,R){this.promise=b,typeof S=="function"&&(this.onFulfilled=S,this.callFulfilled=this.otherCallFulfilled),typeof R=="function"&&(this.onRejected=R,this.callRejected=this.otherCallRejected)}w.prototype.callFulfilled=function(b){a.resolve(this.promise,b)},w.prototype.otherCallFulfilled=function(b){m(this.promise,this.onFulfilled,b)},w.prototype.callRejected=function(b){a.reject(this.promise,b)},w.prototype.otherCallRejected=function(b){m(this.promise,this.onRejected,b)};function m(b,S,R){n(function(){var I;try{I=S(R)}catch(k){return a.reject(b,k)}I===b?a.reject(b,new TypeError("Cannot resolve promise with itself")):a.resolve(b,I)})}a.resolve=function(b,S){var R=f(N,S);if(R.status==="error")return a.reject(b,R.value);var I=R.value;if(I)E(b,I);else{b.state=h,b.outcome=S;for(var k=-1,O=b.queue.length;++k<O;)b.queue[k].callFulfilled(S)}return b},a.reject=function(b,S){b.state=u,b.outcome=S;for(var R=-1,I=b.queue.length;++R<I;)b.queue[R].callRejected(S);return b};function N(b){var S=b&&b.then;if(b&&(typeof b=="object"||typeof b=="function")&&typeof S=="function")return function(){S.apply(b,arguments)}}function E(b,S){var R=!1;function I(j){R||(R=!0,a.reject(b,j))}function k(j){R||(R=!0,a.resolve(b,j))}function O(){S(k,I)}var G=f(O);G.status==="error"&&I(G.value)}function f(b,S){var R={};try{R.value=b(S),R.status="success"}catch(I){R.status="error",R.value=I}return R}c.resolve=v;function v(b){return b instanceof this?b:a.resolve(new this(s),b)}c.reject=g;function g(b){var S=new this(s);return a.reject(S,b)}c.all=D;function D(b){var S=this;if(Object.prototype.toString.call(b)!=="[object Array]")return this.reject(new TypeError("must be an array"));var R=b.length,I=!1;if(!R)return this.resolve([]);for(var k=new Array(R),O=0,G=-1,j=new this(s);++G<R;)Z(b[G],G);return j;function Z(Y,X){S.resolve(Y).then(ie,function(K){I||(I=!0,a.reject(j,K))});function ie(K){k[X]=K,++O===R&&!I&&(I=!0,a.resolve(j,k))}}}c.race=L;function L(b){var S=this;if(Object.prototype.toString.call(b)!=="[object Array]")return this.reject(new TypeError("must be an array"));var R=b.length,I=!1;if(!R)return this.resolve([]);for(var k=-1,O=new this(s);++k<R;)G(b[k]);return O;function G(j){S.resolve(j).then(function(Z){I||(I=!0,a.resolve(O,Z))},function(Z){I||(I=!0,a.reject(O,Z))})}}},{1:1}],3:[function(t,i,r){(function(n){typeof n.Promise!="function"&&(n.Promise=t(2))}).call(this,typeof bt<"u"?bt:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(t,i,r){var n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(A){return typeof A}:function(A){return A&&typeof Symbol=="function"&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A};function s(A,P){if(!(A instanceof P))throw new TypeError("Cannot call a class as a function")}function a(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var u=a();function h(){try{if(!u||!u.open)return!1;var A=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),P=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!A||P)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function d(A,P){A=A||[],P=P||{};try{return new Blob(A,P)}catch(U){if(U.name!=="TypeError")throw U;for(var T=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,q=new T,W=0;W<A.length;W+=1)q.append(A[W]);return q.getBlob(P.type)}}typeof Promise>"u"&&t(3);var c=Promise;function w(A,P){P&&A.then(function(T){P(null,T)},function(T){P(T)})}function m(A,P,T){typeof P=="function"&&A.then(P),typeof T=="function"&&A.catch(T)}function N(A){return typeof A!="string"&&(console.warn(A+" used as a key, but it is not a string."),A=String(A)),A}function E(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var f="local-forage-detect-blob-support",v=void 0,g={},D=Object.prototype.toString,L="readonly",b="readwrite";function S(A){for(var P=A.length,T=new ArrayBuffer(P),q=new Uint8Array(T),W=0;W<P;W++)q[W]=A.charCodeAt(W);return T}function R(A){return new c(function(P){var T=A.transaction(f,b),q=d([""]);T.objectStore(f).put(q,"key"),T.onabort=function(W){W.preventDefault(),W.stopPropagation(),P(!1)},T.oncomplete=function(){var W=navigator.userAgent.match(/Chrome\/(\d+)/),U=navigator.userAgent.match(/Edge\//);P(U||!W||parseInt(W[1],10)>=43)}}).catch(function(){return!1})}function I(A){return typeof v=="boolean"?c.resolve(v):R(A).then(function(P){return v=P,v})}function k(A){var P=g[A.name],T={};T.promise=new c(function(q,W){T.resolve=q,T.reject=W}),P.deferredOperations.push(T),P.dbReady?P.dbReady=P.dbReady.then(function(){return T.promise}):P.dbReady=T.promise}function O(A){var P=g[A.name],T=P.deferredOperations.pop();if(T)return T.resolve(),T.promise}function G(A,P){var T=g[A.name],q=T.deferredOperations.pop();if(q)return q.reject(P),q.promise}function j(A,P){return new c(function(T,q){if(g[A.name]=g[A.name]||ce(),A.db)if(P)k(A),A.db.close();else return T(A.db);var W=[A.name];P&&W.push(A.version);var U=u.open.apply(u,W);P&&(U.onupgradeneeded=function(J){var ee=U.result;try{ee.createObjectStore(A.storeName),J.oldVersion<=1&&ee.createObjectStore(f)}catch(re){if(re.name==="ConstraintError")console.warn('The database "'+A.name+'" has been upgraded from version '+J.oldVersion+" to version "+J.newVersion+', but the storage "'+A.storeName+'" already exists.');else throw re}}),U.onerror=function(J){J.preventDefault(),q(U.error)},U.onsuccess=function(){var J=U.result;J.onversionchange=function(ee){ee.target.close()},T(J),O(A)}})}function Z(A){return j(A,!1)}function Y(A){return j(A,!0)}function X(A,P){if(!A.db)return!0;var T=!A.db.objectStoreNames.contains(A.storeName),q=A.version<A.db.version,W=A.version>A.db.version;if(q&&(A.version!==P&&console.warn('The database "'+A.name+`" can't be downgraded from version `+A.db.version+" to version "+A.version+"."),A.version=A.db.version),W||T){if(T){var U=A.db.version+1;U>A.version&&(A.version=U)}return!0}return!1}function ie(A){return new c(function(P,T){var q=new FileReader;q.onerror=T,q.onloadend=function(W){var U=btoa(W.target.result||"");P({__local_forage_encoded_blob:!0,data:U,type:A.type})},q.readAsBinaryString(A)})}function K(A){var P=S(atob(A.data));return d([P],{type:A.type})}function $(A){return A&&A.__local_forage_encoded_blob}function ae(A){var P=this,T=P._initReady().then(function(){var q=g[P._dbInfo.name];if(q&&q.dbReady)return q.dbReady});return m(T,A,A),T}function pe(A){k(A);for(var P=g[A.name],T=P.forages,q=0;q<T.length;q++){var W=T[q];W._dbInfo.db&&(W._dbInfo.db.close(),W._dbInfo.db=null)}return A.db=null,Z(A).then(function(U){return A.db=U,X(A)?Y(A):U}).then(function(U){A.db=P.db=U;for(var J=0;J<T.length;J++)T[J]._dbInfo.db=U}).catch(function(U){throw G(A,U),U})}function ne(A,P,T,q){q===void 0&&(q=1);try{var W=A.db.transaction(A.storeName,P);T(null,W)}catch(U){if(q>0&&(!A.db||U.name==="InvalidStateError"||U.name==="NotFoundError"))return c.resolve().then(function(){if(!A.db||U.name==="NotFoundError"&&!A.db.objectStoreNames.contains(A.storeName)&&A.version<=A.db.version)return A.db&&(A.version=A.db.version+1),Y(A)}).then(function(){return pe(A).then(function(){ne(A,P,T,q-1)})}).catch(T);T(U)}}function ce(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Ce(A){var P=this,T={db:null};if(A)for(var q in A)T[q]=A[q];var W=g[T.name];W||(W=ce(),g[T.name]=W),W.forages.push(P),P._initReady||(P._initReady=P.ready,P.ready=ae);var U=[];function J(){return c.resolve()}for(var ee=0;ee<W.forages.length;ee++){var re=W.forages[ee];re!==P&&U.push(re._initReady().catch(J))}var se=W.forages.slice(0);return c.all(U).then(function(){return T.db=W.db,Z(T)}).then(function(oe){return T.db=oe,X(T,P._defaultConfig.version)?Y(T):oe}).then(function(oe){T.db=W.db=oe,P._dbInfo=T;for(var ge=0;ge<se.length;ge++){var Re=se[ge];Re!==P&&(Re._dbInfo.db=T.db,Re._dbInfo.version=T.version)}})}function ye(A,P){var T=this;A=N(A);var q=new c(function(W,U){T.ready().then(function(){ne(T._dbInfo,L,function(J,ee){if(J)return U(J);try{var re=ee.objectStore(T._dbInfo.storeName),se=re.get(A);se.onsuccess=function(){var oe=se.result;oe===void 0&&(oe=null),$(oe)&&(oe=K(oe)),W(oe)},se.onerror=function(){U(se.error)}}catch(oe){U(oe)}})}).catch(U)});return w(q,P),q}function Te(A,P){var T=this,q=new c(function(W,U){T.ready().then(function(){ne(T._dbInfo,L,function(J,ee){if(J)return U(J);try{var re=ee.objectStore(T._dbInfo.storeName),se=re.openCursor(),oe=1;se.onsuccess=function(){var ge=se.result;if(ge){var Re=ge.value;$(Re)&&(Re=K(Re));var qe=A(Re,ge.key,oe++);qe!==void 0?W(qe):ge.continue()}else W()},se.onerror=function(){U(se.error)}}catch(ge){U(ge)}})}).catch(U)});return w(q,P),q}function We(A,P,T){var q=this;A=N(A);var W=new c(function(U,J){var ee;q.ready().then(function(){return ee=q._dbInfo,D.call(P)==="[object Blob]"?I(ee.db).then(function(re){return re?P:ie(P)}):P}).then(function(re){ne(q._dbInfo,b,function(se,oe){if(se)return J(se);try{var ge=oe.objectStore(q._dbInfo.storeName);re===null&&(re=void 0);var Re=ge.put(re,A);oe.oncomplete=function(){re===void 0&&(re=null),U(re)},oe.onabort=oe.onerror=function(){var qe=Re.error?Re.error:Re.transaction.error;J(qe)}}catch(qe){J(qe)}})}).catch(J)});return w(W,T),W}function Fe(A,P){var T=this;A=N(A);var q=new c(function(W,U){T.ready().then(function(){ne(T._dbInfo,b,function(J,ee){if(J)return U(J);try{var re=ee.objectStore(T._dbInfo.storeName),se=re.delete(A);ee.oncomplete=function(){W()},ee.onerror=function(){U(se.error)},ee.onabort=function(){var oe=se.error?se.error:se.transaction.error;U(oe)}}catch(oe){U(oe)}})}).catch(U)});return w(q,P),q}function be(A){var P=this,T=new c(function(q,W){P.ready().then(function(){ne(P._dbInfo,b,function(U,J){if(U)return W(U);try{var ee=J.objectStore(P._dbInfo.storeName),re=ee.clear();J.oncomplete=function(){q()},J.onabort=J.onerror=function(){var se=re.error?re.error:re.transaction.error;W(se)}}catch(se){W(se)}})}).catch(W)});return w(T,A),T}function Pe(A){var P=this,T=new c(function(q,W){P.ready().then(function(){ne(P._dbInfo,L,function(U,J){if(U)return W(U);try{var ee=J.objectStore(P._dbInfo.storeName),re=ee.count();re.onsuccess=function(){q(re.result)},re.onerror=function(){W(re.error)}}catch(se){W(se)}})}).catch(W)});return w(T,A),T}function Ue(A,P){var T=this,q=new c(function(W,U){if(A<0){W(null);return}T.ready().then(function(){ne(T._dbInfo,L,function(J,ee){if(J)return U(J);try{var re=ee.objectStore(T._dbInfo.storeName),se=!1,oe=re.openKeyCursor();oe.onsuccess=function(){var ge=oe.result;if(!ge){W(null);return}A===0||se?W(ge.key):(se=!0,ge.advance(A))},oe.onerror=function(){U(oe.error)}}catch(ge){U(ge)}})}).catch(U)});return w(q,P),q}function xe(A){var P=this,T=new c(function(q,W){P.ready().then(function(){ne(P._dbInfo,L,function(U,J){if(U)return W(U);try{var ee=J.objectStore(P._dbInfo.storeName),re=ee.openKeyCursor(),se=[];re.onsuccess=function(){var oe=re.result;if(!oe){q(se);return}se.push(oe.key),oe.continue()},re.onerror=function(){W(re.error)}}catch(oe){W(oe)}})}).catch(W)});return w(T,A),T}function ke(A,P){P=E.apply(this,arguments);var T=this.config();A=typeof A!="function"&&A||{},A.name||(A.name=A.name||T.name,A.storeName=A.storeName||T.storeName);var q=this,W;if(!A.name)W=c.reject("Invalid arguments");else{var U=A.name===T.name&&q._dbInfo.db,J=U?c.resolve(q._dbInfo.db):Z(A).then(function(ee){var re=g[A.name],se=re.forages;re.db=ee;for(var oe=0;oe<se.length;oe++)se[oe]._dbInfo.db=ee;return ee});A.storeName?W=J.then(function(ee){if(ee.objectStoreNames.contains(A.storeName)){var re=ee.version+1;k(A);var se=g[A.name],oe=se.forages;ee.close();for(var ge=0;ge<oe.length;ge++){var Re=oe[ge];Re._dbInfo.db=null,Re._dbInfo.version=re}var qe=new c(function(je,rt){var et=u.open(A.name,re);et.onerror=function(mt){var $t=et.result;$t.close(),rt(mt)},et.onupgradeneeded=function(){var mt=et.result;mt.deleteObjectStore(A.storeName)},et.onsuccess=function(){var mt=et.result;mt.close(),je(mt)}});return qe.then(function(je){se.db=je;for(var rt=0;rt<oe.length;rt++){var et=oe[rt];et._dbInfo.db=je,O(et._dbInfo)}}).catch(function(je){throw(G(A,je)||c.resolve()).catch(function(){}),je})}}):W=J.then(function(ee){k(A);var re=g[A.name],se=re.forages;ee.close();for(var oe=0;oe<se.length;oe++){var ge=se[oe];ge._dbInfo.db=null}var Re=new c(function(qe,je){var rt=u.deleteDatabase(A.name);rt.onerror=function(){var et=rt.result;et&&et.close(),je(rt.error)},rt.onblocked=function(){console.warn('dropInstance blocked for database "'+A.name+'" until all open connections are closed')},rt.onsuccess=function(){var et=rt.result;et&&et.close(),qe(et)}});return Re.then(function(qe){re.db=qe;for(var je=0;je<se.length;je++){var rt=se[je];O(rt._dbInfo)}}).catch(function(qe){throw(G(A,qe)||c.resolve()).catch(function(){}),qe})})}return w(W,P),W}var ve={_driver:"asyncStorage",_initStorage:Ce,_support:h(),iterate:Te,getItem:ye,setItem:We,removeItem:Fe,clear:be,length:Pe,key:Ue,keys:xe,dropInstance:ke};function Ie(){return typeof openDatabase=="function"}var He="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ze="~~local_forage_type~",Oe=/^~~local_forage_type~([^~]+)~/,Ge="__lfsc__:",tt=Ge.length,Je="arbf",Ee="blob",De="si08",_e="ui08",nt="uic8",pt="si16",lt="si32",it="ur16",vt="ui32",ft="fl32",at="fl64",ct=tt+Je.length,ht=Object.prototype.toString;function Ye(A){var P=A.length*.75,T=A.length,q,W=0,U,J,ee,re;A[A.length-1]==="="&&(P--,A[A.length-2]==="="&&P--);var se=new ArrayBuffer(P),oe=new Uint8Array(se);for(q=0;q<T;q+=4)U=He.indexOf(A[q]),J=He.indexOf(A[q+1]),ee=He.indexOf(A[q+2]),re=He.indexOf(A[q+3]),oe[W++]=U<<2|J>>4,oe[W++]=(J&15)<<4|ee>>2,oe[W++]=(ee&3)<<6|re&63;return se}function ot(A){var P=new Uint8Array(A),T="",q;for(q=0;q<P.length;q+=3)T+=He[P[q]>>2],T+=He[(P[q]&3)<<4|P[q+1]>>4],T+=He[(P[q+1]&15)<<2|P[q+2]>>6],T+=He[P[q+2]&63];return P.length%3===2?T=T.substring(0,T.length-1)+"=":P.length%3===1&&(T=T.substring(0,T.length-2)+"=="),T}function wt(A,P){var T="";if(A&&(T=ht.call(A)),A&&(T==="[object ArrayBuffer]"||A.buffer&&ht.call(A.buffer)==="[object ArrayBuffer]")){var q,W=Ge;A instanceof ArrayBuffer?(q=A,W+=Je):(q=A.buffer,T==="[object Int8Array]"?W+=De:T==="[object Uint8Array]"?W+=_e:T==="[object Uint8ClampedArray]"?W+=nt:T==="[object Int16Array]"?W+=pt:T==="[object Uint16Array]"?W+=it:T==="[object Int32Array]"?W+=lt:T==="[object Uint32Array]"?W+=vt:T==="[object Float32Array]"?W+=ft:T==="[object Float64Array]"?W+=at:P(new Error("Failed to get type for BinaryArray"))),P(W+ot(q))}else if(T==="[object Blob]"){var U=new FileReader;U.onload=function(){var J=ze+A.type+"~"+ot(this.result);P(Ge+Ee+J)},U.readAsArrayBuffer(A)}else try{P(JSON.stringify(A))}catch(J){console.error("Couldn't convert value into a JSON string: ",A),P(null,J)}}function C(A){if(A.substring(0,tt)!==Ge)return JSON.parse(A);var P=A.substring(ct),T=A.substring(tt,ct),q;if(T===Ee&&Oe.test(P)){var W=P.match(Oe);q=W[1],P=P.substring(W[0].length)}var U=Ye(P);switch(T){case Je:return U;case Ee:return d([U],{type:q});case De:return new Int8Array(U);case _e:return new Uint8Array(U);case nt:return new Uint8ClampedArray(U);case pt:return new Int16Array(U);case it:return new Uint16Array(U);case lt:return new Int32Array(U);case vt:return new Uint32Array(U);case ft:return new Float32Array(U);case at:return new Float64Array(U);default:throw new Error("Unkown type: "+T)}}var Q={serialize:wt,deserialize:C,stringToBuffer:Ye,bufferToString:ot};function te(A,P,T,q){A.executeSql("CREATE TABLE IF NOT EXISTS "+P.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],T,q)}function fe(A){var P=this,T={db:null};if(A)for(var q in A)T[q]=typeof A[q]!="string"?A[q].toString():A[q];var W=new c(function(U,J){try{T.db=openDatabase(T.name,String(T.version),T.description,T.size)}catch(ee){return J(ee)}T.db.transaction(function(ee){te(ee,T,function(){P._dbInfo=T,U()},function(re,se){J(se)})},J)});return T.serializer=Q,W}function F(A,P,T,q,W,U){A.executeSql(T,q,W,function(J,ee){ee.code===ee.SYNTAX_ERR?J.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[P.storeName],function(re,se){se.rows.length?U(re,ee):te(re,P,function(){re.executeSql(T,q,W,U)},U)},U):U(J,ee)},U)}function p(A,P){var T=this;A=N(A);var q=new c(function(W,U){T.ready().then(function(){var J=T._dbInfo;J.db.transaction(function(ee){F(ee,J,"SELECT * FROM "+J.storeName+" WHERE key = ? LIMIT 1",[A],function(re,se){var oe=se.rows.length?se.rows.item(0).value:null;oe&&(oe=J.serializer.deserialize(oe)),W(oe)},function(re,se){U(se)})})}).catch(U)});return w(q,P),q}function o(A,P){var T=this,q=new c(function(W,U){T.ready().then(function(){var J=T._dbInfo;J.db.transaction(function(ee){F(ee,J,"SELECT * FROM "+J.storeName,[],function(re,se){for(var oe=se.rows,ge=oe.length,Re=0;Re<ge;Re++){var qe=oe.item(Re),je=qe.value;if(je&&(je=J.serializer.deserialize(je)),je=A(je,qe.key,Re+1),je!==void 0){W(je);return}}W()},function(re,se){U(se)})})}).catch(U)});return w(q,P),q}function x(A,P,T,q){var W=this;A=N(A);var U=new c(function(J,ee){W.ready().then(function(){P===void 0&&(P=null);var re=P,se=W._dbInfo;se.serializer.serialize(P,function(oe,ge){ge?ee(ge):se.db.transaction(function(Re){F(Re,se,"INSERT OR REPLACE INTO "+se.storeName+" (key, value) VALUES (?, ?)",[A,oe],function(){J(re)},function(qe,je){ee(je)})},function(Re){if(Re.code===Re.QUOTA_ERR){if(q>0){J(x.apply(W,[A,re,T,q-1]));return}ee(Re)}})})}).catch(ee)});return w(U,T),U}function z(A,P,T){return x.apply(this,[A,P,T,1])}function l(A,P){var T=this;A=N(A);var q=new c(function(W,U){T.ready().then(function(){var J=T._dbInfo;J.db.transaction(function(ee){F(ee,J,"DELETE FROM "+J.storeName+" WHERE key = ?",[A],function(){W()},function(re,se){U(se)})})}).catch(U)});return w(q,P),q}function M(A){var P=this,T=new c(function(q,W){P.ready().then(function(){var U=P._dbInfo;U.db.transaction(function(J){F(J,U,"DELETE FROM "+U.storeName,[],function(){q()},function(ee,re){W(re)})})}).catch(W)});return w(T,A),T}function H(A){var P=this,T=new c(function(q,W){P.ready().then(function(){var U=P._dbInfo;U.db.transaction(function(J){F(J,U,"SELECT COUNT(key) as c FROM "+U.storeName,[],function(ee,re){var se=re.rows.item(0).c;q(se)},function(ee,re){W(re)})})}).catch(W)});return w(T,A),T}function _(A,P){var T=this,q=new c(function(W,U){T.ready().then(function(){var J=T._dbInfo;J.db.transaction(function(ee){F(ee,J,"SELECT key FROM "+J.storeName+" WHERE id = ? LIMIT 1",[A+1],function(re,se){var oe=se.rows.length?se.rows.item(0).key:null;W(oe)},function(re,se){U(se)})})}).catch(U)});return w(q,P),q}function B(A){var P=this,T=new c(function(q,W){P.ready().then(function(){var U=P._dbInfo;U.db.transaction(function(J){F(J,U,"SELECT key FROM "+U.storeName,[],function(ee,re){for(var se=[],oe=0;oe<re.rows.length;oe++)se.push(re.rows.item(oe).key);q(se)},function(ee,re){W(re)})})}).catch(W)});return w(T,A),T}function V(A){return new c(function(P,T){A.transaction(function(q){q.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(W,U){for(var J=[],ee=0;ee<U.rows.length;ee++)J.push(U.rows.item(ee).name);P({db:A,storeNames:J})},function(W,U){T(U)})},function(q){T(q)})})}function de(A,P){P=E.apply(this,arguments);var T=this.config();A=typeof A!="function"&&A||{},A.name||(A.name=A.name||T.name,A.storeName=A.storeName||T.storeName);var q=this,W;return A.name?W=new c(function(U){var J;A.name===T.name?J=q._dbInfo.db:J=openDatabase(A.name,"","",0),A.storeName?U({db:J,storeNames:[A.storeName]}):U(V(J))}).then(function(U){return new c(function(J,ee){U.db.transaction(function(re){function se(qe){return new c(function(je,rt){re.executeSql("DROP TABLE IF EXISTS "+qe,[],function(){je()},function(et,mt){rt(mt)})})}for(var oe=[],ge=0,Re=U.storeNames.length;ge<Re;ge++)oe.push(se(U.storeNames[ge]));c.all(oe).then(function(){J()}).catch(function(qe){ee(qe)})},function(re){ee(re)})})}):W=c.reject("Invalid arguments"),w(W,P),W}var ue={_driver:"webSQLStorage",_initStorage:fe,_support:Ie(),iterate:o,getItem:p,setItem:z,removeItem:l,clear:M,length:H,key:_,keys:B,dropInstance:de};function le(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function Ae(A,P){var T=A.name+"/";return A.storeName!==P.storeName&&(T+=A.storeName+"/"),T}function Xe(){var A="_localforage_support_test";try{return localStorage.setItem(A,!0),localStorage.removeItem(A),!1}catch{return!0}}function Me(){return!Xe()||localStorage.length>0}function Se(A){var P=this,T={};if(A)for(var q in A)T[q]=A[q];return T.keyPrefix=Ae(A,P._defaultConfig),Me()?(P._dbInfo=T,T.serializer=Q,c.resolve()):c.reject()}function Ne(A){var P=this,T=P.ready().then(function(){for(var q=P._dbInfo.keyPrefix,W=localStorage.length-1;W>=0;W--){var U=localStorage.key(W);U.indexOf(q)===0&&localStorage.removeItem(U)}});return w(T,A),T}function Qe(A,P){var T=this;A=N(A);var q=T.ready().then(function(){var W=T._dbInfo,U=localStorage.getItem(W.keyPrefix+A);return U&&(U=W.serializer.deserialize(U)),U});return w(q,P),q}function Ze(A,P){var T=this,q=T.ready().then(function(){for(var W=T._dbInfo,U=W.keyPrefix,J=U.length,ee=localStorage.length,re=1,se=0;se<ee;se++){var oe=localStorage.key(se);if(oe.indexOf(U)===0){var ge=localStorage.getItem(oe);if(ge&&(ge=W.serializer.deserialize(ge)),ge=A(ge,oe.substring(J),re++),ge!==void 0)return ge}}});return w(q,P),q}function Tt(A,P){var T=this,q=T.ready().then(function(){var W=T._dbInfo,U;try{U=localStorage.key(A)}catch{U=null}return U&&(U=U.substring(W.keyPrefix.length)),U});return w(q,P),q}function Pt(A){var P=this,T=P.ready().then(function(){for(var q=P._dbInfo,W=localStorage.length,U=[],J=0;J<W;J++){var ee=localStorage.key(J);ee.indexOf(q.keyPrefix)===0&&U.push(ee.substring(q.keyPrefix.length))}return U});return w(T,A),T}function $e(A){var P=this,T=P.keys().then(function(q){return q.length});return w(T,A),T}function dt(A,P){var T=this;A=N(A);var q=T.ready().then(function(){var W=T._dbInfo;localStorage.removeItem(W.keyPrefix+A)});return w(q,P),q}function st(A,P,T){var q=this;A=N(A);var W=q.ready().then(function(){P===void 0&&(P=null);var U=P;return new c(function(J,ee){var re=q._dbInfo;re.serializer.serialize(P,function(se,oe){if(oe)ee(oe);else try{localStorage.setItem(re.keyPrefix+A,se),J(U)}catch(ge){(ge.name==="QuotaExceededError"||ge.name==="NS_ERROR_DOM_QUOTA_REACHED")&&ee(ge),ee(ge)}})})});return w(W,T),W}function _t(A,P){if(P=E.apply(this,arguments),A=typeof A!="function"&&A||{},!A.name){var T=this.config();A.name=A.name||T.name,A.storeName=A.storeName||T.storeName}var q=this,W;return A.name?W=new c(function(U){A.storeName?U(Ae(A,q._defaultConfig)):U(A.name+"/")}).then(function(U){for(var J=localStorage.length-1;J>=0;J--){var ee=localStorage.key(J);ee.indexOf(U)===0&&localStorage.removeItem(ee)}}):W=c.reject("Invalid arguments"),w(W,P),W}var gt={_driver:"localStorageWrapper",_initStorage:Se,_support:le(),iterate:Ze,getItem:Qe,setItem:st,removeItem:dt,clear:Ne,length:$e,key:Tt,keys:Pt,dropInstance:_t},ii=function(P,T){return P===T||typeof P=="number"&&typeof T=="number"&&isNaN(P)&&isNaN(T)},vs=function(P,T){for(var q=P.length,W=0;W<q;){if(ii(P[W],T))return!0;W++}return!1},Rr=Array.isArray||function(A){return Object.prototype.toString.call(A)==="[object Array]"},Xt={},Ir={},Ft={INDEXEDDB:ve,WEBSQL:ue,LOCALSTORAGE:gt},gs=[Ft.INDEXEDDB._driver,Ft.WEBSQL._driver,Ft.LOCALSTORAGE._driver],ri=["dropInstance"],Ei=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(ri),ms={description:"",driver:gs.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function ys(A,P){A[P]=function(){var T=arguments;return A.ready().then(function(){return A[P].apply(A,T)})}}function xi(){for(var A=1;A<arguments.length;A++){var P=arguments[A];if(P)for(var T in P)P.hasOwnProperty(T)&&(Rr(P[T])?arguments[0][T]=P[T].slice():arguments[0][T]=P[T])}return arguments[0]}var bs=(function(){function A(P){s(this,A);for(var T in Ft)if(Ft.hasOwnProperty(T)){var q=Ft[T],W=q._driver;this[T]=W,Xt[W]||this.defineDriver(q)}this._defaultConfig=xi({},ms),this._config=xi({},this._defaultConfig,P),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return A.prototype.config=function(T){if((typeof T>"u"?"undefined":n(T))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var q in T){if(q==="storeName"&&(T[q]=T[q].replace(/\W/g,"_")),q==="version"&&typeof T[q]!="number")return new Error("Database version must be a number.");this._config[q]=T[q]}return"driver"in T&&T.driver?this.setDriver(this._config.driver):!0}else return typeof T=="string"?this._config[T]:this._config},A.prototype.defineDriver=function(T,q,W){var U=new c(function(J,ee){try{var re=T._driver,se=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!T._driver){ee(se);return}for(var oe=Ei.concat("_initStorage"),ge=0,Re=oe.length;ge<Re;ge++){var qe=oe[ge],je=!vs(ri,qe);if((je||T[qe])&&typeof T[qe]!="function"){ee(se);return}}var rt=function(){for(var $t=function(Es){return function(){var xs=new Error("Method "+Es+" is not implemented by the current driver"),Or=c.reject(xs);return w(Or,arguments[arguments.length-1]),Or}},Ai=0,_s=ri.length;Ai<_s;Ai++){var Di=ri[Ai];T[Di]||(T[Di]=$t(Di))}};rt();var et=function($t){Xt[re]&&console.info("Redefining LocalForage driver: "+re),Xt[re]=T,Ir[re]=$t,J()};"_support"in T?T._support&&typeof T._support=="function"?T._support().then(et,ee):et(!!T._support):et(!0)}catch(mt){ee(mt)}});return m(U,q,W),U},A.prototype.driver=function(){return this._driver||null},A.prototype.getDriver=function(T,q,W){var U=Xt[T]?c.resolve(Xt[T]):c.reject(new Error("Driver not found."));return m(U,q,W),U},A.prototype.getSerializer=function(T){var q=c.resolve(Q);return m(q,T),q},A.prototype.ready=function(T){var q=this,W=q._driverSet.then(function(){return q._ready===null&&(q._ready=q._initDriver()),q._ready});return m(W,T,T),W},A.prototype.setDriver=function(T,q,W){var U=this;Rr(T)||(T=[T]);var J=this._getSupportedDrivers(T);function ee(){U._config.driver=U.driver()}function re(ge){return U._extend(ge),ee(),U._ready=U._initStorage(U._config),U._ready}function se(ge){return function(){var Re=0;function qe(){for(;Re<ge.length;){var je=ge[Re];return Re++,U._dbInfo=null,U._ready=null,U.getDriver(je).then(re).catch(qe)}ee();var rt=new Error("No available storage method found.");return U._driverSet=c.reject(rt),U._driverSet}return qe()}}var oe=this._driverSet!==null?this._driverSet.catch(function(){return c.resolve()}):c.resolve();return this._driverSet=oe.then(function(){var ge=J[0];return U._dbInfo=null,U._ready=null,U.getDriver(ge).then(function(Re){U._driver=Re._driver,ee(),U._wrapLibraryMethodsWithReady(),U._initDriver=se(J)})}).catch(function(){ee();var ge=new Error("No available storage method found.");return U._driverSet=c.reject(ge),U._driverSet}),m(this._driverSet,q,W),this._driverSet},A.prototype.supports=function(T){return!!Ir[T]},A.prototype._extend=function(T){xi(this,T)},A.prototype._getSupportedDrivers=function(T){for(var q=[],W=0,U=T.length;W<U;W++){var J=T[W];this.supports(J)&&q.push(J)}return q},A.prototype._wrapLibraryMethodsWithReady=function(){for(var T=0,q=Ei.length;T<q;T++)ys(this,Ei[T])},A.prototype.createInstance=function(T){return new A(T)},A})(),ws=new bs;i.exports=ws},{3:3}]},{},[4])(4)})})(cr)),cr.exports}var Qa=Ja();const In=Yt(Qa);class cs{constructor(e,t,i){this.urlCache={},this.storage=void 0,this.name=e,this.requester=t||ti,this.resolver=i,this.online=!0,this.checkRequirements(),this.addListeners()}checkRequirements(){try{let e;typeof In>"u"&&(e=In),this.storage=e.createInstance({name:this.name})}catch{throw new Error("localForage lib not loaded")}}addListeners(){this._status=this.status.bind(this),window.addEventListener("online",this._status),window.addEventListener("offline",this._status)}removeListeners(){window.removeEventListener("online",this._status),window.removeEventListener("offline",this._status),this._status=void 0}status(e){let t=navigator.onLine;this.online=t,t?this.emit("online",this):this.emit("offline",this)}add(e,t){let i=e.resources.map(r=>{let{href:n}=r,s=this.resolver(n),a=window.encodeURIComponent(s);return this.storage.getItem(a).then(u=>!u||t?this.requester(s,"binary").then(h=>this.storage.setItem(a,h)):u)});return Promise.all(i)}put(e,t,i){let r=window.encodeURIComponent(e);return this.storage.getItem(r).then(n=>n||this.requester(e,"binary",t,i).then(s=>this.storage.setItem(r,s)))}request(e,t,i,r){return this.online?this.requester(e,t,i,r).then(n=>(this.put(e),n)):this.retrieve(e,t)}retrieve(e,t){new Le;var i,r=new It(e);return t||(t=r.extension),t=="blob"?i=this.getBlob(e):i=this.getText(e),i.then(n=>{var s=new Le,a;return n?(a=this.handleResponse(n,t),s.resolve(a)):s.reject({message:"File not found in storage: "+e,stack:new Error().stack}),s.promise})}handleResponse(e,t){var i;return t=="json"?i=JSON.parse(e):ei(t)?i=Ct(e,"text/xml"):t=="xhtml"?i=Ct(e,"application/xhtml+xml"):t=="html"||t=="htm"?i=Ct(e,"text/html"):i=e,i}getBlob(e,t){let i=window.encodeURIComponent(e);return this.storage.getItem(i).then(function(r){if(r)return t=t||Gt.lookup(e),new Blob([r],{type:t})})}getText(e,t){let i=window.encodeURIComponent(e);return t=t||Gt.lookup(e),this.storage.getItem(i).then(function(r){var n=new Le,s=new FileReader,a;if(r)return a=new Blob([r],{type:t}),s.addEventListener("loadend",()=>{n.resolve(s.result)}),s.readAsText(a,t),n.promise})}getBase64(e,t){let i=window.encodeURIComponent(e);return t=t||Gt.lookup(e),this.storage.getItem(i).then(r=>{var n=new Le,s=new FileReader,a;if(r)return a=new Blob([r],{type:t}),s.addEventListener("loadend",()=>{n.resolve(s.result)}),s.readAsDataURL(a,t),n.promise})}createUrl(e,t){var i=new Le,r=window.URL||window.webkitURL||window.mozURL,n,s,a=t&&t.base64;return e in this.urlCache?(i.resolve(this.urlCache[e]),i.promise):(a?(s=this.getBase64(e),s&&s.then((function(u){this.urlCache[e]=u,i.resolve(u)}).bind(this))):(s=this.getBlob(e),s&&s.then((function(u){n=r.createObjectURL(u),this.urlCache[e]=n,i.resolve(n)}).bind(this))),s||i.reject({message:"File not found in storage: "+e,stack:new Error().stack}),i.promise)}revokeUrl(e){var t=window.URL||window.webkitURL||window.mozURL,i=this.urlCache[e];i&&t.revokeObjectURL(i)}destroy(){var e=window.URL||window.webkitURL||window.mozURL;for(let t in this.urlCache)e.revokeObjectURL(t);this.urlCache={},this.removeListeners()}}St(cs.prototype);class dr{constructor(e){this.interactive="",this.fixedLayout="",this.openToSpread="",this.orientationLock="",e&&this.parse(e)}parse(e){if(!e)return this;const t=Ve(e,"display_options");return t?(Rt(t,"option").forEach(r=>{let n="";switch(r.childNodes.length&&(n=r.childNodes[0].nodeValue),r.attributes.name.value){case"interactive":this.interactive=n;break;case"fixed-layout":this.fixedLayout=n;break;case"open-to-spread":this.openToSpread=n;break;case"orientation-lock":this.orientationLock=n;break}}),this):this}destroy(){this.interactive=void 0,this.fixedLayout=void 0,this.openToSpread=void 0,this.orientationLock=void 0}}const On="META-INF/container.xml",eo="META-INF/com.apple.ibooks.display-options.xml",xt={BINARY:"binary",BASE64:"base64",EPUB:"epub",OPF:"opf",MANIFEST:"json",DIRECTORY:"directory"};class Nr{constructor(e,t){typeof t>"u"&&typeof e!="string"&&!(e instanceof Blob)&&!(e instanceof ArrayBuffer)&&(t=e,e=void 0),this.settings=ut(this.settings||{},{requestMethod:void 0,requestCredentials:void 0,requestHeaders:void 0,encoding:void 0,replacements:void 0,canonical:void 0,openAs:void 0,store:void 0}),ut(this.settings,t),this.opening=new Le,this.opened=this.opening.promise,this.isOpen=!1,this.loading={manifest:new Le,spine:new Le,metadata:new Le,cover:new Le,navigation:new Le,pageList:new Le,resources:new Le,displayOptions:new Le},this.loaded={manifest:this.loading.manifest.promise,spine:this.loading.spine.promise,metadata:this.loading.metadata.promise,cover:this.loading.cover.promise,navigation:this.loading.navigation.promise,pageList:this.loading.pageList.promise,resources:this.loading.resources.promise,displayOptions:this.loading.displayOptions.promise},this.ready=Promise.all([this.loaded.manifest,this.loaded.spine,this.loaded.metadata,this.loaded.cover,this.loaded.navigation,this.loaded.resources,this.loaded.displayOptions]),this.isRendered=!1,this.request=this.settings.requestMethod||ti,this.spine=new pa,this.locations=new ns(this.spine,this.load.bind(this)),this.navigation=void 0,this.pageList=void 0,this.url=void 0,this.path=void 0,this.archived=!1,this.archive=void 0,this.storage=void 0,this.resources=void 0,this.rendition=void 0,this.container=void 0,this.packaging=void 0,this.displayOptions=void 0,this.settings.store&&this.store(this.settings.store),e&&this.open(e,this.settings.openAs).catch(i=>{var r=new Error("Cannot load book at "+e);this.emit(he.BOOK.OPEN_FAILED,r)})}open(e,t){var i,r=t||this.determineType(e);return r===xt.BINARY?(this.archived=!0,this.url=new At("/",""),i=this.openEpub(e)):r===xt.BASE64?(this.archived=!0,this.url=new At("/",""),i=this.openEpub(e,r)):r===xt.EPUB?(this.archived=!0,this.url=new At("/",""),i=this.request(e,"binary",this.settings.requestCredentials,this.settings.requestHeaders).then(this.openEpub.bind(this))):r==xt.OPF?(this.url=new At(e),i=this.openPackaging(this.url.Path.toString())):r==xt.MANIFEST?(this.url=new At(e),i=this.openManifest(this.url.Path.toString())):(this.url=new At(e),i=this.openContainer(On).then(this.openPackaging.bind(this))),i}openEpub(e,t){return this.unarchive(e,t||this.settings.encoding).then(()=>this.openContainer(On)).then(i=>this.openPackaging(i))}openContainer(e){return this.load(e).then(t=>(this.container=new va(t),this.resolve(this.container.packagePath)))}openPackaging(e){return this.path=new It(e),this.load(e).then(t=>(this.packaging=new hn(t),this.unpack(this.packaging)))}openManifest(e){return this.path=new It(e),this.load(e).then(t=>(this.packaging=new hn,this.packaging.load(t),this.unpack(this.packaging)))}load(e){var t=this.resolve(e);return this.archived?this.archive.request(t):this.request(t,null,this.settings.requestCredentials,this.settings.requestHeaders)}resolve(e,t){if(e){var i=e,r=e.indexOf("://")>-1;return r?e:(this.path&&(i=this.path.resolve(e)),t!=!1&&this.url&&(i=this.url.resolve(i)),i)}}canonical(e){var t=e;return e?(this.settings.canonical?t=this.settings.canonical(e):t=this.resolve(e,!0),t):""}determineType(e){var t,i,r;if(this.settings.encoding==="base64")return xt.BASE64;if(typeof e!="string")return xt.BINARY;if(t=new At(e),i=t.path(),r=i.extension,r&&(r=r.replace(/\?.*$/,"")),!r)return xt.DIRECTORY;if(r==="epub")return xt.EPUB;if(r==="opf")return xt.OPF;if(r==="json")return xt.MANIFEST}unpack(e){this.package=e,this.packaging.metadata.layout===""?this.load(this.url.resolve(eo)).then(t=>{this.displayOptions=new dr(t),this.loading.displayOptions.resolve(this.displayOptions)}).catch(t=>{this.displayOptions=new dr,this.loading.displayOptions.resolve(this.displayOptions)}):(this.displayOptions=new dr,this.loading.displayOptions.resolve(this.displayOptions)),this.spine.unpack(this.packaging,this.resolve.bind(this),this.canonical.bind(this)),this.resources=new ba(this.packaging.manifest,{archive:this.archive,resolver:this.resolve.bind(this),request:this.request.bind(this),replacements:this.settings.replacements||(this.archived?"blobUrl":"base64")}),this.loadNavigation(this.packaging).then(()=>{this.loading.navigation.resolve(this.navigation)}),this.packaging.coverPath&&(this.cover=this.resolve(this.packaging.coverPath)),this.loading.manifest.resolve(this.packaging.manifest),this.loading.metadata.resolve(this.packaging.metadata),this.loading.spine.resolve(this.spine),this.loading.cover.resolve(this.cover),this.loading.resources.resolve(this.resources),this.loading.pageList.resolve(this.pageList),this.isOpen=!0,this.archived||this.settings.replacements&&this.settings.replacements!="none"?this.replacements().then(()=>{this.loaded.displayOptions.then(()=>{this.opening.resolve(this)})}).catch(t=>{console.error(t)}):this.loaded.displayOptions.then(()=>{this.opening.resolve(this)})}loadNavigation(e){let t=e.navPath||e.ncxPath,i=e.toc;return i?new Promise((r,n)=>{this.navigation=new Yi(i),e.pageList&&(this.pageList=new Xi(e.pageList)),r(this.navigation)}):t?this.load(t,"xml").then(r=>(this.navigation=new Yi(r),this.pageList=new Xi(r),this.navigation)):new Promise((r,n)=>{this.navigation=new Yi,this.pageList=new Xi,r(this.navigation)})}section(e){return this.spine.get(e)}renderTo(e,t){return this.rendition=new kr(this,t),this.rendition.attachTo(e),this.rendition}setRequestCredentials(e){this.settings.requestCredentials=e}setRequestHeaders(e){this.settings.requestHeaders=e}unarchive(e,t){return this.archive=new Ka,this.archive.open(e,t)}store(e){let t=this.settings.replacements&&this.settings.replacements!=="none",i=this.url,r=this.settings.requestMethod||ti.bind(this);return this.storage=new cs(e,r,this.resolve.bind(this)),this.request=this.storage.request.bind(this.storage),this.opened.then(()=>{this.archived&&(this.storage.requester=this.archive.request.bind(this.archive));let n=(s,a)=>{a.output=this.resources.substitute(s,a.url)};this.resources.settings.replacements=t||"blobUrl",this.resources.replacements().then(()=>this.resources.replaceCss()),this.storage.on("offline",()=>{this.url=new At("/",""),this.spine.hooks.serialize.register(n)}),this.storage.on("online",()=>{this.url=i,this.spine.hooks.serialize.deregister(n)})}),this.storage}coverUrl(){return this.loaded.cover.then(()=>this.cover?this.archived?this.archive.createUrl(this.cover):this.cover:null)}replacements(){return this.spine.hooks.serialize.register((e,t)=>{t.output=this.resources.substitute(e,t.url)}),this.resources.replacements().then(()=>this.resources.replaceCss())}getRange(e){var t=new Be(e),i=this.spine.get(t.spinePos),r=this.load.bind(this);return i?i.load(r).then(function(n){var s=t.toRange(i.document);return s}):new Promise((n,s)=>{s("CFI could not be found")})}key(e){var t=e||this.packaging.metadata.identifier||this.url.filename;return`epubjs:${_i}:${t}`}destroy(){this.opened=void 0,this.loading=void 0,this.loaded=void 0,this.ready=void 0,this.isOpen=!1,this.isRendered=!1,this.spine&&this.spine.destroy(),this.locations&&this.locations.destroy(),this.pageList&&this.pageList.destroy(),this.archive&&this.archive.destroy(),this.resources&&this.resources.destroy(),this.container&&this.container.destroy(),this.packaging&&this.packaging.destroy(),this.rendition&&this.rendition.destroy(),this.displayOptions&&this.displayOptions.destroy(),this.spine=void 0,this.locations=void 0,this.pageList=void 0,this.archive=void 0,this.resources=void 0,this.container=void 0,this.packaging=void 0,this.rendition=void 0,this.navigation=void 0,this.url=void 0,this.path=void 0,this.archived=!1}}St(Nr.prototype);function Bt(y,e){return new Nr(y,e)}Bt.VERSION=_i;typeof global<"u"&&(global.EPUBJS_VERSION=_i);Bt.Book=Nr;Bt.Rendition=kr;Bt.Contents=Sr;Bt.CFI=Be;Bt.utils=aa;var to=Object.defineProperty,io=(y,e,t)=>e in y?to(y,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):y[e]=t,Nt=(y,e,t)=>io(y,typeof e!="symbol"?e+"":e,t);const br={viewHolder:{position:"relative",height:"100%",width:"100%"},view:{height:"100%"}};class ro extends me.Component{constructor(e){super(e),Nt(this,"state",{isLoaded:!1,isError:!1,toc:[]}),Nt(this,"viewerRef",As.createRef()),Nt(this,"location"),Nt(this,"book"),Nt(this,"rendition"),Nt(this,"prevPage"),Nt(this,"nextPage"),Nt(this,"onLocationChange",t=>{const{location:i,locationChanged:r}=this.props,n=`${t.start}`;i!==n&&(this.location=n,r&&r(n))}),Nt(this,"handleKeyPress",t=>{this.props.handleKeyPress||(t.key==="ArrowRight"&&this.nextPage&&this.nextPage(),t.key==="ArrowLeft"&&this.prevPage&&this.prevPage())}),this.location=e.location,this.book=this.rendition=this.prevPage=this.nextPage=void 0}componentDidMount(){this.initBook(),document.addEventListener("keyup",this.handleKeyPress,!1)}initBook(){const{url:e,tocChanged:t,epubInitOptions:i}=this.props;this.book&&this.book.destroy(),this.book=Bt(e,i),this.book.on("openFailed",r=>{this.setState({isError:!0})}),this.book.loaded.navigation.then(({toc:r})=>{this.setState({isLoaded:!0,isError:!1,toc:r},()=>{t&&t(r),this.initReader()})})}componentWillUnmount(){this.book&&this.book.destroy(),this.book=this.rendition=this.prevPage=this.nextPage=void 0,document.removeEventListener("keyup",this.handleKeyPress,!1)}shouldComponentUpdate(e){return!this.state.isLoaded||e.location!==this.props.location||e.url!==this.props.url}componentDidUpdate(e){var t;e.location!==this.props.location&&this.location!==this.props.location&&((t=this.rendition)==null||t.display(this.props.location+"")),e.url!==this.props.url&&this.initBook()}initReader(){const{toc:e}=this.state,{location:t,epubOptions:i,getRendition:r}=this.props;if(this.viewerRef.current){const n=this.viewerRef.current;if(this.book){const s=this.book.renderTo(n,{width:"100%",height:"100%",...i});this.rendition=s,this.prevPage=()=>{s.prev()},this.nextPage=()=>{s.next()},this.registerEvents(),r&&r(s),typeof t=="string"||typeof t=="number"?s.display(t+""):e.length>0&&e[0].href?s.display(e[0].href):s.display()}}}registerEvents(){const{handleKeyPress:e,handleTextSelected:t}=this.props;this.rendition&&(this.rendition.on("locationChanged",this.onLocationChange),this.rendition.on("keyup",e||this.handleKeyPress),t&&this.rendition.on("selected",t))}renderBook(){const{epubViewStyles:e=br}=this.props;return we.jsx("div",{ref:this.viewerRef,style:e.view})}render(){const{isLoaded:e,isError:t}=this.state,{loadingView:i=null,errorView:r=null,epubViewStyles:n=br}=this.props;return we.jsxs("div",{style:n.viewHolder,children:[e&&this.renderBook(),!e&&!t&&i,!e&&t&&r]})}}async function no(){const{data:y}=await yi.get("/reader/settings/");return y}async function so(y){const{data:e}=await yi.patch("/reader/settings/",y);return e}async function ao(y){const{data:e}=await yi.get(`/books/ebooks/${y}/progress/`);return{id:y,book:y,current_chapter:e.last_page||1,current_position:e.current_position??0,percentage:e.current_position??0,epub_location:e.epub_location??"",updated_at:e.updated_at??""}}async function oo(y,e){return ds(y,{epub_location:e,current_position:0,percentage:0,current_chapter:0})}async function ds(y,e){const{data:t}=await yi.patch(`/books/ebooks/${y}/progress/`,{current_position:e.percentage??e.current_position??0,last_page:e.current_chapter??0,epub_location:e.epub_location??""});return{id:y,book:y,current_chapter:t.last_page||1,current_position:t.current_position??0,percentage:t.current_position??0,epub_location:t.epub_location??"",updated_at:t.updated_at??""}}const Ln={serif:'Georgia, "Times New Roman", serif',"sans-serif":'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',monospace:'ui-monospace, "Cascadia Code", monospace'},Bn="cloud-reader";function Vt(y){return typeof y=="string"&&y.startsWith("epubcfi(")}function uo(y,e){const t=e.indexOf("#"),i=t>=0?e.slice(t):"",r=t>=0?e.slice(0,t):e,n=[e,r];try{n.push(decodeURIComponent(r),encodeURI(r))}catch{}for(const u of n)if(y.spine.get(u))return u.includes("#")?u:u+i;const s=r.replace(/^\/+/,""),a=s.split("/").pop()??s;for(const u of y.spine.spineItems??[]){const h=u.href.replace(/^\/+/,""),d=h.split("/").pop()??h;if(h===s||h.endsWith(s)||s.endsWith(h)||d===a)return u.href+i}return e}function ps(y){return y*2}function lo(y,e){var r,n,s;const t=ps(e),i=y;i.settings&&(i.settings.gap=t),(r=i.manager)!=null&&r.settings&&(i.manager.settings.gap=t),(s=(n=i.manager)==null?void 0:n.isRendered)!=null&&s.call(n)&&i.manager.updateLayout&&i.manager.updateLayout()}function Pn(y,e){const t=Ln[e.font_family]??Ln.serif;lo(y,e.margin_width),y.themes.register(Bn,{body:{color:`${e.text_color} !important`,background:`${e.background_color} !important`,"font-family":`${t} !important`,"line-height":`${e.line_height} !important`}}),y.themes.select(Bn),y.themes.fontSize(`${e.font_size}px`)}async function Fn(y){var e;try{const t=await y.currentLocation(),i=(e=t==null?void 0:t.start)==null?void 0:e.href;if(i&&y.book.navigation){const r=y.book.navigation.get(i);if(r!=null&&r.label)return r.label}}catch{}return""}function ho(y,e,t){const[i,r]=me.useState(null),[n,s]=me.useState(0),[a,u]=me.useState(""),[h,d]=me.useState(null),[c,w]=me.useState(!0),[m,N]=me.useState(null),E=me.useRef(null),f=me.useRef(null),v=me.useRef(null),g=me.useRef(!1),D={flow:"paginated",manager:"default",spread:"none",width:"100%",height:"100%",gap:ps(e)};me.useEffect(()=>{let Y=null,X=!1;g.current=!1;async function ie(){w(!0),N(null);try{const[K,$]=await Promise.all([ao(y).catch(()=>null),jn.getEpubFile(y)]);if(X)return;Y=URL.createObjectURL($),r(Y),t&&Vt(t)?s(t):K!=null&&K.epub_location?(d(K),s(K.epub_location)):K&&d(K)}catch(K){X||N(K instanceof Error?K.message:"Failed to load EPUB")}finally{X||w(!1)}}return ie(),()=>{X=!0,Y&&URL.revokeObjectURL(Y),v.current&&clearTimeout(v.current)}},[y,t]);const L=me.useCallback(async(Y,X)=>{try{const ie=await ds(y,{epub_location:Y,percentage:X,current_position:X});d(ie)}catch{}},[y]),b=me.useCallback(async Y=>{try{const X=await oo(y,Y);d(X)}catch{}},[y]),S=me.useCallback(Y=>{var K;if(s(Y),!Vt(Y))return;const X=E.current;let ie=0;if((K=X==null?void 0:X.book)!=null&&K.locations){const $=X.book.locations.percentageFromCfi(Y);$!=null&&(ie=Math.round($*100))}if(X&&Fn(X).then($=>{$&&u($)}),!g.current&&ie<=0){g.current=!0,b(Y);return}v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{L(Y,ie)},3e3)},[b,L]),R=me.useCallback(Y=>{Vt(Y)&&s(Y)},[]),I=me.useCallback(Y=>{const X=E.current;if(!X){s(Y);return}X.book.ready.then(()=>{const ie=uo(X.book,Y);return s(ie),X.display(ie)})},[]),k=me.useCallback(()=>{var $,ae;const Y=E.current;if(!Y||g.current)return;const X=($=Y.location)==null?void 0:$.start,ie=X==null?void 0:X.cfi;if(!ie||!Vt(ie))return;let K=0;if((ae=Y.book)!=null&&ae.locations){const pe=Y.book.locations.percentageFromCfi(ie);pe!=null&&(K=Math.round(pe*100))}K<=0&&(g.current=!0,b(ie))},[b]),O=me.useCallback(Y=>{var K,$,ae;const X=Y;E.current=Y;const ie=()=>{const pe=document.querySelector(".reader-epub-container");pe&&"resize"in Y&&Y.resize(pe.clientWidth,pe.clientHeight)};return(ae=($=(K=X.hooks)==null?void 0:K.content)==null?void 0:$.register)==null||ae.call($,pe=>{var ne;(ne=pe.document)!=null&&ne.body&&(pe.document.body.style.userSelect="text",pe.document.body.style.webkitUserSelect="text")}),X.book.ready.then(()=>X.book.locations.generate(1600)).then(ie).then(()=>Fn(X)).then(pe=>{pe&&u(pe)}).then(()=>k()),window.addEventListener("resize",ie),f.current&&Pn(Y,f.current),()=>window.removeEventListener("resize",ie)},[k]),G=me.useCallback(Y=>{f.current=Y,E.current&&Pn(E.current,Y)},[]),j=me.useCallback(()=>{var Y;(Y=E.current)==null||Y.next()},[]),Z=me.useCallback(()=>{var Y;(Y=E.current)==null||Y.prev()},[]);return{epubUrl:i,location:n,chapterTitle:a,progress:h,isLoading:c,error:m,handleLocationChanged:S,handleGetRendition:O,navigateToHref:I,jumpToCfi:R,goToNextPage:j,goToPrevPage:Z,applySettings:G,epubOptions:D,renditionRef:E}}function zn(y,e){var u,h,d,c,w,m,N,E,f,v,g,D,L,b,S;const t=((w=(c=(d=(h=(u=y.window)==null?void 0:u.getSelection)==null?void 0:h.call(u))==null?void 0:d.toString)==null?void 0:c.call(d))==null?void 0:w.trim())??((v=(f=(E=(N=(m=y.document)==null?void 0:m.getSelection)==null?void 0:N.call(m))==null?void 0:E.toString)==null?void 0:f.call(E))==null?void 0:v.trim())??"";if(!t)return null;const i=y.document.getSelection();if(!i||i.rangeCount===0)return null;const r=i.getRangeAt(0);let n="";try{n=((g=y.cfiFromRange)==null?void 0:g.call(y,r))??""}catch{n=""}if(!n||!Vt(n)){const R=(L=(D=e.location)==null?void 0:D.start)==null?void 0:L.cfi;if(R&&Vt(R))n=R;else return null}const s=r.getBoundingClientRect(),a=((S=(b=e.location)==null?void 0:b.start)==null?void 0:S.index)??0;return{epubCfi:n,locationText:t.slice(0,2e3),chapterIndex:typeof a=="number"?a:0,chapterTitle:"",anchorTop:s.bottom+8,anchorLeft:Math.min(s.left,window.innerWidth-280)}}function fo(y,e,t){const[i,r]=me.useState(null),n=me.useRef(e);n.current=e;const s=me.useCallback(()=>{r(null)},[]);return me.useEffect(()=>{var d,c,w;const a=y.current;if(!a)return;const u=m=>{if(!m){r(null);return}r({...m,chapterTitle:n.current})},h=(m,N)=>{u(zn(N,a))};return a.on&&a.on("selected",h),(w=(c=(d=a.hooks)==null?void 0:d.content)==null?void 0:c.register)==null||w.call(c,m=>{const N=()=>{window.setTimeout(()=>{u(zn(m,a))},10)};m.document.addEventListener("mouseup",N)}),()=>{var m;(m=a.off)==null||m.call(a,"selected",h)}},[y,t]),{pendingSelection:i,clearSelection:s}}const Mn={sepia:{background_color:"#f5f0eb",text_color:"#1a1a1a"},dark:{background_color:"#1a1a2e",text_color:"#e0e0e0"},light:{background_color:"#ffffff",text_color:"#1a1a1a"},paper:{background_color:"#e8e0d4",text_color:"#2c2c2c"}},Un={font_family:"serif",font_size:18,line_height:1.6,margin_width:16,background_color:"#f5f0eb",text_color:"#1a1a1a",brightness:100,orientation_lock:"auto",theme:"sepia",created_at:"",updated_at:""},co=600;function oi(y){const e=document.documentElement;e.style.setProperty("--reader-bg",y.background_color),e.style.setProperty("--reader-text",y.text_color),e.style.setProperty("--reader-margin",`${y.margin_width}px`),e.style.setProperty("--reader-brightness",`${y.brightness}%`)}function po(y,e){const t={...y,...e};return e.theme&&Mn[e.theme]&&Object.assign(t,Mn[e.theme]),t}function vo(){const[y,e]=me.useState(Un),[t,i]=me.useState(!0),[r,n]=me.useState(null),s=me.useRef({}),a=me.useRef(null),u=me.useRef(!1),h=me.useCallback(async()=>{const m={...s.current};if(s.current={},!(Object.keys(m).length===0||u.current)){u.current=!0;try{const N=await so(m);e(N),oi(N),n(null)}catch(N){n(N instanceof Error?N.message:"Failed to update reading settings")}finally{u.current=!1}}},[]),d=me.useCallback((m,N)=>{if(Object.assign(s.current,m),a.current&&clearTimeout(a.current),N){h();return}a.current=setTimeout(()=>{h()},co)},[h]);me.useEffect(()=>{let m=!1;return i(!0),no().then(N=>{m||(e(N),oi(N))}).catch(N=>{m||(n(N instanceof Error?N.message:"Failed to load reading settings"),oi(Un))}).finally(()=>{m||i(!1)}),()=>{m=!0,a.current&&clearTimeout(a.current)}},[]);const c=me.useCallback((m,N="debounced")=>{e(E=>{const f=po(E,m);return oi(f),f}),d(m,N==="immediate")},[d]),w=me.useCallback(async()=>{a.current&&clearTimeout(a.current),await h()},[h]);return{settings:y,isLoading:t,error:r,updateSettings:c,flushSettings:w}}function go({ebookId:y,selection:e,onClose:t,onSaved:i}){const{t:r}=wr(),{addMarker:n}=qn(),{showToast:s}=Ds(),[a,u]=me.useState(""),[h,d]=me.useState(!1),c=async()=>{d(!0);try{await n({ebook:y,epub_cfi:e.epubCfi,chapter_index:e.chapterIndex,chapter_title:e.chapterTitle,location_text:e.locationText,content:a.trim()}),s({message:a.trim()?r("annotations.markerSavedWithNote"):r("annotations.markerSaved"),variant:"success"}),i(),t()}catch(w){s({message:ks(w,r("annotations.saveFailed")),variant:"error"})}finally{d(!1)}};return we.jsxs(we.Fragment,{children:[we.jsx("div",{className:"selection-popover-backdrop",onClick:t,"aria-hidden":!0}),we.jsxs("div",{className:"selection-popover",style:{top:e.anchorTop,left:e.anchorLeft},role:"dialog","aria-label":r("annotations.saveMarker"),children:[we.jsxs("p",{className:"selection-popover-quote",children:["“",e.locationText.length>120?`${e.locationText.slice(0,120)}…`:e.locationText,"”"]}),we.jsx("textarea",{className:"selection-popover-input",value:a,onChange:w=>u(w.target.value),placeholder:r("annotations.thoughtPlaceholder"),rows:3,autoFocus:!0}),we.jsxs("div",{className:"selection-popover-actions",children:[we.jsx("button",{type:"button",className:"btn btn-sm",onClick:c,disabled:h,children:r(h?"common.saving":"annotations.saveMarker")}),we.jsx("button",{type:"button",className:"btn btn-sm btn-secondary",onClick:t,disabled:h,children:r("common.cancel")})]})]})]})}function mo({ebookId:y,isOpen:e,onClose:t,onGoToPassage:i}){const{t:r}=wr(),{markers:n,loadBookmarks:s,removeBookmark:a,state:u}=qn();return me.useEffect(()=>{e&&s(y)},[e,y,s]),e?we.jsxs(we.Fragment,{children:[we.jsx("div",{className:"reader-panel-backdrop",onClick:t,"aria-hidden":!0}),we.jsxs("aside",{className:"reader-side-panel reader-markers-panel",role:"dialog","aria-label":r("annotations.inBookPanel"),children:[we.jsxs("header",{className:"reader-panel-header",children:[we.jsx("h2",{children:r("annotations.inBookPanel")}),we.jsx("button",{type:"button",className:"reader-panel-close",onClick:t,"aria-label":r("annotations.close"),children:"×"})]}),we.jsx("div",{className:"reader-panel-body",children:u.bookmarksLoading?we.jsx("p",{className:"annotations-loading",children:r("annotations.loading")}):n.length===0?we.jsx("p",{className:"annotations-empty",children:r("annotations.selectTextHint")}):we.jsx("ul",{className:"marker-thread-list",children:n.map(h=>we.jsxs("li",{className:"marker-thread",children:[h.chapter_title&&we.jsx("span",{className:"marker-thread-chapter",children:h.chapter_title}),h.location_text&&we.jsxs("blockquote",{className:"annotation-quote",children:["“",h.location_text,"”"]}),h.content?we.jsx("p",{className:"marker-thread-thought",children:h.content}):we.jsx("span",{className:"annotation-kind-badge bookmark-badge",children:r("annotations.bookmarkOnly")}),we.jsxs("div",{className:"annotation-actions",children:[we.jsx("button",{type:"button",className:"btn btn-sm",onClick:()=>i(h),children:r("annotations.goToPassage")}),we.jsx("button",{type:"button",className:"btn btn-sm btn-danger",onClick:()=>a(h.id),children:r("common.delete")})]})]},h.id))})})]})]}):null}const yo=me.lazy(()=>_r(()=>import("./ReaderToolbar-wmOf7G3U.js"),__vite__mapDeps([0,1,2]))),bo=me.lazy(()=>_r(()=>import("./TableOfContents-BqoUCglr.js"),__vite__mapDeps([3,1,2]))),wo=me.lazy(()=>_r(()=>import("./ReadingSettingsPanel-Bt3-VHc7.js"),__vite__mapDeps([4,1,2])));function Do(){var ke;const{t:y}=wr(),{id:e}=Cs(),t=Ss(),i=Ts(),r=Number(e),n=(ke=i.state)==null?void 0:ke.epubLocation,[s,a]=me.useState(null),[u,h]=me.useState(!0),[d,c]=me.useState(null),[w,m]=me.useState(!1),[N,E]=me.useState(!1),[f,v]=me.useState(!1),[g,D]=me.useState([]),[L,b]=me.useState(0),{settings:S,updateSettings:R,flushSettings:I}=vo(),{epubUrl:k,location:O,chapterTitle:G,progress:j,isLoading:Z,error:Y,handleLocationChanged:X,handleGetRendition:ie,navigateToHref:K,jumpToCfi:$,goToNextPage:ae,goToPrevPage:pe,applySettings:ne,epubOptions:ce,renditionRef:Ce}=ho(r,S.margin_width,n),{pendingSelection:ye,clearSelection:Te}=fo(Ce,G,L);me.useEffect(()=>{!r||Number.isNaN(r)||(h(!0),c(null),jn.getEBook(r).then(ve=>{if(ve.format!=="epub"){c(y("reader.epubOnly")),a(null);return}a(ve)}).catch(()=>c(y("reader.loadBookFailed"))).finally(()=>h(!1)))},[r,y]),me.useEffect(()=>{ne(S)},[S,ne]),me.useEffect(()=>{const ve=document.documentElement;S.orientation_lock!=="auto"?ve.style.setProperty("--reader-orientation",S.orientation_lock==="portrait"?"portrait":"landscape"):ve.style.removeProperty("--reader-orientation")},[S.orientation_lock]);const We=me.useCallback(ve=>{D(ve)},[]),Fe=me.useCallback(ve=>{K(ve)},[K]),be=me.useCallback(ve=>{ie(ve),b(Ie=>Ie+1)},[ie]),Pe=me.useCallback(ve=>{$(ve.epub_cfi),v(!1)},[$]),Ue=u||Z,xe=d??Y;return Ue?we.jsxs("div",{className:"reader-loading",children:[we.jsx("div",{className:"spinner"}),we.jsx("p",{children:y("reader.loading")})]}):xe||!k?we.jsxs("div",{className:"reader-loading",children:[we.jsx("p",{className:"reader-error",children:xe??y("reader.unableToOpen")}),we.jsx("button",{type:"button",className:"back-button",onClick:()=>t("/"),children:y("reader.backToLibrary")})]}):we.jsx(me.Suspense,{fallback:we.jsx("div",{className:"reader-loading",children:we.jsx("div",{className:"spinner"})}),children:we.jsxs("div",{className:"reader-container","data-theme":S.theme,children:[we.jsx(yo,{bookTitle:(s==null?void 0:s.title)??y("reader.reading"),chapterTitle:G||y("reader.reading"),progress:j,onBack:()=>t("/"),onToggleToc:()=>m(ve=>!ve),onToggleSettings:()=>E(ve=>!ve),onToggleMarkers:()=>v(ve=>!ve)}),we.jsx(bo,{items:g,isOpen:w,onClose:()=>m(!1),onNavigate:Fe}),we.jsx(mo,{ebookId:r,isOpen:f,onClose:()=>v(!1),onGoToPassage:Pe}),we.jsx(wo,{settings:S,isOpen:N,onClose:()=>E(!1),onUpdate:R,onFlush:I}),ye&&we.jsx(go,{ebookId:r,selection:ye,onClose:Te,onSaved:Te}),we.jsxs("main",{className:"reader-epub-container",children:[we.jsx(ro,{url:k,location:O,locationChanged:X,tocChanged:We,getRendition:ve=>be(ve),epubInitOptions:{openAs:"epub"},epubOptions:ce,epubViewStyles:br,loadingView:we.jsx("div",{className:"reader-loading",children:we.jsx("div",{className:"spinner"})})}),we.jsx("button",{type:"button",className:"reader-page-nav reader-page-nav--prev",onClick:pe,"aria-label":y("reader.prevPage"),children:""}),we.jsx("button",{type:"button",className:"reader-page-nav reader-page-nav--next",onClick:ae,"aria-label":y("reader.nextPage"),children:""})]})]})})}export{Do as default};