@file-viewer/assets-design 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +160 -0
- package/README.en.md +3 -0
- package/README.md +3 -0
- package/bin/install.mjs +7 -0
- package/file-viewer.asset-pack.json +7 -0
- package/package.json +46 -0
- package/viewer/file-viewer-asset-pack.json +612 -0
- package/viewer/vendor/design/LICENSE.Carlito-OFL-1.1.txt +94 -0
- package/viewer/vendor/design/LICENSE.Cousine-OFL-1.1.txt +93 -0
- package/viewer/vendor/design/LICENSE.NotoSansSymbols2-OFL-1.1.txt +93 -0
- package/viewer/vendor/design/LICENSE.Tinos-OFL-1.1.txt +93 -0
- package/viewer/vendor/design/LICENSE.ag-psd-MIT.txt +24 -0
- package/viewer/vendor/design/LICENSE.base64-js-MIT.txt +21 -0
- package/viewer/vendor/design/LICENSE.fzstd-MIT.txt +21 -0
- package/viewer/vendor/design/LICENSE.illustrator-pgf-MIT.txt +9 -0
- package/viewer/vendor/design/LICENSE.introspect-wasm-MPL-2.0.txt +373 -0
- package/viewer/vendor/design/LICENSE.pako-MIT.txt +21 -0
- package/viewer/vendor/design/LICENSE.saxes-ISC.txt +57 -0
- package/viewer/vendor/design/LICENSE.stet-Apache-2.0.txt +190 -0
- package/viewer/vendor/design/LICENSE.stet-MIT.txt +21 -0
- package/viewer/vendor/design/LICENSE.webtoon-psd-MIT.txt +19 -0
- package/viewer/vendor/design/LICENSE.xmlchars-MIT.txt +18 -0
- package/viewer/vendor/design/LICENSE.xmldom-MIT.txt +8 -0
- package/viewer/vendor/design/THIRD_PARTY_NOTICES.md +91 -0
- package/viewer/vendor/design/adobe-container.worker.js +44 -0
- package/viewer/vendor/design/adobe-resource.worker.js +11 -0
- package/viewer/vendor/design/idml.worker.js +38 -0
- package/viewer/vendor/design/illustrator-pgf.worker.js +2 -0
- package/viewer/vendor/design/paged_introspect_wasm_bg.wasm +0 -0
- package/viewer/vendor/design/photoshop.worker.js +11 -0
- package/viewer/vendor/design/postscript.worker.js +1 -0
- package/viewer/vendor/design/stet_wasm_bg.wasm +0 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
var qa=Object.create;var wi=Object.defineProperty;var Ga=Object.getOwnPropertyDescriptor;var Ha=Object.getOwnPropertyNames;var Va=Object.getPrototypeOf,Za=Object.prototype.hasOwnProperty;var Fe=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}};var ja=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ha(t))!Za.call(e,i)&&i!==r&&wi(e,i,{get:()=>t[i],enumerable:!(n=Ga(t,i))||n.enumerable});return e};var En=(e,t,r)=>(r=e!=null?qa(Va(e)):{},ja(t||!e||!e.__esModule?wi(r,"default",{value:e,enumerable:!0}):r,e));var pt=Fe(oe=>{"use strict";function ro(e,t,r){if(r===void 0&&(r=Array.prototype),e&&typeof r.find=="function")return r.find.call(e,t);for(var n=0;n<e.length;n++)if(ft(e,n)){var i=e[n];if(t.call(void 0,i,n,e))return i}}function Ct(e,t){return t===void 0&&(t=Object),t&&typeof t.getOwnPropertyDescriptors=="function"&&(e=t.create(null,t.getOwnPropertyDescriptors(e))),t&&typeof t.freeze=="function"?t.freeze(e):e}function ft(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function no(e,t){if(e===null||typeof e!="object")throw new TypeError("target is not an object");for(var r in t)ft(t,r)&&(e[r]=t[r]);return e}var Si=Ct({allowfullscreen:!0,async:!0,autofocus:!0,autoplay:!0,checked:!0,controls:!0,default:!0,defer:!0,disabled:!0,formnovalidate:!0,hidden:!0,ismap:!0,itemscope:!0,loop:!0,multiple:!0,muted:!0,nomodule:!0,novalidate:!0,open:!0,playsinline:!0,readonly:!0,required:!0,reversed:!0,selected:!0});function io(e){return ft(Si,e.toLowerCase())}var Ii=Ct({area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function so(e){return ft(Ii,e.toLowerCase())}var Qt=Ct({script:!1,style:!1,textarea:!0,title:!0});function ao(e){var t=e.toLowerCase();return ft(Qt,t)&&!Qt[t]}function oo(e){var t=e.toLowerCase();return ft(Qt,t)&&Qt[t]}function _i(e){return e===Kt.HTML}function uo(e){return _i(e)||e===Kt.XML_XHTML_APPLICATION}var Kt=Ct({HTML:"text/html",XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),lo=Object.keys(Kt).map(function(e){return Kt[e]});function co(e){return lo.indexOf(e)>-1}var mo=Ct({HTML:"http://www.w3.org/1999/xhtml",SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});oe.assign=no;oe.find=ro;oe.freeze=Ct;oe.HTML_BOOLEAN_ATTRIBUTES=Si;oe.HTML_RAW_TEXT_ELEMENTS=Qt;oe.HTML_VOID_ELEMENTS=Ii;oe.hasDefaultHTMLNamespace=uo;oe.hasOwn=ft;oe.isHTMLBooleanAttribute=io;oe.isHTMLRawTextElement=ao;oe.isHTMLEscapableRawTextElement=oo;oe.isHTMLMimeType=_i;oe.isHTMLVoidElement=so;oe.isValidMimeType=co;oe.MIME_TYPE=Kt;oe.NAMESPACE=mo});var ir=Fe(nr=>{"use strict";var ho=pt();function Li(e,t){e.prototype=Object.create(Error.prototype,{constructor:{value:e},name:{value:e.name,enumerable:!0,writable:t}})}var tr=ho.freeze({Error:"Error",IndexSizeError:"IndexSizeError",DomstringSizeError:"DomstringSizeError",HierarchyRequestError:"HierarchyRequestError",WrongDocumentError:"WrongDocumentError",InvalidCharacterError:"InvalidCharacterError",NoDataAllowedError:"NoDataAllowedError",NoModificationAllowedError:"NoModificationAllowedError",NotFoundError:"NotFoundError",NotSupportedError:"NotSupportedError",InUseAttributeError:"InUseAttributeError",InvalidStateError:"InvalidStateError",SyntaxError:"SyntaxError",InvalidModificationError:"InvalidModificationError",NamespaceError:"NamespaceError",InvalidAccessError:"InvalidAccessError",ValidationError:"ValidationError",TypeMismatchError:"TypeMismatchError",SecurityError:"SecurityError",NetworkError:"NetworkError",AbortError:"AbortError",URLMismatchError:"URLMismatchError",QuotaExceededError:"QuotaExceededError",TimeoutError:"TimeoutError",InvalidNodeTypeError:"InvalidNodeTypeError",DataCloneError:"DataCloneError",EncodingError:"EncodingError",NotReadableError:"NotReadableError",UnknownError:"UnknownError",ConstraintError:"ConstraintError",DataError:"DataError",TransactionInactiveError:"TransactionInactiveError",ReadOnlyError:"ReadOnlyError",VersionError:"VersionError",OperationError:"OperationError",NotAllowedError:"NotAllowedError",OptOutError:"OptOutError"}),Bi=Object.keys(tr);function Ri(e){return typeof e=="number"&&e>=1&&e<=25}function fo(e){return typeof e=="string"&&e.substring(e.length-tr.Error.length)===tr.Error}function rr(e,t){Ri(e)?(this.name=Bi[e],this.message=t||""):(this.message=e,this.name=fo(t)?t:tr.Error),Error.captureStackTrace&&Error.captureStackTrace(this,rr)}Li(rr,!0);Object.defineProperties(rr.prototype,{code:{enumerable:!0,get:function(){var e=Bi.indexOf(this.name);return Ri(e)?e:0}}});var Pi={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25},Dn=Object.entries(Pi);for(er=0;er<Dn.length;er++)Fi=Dn[er][0],rr[Fi]=Dn[er][1];var Fi,er;function An(e,t,r){this.message=e,this.locator=t,this.cause=r,Error.captureStackTrace&&Error.captureStackTrace(this,An)}Li(An);nr.DOMException=rr;nr.DOMExceptionName=tr;nr.ExceptionCode=Pi;nr.ParseError=An});var vn=Fe(v=>{"use strict";function $i(e){try{typeof e!="function"&&(e=RegExp);var t=new e("\u{1D306}","u").exec("\u{1D306}");return!!t&&t[0].length===2}catch{}return!1}var Nt=$i();function it(e){if(e.source[0]!=="[")throw new Error(e+" can not be used with chars");return e.source.slice(1,e.source.lastIndexOf("]"))}function wt(e,t){if(e.source[0]!=="[")throw new Error("/"+e.source+"/ can not be used with chars_without");if(!t||typeof t!="string")throw new Error(JSON.stringify(t)+" is not a valid search");if(e.source.indexOf(t)===-1)throw new Error('"'+t+'" is not is /'+e.source+"/");if(t==="-"&&e.source.indexOf(t)!==1)throw new Error('"'+t+'" is not at the first postion of /'+e.source+"/");return new RegExp(e.source.replace(t,""),Nt?"u":"")}function _(e){var t=this;return new RegExp(Array.prototype.slice.call(arguments).map(function(r){var n=typeof r=="string";if(n&&t===void 0&&r==="|")throw new Error("use regg instead of reg to wrap expressions with `|`!");return n?r:r.source}).join(""),Nt?"u":"")}function N(e){if(arguments.length===0)throw new Error("no parameters provided");return _.apply(N,["(?:"].concat(Array.prototype.slice.call(arguments),[")"]))}var po="\uFFFD",st=/[-\x09\x0A\x0D\x20-\x2C\x2E-\uD7FF\uE000-\uFFFD]/;Nt&&(st=_("[",it(st),"\\u{10000}-\\u{10FFFF}","]"));var go=new RegExp("[^"+it(st)+"]",Nt?"u":""),Ir=/[\x20\x09\x0D\x0A]/,Eo=it(Ir),q=_(Ir,"+"),W=_(Ir,"*"),sr=/[:_a-zA-Z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;Nt&&(sr=_("[",it(sr),"\\u{10000}-\\u{10FFFF}","]"));var xo=it(sr),Cn=_("[",xo,it(/[-.0-9\xB7]/),it(/[\u0300-\u036F\u203F-\u2040]/),"]"),Ne=_(sr,Cn,"*"),Do=_("^",Ne,"$"),Mi=_(Cn,"+"),Ao=_("&",Ne,";"),yo=N(/&#[0-9]+;|&#x[0-9a-fA-F]+;/),ar=N(Ao,"|",yo),or=_("%",Ne,";"),wn=N(_('"',N(/[^%&"]/,"|",or,"|",ar),"*",'"'),"|",_("'",N(/[^%&']/,"|",or,"|",ar),"*","'")),bo=N('"',N(/[^<&"]/,"|",ar),"*",'"',"|","'",N(/[^<&']/,"|",ar),"*","'"),Co=wt(sr,":"),wo=wt(Cn,":"),yn=_(Co,wo,"*"),To=_("^",yn,"$"),ur=_(yn,N(":",yn),"?"),No=_("^",ur,"$"),vo=_("(",ur,")"),Tt=N(/"[^"]*"|'[^']*'/),So=_(/^<\?/,"(",Ne,")",N(q,"(?!",Ir,")(",st,"*?)"),"?",/\?>/),Oi=/[\x20\x0D\x0Aa-zA-Z0-9-'()+,./:=?;!*#@$_%]/,lr=N('"',Oi,'*"',"|","'",wt(Oi,"'"),"*'"),qi="<!--",Gi="-->",Io=_(qi,N(wt(st,"-"),"|",_("-",wt(st,"-"))),"*",Gi),Xi="#PCDATA",_o=N(_(/\(/,W,Xi,N(W,/\|/,W,ur),"*",W,/\)\*/),"|",_(/\(/,W,Xi,W,/\)/)),Fo=/[?*+]?/,Lo=_(/\([^>]+\)/,Fo),Bo=N("EMPTY","|","ANY","|",_o,"|",Lo),Ro="<!ELEMENT",Po=_(Ro,q,N(ur,"|",or),q,N(Bo,"|",or),W,">"),Mo=_("NOTATION",q,/\(/,W,Ne,N(W,/\|/,W,Ne),"*",W,/\)/),Oo=_(/\(/,W,Mi,N(W,/\|/,W,Mi),"*",W,/\)/),Xo=N(Mo,"|",Oo),ko=N(/CDATA|ID|IDREF|IDREFS|ENTITY|ENTITIES|NMTOKEN|NMTOKENS/,"|",Xo),Uo=N(/#REQUIRED|#IMPLIED/,"|",N(N("#FIXED",q),"?",bo)),$o=N(q,Ne,q,ko,q,Uo),qo="<!ATTLIST",Go=_(qo,q,Ne,$o,"*",W,">"),bn="about:legacy-compat",Ho=N('"'+bn+'"',"|","'"+bn+"'"),Tn="SYSTEM",_r="PUBLIC",Fr=N(N(Tn,q,Tt),"|",N(_r,q,lr,q,Tt)),Vo=_("^",N(N(Tn,q,"(?<SystemLiteralOnly>",Tt,")"),"|",N(_r,q,"(?<PubidLiteral>",lr,")",q,"(?<SystemLiteral>",Tt,")"))),Zo=_("^",lr,"$"),jo=_("^",Tt,"$"),zo=N(q,"NDATA",q,Ne),Yo=N(wn,"|",N(Fr,zo,"?")),Hi="<!ENTITY",Wo=_(Hi,q,Ne,q,Yo,W,">"),Jo=N(wn,"|",Fr),Qo=_(Hi,q,"%",q,Ne,q,Jo,W,">"),Ko=N(Wo,"|",Qo),eu=_(_r,q,lr),tu=_("<!NOTATION",q,Ne,q,N(Fr,"|",eu),W,">"),Nn=_(W,"=",W),ki=/1[.]\d+/,ru=_(q,"version",Nn,N("'",ki,"'","|",'"',ki,'"')),Ui=/[A-Za-z][-A-Za-z0-9._]*/,nu=N(q,"encoding",Nn,N('"',Ui,'"',"|","'",Ui,"'")),iu=N(q,"standalone",Nn,N("'",N("yes","|","no"),"'","|",'"',N("yes","|","no"),'"')),su=_(/^<\?xml/,ru,nu,"?",iu,"?",W,/\?>/),au="<!DOCTYPE",ou="<![CDATA[",uu="]]>",lu=/<!\[CDATA\[/,cu=/\]\]>/,mu=_(st,"*?",cu),du=_(lu,mu);v.chars=it;v.chars_without=wt;v.detectUnicodeSupport=$i;v.reg=_;v.regg=N;v.ABOUT_LEGACY_COMPAT=bn;v.ABOUT_LEGACY_COMPAT_SystemLiteral=Ho;v.AttlistDecl=Go;v.CDATA_START=ou;v.CDATA_END=uu;v.CDSect=du;v.Char=st;v.Comment=Io;v.COMMENT_START=qi;v.COMMENT_END=Gi;v.DOCTYPE_DECL_START=au;v.elementdecl=Po;v.EntityDecl=Ko;v.EntityValue=wn;v.ExternalID=Fr;v.ExternalID_match=Vo;v.Name=Ne;v.Name_exact=Do;v.NCName_exact=To;v.NotationDecl=tu;v.Reference=ar;v.PEReference=or;v.PI=So;v.PUBLIC=_r;v.PubidLiteral=lr;v.PubidLiteral_match=Zo;v.QName=ur;v.QName_exact=No;v.QName_group=vo;v.S=q;v.SChar_s=Eo;v.S_OPT=W;v.SYSTEM=Tn;v.SystemLiteral=Tt;v.SystemLiteral_match=jo;v.InvalidChar=go;v.UNICODE_REPLACEMENT_CHARACTER=po;v.UNICODE_SUPPORT=Nt;v.XMLDecl=su});var On=Fe(K=>{"use strict";var Be=pt(),qe=Be.find,hu=Be.hasDefaultHTMLNamespace,St=Be.hasOwn,fu=Be.isHTMLMimeType,pu=Be.isHTMLRawTextElement,gu=Be.isHTMLVoidElement,cr=Be.MIME_TYPE,Ge=Be.NAMESPACE,de=Symbol(),Ji=ir(),D=Ji.DOMException,ce=Ji.DOMExceptionName,Q=vn();function ge(e){if(e!==de)throw new TypeError("Illegal constructor")}function Eu(e){return e!==""}function xu(e){return e?e.split(/[\t\n\f\r ]+/).filter(Eu):[]}function Du(e,t){return St(e,t)||(e[t]=!0),e}function Vi(e){if(!e)return[];var t=xu(e);return Object.keys(t.reduce(Du,{}))}function Au(e){return function(t){return e&&e.indexOf(t)!==-1}}function Qi(e){if(!Q.QName_exact.test(e))throw new D(D.INVALID_CHARACTER_ERR,'invalid character in qualified name "'+e+'"')}function In(e,t){Qi(t),e=e||null;var r=null,n=t;if(t.indexOf(":")>=0){var i=t.split(":");r=i[0],n=i[1]}if(r!==null&&e===null)throw new D(D.NAMESPACE_ERR,"prefix is non-null and namespace is null");if(r==="xml"&&e!==Be.NAMESPACE.XML)throw new D(D.NAMESPACE_ERR,'prefix is "xml" and namespace is not the XML namespace');if((r==="xmlns"||t==="xmlns")&&e!==Be.NAMESPACE.XMLNS)throw new D(D.NAMESPACE_ERR,'either qualifiedName or prefix is "xmlns" and namespace is not the XMLNS namespace');if(e===Be.NAMESPACE.XMLNS&&r!=="xmlns"&&t!=="xmlns")throw new D(D.NAMESPACE_ERR,'namespace is the XMLNS namespace and neither qualifiedName nor prefix is "xmlns"');return[e,r,n]}function Ft(e,t){for(var r in e)St(e,r)&&(t[r]=e[r])}function Ee(e,t){var r=e.prototype;if(!(r instanceof t)){let n=function(){};n.prototype=t.prototype,n=new n,Ft(r,n),e.prototype=r=n}r.constructor!=e&&(typeof e!="function"&&console.error("unknown Class:"+e),r.constructor=e)}var xe={},Le=xe.ELEMENT_NODE=1,It=xe.ATTRIBUTE_NODE=2,mr=xe.TEXT_NODE=3,Ki=xe.CDATA_SECTION_NODE=4,es=xe.ENTITY_REFERENCE_NODE=5,yu=xe.ENTITY_NODE=6,_n=xe.PROCESSING_INSTRUCTION_NODE=7,Fn=xe.COMMENT_NODE=8,vt=xe.DOCUMENT_NODE=9,ts=xe.DOCUMENT_TYPE_NODE=10,at=xe.DOCUMENT_FRAGMENT_NODE=11,bu=xe.NOTATION_NODE=12,J=Be.freeze({DOCUMENT_POSITION_DISCONNECTED:1,DOCUMENT_POSITION_PRECEDING:2,DOCUMENT_POSITION_FOLLOWING:4,DOCUMENT_POSITION_CONTAINS:8,DOCUMENT_POSITION_CONTAINED_BY:16,DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:32});function rs(e,t){if(t.length<e.length)return rs(t,e);var r=null;for(var n in e){if(e[n]!==t[n])return r;r=e[n]}return r}function Zi(e){return e.guid||(e.guid=Math.random()),e.guid}function te(){}te.prototype={length:0,item:function(e){return e>=0&&e<this.length?this[e]:null},toString:function(e){var t;typeof e=="function"?t={requireWellFormed:!1,splitCDATASections:!0,nodeFilter:e}:e?t={requireWellFormed:!!e.requireWellFormed,splitCDATASections:e.splitCDATASections!==!1,nodeFilter:e.nodeFilter||null}:t={requireWellFormed:!1,splitCDATASections:!0,nodeFilter:null};for(var r=[],n=0;n<this.length;n++)Mn(this[n],r,null,t);return r.join("")},filter:function(e){return Array.prototype.filter.call(this,e)},indexOf:function(e){return Array.prototype.indexOf.call(this,e)}};te.prototype[Symbol.iterator]=function(){var e=this,t=0;return{next:function(){return t<e.length?{value:e[t++],done:!1}:{done:!0}},return:function(){return{done:!0}}}};function $e(e,t){this._node=e,this._refresh=t,Pr(this)}function Pr(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!==t){var r=e._refresh(e._node);if(hs(e,"length",r.length),!e.$$length||r.length<e.$$length)for(var n=r.length;n in e;n++)St(e,n)&&delete e[n];Ft(r,e),e._inc=t}}$e.prototype.item=function(e){return Pr(this),this[e]||null};Ee($e,te);function _t(){this._nsIndex=Object.create(null),this._noNsIndex=Object.create(null)}function ns(e,t){for(var r=0;r<e.length;){if(e[r]===t)return r;r++}}function Ln(e,t,r){if(!t)return e._noNsIndex;var n=e._nsIndex[t];return!n&&r&&(n=e._nsIndex[t]=Object.create(null)),n}function Cu(e,t,r){var n=Ln(e,t,!1),i=n&&n[r];return i||null}function wu(e,t){Ln(e,t.namespaceURI,!0)[t.localName]=t}function Tu(e,t){var r=Ln(e,t.namespaceURI,!1);r&&delete r[t.localName]}function Nu(e,t,r,n){if(n?t[ns(t,n)]=r:(t[t.length]=r,t.length++),wu(t,r),e){r.ownerElement=e;var i=e.ownerDocument;i&&(n&&as(i,e,n),vu(i,e,r))}}function ji(e,t,r){var n=ns(t,r);if(n>=0){for(var i=t.length-1;n<=i;)t[n]=t[++n];if(t.length=i,Tu(t,r),e){var s=e.ownerDocument;s&&as(s,e,r),r.ownerElement=null}}}_t.prototype={length:0,item:te.prototype.item,getNamedItem:function(e){this._ownerElement&&this._ownerElement._isInHTMLDocumentAndNamespace()&&(e=e.toLowerCase());for(var t=0;t<this.length;){var r=this[t];if(r.nodeName===e)return r;t++}return null},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!==this._ownerElement)throw new D(D.INUSE_ATTRIBUTE_ERR);var r=Cu(this,e.namespaceURI,e.localName);return r===e?e:(Nu(this._ownerElement,this,e,r),r)},setNamedItemNS:function(e){return this.setNamedItem(e)},removeNamedItem:function(e){var t=this.getNamedItem(e);if(!t)throw new D(D.NOT_FOUND_ERR,e);return ji(this._ownerElement,this,t),t},removeNamedItemNS:function(e,t){var r=this.getNamedItemNS(e,t);if(!r)throw new D(D.NOT_FOUND_ERR,e?e+" : "+t:t);return ji(this._ownerElement,this,r),r},getNamedItemNS:function(e,t){e||(e=null);for(var r=0;r<this.length;){var n=this[r];if(n.localName===t&&n.namespaceURI===e)return n;r++}return null}};_t.prototype[Symbol.iterator]=function(){var e=this,t=0;return{next:function(){return t<e.length?{value:e[t++],done:!1}:{done:!0}},return:function(){return{done:!0}}}};function is(){}is.prototype={hasFeature:function(e,t){return!0},createDocument:function(e,t,r){var n=cr.XML_APPLICATION;e===Ge.HTML?n=cr.XML_XHTML_APPLICATION:e===Ge.SVG&&(n=cr.XML_SVG_IMAGE);var i=new Ye(de,{contentType:n});if(i.implementation=this,i.childNodes=new te,i.doctype=r||null,r&&i.appendChild(r),t){var s=i.createElementNS(e,t);i.appendChild(s)}return i},createDocumentType:function(e,t,r,n){Qi(e);var i=new Xr(de);return i.name=e,i.nodeName=e,i.publicId=t||"",i.systemId=r||"",i.internalSubset=n||"",i.childNodes=new te,i},createHTMLDocument:function(e){var t=new Ye(de,{contentType:cr.HTML});if(t.implementation=this,t.childNodes=new te,e!==!1){t.doctype=this.createDocumentType("html"),t.doctype.ownerDocument=t,t.appendChild(t.doctype);var r=t.createElement("html");t.appendChild(r);var n=t.createElement("head");if(r.appendChild(n),typeof e=="string"){var i=t.createElement("title");i.appendChild(t.createTextNode(e)),n.appendChild(i)}r.appendChild(t.createElement("body"))}return t}};function P(e){ge(e)}P.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,parentNode:null,get parentElement(){return this.parentNode&&this.parentNode.nodeType===this.ELEMENT_NODE?this.parentNode:null},childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,baseURI:"about:blank",get isConnected(){var e=this.getRootNode();return e&&e.nodeType===e.DOCUMENT_NODE},contains:function(e){if(!e)return!1;var t=e;do{if(this===t)return!0;t=t.parentNode}while(t);return!1},getRootNode:function(e){var t=this;do{if(!t.parentNode)return t;t=t.parentNode}while(t)},isEqualNode:function(e){if(!e)return!1;for(var t=[{node:this,other:e}];t.length>0;){var r=t.pop(),n=r.node,i=r.other;if(n.nodeType!==i.nodeType)return!1;switch(n.nodeType){case n.DOCUMENT_TYPE_NODE:if(n.name!==i.name||n.publicId!==i.publicId||n.systemId!==i.systemId)return!1;break;case n.ELEMENT_NODE:if(n.namespaceURI!==i.namespaceURI||n.prefix!==i.prefix||n.localName!==i.localName||n.attributes.length!==i.attributes.length)return!1;for(var s=0;s<n.attributes.length;s++){var a=n.attributes.item(s),u=i.getAttributeNodeNS(a.namespaceURI,a.localName);if(!u)return!1;t.push({node:a,other:u})}break;case n.ATTRIBUTE_NODE:if(n.namespaceURI!==i.namespaceURI||n.localName!==i.localName||n.value!==i.value)return!1;break;case n.PROCESSING_INSTRUCTION_NODE:if(n.target!==i.target||n.data!==i.data)return!1;break;case n.TEXT_NODE:case n.CDATA_SECTION_NODE:case n.COMMENT_NODE:if(n.data!==i.data)return!1;break}if(n.childNodes.length!==i.childNodes.length)return!1;for(var s=n.childNodes.length-1;s>=0;s--)t.push({node:n.childNodes[s],other:i.childNodes[s]})}return!0},isSameNode:function(e){return this===e},insertBefore:function(e,t){return Rr(this,e,t)},replaceChild:function(e,t){Rr(this,e,t,ls),t&&this.removeChild(t)},removeChild:function(e){return os(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(e){return ds(this.ownerDocument||this,this,e)},normalize:function(){ue(this,null,{enter:function(e){for(var t=e.firstChild;t;){var r=t.nextSibling;if(r!==null&&r.nodeType===mr&&t.nodeType===mr){for(var n=[],i=r;i!==null&&i.nodeType===mr;)n.push(i.data),i=i.nextSibling;for(var s=t.nextSibling;s!==i;){var a=s.nextSibling;s.parentNode=null,s.previousSibling=null,s.nextSibling=null,s=a}t.nextSibling=i,i!==null?i.previousSibling=t:e.lastChild=t,t.appendData(n.join("")),Bn(e.ownerDocument,e),t=i}else t=r}return!0}})},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},lookupPrefix:function(e){for(var t=this;t;){var r=t._nsMap;if(r){for(var n in r)if(St(r,n)&&r[n]===e)return n}t=t.nodeType==It?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var r=t._nsMap;if(r&&St(r,e))return r[e];t=t.nodeType==It?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){var t=this.lookupPrefix(e);return t==null},compareDocumentPosition:function(e){if(this===e)return 0;var t=e,r=this,n=null,i=null;if(t instanceof gt&&(n=t,t=n.ownerElement),r instanceof gt&&(i=r,r=i.ownerElement,n&&t&&r===t))for(var s=0,a;a=r.attributes[s];s++){if(a===n)return J.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+J.DOCUMENT_POSITION_PRECEDING;if(a===i)return J.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+J.DOCUMENT_POSITION_FOLLOWING}if(!t||!r||r.ownerDocument!==t.ownerDocument)return J.DOCUMENT_POSITION_DISCONNECTED+J.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+(Zi(r.ownerDocument)>Zi(t.ownerDocument)?J.DOCUMENT_POSITION_FOLLOWING:J.DOCUMENT_POSITION_PRECEDING);if(i&&t===r)return J.DOCUMENT_POSITION_CONTAINS+J.DOCUMENT_POSITION_PRECEDING;if(n&&t===r)return J.DOCUMENT_POSITION_CONTAINED_BY+J.DOCUMENT_POSITION_FOLLOWING;for(var u=[],l=t.parentNode;l;){if(!i&&l===r)return J.DOCUMENT_POSITION_CONTAINED_BY+J.DOCUMENT_POSITION_FOLLOWING;u.push(l),l=l.parentNode}u.reverse();for(var o=[],c=r.parentNode;c;){if(!n&&c===t)return J.DOCUMENT_POSITION_CONTAINS+J.DOCUMENT_POSITION_PRECEDING;o.push(c),c=c.parentNode}o.reverse();var m=rs(u,o);for(var h in m.childNodes){var p=m.childNodes[h];if(p===r)return J.DOCUMENT_POSITION_FOLLOWING;if(p===t)return J.DOCUMENT_POSITION_PRECEDING;if(o.indexOf(p)>=0)return J.DOCUMENT_POSITION_FOLLOWING;if(u.indexOf(p)>=0)return J.DOCUMENT_POSITION_PRECEDING}return 0}};function ss(e){return e=="<"&&"<"||e==">"&&">"||e=="&"&&"&"||e=='"'&&"""||"&#"+e.charCodeAt()+";"}Ft(xe,P);Ft(xe,P.prototype);Ft(J,P);Ft(J,P.prototype);function Br(e,t){ue(e,null,{enter:function(r){return t(r)?ue.STOP:!0}})}function ue(e,t,r){for(var n=[{node:e,context:t,phase:ue.ENTER}];n.length>0;){var i=n.pop();if(i.phase===ue.ENTER){var s=r.enter(i.node,i.context);if(s===ue.STOP)return ue.STOP;if(n.push({node:i.node,context:s,phase:ue.EXIT}),s==null)continue;for(var a=i.node.lastChild;a;)n.push({node:a,context:s,phase:ue.ENTER}),a=a.previousSibling}else r.exit&&r.exit(i.node,i.context)}}ue.STOP=Symbol("walkDOM.STOP");ue.ENTER=0;ue.EXIT=1;function Ye(e,t){ge(e);var r=t||{};this.ownerDocument=this,this.contentType=r.contentType||cr.XML_APPLICATION,this.type=fu(this.contentType)?"html":"xml"}function vu(e,t,r){e&&e._inc++;var n=r.namespaceURI;n===Ge.XMLNS&&(t._nsMap[r.prefix?r.localName:""]=r.value)}function as(e,t,r,n){e&&e._inc++;var i=r.namespaceURI;i===Ge.XMLNS&&delete t._nsMap[r.prefix?r.localName:""]}function Bn(e,t,r){if(e&&e._inc){e._inc++;var n=t.childNodes;if(r&&!r.nextSibling)n[n.length++]=r;else{for(var i=t.firstChild,s=0;i;)n[s++]=i,i=i.nextSibling;n.length=s,delete n[n.length]}}}function os(e,t){if(e!==t.parentNode)throw new D(D.NOT_FOUND_ERR,"child's parent is not parent");var r=t.previousSibling,n=t.nextSibling;return r?r.nextSibling=n:e.firstChild=n,n?n.previousSibling=r:e.lastChild=r,Bn(e.ownerDocument,e),t.parentNode=null,t.previousSibling=null,t.nextSibling=null,t}function Su(e){return e&&(e.nodeType===P.DOCUMENT_NODE||e.nodeType===P.DOCUMENT_FRAGMENT_NODE||e.nodeType===P.ELEMENT_NODE)}function Iu(e){return e&&(e.nodeType===P.CDATA_SECTION_NODE||e.nodeType===P.COMMENT_NODE||e.nodeType===P.DOCUMENT_FRAGMENT_NODE||e.nodeType===P.DOCUMENT_TYPE_NODE||e.nodeType===P.ELEMENT_NODE||e.nodeType===P.PROCESSING_INSTRUCTION_NODE||e.nodeType===P.TEXT_NODE)}function ot(e){return e&&e.nodeType===P.DOCUMENT_TYPE_NODE}function ze(e){return e&&e.nodeType===P.ELEMENT_NODE}function us(e){return e&&e.nodeType===P.TEXT_NODE}function zi(e,t){var r=e.childNodes||[];if(qe(r,ze)||ot(t))return!1;var n=qe(r,ot);return!(t&&n&&r.indexOf(n)>r.indexOf(t))}function Yi(e,t){var r=e.childNodes||[];function n(s){return ze(s)&&s!==t}if(qe(r,n))return!1;var i=qe(r,ot);return!(t&&i&&r.indexOf(i)>r.indexOf(t))}function _u(e,t,r){if(!Su(e))throw new D(D.HIERARCHY_REQUEST_ERR,"Unexpected parent node type "+e.nodeType);if(r&&r.parentNode!==e)throw new D(D.NOT_FOUND_ERR,"child not in parent");if(!Iu(t)||ot(t)&&e.nodeType!==P.DOCUMENT_NODE)throw new D(D.HIERARCHY_REQUEST_ERR,"Unexpected node type "+t.nodeType+" for parent node type "+e.nodeType)}function Fu(e,t,r){var n=e.childNodes||[],i=t.childNodes||[];if(t.nodeType===P.DOCUMENT_FRAGMENT_NODE){var s=i.filter(ze);if(s.length>1||qe(i,us))throw new D(D.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(s.length===1&&!zi(e,r))throw new D(D.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(ze(t)&&!zi(e,r))throw new D(D.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(ot(t)){if(qe(n,ot))throw new D(D.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var a=qe(n,ze);if(r&&n.indexOf(a)<n.indexOf(r))throw new D(D.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element");if(!r&&a)throw new D(D.HIERARCHY_REQUEST_ERR,"Doctype can not be appended since element is present")}}function ls(e,t,r){var n=e.childNodes||[],i=t.childNodes||[];if(t.nodeType===P.DOCUMENT_FRAGMENT_NODE){var s=i.filter(ze);if(s.length>1||qe(i,us))throw new D(D.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(s.length===1&&!Yi(e,r))throw new D(D.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(ze(t)&&!Yi(e,r))throw new D(D.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(ot(t)){if(qe(n,function(l){return ot(l)&&l!==r}))throw new D(D.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var a=qe(n,ze);if(r&&n.indexOf(a)<n.indexOf(r))throw new D(D.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element")}}function Rr(e,t,r,n){_u(e,t,r),e.nodeType===P.DOCUMENT_NODE&&(n||Fu)(e,t,r);var i=t.parentNode;if(i&&i.removeChild(t),t.nodeType===at){var s=t.firstChild;if(s==null)return t;var a=t.lastChild}else s=a=t;var u=r?r.previousSibling:e.lastChild;s.previousSibling=u,a.nextSibling=r,u?u.nextSibling=s:e.firstChild=s,r==null?e.lastChild=a:r.previousSibling=a;do s.parentNode=e;while(s!==a&&(s=s.nextSibling));return Bn(e.ownerDocument||e,e,t),t.nodeType==at&&(t.firstChild=t.lastChild=null),t}Ye.prototype={implementation:null,nodeName:"#document",nodeType:vt,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType===at){for(var r=e.firstChild;r;){var n=r.nextSibling;this.insertBefore(r,t),r=n}return e}return Rr(this,e,t),e.ownerDocument=this,this.documentElement===null&&e.nodeType===Le&&(this.documentElement=e),e},removeChild:function(e){var t=os(this,e);return t===this.documentElement&&(this.documentElement=null),t},replaceChild:function(e,t){Rr(this,e,t,ls),e.ownerDocument=this,t&&this.removeChild(t),ze(e)&&(this.documentElement=e)},importNode:function(e,t){return Lu(this,e,t)},getElementById:function(e){var t=null;return Br(this.documentElement,function(r){if(r.nodeType==Le&&r.getAttribute("id")==e)return t=r,!0}),t},createElement:function(e){var t=new We(de);t.ownerDocument=this,this.type==="html"&&(e=e.toLowerCase()),hu(this.contentType)&&(t.namespaceURI=Ge.HTML),t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new te;var r=t.attributes=new _t;return r._ownerElement=t,t},createDocumentFragment:function(){var e=new Lt(de);return e.ownerDocument=this,e.childNodes=new te,e},createTextNode:function(e){var t=new dr(de);return t.ownerDocument=this,t.childNodes=new te,t.appendData(e),t},createComment:function(e){var t=new Mr(de);return t.ownerDocument=this,t.childNodes=new te,t.appendData(e),t},createCDATASection:function(e){if(e.indexOf("]]>")!==-1)throw new D(D.INVALID_CHARACTER_ERR,'data contains "]]>"');var t=new Or(de);return t.ownerDocument=this,t.childNodes=new te,t.appendData(e),t},createProcessingInstruction:function(e,t){var r=new Ur(de);return r.ownerDocument=this,r.childNodes=new te,r.nodeName=r.target=e,r.nodeValue=r.data=t,r},createAttribute:function(e){if(!Q.QName_exact.test(e))throw new D(D.INVALID_CHARACTER_ERR,'invalid character in name "'+e+'"');return this.type==="html"&&(e=e.toLowerCase()),this._createAttribute(e)},_createAttribute:function(e){var t=new gt(de);return t.ownerDocument=this,t.childNodes=new te,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){if(!Q.Name_exact.test(e))throw new D(D.INVALID_CHARACTER_ERR,'not a valid xml name "'+e+'"');if(this.type==="html")throw new D("document is an html document",ce.NotSupportedError);var t=new kr(de);return t.ownerDocument=this,t.childNodes=new te,t.nodeName=e,t},createElementNS:function(e,t){var r=In(e,t),n=new We(de),i=n.attributes=new _t;return n.childNodes=new te,n.ownerDocument=this,n.nodeName=t,n.tagName=t,n.namespaceURI=r[0],n.prefix=r[1],n.localName=r[2],i._ownerElement=n,n},createAttributeNS:function(e,t){var r=In(e,t),n=new gt(de);return n.ownerDocument=this,n.childNodes=new te,n.nodeName=t,n.name=t,n.specified=!0,n.namespaceURI=r[0],n.prefix=r[1],n.localName=r[2],n}};Ee(Ye,P);function We(e){ge(e),this._nsMap=Object.create(null)}We.prototype={nodeType:Le,attributes:null,getQualifiedName:function(){return this.prefix?this.prefix+":"+this.localName:this.localName},_isInHTMLDocumentAndNamespace:function(){return this.ownerDocument.type==="html"&&this.namespaceURI===Ge.HTML},hasAttributes:function(){return!!(this.attributes&&this.attributes.length)},hasAttribute:function(e){return!!this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t?t.value:null},getAttributeNode:function(e){return this._isInHTMLDocumentAndNamespace()&&(e=e.toLowerCase()),this.attributes.getNamedItem(e)},setAttribute:function(e,t){this._isInHTMLDocumentAndNamespace()&&(e=e.toLowerCase());var r=this.getAttributeNode(e);r?r.value=r.nodeValue=""+t:(r=this.ownerDocument._createAttribute(e),r.value=r.nodeValue=""+t,this.setAttributeNode(r))},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var r=this.getAttributeNodeNS(e,t);r&&this.removeAttributeNode(r)},hasAttributeNS:function(e,t){return this.getAttributeNodeNS(e,t)!=null},getAttributeNS:function(e,t){var r=this.getAttributeNodeNS(e,t);return r?r.value:null},setAttributeNS:function(e,t,r){var n=In(e,t),i=n[2],s=this.getAttributeNodeNS(e,i);s?s.value=s.nodeValue=""+r:(s=this.ownerDocument.createAttributeNS(e,t),s.value=s.nodeValue=""+r,this.setAttributeNode(s))},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByClassName:function(e){var t=Vi(e);return new $e(this,function(r){var n=[];return t.length>0&&Br(r,function(i){if(i!==r&&i.nodeType===Le){var s=i.getAttribute("class");if(s){var a=e===s;if(!a){var u=Vi(s);a=t.every(Au(u))}a&&n.push(i)}}}),n})},getElementsByTagName:function(e){var t=(this.nodeType===vt?this:this.ownerDocument).type==="html",r=e.toLowerCase();return new $e(this,function(n){var i=[];return Br(n,function(s){if(!(s===n||s.nodeType!==Le))if(e==="*")i.push(s);else{var a=s.getQualifiedName(),u=t&&s.namespaceURI===Ge.HTML?r:e;a===u&&i.push(s)}}),i})},getElementsByTagNameNS:function(e,t){return new $e(this,function(r){var n=[];return Br(r,function(i){i!==r&&i.nodeType===Le&&(e==="*"||i.namespaceURI===e)&&(t==="*"||i.localName==t)&&n.push(i)}),n})}};Ye.prototype.getElementsByClassName=We.prototype.getElementsByClassName;Ye.prototype.getElementsByTagName=We.prototype.getElementsByTagName;Ye.prototype.getElementsByTagNameNS=We.prototype.getElementsByTagNameNS;Ee(We,P);function gt(e){ge(e),this.namespaceURI=null,this.prefix=null,this.ownerElement=null}gt.prototype.nodeType=It;Ee(gt,P);function ut(e){ge(e)}ut.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,r){var n=this.data.substring(0,e),i=this.data.substring(e+t);r=n+r+i,this.nodeValue=this.data=r,this.length=r.length}};Ee(ut,P);function dr(e){ge(e)}dr.prototype={nodeName:"#text",nodeType:mr,splitText:function(e){var t=this.data,r=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var n=this.ownerDocument.createTextNode(r);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}};Ee(dr,ut);function Mr(e){ge(e)}Mr.prototype={nodeName:"#comment",nodeType:Fn};Ee(Mr,ut);function Or(e){ge(e)}Or.prototype={nodeName:"#cdata-section",nodeType:Ki};Ee(Or,dr);function Xr(e){ge(e)}Xr.prototype.nodeType=ts;Ee(Xr,P);function Rn(e){ge(e)}Rn.prototype.nodeType=bu;Ee(Rn,P);function Pn(e){ge(e)}Pn.prototype.nodeType=yu;Ee(Pn,P);function kr(e){ge(e)}kr.prototype.nodeType=es;Ee(kr,P);function Lt(e){ge(e)}Lt.prototype.nodeName="#document-fragment";Lt.prototype.nodeType=at;Ee(Lt,P);function Ur(e){ge(e)}Ur.prototype.nodeType=_n;Ee(Ur,ut);function cs(){}cs.prototype.serializeToString=function(e,t){return ms.call(e,t)};P.prototype.toString=ms;function ms(e){var t;typeof e=="function"?t={requireWellFormed:!1,splitCDATASections:!0,nodeFilter:e}:e!=null?t={requireWellFormed:!!e.requireWellFormed,splitCDATASections:e.splitCDATASections!==!1,nodeFilter:e.nodeFilter||null}:t={requireWellFormed:!1,splitCDATASections:!0,nodeFilter:null};var r=[],n=this.nodeType===vt&&this.documentElement||this,i=n.prefix,s=n.namespaceURI;if(s&&i==null){var i=n.lookupPrefix(s);if(i==null)var a=[{namespace:s,prefix:null}]}return Mn(this,r,a,t),r.join("")}function Wi(e,t,r){var n=e.prefix||"",i=e.namespaceURI;if(!i||n==="xml"&&i===Ge.XML||i===Ge.XMLNS)return!1;for(var s=r.length;s--;){var a=r[s];if(a.prefix===n)return a.namespace!==i}return!0}function Lr(e,t,r,n){if(n&&!Q.QName_exact.test(t))throw new D('The attribute name "'+t+'" is not a valid XML QName',ce.InvalidStateError);e.push(" ",t,'="',r.replace(/[<>&"\t\n\r]/g,ss),'"')}function Mn(e,t,r,n){r||(r=[]);var i=n.nodeFilter,s=n.requireWellFormed,a=n.splitCDATASections,u=e.nodeType===vt?e:e.ownerDocument,l=u.type==="html";ue(e,{ns:r},{enter:function(o,c){var m=c.ns;if(i)if(o=i(o),o){if(typeof o=="string")return t.push(o),null}else return null;switch(o.nodeType){case Le:var h=o.attributes,p=h.length,E=o.tagName,A=E;if(!l&&!o.prefix&&o.namespaceURI){for(var y,b=0;b<h.length;b++)if(h.item(b).name==="xmlns"){y=h.item(b).value;break}if(!y)for(var C=m.length-1;C>=0;C--){var w=m[C];if(w.prefix===""&&w.namespace===o.namespaceURI){y=w.namespace;break}}if(y!==o.namespaceURI)for(var C=m.length-1;C>=0;C--){var w=m[C];if(w.namespace===o.namespaceURI){w.prefix&&(A=w.prefix+":"+E);break}}}if(s&&!Q.QName_exact.test(A))throw new D('The element name "'+A+'" is not a valid XML QName',ce.InvalidStateError);t.push("<",A);for(var x=m.slice(),F=0;F<p;F++){var B=h.item(F);B.prefix=="xmlns"?x.push({prefix:B.localName,namespace:B.value}):B.nodeName=="xmlns"&&x.push({prefix:"",namespace:B.value})}for(var F=0;F<p;F++){var B=h.item(F);if(Wi(B,l,x)){var G=B.prefix||"",O=B.namespaceURI;Lr(t,G?"xmlns:"+G:"xmlns",O,s),x.push({prefix:G,namespace:O})}var $=i?i(B):B;$&&(typeof $=="string"?t.push($):Lr(t,$.name,$.value,s))}if(E===A&&Wi(o,l,x)){var fe=o.prefix||"",O=o.namespaceURI;Lr(t,fe?"xmlns:"+fe:"xmlns",O,s),x.push({prefix:fe,namespace:O})}var pe=!o.firstChild;if(pe&&(l||o.namespaceURI===Ge.HTML)&&(pe=gu(E)),pe)return t.push("/>"),null;if(t.push(">"),l&&pu(E)){for(var H=o.firstChild;H;)H.data?t.push(H.data):Mn(H,t,x.slice(),n),H=H.nextSibling;return t.push("</",A,">"),null}return{ns:x,tag:A};case vt:case at:if(s&&o.nodeType===vt&&o.documentElement==null)throw new D("The Document has no documentElement",ce.InvalidStateError);return{ns:m};case It:return Lr(t,o.name,o.value,s),null;case mr:if(s&&Q.InvalidChar.test(o.data))throw new D("The Text node data contains characters outside the XML Char production",ce.InvalidStateError);return t.push(o.data.replace(/[<&>]/g,ss)),null;case Ki:if(s&&o.data.indexOf("]]>")!==-1)throw new D('The CDATASection data contains "]]>"',ce.InvalidStateError);return a?t.push(Q.CDATA_START,o.data.replace(/]]>/g,"]]]]><![CDATA[>"),Q.CDATA_END):t.push(Q.CDATA_START,o.data,Q.CDATA_END),null;case Fn:if(s){if(Q.InvalidChar.test(o.data))throw new D("The comment node data contains characters outside the XML Char production",ce.InvalidStateError);if(o.data.indexOf("--")!==-1||o.data[o.data.length-1]==="-")throw new D('The comment node data contains "--" or ends with "-"',ce.InvalidStateError)}return t.push(Q.COMMENT_START,o.data,Q.COMMENT_END),null;case ts:var L=o.publicId,X=o.systemId;if(s){if(!Q.Name_exact.test(o.name))throw new D('The doctype name "'+o.name+'" is not a valid XML Name',ce.InvalidStateError);if(L&&!Q.PubidLiteral_match.test(L))throw new D("DocumentType publicId is not a valid PubidLiteral",ce.InvalidStateError);if(X&&X!=="."&&!Q.SystemLiteral_match.test(X))throw new D("DocumentType systemId is not a valid SystemLiteral",ce.InvalidStateError);if(o.internalSubset&&o.internalSubset.indexOf("]>")!==-1)throw new D('DocumentType internalSubset contains "]>"',ce.InvalidStateError)}return t.push(Q.DOCTYPE_DECL_START," ",o.name),L?(t.push(" ",Q.PUBLIC," ",L),X&&X!=="."&&t.push(" ",X)):X&&X!=="."&&t.push(" ",Q.SYSTEM," ",X),o.internalSubset&&t.push(" [",o.internalSubset,"]"),t.push(">"),null;case _n:if(s){if(!Q.NCName_exact.test(o.target)||o.target.toLowerCase()==="xml")throw new D('The processing instruction target "'+o.target+'" is not a valid XML NCName or is reserved',ce.InvalidStateError);if(Q.InvalidChar.test(o.data))throw new D("The ProcessingInstruction data contains characters outside the XML Char production",ce.InvalidStateError);if(o.data.indexOf("?>")!==-1)throw new D('The ProcessingInstruction data contains "?>"',ce.InvalidStateError)}return t.push("<?",o.target," ",o.data,"?>"),null;case es:if(s&&!Q.Name_exact.test(o.nodeName))throw new D('The entity reference name "'+o.nodeName+'" is not a valid XML Name',ce.InvalidStateError);return t.push("&",o.nodeName,";"),null;default:return t.push("??",o.nodeName),null}},exit:function(o,c){c&&c.tag&&t.push("</",c.tag,">")}})}function Lu(e,t,r){var n;return ue(t,null,{enter:function(i,s){var a=i.cloneNode(!1);a.ownerDocument=e,a.parentNode=null,s===null?n=a:s.appendChild(a);var u=i.nodeType===It||r;return u?a:null}}),n}function ds(e,t,r){var n;return ue(t,null,{enter:function(i,s){var a=new i.constructor(de);for(var u in i)if(St(i,u)){var l=i[u];typeof l!="object"&&l!=a[u]&&(a[u]=l)}i.childNodes&&(a.childNodes=new te),a.ownerDocument=e;var o=r;switch(a.nodeType){case Le:var c=i.attributes,m=a.attributes=new _t,h=c.length;m._ownerElement=a;for(var p=0;p<h;p++)a.setAttributeNode(ds(e,c.item(p),!0));break;case It:o=!0}return s!==null?s.appendChild(a):n=a,o?a:null}}),n}function hs(e,t,r){e[t]=r}function Sn(e){for(var t=[],r=e.firstChild;r;)r.nodeType===Le&&t.push(r),r=r.nextSibling;return t}try{Object.defineProperty&&(Object.defineProperty($e.prototype,"length",{get:function(){return Pr(this),this.$$length}}),Object.defineProperty(P.prototype,"textContent",{get:function(){if(this.nodeType===Le||this.nodeType===at){var e=[];return ue(this,null,{enter:function(t){if(t.nodeType===Le||t.nodeType===at)return!0;if(t.nodeType===_n||t.nodeType===Fn)return null;e.push(t.nodeValue)}}),e.join("")}return this.nodeValue},set:function(e){switch(this.nodeType){case Le:case at:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),Object.defineProperty(ut.prototype,"data",{get:function(){return this._data!=null?this._data:""},set:function(e){this._data=e,this.length=typeof e=="string"?e.length:0}}),Object.defineProperty(ut.prototype,"nodeValue",{get:function(){return this.data},set:function(e){this.data=e},enumerable:!0,configurable:!0}),Object.defineProperty(We.prototype,"children",{get:function(){return new $e(this,Sn)}}),Object.defineProperty(Ye.prototype,"children",{get:function(){return new $e(this,Sn)}}),Object.defineProperty(Lt.prototype,"children",{get:function(){return new $e(this,Sn)}}),hs=function(e,t,r){e["$$"+t]=r})}catch{}K._updateLiveList=Pr;K.Attr=gt;K.CDATASection=Or;K.CharacterData=ut;K.Comment=Mr;K.Document=Ye;K.DocumentFragment=Lt;K.DocumentType=Xr;K.DOMImplementation=is;K.Element=We;K.Entity=Pn;K.EntityReference=kr;K.LiveNodeList=$e;K.NamedNodeMap=_t;K.Node=P;K.NodeList=te;K.Notation=Rn;K.Text=dr;K.ProcessingInstruction=Ur;K.walkDOM=ue;K.XMLSerializer=cs});var ps=Fe(hr=>{"use strict";var fs=pt().freeze;hr.XML_ENTITIES=fs({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'});hr.HTML_ENTITIES=fs({Aacute:"\xC1",aacute:"\xE1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223E",acd:"\u223F",acE:"\u223E\u0333",Acirc:"\xC2",acirc:"\xE2",acute:"\xB4",Acy:"\u0410",acy:"\u0430",AElig:"\xC6",aelig:"\xE6",af:"\u2061",Afr:"\u{1D504}",afr:"\u{1D51E}",Agrave:"\xC0",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03B1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2A3F",AMP:"&",amp:"&",And:"\u2A53",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",Aogon:"\u0104",aogon:"\u0105",Aopf:"\u{1D538}",aopf:"\u{1D552}",ap:"\u2248",apacir:"\u2A6F",apE:"\u2A70",ape:"\u224A",apid:"\u224B",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224A",Aring:"\xC5",aring:"\xE5",Ascr:"\u{1D49C}",ascr:"\u{1D4B6}",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224D",Atilde:"\xC3",atilde:"\xE3",Auml:"\xC4",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",Backslash:"\u2216",Barv:"\u2AE7",barvee:"\u22BD",Barwed:"\u2306",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",Because:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",Bernoullis:"\u212C",Beta:"\u0392",beta:"\u03B2",beth:"\u2136",between:"\u226C",Bfr:"\u{1D505}",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bNot:"\u2AED",bnot:"\u2310",Bopf:"\u{1D539}",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxbox:"\u29C9",boxDL:"\u2557",boxDl:"\u2556",boxdL:"\u2555",boxdl:"\u2510",boxDR:"\u2554",boxDr:"\u2553",boxdR:"\u2552",boxdr:"\u250C",boxH:"\u2550",boxh:"\u2500",boxHD:"\u2566",boxHd:"\u2564",boxhD:"\u2565",boxhd:"\u252C",boxHU:"\u2569",boxHu:"\u2567",boxhU:"\u2568",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxUL:"\u255D",boxUl:"\u255C",boxuL:"\u255B",boxul:"\u2518",boxUR:"\u255A",boxUr:"\u2559",boxuR:"\u2558",boxur:"\u2514",boxV:"\u2551",boxv:"\u2502",boxVH:"\u256C",boxVh:"\u256B",boxvH:"\u256A",boxvh:"\u253C",boxVL:"\u2563",boxVl:"\u2562",boxvL:"\u2561",boxvl:"\u2524",boxVR:"\u2560",boxVr:"\u255F",boxvR:"\u255E",boxvr:"\u251C",bprime:"\u2035",Breve:"\u02D8",breve:"\u02D8",brvbar:"\xA6",Bscr:"\u212C",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",Bumpeq:"\u224E",bumpeq:"\u224F",Cacute:"\u0106",cacute:"\u0107",Cap:"\u22D2",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",CapitalDifferentialD:"\u2145",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",Cayleys:"\u212D",ccaps:"\u2A4D",Ccaron:"\u010C",ccaron:"\u010D",Ccedil:"\xC7",ccedil:"\xE7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2A4C",ccupssm:"\u2A50",Cdot:"\u010A",cdot:"\u010B",cedil:"\xB8",Cedilla:"\xB8",cemptyv:"\u29B2",cent:"\xA2",CenterDot:"\xB7",centerdot:"\xB7",Cfr:"\u212D",cfr:"\u{1D520}",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03A7",chi:"\u03C7",cir:"\u25CB",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",CircleDot:"\u2299",circledR:"\xAE",circledS:"\u24C8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cirE:"\u29C3",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",Colon:"\u2237",colon:":",Colone:"\u2A74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",Congruent:"\u2261",Conint:"\u222F",conint:"\u222E",ContourIntegral:"\u222E",Copf:"\u2102",copf:"\u{1D554}",coprod:"\u2210",Coproduct:"\u2210",COPY:"\xA9",copy:"\xA9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21B5",Cross:"\u2A2F",cross:"\u2717",Cscr:"\u{1D49E}",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",Cup:"\u22D3",cup:"\u222A",cupbrcap:"\u2A48",CupCap:"\u224D",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",Dagger:"\u2021",dagger:"\u2020",daleth:"\u2138",Darr:"\u21A1",dArr:"\u21D3",darr:"\u2193",dash:"\u2010",Dashv:"\u2AE4",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",Dcaron:"\u010E",dcaron:"\u010F",Dcy:"\u0414",dcy:"\u0434",DD:"\u2145",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",DDotrahd:"\u2911",ddotseq:"\u2A77",deg:"\xB0",Del:"\u2207",Delta:"\u0394",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",Dfr:"\u{1D507}",dfr:"\u{1D521}",dHar:"\u2965",dharl:"\u21C3",dharr:"\u21C2",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",diam:"\u22C4",Diamond:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",DifferentialD:"\u2146",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",Dopf:"\u{1D53B}",dopf:"\u{1D555}",Dot:"\xA8",dot:"\u02D9",DotDot:"\u20DC",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",Downarrow:"\u21D3",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",Dscr:"\u{1D49F}",dscr:"\u{1D4B9}",DScy:"\u0405",dscy:"\u0455",dsol:"\u29F6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",DZcy:"\u040F",dzcy:"\u045F",dzigrarr:"\u27FF",Eacute:"\xC9",eacute:"\xE9",easter:"\u2A6E",Ecaron:"\u011A",ecaron:"\u011B",ecir:"\u2256",Ecirc:"\xCA",ecirc:"\xEA",ecolon:"\u2255",Ecy:"\u042D",ecy:"\u044D",eDDot:"\u2A77",Edot:"\u0116",eDot:"\u2251",edot:"\u0117",ee:"\u2147",efDot:"\u2252",Efr:"\u{1D508}",efr:"\u{1D522}",eg:"\u2A9A",Egrave:"\xC8",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",Element:"\u2208",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25FB",emptyv:"\u2205",EmptyVerySmallSquare:"\u25AB",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",ENG:"\u014A",eng:"\u014B",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\u{1D53C}",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",Epsilon:"\u0395",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",Equal:"\u2A75",equals:"=",EqualTilde:"\u2242",equest:"\u225F",Equilibrium:"\u21CC",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erarr:"\u2971",erDot:"\u2253",Escr:"\u2130",escr:"\u212F",esdot:"\u2250",Esim:"\u2A73",esim:"\u2242",Eta:"\u0397",eta:"\u03B7",ETH:"\xD0",eth:"\xF0",Euml:"\xCB",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",ExponentialE:"\u2147",exponentiale:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",Ffr:"\u{1D509}",ffr:"\u{1D523}",filig:"\uFB01",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",Fopf:"\u{1D53D}",fopf:"\u{1D557}",ForAll:"\u2200",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",Fouriertrf:"\u2131",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",Fscr:"\u2131",fscr:"\u{1D4BB}",gacute:"\u01F5",Gamma:"\u0393",gamma:"\u03B3",Gammad:"\u03DC",gammad:"\u03DD",gap:"\u2A86",Gbreve:"\u011E",gbreve:"\u011F",Gcedil:"\u0122",Gcirc:"\u011C",gcirc:"\u011D",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",gE:"\u2267",ge:"\u2265",gEl:"\u2A8C",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",Gfr:"\u{1D50A}",gfr:"\u{1D524}",Gg:"\u22D9",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gl:"\u2277",gla:"\u2AA5",glE:"\u2A92",glj:"\u2AA4",gnap:"\u2A8A",gnapprox:"\u2A8A",gnE:"\u2269",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",Gopf:"\u{1D53E}",gopf:"\u{1D558}",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",Gt:"\u226B",GT:">",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",Hacek:"\u02C7",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",HARDcy:"\u042A",hardcy:"\u044A",hArr:"\u21D4",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",Hat:"^",hbar:"\u210F",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",Hfr:"\u210C",hfr:"\u{1D525}",HilbertSpace:"\u210B",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",Hopf:"\u210D",hopf:"\u{1D559}",horbar:"\u2015",HorizontalLine:"\u2500",Hscr:"\u210B",hscr:"\u{1D4BD}",hslash:"\u210F",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224E",HumpEqual:"\u224F",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xCD",iacute:"\xED",ic:"\u2063",Icirc:"\xCE",icirc:"\xEE",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",Ifr:"\u2111",ifr:"\u{1D526}",Igrave:"\xCC",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Im:"\u2111",Imacr:"\u012A",imacr:"\u012B",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",Implies:"\u21D2",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",Int:"\u222C",int:"\u222B",intcal:"\u22BA",integers:"\u2124",Integral:"\u222B",intercal:"\u22BA",Intersection:"\u22C2",intlarhk:"\u2A17",intprod:"\u2A3C",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012E",iogon:"\u012F",Iopf:"\u{1D540}",iopf:"\u{1D55A}",Iota:"\u0399",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",Iscr:"\u2110",iscr:"\u{1D4BE}",isin:"\u2208",isindot:"\u22F5",isinE:"\u22F9",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xCF",iuml:"\xEF",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\u{1D50D}",jfr:"\u{1D527}",jmath:"\u0237",Jopf:"\u{1D541}",jopf:"\u{1D55B}",Jscr:"\u{1D4A5}",jscr:"\u{1D4BF}",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039A",kappa:"\u03BA",kappav:"\u03F0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041A",kcy:"\u043A",Kfr:"\u{1D50E}",kfr:"\u{1D528}",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040C",kjcy:"\u045C",Kopf:"\u{1D542}",kopf:"\u{1D55C}",Kscr:"\u{1D4A6}",kscr:"\u{1D4C0}",lAarr:"\u21DA",Lacute:"\u0139",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",Lambda:"\u039B",lambda:"\u03BB",Lang:"\u27EA",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",Laplacetrf:"\u2112",laquo:"\xAB",Larr:"\u219E",lArr:"\u21D0",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",lAtail:"\u291B",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lBarr:"\u290E",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",Lcaron:"\u013D",lcaron:"\u013E",Lcedil:"\u013B",lcedil:"\u013C",lceil:"\u2308",lcub:"{",Lcy:"\u041B",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",lE:"\u2266",le:"\u2264",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",Leftarrow:"\u21D0",leftarrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",leftarrowtail:"\u21A2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",LeftRightArrow:"\u2194",Leftrightarrow:"\u21D4",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",leftthreetimes:"\u22CB",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",lEg:"\u2A8B",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2AA1",lesssim:"\u2272",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",lfisht:"\u297C",lfloor:"\u230A",Lfr:"\u{1D50F}",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lHar:"\u2962",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",Ll:"\u22D8",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",Lleftarrow:"\u21DA",llhard:"\u296B",lltri:"\u25FA",Lmidot:"\u013F",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnap:"\u2A89",lnapprox:"\u2A89",lnE:"\u2268",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",LongLeftArrow:"\u27F5",Longleftarrow:"\u27F8",longleftarrow:"\u27F5",LongLeftRightArrow:"\u27F7",Longleftrightarrow:"\u27FA",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",LongRightArrow:"\u27F6",Longrightarrow:"\u27F9",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",Lopf:"\u{1D543}",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",Lscr:"\u2112",lscr:"\u{1D4C1}",Lsh:"\u21B0",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",Lstrok:"\u0141",lstrok:"\u0142",Lt:"\u226A",LT:"<",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",ltrPar:"\u2996",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",Mcy:"\u041C",mcy:"\u043C",mdash:"\u2014",mDDot:"\u223A",measuredangle:"\u2221",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",MinusPlus:"\u2213",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",Mopf:"\u{1D544}",mopf:"\u{1D55E}",mp:"\u2213",Mscr:"\u2133",mscr:"\u{1D4C2}",mstpos:"\u223E",Mu:"\u039C",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",Ncy:"\u041D",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",neArr:"\u21D7",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:`
|
|
2
|
+
`,nexist:"\u2204",nexists:"\u2204",Nfr:"\u{1D511}",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",nGt:"\u226B\u20D2",ngt:"\u226F",ngtr:"\u226F",nGtv:"\u226B\u0338",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",NJcy:"\u040A",njcy:"\u045A",nlArr:"\u21CD",nlarr:"\u219A",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nLeftarrow:"\u21CD",nleftarrow:"\u219A",nLeftrightarrow:"\u21CE",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nLt:"\u226A\u20D2",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",nopf:"\u{1D55F}",Not:"\u2AEC",not:"\xAC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nRightarrow:"\u21CF",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",Nscr:"\u{1D4A9}",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",Ntilde:"\xD1",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",Nu:"\u039D",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nVDash:"\u22AF",nVdash:"\u22AE",nvDash:"\u22AD",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwArr:"\u21D6",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xD3",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",Ocirc:"\xD4",ocirc:"\xF4",Ocy:"\u041E",ocy:"\u043E",odash:"\u229D",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29BF",Ofr:"\u{1D512}",ofr:"\u{1D52C}",ogon:"\u02DB",Ograve:"\xD2",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",Omacr:"\u014C",omacr:"\u014D",Omega:"\u03A9",omega:"\u03C9",Omicron:"\u039F",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",Oopf:"\u{1D546}",oopf:"\u{1D560}",opar:"\u29B7",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",operp:"\u29B9",oplus:"\u2295",Or:"\u2A54",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oS:"\u24C8",Oscr:"\u{1D4AA}",oscr:"\u2134",Oslash:"\xD8",oslash:"\xF8",osol:"\u2298",Otilde:"\xD5",otilde:"\xF5",Otimes:"\u2A37",otimes:"\u2297",otimesas:"\u2A36",Ouml:"\xD6",ouml:"\xF6",ovbar:"\u233D",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",PartialD:"\u2202",Pcy:"\u041F",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",Pfr:"\u{1D513}",pfr:"\u{1D52D}",Phi:"\u03A6",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",Pi:"\u03A0",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",PlusMinus:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",Poincareplane:"\u210C",pointint:"\u2A15",Popf:"\u2119",popf:"\u{1D561}",pound:"\xA3",Pr:"\u2ABB",pr:"\u227A",prap:"\u2AB7",prcue:"\u227C",prE:"\u2AB3",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",Prime:"\u2033",prime:"\u2032",primes:"\u2119",prnap:"\u2AB9",prnE:"\u2AB5",prnsim:"\u22E8",prod:"\u220F",Product:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",Proportion:"\u2237",Proportional:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",Pscr:"\u{1D4AB}",pscr:"\u{1D4C5}",Psi:"\u03A8",psi:"\u03C8",puncsp:"\u2008",Qfr:"\u{1D514}",qfr:"\u{1D52E}",qint:"\u2A0C",Qopf:"\u211A",qopf:"\u{1D562}",qprime:"\u2057",Qscr:"\u{1D4AC}",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",QUOT:'"',quot:'"',rAarr:"\u21DB",race:"\u223D\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",Rang:"\u27EB",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",Rarr:"\u21A0",rArr:"\u21D2",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21A3",rarrw:"\u219D",rAtail:"\u291C",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",RBarr:"\u2910",rBarr:"\u290F",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",Re:"\u211C",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",REG:"\xAE",reg:"\xAE",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",rfisht:"\u297D",rfloor:"\u230B",Rfr:"\u211C",rfr:"\u{1D52F}",rHar:"\u2964",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",Rho:"\u03A1",rho:"\u03C1",rhov:"\u03F1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",Rightarrow:"\u21D2",rightarrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",rightarrowtail:"\u21A3",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",rightthreetimes:"\u22CC",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",Ropf:"\u211D",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",Rrightarrow:"\u21DB",rsaquo:"\u203A",Rscr:"\u211B",rscr:"\u{1D4C7}",Rsh:"\u21B1",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",RuleDelayed:"\u29F4",ruluhar:"\u2968",rx:"\u211E",Sacute:"\u015A",sacute:"\u015B",sbquo:"\u201A",Sc:"\u2ABC",sc:"\u227B",scap:"\u2AB8",Scaron:"\u0160",scaron:"\u0161",sccue:"\u227D",scE:"\u2AB4",sce:"\u2AB0",Scedil:"\u015E",scedil:"\u015F",Scirc:"\u015C",scirc:"\u015D",scnap:"\u2ABA",scnE:"\u2AB6",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",Scy:"\u0421",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",searhk:"\u2925",seArr:"\u21D8",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\u{1D516}",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xAD",Sigma:"\u03A3",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",SOFTcy:"\u042C",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",Sopf:"\u{1D54A}",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",Sqrt:"\u221A",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",Square:"\u25A1",square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",Sscr:"\u{1D4AE}",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",Star:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",Sub:"\u22D0",sub:"\u2282",subdot:"\u2ABD",subE:"\u2AC5",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",Subset:"\u22D0",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",SubsetEqual:"\u2286",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",SuchThat:"\u220B",Sum:"\u2211",sum:"\u2211",sung:"\u266A",Sup:"\u22D1",sup:"\u2283",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supdot:"\u2ABE",supdsub:"\u2AD8",supE:"\u2AC6",supe:"\u2287",supedot:"\u2AC4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",Supset:"\u22D1",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swarhk:"\u2926",swArr:"\u21D9",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",Tab:" ",target:"\u2316",Tau:"\u03A4",tau:"\u03C4",tbrk:"\u23B4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",Tfr:"\u{1D517}",tfr:"\u{1D531}",there4:"\u2234",Therefore:"\u2234",therefore:"\u2234",Theta:"\u0398",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",ThickSpace:"\u205F\u200A",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223C",THORN:"\xDE",thorn:"\xFE",Tilde:"\u223C",tilde:"\u02DC",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",Topf:"\u{1D54B}",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",TRADE:"\u2122",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",TripleDot:"\u20DB",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",Tscr:"\u{1D4AF}",tscr:"\u{1D4C9}",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040B",tshcy:"\u045B",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",Uacute:"\xDA",uacute:"\xFA",Uarr:"\u219F",uArr:"\u21D1",uarr:"\u2191",Uarrocir:"\u2949",Ubrcy:"\u040E",ubrcy:"\u045E",Ubreve:"\u016C",ubreve:"\u016D",Ucirc:"\xDB",ucirc:"\xFB",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21C5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",Ufr:"\u{1D518}",ufr:"\u{1D532}",Ugrave:"\xD9",ugrave:"\xF9",uHar:"\u2963",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",Umacr:"\u016A",umacr:"\u016B",uml:"\xA8",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",uogon:"\u0173",Uopf:"\u{1D54C}",uopf:"\u{1D566}",UpArrow:"\u2191",Uparrow:"\u21D1",uparrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",Updownarrow:"\u21D5",updownarrow:"\u2195",UpEquilibrium:"\u296E",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",upsi:"\u03C5",upsih:"\u03D2",Upsilon:"\u03A5",upsilon:"\u03C5",UpTee:"\u22A5",UpTeeArrow:"\u21A5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",Uring:"\u016E",uring:"\u016F",urtri:"\u25F9",Uscr:"\u{1D4B0}",uscr:"\u{1D4CA}",utdot:"\u22F0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",Uuml:"\xDC",uuml:"\xFC",uwangle:"\u29A7",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",vArr:"\u21D5",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",Vbar:"\u2AEB",vBar:"\u2AE8",vBarv:"\u2AE9",Vcy:"\u0412",vcy:"\u0432",VDash:"\u22AB",Vdash:"\u22A9",vDash:"\u22A8",vdash:"\u22A2",Vdashl:"\u2AE6",Vee:"\u22C1",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",Verbar:"\u2016",verbar:"|",Vert:"\u2016",vert:"|",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",Vopf:"\u{1D54D}",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",Vscr:"\u{1D4B1}",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",Vvdash:"\u22AA",vzigzag:"\u299A",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2A5F",Wedge:"\u22C0",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\u{1D51A}",wfr:"\u{1D534}",Wopf:"\u{1D54E}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\u{1D4B2}",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",Xfr:"\u{1D51B}",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",Xi:"\u039E",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",Xopf:"\u{1D54F}",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",Xscr:"\u{1D4B3}",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",Yacute:"\xDD",yacute:"\xFD",YAcy:"\u042F",yacy:"\u044F",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042B",ycy:"\u044B",yen:"\xA5",Yfr:"\u{1D51C}",yfr:"\u{1D536}",YIcy:"\u0407",yicy:"\u0457",Yopf:"\u{1D550}",yopf:"\u{1D56A}",Yscr:"\u{1D4B4}",yscr:"\u{1D4CE}",YUcy:"\u042E",yucy:"\u044E",Yuml:"\u0178",yuml:"\xFF",Zacute:"\u0179",zacute:"\u017A",Zcaron:"\u017D",zcaron:"\u017E",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017B",zdot:"\u017C",zeetrf:"\u2128",ZeroWidthSpace:"\u200B",Zeta:"\u0396",zeta:"\u03B6",Zfr:"\u2128",zfr:"\u{1D537}",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21DD",Zopf:"\u2124",zopf:"\u{1D56B}",Zscr:"\u{1D4B5}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"});hr.entityMap=hr.HTML_ENTITIES});var ws=Fe(qr=>{"use strict";var Ot=pt(),S=vn(),Ds=ir(),Bu=Ot.isHTMLEscapableRawTextElement,Ru=Ot.isHTMLMimeType,Pu=Ot.isHTMLRawTextElement,gr=Ot.hasOwn,gs=Ot.NAMESPACE,Mu=Ds.ParseError,Ou=Ds.DOMException,Bt=0,lt=1,Rt=2,fr=3,Pt=4,Mt=5,pr=6,$r=7;function As(){}As.prototype={parse:function(e,t,r){var n=this.domBuilder;n.startDocument(),$u(t,t=Object.create(null)),Xu(e,t,r,n,this.errorHandler),n.endDocument()}};var Xn=/&#?\w+;?/g;function Xu(e,t,r,n,i){var s=Ru(n.mimeType);e.indexOf(S.UNICODE_REPLACEMENT_CHARACTER)>=0&&i.warning("Unicode replacement character detected, source encoding issues?");function a(I){if(I>65535){I-=65536;var ee=55296+(I>>10),Te=56320+(I&1023);return String.fromCharCode(ee,Te)}else return String.fromCharCode(I)}function u(I){var ee=I[I.length-1]===";"?I:I+";";if(!s&&ee!==I)return i.error("EntityRef: expecting ;"),I;var Te=S.Reference.exec(ee);if(!Te||Te[0].length!==ee.length)return i.error("entity not matching Reference production: "+I),I;var _e=ee.slice(1,-1);return gr(r,_e)?r[_e]:_e.charAt(0)==="#"?a(parseInt(_e.substring(1).replace("x","0x"))):(i.error("entity not found:"+I),I)}function l(I){if(I>y){var ee=e.substring(y,I).replace(Xn,u);h&&p(y),n.characters(ee,0,I-y),y=I}}var o=0,c=0,m=/\r\n?|\n|$/g,h=n.locator;function p(I,ee){for(;I>=c&&(ee=m.exec(e));)o=c,c=ee.index+ee[0].length,h.lineNumber++;h.columnNumber=I-o+1}for(var E=[{currentNSMap:t}],A=[],y=0;;){try{var b=e.indexOf("<",y);if(b<0){if(!s&&A.length>0)return i.fatalError("unclosed xml tag(s): "+A.join(", "));if(!e.substring(y).match(/^\s*$/)){var C=n.doc,w=C.createTextNode(e.substring(y));if(C.documentElement)return i.error("Extra content at the end of the document");C.appendChild(w),n.currentElement=w}return}if(b>y){var x=e.substring(y,b);!s&&A.length===0&&(x=x.replace(new RegExp(S.S_OPT.source,"g"),""),x&&i.error("Unexpected content outside root element: '"+x+"'")),l(b)}switch(e.charAt(b+1)){case"/":var T=e.indexOf(">",b+2),F=e.substring(b+2,T>0?T:void 0);if(!F)return i.fatalError("end tag name missing");var B=S.reg("^",S.QName_group,S.S_OPT,"$"),G=T>0&&B.exec(F);if(!G){var O=T>0&&S.reg("^",S.QName_group).exec(F);if(s&&O)i.warning('end tag name contains invalid trailing characters: "'+F+'"'),G=O;else if(O&&new RegExp(B.source,B.flags+"m").test(F))i.error('end tag name is followed by a line break and trailing content: "'+F+'"'),G=O;else return i.fatalError('end tag name contains invalid characters: "'+F+'"')}if(!n.currentElement&&!n.doc.documentElement)return;var $=A[A.length-1]||n.currentElement.tagName||n.doc.documentElement.tagName||"";if($!==G[1]){var fe=G[1].toLowerCase();if(!s||$.toLowerCase()!==fe)return i.fatalError('Opening and ending tag mismatch: "'+$+'" != "'+F+'"')}var pe=E.pop();A.pop();var H=pe.localNSMap;if(n.endElement(pe.uri,pe.localName,$),H)for(var L in H)gr(H,L)&&n.endPrefixMapping(L);T++;break;case"?":h&&p(b),T=Gu(e,b,n,i);break;case"!":h&&p(b),T=bs(e,b,n,i,s);break;default:h&&p(b);var X=new Cs,Ce=E[E.length-1].currentNSMap,T=ku(e,b,X,Ce,u,i,s),we=X.length;if(X.closed||(s&&Ot.isHTMLVoidElement(X.tagName)?X.closed=!0:A.push(X.tagName)),h&&we){for(var rt=Es(h,{}),se=0;se<we;se++){var g=X[se];p(g.offset),g.locator=Es(h,{})}n.locator=rt,xs(X,n,Ce)&&E.push(X),n.locator=h}else xs(X,n,Ce)&&E.push(X);s&&!X.closed?T=Uu(e,T,X.tagName,u,n):T++}}catch(I){if(I instanceof Mu)throw I;if(I instanceof Ou)return i.fatalError("Error constructing the DOM: "+I.name+": "+I.message,I);i.error("element parse error: "+I),T=-1}T>y?y=T:l(Math.max(b,y)+1)}}function Es(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function ku(e,t,r,n,i,s,a){function u(p,E,A){if(gr(r.attributeNames,p))return s.fatalError("Attribute "+p+" redefined");if(!a&&E.indexOf("<")>=0)return s.fatalError("Unescaped '<' not allowed in attributes values");r.addValue(p,E.replace(/[\t\n\r]/g," ").replace(Xn,i),A)}for(var l,o,c=++t,m=Bt;;){var h=e.charAt(c);if(m===Bt&&h==="<")throw new Error("unexpected < in tag name: "+e.slice(t,c));switch(h){case"=":if(m===lt)l=e.slice(t,c),m=fr;else if(m===Rt)m=fr;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(m===fr||m===lt)if(m===lt&&(s.warning('attribute value must after "="'),l=e.slice(t,c)),t=c+1,c=e.indexOf(h,t),c>0)o=e.slice(t,c),u(l,o,t-1),m=Mt;else throw new Error("attribute value no end '"+h+"' match");else if(m==Pt)o=e.slice(t,c),u(l,o,t),s.warning('attribute "'+l+'" missed start quot('+h+")!!"),t=c+1,m=Mt;else throw new Error('attribute value must after "="');break;case"/":switch(m){case Bt:r.setTagName(e.slice(t,c));case Mt:case pr:case $r:m=$r,r.closed=!0;case Pt:case lt:break;case Rt:r.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return s.error("unexpected end of input"),m==Bt&&r.setTagName(e.slice(t,c)),c;case">":switch(m){case Bt:r.setTagName(e.slice(t,c));case Mt:case pr:case $r:break;case Pt:case lt:o=e.slice(t,c),o.slice(-1)==="/"&&(r.closed=!0,o=o.slice(0,-1));case Rt:m===Rt&&(o=l),m==Pt?(s.warning('attribute "'+o+'" missed quot(")!'),u(l,o,t)):(a||s.warning('attribute "'+o+'" missed value!! "'+o+'" instead!!'),u(o,o,t));break;case fr:if(!a)return s.fatalError(`AttValue: ' or " expected`)}return c;case"\x80":h=" ";default:if(h<=" ")switch(m){case Bt:r.setTagName(e.slice(t,c)),m=pr;break;case lt:l=e.slice(t,c),m=Rt;break;case Pt:var o=e.slice(t,c);s.warning('attribute "'+o+'" missed quot(")!!'),u(l,o,t);case Mt:m=pr;break}else switch(m){case Rt:a||s.warning('attribute "'+l+'" missed value!! "'+l+'" instead2!!'),u(l,l,t),t=c,m=lt;break;case Mt:s.warning('attribute space is required"'+l+'"!!');case pr:m=lt,t=c;break;case fr:m=Pt,t=c;break;case $r:throw new Error("elements closed character '/' and '>' must be connected to")}}c++}}function xs(e,t,r){for(var n=e.tagName,i=null,m=e.length;m--;){var s=e[m],a=s.qName,u=s.value,h=a.indexOf(":");if(h>0)var l=s.prefix=a.slice(0,h),o=a.slice(h+1),c=l==="xmlns"&&o;else o=a,l=null,c=a==="xmlns"&&"";s.localName=o,c!==!1&&(i==null&&(i=Object.create(null),r=Object.create(r)),r[c]=i[c]=u,s.uri=gs.XMLNS,t.startPrefixMapping(c,u))}for(var m=e.length;m--;)s=e[m],s.prefix&&(s.prefix==="xml"&&(s.uri=gs.XML),s.prefix!=="xmlns"&&(s.uri=r[s.prefix]));var h=n.indexOf(":");h>0?(l=e.prefix=n.slice(0,h),o=e.localName=n.slice(h+1)):(l=null,o=e.localName=n);var p=e.uri=r[l||""];if(t.startElement(p,o,n,e),e.closed){if(t.endElement(p,o,n),i)for(l in i)gr(i,l)&&t.endPrefixMapping(l)}else return e.currentNSMap=r,e.localNSMap=i,!0}function Uu(e,t,r,n,i){var s=Bu(r);if(s||Pu(r)){var a=new RegExp("</"+r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+">","ig");a.lastIndex=t;var u=a.exec(e),l=u?u.index:-1;if(l<0)return t+1;var o=e.substring(t+1,l);return s&&(o=o.replace(Xn,n)),i.characters(o,0,o.length),l}return t+1}function $u(e,t){for(var r in e)gr(e,r)&&(t[r]=e[r])}function ys(e,t){var r=t;function n(c){return c=c||0,e.charAt(r+c)}function i(c){c=c||1,r+=c}function s(){for(var c=0;r<e.length;){var m=n();if(m!==" "&&m!==`
|
|
3
|
+
`&&m!==" "&&m!=="\r")return c;c++,i()}return-1}function a(){return e.substring(r)}function u(c){return e.substring(r,r+c.length)===c}function l(c){return e.substring(r,r+c.length).toUpperCase()===c.toUpperCase()}function o(c){var m=S.reg("^",c),h=m.exec(a());return h?(i(h[0].length),h[0]):null}return{char:n,getIndex:function(){return r},getMatch:o,getSource:function(){return e},skip:i,skipBlanks:s,substringFromIndex:a,substringStartsWith:u,substringStartsWithCaseInsensitive:l}}function qu(e,t){function r(u,l){var o=S.PI.exec(u.substringFromIndex());return o?o[1].toLowerCase()==="xml"?l.fatalError("xml declaration is only allowed at the start of the document, but found at position "+u.getIndex()):(u.skip(o[0].length),o[0]):l.fatalError("processing instruction is not well-formed at position "+u.getIndex())}var n=e.getSource();if(e.char()==="["){e.skip(1);for(var i=e.getIndex();e.getIndex()<n.length;){if(e.skipBlanks(),e.char()==="]"){var s=n.substring(i,e.getIndex());return e.skip(1),s}var a=null;if(e.char()==="<"&&e.char(1)==="!")switch(e.char(2)){case"E":e.char(3)==="L"?a=e.getMatch(S.elementdecl):e.char(3)==="N"&&(a=e.getMatch(S.EntityDecl));break;case"A":a=e.getMatch(S.AttlistDecl);break;case"N":a=e.getMatch(S.NotationDecl);break;case"-":a=e.getMatch(S.Comment);break}else if(e.char()==="<"&&e.char(1)==="?")a=r(e,t);else if(e.char()==="%")a=e.getMatch(S.PEReference);else return t.fatalError("Error detected in Markup declaration");if(!a)return t.fatalError("Error in internal subset at position "+e.getIndex())}return t.fatalError("doctype internal subset is not well-formed, missing ]")}}function bs(e,t,r,n,i){var s=ys(e,t);switch(i?s.char(2).toUpperCase():s.char(2)){case"-":var a=s.getMatch(S.Comment);return a?(r.comment(a,S.COMMENT_START.length,a.length-S.COMMENT_START.length-S.COMMENT_END.length),s.getIndex()):n.fatalError("comment is not well-formed at position "+s.getIndex());case"[":var u=s.getMatch(S.CDSect);return u?!i&&!r.currentElement?n.fatalError("CDATA outside of element"):(r.startCDATA(),r.characters(u,S.CDATA_START.length,u.length-S.CDATA_START.length-S.CDATA_END.length),r.endCDATA(),s.getIndex()):n.fatalError("Invalid CDATA starting at position "+t);case"D":{if(r.doc&&r.doc.documentElement)return n.fatalError("Doctype not allowed inside or after documentElement at position "+s.getIndex());if(i?!s.substringStartsWithCaseInsensitive(S.DOCTYPE_DECL_START):!s.substringStartsWith(S.DOCTYPE_DECL_START))return n.fatalError("Expected "+S.DOCTYPE_DECL_START+" at position "+s.getIndex());if(s.skip(S.DOCTYPE_DECL_START.length),s.skipBlanks()<1)return n.fatalError("Expected whitespace after "+S.DOCTYPE_DECL_START+" at position "+s.getIndex());var l={name:void 0,publicId:void 0,systemId:void 0,internalSubset:void 0};if(l.name=s.getMatch(S.Name),!l.name)return n.fatalError("doctype name missing or contains unexpected characters at position "+s.getIndex());if(i&&l.name.toLowerCase()!=="html"&&n.warning("Unexpected DOCTYPE in HTML document at position "+s.getIndex()),s.skipBlanks(),s.substringStartsWith(S.PUBLIC)||s.substringStartsWith(S.SYSTEM)){var o=S.ExternalID_match.exec(s.substringFromIndex());if(!o)return n.fatalError("doctype external id is not well-formed at position "+s.getIndex());o.groups.SystemLiteralOnly!==void 0?l.systemId=o.groups.SystemLiteralOnly:(l.systemId=o.groups.SystemLiteral,l.publicId=o.groups.PubidLiteral),s.skip(o[0].length)}else if(i&&s.substringStartsWithCaseInsensitive(S.SYSTEM)){if(s.skip(S.SYSTEM.length),s.skipBlanks()<1)return n.fatalError("Expected whitespace after "+S.SYSTEM+" at position "+s.getIndex());if(l.systemId=s.getMatch(S.ABOUT_LEGACY_COMPAT_SystemLiteral),!l.systemId)return n.fatalError("Expected "+S.ABOUT_LEGACY_COMPAT+" in single or double quotes after "+S.SYSTEM+" at position "+s.getIndex())}return i&&l.systemId&&!S.ABOUT_LEGACY_COMPAT_SystemLiteral.test(l.systemId)&&n.warning("Unexpected doctype.systemId in HTML document at position "+s.getIndex()),i||(s.skipBlanks(),l.internalSubset=qu(s,n)),s.skipBlanks(),s.char()!==">"?n.fatalError("doctype not terminated with > at position "+s.getIndex()):(s.skip(1),r.startDTD(l.name,l.publicId,l.systemId,l.internalSubset),r.endDTD(),s.getIndex())}default:return n.fatalError('Not well-formed XML starting with "<!" at position '+t)}}function Gu(e,t,r,n){var i=e.substring(t).match(S.PI);if(!i)return n.fatalError("Invalid processing instruction starting at position "+t);if(i[1].toLowerCase()==="xml"){if(t>0)return n.fatalError("processing instruction at position "+t+" is an xml declaration which is only at the start of the document");if(!S.XMLDecl.test(e.substring(t)))return n.fatalError("xml declaration is not well-formed")}return r.processingInstruction(i[1],i[2]),t+i[0].length}function Cs(){this.attributeNames=Object.create(null)}Cs.prototype={setTagName:function(e){if(!S.QName_exact.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,r){if(!S.QName_exact.test(e))throw new Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:r}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}};qr.XMLReader=As;qr.parseUtils=ys;qr.parseDoctypeCommentOrCData=bs});var Fs=Fe(kt=>{"use strict";var Et=pt(),Hu=On(),Vu=ir(),Ts=ps(),Zu=ws(),ju=Hu.DOMImplementation,zu=Et.hasDefaultHTMLNamespace,Yu=Et.isHTMLMimeType,Wu=Et.isValidMimeType,Ss=Et.MIME_TYPE,kn=Et.NAMESPACE,Ns=Vu.ParseError,Ju=Zu.XMLReader;function Is(e){return e.replace(/\r[\n\u0085]/g,`
|
|
4
|
+
`).replace(/[\r\u0085\u2028\u2029]/g,`
|
|
5
|
+
`)}function _s(e){if(e=e||{},e.locator===void 0&&(e.locator=!0),this.assign=e.assign||Et.assign,this.domHandler=e.domHandler||Hr,this.onError=e.onError||e.errorHandler,e.errorHandler&&typeof e.errorHandler!="function")throw new TypeError("errorHandler object is no longer supported, switch to onError!");e.errorHandler&&e.errorHandler("warning","The `errorHandler` option has been deprecated, use `onError` instead!",this),this.normalizeLineEndings=e.normalizeLineEndings||Is,this.locator=!!e.locator,this.xmlns=this.assign(Object.create(null),e.xmlns)}_s.prototype.parseFromString=function(e,t){if(!Wu(t))throw new TypeError('DOMParser.parseFromString: the provided mimeType "'+t+'" is not valid.');var r=this.assign(Object.create(null),this.xmlns),n=Ts.XML_ENTITIES,i=r[""]||null;zu(t)?(n=Ts.HTML_ENTITIES,i=kn.HTML):t===Ss.XML_SVG_IMAGE&&(i=kn.SVG),r[""]=i,r.xml=r.xml||kn.XML;var s=new this.domHandler({mimeType:t,defaultNamespace:i,onError:this.onError}),a=this.locator?{}:void 0;this.locator&&s.setDocumentLocator(a);var u=new Ju;u.errorHandler=s,u.domBuilder=s;var l=!Et.isHTMLMimeType(t);return l&&typeof e!="string"&&u.errorHandler.fatalError("source is not a string"),u.parse(this.normalizeLineEndings(String(e)),r,n),s.doc.documentElement||u.errorHandler.fatalError("missing root element"),s.doc};function Hr(e){var t=e||{};this.mimeType=t.mimeType||Ss.XML_APPLICATION,this.defaultNamespace=t.defaultNamespace||null,this.cdata=!1,this.currentElement=void 0,this.doc=void 0,this.locator=void 0,this.onError=t.onError}function Xt(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}Hr.prototype={startDocument:function(){var e=new ju;this.doc=Yu(this.mimeType)?e.createHTMLDocument(!1):e.createDocument(this.defaultNamespace,"")},startElement:function(e,t,r,n){var i=this.doc,s=i.createElementNS(e,r||t),a=n.length;Gr(this,s),this.currentElement=s,this.locator&&Xt(this.locator,s);for(var u=0;u<a;u++){var e=n.getURI(u),l=n.getValue(u),r=n.getQName(u),o=i.createAttributeNS(e,r);this.locator&&Xt(n.getLocator(u),o),o.value=o.nodeValue=l,s.setAttributeNode(o)}},endElement:function(e,t,r){this.currentElement=this.currentElement.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){var r=this.doc.createProcessingInstruction(e,t);this.locator&&Xt(this.locator,r),Gr(this,r)},ignorableWhitespace:function(e,t,r){},characters:function(e,t,r){if(e=vs.apply(this,arguments),e){if(this.cdata)var n=this.doc.createCDATASection(e);else var n=this.doc.createTextNode(e);this.currentElement?this.currentElement.appendChild(n):/^\s*$/.test(e)&&this.doc.appendChild(n),this.locator&&Xt(this.locator,n)}},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){e&&(e.lineNumber=0),this.locator=e},comment:function(e,t,r){e=vs.apply(this,arguments);var n=this.doc.createComment(e);this.locator&&Xt(this.locator,n),Gr(this,n)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,r,n){var i=this.doc.implementation;if(i&&i.createDocumentType){var s=i.createDocumentType(e,t,r,n);this.locator&&Xt(this.locator,s),Gr(this,s),this.doc.doctype=s}},reportError:function(e,t){if(typeof this.onError=="function")try{this.onError(e,t,this)}catch(r){throw new Ns("Reporting "+e+' "'+t+'" caused '+r,this.locator)}else console.error("[xmldom "+e+"] "+t,Qu(this.locator))},warning:function(e){this.reportError("warning",e)},error:function(e){this.reportError("error",e)},fatalError:function(e,t){throw this.reportError("fatalError",e),new Ns(e,this.locator,t)}};function Qu(e){if(e)return`
|
|
6
|
+
@#[line:`+e.lineNumber+",col:"+e.columnNumber+"]"}function vs(e,t,r){return typeof e=="string"?e.substr(t,r):e.length>=t+r||t?new java.lang.String(e,t,r)+"":e}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(e){Hr.prototype[e]=function(){return null}});function Gr(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}function Ku(e){if(e==="error")throw"onErrorStopParsing"}function el(){throw"onWarningStopParsing"}kt.__DOMHandler=Hr;kt.DOMParser=_s;kt.normalizeLineEndings=Is;kt.onErrorStopParsing=Ku;kt.onWarningStopParsing=el});var Ls=Fe(M=>{"use strict";var Ut=pt();M.assign=Ut.assign;M.hasDefaultHTMLNamespace=Ut.hasDefaultHTMLNamespace;M.isHTMLMimeType=Ut.isHTMLMimeType;M.isValidMimeType=Ut.isValidMimeType;M.MIME_TYPE=Ut.MIME_TYPE;M.NAMESPACE=Ut.NAMESPACE;var Vr=ir();M.DOMException=Vr.DOMException;M.DOMExceptionName=Vr.DOMExceptionName;M.ExceptionCode=Vr.ExceptionCode;M.ParseError=Vr.ParseError;var re=On();M.Attr=re.Attr;M.CDATASection=re.CDATASection;M.CharacterData=re.CharacterData;M.Comment=re.Comment;M.Document=re.Document;M.DocumentFragment=re.DocumentFragment;M.DocumentType=re.DocumentType;M.DOMImplementation=re.DOMImplementation;M.Element=re.Element;M.Entity=re.Entity;M.EntityReference=re.EntityReference;M.LiveNodeList=re.LiveNodeList;M.NamedNodeMap=re.NamedNodeMap;M.Node=re.Node;M.NodeList=re.NodeList;M.Notation=re.Notation;M.ProcessingInstruction=re.ProcessingInstruction;M.Text=re.Text;M.XMLSerializer=re.XMLSerializer;var Zr=Fs();M.DOMParser=Zr.DOMParser;M.normalizeLineEndings=Zr.normalizeLineEndings;M.onErrorStopParsing=Zr.onErrorStopParsing;M.onWarningStopParsing=Zr.onWarningStopParsing});var Rs=Fe(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.CHAR=`
|
|
7
|
+
\r -\uD7FF\uE000-\uFFFD\u{10000}-\u{10FFFF}`;V.S=` \r
|
|
8
|
+
`;V.NAME_START_CHAR=":A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}";V.NAME_CHAR="-"+V.NAME_START_CHAR+".0-9\xB7\u0300-\u036F\u203F-\u2040";V.CHAR_RE=new RegExp("^["+V.CHAR+"]$","u");V.S_RE=new RegExp("^["+V.S+"]+$","u");V.NAME_START_CHAR_RE=new RegExp("^["+V.NAME_START_CHAR+"]$","u");V.NAME_CHAR_RE=new RegExp("^["+V.NAME_CHAR+"]$","u");V.NAME_RE=new RegExp("^["+V.NAME_START_CHAR+"]["+V.NAME_CHAR+"]*$","u");V.NMTOKEN_RE=new RegExp("^["+V.NAME_CHAR+"]+$","u");var Un=9,$n=10,qn=13,Gn=32;V.S_LIST=[Gn,$n,qn,Un];function tl(e){return e>=Gn&&e<=55295||e===$n||e===qn||e===Un||e>=57344&&e<=65533||e>=65536&&e<=1114111}V.isChar=tl;function rl(e){return e===Gn||e===$n||e===qn||e===Un}V.isS=rl;function Bs(e){return e>=65&&e<=90||e>=97&&e<=122||e===58||e===95||e===8204||e===8205||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}V.isNameStartChar=Bs;function nl(e){return Bs(e)||e>=48&&e<=57||e===45||e===46||e===183||e>=768&&e<=879||e>=8255&&e<=8256}V.isNameChar=nl});var Us=Fe(U=>{"use strict";Object.defineProperty(U,"__esModule",{value:!0});U.CHAR="-\uD7FF\uE000-\uFFFD\u{10000}-\u{10FFFF}";U.RESTRICTED_CHAR="-\b\v\f-\x7F-\x84\x86-\x9F";U.S=` \r
|
|
9
|
+
`;U.NAME_START_CHAR=":A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}";U.NAME_CHAR="-"+U.NAME_START_CHAR+".0-9\xB7\u0300-\u036F\u203F-\u2040";U.CHAR_RE=new RegExp("^["+U.CHAR+"]$","u");U.RESTRICTED_CHAR_RE=new RegExp("^["+U.RESTRICTED_CHAR+"]$","u");U.S_RE=new RegExp("^["+U.S+"]+$","u");U.NAME_START_CHAR_RE=new RegExp("^["+U.NAME_START_CHAR+"]$","u");U.NAME_CHAR_RE=new RegExp("^["+U.NAME_CHAR+"]$","u");U.NAME_RE=new RegExp("^["+U.NAME_START_CHAR+"]["+U.NAME_CHAR+"]*$","u");U.NMTOKEN_RE=new RegExp("^["+U.NAME_CHAR+"]+$","u");var Ps=9,Ms=10,Os=13,Xs=32;U.S_LIST=[Xs,Ms,Os,Ps];function il(e){return e>=1&&e<=55295||e>=57344&&e<=65533||e>=65536&&e<=1114111}U.isChar=il;function sl(e){return e>=1&&e<=8||e===11||e===12||e>=14&&e<=31||e>=127&&e<=132||e>=134&&e<=159}U.isRestrictedChar=sl;function al(e){return e===9||e===10||e===13||e>31&&e<127||e===133||e>159&&e<=55295||e>=57344&&e<=65533||e>=65536&&e<=1114111}U.isCharAndNotRestricted=al;function ol(e){return e===Xs||e===Ms||e===Os||e===Ps}U.isS=ol;function ks(e){return e>=65&&e<=90||e>=97&&e<=122||e===58||e===95||e===8204||e===8205||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}U.isNameStartChar=ks;function ul(e){return ks(e)||e>=48&&e<=57||e===45||e===46||e===183||e>=768&&e<=879||e>=8255&&e<=8256}U.isNameChar=ul});var qs=Fe(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.NC_NAME_START_CHAR="A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}";De.NC_NAME_CHAR="-"+De.NC_NAME_START_CHAR+".0-9\xB7\u0300-\u036F\u203F-\u2040";De.NC_NAME_START_CHAR_RE=new RegExp("^["+De.NC_NAME_START_CHAR+"]$","u");De.NC_NAME_CHAR_RE=new RegExp("^["+De.NC_NAME_CHAR+"]$","u");De.NC_NAME_RE=new RegExp("^["+De.NC_NAME_START_CHAR+"]["+De.NC_NAME_CHAR+"]*$","u");function $s(e){return e>=65&&e<=90||e===95||e>=97&&e<=122||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}De.isNCNameStartChar=$s;function ll(e){return $s(e)||e===45||e===46||e>=48&&e<=57||e===183||e>=768&&e<=879||e>=8255&&e<=8256}De.isNCNameChar=ll});var ii=Fe(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.SaxesParser=Vt.EVENTS=void 0;var Zt=Rs(),cl=Us(),ni=qs(),Ae=Zt.isS,ml=Zt.isChar,Er=Zt.isNameStartChar,Gs=Zt.isNameChar,na=Zt.S_LIST,dl=Zt.NAME_RE,hl=cl.isChar,fl=ni.isNCNameStartChar,pl=ni.isNCNameChar,gl=ni.NC_NAME_RE,Qr="http://www.w3.org/XML/1998/namespace",Ht="http://www.w3.org/2000/xmlns/",El={__proto__:null,xml:Qr,xmlns:Ht},xl={__proto__:null,amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},Y=-1,He=-2,Hs=0,Dl=1,Hn=2,Al=3,$t=4,yl=5,bl=6,Cl=7,Vn=8,wl=9,Tl=10,Nl=11,vl=12,he=13,jr=14,Zn=15,Sl=16,jn=17,Il=18,_l=19,zn=20,Fl=21,Ll=22,Bl=23,Vs=24,Yn=25,zr=26,Zs=27,Rl=28,Pl=29,js=30,Ml=31,Ol=32,xt=33,Xl=34,Wn=35,xr=36,Jn=37,kl=38,zs=39,Ys=40,Ul=41,Ws=42,$l=43,ql=44,Qn=9,Oe=10,Kn=13,Js=32,Qs=33,ia=34,Dr=38,sa=39,Yr=45,Wr=47,Gl=59,ct=60,qt=61,ne=62,le=63,aa=91,Gt=93,Ks=133,ea=8232,Jr=e=>e===ia||e===sa,oa=[ia,sa],Hl=[...oa,aa,ne],Vl=[...oa,ct,Gt],Zl=[qt,le,...na],jl=[...na,ne,Dr,ct];function ti(e,t,r){switch(t){case"xml":r!==Qr&&e.fail(`xml prefix must be bound to ${Qr}.`);break;case"xmlns":r!==Ht&&e.fail(`xmlns prefix must be bound to ${Ht}.`);break;default:}switch(r){case Ht:e.fail(t===""?`the default namespace may not be set to ${r}.`:`may not assign a prefix (even "xmlns") to the URI ${Ht}.`);break;case Qr:switch(t){case"xml":break;case"":e.fail(`the default namespace may not be set to ${r}.`);break;default:e.fail("may not assign the xml namespace to another prefix.")}break;default:}}function zl(e,t){for(let r of Object.keys(t))ti(e,r,t[r])}var Yl=e=>gl.test(e),Wl=e=>dl.test(e),Dt=0,ta=1,ei=2;Vt.EVENTS=["xmldecl","text","processinginstruction","doctype","comment","opentagstart","attribute","opentag","closetag","cdata","error","end","ready"];var ra={xmldecl:"xmldeclHandler",text:"textHandler",processinginstruction:"piHandler",doctype:"doctypeHandler",comment:"commentHandler",opentagstart:"openTagStartHandler",attribute:"attributeHandler",opentag:"openTagHandler",closetag:"closeTagHandler",cdata:"cdataHandler",error:"errorHandler",end:"endHandler",ready:"readyHandler"},ri=class{constructor(t){this.opt=t??{},this.fragmentOpt=!!this.opt.fragment;let r=this.xmlnsOpt=!!this.opt.xmlns;if(this.trackPosition=this.opt.position!==!1,this.fileName=this.opt.fileName,r){this.nameStartCheck=fl,this.nameCheck=pl,this.isName=Yl,this.processAttribs=this.processAttribsNS,this.pushAttrib=this.pushAttribNS,this.ns=Object.assign({__proto__:null},El);let n=this.opt.additionalNamespaces;n!=null&&(zl(this,n),Object.assign(this.ns,n))}else this.nameStartCheck=Er,this.nameCheck=Gs,this.isName=Wl,this.processAttribs=this.processAttribsPlain,this.pushAttrib=this.pushAttribPlain;this.stateTable=[this.sBegin,this.sBeginWhitespace,this.sDoctype,this.sDoctypeQuote,this.sDTD,this.sDTDQuoted,this.sDTDOpenWaka,this.sDTDOpenWakaBang,this.sDTDComment,this.sDTDCommentEnding,this.sDTDCommentEnded,this.sDTDPI,this.sDTDPIEnding,this.sText,this.sEntity,this.sOpenWaka,this.sOpenWakaBang,this.sComment,this.sCommentEnding,this.sCommentEnded,this.sCData,this.sCDataEnding,this.sCDataEnding2,this.sPIFirstChar,this.sPIRest,this.sPIBody,this.sPIEnding,this.sXMLDeclNameStart,this.sXMLDeclName,this.sXMLDeclEq,this.sXMLDeclValueStart,this.sXMLDeclValue,this.sXMLDeclSeparator,this.sXMLDeclEnding,this.sOpenTag,this.sOpenTagSlash,this.sAttrib,this.sAttribName,this.sAttribNameSawWhite,this.sAttribValue,this.sAttribValueQuoted,this.sAttribValueClosed,this.sAttribValueUnquoted,this.sCloseTag,this.sCloseTagSawWhite],this._init()}get closed(){return this._closed}_init(){var t;this.openWakaBang="",this.text="",this.name="",this.piTarget="",this.entity="",this.q=null,this.tags=[],this.tag=null,this.topNS=null,this.chunk="",this.chunkPosition=0,this.i=0,this.prevI=0,this.carriedFromPrevious=void 0,this.forbiddenState=Dt,this.attribList=[];let{fragmentOpt:r}=this;this.state=r?he:Hs,this.reportedTextBeforeRoot=this.reportedTextAfterRoot=this.closedRoot=this.sawRoot=r,this.xmlDeclPossible=!r,this.xmlDeclExpects=["version"],this.entityReturnState=void 0;let{defaultXMLVersion:n}=this.opt;if(n===void 0){if(this.opt.forceXMLVersion===!0)throw new Error("forceXMLVersion set but defaultXMLVersion is not set");n="1.0"}this.setXMLVersion(n),this.positionAtNewLine=0,this.doctype=!1,this._closed=!1,this.xmlDecl={version:void 0,encoding:void 0,standalone:void 0},this.line=1,this.column=0,this.ENTITIES=Object.create(xl),(t=this.readyHandler)===null||t===void 0||t.call(this)}get position(){return this.chunkPosition+this.i}get columnIndex(){return this.position-this.positionAtNewLine}on(t,r){this[ra[t]]=r}off(t){this[ra[t]]=void 0}makeError(t){var r;let n=(r=this.fileName)!==null&&r!==void 0?r:"";return this.trackPosition&&(n.length>0&&(n+=":"),n+=`${this.line}:${this.column}`),n.length>0&&(n+=": "),new Error(n+t)}fail(t){let r=this.makeError(t),n=this.errorHandler;if(n===void 0)throw r;return n(r),this}write(t){if(this.closed)return this.fail("cannot write after close; assign an onready handler.");let r=!1;t===null?(r=!0,t=""):typeof t=="object"&&(t=t.toString()),this.carriedFromPrevious!==void 0&&(t=`${this.carriedFromPrevious}${t}`,this.carriedFromPrevious=void 0);let n=t.length,i=t.charCodeAt(n-1);!r&&(i===Kn||i>=55296&&i<=56319)&&(this.carriedFromPrevious=t[n-1],n--,t=t.slice(0,n));let{stateTable:s}=this;for(this.chunk=t,this.i=0;this.i<n;)s[this.state].call(this);return this.chunkPosition+=n,r?this.end():this}close(){return this.write(null)}getCode10(){let{chunk:t,i:r}=this;if(this.prevI=r,this.i=r+1,r>=t.length)return Y;let n=t.charCodeAt(r);if(this.column++,n<55296){if(n>=Js||n===Qn)return n;switch(n){case Oe:return this.line++,this.column=0,this.positionAtNewLine=this.position,Oe;case Kn:return t.charCodeAt(r+1)===Oe&&(this.i=r+2),this.line++,this.column=0,this.positionAtNewLine=this.position,He;default:return this.fail("disallowed character."),n}}if(n>56319)return n>=57344&&n<=65533||this.fail("disallowed character."),n;let i=65536+(n-55296)*1024+(t.charCodeAt(r+1)-56320);return this.i=r+2,i>1114111&&this.fail("disallowed character."),i}getCode11(){let{chunk:t,i:r}=this;if(this.prevI=r,this.i=r+1,r>=t.length)return Y;let n=t.charCodeAt(r);if(this.column++,n<55296){if(n>31&&n<127||n>159&&n!==ea||n===Qn)return n;switch(n){case Oe:return this.line++,this.column=0,this.positionAtNewLine=this.position,Oe;case Kn:{let s=t.charCodeAt(r+1);(s===Oe||s===Ks)&&(this.i=r+2)}case Ks:case ea:return this.line++,this.column=0,this.positionAtNewLine=this.position,He;default:return this.fail("disallowed character."),n}}if(n>56319)return n>=57344&&n<=65533||this.fail("disallowed character."),n;let i=65536+(n-55296)*1024+(t.charCodeAt(r+1)-56320);return this.i=r+2,i>1114111&&this.fail("disallowed character."),i}getCodeNorm(){let t=this.getCode();return t===He?Oe:t}unget(){this.i=this.prevI,this.column--}captureTo(t){let{i:r}=this,{chunk:n}=this;for(;;){let i=this.getCode(),s=i===He,a=s?Oe:i;if(a===Y||t.includes(a))return this.text+=n.slice(r,this.prevI),a;s&&(this.text+=`${n.slice(r,this.prevI)}
|
|
10
|
+
`,r=this.i)}}captureToChar(t){let{i:r}=this,{chunk:n}=this;for(;;){let i=this.getCode();switch(i){case He:this.text+=`${n.slice(r,this.prevI)}
|
|
11
|
+
`,r=this.i,i=Oe;break;case Y:return this.text+=n.slice(r),!1;default:}if(i===t)return this.text+=n.slice(r,this.prevI),!0}}captureNameChars(){let{chunk:t,i:r}=this;for(;;){let n=this.getCode();if(n===Y)return this.name+=t.slice(r),Y;if(!Gs(n))return this.name+=t.slice(r,this.prevI),n===He?Oe:n}}skipSpaces(){for(;;){let t=this.getCodeNorm();if(t===Y||!Ae(t))return t}}setXMLVersion(t){this.currentXMLVersion=t,t==="1.0"?(this.isChar=ml,this.getCode=this.getCode10):(this.isChar=hl,this.getCode=this.getCode11)}sBegin(){this.chunk.charCodeAt(0)===65279&&(this.i++,this.column++),this.state=Dl}sBeginWhitespace(){let t=this.i,r=this.skipSpaces();switch(this.prevI!==t&&(this.xmlDeclPossible=!1),r){case ct:if(this.state=Zn,this.text.length!==0)throw new Error("no-empty text at start");break;case Y:break;default:this.unget(),this.state=he,this.xmlDeclPossible=!1}}sDoctype(){var t;let r=this.captureTo(Hl);switch(r){case ne:{(t=this.doctypeHandler)===null||t===void 0||t.call(this,this.text),this.text="",this.state=he,this.doctype=!0;break}case Y:break;default:this.text+=String.fromCodePoint(r),r===aa?this.state=$t:Jr(r)&&(this.state=Al,this.q=r)}}sDoctypeQuote(){let t=this.q;this.captureToChar(t)&&(this.text+=String.fromCodePoint(t),this.q=null,this.state=Hn)}sDTD(){let t=this.captureTo(Vl);t!==Y&&(this.text+=String.fromCodePoint(t),t===Gt?this.state=Hn:t===ct?this.state=bl:Jr(t)&&(this.state=yl,this.q=t))}sDTDQuoted(){let t=this.q;this.captureToChar(t)&&(this.text+=String.fromCodePoint(t),this.state=$t,this.q=null)}sDTDOpenWaka(){let t=this.getCodeNorm();switch(this.text+=String.fromCodePoint(t),t){case Qs:this.state=Cl,this.openWakaBang="";break;case le:this.state=Nl;break;default:this.state=$t}}sDTDOpenWakaBang(){let t=String.fromCodePoint(this.getCodeNorm()),r=this.openWakaBang+=t;this.text+=t,r!=="-"&&(this.state=r==="--"?Vn:$t,this.openWakaBang="")}sDTDComment(){this.captureToChar(Yr)&&(this.text+="-",this.state=wl)}sDTDCommentEnding(){let t=this.getCodeNorm();this.text+=String.fromCodePoint(t),this.state=t===Yr?Tl:Vn}sDTDCommentEnded(){let t=this.getCodeNorm();this.text+=String.fromCodePoint(t),t===ne?this.state=$t:(this.fail("malformed comment."),this.state=Vn)}sDTDPI(){this.captureToChar(le)&&(this.text+="?",this.state=vl)}sDTDPIEnding(){let t=this.getCodeNorm();this.text+=String.fromCodePoint(t),t===ne&&(this.state=$t)}sText(){this.tags.length!==0?this.handleTextInRoot():this.handleTextOutsideRoot()}sEntity(){let{i:t}=this,{chunk:r}=this;e:for(;;)switch(this.getCode()){case He:this.entity+=`${r.slice(t,this.prevI)}
|
|
12
|
+
`,t=this.i;break;case Gl:{let{entityReturnState:n}=this,i=this.entity+r.slice(t,this.prevI);this.state=n;let s;i===""?(this.fail("empty entity name."),s="&;"):(s=this.parseEntity(i),this.entity=""),(n!==he||this.textHandler!==void 0)&&(this.text+=s);break e}case Y:this.entity+=r.slice(t);break e;default:}}sOpenWaka(){let t=this.getCode();if(Er(t))this.state=Xl,this.unget(),this.xmlDeclPossible=!1;else switch(t){case Wr:this.state=$l,this.xmlDeclPossible=!1;break;case Qs:this.state=Sl,this.openWakaBang="",this.xmlDeclPossible=!1;break;case le:this.state=Bl;break;default:this.fail("disallowed character in tag name"),this.state=he,this.xmlDeclPossible=!1}}sOpenWakaBang(){switch(this.openWakaBang+=String.fromCodePoint(this.getCodeNorm()),this.openWakaBang){case"[CDATA[":!this.sawRoot&&!this.reportedTextBeforeRoot&&(this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0),this.closedRoot&&!this.reportedTextAfterRoot&&(this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0),this.state=zn,this.openWakaBang="";break;case"--":this.state=jn,this.openWakaBang="";break;case"DOCTYPE":this.state=Hn,(this.doctype||this.sawRoot)&&this.fail("inappropriately located doctype declaration."),this.openWakaBang="";break;default:this.openWakaBang.length>=7&&this.fail("incorrect syntax.")}}sComment(){this.captureToChar(Yr)&&(this.state=Il)}sCommentEnding(){var t;let r=this.getCodeNorm();r===Yr?(this.state=_l,(t=this.commentHandler)===null||t===void 0||t.call(this,this.text),this.text=""):(this.text+=`-${String.fromCodePoint(r)}`,this.state=jn)}sCommentEnded(){let t=this.getCodeNorm();t!==ne?(this.fail("malformed comment."),this.text+=`--${String.fromCodePoint(t)}`,this.state=jn):this.state=he}sCData(){this.captureToChar(Gt)&&(this.state=Fl)}sCDataEnding(){let t=this.getCodeNorm();t===Gt?this.state=Ll:(this.text+=`]${String.fromCodePoint(t)}`,this.state=zn)}sCDataEnding2(){var t;let r=this.getCodeNorm();switch(r){case ne:{(t=this.cdataHandler)===null||t===void 0||t.call(this,this.text),this.text="",this.state=he;break}case Gt:this.text+="]";break;default:this.text+=`]]${String.fromCodePoint(r)}`,this.state=zn}}sPIFirstChar(){let t=this.getCodeNorm();this.nameStartCheck(t)?(this.piTarget+=String.fromCodePoint(t),this.state=Vs):t===le||Ae(t)?(this.fail("processing instruction without a target."),this.state=t===le?zr:Yn):(this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(t),this.state=Vs)}sPIRest(){let{chunk:t,i:r}=this;for(;;){let n=this.getCodeNorm();if(n===Y){this.piTarget+=t.slice(r);return}if(!this.nameCheck(n)){this.piTarget+=t.slice(r,this.prevI);let i=n===le;i||Ae(n)?this.piTarget==="xml"?(this.xmlDeclPossible||this.fail("an XML declaration must be at the start of the document."),this.state=i?xt:Zs):this.state=i?zr:Yn:(this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(n));break}}}sPIBody(){if(this.text.length===0){let t=this.getCodeNorm();t===le?this.state=zr:Ae(t)||(this.text=String.fromCodePoint(t))}else this.captureToChar(le)&&(this.state=zr)}sPIEnding(){var t;let r=this.getCodeNorm();if(r===ne){let{piTarget:n}=this;n.toLowerCase()==="xml"&&this.fail("the XML declaration must appear at the start of the document."),(t=this.piHandler)===null||t===void 0||t.call(this,{target:n,body:this.text}),this.piTarget=this.text="",this.state=he}else r===le?this.text+="?":(this.text+=`?${String.fromCodePoint(r)}`,this.state=Yn);this.xmlDeclPossible=!1}sXMLDeclNameStart(){let t=this.skipSpaces();if(t===le){this.state=xt;return}t!==Y&&(this.state=Rl,this.name=String.fromCodePoint(t))}sXMLDeclName(){let t=this.captureTo(Zl);if(t===le){this.state=xt,this.name+=this.text,this.text="",this.fail("XML declaration is incomplete.");return}if(Ae(t)||t===qt){if(this.name+=this.text,this.text="",!this.xmlDeclExpects.includes(this.name))switch(this.name.length){case 0:this.fail("did not expect any more name/value pairs.");break;case 1:this.fail(`expected the name ${this.xmlDeclExpects[0]}.`);break;default:this.fail(`expected one of ${this.xmlDeclExpects.join(", ")}`)}this.state=t===qt?js:Pl}}sXMLDeclEq(){let t=this.getCodeNorm();if(t===le){this.state=xt,this.fail("XML declaration is incomplete.");return}Ae(t)||(t!==qt&&this.fail("value required."),this.state=js)}sXMLDeclValueStart(){let t=this.getCodeNorm();if(t===le){this.state=xt,this.fail("XML declaration is incomplete.");return}Ae(t)||(Jr(t)?this.q=t:(this.fail("value must be quoted."),this.q=Js),this.state=Ml)}sXMLDeclValue(){let t=this.captureTo([this.q,le]);if(t===le){this.state=xt,this.text="",this.fail("XML declaration is incomplete.");return}if(t===Y)return;let r=this.text;switch(this.text="",this.name){case"version":{this.xmlDeclExpects=["encoding","standalone"];let n=r;this.xmlDecl.version=n,/^1\.[0-9]+$/.test(n)?this.opt.forceXMLVersion||this.setXMLVersion(n):this.fail("version number must match /^1\\.[0-9]+$/.");break}case"encoding":/^[A-Za-z][A-Za-z0-9._-]*$/.test(r)||this.fail("encoding value must match /^[A-Za-z0-9][A-Za-z0-9._-]*$/."),this.xmlDeclExpects=["standalone"],this.xmlDecl.encoding=r;break;case"standalone":r!=="yes"&&r!=="no"&&this.fail('standalone value must match "yes" or "no".'),this.xmlDeclExpects=[],this.xmlDecl.standalone=r;break;default:}this.name="",this.state=Ol}sXMLDeclSeparator(){let t=this.getCodeNorm();if(t===le){this.state=xt;return}Ae(t)||(this.fail("whitespace required."),this.unget()),this.state=Zs}sXMLDeclEnding(){var t;this.getCodeNorm()===ne?(this.piTarget!=="xml"?this.fail("processing instructions are not allowed before root."):this.name!=="version"&&this.xmlDeclExpects.includes("version")&&this.fail("XML declaration must contain a version."),(t=this.xmldeclHandler)===null||t===void 0||t.call(this,this.xmlDecl),this.name="",this.piTarget=this.text="",this.state=he):this.fail("The character ? is disallowed anywhere in XML declarations."),this.xmlDeclPossible=!1}sOpenTag(){var t;let r=this.captureNameChars();if(r===Y)return;let n=this.tag={name:this.name,attributes:Object.create(null)};switch(this.name="",this.xmlnsOpt&&(this.topNS=n.ns=Object.create(null)),(t=this.openTagStartHandler)===null||t===void 0||t.call(this,n),this.sawRoot=!0,!this.fragmentOpt&&this.closedRoot&&this.fail("documents may contain only one root."),r){case ne:this.openTag();break;case Wr:this.state=Wn;break;default:Ae(r)||this.fail("disallowed character in tag name."),this.state=xr}}sOpenTagSlash(){this.getCode()===ne?this.openSelfClosingTag():(this.fail("forward-slash in opening tag not followed by >."),this.state=xr)}sAttrib(){let t=this.skipSpaces();t!==Y&&(Er(t)?(this.unget(),this.state=Jn):t===ne?this.openTag():t===Wr?this.state=Wn:this.fail("disallowed character in attribute name."))}sAttribName(){let t=this.captureNameChars();t===qt?this.state=zs:Ae(t)?this.state=kl:t===ne?(this.fail("attribute without value."),this.pushAttrib(this.name,this.name),this.name=this.text="",this.openTag()):t!==Y&&this.fail("disallowed character in attribute name.")}sAttribNameSawWhite(){let t=this.skipSpaces();switch(t){case Y:return;case qt:this.state=zs;break;default:this.fail("attribute without value."),this.text="",this.name="",t===ne?this.openTag():Er(t)?(this.unget(),this.state=Jn):(this.fail("disallowed character in attribute name."),this.state=xr)}}sAttribValue(){let t=this.getCodeNorm();Jr(t)?(this.q=t,this.state=Ys):Ae(t)||(this.fail("unquoted attribute value."),this.state=Ws,this.unget())}sAttribValueQuoted(){let{q:t,chunk:r}=this,{i:n}=this;for(;;)switch(this.getCode()){case t:this.pushAttrib(this.name,this.text+r.slice(n,this.prevI)),this.name=this.text="",this.q=null,this.state=Ul;return;case Dr:this.text+=r.slice(n,this.prevI),this.state=jr,this.entityReturnState=Ys;return;case Oe:case He:case Qn:this.text+=`${r.slice(n,this.prevI)} `,n=this.i;break;case ct:this.text+=r.slice(n,this.prevI),this.fail("disallowed character.");return;case Y:this.text+=r.slice(n);return;default:}}sAttribValueClosed(){let t=this.getCodeNorm();Ae(t)?this.state=xr:t===ne?this.openTag():t===Wr?this.state=Wn:Er(t)?(this.fail("no whitespace between attributes."),this.unget(),this.state=Jn):this.fail("disallowed character in attribute name.")}sAttribValueUnquoted(){let t=this.captureTo(jl);switch(t){case Dr:this.state=jr,this.entityReturnState=Ws;break;case ct:this.fail("disallowed character.");break;case Y:break;default:this.text.includes("]]>")&&this.fail('the string "]]>" is disallowed in char data.'),this.pushAttrib(this.name,this.text),this.name=this.text="",t===ne?this.openTag():this.state=xr}}sCloseTag(){let t=this.captureNameChars();t===ne?this.closeTag():Ae(t)?this.state=ql:t!==Y&&this.fail("disallowed character in closing tag.")}sCloseTagSawWhite(){switch(this.skipSpaces()){case ne:this.closeTag();break;case Y:break;default:this.fail("disallowed character in closing tag.")}}handleTextInRoot(){let{i:t,forbiddenState:r}=this,{chunk:n,textHandler:i}=this;e:for(;;)switch(this.getCode()){case ct:{if(this.state=Zn,i!==void 0){let{text:s}=this,a=n.slice(t,this.prevI);s.length!==0?(i(s+a),this.text=""):a.length!==0&&i(a)}r=Dt;break e}case Dr:this.state=jr,this.entityReturnState=he,i!==void 0&&(this.text+=n.slice(t,this.prevI)),r=Dt;break e;case Gt:switch(r){case Dt:r=ta;break;case ta:r=ei;break;case ei:break;default:throw new Error("impossible state")}break;case ne:r===ei&&this.fail('the string "]]>" is disallowed in char data.'),r=Dt;break;case He:i!==void 0&&(this.text+=`${n.slice(t,this.prevI)}
|
|
13
|
+
`),t=this.i,r=Dt;break;case Y:i!==void 0&&(this.text+=n.slice(t));break e;default:r=Dt}this.forbiddenState=r}handleTextOutsideRoot(){let{i:t}=this,{chunk:r,textHandler:n}=this,i=!1;e:for(;;){let s=this.getCode();switch(s){case ct:{if(this.state=Zn,n!==void 0){let{text:a}=this,u=r.slice(t,this.prevI);a.length!==0?(n(a+u),this.text=""):u.length!==0&&n(u)}break e}case Dr:this.state=jr,this.entityReturnState=he,n!==void 0&&(this.text+=r.slice(t,this.prevI)),i=!0;break e;case He:n!==void 0&&(this.text+=`${r.slice(t,this.prevI)}
|
|
14
|
+
`),t=this.i;break;case Y:n!==void 0&&(this.text+=r.slice(t));break e;default:Ae(s)||(i=!0)}}i&&(!this.sawRoot&&!this.reportedTextBeforeRoot&&(this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0),this.closedRoot&&!this.reportedTextAfterRoot&&(this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0))}pushAttribNS(t,r){var n;let{prefix:i,local:s}=this.qname(t),a={name:t,prefix:i,local:s,value:r};if(this.attribList.push(a),(n=this.attributeHandler)===null||n===void 0||n.call(this,a),i==="xmlns"){let u=r.trim();this.currentXMLVersion==="1.0"&&u===""&&this.fail("invalid attempt to undefine prefix in XML 1.0"),this.topNS[s]=u,ti(this,s,u)}else if(t==="xmlns"){let u=r.trim();this.topNS[""]=u,ti(this,"",u)}}pushAttribPlain(t,r){var n;let i={name:t,value:r};this.attribList.push(i),(n=this.attributeHandler)===null||n===void 0||n.call(this,i)}end(){var t,r;this.sawRoot||this.fail("document must contain a root element.");let{tags:n}=this;for(;n.length>0;){let s=n.pop();this.fail(`unclosed tag: ${s.name}`)}this.state!==Hs&&this.state!==he&&this.fail("unexpected end.");let{text:i}=this;return i.length!==0&&((t=this.textHandler)===null||t===void 0||t.call(this,i),this.text=""),this._closed=!0,(r=this.endHandler)===null||r===void 0||r.call(this),this._init(),this}resolve(t){var r,n;let i=this.topNS[t];if(i!==void 0)return i;let{tags:s}=this;for(let a=s.length-1;a>=0;a--)if(i=s[a].ns[t],i!==void 0)return i;return i=this.ns[t],i!==void 0?i:(n=(r=this.opt).resolvePrefix)===null||n===void 0?void 0:n.call(r,t)}qname(t){let r=t.indexOf(":");if(r===-1)return{prefix:"",local:t};let n=t.slice(r+1),i=t.slice(0,r);return(i===""||n===""||n.includes(":"))&&this.fail(`malformed name: ${t}.`),{prefix:i,local:n}}processAttribsNS(){var t;let{attribList:r}=this,n=this.tag;{let{prefix:a,local:u}=this.qname(n.name);n.prefix=a,n.local=u;let l=n.uri=(t=this.resolve(a))!==null&&t!==void 0?t:"";a!==""&&(a==="xmlns"&&this.fail('tags may not have "xmlns" as prefix.'),l===""&&(this.fail(`unbound namespace prefix: ${JSON.stringify(a)}.`),n.uri=a))}if(r.length===0)return;let{attributes:i}=n,s=new Set;for(let a of r){let{name:u,prefix:l,local:o}=a,c,m;l===""?(c=u==="xmlns"?Ht:"",m=u):(c=this.resolve(l),c===void 0&&(this.fail(`unbound namespace prefix: ${JSON.stringify(l)}.`),c=l),m=`{${c}}${o}`),s.has(m)&&this.fail(`duplicate attribute: ${m}.`),s.add(m),a.uri=c,i[u]=a}this.attribList=[]}processAttribsPlain(){let{attribList:t}=this,r=this.tag.attributes;for(let{name:n,value:i}of t)r[n]!==void 0&&this.fail(`duplicate attribute: ${n}.`),r[n]=i;this.attribList=[]}openTag(){var t;this.processAttribs();let{tags:r}=this,n=this.tag;n.isSelfClosing=!1,(t=this.openTagHandler)===null||t===void 0||t.call(this,n),r.push(n),this.state=he,this.name=""}openSelfClosingTag(){var t,r,n;this.processAttribs();let{tags:i}=this,s=this.tag;s.isSelfClosing=!0,(t=this.openTagHandler)===null||t===void 0||t.call(this,s),(r=this.closeTagHandler)===null||r===void 0||r.call(this,s),(this.tag=(n=i[i.length-1])!==null&&n!==void 0?n:null)===null&&(this.closedRoot=!0),this.state=he,this.name=""}closeTag(){let{tags:t,name:r}=this;if(this.state=he,this.name="",r===""){this.fail("weird empty close tag."),this.text+="</>";return}let n=this.closeTagHandler,i=t.length;for(;i-- >0;){let s=this.tag=t.pop();if(this.topNS=s.ns,n?.(s),s.name===r)break;this.fail("unexpected close tag.")}i===0?this.closedRoot=!0:i<0&&(this.fail(`unmatched closing tag: ${r}.`),this.text+=`</${r}>`)}parseEntity(t){if(t[0]!=="#"){let n=this.ENTITIES[t];return n!==void 0?n:(this.fail(this.isName(t)?"undefined entity.":"disallowed character in entity name."),`&${t};`)}let r=NaN;return t[1]==="x"&&/^#x[0-9a-f]+$/i.test(t)?r=parseInt(t.slice(2),16):/^#[0-9]+$/.test(t)&&(r=parseInt(t.slice(1),10)),this.isChar(r)?String.fromCodePoint(r):(this.fail("malformed character entity."),`&${t};`)}};Vt.SaxesParser=ri});var z=e=>{throw new Error(`Adobe palette: ${e}`)},Sr=class{bytes;view;offset=0;constructor(t){this.bytes=new Uint8Array(t),this.view=new DataView(t)}ensure(t,r){(!Number.isSafeInteger(t)||t<0||this.offset+t>this.bytes.byteLength)&&z(`${r} is truncated at byte ${this.offset}.`)}u16(t="uint16"){this.ensure(2,t);let r=this.view.getUint16(this.offset,!1);return this.offset+=2,r}i16(t="int16"){this.ensure(2,t);let r=this.view.getInt16(this.offset,!1);return this.offset+=2,r}u32(t="uint32"){this.ensure(4,t);let r=this.view.getUint32(this.offset,!1);return this.offset+=4,r}f32(t="float32"){this.ensure(4,t);let r=this.view.getFloat32(this.offset,!1);return this.offset+=4,Number.isFinite(r)||z(`${t} is not finite.`),r}ascii(t,r="ASCII value"){this.ensure(t,r);let n=String.fromCharCode(...this.bytes.subarray(this.offset,this.offset+t));return this.offset+=t,n}skip(t,r="section"){this.ensure(t,r),this.offset+=t}},za=(e,t)=>{for(let r=0;r<e.length;r+=1){let n=e[r];if(n>=55296&&n<=56319){let i=e[r+1];(i===void 0||i<56320||i>57343)&&z(`${t} contains an unpaired UTF-16 high surrogate.`),r+=1}else n>=56320&&n<=57343&&z(`${t} contains an unpaired UTF-16 low surrogate.`)}},Ya=e=>{let t="";for(let r=0;r<e.length;r+=1024)t+=String.fromCharCode(...e.slice(r,r+1024));return t},xn=(e,t,r,n,i)=>{(!Number.isSafeInteger(t)||t<(i?1:0))&&z(`${n} has an invalid length.`),t>r.maxResourceNameCodeUnits&&z(`${n} exceeds the ${r.maxResourceNameCodeUnits}-code-unit safety limit.`),e.ensure(t*2,n);let s=Array.from({length:t},()=>e.u16(n));return i?(s.at(-1)!==0&&z(`${n} is missing its UTF-16 terminator.`),s.pop()):s.at(-1)===0&&s.pop(),za(s,n),Ya(s)},Me=e=>Math.min(1,Math.max(0,e)),vr=e=>Math.round(Me(e)*255),Wa=e=>`#${e.map(t=>vr(t).toString(16).padStart(2,"0")).join("").toUpperCase()}`,Ja=(e,t,r)=>{let n=(e%1+1)%1,i=Me(r)*Me(t),s=n*6,a=i*(1-Math.abs(s%2-1)),u=Me(r)-i;return(s<1?[i,a,0]:s<2?[a,i,0]:s<3?[0,i,a]:s<4?[0,a,i]:s<5?[a,0,i]:[i,0,a]).map(o=>Me(o+u))},Qa=(e,t,r)=>{let n=.20689655172413793,i=A=>A>n?A**3:3*n*n*(A-4/29),s=(e+16)/116,a=s+t/500,u=s-r/200,l=.96422*i(a),o=i(s),c=.82521*i(u),m=.9555766*l-.0230393*o+.0631636*c,h=-.0282895*l+1.0099416*o+.0210077*c,p=.0122982*l-.020483*o+1.3299098*c;return[3.2404542*m-1.5371385*h-.4985314*p,-.969266*m+1.8760108*h+.041556*p,.0556434*m-.2040259*h+1.0572252*p].map(A=>Me(A<=.0031308?12.92*A:1.055*A**(1/2.4)-.055))},Ni=(e,t,r,n,i,s)=>{let a;switch(n){case"RGB":a=i.slice(0,3).map(Me);break;case"HSB":a=Ja(i[0],i[1],i[2]);break;case"CMYK":{let[l,o,c,m]=i.map(Me);a=[(1-l)*(1-m),(1-o)*(1-m),(1-c)*(1-m)];break}case"LAB":a=Qa(i[0],i[1],i[2]);break;case"Gray":a=[Me(i[0]),Me(i[0]),Me(i[0])];break}let u=n==="LAB"?`L ${i[0].toFixed(2)} \xB7 a ${i[1].toFixed(2)} \xB7 b ${i[2].toFixed(2)}`:n==="CMYK"?`C ${Math.round(i[0]*100)} \xB7 M ${Math.round(i[1]*100)} \xB7 Y ${Math.round(i[2]*100)} \xB7 K ${Math.round(i[3]*100)}`:n==="HSB"?`H ${Math.round(i[0]*360)}\xB0 \xB7 S ${Math.round(i[1]*100)} \xB7 B ${Math.round(i[2]*100)}`:n==="Gray"?`Gray ${Math.round(i[0]*100)}%`:`R ${vr(i[0])} \xB7 G ${vr(i[1])} \xB7 B ${vr(i[2])}`;return{id:e,name:t,groupPath:r,model:n,components:i,componentText:u,kind:s,rgb:a,hex:Wa(a)}},Ue=(e,t,r,n)=>((e<t||e>r)&&z(`${n} ${e} is outside ${t}\u2026${r}.`),e),Ti=e=>e>32767?e-65536:e,Ka=(e,t)=>{e.byteLength>t.maxFileBytes&&z(`source exceeds the ${t.maxFileBytes}-byte safety limit.`);let r=new Sr(e);r.ascii(4,"ASE signature")!=="ASEF"&&z("invalid ASE signature.");let n=r.u16("ASE major version"),i=r.u16("ASE minor version");n!==1&&z(`unsupported ASE version ${n}.${i}.`);let s=r.u32("ASE block count");s>t.maxResourceItems*3&&z(`ASE block count exceeds the ${t.maxResourceItems*3}-block safety limit.`);let a=[],u=[],l=new Set,o=0,c=["global","spot","normal"];for(let m=0;m<s;m+=1){let h=r.u16(`ASE block ${m} type`),p=r.u32(`ASE block ${m} length`);r.ensure(p,`ASE block ${m}`);let E=r.offset+p;if(h===49153){let A=xn(r,r.u16("ASE group name length"),t,"ASE group name",!0);r.offset!==E&&z(`ASE group block ${m} has an invalid length.`),u.push(A),l.add(u.join(" / "))}else if(h===49154)p!==0&&z(`ASE group-end block ${m} must be empty.`),u.length||z(`ASE group-end block ${m} has no matching group start.`),u.pop();else if(h===1){a.length>=t.maxResourceItems&&z(`ASE color count exceeds the ${t.maxResourceItems}-item safety limit.`);let A=xn(r,r.u16("ASE color name length"),t,"ASE color name",!0),y=r.ascii(4,"ASE color model"),b,C;y==="RGB "?(b="RGB",C=[0,1,2].map(x=>Ue(r.f32(`ASE RGB component ${x}`),0,1,"ASE RGB component"))):y==="CMYK"?(b="CMYK",C=[0,1,2,3].map(x=>Ue(r.f32(`ASE CMYK component ${x}`),0,1,"ASE CMYK component"))):y==="Gray"?(b="Gray",C=[Ue(r.f32("ASE Gray component"),0,1,"ASE Gray component")]):y==="LAB "?(b="LAB",C=[Ue(r.f32("ASE Lab L"),0,100,"ASE Lab L"),Ue(r.f32("ASE Lab a"),-160,160,"ASE Lab a"),Ue(r.f32("ASE Lab b"),-160,160,"ASE Lab b")]):z(`unsupported ASE color model ${JSON.stringify(y)}.`);let w=c[r.u16("ASE color kind")];w||z("ASE color kind is invalid."),r.offset!==E&&z(`ASE color block ${m} has an invalid length.`),a.push(Ni(`ase-${a.length}`,A||`Color ${a.length+1}`,[...u],b,C,w))}else o+=1,r.offset=E}return u.length&&z("ASE file ends before all color groups are closed."),{format:"ase",version:`${n}.${i}`,colors:a,groups:[...l],unknownBlocks:o,trailingBytes:e.byteLength-r.offset}},eo=(e,t,r,n)=>{let i=e.u16(`ACO color ${r} color space`),s=[0,1,2,3].map(o=>e.u16(`ACO color ${r} component ${o}`)),a,u;switch(i){case 0:a="RGB",u=s.slice(0,3).map(o=>o/65535);break;case 1:a="HSB",u=s.slice(0,3).map(o=>o/65535);break;case 2:a="CMYK",u=s.map(o=>1-o/65535);break;case 7:a="LAB",u=[Ue(s[0]/100,0,100,"ACO Lab L"),Ti(s[1])/100,Ti(s[2])/100],Ue(u[1],-160,160,"ACO Lab a"),Ue(u[2],-160,160,"ACO Lab b");break;case 8:a="Gray",u=[Ue(s[0]/1e4,0,1,"ACO Gray component")];break;default:z(`unsupported ACO color space ${i}.`)}let l=t===2?xn(e,e.u32(`ACO color ${r} name length`),n,`ACO color ${r} name`,!1):void 0;return{model:a,components:u,name:l}},to=(e,t)=>{e.byteLength>t.maxFileBytes&&z(`source exceeds the ${t.maxFileBytes}-byte safety limit.`);let r=new Sr(e),n=new Map;for(;e.byteLength-r.offset>=4;){let a=r.offset,u=r.u16("ACO version");if(u!==1&&u!==2){r.offset=a;break}let l=r.u16(`ACO v${u} color count`);l>t.maxResourceItems&&z(`ACO color count exceeds the ${t.maxResourceItems}-item safety limit.`);let o=Array.from({length:l},(c,m)=>eo(r,u,m,t));n.set(u,o)}let i=n.has(2)?2:n.has(1)?1:0;i||z("invalid ACO version or empty file.");let s=n.get(i);return{format:"aco",version:String(i),colors:s.map((a,u)=>Ni(`aco-${u}`,a.name||`Color ${u+1}`,[],a.model,a.components,"unspecified")),groups:[],unknownBlocks:0,trailingBytes:e.byteLength-r.offset}},vi=(e,t,r)=>t==="ase"?Ka(e,r):to(e,r);var Ea=En(Ls(),1),xa=En(ii(),1);var ua=(e,t,r,n)=>{if(e.byteLength===0||e.byteLength>n.maxBytes)throw new Error(`Embedded preview is outside the 1-${n.maxBytes} byte safety range.`);if(!Number.isSafeInteger(t)||!Number.isSafeInteger(r)||t<=0||r<=0||t>n.maxDimension||r>n.maxDimension||t>Math.floor(n.maxPixels/r))throw new Error(`Embedded preview dimensions ${t} x ${r} exceed the raster safety limit.`)},Jl=e=>{let t=[137,80,78,71,13,10,26,10];return e.byteLength>=t.length&&t.every((r,n)=>e[n]===r)},Ql=(e,t)=>{if(e.byteLength<45)throw new Error("Embedded PNG preview is truncated.");let r=new DataView(e.buffer,e.byteOffset,e.byteLength),n=8,i=0,s=0,a=!1,u=!1;for(;n<e.byteLength;){if(n>e.byteLength-12)throw new Error("Embedded PNG chunk header is truncated.");let l=r.getUint32(n,!1);if(l>e.byteLength-n-12)throw new Error("Embedded PNG chunk exceeds the preview bytes.");let o=String.fromCharCode(e[n+4],e[n+5],e[n+6],e[n+7]);if(n===8){if(o!=="IHDR"||l!==13)throw new Error("Embedded PNG does not begin with a valid IHDR chunk.");i=r.getUint32(n+8,!1),s=r.getUint32(n+12,!1);let c=e[n+16],m=e[n+17];if(!{0:[1,2,4,8,16],2:[8,16],3:[1,2,4,8],4:[8,16],6:[8,16]}[m]?.includes(c)||e[n+18]!==0||e[n+19]!==0||e[n+20]!==0&&e[n+20]!==1)throw new Error("Embedded PNG uses an invalid IHDR encoding.")}else if(/^[A-Z]/.test(o)&&!["PLTE","IDAT","IEND"].includes(o))throw new Error(`Embedded PNG uses unknown critical chunk ${JSON.stringify(o)}.`);if(o==="IDAT"&&(a=!0),o==="IEND"){if(l!==0||!a)throw new Error("Embedded PNG has an invalid IEND or no IDAT data.");u=!0,n+=12;break}n+=12+l}if(!u||n!==e.byteLength)throw new Error("Embedded PNG has no terminal IEND or contains trailing bytes.");return ua(e,i,s,t),{mimeType:"image/png",width:i,height:s,byteLength:e.byteLength}},Kl=new Set([192,193,194,195,197,198,199,201,202,203,205,206,207]),ec=(e,t)=>{if(e.byteLength<12||e[0]!==255||e[1]!==216)throw new Error("Embedded JPEG preview has an invalid SOI marker.");if(e[e.byteLength-2]!==255||e[e.byteLength-1]!==217)throw new Error("Embedded JPEG preview has no terminal EOI marker or contains trailing bytes.");let r=2,n=0,i=0;for(;r<e.byteLength-2;){if(e[r]!==255)throw new Error("Embedded JPEG marker stream is malformed.");for(;r<e.byteLength&&e[r]===255;)r+=1;if(r>=e.byteLength)throw new Error("Embedded JPEG marker is truncated.");let s=e[r];if(r+=1,s===217)break;if(s===218){if(n===0||i===0)throw new Error("Embedded JPEG reached scan data before a supported SOF marker.");break}if(s===1||s>=208&&s<=215)continue;if(r>e.byteLength-2)throw new Error("Embedded JPEG segment length is truncated.");let a=e[r]<<8|e[r+1];if(a<2||r>e.byteLength-a)throw new Error("Embedded JPEG segment exceeds the preview bytes.");if(Kl.has(s)){if(a<8)throw new Error("Embedded JPEG SOF segment is truncated.");i=e[r+3]<<8|e[r+4],n=e[r+5]<<8|e[r+6]}r+=a}if(n===0||i===0)throw new Error("Embedded JPEG contains no supported frame header.");return ua(e,n,i,t),{mimeType:"image/jpeg",width:n,height:i,byteLength:e.byteLength}},jt=(e,t,r)=>{let n=Jl(e)?Ql(e,r):ec(e,r);if(t&&t.toLowerCase()!==n.mimeType)throw new Error(`Embedded preview declares ${t} but contains ${n.mimeType}.`);return n};var ve=Object.freeze({maxFileBytes:268435456,maxEntries:4096,maxCentralDirectoryBytes:8388608,maxEntryNameBytes:1024,maxPathDepth:24,maxEntryCompressedBytes:67108864,maxEntryUncompressedBytes:67108864,maxTotalUncompressedBytes:536870912,maxCompressionRatio:120}),tc=101010256,rc=33639248,nc=67324752,ic=134695760,la=8,sc=1,ac=39169,Kr=22,oc=65535,si=46,ca=30,uc=2062,Je=(e,t)=>Number.isSafeInteger(e)&&Number(e)>0?Number(e):t,Ar=e=>({maxFileBytes:Je(e?.maxFileBytes,ve.maxFileBytes),maxEntries:Je(e?.maxEntries,ve.maxEntries),maxCentralDirectoryBytes:Je(e?.maxCentralDirectoryBytes,ve.maxCentralDirectoryBytes),maxEntryNameBytes:Je(e?.maxEntryNameBytes,ve.maxEntryNameBytes),maxPathDepth:Je(e?.maxPathDepth,ve.maxPathDepth),maxEntryCompressedBytes:Je(e?.maxEntryCompressedBytes,ve.maxEntryCompressedBytes),maxEntryUncompressedBytes:Je(e?.maxEntryUncompressedBytes,ve.maxEntryUncompressedBytes),maxTotalUncompressedBytes:Je(e?.maxTotalUncompressedBytes,ve.maxTotalUncompressedBytes),maxCompressionRatio:Je(e?.maxCompressionRatio,ve.maxCompressionRatio)}),Ve=(e,t,r,n)=>{if(!Number.isSafeInteger(e)||!Number.isSafeInteger(t)||e<0||t<0||e>r-t)throw new Error(`${n} points outside the XD ZIP container.`)},lc=(e,t)=>{if(!t&&e.some(r=>r<32||r>126))throw new Error("XD ZIP entry names must be UTF-8 or printable ASCII.");try{return new TextDecoder("utf-8",{fatal:!0}).decode(e)}catch{throw new Error("XD ZIP contains an invalid UTF-8 entry name.")}},cc=(e,t)=>{if(!e||e.includes("\0"))throw new Error("XD ZIP contains an empty or NUL-containing entry name.");if(e.includes("\\"))throw new Error(`XD ZIP entry ${JSON.stringify(e)} uses unsafe backslash separators.`);if(e.startsWith("/")||/^[A-Za-z]:/.test(e))throw new Error(`XD ZIP entry ${JSON.stringify(e)} is absolute.`);let r=e.endsWith("/"),n=r?e.slice(0,-1):e,i=n.split("/");if(!n||i.length>t.maxPathDepth||i.some(s=>!s||s==="."||s===".."))throw new Error(`XD ZIP entry ${JSON.stringify(e)} contains an unsafe path.`);return r},mc=e=>{if(e.byteLength<Kr)throw new Error("XD file is too short to contain a ZIP directory.");let t=Math.max(0,e.byteLength-Kr-oc);for(let r=e.byteLength-Kr;r>=t;r-=1){if(e.getUint32(r,!0)!==tc)continue;let n=e.getUint16(r+20,!0);if(r+Kr+n===e.byteLength)return r}throw new Error("XD ZIP end-of-central-directory record was not found.")},dc=(e,t,r,n,i)=>{for(let s=0;s<i;s+=1)if(e[t+s]!==r[n+s])return!1;return!0},ma=(e,t)=>{let r=new DataView(e.buffer,e.byteOffset,e.byteLength),n=0;for(;n<e.byteLength;){Ve(n,4,e.byteLength,`${t} extra-field header`);let i=r.getUint16(n,!0),s=r.getUint16(n+2,!0);if(Ve(n+4,s,e.byteLength,`${t} extra field`),i===sc)throw new Error("ZIP64 XD entries are not supported by the bounded browser parser.");if(i===ac)throw new Error("Encrypted XD ZIP entries are not supported.");n+=4+s}},en=(e,t)=>{let r=Ar(t);if(e.byteLength>r.maxFileBytes)throw new Error(`XD ZIP is ${e.byteLength} bytes, exceeding the ${r.maxFileBytes}-byte file limit.`);let n=new DataView(e),i=new Uint8Array(e),s=mc(n),a=n.getUint16(s+4,!0),u=n.getUint16(s+6,!0),l=n.getUint16(s+8,!0),o=n.getUint16(s+10,!0),c=n.getUint32(s+12,!0),m=n.getUint32(s+16,!0);if(a!==0||u!==0||l!==o)throw new Error("Multi-disk XD ZIP containers are not supported.");if(o===65535||c===4294967295||m===4294967295)throw new Error("ZIP64 XD containers are not supported by the bounded browser parser.");if(o===0||o>r.maxEntries)throw new Error(`XD ZIP entry count ${o} is outside the 1-${r.maxEntries} safety range.`);if(c>r.maxCentralDirectoryBytes)throw new Error(`XD ZIP central directory exceeds ${r.maxCentralDirectoryBytes} bytes.`);if(Ve(m,c,s,"XD ZIP central directory"),m+c!==s)throw new Error("XD ZIP central directory has an unsupported gap or trailing record.");let h=[],p=new Map,E=new Set,A=new Set,y=[],b=0,C=m;for(let w=0;w<o;w+=1){if(Ve(C,si,s,"XD ZIP central-directory entry"),n.getUint32(C,!0)!==rc)throw new Error(`XD ZIP central-directory entry ${w+1} has an invalid signature.`);let x=n.getUint16(C+8,!0),F=n.getUint16(C+10,!0),B=n.getUint32(C+16,!0),G=n.getUint32(C+20,!0),O=n.getUint32(C+24,!0),$=n.getUint16(C+28,!0),fe=n.getUint16(C+30,!0),pe=n.getUint16(C+32,!0),H=n.getUint16(C+34,!0),L=n.getUint32(C+42,!0),X=si+$+fe+pe;if(Ve(C,X,s,"XD ZIP central-directory record"),$===0||$>r.maxEntryNameBytes)throw new Error(`XD ZIP entry ${w+1} has an invalid filename length.`);if(H!==0)throw new Error("XD ZIP entry starts on an unsupported secondary disk.");if((x&1)!==0)throw new Error("Encrypted XD ZIP entries are not supported.");if((x&~uc)!==0)throw new Error(`XD ZIP entry ${w+1} uses unsupported general-purpose flags 0x${x.toString(16)}.`);if(F!==0&&F!==8)throw new Error(`XD ZIP entry ${w+1} uses unsupported compression method ${F}.`);if(G===4294967295||O===4294967295||L===4294967295)throw new Error("ZIP64 XD entries are not supported by the bounded browser parser.");if(G>r.maxEntryCompressedBytes||O>r.maxEntryUncompressedBytes)throw new Error(`XD ZIP entry ${w+1} exceeds the per-entry size limit.`);if(O>0){if(G===0)throw new Error(`XD ZIP entry ${w+1} has an impossible zero compressed size.`);if(O/G>r.maxCompressionRatio)throw new Error(`XD ZIP entry ${w+1} exceeds the ${r.maxCompressionRatio}:1 compression-ratio limit.`)}if(b+=O,!Number.isSafeInteger(b)||b>r.maxTotalUncompressedBytes)throw new Error(`XD ZIP expands beyond the ${r.maxTotalUncompressedBytes}-byte aggregate limit.`);let Ce=C+si;ma(i.subarray(Ce+$,Ce+$+fe),`XD ZIP central header for entry ${w+1}`);let T=lc(i.subarray(Ce,Ce+$),(x&2048)!==0),we=cc(T,r),rt=T.normalize("NFC").toLocaleLowerCase("en-US");if(E.has(rt))throw new Error(`XD ZIP contains an ambiguous duplicate entry ${JSON.stringify(T)}.`);if(E.add(rt),A.has(L))throw new Error(`XD ZIP entries reuse local header offset ${L}.`);if(A.add(L),Ve(L,ca,m,`XD ZIP local header for ${T}`),n.getUint32(L,!0)!==nc)throw new Error(`XD ZIP local header for ${JSON.stringify(T)} has an invalid signature.`);let se=n.getUint16(L+6,!0),g=n.getUint16(L+8,!0),I=n.getUint16(L+26,!0),ee=n.getUint16(L+28,!0);if(se!==x||g!==F||I!==$)throw new Error(`XD ZIP local and central headers disagree for ${JSON.stringify(T)}.`);let Te=L+ca;if(Ve(Te,I+ee,m,`XD ZIP local metadata for ${T}`),!dc(i,Te,i,Ce,$))throw new Error(`XD ZIP local and central filenames disagree for ${JSON.stringify(T)}.`);if(ma(i.subarray(Te+I,Te+I+ee),`XD ZIP local header for ${T}`),(x&la)===0){let Jt=n.getUint32(L+14,!0),Xe=n.getUint32(L+18,!0),wr=n.getUint32(L+22,!0);if(Jt!==B||Xe!==G||wr!==O)throw new Error(`XD ZIP local sizes or CRC disagree for ${JSON.stringify(T)}.`)}let _e=Te+I+ee;Ve(_e,G,m,`XD ZIP compressed data for ${T}`);let ht=_e+G,yt=ht;if((x&la)!==0){Ve(ht,12,m,`XD ZIP data descriptor for ${T}`);let Jt=n.getUint32(ht,!0)===ic,Xe=ht+(Jt?4:0);if(Ve(Xe,12,m,`XD ZIP data descriptor for ${T}`),n.getUint32(Xe,!0)!==B||n.getUint32(Xe+4,!0)!==G||n.getUint32(Xe+8,!0)!==O)throw new Error(`XD ZIP data descriptor disagrees for ${JSON.stringify(T)}.`);yt=Xe+12}y.push({start:L,end:yt,name:T});let bt={name:T,compressedSize:G,uncompressedSize:O,crc32:B,compressionMethod:F,flags:x,localHeaderOffset:L,dataOffset:_e,directory:we};h.push(bt),p.set(T,bt),C+=X}if(C!==s)throw new Error("XD ZIP central-directory size does not match its entries.");y.sort((w,x)=>w.start-x.start);for(let w=1;w<y.length;w+=1){let x=y[w-1],F=y[w];if(F.start<x.end)throw new Error(`XD ZIP local records overlap: ${JSON.stringify(x.name)} and ${JSON.stringify(F.name)}.`)}return{entries:h,entryByName:p,centralDirectoryOffset:m,centralDirectorySize:c,totalUncompressedBytes:b,fileBytes:e.byteLength}},hc=(()=>{let e=new Uint32Array(256);for(let t=0;t<e.length;t+=1){let r=t;for(let n=0;n<8;n+=1)r=(r&1)!==0?3988292384^r>>>1:r>>>1;e[t]=r>>>0}return e})(),fc=e=>{let t=4294967295;for(let r of e)t=hc[(t^r)&255]^t>>>8;return(t^4294967295)>>>0},pc=async(e,t)=>{if(typeof DecompressionStream>"u")throw new Error("This browser does not expose DecompressionStream for XD ZIP deflate entries.");let r;try{r=new DecompressionStream("deflate-raw")}catch{throw new Error("This browser does not support raw DEFLATE streams required by the XD ZIP entry.")}let n=new Blob([e]).stream().pipeThrough(r).getReader(),i=new Uint8Array(t),s=0;try{for(;;){let a=await n.read();if(a.done)break;if(s+a.value.byteLength>t)throw await n.cancel(),new Error("XD ZIP entry inflated beyond its declared size.");i.set(a.value,s),s+=a.value.byteLength}}finally{n.releaseLock()}if(s!==t)throw new Error(`XD ZIP entry inflated to ${s} bytes instead of its declared ${t} bytes.`);return i},At=async(e,t,r,n)=>{if(t.fileBytes!==e.byteLength)throw new Error("XD ZIP directory belongs to a different buffer.");let i=t.entryByName.get(r);if(!i||i.directory)throw new Error(`XD ZIP entry ${JSON.stringify(r)} was not found.`);if(!Number.isSafeInteger(n)||n<=0||i.uncompressedSize>n)throw new Error(`XD ZIP entry ${JSON.stringify(r)} exceeds its extraction limit.`);let s=e.slice(i.dataOffset,i.dataOffset+i.compressedSize),a=i.compressionMethod===0?new Uint8Array(s):await pc(s,i.uncompressedSize);if(a.byteLength!==i.uncompressedSize)throw new Error(`XD ZIP stored entry ${JSON.stringify(r)} has an inconsistent size.`);if(fc(a)!==i.crc32)throw new Error(`XD ZIP entry ${JSON.stringify(r)} failed CRC-32 validation.`);return a};var ai=Object.freeze({...ve,maxFileBytes:256*1024*1024,maxEntries:8192,maxEntryUncompressedBytes:96*1024*1024,maxTotalUncompressedBytes:512*1024*1024,maxCompressionRatio:120}),da=e=>{if(!(e instanceof Error))throw e;let t=new Error(e.message.replaceAll("XD ZIP","FLA ZIP").replaceAll("XD file","FLA file").replaceAll("XD containers","FLA containers").replaceAll("XD entries","FLA entries").replaceAll("XD entry","FLA entry"));throw t.name=e.name,t},oi=e=>({...Ar({...ai,...e})}),ha=(e,t)=>{try{return en(e,oi(t))}catch(r){return da(r)}},tn=async(e,t,r,n)=>{try{return await At(e,t,r,n)}catch(i){return da(i)}};var gc="http://ns.adobe.com/xfl/2008/",ci="application/vnd.adobe.xfl",fa=[208,207,17,224,161,177,26,225],ui=128,Z=Object.freeze({...ai,maxXmlFileBytes:12*1024*1024,maxXmlTotalBytes:48*1024*1024,maxXmlFiles:512,maxXmlNodes:25e4,maxXmlDepth:128,maxXmlAttributes:75e4,maxXmlTextBytes:24*1024*1024,maxAttributeBytes:2*1024*1024,maxXmlTotalNodes:3e5,maxXmlTotalAttributes:1e6,maxXmlTotalTextBytes:32*1024*1024,maxXmlTotalAttributeBytes:4*1024*1024,maxTimelines:256,maxLayers:2e4,maxFrames:25e4,maxSymbols:8192,maxReportedResources:2048,maxPreviewElements:1e4,maxPreviewPathCommands:25e4,maxPreviewSvgBytes:16*1024*1024,maxPreviewAssetBytes:8*1024*1024,maxPreviewAssetTotalBytes:32*1024*1024,maxPreviewDimension:16384,maxPreviewPixels:64e6,maxSymbolDepth:24}),Re=Object.freeze({maxXmlFileBytes:24*1024*1024,maxXmlTotalBytes:96*1024*1024,maxXmlFiles:1024,maxXmlNodes:5e5,maxXmlDepth:256,maxXmlAttributes:1e6,maxXmlTextBytes:24*1024*1024,maxAttributeBytes:8*1024*1024,maxXmlTotalNodes:5e5,maxXmlTotalAttributes:15e5,maxXmlTotalTextBytes:64*1024*1024,maxXmlTotalAttributeBytes:8*1024*1024}),j=(e,t,r=Number.MAX_SAFE_INTEGER)=>Number.isSafeInteger(e)&&Number(e)>0?Math.min(Number(e),r):t,Ec=e=>({...oi(e),maxXmlFileBytes:j(e?.maxXmlFileBytes,Z.maxXmlFileBytes,Re.maxXmlFileBytes),maxXmlTotalBytes:j(e?.maxXmlTotalBytes,Z.maxXmlTotalBytes,Re.maxXmlTotalBytes),maxXmlFiles:j(e?.maxXmlFiles,Z.maxXmlFiles,Re.maxXmlFiles),maxXmlNodes:j(e?.maxXmlNodes,Z.maxXmlNodes,Re.maxXmlNodes),maxXmlDepth:j(e?.maxXmlDepth,Z.maxXmlDepth,Re.maxXmlDepth),maxXmlAttributes:j(e?.maxXmlAttributes,Z.maxXmlAttributes,Re.maxXmlAttributes),maxXmlTextBytes:j(e?.maxXmlTextBytes,Z.maxXmlTextBytes,Re.maxXmlTextBytes),maxAttributeBytes:j(e?.maxAttributeBytes,Z.maxAttributeBytes,Re.maxAttributeBytes),maxXmlTotalNodes:j(e?.maxXmlTotalNodes,Z.maxXmlTotalNodes,Re.maxXmlTotalNodes),maxXmlTotalAttributes:j(e?.maxXmlTotalAttributes,Z.maxXmlTotalAttributes,Re.maxXmlTotalAttributes),maxXmlTotalTextBytes:j(e?.maxXmlTotalTextBytes,Z.maxXmlTotalTextBytes,Re.maxXmlTotalTextBytes),maxXmlTotalAttributeBytes:j(e?.maxXmlTotalAttributeBytes,Z.maxXmlTotalAttributeBytes,Re.maxXmlTotalAttributeBytes),maxTimelines:j(e?.maxTimelines,Z.maxTimelines),maxLayers:j(e?.maxLayers,Z.maxLayers),maxFrames:j(e?.maxFrames,Z.maxFrames),maxSymbols:j(e?.maxSymbols,Z.maxSymbols),maxReportedResources:j(e?.maxReportedResources,Z.maxReportedResources),maxPreviewElements:j(e?.maxPreviewElements,Z.maxPreviewElements),maxPreviewPathCommands:j(e?.maxPreviewPathCommands,Z.maxPreviewPathCommands),maxPreviewSvgBytes:j(e?.maxPreviewSvgBytes,Z.maxPreviewSvgBytes),maxPreviewAssetBytes:j(e?.maxPreviewAssetBytes,Z.maxPreviewAssetBytes),maxPreviewAssetTotalBytes:j(e?.maxPreviewAssetTotalBytes,Z.maxPreviewAssetTotalBytes),maxPreviewDimension:j(e?.maxPreviewDimension,Z.maxPreviewDimension),maxPreviewPixels:j(e?.maxPreviewPixels,Z.maxPreviewPixels),maxSymbolDepth:j(e?.maxSymbolDepth,Z.maxSymbolDepth)}),zt=e=>(e.localName||e.nodeName).split(":").pop().toLowerCase(),Pe=(e,t)=>Array.from(e.childNodes).filter(r=>r.nodeType===1).filter(r=>!t||zt(r)===t),rn=(e,t)=>{let r=[],n=[...Pe(e)].reverse();for(;n.length>0;){let i=n.pop();zt(i)===t&&r.push(i);let s=Pe(i);for(let a=s.length-1;a>=0;a-=1)n.push(s[a])}return r},mt=(e,t,r)=>{let n=Pe(e,t)[0];return n?Pe(n,r):[]},Da=(e,t)=>{let r=Pe(e,t)[0];return r?Pe(r):[]},Qe=(e,t,r=4096)=>{let n=(e||"").replace(/[\u0000-\u001f\u007f]/g,"").trim();return n?n.slice(0,r):t},Ie=(e,t)=>{if(e==null||e.trim()==="")return t;let r=Number(e);return Number.isFinite(r)?r:t},Ke=e=>{if(e==null||e.trim()==="")return;let t=Number(e);return Number.isSafeInteger(t)&&t>=0?t:void 0},mi=(e,t)=>e===null||e===""?t:e.toLowerCase()!=="false"&&e!=="0",fi=(e,t)=>{let r=(e||"").trim();return/^#[0-9a-f]{6}$/i.test(r)?r.toUpperCase():t},di=e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),Ze=(e,t)=>{e.includes(t)||(e.length<ui?e.push(t):e.length===ui&&e.push(`Additional FLA/XFL warnings were omitted after ${ui} distinct messages.`))},xc=e=>e.byteLength>=4&&e[0]===80&&e[1]===75&&e[2]===3&&e[3]===4,Dc=e=>e.byteLength>=fa.length&&fa.every((t,r)=>e[r]===t),hi=(e,t)=>{try{return new TextDecoder("utf-8",{fatal:!0}).decode(e)}catch{throw new Error(`${t} is not valid UTF-8.`)}},nn=class extends Error{phase="pre-dom";constructor(t){super(t),this.name="FlaXmlPreflightError"}},Se=e=>{throw new nn(e)},pa=()=>({files:0,bytes:0,nodes:0,attributes:0,textBytes:0,attributeBytes:0}),li=e=>{let t=0;for(let r=0;r<e.length;r+=1){let n=e.charCodeAt(r);if(n<=127)t+=1;else if(n<=2047)t+=2;else if(n>=55296&&n<=56319&&r+1<e.length){let i=e.charCodeAt(r+1);i>=56320&&i<=57343?(t+=4,r+=1):t+=3}else t+=3}return t},Ac=(e,t,r)=>{let n=1,i=0,s=0,a=0,u=0,l=0,o=()=>{n+=1,n>t.maxXmlNodes&&Se(`${r} exceeds the ${t.maxXmlNodes}-node XML limit.`)},c=h=>{o(),u+=li(h),u>t.maxXmlTextBytes&&Se(`${r} exceeds the ${t.maxXmlTextBytes}-byte XML text limit.`)},m=new xa.SaxesParser({xmlns:!1,position:!1,fileName:r});m.on("error",h=>{throw h}),m.on("doctype",()=>Se(`${r} contains a forbidden DTD or ENTITY declaration.`)),m.on("processinginstruction",h=>{h.target.toLowerCase()==="xml-stylesheet"&&Se(`${r} contains an external-capable XML stylesheet instruction.`),o()}),m.on("opentagstart",()=>{o(),i+=1,s=Math.max(s,i),i>t.maxXmlDepth&&Se(`${r} exceeds the ${t.maxXmlDepth}-level XML limit.`)}),m.on("attribute",h=>{a+=1,a>t.maxXmlAttributes&&Se(`${r} exceeds the ${t.maxXmlAttributes}-attribute XML limit.`),l+=li(h.name)+li(h.value),l>t.maxAttributeBytes&&Se(`${r} exceeds the ${t.maxAttributeBytes}-byte XML attribute limit.`)}),m.on("closetag",()=>{i=Math.max(0,i-1)}),m.on("text",c),m.on("cdata",c),m.on("comment",()=>o());try{m.write(e).close()}catch(h){throw h instanceof nn?h:new Error(`${r} is not well-formed XML: ${h instanceof Error?h.message:String(h)}`)}return{nodes:n,maximumDepth:s,attributes:a,textBytes:u,attributeBytes:l}},Aa=(e,t,r,n)=>{e.files+1>r.maxXmlFiles&&Se(`${n} would exceed the aggregate ${r.maxXmlFiles}-file XML limit.`),e.bytes+t>r.maxXmlTotalBytes&&Se(`${n} would exceed the aggregate ${r.maxXmlTotalBytes}-byte XML source limit.`)},yc=(e,t,r,n,i)=>{Aa(e,t,n,i);let s=e.nodes+r.nodes,a=e.attributes+r.attributes,u=e.textBytes+r.textBytes,l=e.attributeBytes+r.attributeBytes;s>n.maxXmlTotalNodes&&Se(`${i} would exceed the aggregate ${n.maxXmlTotalNodes}-node XML limit.`),a>n.maxXmlTotalAttributes&&Se(`${i} would exceed the aggregate ${n.maxXmlTotalAttributes}-attribute XML limit.`),u>n.maxXmlTotalTextBytes&&Se(`${i} would exceed the aggregate ${n.maxXmlTotalTextBytes}-byte XML text limit.`),l>n.maxXmlTotalAttributeBytes&&Se(`${i} would exceed the aggregate ${n.maxXmlTotalAttributeBytes}-byte XML attribute limit.`),e.files+=1,e.bytes+=t,e.nodes=s,e.attributes=a,e.textBytes=u,e.attributeBytes=l},ya=(e,t,r,n)=>{if(e.byteLength===0||e.byteLength>r.maxXmlFileBytes)throw new Error(`${t} is outside the 1-${r.maxXmlFileBytes} byte XML limit.`);let i=hi(e,t),s=Ac(i,r,t);yc(n,e.byteLength,s,r,t);let a;try{a=new Ea.DOMParser({locator:!1,onError:(u,l)=>{throw new Error(`${u}: ${l}`)}}).parseFromString(i,"application/xml")}catch(u){throw new Error(`${t} is not well-formed XML: ${u instanceof Error?u.message:String(u)}`)}return{path:t,document:a,byteLength:e.byteLength,preflight:s}},ba=e=>{if(!e||e.includes("\0")||e.includes("\\")||e.startsWith("/")||/^[A-Za-z]:/.test(e))return;let t=e.split("/");if(!t.some(r=>!r||r==="."||r===".."))return`LIBRARY/${t.join("/")}`},sn=(e,t)=>e.entryByName.get(t),Ca=async(e,t,r,n,i)=>(Aa(i,r.uncompressedSize,n,r.name),ya(await tn(e,t,r.name,n.maxXmlFileBytes),r.name,n,i)),bc=e=>{let t=e.toLowerCase();return t.endsWith(".xml")||t.endsWith(".xfl")?"xml":/\.(?:png|jpe?g|gif|webp|bmp)$/.test(t)?"image":/\.(?:mp3|wav|aac|m4a|flac)$/.test(t)?"audio":/\.(?:mp4|m4v|mov|flv|webm)$/.test(t)?"video":/\.(?:as|js|html?|css)$/.test(t)?"script":t==="mimetype"||t.startsWith("meta-inf/")?"metadata":"binary"},Cc=()=>({shapes:0,symbols:0,bitmaps:0,text:0,groups:0,other:0}),wc=(e,t)=>{t==="domshape"||t==="domrectangleobject"||t==="domovalobject"?e.shapes+=1:t==="domsymbolinstance"?e.symbols+=1:t==="dombitmapinstance"?e.bitmaps+=1:t.includes("text")?e.text+=1:t==="domgroup"?e.groups+=1:e.other+=1},pi=e=>{if(zt(e)==="domdocument")return mt(e,"timelines","domtimeline");let t=Pe(e,"timeline")[0];return t?Pe(t,"domtimeline"):[]},wa=(e,t,r)=>{let n=pi(e),i=[];for(let s of n){if(r.timelines+=1,r.timelines>t.maxTimelines)throw new Error(`FLA/XFL contains more than ${t.maxTimelines} timelines.`);let a=mt(s,"layers","domlayer"),u=[],l=1;for(let o=0;o<a.length;o+=1){let c=a[o];if(r.layers+=1,r.layers>t.maxLayers)throw new Error(`FLA/XFL contains more than ${t.maxLayers} layers.`);let m=mt(c,"frames","domframe");if(r.frames+=m.length,r.frames>t.maxFrames)throw new Error(`FLA/XFL contains more than ${t.maxFrames} keyframes.`);let h=Cc(),p=1;for(let A of m){let y=Ke(A.getAttribute("index"))??0,b=Math.max(1,Ke(A.getAttribute("duration"))??1);p=Math.max(p,y+b);for(let C of Da(A,"elements"))wc(h,zt(C))}l=Math.max(l,p);let E=Ke(c.getAttribute("parentLayerIndex"));u.push({index:o,name:Qe(c.getAttribute("name"),`Layer ${o+1}`,512),layerType:Qe(c.getAttribute("layerType"),"normal",64).toLowerCase(),visible:mi(c.getAttribute("visible"),!0),locked:mi(c.getAttribute("locked"),!1),...E===void 0?{}:{parentLayerIndex:E},frameCount:p,keyframeCount:m.length,elements:h})}i.push({index:i.length,name:Qe(s.getAttribute("name"),`Timeline ${i.length+1}`,512),frameCount:l,layers:u})}return i},yr=e=>{let t=Pe(e,"matrix")[0],r=t?Pe(t,"matrix")[0]:void 0;return{a:Ie(r?.getAttribute("a"),1),b:Ie(r?.getAttribute("b"),0),c:Ie(r?.getAttribute("c"),0),d:Ie(r?.getAttribute("d"),1),tx:Ie(r?.getAttribute("tx"),0),ty:Ie(r?.getAttribute("ty"),0)}},br=e=>`matrix(${e.a} ${e.b} ${e.c} ${e.d} ${e.tx} ${e.ty})`,Tc=e=>{if(!e.startsWith("#")){let a=Number(e);return Number.isFinite(a)?a/20:void 0}let t=e.slice(1),[r="0",n=""]=t.split(".",2);if(!/^[0-9a-f]+$/i.test(r)||n&&!/^[0-9a-f]+$/i.test(n))return;let i=Number.parseInt(r,16);if(!Number.isSafeInteger(i))return;if(r.length>=6){let a=r.length*4,u=2**(a-1);i>=u&&(i-=2**a)}let s=n?Number.parseInt(n,16)/16**n.length:0;return(i<0?i-s:i+s)/20},Nc=e=>e.match(/[!|\[\/]|#[0-9a-f]+(?:\.[0-9a-f]+)?|[-+]?(?:\d+(?:\.\d*)?|\.\d+)/gi)||[],vc=(e,t,r)=>{let n=Nc(e),i=[],s=0,a=()=>{let u=n[s++];return u===void 0?void 0:Tc(u)};for(;s<n.length;){let u=n[s++];if(u==="/")i.push("Z"),t.pathCommands+=1;else if(u==="!"||u==="|"){let l=a(),o=a();if(l===void 0||o===void 0)return;i.push(`${u==="!"?"M":"L"}${l} ${o}`),t.pathCommands+=1}else if(u==="["){let l=a(),o=a(),c=a(),m=a();if(l===void 0||o===void 0||c===void 0||m===void 0)return;i.push(`Q${l} ${o} ${c} ${m}`),t.pathCommands+=1}if(t.pathCommands>r.maxPreviewPathCommands)throw new Error(`FLA first-frame preview exceeds ${r.maxPreviewPathCommands} path commands.`)}return i.length>0?i.join(" "):void 0},Sc=(e,t,r,n)=>{let i=new Map;for(let a of mt(e,"fills","fillstyle")){let u=Ke(a.getAttribute("index")),l=rn(a,"solidcolor")[0];u===void 0||!l||i.set(u,{color:fi(l.getAttribute("color"),"#000000"),opacity:Math.min(1,Math.max(0,Ie(l.getAttribute("alpha"),1)))})}let s=[];for(let a of mt(e,"edges","edge")){let u=vc(a.getAttribute("edges")||"",t,r);if(!u){t.unsupported+=1;continue}let l=Ke(a.getAttribute("fillStyle1"))??Ke(a.getAttribute("fillStyle0")),o=l===void 0?void 0:i.get(l);if(s.push(`<path d="${di(u)}" fill="${o?.color||"none"}" fill-opacity="${o?.opacity??1}" fill-rule="evenodd"/>`),t.elements+=1,t.elements>r.maxPreviewElements)throw new Error(`FLA first-frame preview exceeds ${r.maxPreviewElements} elements.`)}return s.length===0&&i.size>0&&Ze(n,"A first-frame shape had no supported bounded edge path."),s.length>0?`<g transform="${br(yr(e))}">${s.join("")}</g>`:""},Ic=(e,t)=>{let r=rn(e,"characters").map(c=>c.textContent||"").join("");if(!r.trim())return"";let n=rn(e,"domtextattrs")[0],i=Math.min(512,Math.max(1,Ie(n?.getAttribute("size"),16))),s=fi(n?.getAttribute("fillColor"),"#111827"),a=yr(e),u=Ie(e.getAttribute("left"),0),l=Ie(e.getAttribute("top"),0),o=Qe(n?.getAttribute("face"),"sans-serif",128).replace(/["'<>;]/g,"");return t.elements+=1,`<text x="${u}" y="${l+i}" transform="${br(a)}" fill="${s}" font-size="${i}" font-family="${di(o)}">${di(r.slice(0,16384))}</text>`},_c=e=>{let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r="";for(let n=0;n<e.length;n+=3){let i=e[n],s=n+1<e.length?e[n+1]:0,a=n+2<e.length?e[n+2]:0;r+=t[i>>>2],r+=t[(i&3)<<4|s>>>4],r+=n+1<e.length?t[(s&15)<<2|a>>>6]:"=",r+=n+2<e.length?t[a&63]:"="}return r},Fc=(e,t,r)=>{let n=e.getAttribute("libraryItemName")||"",i=t.get(n);if(!i)return r.unsupported+=1,"";let s=yr(e);return r.elements+=1,`<image width="${i.width}" height="${i.height}" transform="${br(s)}" href="${i.dataUrl}"/>`},Ta=(e,t,r,n,i,s,a)=>{if(n.elements>=i.maxPreviewElements)throw new Error(`FLA first-frame preview exceeds ${i.maxPreviewElements} elements.`);let u=zt(e);if(u==="domshape")return Sc(e,n,i,s);if(u.includes("text"))return Ic(e,n);if(u==="dombitmapinstance")return Fc(e,r,n);if(u==="domsymbolinstance"){let l=e.getAttribute("libraryItemName")||"",o=t.get(l);if(!o||a.includes(l)||a.length>=i.maxSymbolDepth)return n.unsupported+=1,"";let c=pi(o)[0];if(!c)return n.unsupported+=1,"";let m=Na(c,t,r,n,i,s,[...a,l]);return m?`<g transform="${br(yr(e))}">${m}</g>`:""}if(u==="domgroup"){let o=Da(e,"members").map(c=>Ta(c,t,r,n,i,s,a)).join("");return o?`<g transform="${br(yr(e))}">${o}</g>`:""}return n.unsupported+=1,""},Na=(e,t,r,n,i,s,a=[])=>{let u=mt(e,"layers","domlayer"),l=[];for(let o=u.length-1;o>=0;o-=1){let c=u[o],m=(c.getAttribute("layerType")||"normal").toLowerCase();if(!mi(c.getAttribute("visible"),!0)||["guide","folder"].includes(m))continue;if(m==="mask"||m==="masked"){Ze(s,"Mask-layer compositing is not reconstructed in the bounded first-frame preview."),n.unsupported+=1;continue}let p=mt(c,"frames","domframe").find(A=>{let y=Ke(A.getAttribute("index"))??0,b=Math.max(1,Ke(A.getAttribute("duration"))??1);return y<=0&&y+b>0});if(!p)continue;let E=Pe(p,"elements")[0];if(E)for(let A of Pe(E))l.push(Ta(A,t,r,n,i,s,a))}return l.join("")},Lc=e=>e.namespaceURI||e.getAttribute("xmlns")||"",va=(e,t)=>{let r=e.document.documentElement;if(!r||zt(r)!==t)throw new Error(`${e.path} does not contain an XFL ${t==="domdocument"?"DOMDocument":"DOMSymbolItem"} root.`);if(Lc(r)!==gc)throw new Error(`${e.path} does not declare the supported Adobe XFL 2008 namespace.`);return r},Bc=async(e,t,r,n,i,s,a)=>{let u=[],l=new Map;if(!e||!t)return{summaries:u,roots:l};let o=mt(r,"symbols","include");if(o.length>n.maxSymbols)throw new Error(`FLA/XFL contains more than ${n.maxSymbols} symbol references.`);for(let c of o){let m=c.getAttribute("href")||"",h=ba(m);if(!h){Ze(a,`Ignored unsafe XFL symbol path ${JSON.stringify(m)}.`);continue}let p=sn(t,h);if(!p||p.directory){Ze(a,`Referenced XFL symbol ${JSON.stringify(h)} is missing.`);continue}let E=await Ca(e,t,p,n,i),A=va(E,"domsymbolitem"),y=Qe(A.getAttribute("name"),m.replace(/\.xml$/i,""),1024);if(l.has(y))throw new Error(`FLA/XFL contains duplicate symbol name ${JSON.stringify(y)}.`);l.set(y,A);let b=wa(A,n,s)[0];u.push({name:y,href:m,symbolType:Qe(A.getAttribute("symbolType"),"graphic",64),timelineName:b?.name||y,layerCount:b?.layers.length||0,frameCount:b?.frameCount||1})}return{summaries:u,roots:l}},Rc=async(e,t,r,n,i)=>{let s=new Map;if(!e||!t)return s;let a=new Map,u=0;for(let l of rn(r,"dombitmapitem")){let o=l.getAttribute("name")||"",c=l.getAttribute("href")||"",m=ba(c);if(!o||!m||!/\.(?:png|jpe?g)$/i.test(m))continue;let h=a.get(o);if(h){if(h!==m)throw new Error(`FLA/XFL contains duplicate bitmap library name ${JSON.stringify(o)}.`);continue}a.set(o,m);let p=sn(t,m);if(!(!p||p.directory)){if(p.uncompressedSize>n.maxPreviewAssetBytes){Ze(i,`Skipped oversized bitmap resource ${JSON.stringify(m)}.`);continue}if(u+=p.uncompressedSize,u>n.maxPreviewAssetTotalBytes){Ze(i,"Stopped loading bitmap previews at the aggregate first-frame asset limit.");break}try{let E=await tn(e,t,p.name,n.maxPreviewAssetBytes),A=jt(E,void 0,{maxBytes:n.maxPreviewAssetBytes,maxDimension:n.maxPreviewDimension,maxPixels:n.maxPreviewPixels});s.set(o,{name:o,dataUrl:`data:${A.mimeType};base64,${_c(E)}`,width:A.width,height:A.height})}catch(E){Ze(i,`Skipped invalid bitmap ${JSON.stringify(m)}: ${E instanceof Error?E.message:String(E)}`)}}}return s},ga=async(e,t,r,n,i,s,a,u)=>{let l=va(r,"domdocument"),o=Ie(l.getAttribute("width"),550),c=Ie(l.getAttribute("height"),400);if(o<=0||c<=0||o>n.maxPreviewDimension||c>n.maxPreviewDimension||o>Math.floor(n.maxPreviewPixels/c))throw new Error(`XFL stage dimensions ${o} x ${c} exceed the preview safety limit.`);let m={width:o,height:c,frameRate:Math.min(240,Math.max(.1,Ie(l.getAttribute("frameRate"),24))),backgroundColor:fi(l.getAttribute("backgroundColor"),"#FFFFFF"),currentTimeline:Ke(l.getAttribute("currentTimeline"))??0},h={timelines:0,layers:0,frames:0},p=wa(l,n,h);if(p.length===0)throw new Error("XFL DOMDocument does not contain a timeline.");let E=await Bc(a,u,l,n,i,h,s),A=await Rc(a,u,l,n,s),y=pi(l),b=y[Math.min(m.currentTimeline,y.length-1)]||y[0],C={elements:0,pathCommands:0,unsupported:0},w=Na(b,E.roots,A,C,n,s),x=`<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${c}" viewBox="0 0 ${o} ${c}"><rect width="100%" height="100%" fill="${m.backgroundColor}"/>${w}</svg>`;if(new TextEncoder().encode(x).byteLength>n.maxPreviewSvgBytes)throw new Error(`FLA first-frame SVG exceeds ${n.maxPreviewSvgBytes} bytes.`);let F=u?u.entries.filter(B=>!B.directory).slice(0,n.maxReportedResources).map(B=>({path:B.name,byteLength:B.uncompressedSize,kind:bc(B.name)})):[];return u&&u.entries.filter(B=>!B.directory).length>n.maxReportedResources&&Ze(s,`Resource inventory was truncated to ${n.maxReportedResources} entries.`),C.unsupported>0&&Ze(s,`${C.unsupported} first-frame element or effect was not reconstructed; timeline structure remains available.`),{format:e,container:t,mimeType:ci,name:Qe(l.getAttribute("name"),e==="fla"?"Animate document":"XFL document",512),xflVersion:Qe(l.getAttribute("xflVersion"),"unknown",64),creatorInfo:Qe(l.getAttribute("creatorInfo"),"not declared",512),entryCount:u?.entries.length||1,expandedBytes:u?.totalUncompressedBytes||r.byteLength,stage:m,timelines:p,symbols:E.summaries,resources:F,previewSvg:x,previewElementCount:C.elements,unsupportedPreviewElements:C.unsupported,warnings:s}},Sa=async(e,t="fla",r)=>{let n=Ec(r);if(e.byteLength===0||e.byteLength>n.maxFileBytes)throw new Error(`FLA/XFL source is outside the 1-${n.maxFileBytes} byte file limit.`);let i=new Uint8Array(e);if(Dc(i))throw new Error("Legacy binary FLA (Flash CS4 and earlier) is intentionally not accepted. This renderer supports only modern compressed XFL-based FLA files.");if(!xc(i)){let m=hi(i,"XFL source");if(/^PROXY-/i.test(m.trim()))throw new Error("This .xfl is only the marker of an uncompressed XFL folder. Select or package DOMDocument.xml together with its LIBRARY and asset folders; a single browser File object cannot read sibling files.");let h=pa(),p=ya(i,"XFL source",n,h);return ga("xfl","single-xml-xfl",p,n,h,["Single-file XML XFL has no sibling LIBRARY or media directory; external symbol and bitmap references cannot be resolved."])}let s=ha(e,n),a=sn(s,"DOMDocument.xml");if(!a||a.directory)throw new Error("Modern compressed FLA must contain a root DOMDocument.xml entry.");let u=[],l=sn(s,"mimetype");if(l&&!l.directory){if(l.localHeaderOffset!==0||l.compressionMethod!==0)throw new Error("FLA mimetype must be the first local ZIP entry and must be stored without compression.");let m=await tn(e,s,l.name,256),h=hi(m,"FLA mimetype").trim();if(h!==ci)throw new Error(`FLA mimetype ${JSON.stringify(h)} is not ${ci}.`)}else Ze(u,"The compressed XFL package has no mimetype entry; DOMDocument.xml and its namespace supplied the format signature.");let o=pa(),c=await Ca(e,s,a,n,o);return ga(t,"compressed-xfl",c,n,o,u,e,s)};var et=Object.freeze({maxFileBytes:256*1024*1024,maxDatabasePages:65536,maxContiguousObjects:8192,maxObjectBytes:64*1024*1024,maxXmpBytes:12*1024*1024,maxPreviewCandidates:64,maxPreviewBytes:24*1024*1024,maxPreviewDimension:16384,maxPreviewPixels:64e6}),Cr=4096,_a=Uint8Array.from([6,6,237,245,216,29,70,229,189,49,239,231,254,116,183,29]),Pc=Uint8Array.from([222,57,57,121,81,136,75,108,142,99,238,248,174,224,221,56]),Mc=Uint8Array.from([253,206,219,112,247,134,75,79,164,211,199,40,179,65,113,6]),Fa="DOCUMENT",Oc="W5M0MpCehiHzreSzNTczkc9d",Xc="http://ns.adobe.com/xap/1.0/g/img/",kc="http://www.w3.org/1999/02/22-rdf-syntax-ns#",tt=(e,t)=>Number.isSafeInteger(e)&&Number(e)>0?Number(e):t,La=e=>({maxFileBytes:tt(e?.maxFileBytes,et.maxFileBytes),maxDatabasePages:tt(e?.maxDatabasePages,et.maxDatabasePages),maxContiguousObjects:tt(e?.maxContiguousObjects,et.maxContiguousObjects),maxObjectBytes:tt(e?.maxObjectBytes,et.maxObjectBytes),maxXmpBytes:tt(e?.maxXmpBytes,et.maxXmpBytes),maxPreviewCandidates:tt(e?.maxPreviewCandidates,et.maxPreviewCandidates),maxPreviewBytes:tt(e?.maxPreviewBytes,et.maxPreviewBytes),maxPreviewDimension:tt(e?.maxPreviewDimension,et.maxPreviewDimension),maxPreviewPixels:tt(e?.maxPreviewPixels,et.maxPreviewPixels)}),on=(e,t,r)=>{if(t<0||t>e.byteLength-r.byteLength)return!1;for(let n=0;n<r.byteLength;n+=1)if(e[t+n]!==r[n])return!1;return!0},Ba=(e,t,r)=>{if(t<0||t>e.byteLength-r.length)return!1;for(let n=0;n<r.length;n+=1)if(e[t+n]!==r.charCodeAt(n))return!1;return!0},Ra=(e,t,r,n)=>{if(!Number.isSafeInteger(e)||!Number.isSafeInteger(t)||e<0||t<0||e>r-t)throw new Error(`${n} points outside the InDesign container.`)},Uc=(e,t)=>{let r=e.getUint32(t,!0),n=e.getUint32(t+4,!0);return BigInt(n)<<32n|BigInt(r)},Ia=(e,t,r,n)=>{if(Ra(r,Cr,e.byteLength,n),!on(e,r,_a)||!Ba(e,r+16,Fa))throw new Error(`${n} has an invalid InDesign DOCUMENT signature.`);return{streamByteOrderByte:e[r+24],sequence:Uc(t,r+264),databasePages:t.getUint32(r+280,!0)}},$c=(e,t="indd",r)=>{let n=La(r);if(e.byteLength>n.maxFileBytes)throw new Error(`InDesign file is ${e.byteLength} bytes, exceeding the ${n.maxFileBytes}-byte limit.`);if(e.byteLength<Cr*2)throw new Error("InDesign file does not contain both master pages.");let i=new Uint8Array(e),s=new DataView(e);if(!on(i,0,_a)&&Ba(i,92,Fa))throw new Error("Legacy InDesign 1.x DOCUMENT container recognized; the GUID/master-page reader supports InDesign 2 and later.");let a=Ia(i,s,0,"InDesign master page 1"),u=Ia(i,s,Cr,"InDesign master page 2"),l=u.sequence>a.sequence?2:1,o=l===2?u:a;if(o.streamByteOrderByte!==1&&o.streamByteOrderByte!==2)throw new Error(`InDesign active master page declares invalid stream byte order ${o.streamByteOrderByte}.`);if(o.databasePages<2||o.databasePages>n.maxDatabasePages)throw new Error(`InDesign database page count ${o.databasePages} is outside the safety range.`);let c=o.databasePages*Cr;if(!Number.isSafeInteger(c)||c>e.byteLength)throw new Error("InDesign database page count points beyond the file.");let m=o.streamByteOrderByte===1;return{kind:t,formatVersion:s.getUint32((l-1)*Cr+29,m),streamByteOrder:m?"little-endian":"big-endian",activeMasterPage:l,activeSequence:o.sequence.toString(),databasePages:o.databasePages,contiguousObjectOffset:c,fileBytes:e.byteLength}},qc=(e,t)=>{let r=Math.min(e.byteLength,t+32);if(r===t)return!0;for(let n=t;n<r;n+=1)if(e[n]!==0)return!1;return!0},Gc=e=>{let t;try{t=new TextDecoder("utf-8",{fatal:!0}).decode(e)}catch{return}if(!(!new RegExp(`^<\\?xpacket begin=(["'])\\uFEFF\\1 id=(["'])${Oc}\\2`).test(t)||!/<\?xpacket end=(["'])[rw]\1\s*\?>\s*$/.test(t)))return t},un=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Hc=e=>{let t=new Map,r=/xmlns:([A-Za-z_][A-Za-z0-9_.-]*)\s*=\s*(["'])([^"']+)\2/g;for(let n of e.matchAll(r))t.set(n[1],n[3]);return t},an=(e,t,r)=>{let n=`${un(t)}:${un(r)}`;return new RegExp(`<${n}\\b[^>]*>([\\s\\S]*?)<\\/${n}\\s*>`,"i").exec(e)?.[1]?.trim()},Vc=(e,t)=>{let r=e.replace(/&#(?:x0*(?:9|a|d|20)|0*(?:9|10|13|32));/gi," ");if(r.includes("&"))return;let n=r.replace(/[\t\n\r ]+/g,"");if(n.length===0||n.length>Math.ceil(t/3)*4+4||n.length%4!==0||!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(n))return;let i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=n.endsWith("==")?2:n.endsWith("=")?1:0,a=n.length/4*3-s;if(a<=0||a>t)return;let u=new Uint8Array(a),l=0;for(let o=0;o<n.length;o+=4){let c=i.indexOf(n[o]),m=i.indexOf(n[o+1]),h=n[o+2]==="="?0:i.indexOf(n[o+2]),p=n[o+3]==="="?0:i.indexOf(n[o+3]),E=c<<18|m<<12|h<<6|p;l<a&&(u[l++]=E>>>16&255),l<a&&(u[l++]=E>>>8&255),l<a&&(u[l++]=E&255)}return u},Zc=(e,t,r)=>{let n=Hc(e),i=[...n.entries()].find(([,o])=>o===Xc)?.[0],s=[...n.entries()].find(([,o])=>o===kc)?.[0];if(!i||!s)return;let a=new RegExp(`<${un(s)}:li\\b[^>]*>[\\s\\S]*?<\\/${un(s)}:li\\s*>`,"gi"),u,l=0;for(let o of e.matchAll(a)){if(l>=t.maxPreviewCandidates){r.push(`Stopped reading XMP thumbnails at the ${t.maxPreviewCandidates}-candidate limit.`);break}let c=an(o[0],i,"image");if(!c)continue;l+=1;let m=an(o[0],i,"format"),h=m?.toLowerCase()==="png"?"image/png":m?.toLowerCase()==="jpeg"||m?.toLowerCase()==="jpg"?"image/jpeg":void 0;if(!h){r.push(`Skipped XMP thumbnail with unsupported declared format ${JSON.stringify(m||"missing")}.`);continue}let p=Vc(c,t.maxPreviewBytes);if(!p){r.push("Skipped an invalid or oversized XMP thumbnail payload.");continue}try{let E=jt(p,h,{maxBytes:t.maxPreviewBytes,maxDimension:t.maxPreviewDimension,maxPixels:t.maxPreviewPixels}),A=Number(an(o[0],i,"width")),y=Number(an(o[0],i,"height"));(Number.isFinite(A)&&A>0&&A!==E.width||Number.isFinite(y)&&y>0&&y!==E.height)&&r.push("An XMP thumbnail declared dimensions that did not match its raster header; the raster header was used."),(!u||E.width*E.height>u.width*u.height)&&(u={...E,source:"xmp-thumbnail",bytes:p,declaredFormat:m})}catch(E){r.push(`Skipped malformed XMP thumbnail: ${E instanceof Error?E.message:String(E)}`)}}return u},Pa=(e,t="indd",r)=>{let n=La(r),i=$c(e,t,n),s=new Uint8Array(e),a=new DataView(e),u=i.streamByteOrder==="little-endian",l=[],o=i.contiguousObjectOffset,c=0,m=0,h,p;for(;o<s.byteLength&&!qc(s,o);){if(s.byteLength-o<32){p=`InDesign contiguous data at offset ${o} has a truncated object header.`;break}if(!on(s,o,Pc)){p=`InDesign contiguous data at offset ${o} is not a supported object header.`;break}if(c+=1,c>n.maxContiguousObjects)throw new Error(`InDesign exceeds the ${n.maxContiguousObjects}-object contiguous-stream limit.`);let y=a.getUint32(o+24,!0);if(y>n.maxObjectBytes)throw new Error(`InDesign contiguous object ${c} exceeds ${n.maxObjectBytes} bytes.`);let b=o+32,C=b+y;if(Ra(b,y+32,s.byteLength,`InDesign contiguous object ${c}`),!on(s,C,Mc)){p=`InDesign contiguous object ${c} has an invalid trailer.`;break}for(let w=0;w<8;w+=1)if(s[o+16+w]!==s[C+16+w]){p=`InDesign contiguous object ${c} header/trailer identity does not match.`;break}if(p)break;if(y>56){let w=a.getUint32(b,u);if(w>n.maxXmpBytes)l.push(`Ignored an InDesign XMP candidate larger than ${n.maxXmpBytes} bytes.`);else if(w>0&&w<=y-4){let x=Gc(s.subarray(b+4,b+4+w));x&&(m+=1,h=x)}}o=C+32}let E=h?Zc(h,n,l):void 0;return h&&!E&&l.push("The verified InDesign XMP object contains no valid bounded JPEG/PNG thumbnail."),h||l.push("No XMP packet was found through the declared database-page and contiguous-object structure; binary image signatures were not scanned."),{format:t,status:p?"unsupported-structure":E?"preview":h?"metadata-only":"structure-only",header:i,contiguousObjectCount:c,xmpPacketCount:m,xmp:h,preview:E,unsupportedReason:p,warnings:l}};var Oa=En(ii(),1),Wt=1024*1024,jc=Object.freeze({maxFileBytes:64*Wt,maxNodes:1e5,maxDepth:128,maxAttributesPerElement:512,maxAttributeLength:65536,maxTextCharacters:8*Wt,maxStories:2048,maxParagraphs:2e4,maxRuns:4e4,maxItems:1e4,maxPoints:1e5,maxPointsPerItem:4096,maxStyles:2e4,maxColors:16384,maxUnknownElementNames:256,maxResultBytes:24*Wt,maxDomNodesPerPanel:8e3}),zc=Object.freeze({maxFileBytes:256*Wt,maxNodes:25e4,maxDepth:256,maxAttributesPerElement:2048,maxAttributeLength:262144,maxTextCharacters:32*Wt,maxStories:8192,maxParagraphs:1e5,maxRuns:1e5,maxItems:5e4,maxPoints:5e5,maxPointsPerItem:16384,maxStyles:1e5,maxColors:65536,maxUnknownElementNames:1024,maxResultBytes:64*Wt,maxDomNodesPerPanel:2e4}),mn=class extends Error{code;constructor(t,r){super(r),this.name="InDesignExchangeError",this.code=t}},Yc=(e,t,r)=>{let n=Number(e);return!Number.isSafeInteger(n)||n<=0?t:Math.min(n,r)},Wc=e=>Object.fromEntries(Object.entries(jc).map(([t,r])=>[t,Yc(e?.[t],r,zc[t])])),me=(e,t)=>{throw new mn(e,t)},Jc=(e,t)=>{let r=[e],n=new WeakSet,i=0,s=a=>{i+=a,(!Number.isSafeInteger(i)||i>t)&&me("INDESIGN_EXCHANGE_RESULT_LIMIT",`InDesign exchange retained result exceeds the ${t}-byte structured-result safety limit.`)};for(;r.length;){let a=r.pop();if(a==null)continue;if(typeof a=="string"){s(24+a.length*2);continue}if(typeof a=="number"||typeof a=="bigint"){s(8);continue}if(typeof a=="boolean"){s(4);continue}if(typeof a!="object"||n.has(a))continue;if(n.add(a),Array.isArray(a)){s(32+a.length*8);for(let l of a)r.push(l);continue}let u=Object.entries(a);s(64+u.length*8);for(let[l,o]of u)s(16+l.length*2),r.push(o)}return i},Qc=e=>{let t=Number(e);return Number.isFinite(t)?t:void 0},dt=(e,t=-1e6,r=1e6)=>{let n=Qc(e);return n!==void 0&&n>=t&&n<=r?n:void 0},ln=e=>(e||"").trim().split(/[\s,]+/).map(Number).filter(Number.isFinite),Ma=e=>{let t=[],r=/(?:^|_)D_(-?(?:\d+(?:\.\d+)?|\.\d+)(?:[eE][+-]?\d+)?)/g,n;for(;n=r.exec(e||"");){let i=Number(n[1]);Number.isFinite(i)&&t.push(i)}return t},Yt=e=>!e||e==="k_"||e==="c_"?"":e.replace(/^(?:r?k|c)_/,"").replace(/~sep~/g," / ").replace(/~(.)/g,"$1"),Kc=e=>{let t={},r=/([A-Za-z_:][\w:.-]*)\s*=\s*(?:"([^"]*)"|'([^']*)')/g,n;for(;n=r.exec(e);)t[n[1]]=n[2]??n[3]??"";return t},ie=e=>e?.trim()||void 0,gi=(e,t,r)=>{let n=i=>Math.max(0,Math.min(255,Math.round(i)));return`rgb(${n(e)} ${n(t)} ${n(r)})`},em=(e,t,r)=>{if(/none/i.test(r))return"transparent";if(/paper/i.test(r))return"#ffffff";let n=e.toLowerCase();if(n.includes("rgb")&&t.length>=3){let i=t.every(s=>s>=0&&s<=1)?255:1;return gi(t[0]*i,t[1]*i,t[2]*i)}if(n.includes("cmyk")&&t.length>=4){let i=t.some(o=>o>1)?.01:1,[s,a,u,l]=t.map(o=>Math.max(0,Math.min(1,o*i)));return gi(255*(1-Math.min(1,s+l)),255*(1-Math.min(1,a+l)),255*(1-Math.min(1,u+l)))}if((n.includes("gray")||n.includes("grey"))&&t.length){let i=t[0]<=1?t[0]*255:t[0]<=100?t[0]*2.55:t[0];return gi(i,i,i)}return"#94a3b8"},tm=(e,t)=>{if(t.length!==6)return e;let[r,n,i,s,a,u]=t;return[r,n,i,s,a,u].every(Number.isFinite)?e.map(l=>({x:r*l.x+i*l.y+a,y:n*l.x+s*l.y+u})):e},rm=e=>{let t=ln(e);if(t.length!==4)return[];let[r,n,i,s]=t;return[{x:n,y:r},{x:s,y:r},{x:s,y:i},{x:n,y:i}]},nm=e=>{if(!e.length)return;let t=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY;for(let s of e)t=Math.min(t,s.x),r=Math.min(r,s.y),n=Math.max(n,s.x),i=Math.max(i,s.y);if([t,r,n,i].every(Number.isFinite))return{x:t,y:r,width:Math.max(0,n-t),height:Math.max(0,i-r)}},cn={crec:"Rectangle",tfra:"TextFrame",txfr:"TextFrame",covl:"Oval",cpol:"Polygon",grln:"GraphicLine",grup:"Group",imag:"Image"},Ei=new Set(["Rectangle","TextFrame","Oval","Polygon","GraphicLine","Group","Image","EPS","PDF","SplineItem"]),im=new Set(["Document","docu","SnippetRoot","Story","cxst","ParagraphStyleRange","txsr","CharacterStyleRange","Content","pcnt","Br","Properties","PathGeometry","GeometryPathType","PathPointArray","PathPointType","Color","colr","Swatch","ParagraphStyle","CharacterStyle","ObjectStyle","psty","tsty","ObSt","Layer","layr","Spread","sprd","Page","page","Link","RootParagraphStyleGroup","RootCharacterStyleGroup","RootObjectStyleGroup","RootColorGroup",...Ei,...Object.keys(cn)]),Xa=(e,t,r)=>{let n=Wc(r);e instanceof ArrayBuffer||me("INDESIGN_EXCHANGE_BUFFER","InDesign exchange input must be an ArrayBuffer."),e.byteLength===0&&me("INDESIGN_EXCHANGE_EMPTY","InDesign exchange input is empty."),e.byteLength>n.maxFileBytes&&me("INDESIGN_EXCHANGE_FILE_LIMIT",`InDesign exchange source exceeds the ${n.maxFileBytes}-byte safety limit.`);let i="";try{i=new TextDecoder("utf-8",{fatal:!0}).decode(new Uint8Array(e))}catch{me("INDESIGN_EXCHANGE_ENCODING","InDesign exchange source is not valid UTF-8 XML.")}i.charCodeAt(0)===65279&&(i=i.slice(1)),i.includes("\0")&&me("INDESIGN_EXCHANGE_ENCODING","InDesign exchange XML contains NUL bytes."),/<!\s*(?:DOCTYPE|ENTITY)\b/i.test(i)&&me("INDESIGN_EXCHANGE_DTD","DTD and entity declarations are not accepted in InDesign exchange XML."),/^\s*<\?xml\b/i.test(i)||me("INDESIGN_EXCHANGE_SIGNATURE","InDesign exchange source must start with an XML declaration.");let s=[],a=[],u=[],l=[],o=new Set,c=new Set,m=new Set,h=new Set,p={},E=[],A=[],y=[],b="",C={},w=0,x=0,F=0,B=0,G=0,O=0,$=0,fe=1024,pe=0,H,L,X=[],Ce,T=(d,f,R)=>{d&&me(f,R)},we=(...d)=>d.reduce((f,R)=>f+(R?.length||0)*2,0),rt=d=>{let f=0;for(let R of d)f+=R.length*2;return f},se=(d,f)=>{fe+=Math.max(0,d),T(!Number.isSafeInteger(fe)||fe>n.maxResultBytes,"INDESIGN_EXCHANGE_RESULT_LIMIT",`InDesign exchange ${f} exceeds the ${n.maxResultBytes}-byte structured-result safety limit.`)},g=(d,...f)=>{for(let R of f)if(d[R]!==void 0)return d[R]},I=d=>{H&&(L&&_e(),G+=1,T(G>n.maxParagraphs,"INDESIGN_EXCHANGE_PARAGRAPH_LIMIT","InDesign exchange XML exceeds the paragraph limit."),se(192+we(g(d,"AppliedParagraphStyle","prst"),g(d,"Justification","jstf"),g(d,"BulletsAndNumberingListType","bnlt")),"paragraphs"),L={paragraphStyle:ie(g(d,"AppliedParagraphStyle","prst")),alignment:ie(g(d,"Justification","jstf")),leftIndent:dt(g(d,"LeftIndent","lind")),firstLineIndent:dt(g(d,"FirstLineIndent","flin")),spaceBefore:dt(g(d,"SpaceBefore","spbe"),0),spaceAfter:dt(g(d,"SpaceAfter","spaf"),0),listType:ie(g(d,"BulletsAndNumberingListType","bnlt")),runs:[]})},ee=d=>{H&&(L||I({}),O+=1,T(O>n.maxRuns,"INDESIGN_EXCHANGE_RUN_LIMIT","InDesign exchange XML exceeds the text-run limit."),se(320+we(g(d,"AppliedCharacterStyle","crst"),g(d,"AppliedFont","fFam"),g(d,"FontStyle","fSty"),g(d,"Position","post"),g(d,"FillColor","flcl"),g(d,"HyperlinkTextSource","href")),"text runs"),X.push({text:"",characterStyle:ie(g(d,"AppliedCharacterStyle","crst")),fontFamily:ie(g(d,"AppliedFont","fFam")),fontStyle:ie(g(d,"FontStyle","fSty")),pointSize:dt(g(d,"PointSize","ptsz"),0,1e4),position:ie(g(d,"Position","post")),underline:g(d,"Underline","undl")==="true",strikeThrough:g(d,"StrikeThru","strk")==="true",fillColor:ie(g(d,"FillColor","flcl")),hyperlink:ie(g(d,"HyperlinkTextSource","href"))}))},Te=()=>{let d=X.pop();!d||!L||(d.text.length||d.characterStyle||d.fontFamily)&&L.runs.push(d)},_e=()=>{for(;X.length;)Te();!L||!H||(L.runs.length&&H.paragraphs.push(L),L=void 0)},ht=(d,f=!1)=>{H&&yt(),T(s.length>=n.maxStories,"INDESIGN_EXCHANGE_STORY_LIMIT","InDesign exchange XML exceeds the story limit."),se(256+we(g(d,"Self"),g(d,"StoryTitle","Name","pnam","sTtl")),"stories"),H={id:g(d,"Self")||`story-${s.length+1}`,title:f?Yt(g(d,"pnam","sTtl")):g(d,"StoryTitle","Name"),paragraphs:[],characterCount:0}},yt=()=>{_e(),H&&(H.characterCount=H.paragraphs.reduce((d,f)=>d+f.runs.reduce((R,k)=>R+k.text.length,0),0),s.push(H),H=void 0)},bt=d=>{if(!H||pe<=0||!d)return;let f=t==="inx"?Yt(d):d;if(!f)return;B+=f.length,T(B>n.maxTextCharacters,"INDESIGN_EXCHANGE_TEXT_LIMIT","InDesign exchange XML exceeds the text-character limit."),se(f.length*2,"story text"),L||I({}),X.length||ee({});let R=X[X.length-1];R.text+=f},Jt=(d,f)=>{let R=cn[d]||d,k=g(f,"Self")||`item-${a.length+E.length+1}`,ae=ln(g(f,"ItemTransform")),ke=rm(g(f,"GeometricBounds"));if(t==="inx"){let gn=Ma(g(f,"IGeo"));if(gn.length>=10){let[Ai,yi,bi,Ci]=gn.slice(-10,-6);ke=[{x:yi,y:Ai},{x:Ci,y:Ai},{x:Ci,y:bi},{x:yi,y:bi}],ae.push(...gn.slice(-6))}}T(ke.length>n.maxPointsPerItem,"INDESIGN_EXCHANGE_ITEM_POINT_LIMIT",`An InDesign exchange page item exceeds the ${n.maxPointsPerItem}-point safety limit.`),se(512+ke.length*24+we(k,R,g(f,"Name","pnam","sTtl"),g(f,"ItemLayer","pilr"),g(f,"ParentStory","strp"),g(f,"FillColor","flcl"),g(f,"StrokeColor","lncl"),g(f,"LinkResourceURI","LinkResourceURIEncoded","path")),"page items");let pn={id:k,kind:R,name:t==="inx"?Yt(g(f,"pnam","sTtl")):g(f,"Name"),layer:ie(g(f,"ItemLayer","pilr")),storyId:ie(g(f,"ParentStory","strp")),fillColor:ie(g(f,"FillColor","flcl")),strokeColor:ie(g(f,"StrokeColor","lncl")),strokeWidth:dt(g(f,"StrokeWeight","lnwt"),0,1e5),opacity:dt(g(f,"Opacity","opac"),0,100),points:ke,externalResource:ie(g(f,"LinkResourceURI","LinkResourceURIEncoded","path"))};pn.layer&&o.add(pn.layer),E.push({sourceName:d,item:pn,transform:ae})},Xe=()=>{let d=E.pop();if(!d)return;let f=tm(d.item.points,d.transform);$+=f.length,T($>n.maxPoints,"INDESIGN_EXCHANGE_POINT_LIMIT","InDesign exchange XML exceeds the geometry-point limit."),d.item.points=f,d.item.bounds=nm(f),a.length>=n.maxItems&&me("INDESIGN_EXCHANGE_ITEM_LIMIT","InDesign exchange XML exceeds the page-item limit."),a.push(d.item)},wr=(d,f)=>{let R=g(d,"Self")||`color-${u.length+1}`;if(m.has(R))return;let k=f?Yt(g(d,"pnam"))||R:g(d,"Name")||R.replace(/^Color\//,""),ae=f?g(d,"clsp")||"Unknown":g(d,"Space")||"Unknown",ke=f?Ma(g(d,"clvl")):ln(g(d,"ColorValue"));T(u.length>=n.maxColors,"INDESIGN_EXCHANGE_COLOR_LIMIT","InDesign exchange XML exceeds the color limit."),se(256+ke.length*8+we(R,k,ae),"colors"),u.push({id:R,name:k,space:ae,values:ke,css:em(ae,ke,k)}),m.add(R)},hn=(d,f,R)=>{let k=g(f,"Self")||`${R}-${l.length+A.length+1}`;h.has(k)||(T(l.length+A.length>=n.maxStyles,"INDESIGN_EXCHANGE_STYLE_LIMIT","InDesign exchange XML exceeds the style limit."),se(256+we(k,d,g(f,"Name","pnam"),g(f,"BasedOn","bsed"),g(f,"AppliedFont","fFam"),g(f,"FontStyle","fSty"),g(f,"Justification","jstf")),"styles"),A.push({openName:d,id:k,name:t==="inx"?Yt(g(f,"pnam"))||k:g(f,"Name")||k,kind:R,basedOn:ie(g(f,"BasedOn","bsed")),fontFamily:ie(g(f,"AppliedFont","fFam")),fontStyle:ie(g(f,"FontStyle","fSty")),pointSize:dt(g(f,"PointSize","ptsz"),0,1e4),alignment:ie(g(f,"Justification","jstf"))}))},Di=()=>{let d=A.pop();if(!d||h.has(d.id))return;let{openName:f,...R}=d;l.push(R),h.add(R.id)},nt=new Oa.SaxesParser({xmlns:!1,position:!0,fileName:`${t} source`});nt.on("error",d=>{Ce=d}),nt.on("doctype",()=>me("INDESIGN_EXCHANGE_DTD","DOCTYPE is not accepted in InDesign exchange XML.")),nt.on("processinginstruction",d=>{if(d.target.toLowerCase()!=="aid")return;T(d.body.length>n.maxAttributeLength*4,"INDESIGN_EXCHANGE_ATTRIBUTE_LIMIT","The InDesign aid processing instruction exceeds its safety limit.");let f=Kc(d.body),R=Object.entries(f);T(R.length>n.maxAttributesPerElement,"INDESIGN_EXCHANGE_ATTRIBUTE_LIMIT","The InDesign aid processing instruction has too many attributes.");for(let[k,ae]of R)T(k.length>512||ae.length>n.maxAttributeLength,"INDESIGN_EXCHANGE_ATTRIBUTE_LIMIT","An InDesign aid processing-instruction attribute exceeds its length limit."),se(64+we(k,ae),"processing metadata"),p[k]=ae}),nt.on("opentag",d=>{w+=1,x+=1,F=Math.max(F,x),T(w>n.maxNodes,"INDESIGN_EXCHANGE_NODE_LIMIT","InDesign exchange XML exceeds the node limit."),T(x>n.maxDepth,"INDESIGN_EXCHANGE_DEPTH_LIMIT","InDesign exchange XML exceeds the nesting-depth limit.");let f=d.attributes,R=Object.entries(f);T(R.length>n.maxAttributesPerElement,"INDESIGN_EXCHANGE_ATTRIBUTE_LIMIT","An InDesign exchange XML element has too many attributes.");for(let[k,ae]of R)T(k.length>512||ae.length>n.maxAttributeLength,"INDESIGN_EXCHANGE_ATTRIBUTE_LIMIT","An InDesign exchange XML attribute exceeds its length limit.");if(b||(b=d.name,C={DOMVersion:f.DOMVersion||""}),y.push(d.name),!im.has(d.name)&&c.size<n.maxUnknownElementNames&&c.add(d.name),d.name==="Story")ht(f);else if(d.name==="cxst")ht(f,!0);else if(d.name==="ParagraphStyleRange"||d.name==="txsr")I(f);else if(d.name==="CharacterStyleRange")ee(f);else if(d.name==="Content"||d.name==="pcnt")pe+=1;else if(d.name==="Br")bt(`
|
|
15
|
+
`);else if(d.name==="Color"||d.name==="Swatch")wr(f,!1);else if(d.name==="colr")wr(f,!0);else if(d.name==="ParagraphStyle"||d.name==="psty")hn(d.name,f,"paragraph");else if(d.name==="CharacterStyle"||d.name==="tsty")hn(d.name,f,"character");else if(d.name==="ObjectStyle"||d.name==="ObSt")hn(d.name,f,"object");else if(d.name==="Layer"||d.name==="layr"){let k=t==="inx"?Yt(g(f,"pnam")):g(f,"Name");k&&!o.has(k)&&(se(64+k.length*2,"layers"),o.add(k))}if((Ei.has(d.name)||cn[d.name])&&Jt(d.name,f),d.name==="PathPointType"&&E.length){let k=ln(g(f,"Anchor"));if(k.length===2){let ae=E[E.length-1].item.points;T(ae.length>=n.maxPointsPerItem,"INDESIGN_EXCHANGE_ITEM_POINT_LIMIT",`An InDesign exchange page item exceeds the ${n.maxPointsPerItem}-point safety limit.`),se(24,"page-item geometry"),ae.push({x:k[0],y:k[1]})}}if((d.name==="Link"||d.name==="Image")&&E.length){let k=ie(g(f,"LinkResourceURI","LinkResourceURIEncoded","path"));if(k){let ae=E[E.length-1].item,ke=ae.externalResource?.length||0;se(Math.max(0,k.length-ke)*2,"linked resources"),ae.externalResource=k}}}),nt.on("text",bt),nt.on("cdata",bt),nt.on("closetag",d=>{let f=d.name;f==="Content"||f==="pcnt"?pe=Math.max(0,pe-1):f==="CharacterStyleRange"?Te():f==="ParagraphStyleRange"||f==="txsr"?_e():(f==="Story"||f==="cxst")&&yt(),(Ei.has(f)||cn[f])&&E.at(-1)?.sourceName===f&&Xe(),A.at(-1)?.openName===f&&Di(),y.pop(),x=Math.max(0,x-1)});try{nt.write(i).close()}catch(d){if(d instanceof mn)throw d;me("INDESIGN_EXCHANGE_XML",d instanceof Error?d.message:"InDesign exchange XML could not be parsed.")}for(Ce&&me("INDESIGN_EXCHANGE_XML",Ce.message);E.length;)Xe();for(;A.length;)Di();H&&yt();let Tr=p.SnippetType;t==="icml"?(b!=="Document"||Tr!=="InCopyInterchange")&&me("INDESIGN_EXCHANGE_SIGNATURE","ICML requires a Document root and the InCopyInterchange snippet marker."):t==="idms"?(b!=="Document"||Tr!=="PageItem")&&me("INDESIGN_EXCHANGE_SIGNATURE","IDMS requires a Document root and the PageItem snippet marker."):b!=="docu"&&b!=="SnippetRoot"&&me("INDESIGN_EXCHANGE_SIGNATURE","Legacy INX requires a docu or SnippetRoot root element.");let Nr=t==="icml"?["ICML carries story content and styles but no complete document page geometry."]:t==="idms"?["IDMS is a reusable layout fragment, not a complete InDesign document; linked resources are listed but never fetched."]:["INX uses legacy abbreviated element and attribute names; common page items are visualized, while unmapped legacy records remain an explicit structure inventory."];c.size&&Nr.push(`${c.size} distinct XML element names are inventoried but not mapped to visual objects.`),a.some(d=>d.externalResource)&&Nr.push("External resource paths are displayed as metadata only and are never loaded by the renderer."),se(512+we(b,C.DOMVersion,p.DOMVersion,p.product,Tr)+rt(o)+rt(c)+rt(Nr),"metadata");let fn={format:t,fidelity:t==="icml"?"styled-story":t==="idms"?"layout-fragment":"legacy-structure",rootElement:b,domVersion:C.DOMVersion||p.DOMVersion,product:p.product,snippetType:Tr,stories:s,items:a,colors:u,styles:l,layers:[...o],unknownElementNames:[...c],warnings:Nr,statistics:{bytes:e.byteLength,nodes:w,maxDepth:F,textCharacters:B,storyCount:s.length,paragraphCount:G,runCount:O,itemCount:a.length,pointCount:$,styleCount:l.length,colorCount:u.length,resultBytes:fe}};return fn.statistics.resultBytes=Math.max(fe,Jc(fn,n.maxResultBytes)),fn};var ye=Object.freeze({...ve,maxManifestBytes:2*1024*1024,maxStructureFileBytes:8*1024*1024,maxStructureTotalBytes:32*1024*1024,maxStructureFiles:128,maxJsonNodes:1e5,maxJsonDepth:96,maxJsonStringBytes:8*1024*1024,maxPreviewCandidates:32,maxPreviewBytes:24*1024*1024,maxPreviewTotalBytes:64*1024*1024,maxPreviewDimension:16384,maxPreviewPixels:64e6,maxReportedResources:512,maxReportedArtboards:512}),be=(e,t)=>Number.isSafeInteger(e)&&Number(e)>0?Number(e):t,sm=e=>({...Ar(e),maxManifestBytes:be(e?.maxManifestBytes,ye.maxManifestBytes),maxStructureFileBytes:be(e?.maxStructureFileBytes,ye.maxStructureFileBytes),maxStructureTotalBytes:be(e?.maxStructureTotalBytes,ye.maxStructureTotalBytes),maxStructureFiles:be(e?.maxStructureFiles,ye.maxStructureFiles),maxJsonNodes:be(e?.maxJsonNodes,ye.maxJsonNodes),maxJsonDepth:be(e?.maxJsonDepth,ye.maxJsonDepth),maxJsonStringBytes:be(e?.maxJsonStringBytes,ye.maxJsonStringBytes),maxPreviewCandidates:be(e?.maxPreviewCandidates,ye.maxPreviewCandidates),maxPreviewBytes:be(e?.maxPreviewBytes,ye.maxPreviewBytes),maxPreviewTotalBytes:be(e?.maxPreviewTotalBytes,ye.maxPreviewTotalBytes),maxPreviewDimension:be(e?.maxPreviewDimension,ye.maxPreviewDimension),maxPreviewPixels:be(e?.maxPreviewPixels,ye.maxPreviewPixels),maxReportedResources:be(e?.maxReportedResources,ye.maxReportedResources),maxReportedArtboards:be(e?.maxReportedArtboards,ye.maxReportedArtboards)}),je=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),dn=e=>{let t=typeof e=="number"?e:Number.NaN;return Number.isFinite(t)?t:void 0},am=(e,t,r)=>{let n=[{value:e,depth:0}],i=0,s=0;for(;n.length>0;){let a=n.pop();if(i+=1,i>t.maxJsonNodes)throw new Error(`${r} exceeds the ${t.maxJsonNodes}-node JSON limit.`);if(a.depth>t.maxJsonDepth)throw new Error(`${r} exceeds the ${t.maxJsonDepth}-level JSON limit.`);if(typeof a.value=="string"){if(s+=new TextEncoder().encode(a.value).byteLength,s>t.maxJsonStringBytes)throw new Error(`${r} exceeds the ${t.maxJsonStringBytes}-byte JSON string limit.`)}else if(Array.isArray(a.value))for(let u of a.value)n.push({value:u,depth:a.depth+1});else if(je(a.value))for(let[u,l]of Object.entries(a.value))s+=new TextEncoder().encode(u).byteLength,n.push({value:l,depth:a.depth+1})}},ka=(e,t,r)=>{let n;try{n=new TextDecoder("utf-8",{fatal:!0}).decode(e)}catch{throw new Error(`${r} is not valid UTF-8.`)}let i;try{i=JSON.parse(n)}catch{throw new Error(`${r} is not valid JSON.`)}return am(i,t,r),i},om=e=>{if(!e||e.includes("\0")||e.includes("\\")||e.startsWith("/")||/^[A-Za-z]:/.test(e))return;let t=e.split("/").filter((r,n,i)=>n!==i.length-1||r!=="");if(!(t.length===0||t.some(r=>!r||r==="."||r==="..")))return t.join("/")},Ua=(e,t)=>{let r=om(t);if(r)return e?`${e}/${r}`:r},um=(e,t)=>{let r=[],n=(i,s,a)=>{if(a>96)return;let u=s;if(typeof i.path=="string"){let l=Ua(s,i.path);l?u=l:t.push(`Ignored unsafe XD manifest node path ${JSON.stringify(i.path)}.`)}if(Array.isArray(i.components))for(let l of i.components){if(!je(l)||typeof l.path!="string")continue;let o=Ua(u,l.path);if(!o){t.push(`Ignored unsafe XD manifest component path ${JSON.stringify(l.path)}.`);continue}r.push({path:o,rel:typeof l.rel=="string"?l.rel.toLowerCase():"",type:typeof l.type=="string"?l.type.toLowerCase():"",width:dn(l.width),height:dn(l.height)})}if(Array.isArray(i.children))for(let l of i.children)je(l)&&n(l,u,a+1)};return n(e,"",0),r},lm=e=>{if(e==="preview"||e==="rendition"||e==="thumbnail")return e},cm=e=>{let t=e.split(".").pop()?.toLowerCase();return t==="png"?"image/png":t==="jpg"||t==="jpeg"?"image/jpeg":""},mm=(e,t,r)=>{let n=new Map;for(let s of t){let a=lm(s.rel);if(!a||s.type!=="image/png"&&s.type!=="image/jpeg")continue;let u=e.entryByName.get(s.path);!u||u.directory||u.uncompressedSize>r.maxPreviewBytes||n.set(s.path,{...s,relation:a})}for(let s of e.entries){if(s.directory||s.uncompressedSize>r.maxPreviewBytes||n.has(s.name)||s.name!=="preview.png"&&s.name!=="thumbnail.png"&&!/^renditions\/[A-Za-z0-9._/-]+\.(?:png|jpe?g)$/i.test(s.name))continue;let a=cm(s.name);a&&n.set(s.name,{path:s.name,rel:"",type:a,relation:"known-path"})}let i={preview:4,rendition:3,thumbnail:2,"known-path":1};return[...n.values()].sort((s,a)=>{let u=(s.width||0)*(s.height||0);return(a.width||0)*(a.height||0)-u||i[a.relation]-i[s.relation]||s.path.localeCompare(a.path)}).slice(0,r.maxPreviewCandidates)},dm=async(e,t,r,n,i)=>{let s,a=0;for(let u of r){let l=t.entryByName.get(u.path);if(l){if(a+l.uncompressedSize>n.maxPreviewTotalBytes){i.push("Stopped reading XD preview candidates at the aggregate preview byte limit.");break}a+=l.uncompressedSize;try{let o=await At(e,t,u.path,n.maxPreviewBytes),c=jt(o,u.type,{maxBytes:n.maxPreviewBytes,maxDimension:n.maxPreviewDimension,maxPixels:n.maxPreviewPixels}),m={...c,path:u.path,relation:u.relation,bytes:o},h=s?s.width*s.height:-1;c.width*c.height>h&&(s=m)}catch(o){i.push(`Skipped XD preview ${JSON.stringify(u.path)}: ${o instanceof Error?o.message:String(o)}`)}}}return s},hm=/^artwork\/(?:pasteboard|artboard-[A-Za-z0-9_-]{1,128})\/graphics\/graphicContent\.agc$/,fm=(e,t,r)=>{let n=je(r)?r:{},i=Array.isArray(n.children)?n.children:[],s=[...i],a=i.filter(je).map(o=>typeof o.name=="string"&&o.name.trim()||typeof o.type=="string"&&o.type||"Unnamed").slice(0,64),u={},l=0;for(;s.length>0;){let o=s.pop();if(!je(o))continue;l+=1;let c=typeof o.type=="string"&&o.type?o.type:"unknown";u[c]=(u[c]||0)+1,Array.isArray(o.children)&&s.push(...o.children)}return{path:e,byteLength:t.uncompressedSize,nodeCount:l,topLevelLayers:a,typeCounts:u}},pm=e=>{let t=e.split(".").pop()?.toLowerCase()||"";return["png","jpg","jpeg","gif","webp"].includes(t)?"image":["agc","json"].includes(t)?"structured-data":["ttf","otf","woff","woff2"].includes(t)?"font":t||"binary"},gm=(e,t)=>{if(!je(e)||!je(e.artboards))return[];let r=[];for(let[n,i]of Object.entries(e.artboards))n==="href"||!je(i)||r.length>=t.maxReportedArtboards||r.push({id:n,name:typeof i.name=="string"&&i.name.trim()?i.name:n,width:dn(i.width),height:dn(i.height)});return r};var $a=async(e,t)=>{let r=sm(t),n=en(e,r),i=n.entryByName.get("mimetype"),s=n.entryByName.get("manifest");if(!i||i.directory||i.uncompressedSize>128)throw new Error("XD UCF container has no bounded root mimetype entry.");if(!s||s.directory||s.uncompressedSize>r.maxManifestBytes)throw new Error("XD UCF container has no bounded root manifest entry.");let a=await At(e,n,"mimetype",128),u=new TextDecoder("utf-8",{fatal:!0}).decode(a).trim();if(u!=="application/vnd.adobe.sparkler.project+dcxucf")throw new Error(`XD UCF container declares unexpected mimetype ${JSON.stringify(u)}.`);let l=await At(e,n,"manifest",r.maxManifestBytes),o=ka(l,r,"XD manifest");if(!je(o))throw new Error("XD manifest root must be a JSON object.");let c=[],m=um(o,c),h=await dm(e,n,mm(n,m,r),r,c),p=n.entries.filter(x=>!x.directory&&(x.name==="resources/graphics/graphicContent.agc"||hm.test(x.name)));p.length>r.maxStructureFiles&&c.push(`XD contains ${p.length} structure files; only the first ${r.maxStructureFiles} are read.`);let E=p.slice(0,r.maxStructureFiles),A=[],y=new Map,b=0;for(let x of E){if(x.uncompressedSize>r.maxStructureFileBytes){c.push(`Skipped oversized XD structure file ${JSON.stringify(x.name)}.`);continue}if(b+x.uncompressedSize>r.maxStructureTotalBytes){c.push("Stopped reading XD structure files at the aggregate structure byte limit.");break}b+=x.uncompressedSize;try{let F=await At(e,n,x.name,r.maxStructureFileBytes),B=ka(F,r,`XD structure ${x.name}`),G=fm(x.name,x,B);if(A.push(G),x.name==="resources/graphics/graphicContent.agc")for(let O of gm(B,r)){let $=y.get(O.id);y.set(O.id,{...$,...O})}else{let O=/artwork\/artboard-([^/]+)\//.exec(x.name)?.[1];if(O){let $=y.get(O);y.set(O,{id:O,name:$?.name||G.topLevelLayers[0]||O,width:$?.width,height:$?.height,path:x.name,nodeCount:G.nodeCount,topLevelLayers:G.topLevelLayers})}}}catch(F){c.push(`Skipped XD structure ${JSON.stringify(x.name)}: ${F instanceof Error?F.message:String(F)}`)}}let C=n.entries.filter(x=>!x.directory&&x.name.startsWith("resources/")&&x.name!=="resources/graphics/graphicContent.agc").slice(0,r.maxReportedResources).map(x=>({path:x.name,byteLength:x.uncompressedSize,kind:pm(x.name)})),w=n.entries.filter(x=>!x.directory&&x.name.startsWith("resources/")).length;return w>r.maxReportedResources&&c.push(`XD contains ${w} resource entries; ${r.maxReportedResources} are listed.`),h||c.push("No valid embedded PNG/JPEG preview was found at a manifest or rendition path."),{format:"xd",mimeType:u,name:typeof o.name=="string"&&o.name.trim()?o.name:"Adobe XD document",manifestVersion:String(o["manifest-format-version"]??o["uxdesign#version"]??"unknown"),entryCount:n.entries.length,expandedBytes:n.totalUncompressedBytes,preview:h,artboards:[...y.values()].slice(0,r.maxReportedArtboards),resources:C,structureFiles:A,warnings:c}};var xi=self,Em=e=>{if((e.format==="xd"||e.format==="indd"||e.format==="indt")&&e.preview){let t=e.preview.bytes.buffer;return t instanceof ArrayBuffer?[t]:[]}return[]};xi.addEventListener("message",async e=>{let t=e.data;try{if(!t||t.type!=="parse"||!(t.buffer instanceof ArrayBuffer))throw new Error("Invalid Adobe container Worker request.");let r;switch(t.format){case"xd":r=await $a(t.buffer,t.limits);break;case"indd":case"indt":r=Pa(t.buffer,t.format,t.limits);break;case"ase":case"aco":r=vi(t.buffer,t.format,t.limits);break;case"fla":case"xfl":r=await Sa(t.buffer,t.format,t.limits);break;case"icml":case"idms":case"inx":r=Xa(t.buffer,t.format,t.limits);break;default:throw new Error("Unsupported Adobe container Worker format.")}let n={id:t.id,ok:!0,result:r};xi.postMessage(n,Em(r))}catch(r){let n={id:t?.id??0,ok:!1,error:{name:r instanceof Error?r.name:"Error",message:r instanceof Error?r.message:String(r)}};xi.postMessage(n)}});
|
|
16
|
+
/*! Bundled license information:
|
|
17
|
+
|
|
18
|
+
xmlchars/xml/1.0/ed5.js:
|
|
19
|
+
(**
|
|
20
|
+
* Character classes and associated utilities for the 5th edition of XML 1.0.
|
|
21
|
+
*
|
|
22
|
+
* @author Louis-Dominique Dubeau
|
|
23
|
+
* @license MIT
|
|
24
|
+
* @copyright Louis-Dominique Dubeau
|
|
25
|
+
*)
|
|
26
|
+
|
|
27
|
+
xmlchars/xml/1.1/ed2.js:
|
|
28
|
+
(**
|
|
29
|
+
* Character classes and associated utilities for the 2nd edition of XML 1.1.
|
|
30
|
+
*
|
|
31
|
+
* @author Louis-Dominique Dubeau
|
|
32
|
+
* @license MIT
|
|
33
|
+
* @copyright Louis-Dominique Dubeau
|
|
34
|
+
*)
|
|
35
|
+
|
|
36
|
+
xmlchars/xmlns/1.0/ed3.js:
|
|
37
|
+
(**
|
|
38
|
+
* Character class utilities for XML NS 1.0 edition 3.
|
|
39
|
+
*
|
|
40
|
+
* @author Louis-Dominique Dubeau
|
|
41
|
+
* @license MIT
|
|
42
|
+
* @copyright Louis-Dominique Dubeau
|
|
43
|
+
*)
|
|
44
|
+
*/
|