@signalk/freeboard-sk 3.2.0-beta.2 → 3.2.0-beta.3
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/package.json +1 -1
- package/public/assets/features/chart-sources-1.jpg +0 -0
- package/public/assets/features/chart-sources-2.jpg +0 -0
- package/public/assets/features/chart-sources-3.jpg +0 -0
- package/public/assets/features/chart-sources-4.jpg +0 -0
- package/public/assets/features-corpus.json +1 -1
- package/public/assets/help/index.html +14 -62
- package/public/{chunk-QGRCSFIW.js → chunk-4TZSCPY6.js} +1 -1
- package/public/{chunk-FHFMCRY4.js → chunk-7H3TNUZC.js} +78 -80
- package/public/{chunk-2SPW2M6P.js → chunk-ABRMW675.js} +1 -1
- package/public/{chunk-J43UG5Q3.js → chunk-PLO4RGKC.js} +1 -1
- package/public/{chunk-UYQ6T6PQ.js → chunk-Q4PCFBHO.js} +1 -1
- package/public/{chunk-33UDAXN5.js → chunk-RLJNSFJD.js} +1 -1
- package/public/{chunk-WHLON3TU.js → chunk-TYJ363DD.js} +1 -1
- package/public/{chunk-FTLLJC55.js → chunk-W3IQ2KES.js} +1 -1
- package/public/index.html +1 -1
- package/public/main-GUEKBZU3.js +468 -0
- package/public/worker-2DO6V3OI.js +3 -0
- package/public/worker-BFPH3XRP.js +26 -0
- package/public/worker-SUE26ZZI.js +12 -0
- package/public/main-WJS4CMGQ.js +0 -466
- package/public/worker-JRN7I6EJ.js +0 -12
- package/public/worker-U7H5YFPO.js +0 -3
- package/public/worker-WYGJSPFM.js +0 -26
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
var rn=Object.create;var ie=Object.defineProperty;var nn=Object.getOwnPropertyDescriptor;var on=Object.getOwnPropertyNames;var sn=Object.getPrototypeOf,un=Object.prototype.hasOwnProperty;var F=(t,r)=>()=>{try{return r||t((r={exports:{}}).exports,r),r.exports}catch(c){throw r=0,c}};var an=(t,r,c,y)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of on(r))!un.call(t,i)&&i!==c&&ie(t,i,{get:()=>r[i],enumerable:!(y=nn(r,i))||y.enumerable});return t};var cn=(t,r,c)=>(c=t!=null?rn(sn(t)):{},an(r||!t||!t.__esModule?ie(c,"default",{value:t,enumerable:!0}):c,t));var gt=F(Bt=>{(function(){Bt.defaults={"0.1":{explicitCharkey:!1,trim:!0,normalize:!0,normalizeTags:!1,attrkey:"@",charkey:"#",explicitArray:!1,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!1,validator:null,xmlns:!1,explicitChildren:!1,childkey:"@@",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,emptyTag:""},"0.2":{explicitCharkey:!1,trim:!1,normalize:!1,normalizeTags:!1,attrkey:"$",charkey:"_",explicitArray:!0,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!0,validator:null,xmlns:!1,explicitChildren:!1,preserveChildrenOrder:!1,childkey:"$$",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:!0},doctype:null,renderOpts:{pretty:!0,indent:" ",newline:`
|
|
2
|
-
`},headless:!1,chunkSize:1e4,emptyTag:"",cdata:!1}}}).call(Bt)});var tt=F((oe,st)=>{(function(){var t,r,c,y,i,f,u,l=[].slice,m={}.hasOwnProperty;t=function(){var g,N,O,D,p,T;if(T=arguments[0],p=2<=arguments.length?l.call(arguments,1):[],i(Object.assign))Object.assign.apply(null,arguments);else for(g=0,O=p.length;g<O;g++)if(D=p[g],D!=null)for(N in D)m.call(D,N)&&(T[N]=D[N]);return T},i=function(g){return!!g&&Object.prototype.toString.call(g)==="[object Function]"},f=function(g){var N;return!!g&&((N=typeof g)=="function"||N==="object")},c=function(g){return i(Array.isArray)?Array.isArray(g):Object.prototype.toString.call(g)==="[object Array]"},y=function(g){var N;if(c(g))return!g.length;for(N in g)if(m.call(g,N))return!1;return!0},u=function(g){var N,O;return f(g)&&(O=Object.getPrototypeOf(g))&&(N=O.constructor)&&typeof N=="function"&&N instanceof N&&Function.prototype.toString.call(N)===Function.prototype.toString.call(Object)},r=function(g){return i(g.valueOf)?g.valueOf():g},st.exports.assign=t,st.exports.isFunction=i,st.exports.isObject=f,st.exports.isArray=c,st.exports.isEmpty=y,st.exports.isPlainObject=u,st.exports.getValue=r}).call(oe)});var Ut=F((se,ue)=>{(function(){var t;ue.exports=t=(function(){function r(){}return r.prototype.hasFeature=function(c,y){return!0},r.prototype.createDocumentType=function(c,y,i){throw new Error("This DOM method is not implemented.")},r.prototype.createDocument=function(c,y,i){throw new Error("This DOM method is not implemented.")},r.prototype.createHTMLDocument=function(c){throw new Error("This DOM method is not implemented.")},r.prototype.getFeature=function(c,y){throw new Error("This DOM method is not implemented.")},r})()}).call(se)});var le=F((ae,ce)=>{(function(){var t;ce.exports=t=(function(){function r(){}return r.prototype.handleError=function(c){throw new Error(c)},r})()}).call(ae)});var pe=F((fe,he)=>{(function(){var t;he.exports=t=(function(){function r(c){this.arr=c||[]}return Object.defineProperty(r.prototype,"length",{get:function(){return this.arr.length}}),r.prototype.item=function(c){return this.arr[c]||null},r.prototype.contains=function(c){return this.arr.indexOf(c)!==-1},r})()}).call(fe)});var ye=F((de,me)=>{(function(){var t,r,c;r=le(),c=pe(),me.exports=t=(function(){function y(){var i;this.defaultParams={"canonical-form":!1,"cdata-sections":!1,comments:!1,"datatype-normalization":!1,"element-content-whitespace":!0,entities:!0,"error-handler":new r,infoset:!0,"validate-if-schema":!1,namespaces:!0,"namespace-declarations":!0,"normalize-characters":!1,"schema-location":"","schema-type":"","split-cdata-sections":!0,validate:!1,"well-formed":!0},this.params=i=Object.create(this.defaultParams)}return Object.defineProperty(y.prototype,"parameterNames",{get:function(){return new c(Object.keys(this.defaultParams))}}),y.prototype.getParameter=function(i){return this.params.hasOwnProperty(i)?this.params[i]:null},y.prototype.canSetParameter=function(i,f){return!0},y.prototype.setParameter=function(i,f){return f!=null?this.params[i]=f:delete this.params[i]},y})()}).call(de)});var k=F((ge,we)=>{(function(){we.exports={Element:1,Attribute:2,Text:3,CData:4,EntityReference:5,EntityDeclaration:6,ProcessingInstruction:7,Comment:8,Document:9,DocType:10,DocumentFragment:11,NotationDeclaration:12,Declaration:201,Raw:202,AttributeDeclaration:203,ElementDeclaration:204,Dummy:205}}).call(ge)});var Vt=F((Te,De)=>{(function(){var t,r,c;t=k(),c=$(),De.exports=r=(function(){function y(i,f,u){if(this.parent=i,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),f==null)throw new Error("Missing attribute name. "+this.debugInfo(f));this.name=this.stringify.name(f),this.value=this.stringify.attValue(u),this.type=t.Attribute,this.isId=!1,this.schemaTypeInfo=null}return Object.defineProperty(y.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(y.prototype,"ownerElement",{get:function(){return this.parent}}),Object.defineProperty(y.prototype,"textContent",{get:function(){return this.value},set:function(i){return this.value=i||""}}),Object.defineProperty(y.prototype,"namespaceURI",{get:function(){return""}}),Object.defineProperty(y.prototype,"prefix",{get:function(){return""}}),Object.defineProperty(y.prototype,"localName",{get:function(){return this.name}}),Object.defineProperty(y.prototype,"specified",{get:function(){return!0}}),y.prototype.clone=function(){return Object.create(this)},y.prototype.toString=function(i){return this.options.writer.attribute(this,this.options.writer.filterOptions(i))},y.prototype.debugInfo=function(i){return i=i||this.name,i==null?"parent: <"+this.parent.name+">":"attribute: {"+i+"}, parent: <"+this.parent.name+">"},y.prototype.isEqualNode=function(i){return!(i.namespaceURI!==this.namespaceURI||i.prefix!==this.prefix||i.localName!==this.localName||i.value!==this.value)},y})()}).call(Te)});var wt=F((be,Ee)=>{(function(){var t;Ee.exports=t=(function(){function r(c){this.nodes=c}return Object.defineProperty(r.prototype,"length",{get:function(){return Object.keys(this.nodes).length||0}}),r.prototype.clone=function(){return this.nodes=null},r.prototype.getNamedItem=function(c){return this.nodes[c]},r.prototype.setNamedItem=function(c){var y;return y=this.nodes[c.nodeName],this.nodes[c.nodeName]=c,y||null},r.prototype.removeNamedItem=function(c){var y;return y=this.nodes[c],delete this.nodes[c],y||null},r.prototype.item=function(c){return this.nodes[Object.keys(this.nodes)[c]]||null},r.prototype.getNamedItemNS=function(c,y){throw new Error("This DOM method is not implemented.")},r.prototype.setNamedItemNS=function(c){throw new Error("This DOM method is not implemented.")},r.prototype.removeNamedItemNS=function(c,y){throw new Error("This DOM method is not implemented.")},r})()}).call(be)});var Tt=F((Ne,Oe)=>{(function(){var t,r,c,y,i,f,u,l,m,g=function(O,D){for(var p in D)N.call(D,p)&&(O[p]=D[p]);function T(){this.constructor=O}return T.prototype=D.prototype,O.prototype=new T,O.__super__=D.prototype,O},N={}.hasOwnProperty;m=tt(),l=m.isObject,u=m.isFunction,f=m.getValue,i=$(),t=k(),r=Vt(),y=wt(),Oe.exports=c=(function(O){g(D,O);function D(p,T,E){var A,M,C,d;if(D.__super__.constructor.call(this,p),T==null)throw new Error("Missing element name. "+this.debugInfo());if(this.name=this.stringify.name(T),this.type=t.Element,this.attribs={},this.schemaTypeInfo=null,E!=null&&this.attribute(E),p.type===t.Document&&(this.isRoot=!0,this.documentObject=p,p.rootObject=this,p.children)){for(d=p.children,M=0,C=d.length;M<C;M++)if(A=d[M],A.type===t.DocType){A.name=this.name;break}}}return Object.defineProperty(D.prototype,"tagName",{get:function(){return this.name}}),Object.defineProperty(D.prototype,"namespaceURI",{get:function(){return""}}),Object.defineProperty(D.prototype,"prefix",{get:function(){return""}}),Object.defineProperty(D.prototype,"localName",{get:function(){return this.name}}),Object.defineProperty(D.prototype,"id",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(D.prototype,"className",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(D.prototype,"classList",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(D.prototype,"attributes",{get:function(){return(!this.attributeMap||!this.attributeMap.nodes)&&(this.attributeMap=new y(this.attribs)),this.attributeMap}}),D.prototype.clone=function(){var p,T,E,A;E=Object.create(this),E.isRoot&&(E.documentObject=null),E.attribs={},A=this.attribs;for(T in A)N.call(A,T)&&(p=A[T],E.attribs[T]=p.clone());return E.children=[],this.children.forEach(function(M){var C;return C=M.clone(),C.parent=E,E.children.push(C)}),E},D.prototype.attribute=function(p,T){var E,A;if(p!=null&&(p=f(p)),l(p))for(E in p)N.call(p,E)&&(A=p[E],this.attribute(E,A));else u(T)&&(T=T.apply()),this.options.keepNullAttributes&&T==null?this.attribs[p]=new r(this,p,""):T!=null&&(this.attribs[p]=new r(this,p,T));return this},D.prototype.removeAttribute=function(p){var T,E,A;if(p==null)throw new Error("Missing attribute name. "+this.debugInfo());if(p=f(p),Array.isArray(p))for(E=0,A=p.length;E<A;E++)T=p[E],delete this.attribs[T];else delete this.attribs[p];return this},D.prototype.toString=function(p){return this.options.writer.element(this,this.options.writer.filterOptions(p))},D.prototype.att=function(p,T){return this.attribute(p,T)},D.prototype.a=function(p,T){return this.attribute(p,T)},D.prototype.getAttribute=function(p){return this.attribs.hasOwnProperty(p)?this.attribs[p].value:null},D.prototype.setAttribute=function(p,T){throw new Error("This DOM method is not implemented."+this.debugInfo())},D.prototype.getAttributeNode=function(p){return this.attribs.hasOwnProperty(p)?this.attribs[p]:null},D.prototype.setAttributeNode=function(p){throw new Error("This DOM method is not implemented."+this.debugInfo())},D.prototype.removeAttributeNode=function(p){throw new Error("This DOM method is not implemented."+this.debugInfo())},D.prototype.getElementsByTagName=function(p){throw new Error("This DOM method is not implemented."+this.debugInfo())},D.prototype.getAttributeNS=function(p,T){throw new Error("This DOM method is not implemented."+this.debugInfo())},D.prototype.setAttributeNS=function(p,T,E){throw new Error("This DOM method is not implemented."+this.debugInfo())},D.prototype.removeAttributeNS=function(p,T){throw new Error("This DOM method is not implemented."+this.debugInfo())},D.prototype.getAttributeNodeNS=function(p,T){throw new Error("This DOM method is not implemented."+this.debugInfo())},D.prototype.setAttributeNodeNS=function(p){throw new Error("This DOM method is not implemented."+this.debugInfo())},D.prototype.getElementsByTagNameNS=function(p,T){throw new Error("This DOM method is not implemented."+this.debugInfo())},D.prototype.hasAttribute=function(p){return this.attribs.hasOwnProperty(p)},D.prototype.hasAttributeNS=function(p,T){throw new Error("This DOM method is not implemented."+this.debugInfo())},D.prototype.setIdAttribute=function(p,T){return this.attribs.hasOwnProperty(p)?this.attribs[p].isId:T},D.prototype.setIdAttributeNS=function(p,T,E){throw new Error("This DOM method is not implemented."+this.debugInfo())},D.prototype.setIdAttributeNode=function(p,T){throw new Error("This DOM method is not implemented."+this.debugInfo())},D.prototype.getElementsByTagName=function(p){throw new Error("This DOM method is not implemented."+this.debugInfo())},D.prototype.getElementsByTagNameNS=function(p,T){throw new Error("This DOM method is not implemented."+this.debugInfo())},D.prototype.getElementsByClassName=function(p){throw new Error("This DOM method is not implemented."+this.debugInfo())},D.prototype.isEqualNode=function(p){var T,E,A;if(!D.__super__.isEqualNode.apply(this,arguments).isEqualNode(p)||p.namespaceURI!==this.namespaceURI||p.prefix!==this.prefix||p.localName!==this.localName||p.attribs.length!==this.attribs.length)return!1;for(T=E=0,A=this.attribs.length-1;0<=A?E<=A:E>=A;T=0<=A?++E:--E)if(!this.attribs[T].isEqualNode(p.attribs[T]))return!1;return!0},D})(i)}).call(Ne)});var dt=F((Ie,Le)=>{(function(){var t,r,c=function(i,f){for(var u in f)y.call(f,u)&&(i[u]=f[u]);function l(){this.constructor=i}return l.prototype=f.prototype,i.prototype=new l,i.__super__=f.prototype,i},y={}.hasOwnProperty;r=$(),Le.exports=t=(function(i){c(f,i);function f(u){f.__super__.constructor.call(this,u),this.value=""}return Object.defineProperty(f.prototype,"data",{get:function(){return this.value},set:function(u){return this.value=u||""}}),Object.defineProperty(f.prototype,"length",{get:function(){return this.value.length}}),Object.defineProperty(f.prototype,"textContent",{get:function(){return this.value},set:function(u){return this.value=u||""}}),f.prototype.clone=function(){return Object.create(this)},f.prototype.substringData=function(u,l){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.appendData=function(u){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.insertData=function(u,l){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.deleteData=function(u,l){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.replaceData=function(u,l,m){throw new Error("This DOM method is not implemented."+this.debugInfo())},f.prototype.isEqualNode=function(u){return!(!f.__super__.isEqualNode.apply(this,arguments).isEqualNode(u)||u.data!==this.data)},f})(r)}).call(Ie)});var Dt=F((Ce,_e)=>{(function(){var t,r,c,y=function(f,u){for(var l in u)i.call(u,l)&&(f[l]=u[l]);function m(){this.constructor=f}return m.prototype=u.prototype,f.prototype=new m,f.__super__=u.prototype,f},i={}.hasOwnProperty;t=k(),c=dt(),_e.exports=r=(function(f){y(u,f);function u(l,m){if(u.__super__.constructor.call(this,l),m==null)throw new Error("Missing CDATA text. "+this.debugInfo());this.name="#cdata-section",this.type=t.CData,this.value=this.stringify.cdata(m)}return u.prototype.clone=function(){return Object.create(this)},u.prototype.toString=function(l){return this.options.writer.cdata(this,this.options.writer.filterOptions(l))},u})(c)}).call(Ce)});var bt=F((ve,Me)=>{(function(){var t,r,c,y=function(f,u){for(var l in u)i.call(u,l)&&(f[l]=u[l]);function m(){this.constructor=f}return m.prototype=u.prototype,f.prototype=new m,f.__super__=u.prototype,f},i={}.hasOwnProperty;t=k(),r=dt(),Me.exports=c=(function(f){y(u,f);function u(l,m){if(u.__super__.constructor.call(this,l),m==null)throw new Error("Missing comment text. "+this.debugInfo());this.name="#comment",this.type=t.Comment,this.value=this.stringify.comment(m)}return u.prototype.clone=function(){return Object.create(this)},u.prototype.toString=function(l){return this.options.writer.comment(this,this.options.writer.filterOptions(l))},u})(r)}).call(ve)});var Et=F((Ae,Pe)=>{(function(){var t,r,c,y,i=function(u,l){for(var m in l)f.call(l,m)&&(u[m]=l[m]);function g(){this.constructor=u}return g.prototype=l.prototype,u.prototype=new g,u.__super__=l.prototype,u},f={}.hasOwnProperty;y=tt().isObject,c=$(),t=k(),Pe.exports=r=(function(u){i(l,u);function l(m,g,N,O){var D;l.__super__.constructor.call(this,m),y(g)&&(D=g,g=D.version,N=D.encoding,O=D.standalone),g||(g="1.0"),this.type=t.Declaration,this.version=this.stringify.xmlVersion(g),N!=null&&(this.encoding=this.stringify.xmlEncoding(N)),O!=null&&(this.standalone=this.stringify.xmlStandalone(O))}return l.prototype.toString=function(m){return this.options.writer.declaration(this,this.options.writer.filterOptions(m))},l})(c)}).call(Ae)});var Nt=F((xe,Se)=>{(function(){var t,r,c,y=function(f,u){for(var l in u)i.call(u,l)&&(f[l]=u[l]);function m(){this.constructor=f}return m.prototype=u.prototype,f.prototype=new m,f.__super__=u.prototype,f},i={}.hasOwnProperty;c=$(),t=k(),Se.exports=r=(function(f){y(u,f);function u(l,m,g,N,O,D){if(u.__super__.constructor.call(this,l),m==null)throw new Error("Missing DTD element name. "+this.debugInfo());if(g==null)throw new Error("Missing DTD attribute name. "+this.debugInfo(m));if(!N)throw new Error("Missing DTD attribute type. "+this.debugInfo(m));if(!O)throw new Error("Missing DTD attribute default. "+this.debugInfo(m));if(O.indexOf("#")!==0&&(O="#"+O),!O.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(m));if(D&&!O.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(m));this.elementName=this.stringify.name(m),this.type=t.AttributeDeclaration,this.attributeName=this.stringify.name(g),this.attributeType=this.stringify.dtdAttType(N),D&&(this.defaultValue=this.stringify.dtdAttDefault(D)),this.defaultValueType=O}return u.prototype.toString=function(l){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(l))},u})(c)}).call(xe)});var Ot=F((Fe,Xe)=>{(function(){var t,r,c,y,i=function(u,l){for(var m in l)f.call(l,m)&&(u[m]=l[m]);function g(){this.constructor=u}return g.prototype=l.prototype,u.prototype=new g,u.__super__=l.prototype,u},f={}.hasOwnProperty;y=tt().isObject,c=$(),t=k(),Xe.exports=r=(function(u){i(l,u);function l(m,g,N,O){if(l.__super__.constructor.call(this,m),N==null)throw new Error("Missing DTD entity name. "+this.debugInfo(N));if(O==null)throw new Error("Missing DTD entity value. "+this.debugInfo(N));if(this.pe=!!g,this.name=this.stringify.name(N),this.type=t.EntityDeclaration,!y(O))this.value=this.stringify.dtdEntityValue(O),this.internal=!0;else{if(!O.pubID&&!O.sysID)throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(N));if(O.pubID&&!O.sysID)throw new Error("System identifier is required for a public external entity. "+this.debugInfo(N));if(this.internal=!1,O.pubID!=null&&(this.pubID=this.stringify.dtdPubID(O.pubID)),O.sysID!=null&&(this.sysID=this.stringify.dtdSysID(O.sysID)),O.nData!=null&&(this.nData=this.stringify.dtdNData(O.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(N))}}return Object.defineProperty(l.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(l.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(l.prototype,"notationName",{get:function(){return this.nData||null}}),Object.defineProperty(l.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(l.prototype,"xmlEncoding",{get:function(){return null}}),Object.defineProperty(l.prototype,"xmlVersion",{get:function(){return null}}),l.prototype.toString=function(m){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(m))},l})(c)}).call(Fe)});var It=F((qe,Re)=>{(function(){var t,r,c,y=function(f,u){for(var l in u)i.call(u,l)&&(f[l]=u[l]);function m(){this.constructor=f}return m.prototype=u.prototype,f.prototype=new m,f.__super__=u.prototype,f},i={}.hasOwnProperty;c=$(),t=k(),Re.exports=r=(function(f){y(u,f);function u(l,m,g){if(u.__super__.constructor.call(this,l),m==null)throw new Error("Missing DTD element name. "+this.debugInfo());g||(g="(#PCDATA)"),Array.isArray(g)&&(g="("+g.join(",")+")"),this.name=this.stringify.name(m),this.type=t.ElementDeclaration,this.value=this.stringify.dtdElementValue(g)}return u.prototype.toString=function(l){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(l))},u})(c)}).call(qe)});var Lt=F((je,Be)=>{(function(){var t,r,c,y=function(f,u){for(var l in u)i.call(u,l)&&(f[l]=u[l]);function m(){this.constructor=f}return m.prototype=u.prototype,f.prototype=new m,f.__super__=u.prototype,f},i={}.hasOwnProperty;c=$(),t=k(),Be.exports=r=(function(f){y(u,f);function u(l,m,g){if(u.__super__.constructor.call(this,l),m==null)throw new Error("Missing DTD notation name. "+this.debugInfo(m));if(!g.pubID&&!g.sysID)throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(m));this.name=this.stringify.name(m),this.type=t.NotationDeclaration,g.pubID!=null&&(this.pubID=this.stringify.dtdPubID(g.pubID)),g.sysID!=null&&(this.sysID=this.stringify.dtdSysID(g.sysID))}return Object.defineProperty(u.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(u.prototype,"systemId",{get:function(){return this.sysID}}),u.prototype.toString=function(l){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(l))},u})(c)}).call(je)});var Ct=F((Ue,Ve)=>{(function(){var t,r,c,y,i,f,u,l,m,g=function(O,D){for(var p in D)N.call(D,p)&&(O[p]=D[p]);function T(){this.constructor=O}return T.prototype=D.prototype,O.prototype=new T,O.__super__=D.prototype,O},N={}.hasOwnProperty;m=tt().isObject,l=$(),t=k(),r=Nt(),y=Ot(),c=It(),i=Lt(),u=wt(),Ve.exports=f=(function(O){g(D,O);function D(p,T,E){var A,M,C,d,o,n;if(D.__super__.constructor.call(this,p),this.type=t.DocType,p.children){for(d=p.children,M=0,C=d.length;M<C;M++)if(A=d[M],A.type===t.Element){this.name=A.name;break}}this.documentObject=p,m(T)&&(o=T,T=o.pubID,E=o.sysID),E==null&&(n=[T,E],E=n[0],T=n[1]),T!=null&&(this.pubID=this.stringify.dtdPubID(T)),E!=null&&(this.sysID=this.stringify.dtdSysID(E))}return Object.defineProperty(D.prototype,"entities",{get:function(){var p,T,E,A,M;for(A={},M=this.children,T=0,E=M.length;T<E;T++)p=M[T],p.type===t.EntityDeclaration&&!p.pe&&(A[p.name]=p);return new u(A)}}),Object.defineProperty(D.prototype,"notations",{get:function(){var p,T,E,A,M;for(A={},M=this.children,T=0,E=M.length;T<E;T++)p=M[T],p.type===t.NotationDeclaration&&(A[p.name]=p);return new u(A)}}),Object.defineProperty(D.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(D.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(D.prototype,"internalSubset",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),D.prototype.element=function(p,T){var E;return E=new c(this,p,T),this.children.push(E),this},D.prototype.attList=function(p,T,E,A,M){var C;return C=new r(this,p,T,E,A,M),this.children.push(C),this},D.prototype.entity=function(p,T){var E;return E=new y(this,!1,p,T),this.children.push(E),this},D.prototype.pEntity=function(p,T){var E;return E=new y(this,!0,p,T),this.children.push(E),this},D.prototype.notation=function(p,T){var E;return E=new i(this,p,T),this.children.push(E),this},D.prototype.toString=function(p){return this.options.writer.docType(this,this.options.writer.filterOptions(p))},D.prototype.ele=function(p,T){return this.element(p,T)},D.prototype.att=function(p,T,E,A,M){return this.attList(p,T,E,A,M)},D.prototype.ent=function(p,T){return this.entity(p,T)},D.prototype.pent=function(p,T){return this.pEntity(p,T)},D.prototype.not=function(p,T){return this.notation(p,T)},D.prototype.up=function(){return this.root()||this.documentObject},D.prototype.isEqualNode=function(p){return!(!D.__super__.isEqualNode.apply(this,arguments).isEqualNode(p)||p.name!==this.name||p.publicId!==this.publicId||p.systemId!==this.systemId)},D})(l)}).call(Ue)});var _t=F((We,ke)=>{(function(){var t,r,c,y=function(f,u){for(var l in u)i.call(u,l)&&(f[l]=u[l]);function m(){this.constructor=f}return m.prototype=u.prototype,f.prototype=new m,f.__super__=u.prototype,f},i={}.hasOwnProperty;t=k(),r=$(),ke.exports=c=(function(f){y(u,f);function u(l,m){if(u.__super__.constructor.call(this,l),m==null)throw new Error("Missing raw text. "+this.debugInfo());this.type=t.Raw,this.value=this.stringify.raw(m)}return u.prototype.clone=function(){return Object.create(this)},u.prototype.toString=function(l){return this.options.writer.raw(this,this.options.writer.filterOptions(l))},u})(r)}).call(We)});var vt=F((Ge,Ye)=>{(function(){var t,r,c,y=function(f,u){for(var l in u)i.call(u,l)&&(f[l]=u[l]);function m(){this.constructor=f}return m.prototype=u.prototype,f.prototype=new m,f.__super__=u.prototype,f},i={}.hasOwnProperty;t=k(),r=dt(),Ye.exports=c=(function(f){y(u,f);function u(l,m){if(u.__super__.constructor.call(this,l),m==null)throw new Error("Missing element text. "+this.debugInfo());this.name="#text",this.type=t.Text,this.value=this.stringify.text(m)}return Object.defineProperty(u.prototype,"isElementContentWhitespace",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(u.prototype,"wholeText",{get:function(){var l,m,g;for(g="",m=this.previousSibling;m;)g=m.data+g,m=m.previousSibling;for(g+=this.data,l=this.nextSibling;l;)g=g+l.data,l=l.nextSibling;return g}}),u.prototype.clone=function(){return Object.create(this)},u.prototype.toString=function(l){return this.options.writer.text(this,this.options.writer.filterOptions(l))},u.prototype.splitText=function(l){throw new Error("This DOM method is not implemented."+this.debugInfo())},u.prototype.replaceWholeText=function(l){throw new Error("This DOM method is not implemented."+this.debugInfo())},u})(r)}).call(Ge)});var Mt=F((Ke,ze)=>{(function(){var t,r,c,y=function(f,u){for(var l in u)i.call(u,l)&&(f[l]=u[l]);function m(){this.constructor=f}return m.prototype=u.prototype,f.prototype=new m,f.__super__=u.prototype,f},i={}.hasOwnProperty;t=k(),r=dt(),ze.exports=c=(function(f){y(u,f);function u(l,m,g){if(u.__super__.constructor.call(this,l),m==null)throw new Error("Missing instruction target. "+this.debugInfo());this.type=t.ProcessingInstruction,this.target=this.stringify.insTarget(m),this.name=this.target,g&&(this.value=this.stringify.insValue(g))}return u.prototype.clone=function(){return Object.create(this)},u.prototype.toString=function(l){return this.options.writer.processingInstruction(this,this.options.writer.filterOptions(l))},u.prototype.isEqualNode=function(l){return!(!u.__super__.isEqualNode.apply(this,arguments).isEqualNode(l)||l.target!==this.target)},u})(r)}).call(Ke)});var Wt=F((He,$e)=>{(function(){var t,r,c,y=function(f,u){for(var l in u)i.call(u,l)&&(f[l]=u[l]);function m(){this.constructor=f}return m.prototype=u.prototype,f.prototype=new m,f.__super__=u.prototype,f},i={}.hasOwnProperty;c=$(),t=k(),$e.exports=r=(function(f){y(u,f);function u(l){u.__super__.constructor.call(this,l),this.type=t.Dummy}return u.prototype.clone=function(){return Object.create(this)},u.prototype.toString=function(l){return""},u})(c)}).call(He)});var Je=F((Qe,Ze)=>{(function(){var t;Ze.exports=t=(function(){function r(c){this.nodes=c}return Object.defineProperty(r.prototype,"length",{get:function(){return this.nodes.length||0}}),r.prototype.clone=function(){return this.nodes=null},r.prototype.item=function(c){return this.nodes[c]||null},r})()}).call(Qe)});var rr=F((tr,er)=>{(function(){er.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(tr)});var $=F((nr,ir)=>{(function(){var t,r,c,y,i,f,u,l,m,g,N,O,D,p,T,E,A,M,C,d={}.hasOwnProperty;C=tt(),M=C.isObject,A=C.isFunction,E=C.isEmpty,T=C.getValue,l=null,c=null,y=null,i=null,f=null,D=null,p=null,O=null,u=null,r=null,N=null,m=null,t=null,ir.exports=g=(function(){function o(n){this.parent=n,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.value=null,this.children=[],this.baseURI=null,l||(l=Tt(),c=Dt(),y=bt(),i=Et(),f=Ct(),D=_t(),p=vt(),O=Mt(),u=Wt(),r=k(),N=Je(),m=wt(),t=rr())}return Object.defineProperty(o.prototype,"nodeName",{get:function(){return this.name}}),Object.defineProperty(o.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(o.prototype,"nodeValue",{get:function(){return this.value}}),Object.defineProperty(o.prototype,"parentNode",{get:function(){return this.parent}}),Object.defineProperty(o.prototype,"childNodes",{get:function(){return(!this.childNodeList||!this.childNodeList.nodes)&&(this.childNodeList=new N(this.children)),this.childNodeList}}),Object.defineProperty(o.prototype,"firstChild",{get:function(){return this.children[0]||null}}),Object.defineProperty(o.prototype,"lastChild",{get:function(){return this.children[this.children.length-1]||null}}),Object.defineProperty(o.prototype,"previousSibling",{get:function(){var n;return n=this.parent.children.indexOf(this),this.parent.children[n-1]||null}}),Object.defineProperty(o.prototype,"nextSibling",{get:function(){var n;return n=this.parent.children.indexOf(this),this.parent.children[n+1]||null}}),Object.defineProperty(o.prototype,"ownerDocument",{get:function(){return this.document()||null}}),Object.defineProperty(o.prototype,"textContent",{get:function(){var n,h,L,I,a;if(this.nodeType===r.Element||this.nodeType===r.DocumentFragment){for(a="",I=this.children,h=0,L=I.length;h<L;h++)n=I[h],n.textContent&&(a+=n.textContent);return a}else return null},set:function(n){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),o.prototype.setParent=function(n){var h,L,I,a,w;for(this.parent=n,n&&(this.options=n.options,this.stringify=n.stringify),a=this.children,w=[],L=0,I=a.length;L<I;L++)h=a[L],w.push(h.setParent(this));return w},o.prototype.element=function(n,h,L){var I,a,w,v,P,x,X,q,S,V,R;if(x=null,h===null&&L==null&&(S=[{},null],h=S[0],L=S[1]),h==null&&(h={}),h=T(h),M(h)||(V=[h,L],L=V[0],h=V[1]),n!=null&&(n=T(n)),Array.isArray(n))for(w=0,X=n.length;w<X;w++)a=n[w],x=this.element(a);else if(A(n))x=this.element(n.apply());else if(M(n)){for(P in n)if(d.call(n,P))if(R=n[P],A(R)&&(R=R.apply()),!this.options.ignoreDecorators&&this.stringify.convertAttKey&&P.indexOf(this.stringify.convertAttKey)===0)x=this.attribute(P.substr(this.stringify.convertAttKey.length),R);else if(!this.options.separateArrayItems&&Array.isArray(R)&&E(R))x=this.dummy();else if(M(R)&&E(R))x=this.element(P);else if(!this.options.keepNullNodes&&R==null)x=this.dummy();else if(!this.options.separateArrayItems&&Array.isArray(R))for(v=0,q=R.length;v<q;v++)a=R[v],I={},I[P]=a,x=this.element(I);else M(R)?!this.options.ignoreDecorators&&this.stringify.convertTextKey&&P.indexOf(this.stringify.convertTextKey)===0?x=this.element(R):(x=this.element(P),x.element(R)):x=this.element(P,R)}else!this.options.keepNullNodes&&L===null?x=this.dummy():!this.options.ignoreDecorators&&this.stringify.convertTextKey&&n.indexOf(this.stringify.convertTextKey)===0?x=this.text(L):!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&n.indexOf(this.stringify.convertCDataKey)===0?x=this.cdata(L):!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&n.indexOf(this.stringify.convertCommentKey)===0?x=this.comment(L):!this.options.ignoreDecorators&&this.stringify.convertRawKey&&n.indexOf(this.stringify.convertRawKey)===0?x=this.raw(L):!this.options.ignoreDecorators&&this.stringify.convertPIKey&&n.indexOf(this.stringify.convertPIKey)===0?x=this.instruction(n.substr(this.stringify.convertPIKey.length),L):x=this.node(n,h,L);if(x==null)throw new Error("Could not create any elements with: "+n+". "+this.debugInfo());return x},o.prototype.insertBefore=function(n,h,L){var I,a,w,v,P;if(n?.type)return w=n,v=h,w.setParent(this),v?(a=children.indexOf(v),P=children.splice(a),children.push(w),Array.prototype.push.apply(children,P)):children.push(w),w;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(n));return a=this.parent.children.indexOf(this),P=this.parent.children.splice(a),I=this.parent.element(n,h,L),Array.prototype.push.apply(this.parent.children,P),I},o.prototype.insertAfter=function(n,h,L){var I,a,w;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(n));return a=this.parent.children.indexOf(this),w=this.parent.children.splice(a+1),I=this.parent.element(n,h,L),Array.prototype.push.apply(this.parent.children,w),I},o.prototype.remove=function(){var n,h;if(this.isRoot)throw new Error("Cannot remove the root element. "+this.debugInfo());return n=this.parent.children.indexOf(this),[].splice.apply(this.parent.children,[n,n-n+1].concat(h=[])),this.parent},o.prototype.node=function(n,h,L){var I,a;return n!=null&&(n=T(n)),h||(h={}),h=T(h),M(h)||(a=[h,L],L=a[0],h=a[1]),I=new l(this,n,h),L!=null&&I.text(L),this.children.push(I),I},o.prototype.text=function(n){var h;return M(n)&&this.element(n),h=new p(this,n),this.children.push(h),this},o.prototype.cdata=function(n){var h;return h=new c(this,n),this.children.push(h),this},o.prototype.comment=function(n){var h;return h=new y(this,n),this.children.push(h),this},o.prototype.commentBefore=function(n){var h,L,I;return L=this.parent.children.indexOf(this),I=this.parent.children.splice(L),h=this.parent.comment(n),Array.prototype.push.apply(this.parent.children,I),this},o.prototype.commentAfter=function(n){var h,L,I;return L=this.parent.children.indexOf(this),I=this.parent.children.splice(L+1),h=this.parent.comment(n),Array.prototype.push.apply(this.parent.children,I),this},o.prototype.raw=function(n){var h;return h=new D(this,n),this.children.push(h),this},o.prototype.dummy=function(){var n;return n=new u(this),n},o.prototype.instruction=function(n,h){var L,I,a,w,v;if(n!=null&&(n=T(n)),h!=null&&(h=T(h)),Array.isArray(n))for(w=0,v=n.length;w<v;w++)L=n[w],this.instruction(L);else if(M(n))for(L in n)d.call(n,L)&&(I=n[L],this.instruction(L,I));else A(h)&&(h=h.apply()),a=new O(this,n,h),this.children.push(a);return this},o.prototype.instructionBefore=function(n,h){var L,I,a;return I=this.parent.children.indexOf(this),a=this.parent.children.splice(I),L=this.parent.instruction(n,h),Array.prototype.push.apply(this.parent.children,a),this},o.prototype.instructionAfter=function(n,h){var L,I,a;return I=this.parent.children.indexOf(this),a=this.parent.children.splice(I+1),L=this.parent.instruction(n,h),Array.prototype.push.apply(this.parent.children,a),this},o.prototype.declaration=function(n,h,L){var I,a;return I=this.document(),a=new i(I,n,h,L),I.children.length===0?I.children.unshift(a):I.children[0].type===r.Declaration?I.children[0]=a:I.children.unshift(a),I.root()||I},o.prototype.dtd=function(n,h){var L,I,a,w,v,P,x,X,q,S;for(I=this.document(),a=new f(I,n,h),q=I.children,w=v=0,x=q.length;v<x;w=++v)if(L=q[w],L.type===r.DocType)return I.children[w]=a,a;for(S=I.children,w=P=0,X=S.length;P<X;w=++P)if(L=S[w],L.isRoot)return I.children.splice(w,0,a),a;return I.children.push(a),a},o.prototype.up=function(){if(this.isRoot)throw new Error("The root node has no parent. Use doc() if you need to get the document object.");return this.parent},o.prototype.root=function(){var n;for(n=this;n;){if(n.type===r.Document)return n.rootObject;if(n.isRoot)return n;n=n.parent}},o.prototype.document=function(){var n;for(n=this;n;){if(n.type===r.Document)return n;n=n.parent}},o.prototype.end=function(n){return this.document().end(n)},o.prototype.prev=function(){var n;if(n=this.parent.children.indexOf(this),n<1)throw new Error("Already at the first node. "+this.debugInfo());return this.parent.children[n-1]},o.prototype.next=function(){var n;if(n=this.parent.children.indexOf(this),n===-1||n===this.parent.children.length-1)throw new Error("Already at the last node. "+this.debugInfo());return this.parent.children[n+1]},o.prototype.importDocument=function(n){var h;return h=n.root().clone(),h.parent=this,h.isRoot=!1,this.children.push(h),this},o.prototype.debugInfo=function(n){var h,L;return n=n||this.name,n==null&&!((h=this.parent)!=null&&h.name)?"":n==null?"parent: <"+this.parent.name+">":(L=this.parent)!=null&&L.name?"node: <"+n+">, parent: <"+this.parent.name+">":"node: <"+n+">"},o.prototype.ele=function(n,h,L){return this.element(n,h,L)},o.prototype.nod=function(n,h,L){return this.node(n,h,L)},o.prototype.txt=function(n){return this.text(n)},o.prototype.dat=function(n){return this.cdata(n)},o.prototype.com=function(n){return this.comment(n)},o.prototype.ins=function(n,h){return this.instruction(n,h)},o.prototype.doc=function(){return this.document()},o.prototype.dec=function(n,h,L){return this.declaration(n,h,L)},o.prototype.e=function(n,h,L){return this.element(n,h,L)},o.prototype.n=function(n,h,L){return this.node(n,h,L)},o.prototype.t=function(n){return this.text(n)},o.prototype.d=function(n){return this.cdata(n)},o.prototype.c=function(n){return this.comment(n)},o.prototype.r=function(n){return this.raw(n)},o.prototype.i=function(n,h){return this.instruction(n,h)},o.prototype.u=function(){return this.up()},o.prototype.importXMLBuilder=function(n){return this.importDocument(n)},o.prototype.replaceChild=function(n,h){throw new Error("This DOM method is not implemented."+this.debugInfo())},o.prototype.removeChild=function(n){throw new Error("This DOM method is not implemented."+this.debugInfo())},o.prototype.appendChild=function(n){throw new Error("This DOM method is not implemented."+this.debugInfo())},o.prototype.hasChildNodes=function(){return this.children.length!==0},o.prototype.cloneNode=function(n){throw new Error("This DOM method is not implemented."+this.debugInfo())},o.prototype.normalize=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},o.prototype.isSupported=function(n,h){return!0},o.prototype.hasAttributes=function(){return this.attribs.length!==0},o.prototype.compareDocumentPosition=function(n){var h,L;return h=this,h===n?0:this.document()!==n.document()?(L=t.Disconnected|t.ImplementationSpecific,Math.random()<.5?L|=t.Preceding:L|=t.Following,L):h.isAncestor(n)?t.Contains|t.Preceding:h.isDescendant(n)?t.Contains|t.Following:h.isPreceding(n)?t.Preceding:t.Following},o.prototype.isSameNode=function(n){throw new Error("This DOM method is not implemented."+this.debugInfo())},o.prototype.lookupPrefix=function(n){throw new Error("This DOM method is not implemented."+this.debugInfo())},o.prototype.isDefaultNamespace=function(n){throw new Error("This DOM method is not implemented."+this.debugInfo())},o.prototype.lookupNamespaceURI=function(n){throw new Error("This DOM method is not implemented."+this.debugInfo())},o.prototype.isEqualNode=function(n){var h,L,I;if(n.nodeType!==this.nodeType||n.children.length!==this.children.length)return!1;for(h=L=0,I=this.children.length-1;0<=I?L<=I:L>=I;h=0<=I?++L:--L)if(!this.children[h].isEqualNode(n.children[h]))return!1;return!0},o.prototype.getFeature=function(n,h){throw new Error("This DOM method is not implemented."+this.debugInfo())},o.prototype.setUserData=function(n,h,L){throw new Error("This DOM method is not implemented."+this.debugInfo())},o.prototype.getUserData=function(n){throw new Error("This DOM method is not implemented."+this.debugInfo())},o.prototype.contains=function(n){return n?n===this||this.isDescendant(n):!1},o.prototype.isDescendant=function(n){var h,L,I,a,w;for(w=this.children,I=0,a=w.length;I<a;I++)if(h=w[I],n===h||(L=h.isDescendant(n),L))return!0;return!1},o.prototype.isAncestor=function(n){return n.isDescendant(this)},o.prototype.isPreceding=function(n){var h,L;return h=this.treePosition(n),L=this.treePosition(this),h===-1||L===-1?!1:h<L},o.prototype.isFollowing=function(n){var h,L;return h=this.treePosition(n),L=this.treePosition(this),h===-1||L===-1?!1:h>L},o.prototype.treePosition=function(n){var h,L;return L=0,h=!1,this.foreachTreeNode(this.document(),function(I){if(L++,!h&&I===n)return h=!0}),h?L:-1},o.prototype.foreachTreeNode=function(n,h){var L,I,a,w,v;for(n||(n=this.document()),w=n.children,I=0,a=w.length;I<a;I++){if(L=w[I],v=h(L))return v;if(v=this.foreachTreeNode(L,h),v)return v}},o})()}).call(nr)});var kt=F((or,sr)=>{(function(){var t,r=function(y,i){return function(){return y.apply(i,arguments)}},c={}.hasOwnProperty;sr.exports=t=(function(){function y(i){this.assertLegalName=r(this.assertLegalName,this),this.assertLegalChar=r(this.assertLegalChar,this);var f,u,l;i||(i={}),this.options=i,this.options.version||(this.options.version="1.0"),u=i.stringify||{};for(f in u)c.call(u,f)&&(l=u[f],this[f]=l)}return y.prototype.name=function(i){return this.options.noValidation?i:this.assertLegalName(""+i||"")},y.prototype.text=function(i){return this.options.noValidation?i:this.assertLegalChar(this.textEscape(""+i||""))},y.prototype.cdata=function(i){return this.options.noValidation?i:(i=""+i||"",i=i.replace("]]>","]]]]><![CDATA[>"),this.assertLegalChar(i))},y.prototype.comment=function(i){if(this.options.noValidation)return i;if(i=""+i||"",i.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+i);return this.assertLegalChar(i)},y.prototype.raw=function(i){return this.options.noValidation?i:""+i||""},y.prototype.attValue=function(i){return this.options.noValidation?i:this.assertLegalChar(this.attEscape(i=""+i||""))},y.prototype.insTarget=function(i){return this.options.noValidation?i:this.assertLegalChar(""+i||"")},y.prototype.insValue=function(i){if(this.options.noValidation)return i;if(i=""+i||"",i.match(/\?>/))throw new Error("Invalid processing instruction value: "+i);return this.assertLegalChar(i)},y.prototype.xmlVersion=function(i){if(this.options.noValidation)return i;if(i=""+i||"",!i.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+i);return i},y.prototype.xmlEncoding=function(i){if(this.options.noValidation)return i;if(i=""+i||"",!i.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+i);return this.assertLegalChar(i)},y.prototype.xmlStandalone=function(i){return this.options.noValidation?i:i?"yes":"no"},y.prototype.dtdPubID=function(i){return this.options.noValidation?i:this.assertLegalChar(""+i||"")},y.prototype.dtdSysID=function(i){return this.options.noValidation?i:this.assertLegalChar(""+i||"")},y.prototype.dtdElementValue=function(i){return this.options.noValidation?i:this.assertLegalChar(""+i||"")},y.prototype.dtdAttType=function(i){return this.options.noValidation?i:this.assertLegalChar(""+i||"")},y.prototype.dtdAttDefault=function(i){return this.options.noValidation?i:this.assertLegalChar(""+i||"")},y.prototype.dtdEntityValue=function(i){return this.options.noValidation?i:this.assertLegalChar(""+i||"")},y.prototype.dtdNData=function(i){return this.options.noValidation?i:this.assertLegalChar(""+i||"")},y.prototype.convertAttKey="@",y.prototype.convertPIKey="?",y.prototype.convertTextKey="#text",y.prototype.convertCDataKey="#cdata",y.prototype.convertCommentKey="#comment",y.prototype.convertRawKey="#raw",y.prototype.assertLegalChar=function(i){var f,u;if(this.options.noValidation)return i;if(f="",this.options.version==="1.0"){if(f=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,u=i.match(f))throw new Error("Invalid character in string: "+i+" at index "+u.index)}else if(this.options.version==="1.1"&&(f=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,u=i.match(f)))throw new Error("Invalid character in string: "+i+" at index "+u.index);return i},y.prototype.assertLegalName=function(i){var f;if(this.options.noValidation)return i;if(this.assertLegalChar(i),f=/^([: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]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/,!i.match(f))throw new Error("Invalid character in name");return i},y.prototype.textEscape=function(i){var f;return this.options.noValidation?i:(f=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,i.replace(f,"&").replace(/</g,"<").replace(/>/g,">").replace(/\r/g,"
"))},y.prototype.attEscape=function(i){var f;return this.options.noValidation?i:(f=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,i.replace(f,"&").replace(/</g,"<").replace(/"/g,""").replace(/\t/g,"	").replace(/\n/g,"
").replace(/\r/g,"
"))},y})()}).call(or)});var mt=F((ur,ar)=>{(function(){ar.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}).call(ur)});var Gt=F((cr,lr)=>{(function(){var t,r,c,y,i,f,u,l,m,g,N,O,D,p,T,E,A,M={}.hasOwnProperty;A=tt().assign,t=k(),m=Et(),g=Ct(),c=Dt(),y=bt(),O=Tt(),p=_t(),T=vt(),D=Mt(),N=Wt(),i=Nt(),f=It(),u=Ot(),l=Lt(),r=mt(),lr.exports=E=(function(){function C(d){var o,n,h;d||(d={}),this.options=d,n=d.writer||{};for(o in n)M.call(n,o)&&(h=n[o],this["_"+o]=this[o],this[o]=h)}return C.prototype.filterOptions=function(d){var o,n,h,L,I,a,w,v;return d||(d={}),d=A({},this.options,d),o={writer:this},o.pretty=d.pretty||!1,o.allowEmpty=d.allowEmpty||!1,o.indent=(n=d.indent)!=null?n:" ",o.newline=(h=d.newline)!=null?h:`
|
|
3
|
-
`,o.offset=(L=d.offset)!=null?L:0,o.dontPrettyTextNodes=(I=(a=d.dontPrettyTextNodes)!=null?a:d.dontprettytextnodes)!=null?I:0,o.spaceBeforeSlash=(w=(v=d.spaceBeforeSlash)!=null?v:d.spacebeforeslash)!=null?w:"",o.spaceBeforeSlash===!0&&(o.spaceBeforeSlash=" "),o.suppressPrettyCount=0,o.user={},o.state=r.None,o},C.prototype.indent=function(d,o,n){var h;return!o.pretty||o.suppressPrettyCount?"":o.pretty&&(h=(n||0)+o.offset+1,h>0)?new Array(h).join(o.indent):""},C.prototype.endline=function(d,o,n){return!o.pretty||o.suppressPrettyCount?"":o.newline},C.prototype.attribute=function(d,o,n){var h;return this.openAttribute(d,o,n),h=" "+d.name+'="'+d.value+'"',this.closeAttribute(d,o,n),h},C.prototype.cdata=function(d,o,n){var h;return this.openNode(d,o,n),o.state=r.OpenTag,h=this.indent(d,o,n)+"<![CDATA[",o.state=r.InsideTag,h+=d.value,o.state=r.CloseTag,h+="]]>"+this.endline(d,o,n),o.state=r.None,this.closeNode(d,o,n),h},C.prototype.comment=function(d,o,n){var h;return this.openNode(d,o,n),o.state=r.OpenTag,h=this.indent(d,o,n)+"<!-- ",o.state=r.InsideTag,h+=d.value,o.state=r.CloseTag,h+=" -->"+this.endline(d,o,n),o.state=r.None,this.closeNode(d,o,n),h},C.prototype.declaration=function(d,o,n){var h;return this.openNode(d,o,n),o.state=r.OpenTag,h=this.indent(d,o,n)+"<?xml",o.state=r.InsideTag,h+=' version="'+d.version+'"',d.encoding!=null&&(h+=' encoding="'+d.encoding+'"'),d.standalone!=null&&(h+=' standalone="'+d.standalone+'"'),o.state=r.CloseTag,h+=o.spaceBeforeSlash+"?>",h+=this.endline(d,o,n),o.state=r.None,this.closeNode(d,o,n),h},C.prototype.docType=function(d,o,n){var h,L,I,a,w;if(n||(n=0),this.openNode(d,o,n),o.state=r.OpenTag,a=this.indent(d,o,n),a+="<!DOCTYPE "+d.root().name,d.pubID&&d.sysID?a+=' PUBLIC "'+d.pubID+'" "'+d.sysID+'"':d.sysID&&(a+=' SYSTEM "'+d.sysID+'"'),d.children.length>0){for(a+=" [",a+=this.endline(d,o,n),o.state=r.InsideTag,w=d.children,L=0,I=w.length;L<I;L++)h=w[L],a+=this.writeChildNode(h,o,n+1);o.state=r.CloseTag,a+="]"}return o.state=r.CloseTag,a+=o.spaceBeforeSlash+">",a+=this.endline(d,o,n),o.state=r.None,this.closeNode(d,o,n),a},C.prototype.element=function(d,o,n){var h,L,I,a,w,v,P,x,X,q,S,V,R,J;n||(n=0),q=!1,S="",this.openNode(d,o,n),o.state=r.OpenTag,S+=this.indent(d,o,n)+"<"+d.name,V=d.attribs;for(X in V)M.call(V,X)&&(h=V[X],S+=this.attribute(h,o,n));if(I=d.children.length,a=I===0?null:d.children[0],I===0||d.children.every(function(ht){return(ht.type===t.Text||ht.type===t.Raw)&&ht.value===""}))o.allowEmpty?(S+=">",o.state=r.CloseTag,S+="</"+d.name+">"+this.endline(d,o,n)):(o.state=r.CloseTag,S+=o.spaceBeforeSlash+"/>"+this.endline(d,o,n));else if(o.pretty&&I===1&&(a.type===t.Text||a.type===t.Raw)&&a.value!=null)S+=">",o.state=r.InsideTag,o.suppressPrettyCount++,q=!0,S+=this.writeChildNode(a,o,n+1),o.suppressPrettyCount--,q=!1,o.state=r.CloseTag,S+="</"+d.name+">"+this.endline(d,o,n);else{if(o.dontPrettyTextNodes){for(R=d.children,w=0,P=R.length;w<P;w++)if(L=R[w],(L.type===t.Text||L.type===t.Raw)&&L.value!=null){o.suppressPrettyCount++,q=!0;break}}for(S+=">"+this.endline(d,o,n),o.state=r.InsideTag,J=d.children,v=0,x=J.length;v<x;v++)L=J[v],S+=this.writeChildNode(L,o,n+1);o.state=r.CloseTag,S+=this.indent(d,o,n)+"</"+d.name+">",q&&o.suppressPrettyCount--,S+=this.endline(d,o,n),o.state=r.None}return this.closeNode(d,o,n),S},C.prototype.writeChildNode=function(d,o,n){switch(d.type){case t.CData:return this.cdata(d,o,n);case t.Comment:return this.comment(d,o,n);case t.Element:return this.element(d,o,n);case t.Raw:return this.raw(d,o,n);case t.Text:return this.text(d,o,n);case t.ProcessingInstruction:return this.processingInstruction(d,o,n);case t.Dummy:return"";case t.Declaration:return this.declaration(d,o,n);case t.DocType:return this.docType(d,o,n);case t.AttributeDeclaration:return this.dtdAttList(d,o,n);case t.ElementDeclaration:return this.dtdElement(d,o,n);case t.EntityDeclaration:return this.dtdEntity(d,o,n);case t.NotationDeclaration:return this.dtdNotation(d,o,n);default:throw new Error("Unknown XML node type: "+d.constructor.name)}},C.prototype.processingInstruction=function(d,o,n){var h;return this.openNode(d,o,n),o.state=r.OpenTag,h=this.indent(d,o,n)+"<?",o.state=r.InsideTag,h+=d.target,d.value&&(h+=" "+d.value),o.state=r.CloseTag,h+=o.spaceBeforeSlash+"?>",h+=this.endline(d,o,n),o.state=r.None,this.closeNode(d,o,n),h},C.prototype.raw=function(d,o,n){var h;return this.openNode(d,o,n),o.state=r.OpenTag,h=this.indent(d,o,n),o.state=r.InsideTag,h+=d.value,o.state=r.CloseTag,h+=this.endline(d,o,n),o.state=r.None,this.closeNode(d,o,n),h},C.prototype.text=function(d,o,n){var h;return this.openNode(d,o,n),o.state=r.OpenTag,h=this.indent(d,o,n),o.state=r.InsideTag,h+=d.value,o.state=r.CloseTag,h+=this.endline(d,o,n),o.state=r.None,this.closeNode(d,o,n),h},C.prototype.dtdAttList=function(d,o,n){var h;return this.openNode(d,o,n),o.state=r.OpenTag,h=this.indent(d,o,n)+"<!ATTLIST",o.state=r.InsideTag,h+=" "+d.elementName+" "+d.attributeName+" "+d.attributeType,d.defaultValueType!=="#DEFAULT"&&(h+=" "+d.defaultValueType),d.defaultValue&&(h+=' "'+d.defaultValue+'"'),o.state=r.CloseTag,h+=o.spaceBeforeSlash+">"+this.endline(d,o,n),o.state=r.None,this.closeNode(d,o,n),h},C.prototype.dtdElement=function(d,o,n){var h;return this.openNode(d,o,n),o.state=r.OpenTag,h=this.indent(d,o,n)+"<!ELEMENT",o.state=r.InsideTag,h+=" "+d.name+" "+d.value,o.state=r.CloseTag,h+=o.spaceBeforeSlash+">"+this.endline(d,o,n),o.state=r.None,this.closeNode(d,o,n),h},C.prototype.dtdEntity=function(d,o,n){var h;return this.openNode(d,o,n),o.state=r.OpenTag,h=this.indent(d,o,n)+"<!ENTITY",o.state=r.InsideTag,d.pe&&(h+=" %"),h+=" "+d.name,d.value?h+=' "'+d.value+'"':(d.pubID&&d.sysID?h+=' PUBLIC "'+d.pubID+'" "'+d.sysID+'"':d.sysID&&(h+=' SYSTEM "'+d.sysID+'"'),d.nData&&(h+=" NDATA "+d.nData)),o.state=r.CloseTag,h+=o.spaceBeforeSlash+">"+this.endline(d,o,n),o.state=r.None,this.closeNode(d,o,n),h},C.prototype.dtdNotation=function(d,o,n){var h;return this.openNode(d,o,n),o.state=r.OpenTag,h=this.indent(d,o,n)+"<!NOTATION",o.state=r.InsideTag,h+=" "+d.name,d.pubID&&d.sysID?h+=' PUBLIC "'+d.pubID+'" "'+d.sysID+'"':d.pubID?h+=' PUBLIC "'+d.pubID+'"':d.sysID&&(h+=' SYSTEM "'+d.sysID+'"'),o.state=r.CloseTag,h+=o.spaceBeforeSlash+">"+this.endline(d,o,n),o.state=r.None,this.closeNode(d,o,n),h},C.prototype.openNode=function(d,o,n){},C.prototype.closeNode=function(d,o,n){},C.prototype.openAttribute=function(d,o,n){},C.prototype.closeAttribute=function(d,o,n){},C})()}).call(cr)});var At=F((fr,hr)=>{(function(){var t,r,c=function(i,f){for(var u in f)y.call(f,u)&&(i[u]=f[u]);function l(){this.constructor=i}return l.prototype=f.prototype,i.prototype=new l,i.__super__=f.prototype,i},y={}.hasOwnProperty;r=Gt(),hr.exports=t=(function(i){c(f,i);function f(u){f.__super__.constructor.call(this,u)}return f.prototype.document=function(u,l){var m,g,N,O,D;for(l=this.filterOptions(l),O="",D=u.children,g=0,N=D.length;g<N;g++)m=D[g],O+=this.writeChildNode(m,l,0);return l.pretty&&O.slice(-l.newline.length)===l.newline&&(O=O.slice(0,-l.newline.length)),O},f})(r)}).call(fr)});var Yt=F((pr,dr)=>{(function(){var t,r,c,y,i,f,u,l,m=function(N,O){for(var D in O)g.call(O,D)&&(N[D]=O[D]);function p(){this.constructor=N}return p.prototype=O.prototype,N.prototype=new p,N.__super__=O.prototype,N},g={}.hasOwnProperty;l=tt().isPlainObject,c=Ut(),r=ye(),i=$(),t=k(),u=kt(),f=At(),dr.exports=y=(function(N){m(O,N);function O(D){O.__super__.constructor.call(this,null),this.name="#document",this.type=t.Document,this.documentURI=null,this.domConfig=new r,D||(D={}),D.writer||(D.writer=new f),this.options=D,this.stringify=new u(D)}return Object.defineProperty(O.prototype,"implementation",{value:new c}),Object.defineProperty(O.prototype,"doctype",{get:function(){var D,p,T,E;for(E=this.children,p=0,T=E.length;p<T;p++)if(D=E[p],D.type===t.DocType)return D;return null}}),Object.defineProperty(O.prototype,"documentElement",{get:function(){return this.rootObject||null}}),Object.defineProperty(O.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(O.prototype,"strictErrorChecking",{get:function(){return!1}}),Object.defineProperty(O.prototype,"xmlEncoding",{get:function(){return this.children.length!==0&&this.children[0].type===t.Declaration?this.children[0].encoding:null}}),Object.defineProperty(O.prototype,"xmlStandalone",{get:function(){return this.children.length!==0&&this.children[0].type===t.Declaration?this.children[0].standalone==="yes":!1}}),Object.defineProperty(O.prototype,"xmlVersion",{get:function(){return this.children.length!==0&&this.children[0].type===t.Declaration?this.children[0].version:"1.0"}}),Object.defineProperty(O.prototype,"URL",{get:function(){return this.documentURI}}),Object.defineProperty(O.prototype,"origin",{get:function(){return null}}),Object.defineProperty(O.prototype,"compatMode",{get:function(){return null}}),Object.defineProperty(O.prototype,"characterSet",{get:function(){return null}}),Object.defineProperty(O.prototype,"contentType",{get:function(){return null}}),O.prototype.end=function(D){var p;return p={},D?l(D)&&(p=D,D=this.options.writer):D=this.options.writer,D.document(this,D.filterOptions(p))},O.prototype.toString=function(D){return this.options.writer.document(this,this.options.writer.filterOptions(D))},O.prototype.createElement=function(D){throw new Error("This DOM method is not implemented."+this.debugInfo())},O.prototype.createDocumentFragment=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},O.prototype.createTextNode=function(D){throw new Error("This DOM method is not implemented."+this.debugInfo())},O.prototype.createComment=function(D){throw new Error("This DOM method is not implemented."+this.debugInfo())},O.prototype.createCDATASection=function(D){throw new Error("This DOM method is not implemented."+this.debugInfo())},O.prototype.createProcessingInstruction=function(D,p){throw new Error("This DOM method is not implemented."+this.debugInfo())},O.prototype.createAttribute=function(D){throw new Error("This DOM method is not implemented."+this.debugInfo())},O.prototype.createEntityReference=function(D){throw new Error("This DOM method is not implemented."+this.debugInfo())},O.prototype.getElementsByTagName=function(D){throw new Error("This DOM method is not implemented."+this.debugInfo())},O.prototype.importNode=function(D,p){throw new Error("This DOM method is not implemented."+this.debugInfo())},O.prototype.createElementNS=function(D,p){throw new Error("This DOM method is not implemented."+this.debugInfo())},O.prototype.createAttributeNS=function(D,p){throw new Error("This DOM method is not implemented."+this.debugInfo())},O.prototype.getElementsByTagNameNS=function(D,p){throw new Error("This DOM method is not implemented."+this.debugInfo())},O.prototype.getElementById=function(D){throw new Error("This DOM method is not implemented."+this.debugInfo())},O.prototype.adoptNode=function(D){throw new Error("This DOM method is not implemented."+this.debugInfo())},O.prototype.normalizeDocument=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},O.prototype.renameNode=function(D,p,T){throw new Error("This DOM method is not implemented."+this.debugInfo())},O.prototype.getElementsByClassName=function(D){throw new Error("This DOM method is not implemented."+this.debugInfo())},O.prototype.createEvent=function(D){throw new Error("This DOM method is not implemented."+this.debugInfo())},O.prototype.createRange=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},O.prototype.createNodeIterator=function(D,p,T){throw new Error("This DOM method is not implemented."+this.debugInfo())},O.prototype.createTreeWalker=function(D,p,T){throw new Error("This DOM method is not implemented."+this.debugInfo())},O})(i)}).call(pr)});var gr=F((mr,yr)=>{(function(){var t,r,c,y,i,f,u,l,m,g,N,O,D,p,T,E,A,M,C,d,o,n,h,L,I={}.hasOwnProperty;L=tt(),n=L.isObject,o=L.isFunction,h=L.isPlainObject,d=L.getValue,t=k(),O=Yt(),p=Tt(),y=Dt(),i=bt(),E=_t(),C=vt(),T=Mt(),g=Et(),N=Ct(),f=Nt(),l=Ot(),u=It(),m=Lt(),c=Vt(),M=kt(),A=At(),r=mt(),yr.exports=D=(function(){function a(w,v,P){var x;this.name="?xml",this.type=t.Document,w||(w={}),x={},w.writer?h(w.writer)&&(x=w.writer,w.writer=new A):w.writer=new A,this.options=w,this.writer=w.writer,this.writerOptions=this.writer.filterOptions(x),this.stringify=new M(w),this.onDataCallback=v||function(){},this.onEndCallback=P||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}return a.prototype.createChildNode=function(w){var v,P,x,X,q,S,V,R;switch(w.type){case t.CData:this.cdata(w.value);break;case t.Comment:this.comment(w.value);break;case t.Element:x={},V=w.attribs;for(P in V)I.call(V,P)&&(v=V[P],x[P]=v.value);this.node(w.name,x);break;case t.Dummy:this.dummy();break;case t.Raw:this.raw(w.value);break;case t.Text:this.text(w.value);break;case t.ProcessingInstruction:this.instruction(w.target,w.value);break;default:throw new Error("This XML node type is not supported in a JS object: "+w.constructor.name)}for(R=w.children,q=0,S=R.length;q<S;q++)X=R[q],this.createChildNode(X),X.type===t.Element&&this.up();return this},a.prototype.dummy=function(){return this},a.prototype.node=function(w,v,P){var x;if(w==null)throw new Error("Missing node name.");if(this.root&&this.currentLevel===-1)throw new Error("Document can only have one root node. "+this.debugInfo(w));return this.openCurrent(),w=d(w),v==null&&(v={}),v=d(v),n(v)||(x=[v,P],P=x[0],v=x[1]),this.currentNode=new p(this,w,v),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,P!=null&&this.text(P),this},a.prototype.element=function(w,v,P){var x,X,q,S,V,R;if(this.currentNode&&this.currentNode.type===t.DocType)this.dtdElement.apply(this,arguments);else if(Array.isArray(w)||n(w)||o(w))for(S=this.options.noValidation,this.options.noValidation=!0,R=new O(this.options).element("TEMP_ROOT"),R.element(w),this.options.noValidation=S,V=R.children,X=0,q=V.length;X<q;X++)x=V[X],this.createChildNode(x),x.type===t.Element&&this.up();else this.node(w,v,P);return this},a.prototype.attribute=function(w,v){var P,x;if(!this.currentNode||this.currentNode.children)throw new Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo(w));if(w!=null&&(w=d(w)),n(w))for(P in w)I.call(w,P)&&(x=w[P],this.attribute(P,x));else o(v)&&(v=v.apply()),this.options.keepNullAttributes&&v==null?this.currentNode.attribs[w]=new c(this,w,""):v!=null&&(this.currentNode.attribs[w]=new c(this,w,v));return this},a.prototype.text=function(w){var v;return this.openCurrent(),v=new C(this,w),this.onData(this.writer.text(v,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},a.prototype.cdata=function(w){var v;return this.openCurrent(),v=new y(this,w),this.onData(this.writer.cdata(v,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},a.prototype.comment=function(w){var v;return this.openCurrent(),v=new i(this,w),this.onData(this.writer.comment(v,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},a.prototype.raw=function(w){var v;return this.openCurrent(),v=new E(this,w),this.onData(this.writer.raw(v,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},a.prototype.instruction=function(w,v){var P,x,X,q,S;if(this.openCurrent(),w!=null&&(w=d(w)),v!=null&&(v=d(v)),Array.isArray(w))for(P=0,q=w.length;P<q;P++)x=w[P],this.instruction(x);else if(n(w))for(x in w)I.call(w,x)&&(X=w[x],this.instruction(x,X));else o(v)&&(v=v.apply()),S=new T(this,w,v),this.onData(this.writer.processingInstruction(S,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this},a.prototype.declaration=function(w,v,P){var x;if(this.openCurrent(),this.documentStarted)throw new Error("declaration() must be the first node.");return x=new g(this,w,v,P),this.onData(this.writer.declaration(x,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},a.prototype.doctype=function(w,v,P){if(this.openCurrent(),w==null)throw new Error("Missing root node name.");if(this.root)throw new Error("dtd() must come before the root node.");return this.currentNode=new N(this,v,P),this.currentNode.rootNodeName=w,this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,this},a.prototype.dtdElement=function(w,v){var P;return this.openCurrent(),P=new u(this,w,v),this.onData(this.writer.dtdElement(P,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},a.prototype.attList=function(w,v,P,x,X){var q;return this.openCurrent(),q=new f(this,w,v,P,x,X),this.onData(this.writer.dtdAttList(q,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},a.prototype.entity=function(w,v){var P;return this.openCurrent(),P=new l(this,!1,w,v),this.onData(this.writer.dtdEntity(P,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},a.prototype.pEntity=function(w,v){var P;return this.openCurrent(),P=new l(this,!0,w,v),this.onData(this.writer.dtdEntity(P,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},a.prototype.notation=function(w,v){var P;return this.openCurrent(),P=new m(this,w,v),this.onData(this.writer.dtdNotation(P,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},a.prototype.up=function(){if(this.currentLevel<0)throw new Error("The document node has no parent.");return this.currentNode?(this.currentNode.children?this.closeNode(this.currentNode):this.openNode(this.currentNode),this.currentNode=null):this.closeNode(this.openTags[this.currentLevel]),delete this.openTags[this.currentLevel],this.currentLevel--,this},a.prototype.end=function(){for(;this.currentLevel>=0;)this.up();return this.onEnd()},a.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},a.prototype.openNode=function(w){var v,P,x,X;if(!w.isOpen){if(!this.root&&this.currentLevel===0&&w.type===t.Element&&(this.root=w),P="",w.type===t.Element){this.writerOptions.state=r.OpenTag,P=this.writer.indent(w,this.writerOptions,this.currentLevel)+"<"+w.name,X=w.attribs;for(x in X)I.call(X,x)&&(v=X[x],P+=this.writer.attribute(v,this.writerOptions,this.currentLevel));P+=(w.children?">":"/>")+this.writer.endline(w,this.writerOptions,this.currentLevel),this.writerOptions.state=r.InsideTag}else this.writerOptions.state=r.OpenTag,P=this.writer.indent(w,this.writerOptions,this.currentLevel)+"<!DOCTYPE "+w.rootNodeName,w.pubID&&w.sysID?P+=' PUBLIC "'+w.pubID+'" "'+w.sysID+'"':w.sysID&&(P+=' SYSTEM "'+w.sysID+'"'),w.children?(P+=" [",this.writerOptions.state=r.InsideTag):(this.writerOptions.state=r.CloseTag,P+=">"),P+=this.writer.endline(w,this.writerOptions,this.currentLevel);return this.onData(P,this.currentLevel),w.isOpen=!0}},a.prototype.closeNode=function(w){var v;if(!w.isClosed)return v="",this.writerOptions.state=r.CloseTag,w.type===t.Element?v=this.writer.indent(w,this.writerOptions,this.currentLevel)+"</"+w.name+">"+this.writer.endline(w,this.writerOptions,this.currentLevel):v=this.writer.indent(w,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(w,this.writerOptions,this.currentLevel),this.writerOptions.state=r.None,this.onData(v,this.currentLevel),w.isClosed=!0},a.prototype.onData=function(w,v){return this.documentStarted=!0,this.onDataCallback(w,v+1)},a.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},a.prototype.debugInfo=function(w){return w==null?"":"node: <"+w+">"},a.prototype.ele=function(){return this.element.apply(this,arguments)},a.prototype.nod=function(w,v,P){return this.node(w,v,P)},a.prototype.txt=function(w){return this.text(w)},a.prototype.dat=function(w){return this.cdata(w)},a.prototype.com=function(w){return this.comment(w)},a.prototype.ins=function(w,v){return this.instruction(w,v)},a.prototype.dec=function(w,v,P){return this.declaration(w,v,P)},a.prototype.dtd=function(w,v,P){return this.doctype(w,v,P)},a.prototype.e=function(w,v,P){return this.element(w,v,P)},a.prototype.n=function(w,v,P){return this.node(w,v,P)},a.prototype.t=function(w){return this.text(w)},a.prototype.d=function(w){return this.cdata(w)},a.prototype.c=function(w){return this.comment(w)},a.prototype.r=function(w){return this.raw(w)},a.prototype.i=function(w,v){return this.instruction(w,v)},a.prototype.att=function(){return this.currentNode&&this.currentNode.type===t.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},a.prototype.a=function(){return this.currentNode&&this.currentNode.type===t.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},a.prototype.ent=function(w,v){return this.entity(w,v)},a.prototype.pent=function(w,v){return this.pEntity(w,v)},a.prototype.not=function(w,v){return this.notation(w,v)},a})()}).call(mr)});var Dr=F((wr,Tr)=>{(function(){var t,r,c,y,i=function(u,l){for(var m in l)f.call(l,m)&&(u[m]=l[m]);function g(){this.constructor=u}return g.prototype=l.prototype,u.prototype=new g,u.__super__=l.prototype,u},f={}.hasOwnProperty;t=k(),y=Gt(),r=mt(),Tr.exports=c=(function(u){i(l,u);function l(m,g){this.stream=m,l.__super__.constructor.call(this,g)}return l.prototype.endline=function(m,g,N){return m.isLastRootNode&&g.state===r.CloseTag?"":l.__super__.endline.call(this,m,g,N)},l.prototype.document=function(m,g){var N,O,D,p,T,E,A,M,C;for(A=m.children,O=D=0,T=A.length;D<T;O=++D)N=A[O],N.isLastRootNode=O===m.children.length-1;for(g=this.filterOptions(g),M=m.children,C=[],p=0,E=M.length;p<E;p++)N=M[p],C.push(this.writeChildNode(N,g,0));return C},l.prototype.attribute=function(m,g,N){return this.stream.write(l.__super__.attribute.call(this,m,g,N))},l.prototype.cdata=function(m,g,N){return this.stream.write(l.__super__.cdata.call(this,m,g,N))},l.prototype.comment=function(m,g,N){return this.stream.write(l.__super__.comment.call(this,m,g,N))},l.prototype.declaration=function(m,g,N){return this.stream.write(l.__super__.declaration.call(this,m,g,N))},l.prototype.docType=function(m,g,N){var O,D,p,T;if(N||(N=0),this.openNode(m,g,N),g.state=r.OpenTag,this.stream.write(this.indent(m,g,N)),this.stream.write("<!DOCTYPE "+m.root().name),m.pubID&&m.sysID?this.stream.write(' PUBLIC "'+m.pubID+'" "'+m.sysID+'"'):m.sysID&&this.stream.write(' SYSTEM "'+m.sysID+'"'),m.children.length>0){for(this.stream.write(" ["),this.stream.write(this.endline(m,g,N)),g.state=r.InsideTag,T=m.children,D=0,p=T.length;D<p;D++)O=T[D],this.writeChildNode(O,g,N+1);g.state=r.CloseTag,this.stream.write("]")}return g.state=r.CloseTag,this.stream.write(g.spaceBeforeSlash+">"),this.stream.write(this.endline(m,g,N)),g.state=r.None,this.closeNode(m,g,N)},l.prototype.element=function(m,g,N){var O,D,p,T,E,A,M,C,d,o;N||(N=0),this.openNode(m,g,N),g.state=r.OpenTag,this.stream.write(this.indent(m,g,N)+"<"+m.name),d=m.attribs;for(M in d)f.call(d,M)&&(O=d[M],this.attribute(O,g,N));if(p=m.children.length,T=p===0?null:m.children[0],p===0||m.children.every(function(n){return(n.type===t.Text||n.type===t.Raw)&&n.value===""}))g.allowEmpty?(this.stream.write(">"),g.state=r.CloseTag,this.stream.write("</"+m.name+">")):(g.state=r.CloseTag,this.stream.write(g.spaceBeforeSlash+"/>"));else if(g.pretty&&p===1&&(T.type===t.Text||T.type===t.Raw)&&T.value!=null)this.stream.write(">"),g.state=r.InsideTag,g.suppressPrettyCount++,C=!0,this.writeChildNode(T,g,N+1),g.suppressPrettyCount--,C=!1,g.state=r.CloseTag,this.stream.write("</"+m.name+">");else{for(this.stream.write(">"+this.endline(m,g,N)),g.state=r.InsideTag,o=m.children,E=0,A=o.length;E<A;E++)D=o[E],this.writeChildNode(D,g,N+1);g.state=r.CloseTag,this.stream.write(this.indent(m,g,N)+"</"+m.name+">")}return this.stream.write(this.endline(m,g,N)),g.state=r.None,this.closeNode(m,g,N)},l.prototype.processingInstruction=function(m,g,N){return this.stream.write(l.__super__.processingInstruction.call(this,m,g,N))},l.prototype.raw=function(m,g,N){return this.stream.write(l.__super__.raw.call(this,m,g,N))},l.prototype.text=function(m,g,N){return this.stream.write(l.__super__.text.call(this,m,g,N))},l.prototype.dtdAttList=function(m,g,N){return this.stream.write(l.__super__.dtdAttList.call(this,m,g,N))},l.prototype.dtdElement=function(m,g,N){return this.stream.write(l.__super__.dtdElement.call(this,m,g,N))},l.prototype.dtdEntity=function(m,g,N){return this.stream.write(l.__super__.dtdEntity.call(this,m,g,N))},l.prototype.dtdNotation=function(m,g,N){return this.stream.write(l.__super__.dtdNotation.call(this,m,g,N))},l})(y)}).call(wr)});var Er=F((br,ut)=>{(function(){var t,r,c,y,i,f,u,l,m,g;g=tt(),l=g.assign,m=g.isFunction,c=Ut(),y=Yt(),i=gr(),u=At(),f=Dr(),t=k(),r=mt(),ut.exports.create=function(N,O,D,p){var T,E;if(N==null)throw new Error("Root element needs a name.");return p=l({},O,D,p),T=new y(p),E=T.element(N),p.headless||(T.declaration(p),(p.pubID!=null||p.sysID!=null)&&T.dtd(p)),E},ut.exports.begin=function(N,O,D){var p;return m(N)&&(p=[N,O],O=p[0],D=p[1],N={}),O?new i(N,O,D):new y(N)},ut.exports.stringWriter=function(N){return new u(N)},ut.exports.streamWriter=function(N,O){return new f(N,O)},ut.exports.implementation=new c,ut.exports.nodeType=t,ut.exports.writerState=r}).call(br)});var Nr=F(Kt=>{(function(){"use strict";var t,r,c,y,i,f={}.hasOwnProperty;t=Er(),r=gt().defaults,y=function(u){return typeof u=="string"&&(u.indexOf("&")>=0||u.indexOf(">")>=0||u.indexOf("<")>=0)},i=function(u){return"<![CDATA["+c(u)+"]]>"},c=function(u){return u.replace("]]>","]]]]><![CDATA[>")},Kt.Builder=(function(){function u(l){var m,g,N;this.options={},g=r["0.2"];for(m in g)f.call(g,m)&&(N=g[m],this.options[m]=N);for(m in l)f.call(l,m)&&(N=l[m],this.options[m]=N)}return u.prototype.buildObject=function(l){var m,g,N,O,D;return m=this.options.attrkey,g=this.options.charkey,Object.keys(l).length===1&&this.options.rootName===r["0.2"].rootName?(D=Object.keys(l)[0],l=l[D]):D=this.options.rootName,N=(function(p){return function(T,E){var A,M,C,d,o,n;if(typeof E!="object")p.options.cdata&&y(E)?T.raw(i(E)):T.txt(E);else if(Array.isArray(E)){for(d in E)if(f.call(E,d)){M=E[d];for(o in M)C=M[o],T=N(T.ele(o),C).up()}}else for(o in E)if(f.call(E,o))if(M=E[o],o===m){if(typeof M=="object")for(A in M)n=M[A],T=T.att(A,n)}else if(o===g)p.options.cdata&&y(M)?T=T.raw(i(M)):T=T.txt(M);else if(Array.isArray(M))for(d in M)f.call(M,d)&&(C=M[d],typeof C=="string"?p.options.cdata&&y(C)?T=T.ele(o).raw(i(C)).up():T=T.ele(o,C).up():T=N(T.ele(o),C).up());else typeof M=="object"?T=N(T.ele(o),M).up():typeof M=="string"&&p.options.cdata&&y(M)?T=T.ele(o).raw(i(M)).up():(M==null&&(M=""),T=T.ele(o,M.toString()).up());return T}})(this),O=t.create(D,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),N(O,l).end(this.options.renderOpts)},u})()}).call(Kt)});var Or=F((Mn,zt)=>{function K(t){if(t)return ln(t);this._callbacks=new Map}function ln(t){return Object.assign(t,K.prototype),t._callbacks=new Map,t}K.prototype.on=function(t,r){let c=this._callbacks.get(t)??[];return c.push(r),this._callbacks.set(t,c),this};K.prototype.once=function(t,r){let c=(...y)=>{this.off(t,c),r.apply(this,y)};return c.fn=r,this.on(t,c),this};K.prototype.off=function(t,r){if(t===void 0&&r===void 0)return this._callbacks.clear(),this;if(r===void 0)return this._callbacks.delete(t),this;let c=this._callbacks.get(t);if(c){for(let[y,i]of c.entries())if(i===r||i.fn===r){c.splice(y,1);break}c.length===0?this._callbacks.delete(t):this._callbacks.set(t,c)}return this};K.prototype.emit=function(t,...r){let c=this._callbacks.get(t);if(c){let y=[...c];for(let i of y)i.apply(this,r)}return this};K.prototype.listeners=function(t){return this._callbacks.get(t)??[]};K.prototype.listenerCount=function(t){if(t)return this.listeners(t).length;let r=0;for(let c of this._callbacks.values())r+=c.length;return r};K.prototype.hasListeners=function(t){return this.listenerCount(t)>0};K.prototype.addEventListener=K.prototype.on;K.prototype.removeListener=K.prototype.off;K.prototype.removeEventListener=K.prototype.off;K.prototype.removeAllListeners=K.prototype.off;typeof zt<"u"&&(zt.exports=K)});var Cr=F((An,Lr)=>{var Ir=Or();function yt(){Ir.call(this)}yt.prototype=new Ir;Lr.exports=yt;yt.Stream=yt;yt.prototype.pipe=function(t,r){var c=this;function y(N){t.writable&&t.write(N)===!1&&c.pause&&c.pause()}c.on("data",y);function i(){c.readable&&c.resume&&c.resume()}t.on("drain",i),!t._isStdio&&(!r||r.end!==!1)&&(c.on("end",u),c.on("close",l));var f=!1;function u(){f||(f=!0,t.end())}function l(){f||(f=!0,typeof t.destroy=="function"&&t.destroy())}function m(N){if(g(),!this.hasListeners("error"))throw N}c.on("error",m),t.on("error",m);function g(){c.off("data",y),t.off("drain",i),c.off("end",u),c.off("close",l),c.off("error",m),t.off("error",m),c.off("end",g),c.off("close",g),t.off("end",g),t.off("close",g)}return c.on("end",g),c.on("close",g),t.on("end",g),t.on("close",g),t.emit("pipe",c),t}});var _r=F(Pt=>{(function(t){t.parser=function(s,e){return new c(s,e)},t.SAXParser=c,t.SAXStream=N,t.createStream=m,t.MAX_BUFFER_LENGTH=64*1024;var r=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];t.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function c(s,e){if(!(this instanceof c))return new c(s,e);var _=this;i(_),_.q=_.c="",_.bufferCheckPosition=t.MAX_BUFFER_LENGTH,_.encoding=null,_.opt=e||{},_.opt.lowercase=_.opt.lowercase||_.opt.lowercasetags,_.looseCase=_.opt.lowercase?"toLowerCase":"toUpperCase",_.opt.maxEntityCount=_.opt.maxEntityCount||512,_.opt.maxEntityDepth=_.opt.maxEntityDepth||4,_.entityCount=_.entityDepth=0,_.tags=[],_.closed=_.closedRoot=_.sawRoot=!1,_.tag=_.error=null,_.strict=!!s,_.noscript=!!(s||_.opt.noscript),_.state=a.BEGIN,_.strictEntities=_.opt.strictEntities,_.ENTITIES=_.strictEntities?Object.create(t.XML_ENTITIES):Object.create(t.ENTITIES),_.attribList=[],_.opt.xmlns&&(_.ns=Object.create(E)),_.opt.unquotedAttributeValues===void 0&&(_.opt.unquotedAttributeValues=!s),_.trackPosition=_.opt.position!==!1,_.trackPosition&&(_.position=_.line=_.column=0),v(_,"onready")}Object.create||(Object.create=function(s){function e(){}e.prototype=s;var _=new e;return _}),Object.keys||(Object.keys=function(s){var e=[];for(var _ in s)s.hasOwnProperty(_)&&e.push(_);return e});function y(s){for(var e=Math.max(t.MAX_BUFFER_LENGTH,10),_=0,b=0,j=r.length;b<j;b++){var W=s[r[b]].length;if(W>e)switch(r[b]){case"textNode":V(s);break;case"cdata":S(s,"oncdata",s.cdata),s.cdata="";break;case"script":S(s,"onscript",s.script),s.script="";break;default:J(s,"Max buffer length exceeded: "+r[b])}_=Math.max(_,W)}var G=t.MAX_BUFFER_LENGTH-_;s.bufferCheckPosition=G+s.position}function i(s){for(var e=0,_=r.length;e<_;e++)s[r[e]]=""}function f(s){V(s),s.cdata!==""&&(S(s,"oncdata",s.cdata),s.cdata=""),s.script!==""&&(S(s,"onscript",s.script),s.script="")}c.prototype={end:function(){ht(this)},write:tn,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){f(this)}};var u;try{u=Cr().Stream}catch{u=function(){}}u||(u=function(){});var l=t.EVENTS.filter(function(s){return s!=="error"&&s!=="end"});function m(s,e){return new N(s,e)}function g(s,e){if(s.length>=2){if(s[0]===255&&s[1]===254)return"utf-16le";if(s[0]===254&&s[1]===255)return"utf-16be"}return s.length>=3&&s[0]===239&&s[1]===187&&s[2]===191?"utf8":s.length>=4?s[0]===60&&s[1]===0&&s[2]===63&&s[3]===0?"utf-16le":s[0]===0&&s[1]===60&&s[2]===0&&s[3]===63?"utf-16be":"utf8":e?"utf8":null}function N(s,e){if(!(this instanceof N))return new N(s,e);u.apply(this),this._parser=new c(s,e),this.writable=!0,this.readable=!0;var _=this;this._parser.onend=function(){_.emit("end")},this._parser.onerror=function(b){_.emit("error",b),_._parser.error=null},this._decoder=null,this._decoderBuffer=null,l.forEach(function(b){Object.defineProperty(_,"on"+b,{get:function(){return _._parser["on"+b]},set:function(j){if(!j)return _.removeAllListeners(b),_._parser["on"+b]=j,j;_.on(b,j)},enumerable:!0,configurable:!1})})}N.prototype=Object.create(u.prototype,{constructor:{value:N}}),N.prototype._decodeBuffer=function(s,e){if(this._decoderBuffer&&(s=Buffer.concat([this._decoderBuffer,s]),this._decoderBuffer=null),!this._decoder){var _=g(s,e);if(!_)return this._decoderBuffer=s,"";this._parser.encoding=_,this._decoder=new TextDecoder(_)}return this._decoder.decode(s,{stream:!e})},N.prototype.write=function(s){if(typeof Buffer=="function"&&typeof Buffer.isBuffer=="function"&&Buffer.isBuffer(s))s=this._decodeBuffer(s,!1);else if(this._decoderBuffer){var e=this._decodeBuffer(Buffer.alloc(0),!0);e&&(this._parser.write(e),this.emit("data",e))}return this._parser.write(s.toString()),this.emit("data",s),!0},N.prototype.end=function(s){if(s&&s.length&&this.write(s),this._decoderBuffer){var e=this._decodeBuffer(Buffer.alloc(0),!0);e&&(this._parser.write(e),this.emit("data",e))}else if(this._decoder){var _=this._decoder.decode();_&&(this._parser.write(_),this.emit("data",_))}return this._parser.end(),!0},N.prototype.on=function(s,e){var _=this;return!_._parser["on"+s]&&l.indexOf(s)!==-1&&(_._parser["on"+s]=function(){var b=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);b.splice(0,0,s),_.emit.apply(_,b)}),u.prototype.on.call(_,s,e)};var O="[CDATA[",D="DOCTYPE",p="http://www.w3.org/XML/1998/namespace",T="http://www.w3.org/2000/xmlns/",E={xml:p,xmlns:T},A=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,M=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,C=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,d=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function o(s){return s===" "||s===`
|
|
4
|
-
`||s==="\r"||s===" "}function n(s){return s==='"'||s==="'"}function h(s){return s===">"||o(s)}function L(s,e){return s.test(e)}function I(s,e){return!L(s,e)}var a=0;t.STATE={BEGIN:a++,BEGIN_WHITESPACE:a++,TEXT:a++,TEXT_ENTITY:a++,OPEN_WAKA:a++,SGML_DECL:a++,SGML_DECL_QUOTED:a++,DOCTYPE:a++,DOCTYPE_QUOTED:a++,DOCTYPE_DTD:a++,DOCTYPE_DTD_QUOTED:a++,COMMENT_STARTING:a++,COMMENT:a++,COMMENT_ENDING:a++,COMMENT_ENDED:a++,CDATA:a++,CDATA_ENDING:a++,CDATA_ENDING_2:a++,PROC_INST:a++,PROC_INST_BODY:a++,PROC_INST_ENDING:a++,OPEN_TAG:a++,OPEN_TAG_SLASH:a++,ATTRIB:a++,ATTRIB_NAME:a++,ATTRIB_NAME_SAW_WHITE:a++,ATTRIB_VALUE:a++,ATTRIB_VALUE_QUOTED:a++,ATTRIB_VALUE_CLOSED:a++,ATTRIB_VALUE_UNQUOTED:a++,ATTRIB_VALUE_ENTITY_Q:a++,ATTRIB_VALUE_ENTITY_U:a++,CLOSE_TAG:a++,CLOSE_TAG_SAW_WHITE:a++,SCRIPT:a++,SCRIPT_ENDING:a++},t.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},t.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(t.ENTITIES).forEach(function(s){var e=t.ENTITIES[s],_=typeof e=="number"?String.fromCharCode(e):e;t.ENTITIES[s]=_});for(var w in t.STATE)t.STATE[t.STATE[w]]=w;a=t.STATE;function v(s,e,_){s[e]&&s[e](_)}function P(s){var e=s&&s.match(/(?:^|\s)encoding\s*=\s*(['"])([^'"]+)\1/i);return e?e[2]:null}function x(s){return s?s.toLowerCase().replace(/[^a-z0-9]/g,""):null}function X(s,e){let _=x(s),b=x(e);return!_||!b?!0:b==="utf16"?_==="utf16le"||_==="utf16be":_===b}function q(s,e){if(!(!s.strict||!s.encoding||!e||e.name!=="xml")){var _=P(e.body);_&&!X(s.encoding,_)&&B(s,"XML declaration encoding "+_+" does not match detected stream encoding "+s.encoding.toUpperCase())}}function S(s,e,_){s.textNode&&V(s),v(s,e,_)}function V(s){s.textNode=R(s.opt,s.textNode),s.textNode&&v(s,"ontext",s.textNode),s.textNode=""}function R(s,e){return s.trim&&(e=e.trim()),s.normalize&&(e=e.replace(/\s+/g," ")),e}function J(s,e){return V(s),s.trackPosition&&(e+=`
|
|
5
|
-
Line: `+s.line+`
|
|
6
|
-
Column: `+s.column+`
|
|
7
|
-
Char: `+s.c),e=new Error(e),s.error=e,v(s,"onerror",e),s}function ht(s){return s.sawRoot&&!s.closedRoot&&B(s,"Unclosed root tag"),s.state!==a.BEGIN&&s.state!==a.BEGIN_WHITESPACE&&s.state!==a.TEXT&&J(s,"Unexpected end"),V(s),s.c="",s.closed=!0,v(s,"onend"),c.call(s,s.strict,s.opt),s}function B(s,e){if(typeof s!="object"||!(s instanceof c))throw new Error("bad call to strictFail");s.strict&&J(s,e)}function Zr(s){s.strict||(s.tagName=s.tagName[s.looseCase]());var e=s.tags[s.tags.length-1]||s,_=s.tag={name:s.tagName,attributes:{}};s.opt.xmlns&&(_.ns=e.ns),s.attribList.length=0,S(s,"onopentagstart",_)}function Ft(s,e){var _=s.indexOf(":"),b=_<0?["",s]:s.split(":"),j=b[0],W=b[1];return e&&s==="xmlns"&&(j="xmlns",W=""),{prefix:j,local:W}}function Xt(s){if(s.strict||(s.attribName=s.attribName[s.looseCase]()),s.attribList.indexOf(s.attribName)!==-1||s.tag.attributes.hasOwnProperty(s.attribName)){s.attribName=s.attribValue="";return}if(s.opt.xmlns){var e=Ft(s.attribName,!0),_=e.prefix,b=e.local;if(_==="xmlns")if(b==="xml"&&s.attribValue!==p)B(s,"xml: prefix must be bound to "+p+`
|
|
8
|
-
Actual: `+s.attribValue);else if(b==="xmlns"&&s.attribValue!==T)B(s,"xmlns: prefix must be bound to "+T+`
|
|
9
|
-
Actual: `+s.attribValue);else{var j=s.tag,W=s.tags[s.tags.length-1]||s;j.ns===W.ns&&(j.ns=Object.create(W.ns)),j.ns[b]=s.attribValue}s.attribList.push([s.attribName,s.attribValue])}else s.tag.attributes[s.attribName]=s.attribValue,S(s,"onattribute",{name:s.attribName,value:s.attribValue});s.attribName=s.attribValue=""}function at(s,e){if(s.opt.xmlns){var _=s.tag,b=Ft(s.tagName);_.prefix=b.prefix,_.local=b.local,_.uri=_.ns[b.prefix]||"",_.prefix&&!_.uri&&(B(s,"Unbound namespace prefix: "+JSON.stringify(s.tagName)),_.uri=b.prefix);var j=s.tags[s.tags.length-1]||s;_.ns&&j.ns!==_.ns&&Object.keys(_.ns).forEach(function(ne){S(s,"onopennamespace",{prefix:ne,uri:_.ns[ne]})});for(var W=0,G=s.attribList.length;W<G;W++){var z=s.attribList[W],H=z[0],et=z[1],Y=Ft(H,!0),rt=Y.prefix,en=Y.local,re=rt===""?"":_.ns[rt]||"",jt={name:H,value:et,prefix:rt,local:en,uri:re};rt&&rt!=="xmlns"&&!re&&(B(s,"Unbound namespace prefix: "+JSON.stringify(rt)),jt.uri=rt),s.tag.attributes[H]=jt,S(s,"onattribute",jt)}s.attribList.length=0}s.tag.isSelfClosing=!!e,s.sawRoot=!0,s.tags.push(s.tag),S(s,"onopentag",s.tag),e||(!s.noscript&&s.tagName.toLowerCase()==="script"?s.state=a.SCRIPT:s.state=a.TEXT,s.tag=null,s.tagName=""),s.attribName=s.attribValue="",s.attribList.length=0}function qt(s){if(!s.tagName){B(s,"Weird empty close tag."),s.textNode+="</>",s.state=a.TEXT;return}if(s.script){if(s.tagName!=="script"){s.script+="</"+s.tagName+">",s.tagName="",s.state=a.SCRIPT;return}S(s,"onscript",s.script),s.script=""}var e=s.tags.length,_=s.tagName;s.strict||(_=_[s.looseCase]());for(var b=_;e--;){var j=s.tags[e];if(j.name!==b)B(s,"Unexpected close tag");else break}if(e<0){B(s,"Unmatched closing tag: "+s.tagName),s.textNode+="</"+s.tagName+">",s.state=a.TEXT;return}s.tagName=_;for(var W=s.tags.length;W-- >e;){var G=s.tag=s.tags.pop();s.tagName=s.tag.name,S(s,"onclosetag",s.tagName);var z={};for(var H in G.ns)z[H]=G.ns[H];var et=s.tags[s.tags.length-1]||s;s.opt.xmlns&&G.ns!==et.ns&&Object.keys(G.ns).forEach(function(Y){var rt=G.ns[Y];S(s,"onclosenamespace",{prefix:Y,uri:rt})})}e===0&&(s.closedRoot=!0),s.tagName=s.attribValue=s.attribName="",s.attribList.length=0,s.state=a.TEXT}function Jr(s){var e=s.entity,_=e.toLowerCase(),b,j="";return s.ENTITIES[e]?s.ENTITIES[e]:s.ENTITIES[_]?s.ENTITIES[_]:(e=_,e.charAt(0)==="#"&&(e.charAt(1)==="x"?(e=e.slice(2),b=parseInt(e,16),j=b.toString(16)):(e=e.slice(1),b=parseInt(e,10),j=b.toString(10))),e=e.replace(/^0+/,""),isNaN(b)||j.toLowerCase()!==e||b<0||b>1114111?(B(s,"Invalid character entity"),"&"+s.entity+";"):String.fromCodePoint(b))}function ee(s,e){e==="<"?(s.state=a.OPEN_WAKA,s.startTagPosition=s.position):o(e)||(B(s,"Non-whitespace before first tag."),s.textNode=e,s.state=a.TEXT)}function Rt(s,e){var _="";return e<s.length&&(_=s.charAt(e)),_}function tn(s){var e=this;if(this.error)throw this.error;if(e.closed)return J(e,"Cannot write after close. Assign an onready handler.");if(s===null)return ht(e);typeof s=="object"&&(s=s.toString());for(var _=0,b="";b=Rt(s,_++),e.c=b,!!b;)switch(e.trackPosition&&(e.position++,b===`
|
|
10
|
-
`?(e.line++,e.column=0):e.column++),e.state){case a.BEGIN:if(e.state=a.BEGIN_WHITESPACE,b==="\uFEFF")continue;ee(e,b);continue;case a.BEGIN_WHITESPACE:ee(e,b);continue;case a.TEXT:if(e.sawRoot&&!e.closedRoot){for(var W=_-1;b&&b!=="<"&&b!=="&";)b=Rt(s,_++),b&&e.trackPosition&&(e.position++,b===`
|
|
11
|
-
`?(e.line++,e.column=0):e.column++);e.textNode+=s.substring(W,_-1)}b==="<"&&!(e.sawRoot&&e.closedRoot&&!e.strict)?(e.state=a.OPEN_WAKA,e.startTagPosition=e.position):(!o(b)&&(!e.sawRoot||e.closedRoot)&&B(e,"Text data outside of root node."),b==="&"?e.state=a.TEXT_ENTITY:e.textNode+=b);continue;case a.SCRIPT:b==="<"?e.state=a.SCRIPT_ENDING:e.script+=b;continue;case a.SCRIPT_ENDING:b==="/"?e.state=a.CLOSE_TAG:(e.script+="<"+b,e.state=a.SCRIPT);continue;case a.OPEN_WAKA:if(b==="!")e.state=a.SGML_DECL,e.sgmlDecl="";else if(!o(b))if(L(A,b))e.state=a.OPEN_TAG,e.tagName=b;else if(b==="/")e.state=a.CLOSE_TAG,e.tagName="";else if(b==="?")e.state=a.PROC_INST,e.procInstName=e.procInstBody="";else{if(B(e,"Unencoded <"),e.startTagPosition+1<e.position){var j=e.position-e.startTagPosition;b=new Array(j).join(" ")+b}e.textNode+="<"+b,e.state=a.TEXT}continue;case a.SGML_DECL:if(e.sgmlDecl+b==="--"){e.state=a.COMMENT,e.comment="",e.sgmlDecl="";continue}e.doctype&&e.doctype!==!0&&e.sgmlDecl?(e.state=a.DOCTYPE_DTD,e.doctype+="<!"+e.sgmlDecl+b,e.sgmlDecl=""):(e.sgmlDecl+b).toUpperCase()===O?(S(e,"onopencdata"),e.state=a.CDATA,e.sgmlDecl="",e.cdata=""):(e.sgmlDecl+b).toUpperCase()===D?(e.state=a.DOCTYPE,(e.doctype||e.sawRoot)&&B(e,"Inappropriately located doctype declaration"),e.doctype="",e.sgmlDecl=""):b===">"?(S(e,"onsgmldeclaration",e.sgmlDecl),e.sgmlDecl="",e.state=a.TEXT):(n(b)&&(e.state=a.SGML_DECL_QUOTED),e.sgmlDecl+=b);continue;case a.SGML_DECL_QUOTED:b===e.q&&(e.state=a.SGML_DECL,e.q=""),e.sgmlDecl+=b;continue;case a.DOCTYPE:b===">"?(e.state=a.TEXT,S(e,"ondoctype",e.doctype),e.doctype=!0):(e.doctype+=b,b==="["?e.state=a.DOCTYPE_DTD:n(b)&&(e.state=a.DOCTYPE_QUOTED,e.q=b));continue;case a.DOCTYPE_QUOTED:e.doctype+=b,b===e.q&&(e.q="",e.state=a.DOCTYPE);continue;case a.DOCTYPE_DTD:b==="]"?(e.doctype+=b,e.state=a.DOCTYPE):b==="<"?(e.state=a.OPEN_WAKA,e.startTagPosition=e.position):n(b)?(e.doctype+=b,e.state=a.DOCTYPE_DTD_QUOTED,e.q=b):e.doctype+=b;continue;case a.DOCTYPE_DTD_QUOTED:e.doctype+=b,b===e.q&&(e.state=a.DOCTYPE_DTD,e.q="");continue;case a.COMMENT:b==="-"?e.state=a.COMMENT_ENDING:e.comment+=b;continue;case a.COMMENT_ENDING:b==="-"?(e.state=a.COMMENT_ENDED,e.comment=R(e.opt,e.comment),e.comment&&S(e,"oncomment",e.comment),e.comment=""):(e.comment+="-"+b,e.state=a.COMMENT);continue;case a.COMMENT_ENDED:b!==">"?(B(e,"Malformed comment"),e.comment+="--"+b,e.state=a.COMMENT):e.doctype&&e.doctype!==!0?e.state=a.DOCTYPE_DTD:e.state=a.TEXT;continue;case a.CDATA:for(var W=_-1;b&&b!=="]";)b=Rt(s,_++),b&&e.trackPosition&&(e.position++,b===`
|
|
12
|
-
`?(e.line++,e.column=0):e.column++);e.cdata+=s.substring(W,_-1),b==="]"&&(e.state=a.CDATA_ENDING);continue;case a.CDATA_ENDING:b==="]"?e.state=a.CDATA_ENDING_2:(e.cdata+="]"+b,e.state=a.CDATA);continue;case a.CDATA_ENDING_2:b===">"?(e.cdata&&S(e,"oncdata",e.cdata),S(e,"onclosecdata"),e.cdata="",e.state=a.TEXT):b==="]"?e.cdata+="]":(e.cdata+="]]"+b,e.state=a.CDATA);continue;case a.PROC_INST:b==="?"?e.state=a.PROC_INST_ENDING:o(b)?e.state=a.PROC_INST_BODY:e.procInstName+=b;continue;case a.PROC_INST_BODY:if(!e.procInstBody&&o(b))continue;b==="?"?e.state=a.PROC_INST_ENDING:e.procInstBody+=b;continue;case a.PROC_INST_ENDING:if(b===">"){let et={name:e.procInstName,body:e.procInstBody};q(e,et),S(e,"onprocessinginstruction",et),e.procInstName=e.procInstBody="",e.state=a.TEXT}else e.procInstBody+="?"+b,e.state=a.PROC_INST_BODY;continue;case a.OPEN_TAG:L(M,b)?e.tagName+=b:(Zr(e),b===">"?at(e):b==="/"?e.state=a.OPEN_TAG_SLASH:(o(b)||B(e,"Invalid character in tag name"),e.state=a.ATTRIB));continue;case a.OPEN_TAG_SLASH:b===">"?(at(e,!0),qt(e)):(B(e,"Forward-slash in opening tag not followed by >"),e.state=a.ATTRIB);continue;case a.ATTRIB:if(o(b))continue;b===">"?at(e):b==="/"?e.state=a.OPEN_TAG_SLASH:L(A,b)?(e.attribName=b,e.attribValue="",e.state=a.ATTRIB_NAME):B(e,"Invalid attribute name");continue;case a.ATTRIB_NAME:b==="="?e.state=a.ATTRIB_VALUE:b===">"?(B(e,"Attribute without value"),e.attribValue=e.attribName,Xt(e),at(e)):o(b)?e.state=a.ATTRIB_NAME_SAW_WHITE:L(M,b)?e.attribName+=b:B(e,"Invalid attribute name");continue;case a.ATTRIB_NAME_SAW_WHITE:if(b==="=")e.state=a.ATTRIB_VALUE;else{if(o(b))continue;B(e,"Attribute without value"),e.tag.attributes[e.attribName]="",e.attribValue="",S(e,"onattribute",{name:e.attribName,value:""}),e.attribName="",b===">"?at(e):L(A,b)?(e.attribName=b,e.state=a.ATTRIB_NAME):(B(e,"Invalid attribute name"),e.state=a.ATTRIB)}continue;case a.ATTRIB_VALUE:if(o(b))continue;n(b)?(e.q=b,e.state=a.ATTRIB_VALUE_QUOTED):(e.opt.unquotedAttributeValues||J(e,"Unquoted attribute value"),e.state=a.ATTRIB_VALUE_UNQUOTED,e.attribValue=b);continue;case a.ATTRIB_VALUE_QUOTED:if(b!==e.q){b==="&"?e.state=a.ATTRIB_VALUE_ENTITY_Q:e.attribValue+=b;continue}Xt(e),e.q="",e.state=a.ATTRIB_VALUE_CLOSED;continue;case a.ATTRIB_VALUE_CLOSED:o(b)?e.state=a.ATTRIB:b===">"?at(e):b==="/"?e.state=a.OPEN_TAG_SLASH:L(A,b)?(B(e,"No whitespace between attributes"),e.attribName=b,e.attribValue="",e.state=a.ATTRIB_NAME):B(e,"Invalid attribute name");continue;case a.ATTRIB_VALUE_UNQUOTED:if(!h(b)){b==="&"?e.state=a.ATTRIB_VALUE_ENTITY_U:e.attribValue+=b;continue}Xt(e),b===">"?at(e):e.state=a.ATTRIB;continue;case a.CLOSE_TAG:if(e.tagName)b===">"?qt(e):L(M,b)?e.tagName+=b:e.script?(e.script+="</"+e.tagName+b,e.tagName="",e.state=a.SCRIPT):(o(b)||B(e,"Invalid tagname in closing tag"),e.state=a.CLOSE_TAG_SAW_WHITE);else{if(o(b))continue;I(A,b)?e.script?(e.script+="</"+b,e.state=a.SCRIPT):B(e,"Invalid tagname in closing tag."):e.tagName=b}continue;case a.CLOSE_TAG_SAW_WHITE:if(o(b))continue;b===">"?qt(e):B(e,"Invalid characters in closing tag");continue;case a.TEXT_ENTITY:case a.ATTRIB_VALUE_ENTITY_Q:case a.ATTRIB_VALUE_ENTITY_U:var G,z;switch(e.state){case a.TEXT_ENTITY:G=a.TEXT,z="textNode";break;case a.ATTRIB_VALUE_ENTITY_Q:G=a.ATTRIB_VALUE_QUOTED,z="attribValue";break;case a.ATTRIB_VALUE_ENTITY_U:G=a.ATTRIB_VALUE_UNQUOTED,z="attribValue";break}if(b===";"){var H=Jr(e);e.opt.unparsedEntities&&!Object.values(t.XML_ENTITIES).includes(H)?((e.entityCount+=1)>e.opt.maxEntityCount&&J(e,"Parsed entity count exceeds max entity count"),(e.entityDepth+=1)>e.opt.maxEntityDepth&&J(e,"Parsed entity depth exceeds max entity depth"),e.entity="",e.state=G,e.write(H),e.entityDepth-=1):(e[z]+=H,e.entity="",e.state=G)}else L(e.entity.length?d:C,b)?e.entity+=b:(B(e,"Invalid character in entity name"),e[z]+="&"+e.entity+b,e.entity="",e.state=G);continue;default:throw new Error(e,"Unknown state: "+e.state)}return e.position>=e.bufferCheckPosition&&y(e),e}String.fromCodePoint||(function(){var s=String.fromCharCode,e=Math.floor,_=function(){var b=16384,j=[],W,G,z=-1,H=arguments.length;if(!H)return"";for(var et="";++z<H;){var Y=Number(arguments[z]);if(!isFinite(Y)||Y<0||Y>1114111||e(Y)!==Y)throw RangeError("Invalid code point: "+Y);Y<=65535?j.push(Y):(Y-=65536,W=(Y>>10)+55296,G=Y%1024+56320,j.push(W,G)),(z+1===H||j.length>b)&&(et+=s.apply(null,j),j.length=0)}return et};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:_,configurable:!0,writable:!0}):String.fromCodePoint=_})()})(typeof Pt>"u"?Pt.sax={}:Pt)});var jr=F((xn,Ht)=>{"use strict";var pt=typeof Reflect=="object"?Reflect:null,vr=pt&&typeof pt.apply=="function"?pt.apply:function(r,c,y){return Function.prototype.apply.call(r,c,y)},xt;pt&&typeof pt.ownKeys=="function"?xt=pt.ownKeys:Object.getOwnPropertySymbols?xt=function(r){return Object.getOwnPropertyNames(r).concat(Object.getOwnPropertySymbols(r))}:xt=function(r){return Object.getOwnPropertyNames(r)};function fn(t){console&&console.warn&&console.warn(t)}var Ar=Number.isNaN||function(r){return r!==r};function U(){U.init.call(this)}Ht.exports=U;Ht.exports.once=mn;U.EventEmitter=U;U.prototype._events=void 0;U.prototype._eventsCount=0;U.prototype._maxListeners=void 0;var Mr=10;function St(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(U,"defaultMaxListeners",{enumerable:!0,get:function(){return Mr},set:function(t){if(typeof t!="number"||t<0||Ar(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Mr=t}});U.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};U.prototype.setMaxListeners=function(r){if(typeof r!="number"||r<0||Ar(r))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+r+".");return this._maxListeners=r,this};function Pr(t){return t._maxListeners===void 0?U.defaultMaxListeners:t._maxListeners}U.prototype.getMaxListeners=function(){return Pr(this)};U.prototype.emit=function(r){for(var c=[],y=1;y<arguments.length;y++)c.push(arguments[y]);var i=r==="error",f=this._events;if(f!==void 0)i=i&&f.error===void 0;else if(!i)return!1;if(i){var u;if(c.length>0&&(u=c[0]),u instanceof Error)throw u;var l=new Error("Unhandled error."+(u?" ("+u.message+")":""));throw l.context=u,l}var m=f[r];if(m===void 0)return!1;if(typeof m=="function")vr(m,this,c);else for(var g=m.length,N=qr(m,g),y=0;y<g;++y)vr(N[y],this,c);return!0};function xr(t,r,c,y){var i,f,u;if(St(c),f=t._events,f===void 0?(f=t._events=Object.create(null),t._eventsCount=0):(f.newListener!==void 0&&(t.emit("newListener",r,c.listener?c.listener:c),f=t._events),u=f[r]),u===void 0)u=f[r]=c,++t._eventsCount;else if(typeof u=="function"?u=f[r]=y?[c,u]:[u,c]:y?u.unshift(c):u.push(c),i=Pr(t),i>0&&u.length>i&&!u.warned){u.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+u.length+" "+String(r)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=r,l.count=u.length,fn(l)}return t}U.prototype.addListener=function(r,c){return xr(this,r,c,!1)};U.prototype.on=U.prototype.addListener;U.prototype.prependListener=function(r,c){return xr(this,r,c,!0)};function hn(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Sr(t,r,c){var y={fired:!1,wrapFn:void 0,target:t,type:r,listener:c},i=hn.bind(y);return i.listener=c,y.wrapFn=i,i}U.prototype.once=function(r,c){return St(c),this.on(r,Sr(this,r,c)),this};U.prototype.prependOnceListener=function(r,c){return St(c),this.prependListener(r,Sr(this,r,c)),this};U.prototype.removeListener=function(r,c){var y,i,f,u,l;if(St(c),i=this._events,i===void 0)return this;if(y=i[r],y===void 0)return this;if(y===c||y.listener===c)--this._eventsCount===0?this._events=Object.create(null):(delete i[r],i.removeListener&&this.emit("removeListener",r,y.listener||c));else if(typeof y!="function"){for(f=-1,u=y.length-1;u>=0;u--)if(y[u]===c||y[u].listener===c){l=y[u].listener,f=u;break}if(f<0)return this;f===0?y.shift():pn(y,f),y.length===1&&(i[r]=y[0]),i.removeListener!==void 0&&this.emit("removeListener",r,l||c)}return this};U.prototype.off=U.prototype.removeListener;U.prototype.removeAllListeners=function(r){var c,y,i;if(y=this._events,y===void 0)return this;if(y.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):y[r]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete y[r]),this;if(arguments.length===0){var f=Object.keys(y),u;for(i=0;i<f.length;++i)u=f[i],u!=="removeListener"&&this.removeAllListeners(u);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(c=y[r],typeof c=="function")this.removeListener(r,c);else if(c!==void 0)for(i=c.length-1;i>=0;i--)this.removeListener(r,c[i]);return this};function Fr(t,r,c){var y=t._events;if(y===void 0)return[];var i=y[r];return i===void 0?[]:typeof i=="function"?c?[i.listener||i]:[i]:c?dn(i):qr(i,i.length)}U.prototype.listeners=function(r){return Fr(this,r,!0)};U.prototype.rawListeners=function(r){return Fr(this,r,!1)};U.listenerCount=function(t,r){return typeof t.listenerCount=="function"?t.listenerCount(r):Xr.call(t,r)};U.prototype.listenerCount=Xr;function Xr(t){var r=this._events;if(r!==void 0){var c=r[t];if(typeof c=="function")return 1;if(c!==void 0)return c.length}return 0}U.prototype.eventNames=function(){return this._eventsCount>0?xt(this._events):[]};function qr(t,r){for(var c=new Array(r),y=0;y<r;++y)c[y]=t[y];return c}function pn(t,r){for(;r+1<t.length;r++)t[r]=t[r+1];t.pop()}function dn(t){for(var r=new Array(t.length),c=0;c<r.length;++c)r[c]=t[c].listener||t[c];return r}function mn(t,r){return new Promise(function(c,y){function i(u){t.removeListener(r,f),y(u)}function f(){typeof t.removeListener=="function"&&t.removeListener("error",i),c([].slice.call(arguments))}Rr(t,r,f,{once:!0}),r!=="error"&&yn(t,i,{once:!0})})}function yn(t,r,c){typeof t.on=="function"&&Rr(t,"error",r,c)}function Rr(t,r,c,y){if(typeof t.on=="function")y.once?t.once(r,c):t.on(r,c);else if(typeof t.addEventListener=="function")t.addEventListener(r,function i(f){y.once&&t.removeEventListener(r,i),c(f)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}});var Br=F($t=>{(function(){"use strict";$t.stripBOM=function(t){return t[0]==="\uFEFF"?t.substring(1):t}}).call($t)});var Qt=F(ct=>{(function(){"use strict";var t;t=new RegExp(/(?!xmlns)^.*:/),ct.normalize=function(r){return r.toLowerCase()},ct.firstCharLowerCase=function(r){return r.charAt(0).toLowerCase()+r.slice(1)},ct.stripPrefix=function(r){return r.replace(t,"")},ct.parseNumbers=function(r){return isNaN(r)||(r=r%1===0?parseInt(r,10):parseFloat(r)),r},ct.parseBooleans=function(r){return/^(?:true|false)$/i.test(r)&&(r=r.toLowerCase()==="true"),r}}).call(ct)});var Vr=F(Ur=>{Ur.every=function(t){return new Zt(t)};var nt={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5};for(lt in nt)lt==="millisecond"?nt.ms=nt[lt]:nt[lt.charAt(0)]=nt[lt],nt[lt+"s"]=nt[lt];var lt;function Zt(t){this.count=0;var r=wn(t);r&&(this.time=Number(r[0])*nt[r[1]],this.type=r[1])}Zt.prototype.do=function(t){this.time&&(this.interval=setInterval(c,this.time));var r=this;function c(){r.count++,t.call(r)}return this};Zt.prototype.stop=function(){return this.interval&&(clearInterval(this.interval),delete this.interval),this};var gn=/^\s*(\d+(?:\.\d+)?)\s*([a-z]+)\s*$/;function wn(t){var r=t.match(gn);return r&&nt[r[2]]?r.slice(1):null}});var Wr=F(it=>{(function(){"use strict";var t,r,c,y,i,f,u,l,m,g=function(D,p){return function(){return D.apply(p,arguments)}},N=function(D,p){for(var T in p)O.call(p,T)&&(D[T]=p[T]);function E(){this.constructor=D}return E.prototype=p.prototype,D.prototype=new E,D.__super__=p.prototype,D},O={}.hasOwnProperty;l=_r(),y=jr(),t=Br(),u=Qt(),m=Vr().setImmediate,r=gt().defaults,i=function(D){return typeof D=="object"&&D!=null&&Object.keys(D).length===0},f=function(D,p,T){var E,A,M;for(E=0,A=D.length;E<A;E++)M=D[E],p=M(p,T);return p},c=function(D,p,T){var E;return E=Object.create(null),E.value=T,E.writable=!0,E.enumerable=!0,E.configurable=!0,Object.defineProperty(D,p,E)},it.Parser=(function(D){N(p,D);function p(T){this.parseStringPromise=g(this.parseStringPromise,this),this.parseString=g(this.parseString,this),this.reset=g(this.reset,this),this.assignOrPush=g(this.assignOrPush,this),this.processAsync=g(this.processAsync,this);var E,A,M;if(!(this instanceof it.Parser))return new it.Parser(T);this.options={},A=r["0.2"];for(E in A)O.call(A,E)&&(M=A[E],this.options[E]=M);for(E in T)O.call(T,E)&&(M=T[E],this.options[E]=M);this.options.xmlns&&(this.options.xmlnskey=this.options.attrkey+"ns"),this.options.normalizeTags&&(this.options.tagNameProcessors||(this.options.tagNameProcessors=[]),this.options.tagNameProcessors.unshift(u.normalize)),this.reset()}return p.prototype.processAsync=function(){var T,E;try{return this.remaining.length<=this.options.chunkSize?(T=this.remaining,this.remaining="",this.saxParser=this.saxParser.write(T),this.saxParser.close()):(T=this.remaining.substr(0,this.options.chunkSize),this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length),this.saxParser=this.saxParser.write(T),m(this.processAsync))}catch(A){if(E=A,!this.saxParser.errThrown)return this.saxParser.errThrown=!0,this.emit(E)}},p.prototype.assignOrPush=function(T,E,A){return E in T?(T[E]instanceof Array||c(T,E,[T[E]]),T[E].push(A)):this.options.explicitArray?c(T,E,[A]):c(T,E,A)},p.prototype.reset=function(){var T,E,A,M;return this.removeAllListeners(),this.saxParser=l.parser(this.options.strict,{trim:!1,normalize:!1,xmlns:this.options.xmlns}),this.saxParser.errThrown=!1,this.saxParser.onerror=(function(C){return function(d){if(C.saxParser.resume(),!C.saxParser.errThrown)return C.saxParser.errThrown=!0,C.emit("error",d)}})(this),this.saxParser.onend=(function(C){return function(){if(!C.saxParser.ended)return C.saxParser.ended=!0,C.emit("end",C.resultObject)}})(this),this.saxParser.ended=!1,this.EXPLICIT_CHARKEY=this.options.explicitCharkey,this.resultObject=null,M=[],T=this.options.attrkey,E=this.options.charkey,this.saxParser.onopentag=(function(C){return function(d){var o,n,h,L,I;if(h={},h[E]="",!C.options.ignoreAttrs){I=d.attributes;for(o in I)O.call(I,o)&&(!(T in h)&&!C.options.mergeAttrs&&(h[T]={}),n=C.options.attrValueProcessors?f(C.options.attrValueProcessors,d.attributes[o],o):d.attributes[o],L=C.options.attrNameProcessors?f(C.options.attrNameProcessors,o):o,C.options.mergeAttrs?C.assignOrPush(h,L,n):c(h[T],L,n))}return h["#name"]=C.options.tagNameProcessors?f(C.options.tagNameProcessors,d.name):d.name,C.options.xmlns&&(h[C.options.xmlnskey]={uri:d.uri,local:d.local}),M.push(h)}})(this),this.saxParser.onclosetag=(function(C){return function(){var d,o,n,h,L,I,a,w,v,P;if(I=M.pop(),L=I["#name"],(!C.options.explicitChildren||!C.options.preserveChildrenOrder)&&delete I["#name"],I.cdata===!0&&(d=I.cdata,delete I.cdata),v=M[M.length-1],I[E].match(/^\s*$/)&&!d?(o=I[E],delete I[E]):(C.options.trim&&(I[E]=I[E].trim()),C.options.normalize&&(I[E]=I[E].replace(/\s{2,}/g," ").trim()),I[E]=C.options.valueProcessors?f(C.options.valueProcessors,I[E],L):I[E],Object.keys(I).length===1&&E in I&&!C.EXPLICIT_CHARKEY&&(I=I[E])),i(I)&&(typeof C.options.emptyTag=="function"?I=C.options.emptyTag():I=C.options.emptyTag!==""?C.options.emptyTag:o),C.options.validator!=null&&(P="/"+(function(){var x,X,q;for(q=[],x=0,X=M.length;x<X;x++)h=M[x],q.push(h["#name"]);return q})().concat(L).join("/"),(function(){var x;try{return I=C.options.validator(P,v&&v[L],I)}catch(X){return x=X,C.emit("error",x)}})()),C.options.explicitChildren&&!C.options.mergeAttrs&&typeof I=="object"){if(!C.options.preserveChildrenOrder)h={},C.options.attrkey in I&&(h[C.options.attrkey]=I[C.options.attrkey],delete I[C.options.attrkey]),!C.options.charsAsChildren&&C.options.charkey in I&&(h[C.options.charkey]=I[C.options.charkey],delete I[C.options.charkey]),Object.getOwnPropertyNames(I).length>0&&(h[C.options.childkey]=I),I=h;else if(v){v[C.options.childkey]=v[C.options.childkey]||[],a={};for(n in I)O.call(I,n)&&c(a,n,I[n]);v[C.options.childkey].push(a),delete I["#name"],Object.keys(I).length===1&&E in I&&!C.EXPLICIT_CHARKEY&&(I=I[E])}}return M.length>0?C.assignOrPush(v,L,I):(C.options.explicitRoot&&(w=I,I={},c(I,L,w)),C.resultObject=I,C.saxParser.ended=!0,C.emit("end",C.resultObject))}})(this),A=(function(C){return function(d){var o,n;if(n=M[M.length-1],n)return n[E]+=d,C.options.explicitChildren&&C.options.preserveChildrenOrder&&C.options.charsAsChildren&&(C.options.includeWhiteChars||d.replace(/\\n/g,"").trim()!=="")&&(n[C.options.childkey]=n[C.options.childkey]||[],o={"#name":"__text__"},o[E]=d,C.options.normalize&&(o[E]=o[E].replace(/\s{2,}/g," ").trim()),n[C.options.childkey].push(o)),n}})(this),this.saxParser.ontext=A,this.saxParser.oncdata=(function(C){return function(d){var o;if(o=A(d),o)return o.cdata=!0}})(this)},p.prototype.parseString=function(T,E){var A;E!=null&&typeof E=="function"&&(this.on("end",function(M){return this.reset(),E(null,M)}),this.on("error",function(M){return this.reset(),E(M)}));try{return T=T.toString(),T.trim()===""?(this.emit("end",null),!0):(T=t.stripBOM(T),this.options.async?(this.remaining=T,m(this.processAsync),this.saxParser):this.saxParser.write(T).close())}catch(M){if(A=M,this.saxParser.errThrown||this.saxParser.ended){if(this.saxParser.ended)throw A}else return this.emit("error",A),this.saxParser.errThrown=!0}},p.prototype.parseStringPromise=function(T){return new Promise((function(E){return function(A,M){return E.parseString(T,function(C,d){return C?M(C):A(d)})}})(this))},p})(y),it.parseString=function(D,p,T){var E,A,M;return T!=null?(typeof T=="function"&&(E=T),typeof p=="object"&&(A=p)):(typeof p=="function"&&(E=p),A={}),M=new it.Parser(A),M.parseString(D,E)},it.parseStringPromise=function(D,p){var T,E;return typeof p=="object"&&(T=p),E=new it.Parser(T),E.parseStringPromise(D)}}).call(it)});var kr=F(ot=>{(function(){"use strict";var t,r,c,y,i=function(u,l){for(var m in l)f.call(l,m)&&(u[m]=l[m]);function g(){this.constructor=u}return g.prototype=l.prototype,u.prototype=new g,u.__super__=l.prototype,u},f={}.hasOwnProperty;r=gt(),t=Nr(),c=Wr(),y=Qt(),ot.defaults=r.defaults,ot.processors=y,ot.ValidationError=(function(u){i(l,u);function l(m){this.message=m}return l})(Error),ot.Builder=t.Builder,ot.Parser=c.Parser,ot.parseString=c.parseString,ot.parseStringPromise=c.parseStringPromise}).call(ot)});var te=cn(kr()),$r=8e3;self.onmessage=async t=>{let{sourceType:r}=t.data;try{let c;if(r==="wms"){let{url:y,options:i}=t.data;c=await Tn(y,i)}else if(r==="wmts"){let{url:y,options:i}=t.data;c=await bn(y,i)}else c=null;self.postMessage(c)}catch{self.postMessage(null)}};var Tn=async(t,r)=>{let c=t+"?request=getcapabilities&service=wms",y=new AbortController,i=setTimeout(()=>y.abort(),$r);try{let f=await fetch(c,{signal:y.signal});if(!f.ok)throw new Error(`(${f.status}) Error fetching capabilities.. ${f.statusText}`);let u=await f.text();return await Dn(u,c,r)}finally{clearTimeout(i)}},Dn=async(t,r,c)=>{let y=0,i=(g,N,O=null,D=0)=>{if(y>=c.maxNodes||D>c.maxDepth)return;y+=1;let p={name:g.Name?Q(g.Name[0]):"",description:g.Abstract?Q(g.Abstract[0]):"",selected:!1,parent:O,time:null};if(g.Title&&(p.title=Q(g.Title[0])),Array.isArray(g.Dimension)){for(let T of g.Dimension)if(T.$?.name.toLowerCase()==="time"&&T.$?.units==="ISO8601"){p.time=Object.assign({current:T.$?.default??null},Qr(T._,T.$?.default));break}}g.Layer&&(p.children=[],g.Layer.forEach(T=>i(T,p.children,p,D+1))),N.push(p)};if(t.indexOf("<Capability")===-1)throw new Error("Error: Invalid response received!");let f=await(0,te.parseStringPromise)(t);if(!f.WMS_Capabilities&&!f.WMT_MS_Capabilities)throw new Error("Error: No Capabilities found!");let u=f.WMS_Capabilities?f.WMS_Capabilities:f.WMT_MS_Capabilities?f.WMT_MS_Capabilities:void 0;if(!u?.Capability[0].Layer)throw new Error("Error: No layer information found!");let l={name:"",description:"",type:"WMS",url:r,layers:[]};if(Z(u?.Service)){let g=u?.Service[0];l.name=Z(g.Title)?Q(g.Title[0]):Z(g.Name)?Q(g.Name[0]):"WMS",l.description=Z(g.Abstract)?Q(g.Abstract[0]):""}let m=[];return u.Capability[0].Layer.forEach(g=>{i(g,m)}),m.sort((g,N)=>g.name<N.name?-1:1),l.layers=m,l},bn=async(t,r)=>{let c=t+"?request=GetCapabilities&service=wmts",y=new AbortController,i=setTimeout(()=>y.abort(),$r);try{let f=await fetch(c,{signal:y.signal});if(!f.ok)throw new Error(`(${f.status}) Error fetching capabilities.. ${f.statusText}`);let u=await f.text();return await En(u,c,r)}finally{clearTimeout(i)}},En=async(t,r,c)=>{let y=l=>{if(!Z(l["ows:Identifier"]))return null;let m={name:Z(l["ows:Title"])?Q(l["ows:Title"][0]):"",description:Z(l["ows:Abstract"])?Q(l["ows:Abstract"][0]):"",id:Q(l["ows:Identifier"][0]),format:"png"};if(Z(l["ows:WGS84BoundingBox"])&&(m.bounds=[Number(l["ows:WGS84BoundingBox"][0]["ows:LowerCorner"][0].split(" ")[0]),Number(l["ows:WGS84BoundingBox"][0]["ows:LowerCorner"][0].split(" ")[1]),Number(l["ows:WGS84BoundingBox"][0]["ows:UpperCorner"][0].split(" ")[0]),Number(l["ows:WGS84BoundingBox"][0]["ows:UpperCorner"][0].split(" ")[1])]),Z(l.Format)){let g=Q(l.Format[0]);m.format=g.indexOf("jpg")!==-1?"jpg":"png"}return Z(l.Dimension)&&l.Dimension.forEach(g=>{Q(g["ows:Identifier"][0]).toLowerCase()==="time"&&(m.time=Object.assign({current:ft(Q(g.Default[0]))??null},Qr(g.Value,Q(g.Default[0]))))}),m};if(t.indexOf("<Capabilities")===-1)throw new Error("Error: Invalid response received!");let i=await(0,te.parseStringPromise)(t);if(!Z(i.Capabilities?.Contents))throw new Error("Error: No Capabilities found!");if(!Z(i.Capabilities.Contents[0].Layer))throw new Error("Error: No layer information found!");let f={name:"",description:"",type:"WMTS",url:r,layers:[]},u=0;for(let l of i.Capabilities.Contents[0].Layer){if(u>=c.maxNodes)break;let m=y(l);m&&f.layers.push(m),u++}return f.layers.sort((l,m)=>l.name<m.name?-1:1),f},Z=t=>Array.isArray(t)&&t.length!==0,Q=t=>typeof t=="string"?t:t._??"",Jt=t=>{let r=/^P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+(?:\.\d+)?)S)?)?$/,c=t.match(r);return c?{years:parseInt(c[1]??"0"),months:parseInt(c[2]??"0"),weeks:parseInt(c[3]??"0"),days:parseInt(c[4]??"0"),hours:parseInt(c[5]??"0"),minutes:parseInt(c[6]??"0"),seconds:parseFloat(c[7]??"0")}:{years:0,months:0,weeks:0,days:0,hours:0,minutes:0,seconds:0}},Nn=t=>{let r=Jt(t);return r.weeks*(3600*1e3*24*7)+r.days*(3600*1e3*24)+r.hours*(3600*1e3)+r.minutes*(60*1e3)+r.seconds*1e3},Gr=(t,r,c)=>{let y={y:new Date(t).getFullYear(),m:new Date(t).getMonth(),d:new Date(t).getDate()},i={y:c?y.y+r.years:y.y-r.years,m:c?y.m+r.months:y.m-r.months,d:c?y.d+r.days:y.d-r.days};if(r.weeks){let l=r.weeks*7;i.d=c?i.d+l:i.d-l}let f=new Date(t);f.setFullYear(i.y,i.m,i.d);let u=r.hours*(1e3*3600)+r.minutes*(1e3*60)+r.seconds*1e3;return u=c?u:0-u,f.setTime(f.getTime()+u),f.toISOString()},Yr=t=>t.startsWith("P"),Kr=t=>!t.includes("-")&&!t.includes(":"),zr=t=>t.split("-").length===2&&!t.includes("T"),On=t=>t.split("-").length===3&&!t.includes("T"),In=t=>t.length===8&&!t.startsWith("P"),Ln=t=>t.includes("T")&&!t.includes(":"),Hr=t=>t.includes("/"),ft=t=>{try{return t.toLocaleLowerCase()==="current"||t.toLocaleLowerCase()==="present"?new Date().toISOString():(In(t)?t=`${t.slice(0,4)}-${t.slice(4,6)}-${t.slice(6)}`:Ln(t)&&(t+=":00:00.000Z"),new Date(t).toISOString())}catch(r){throw new Error(`Unhandled Date format (${t})`,{cause:r})}},Qr=(t,r)=>{let c=i=>{if(Kr(i))return`${i}-12-31T23:59:59.999Z`;if(zr(i)){let f=i.split("-").map(l=>parseInt(l)),u=new Date(f[0],f[1],0).getDate();return`${i}-${u}T23:59:59.999Z`}else return On(i)?`${i}T23:59:59.999Z`:ft(i)},y=i=>{let f={from:null,to:null};if((i[0].toLocaleLowerCase()==="present"||i[0].toLocaleLowerCase()==="current")&&(i[0]=new Date().toISOString()),(i[1].toLocaleLowerCase()==="present"||i[1].toLocaleLowerCase()==="current")&&(i[1]=new Date().toISOString()),Yr(i[0])?f.from=Gr(i[1],Jt(i[0]),!1):f.from=ft(i[0]),Yr(i[1])?f.to=Gr(i[0],Jt(i[1]),!0):f.to=c(i[1]),i.length===3){let u=Nn(i[2]);u&&(f.interval=u)}return f};try{if(Array.isArray(t)){let i=[];if(t.forEach(u=>{if(Hr(u)){let l=y(u.split("/"));l&&i.push(l)}}),i.length){let u=new Date(r).valueOf();for(let l=0;l<i.length;l++)if(u>=new Date(i[l].from).valueOf()&&u<=new Date(i[l].to).valueOf())return i[l];return i[i.length-1]}let f=t.map(u=>ft(u));if(f.length>1)return{from:f[0]??null,to:f[f.length-1]??null,values:f};t=f[0]}if(t.includes(",")){let i=t.split(",").map(f=>ft(f));return{from:i[0]??null,to:i[i.length-1]??null,values:i}}else if(typeof t=="string"){if(Hr(t))return y(t.split("/"));if(Kr(t)){let i=new Date(t),f=i.getFullYear();return i.setFullYear(f+1),{from:ft(t),to:i.toISOString()}}else if(zr(t)){let i=new Date(t),f=new Date(i.getFullYear(),i.getMonth()+1,0).getDate();return i.setFullYear(i.getFullYear(),i.getMonth(),f),i.setUTCHours(23),i.setUTCMinutes(59),i.setUTCSeconds(59,999),{from:ft(t),to:i.toISOString()}}else return{from:null,to:null}}}catch{return{from:null,to:null}}};export{Dn as parseWMSCapabilities,En as parseWMTSCapabilities};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
var Ti=Object.create;var Wr=Object.defineProperty;var Di=Object.getOwnPropertyDescriptor;var Ri=Object.getOwnPropertyNames;var wi=Object.getPrototypeOf,Ci=Object.prototype.hasOwnProperty;var u=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}};var ki=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ri(t))!Ci.call(e,i)&&i!==r&&Wr(e,i,{get:()=>t[i],enumerable:!(n=Di(t,i))||n.enumerable});return e};var Br=(e,t,r)=>(r=e!=null?Ti(wi(e)):{},ki(t||!e||!e.__esModule?Wr(r,"default",{value:e,enumerable:!0}):r,e));var _=u(p=>{"use strict";Object.defineProperty(p,"__esModule",{value:!0});p.timeConversion=p.sexagesimalPattern=p.longitudeKeys=p.latitudeKeys=p.earthRadius=p.distanceConversion=p.areaConversion=p.altitudeKeys=p.RAD_TO_DEG=p.MINLON=p.MINLAT=p.MAXLON=p.MAXLAT=p.DEG_TO_RAD=void 0;var rl=p.sexagesimalPattern=/^([0-9]{1,3})°\s*([0-9]{1,3}(?:\.(?:[0-9]{1,}))?)['′]\s*(([0-9]{1,3}(\.([0-9]{1,}))?)["″]\s*)?([NEOSW]?)$/,nl=p.earthRadius=6378137,il=p.MINLAT=-90,sl=p.MAXLAT=90,ol=p.MINLON=-180,al=p.MAXLON=180,ul=p.DEG_TO_RAD=Math.PI/180,ll=p.RAD_TO_DEG=180/Math.PI,cl=p.longitudeKeys=["lng","lon","longitude",0],fl=p.latitudeKeys=["lat","latitude",1],dl=p.altitudeKeys=["alt","altitude","elevation","elev",2],ml=p.distanceConversion={m:1,km:.001,cm:100,mm:1e3,mi:1/1609.344,sm:1/1852.216,ft:100/30.48,in:100/2.54,yd:1/.9144},pl=p.timeConversion={m:60,h:3600,d:86400},I=p.areaConversion={m2:1,km2:1e-6,ha:1e-4,a:.01,ft2:10.763911,yd2:1.19599,in2:1550.0031};I.sqm=I.m2;I.sqkm=I.km2;I.sqft=I.ft2;I.sqyd=I.yd2;I.sqin=I.in2});var fe=u(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.default=void 0;var Fi=(e,t)=>{if(e==null)throw new Error(`'${e}' is no valid coordinate.`);return t.reduce((r,n)=>Object.prototype.hasOwnProperty.call(e,n)&&n!==void 0&&r===void 0?(r=n,n):r,void 0)},hl=Ne.default=Fi});var de=u(je=>{"use strict";Object.defineProperty(je,"__esModule",{value:!0});je.default=void 0;var Wi=e=>{let t=e.toString().trim();return isNaN(parseFloat(t))?!1:parseFloat(t)===Number(t)},vl=je.default=Wi});var me=u(Ke=>{"use strict";Object.defineProperty(Ke,"__esModule",{value:!0});Ke.default=void 0;var Bi=_(),Hi=e=>Bi.sexagesimalPattern.test(e.toString().trim()),yl=Ke.default=Hi});var pe=u(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.default=void 0;var $i=_(),Gi=e=>{let t=new RegExp($i.sexagesimalPattern).exec(e.toString().trim());if(t===null)throw new Error("Given value is not in sexagesimal format");let r=Number(t[2])/60||0,n=Number(t[4])/3600||0,i=parseFloat(t[1])+r+n;return["S","W"].includes(t[7])?-i:i},Ml=Ue.default=Gi});var Fe=u(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.default=void 0;var tr=_(),rr=zi(fe());function zi(e){return e&&e.__esModule?e:{default:e}}var Zi=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{longitude:tr.longitudeKeys,latitude:tr.latitudeKeys,altitude:tr.altitudeKeys},r=(0,rr.default)(e,t.longitude),n=(0,rr.default)(e,t.latitude),i=(0,rr.default)(e,t.altitude);return{latitude:n,longitude:r,...i?{altitude:i}:{}}},Pl=Ve.default=Zi});var ir=u(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});We.default=void 0;var Xi=nr(de()),Yi=nr(me()),Ji=nr(pe()),nn=_();function nr(e){return e&&e.__esModule?e:{default:e}}var sn=e=>{if((0,Xi.default)(e)){let t=parseFloat(e);return!(t>nn.MAXLAT||t<nn.MINLAT)}return(0,Yi.default)(e)?sn((0,Ji.default)(e)):!1},Al=We.default=sn});var or=u(Be=>{"use strict";Object.defineProperty(Be,"__esModule",{value:!0});Be.default=void 0;var Qi=sr(de()),es=sr(me()),ts=sr(pe()),on=_();function sr(e){return e&&e.__esModule?e:{default:e}}var an=e=>{if((0,Qi.default)(e)){let t=parseFloat(e);return!(t>on.MAXLON||t<on.MINLON)}return(0,es.default)(e)?an((0,ts.default)(e)):!1},Dl=Be.default=an});var ur=u(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.default=void 0;var rs=ar(Fe()),un=ar(ir()),ln=ar(or());function ar(e){return e&&e.__esModule?e:{default:e}}var ns=e=>{let{latitude:t,longitude:r}=(0,rs.default)(e);if(Array.isArray(e)&&e.length>=2)return(0,ln.default)(e[0])&&(0,un.default)(e[1]);if(t===void 0||r===void 0)return!1;let n=e[r],i=e[t];return i===void 0||n===void 0?!1:(0,un.default)(i)&&(0,ln.default)(n)},wl=He.default=ns});var Ge=u($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.default=void 0;var is=he(de()),ss=he(me()),os=he(pe()),cn=he(ur()),as=he(Fe());function he(e){return e&&e.__esModule?e:{default:e}}var ge=e=>{if((0,is.default)(e))return Number(e);if((0,ss.default)(e))return(0,os.default)(e);if((0,cn.default)(e)){let t=(0,as.default)(e);return Array.isArray(e)?e.map((r,n)=>[0,1].includes(n)?ge(r):r):{...e,...t.latitude&&{[t.latitude]:ge(e[t.latitude])},...t.longitude&&{[t.longitude]:ge(e[t.longitude])}}}return Array.isArray(e)?e.map(t=>(0,cn.default)(t)?ge(t):t):e},kl=$e.default=ge});var R=u(ze=>{"use strict";Object.defineProperty(ze,"__esModule",{value:!0});ze.default=void 0;var us=_(),ls=fn(fe()),cs=fn(Ge());function fn(e){return e&&e.__esModule?e:{default:e}}var fs=(e,t)=>{let r=(0,ls.default)(e,us.latitudeKeys);if(r==null)return;let n=e[r];return t===!0?n:(0,cs.default)(n)},Ll=ze.default=fs});var w=u(Ze=>{"use strict";Object.defineProperty(Ze,"__esModule",{value:!0});Ze.default=void 0;var ds=_(),ms=dn(fe()),ps=dn(Ge());function dn(e){return e&&e.__esModule?e:{default:e}}var gs=(e,t)=>{let r=(0,ms.default)(e,ds.longitudeKeys);if(r==null)return;let n=e[r];return t===!0?n:(0,ps.default)(n)},Il=Ze.default=gs});var N=u(Xe=>{"use strict";Object.defineProperty(Xe,"__esModule",{value:!0});Xe.default=void 0;var hs=_(),bs=e=>e*hs.DEG_TO_RAD,jl=Xe.default=bs});var G=u(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.default=void 0;var vs=_(),xs=e=>e*vs.RAD_TO_DEG,Ul=Ye.default=xs});var pn=u(Qe=>{"use strict";Object.defineProperty(Qe,"__esModule",{value:!0});Qe.default=void 0;var ys=Je(R()),_s=Je(w()),lr=Je(N()),cr=Je(G()),mn=_();function Je(e){return e&&e.__esModule?e:{default:e}}var Ms=function(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:6371e3,i=(0,ys.default)(e),s=(0,_s.default)(e),o=t/n,a=(0,lr.default)(r),l=(0,lr.default)(i),y=(0,lr.default)(s),g=Math.asin(Math.sin(l)*Math.cos(o)+Math.cos(l)*Math.sin(o)*Math.cos(a)),h=y+Math.atan2(Math.sin(a)*Math.sin(o)*Math.cos(l),Math.cos(o)-Math.sin(l)*Math.sin(g)),m=(0,cr.default)(h);return(m<mn.MINLON||m>mn.MAXLON)&&(h=(h+3*Math.PI)%(2*Math.PI)-Math.PI,m=(0,cr.default)(h)),{latitude:(0,cr.default)(g),longitude:m}},Fl=Qe.default=Ms});var gn=u(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.default=void 0;var Ss=_(),Ps=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"m",r=Ss.areaConversion[t];if(r)return e*r;throw new Error("Invalid unit used for area conversion.")},Bl=et.default=Ps});var hn=u(tt=>{"use strict";Object.defineProperty(tt,"__esModule",{value:!0});tt.default=void 0;var Os=_(),As=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"m",r=Os.distanceConversion[t];if(r)return e*r;throw new Error("Invalid unit used for distance conversion.")},$l=tt.default=As});var bn=u(nt=>{"use strict";Object.defineProperty(nt,"__esModule",{value:!0});nt.default=void 0;var rt=_(),Ts=function(e){switch(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"kmh"){case"kmh":return e*rt.timeConversion.h*rt.distanceConversion.km;case"mph":return e*rt.timeConversion.h*rt.distanceConversion.mi;default:return e}},zl=nt.default=Ts});var vn=u(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.default=void 0;var Ds=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:4,r=Math.pow(10,t);return Math.round(e*r)/r},Rs=e=>{let[t,r]=e.toString().split("."),n=Math.abs(Number(t)),i=+("0."+(r||0))*60,s=i.toString().split("."),o=Math.floor(i),a=Ds(+("0."+(s[1]||0))*60).toString(),[l,y="0"]=a.split(".");return n+"\xB0 "+o.toString().padStart(2,"0")+"' "+l.padStart(2,"0")+"."+y.padEnd(1,"0")+'"'},Xl=it.default=Rs});var fr=u(st=>{"use strict";Object.defineProperty(st,"__esModule",{value:!0});st.default=void 0;var ws=e=>e>1?1:e<-1?-1:e,Jl=st.default=ws});var W=u(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.default=void 0;var xn=ot(R()),yn=ot(w()),dr=ot(N()),Cs=ot(fr()),ks=_();function ot(e){return e&&e.__esModule?e:{default:e}}var qs=function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;r=isNaN(r)?1:r;let n=(0,dr.default)((0,xn.default)(e)),i=(0,dr.default)((0,xn.default)(t)),s=(0,dr.default)((0,yn.default)(e)-(0,yn.default)(t)),o=Math.acos((0,Cs.default)(Math.sin(i)*Math.sin(n)+Math.cos(i)*Math.cos(n)*Math.cos(s)))*ks.earthRadius;return Math.round(o/r)*r},ec=at.default=qs});var mr=u(ut=>{"use strict";Object.defineProperty(ut,"__esModule",{value:!0});ut.default=void 0;var _n=Ls(W());function Ls(e){return e&&e.__esModule?e:{default:e}}var Es=function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:_n.default;return r=typeof r=="function"?r:_n.default,t.slice().sort((n,i)=>r(e,n)-r(e,i))},rc=ut.default=Es});var Mn=u(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.default=void 0;var Is=Ns(mr());function Ns(e){return e&&e.__esModule?e:{default:e}}var js=(e,t)=>(0,Is.default)(e,t)[0],ic=lt.default=js});var On=u(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.default=void 0;var pr=gr(N()),Ks=gr(R()),Sn=gr(w()),Pn=_();function gr(e){return e&&e.__esModule?e:{default:e}}var Us=e=>{let t=0;if(e.length>2){let r,n,i;for(let s=0;s<e.length;s++){s===e.length-2?(r=e.length-2,n=e.length-1,i=0):s===e.length-1?(r=e.length-1,n=0,i=1):(r=s,n=s+1,i=s+2);let o=(0,Sn.default)(e[r]),a=(0,Ks.default)(e[n]),l=(0,Sn.default)(e[i]);t+=((0,pr.default)(l)-(0,pr.default)(o))*Math.sin((0,pr.default)(a))}t=t*Pn.earthRadius*Pn.earthRadius/2}return Math.abs(t)},oc=ct.default=Us});var hr=u(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.default=void 0;var Vs=An(R()),Fs=An(w());function An(e){return e&&e.__esModule?e:{default:e}}var Ws=e=>{if(Array.isArray(e)===!1||e.length===0)throw new Error("No points were given.");return e.reduce((t,r)=>{let n=(0,Vs.default)(r),i=(0,Fs.default)(r);return{maxLat:Math.max(n,t.maxLat),minLat:Math.min(n,t.minLat),maxLng:Math.max(i,t.maxLng),minLng:Math.min(i,t.minLng)}},{maxLat:-1/0,minLat:1/0,maxLng:-1/0,minLng:1/0})},uc=ft.default=Ws});var Tn=u(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.default=void 0;var Bs=mt(R()),Hs=mt(w()),re=mt(N()),dt=mt(G()),be=_();function mt(e){return e&&e.__esModule?e:{default:e}}var $s=(e,t)=>{let r=(0,Bs.default)(e),n=(0,Hs.default)(e),i=(0,re.default)(r),s=(0,re.default)(n),o=t/be.earthRadius,a=i-o,l=i+o,y=(0,re.default)(be.MAXLAT),g=(0,re.default)(be.MINLAT),h=(0,re.default)(be.MAXLON),m=(0,re.default)(be.MINLON),S,v;if(a>g&&l<y){let T=Math.asin(Math.sin(o)/Math.cos(i));S=s-T,S<m&&(S+=Math.PI*2),v=s+T,v>h&&(v-=Math.PI*2)}else a=Math.max(a,g),l=Math.min(l,y),S=m,v=h;return[{latitude:(0,dt.default)(a),longitude:(0,dt.default)(S)},{latitude:(0,dt.default)(l),longitude:(0,dt.default)(v)}]},cc=pt.default=$s});var wn=u(ht=>{"use strict";Object.defineProperty(ht,"__esModule",{value:!0});ht.default=void 0;var Gs=gt(R()),zs=gt(w()),Dn=gt(N()),Rn=gt(G());function gt(e){return e&&e.__esModule?e:{default:e}}var Zs=e=>{if(Array.isArray(e)===!1||e.length===0)return!1;let t=e.length,r=e.reduce((o,a)=>{let l=(0,Dn.default)((0,Gs.default)(a)),y=(0,Dn.default)((0,zs.default)(a));return{X:o.X+Math.cos(l)*Math.cos(y),Y:o.Y+Math.cos(l)*Math.sin(y),Z:o.Z+Math.sin(l)}},{X:0,Y:0,Z:0}),n=r.X/t,i=r.Y/t,s=r.Z/t;return{longitude:(0,Rn.default)(Math.atan2(i,n)),latitude:(0,Rn.default)(Math.atan2(s,Math.sqrt(n*n+i*i)))}},dc=ht.default=Zs});var Cn=u(bt=>{"use strict";Object.defineProperty(bt,"__esModule",{value:!0});bt.default=void 0;var Xs=Ys(hr());function Ys(e){return e&&e.__esModule?e:{default:e}}var Js=e=>{let t=(0,Xs.default)(e),r=t.minLat+(t.maxLat-t.minLat)/2,n=t.minLng+(t.maxLng-t.minLng)/2;return{latitude:parseFloat(r.toFixed(6)),longitude:parseFloat(n.toFixed(6))}},pc=bt.default=Js});var br=u(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.default=void 0;var kn=xt(R()),qn=xt(w()),vt=xt(N()),Qs=xt(G());function xt(e){return e&&e.__esModule?e:{default:e}}var eo=(e,t)=>{let r=(0,vt.default)((0,qn.default)(t))-(0,vt.default)((0,qn.default)(e)),n=Math.log(Math.tan((0,vt.default)((0,kn.default)(t))/2+Math.PI/4)/Math.tan((0,vt.default)((0,kn.default)(e))/2+Math.PI/4));return Math.abs(r)>Math.PI&&(r>0?r=(Math.PI*2-r)*-1:r=Math.PI*2+r),((0,Qs.default)(Math.atan2(r,n))+360)%360},hc=yt.default=eo});var En=u(_t=>{"use strict";Object.defineProperty(_t,"__esModule",{value:!0});_t.default=void 0;var Ln=to(br());function to(e){return e&&e.__esModule?e:{default:e}}var ro=function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ln.default,n=typeof r=="function"?r(e,t):(0,Ln.default)(e,t);if(isNaN(n))throw new Error("Could not calculate bearing for given points. Check your bearing function");switch(Math.round(n/22.5)){case 1:return"NNE";case 2:return"NE";case 3:return"ENE";case 4:return"E";case 5:return"ESE";case 6:return"SE";case 7:return"SSE";case 8:return"S";case 9:return"SSW";case 10:return"SW";case 11:return"WSW";case 12:return"W";case 13:return"WNW";case 14:return"NW";case 15:return"NNW";default:return"N"}},vc=_t.default=ro});var xr=u(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.default=void 0;var vr=Nn(W()),In=Nn(fr());function Nn(e){return e&&e.__esModule?e:{default:e}}var no=function(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1,i=(0,vr.default)(t,e,n),s=(0,vr.default)(e,r,n),o=(0,vr.default)(t,r,n),a=Math.acos((0,In.default)((i*i+o*o-s*s)/(2*i*o))),l=Math.acos((0,In.default)((s*s+o*o-i*i)/(2*s*o)));return i===0||s===0?0:o===0||a>Math.PI/2?i:l>Math.PI/2?s:Math.sin(a)*i},yc=Mt.default=no});var Un=u(Pt=>{"use strict";Object.defineProperty(Pt,"__esModule",{value:!0});Pt.default=void 0;var jn=St(R()),Kn=St(w()),K=St(N()),io=St(G());function St(e){return e&&e.__esModule?e:{default:e}}var so=(e,t)=>{let r=(0,jn.default)(t),n=(0,Kn.default)(t),i=(0,jn.default)(e),s=(0,Kn.default)(e);return((0,io.default)(Math.atan2(Math.sin((0,K.default)(n)-(0,K.default)(s))*Math.cos((0,K.default)(r)),Math.cos((0,K.default)(i))*Math.sin((0,K.default)(r))-Math.sin((0,K.default)(i))*Math.cos((0,K.default)(r))*Math.cos((0,K.default)(n)-(0,K.default)(s))))+360)%360},Mc=Pt.default=so});var Vn=u(Ot=>{"use strict";Object.defineProperty(Ot,"__esModule",{value:!0});Ot.default=void 0;var oo=ao(W());function ao(e){return e&&e.__esModule?e:{default:e}}var uo=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:oo.default;return e.reduce((r,n)=>(typeof r=="object"&&r.last!==null&&(r.distance+=t(n,r.last)),r.last=n,r),{last:null,distance:0}).distance},Pc=Ot.default=uo});var Hn=u(At=>{"use strict";Object.defineProperty(At,"__esModule",{value:!0});At.default=void 0;var Fn=_r(R()),Wn=_r(w()),yr=_r(N()),Bn=_();function _r(e){return e&&e.__esModule?e:{default:e}}var lo=function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;r=isNaN(r)?1:r;let n=(0,Fn.default)(e),i=(0,Wn.default)(e),s=(0,Fn.default)(t),o=(0,Wn.default)(t),a=6356752314245e-6,l=1/298.257223563,y=(0,yr.default)(o-i),g,h,m,S,v,T,Kr=Math.atan((1-l)*Math.tan((0,yr.default)(parseFloat(n)))),Ur=Math.atan((1-l)*Math.tan((0,yr.default)(parseFloat(s)))),Pe=Math.sin(Kr),Oe=Math.cos(Kr),Ae=Math.sin(Ur),X=Math.cos(Ur),se=y,Vr,Fr=100;do{let Wt=Math.sin(se),Bt=Math.cos(se);if(T=Math.sqrt(X*Wt*(X*Wt)+(Oe*Ae-Pe*X*Bt)*(Oe*Ae-Pe*X*Bt)),T===0)return 0;g=Pe*Ae+Oe*X*Bt,h=Math.atan2(T,g),m=Oe*X*Wt/T,S=1-m*m,v=g-2*Pe*Ae/S,isNaN(v)&&(v=0);let Ht=l/16*S*(4+l*(4-3*S));Vr=se,se=y+(1-Ht)*l*m*(h+Ht*T*(v+Ht*g*(-1+2*v*v)))}while(Math.abs(se-Vr)>1e-12&&--Fr>0);if(Fr===0)return NaN;let F=S*(Bn.earthRadius*Bn.earthRadius-a*a)/(a*a),Pi=1+F/16384*(4096+F*(-768+F*(320-175*F))),Ft=F/1024*(256+F*(-128+F*(74-47*F))),Oi=Ft*T*(v+Ft/4*(g*(-1+2*v*v)-Ft/6*v*(-3+4*T*T)*(-3+4*v*v))),Ai=a*Pi*(h-Oi);return Math.round(Ai/r)*r},Ac=At.default=lo});var $n=u(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});Tt.default=void 0;var co=e=>{if(/^(NNE|NE|NNW|N)$/.test(e))return"N";if(/^(ENE|E|ESE|SE)$/.test(e))return"E";if(/^(SSE|S|SSW|SW)$/.test(e))return"S";if(/^(WSW|W|WNW|NW)$/.test(e))return"W"},Dc=Tt.default=co});var Gn=u(Dt=>{"use strict";Object.defineProperty(Dt,"__esModule",{value:!0});Dt.default=void 0;var fo=mo(W());function mo(e){return e&&e.__esModule?e:{default:e}}var po=function(e,t){let n=(arguments.length>2&&arguments[2]!==void 0?arguments[2]:fo.default)(e,t),i=Number(t.time)-Number(e.time);return n/i*1e3},wc=Dt.default=po});var zn=u(Rt=>{"use strict";Object.defineProperty(Rt,"__esModule",{value:!0});Rt.default=void 0;var Mr=go(W());function go(e){return e&&e.__esModule?e:{default:e}}var ho=(e,t,r)=>(0,Mr.default)(t,e)+(0,Mr.default)(e,r)===(0,Mr.default)(t,r),kc=Rt.default=ho});var Xn=u(Ct=>{"use strict";Object.defineProperty(Ct,"__esModule",{value:!0});Ct.default=void 0;var wt=Zn(R()),C=Zn(w());function Zn(e){return e&&e.__esModule?e:{default:e}}var bo=(e,t)=>{let r=!1,n=t.length;for(let i=-1,s=n-1;++i<n;s=i)((0,C.default)(t[i])<=(0,C.default)(e)&&(0,C.default)(e)<(0,C.default)(t[s])||(0,C.default)(t[s])<=(0,C.default)(e)&&(0,C.default)(e)<(0,C.default)(t[i]))&&(0,wt.default)(e)<((0,wt.default)(t[s])-(0,wt.default)(t[i]))*((0,C.default)(e)-(0,C.default)(t[i]))/((0,C.default)(t[s])-(0,C.default)(t[i]))+(0,wt.default)(t[i])&&(r=!r);return r},Lc=Ct.default=bo});var Yn=u(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.default=void 0;var vo=xo(xr());function xo(e){return e&&e.__esModule?e:{default:e}}var yo=(e,t,r,n)=>(0,vo.default)(e,t,r)<n,Ic=kt.default=yo});var Jn=u(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.default=void 0;var _o=Mo(W());function Mo(e){return e&&e.__esModule?e:{default:e}}var So=(e,t,r)=>(0,_o.default)(e,t,.01)<r,jc=qt.default=So});var Qn=u(Lt=>{"use strict";Object.defineProperty(Lt,"__esModule",{value:!0});Lt.default=void 0;var Po=e=>{if(!e.startsWith("POLYGON"))throw new Error("Invalid wkt.");return e.slice(e.indexOf("(")+2,e.indexOf(")")).split(", ").map(n=>{let[i,s]=n.split(" ");return{longitude:parseFloat(i),latitude:parseFloat(s)}})},Uc=Lt.default=Po});var ei=u(c=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var Oo={computeDestinationPoint:!0,convertArea:!0,convertDistance:!0,convertSpeed:!0,decimalToSexagesimal:!0,findNearest:!0,getAreaOfPolygon:!0,getBounds:!0,getBoundsOfDistance:!0,getCenter:!0,getCenterOfBounds:!0,getCompassDirection:!0,getCoordinateKey:!0,getCoordinateKeys:!0,getDistance:!0,getDistanceFromLine:!0,getGreatCircleBearing:!0,getLatitude:!0,getLongitude:!0,getPathLength:!0,getPreciseDistance:!0,getRhumbLineBearing:!0,getRoughCompassDirection:!0,getSpeed:!0,isDecimal:!0,isPointInLine:!0,isPointInPolygon:!0,isPointNearLine:!0,isPointWithinRadius:!0,isSexagesimal:!0,isValidCoordinate:!0,isValidLatitude:!0,isValidLongitude:!0,orderByDistance:!0,sexagesimalToDecimal:!0,toDecimal:!0,toRad:!0,toDeg:!0,wktToPolygon:!0};Object.defineProperty(c,"computeDestinationPoint",{enumerable:!0,get:function(){return Ao.default}});Object.defineProperty(c,"convertArea",{enumerable:!0,get:function(){return To.default}});Object.defineProperty(c,"convertDistance",{enumerable:!0,get:function(){return Do.default}});Object.defineProperty(c,"convertSpeed",{enumerable:!0,get:function(){return Ro.default}});Object.defineProperty(c,"decimalToSexagesimal",{enumerable:!0,get:function(){return wo.default}});Object.defineProperty(c,"findNearest",{enumerable:!0,get:function(){return Co.default}});Object.defineProperty(c,"getAreaOfPolygon",{enumerable:!0,get:function(){return ko.default}});Object.defineProperty(c,"getBounds",{enumerable:!0,get:function(){return qo.default}});Object.defineProperty(c,"getBoundsOfDistance",{enumerable:!0,get:function(){return Lo.default}});Object.defineProperty(c,"getCenter",{enumerable:!0,get:function(){return Eo.default}});Object.defineProperty(c,"getCenterOfBounds",{enumerable:!0,get:function(){return Io.default}});Object.defineProperty(c,"getCompassDirection",{enumerable:!0,get:function(){return No.default}});Object.defineProperty(c,"getCoordinateKey",{enumerable:!0,get:function(){return jo.default}});Object.defineProperty(c,"getCoordinateKeys",{enumerable:!0,get:function(){return Ko.default}});Object.defineProperty(c,"getDistance",{enumerable:!0,get:function(){return Uo.default}});Object.defineProperty(c,"getDistanceFromLine",{enumerable:!0,get:function(){return Vo.default}});Object.defineProperty(c,"getGreatCircleBearing",{enumerable:!0,get:function(){return Fo.default}});Object.defineProperty(c,"getLatitude",{enumerable:!0,get:function(){return Wo.default}});Object.defineProperty(c,"getLongitude",{enumerable:!0,get:function(){return Bo.default}});Object.defineProperty(c,"getPathLength",{enumerable:!0,get:function(){return Ho.default}});Object.defineProperty(c,"getPreciseDistance",{enumerable:!0,get:function(){return $o.default}});Object.defineProperty(c,"getRhumbLineBearing",{enumerable:!0,get:function(){return Go.default}});Object.defineProperty(c,"getRoughCompassDirection",{enumerable:!0,get:function(){return zo.default}});Object.defineProperty(c,"getSpeed",{enumerable:!0,get:function(){return Zo.default}});Object.defineProperty(c,"isDecimal",{enumerable:!0,get:function(){return Xo.default}});Object.defineProperty(c,"isPointInLine",{enumerable:!0,get:function(){return Yo.default}});Object.defineProperty(c,"isPointInPolygon",{enumerable:!0,get:function(){return Jo.default}});Object.defineProperty(c,"isPointNearLine",{enumerable:!0,get:function(){return Qo.default}});Object.defineProperty(c,"isPointWithinRadius",{enumerable:!0,get:function(){return ea.default}});Object.defineProperty(c,"isSexagesimal",{enumerable:!0,get:function(){return ta.default}});Object.defineProperty(c,"isValidCoordinate",{enumerable:!0,get:function(){return ra.default}});Object.defineProperty(c,"isValidLatitude",{enumerable:!0,get:function(){return na.default}});Object.defineProperty(c,"isValidLongitude",{enumerable:!0,get:function(){return ia.default}});Object.defineProperty(c,"orderByDistance",{enumerable:!0,get:function(){return sa.default}});Object.defineProperty(c,"sexagesimalToDecimal",{enumerable:!0,get:function(){return oa.default}});Object.defineProperty(c,"toDecimal",{enumerable:!0,get:function(){return aa.default}});Object.defineProperty(c,"toDeg",{enumerable:!0,get:function(){return la.default}});Object.defineProperty(c,"toRad",{enumerable:!0,get:function(){return ua.default}});Object.defineProperty(c,"wktToPolygon",{enumerable:!0,get:function(){return ca.default}});var Ao=d(pn()),To=d(gn()),Do=d(hn()),Ro=d(bn()),wo=d(vn()),Co=d(Mn()),ko=d(On()),qo=d(hr()),Lo=d(Tn()),Eo=d(wn()),Io=d(Cn()),No=d(En()),jo=d(fe()),Ko=d(Fe()),Uo=d(W()),Vo=d(xr()),Fo=d(Un()),Wo=d(R()),Bo=d(w()),Ho=d(Vn()),$o=d(Hn()),Go=d(br()),zo=d($n()),Zo=d(Gn()),Xo=d(de()),Yo=d(zn()),Jo=d(Xn()),Qo=d(Yn()),ea=d(Jn()),ta=d(me()),ra=d(ur()),na=d(ir()),ia=d(or()),sa=d(mr()),oa=d(pe()),aa=d(Ge()),ua=d(N()),la=d(G()),ca=d(Qn()),Sr=_();Object.keys(Sr).forEach(function(e){e==="default"||e==="__esModule"||Object.prototype.hasOwnProperty.call(Oo,e)||e in c&&c[e]===Sr[e]||Object.defineProperty(c,e,{enumerable:!0,get:function(){return Sr[e]}})});function d(e){return e&&e.__esModule?e:{default:e}}});var ti=u(Tr=>{"use strict";Tr.__esModule=!0;function Or(e,t){return e*e+t*t}function fa(e,t){return Or(e[0]-t[0],e[1]-t[1])}function da(e,t,r){var n=t[0],i=t[1],s=r[0]-n,o=r[1]-i;if(s!==0||o!==0){var a=((e[0]-n)*s+(e[1]-i)*o)/Or(s,o);a>1?(n=r[0],i=r[1]):a>0&&(n+=s*a,i+=o*a)}return Or(e[0]-n,e[1]-i)}function ma(e,t){for(var r=e[0],n,i=[r],s=1,o=e.length;s<o;s++)n=e[s],fa(n,r)>t&&(i.push(n),r=n);return r!==n&&i.push(n),i}function Ar(e,t,r,n,i){for(var s=n,o,a=t+1;a<r;a++){var l=da(e[a],e[t],e[r]);l>s&&(o=a,s=l)}s>n&&(o-t>1&&Ar(e,t,o,n,i),i.push(e[o]),r-o>1&&Ar(e,o,r,n,i))}function pa(e,t){var r=e.length-1,n=[e[0]];return Ar(e,0,r,t,n),n.push(e[r]),n}function ga(e,t,r){if(t===void 0&&(t=1),r===void 0&&(r=!1),e.length<=2)return e;var n=t*t;return e=r?e:ma(e,n),e=pa(e,n),e}Tr.SimplifyAP=ga});var ri=u(wr=>{"use strict";wr.__esModule=!0;function Dr(e,t){return e*e+t*t}function ha(e,t){return Dr(e.longitude-t.longitude,e.latitude-t.latitude)}function ba(e,t,r){var n=t.longitude,i=t.latitude,s=r.longitude-n,o=r.latitude-i;if(s!==0||o!==0){var a=((e.longitude-n)*s+(e.latitude-i)*o)/Dr(s,o);a>1?(n=r.longitude,i=r.latitude):a>0&&(n+=s*a,i+=o*a)}return Dr(e.longitude-n,e.latitude-i)}function va(e,t){for(var r=e[0],n,i=[r],s=1,o=e.length;s<o;s++)n=e[s],ha(n,r)>t&&(i.push(n),r=n);return r!==n&&i.push(n),i}function Rr(e,t,r,n,i){for(var s=n,o,a=t+1;a<r;a++){var l=ba(e[a],e[t],e[r]);l>s&&(o=a,s=l)}s>n&&(o-t>1&&Rr(e,t,o,n,i),i.push(e[o]),r-o>1&&Rr(e,o,r,n,i))}function xa(e,t){var r=e.length-1,n=[e[0]];return Rr(e,0,r,t,n),n.push(e[r]),n}function ya(e,t,r){if(t===void 0&&(t=1),r===void 0&&(r=!1),e.length<=2)return e;var n=t*t;return e=r?e:va(e,n),e=xa(e,n),e}wr.SimplifyLL=ya});var ni=u(qr=>{"use strict";qr.__esModule=!0;function Cr(e,t){return e*e+t*t}function _a(e,t){return Cr(e.x-t.x,e.y-t.y)}function Ma(e,t,r){var n=t.x,i=t.y,s=r.x-n,o=r.y-i;if(s!==0||o!==0){var a=((e.x-n)*s+(e.y-i)*o)/Cr(s,o);a>1?(n=r.x,i=r.y):a>0&&(n+=s*a,i+=o*a)}return Cr(e.x-n,e.y-i)}function Sa(e,t){for(var r=e[0],n,i=[r],s=1,o=e.length;s<o;s++)n=e[s],_a(n,r)>t&&(i.push(n),r=n);return r!==n&&i.push(n),i}function kr(e,t,r,n,i){for(var s=n,o,a=t+1;a<r;a++){var l=Ma(e[a],e[t],e[r]);l>s&&(o=a,s=l)}s>n&&(o-t>1&&kr(e,t,o,n,i),i.push(e[o]),r-o>1&&kr(e,o,r,n,i))}function Pa(e,t){var r=e.length-1,n=[e[0]];return kr(e,0,r,t,n),n.push(e[r]),n}function Oa(e,t,r){if(t===void 0&&(t=1),r===void 0&&(r=!1),e.length<=2)return e;var n=t*t;return e=r?e:Sa(e,n),e=Pa(e,n),e}qr.Simplify=Oa});var ii=u(ve=>{"use strict";ve.__esModule=!0;var Aa=ti();ve.SimplifyAP=Aa.SimplifyAP;var Ta=ri();ve.SimplifyLL=Ta.SimplifyLL;var Da=ni();ve.Simplify=Da.Simplify});function D(e){return typeof e=="function"}function Te(e){let r=e(n=>{Error.call(n),n.stack=new Error().stack});return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var De=Te(e=>function(r){e(this),this.message=r?`${r.length} errors occurred during unsubscription:
|
|
2
|
-
${r.map((n,i)=>`${i+1}) ${n.toString()}`).join(`
|
|
3
|
-
`)}`:"",this.name="UnsubscriptionError",this.errors=r});function oe(e,t){if(e){let r=e.indexOf(t);0<=r&&e.splice(r,1)}}var L=class e{constructor(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let t;if(!this.closed){this.closed=!0;let{_parentage:r}=this;if(r)if(this._parentage=null,Array.isArray(r))for(let s of r)s.remove(this);else r.remove(this);let{initialTeardown:n}=this;if(D(n))try{n()}catch(s){t=s instanceof De?s.errors:[s]}let{_finalizers:i}=this;if(i){this._finalizers=null;for(let s of i)try{Hr(s)}catch(o){t=t??[],o instanceof De?t=[...t,...o.errors]:t.push(o)}}if(t)throw new De(t)}}add(t){var r;if(t&&t!==this)if(this.closed)Hr(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}}_hasParent(t){let{_parentage:r}=this;return r===t||Array.isArray(r)&&r.includes(t)}_addParent(t){let{_parentage:r}=this;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t}_removeParent(t){let{_parentage:r}=this;r===t?this._parentage=null:Array.isArray(r)&&oe(r,t)}remove(t){let{_finalizers:r}=this;r&&oe(r,t),t instanceof e&&t._removeParent(this)}};L.EMPTY=(()=>{let e=new L;return e.closed=!0,e})();var $t=L.EMPTY;function Re(e){return e instanceof L||e&&"closed"in e&&D(e.remove)&&D(e.add)&&D(e.unsubscribe)}function Hr(e){D(e)?e():e.unsubscribe()}var k={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var Y={setTimeout(e,t,...r){let{delegate:n}=Y;return n?.setTimeout?n.setTimeout(e,t,...r):setTimeout(e,t,...r)},clearTimeout(e){let{delegate:t}=Y;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function $r(e){Y.setTimeout(()=>{let{onUnhandledError:t}=k;if(t)t(e);else throw e})}function Gt(){}var Gr=zt("C",void 0,void 0);function zr(e){return zt("E",void 0,e)}function Zr(e){return zt("N",e,void 0)}function zt(e,t,r){return{kind:e,value:t,error:r}}var B=null;function J(e){if(k.useDeprecatedSynchronousErrorHandling){let t=!B;if(t&&(B={errorThrown:!1,error:null}),e(),t){let{errorThrown:r,error:n}=B;if(B=null,r)throw n}}else e()}function Xr(e){k.useDeprecatedSynchronousErrorHandling&&B&&(B.errorThrown=!0,B.error=e)}var ae=class extends L{constructor(t){super(),this.isStopped=!1,t?(this.destination=t,Re(t)&&t.add(this)):this.destination=Ei}static create(t,r,n){return new Q(t,r,n)}next(t){this.isStopped?Xt(Zr(t),this):this._next(t)}error(t){this.isStopped?Xt(zr(t),this):(this.isStopped=!0,this._error(t))}complete(){this.isStopped?Xt(Gr,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(t){this.destination.next(t)}_error(t){try{this.destination.error(t)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}},qi=Function.prototype.bind;function Zt(e,t){return qi.call(e,t)}var Yt=class{constructor(t){this.partialObserver=t}next(t){let{partialObserver:r}=this;if(r.next)try{r.next(t)}catch(n){we(n)}}error(t){let{partialObserver:r}=this;if(r.error)try{r.error(t)}catch(n){we(n)}else we(t)}complete(){let{partialObserver:t}=this;if(t.complete)try{t.complete()}catch(r){we(r)}}},Q=class extends ae{constructor(t,r,n){super();let i;if(D(t)||!t)i={next:t??void 0,error:r??void 0,complete:n??void 0};else{let s;this&&k.useDeprecatedNextContext?(s=Object.create(t),s.unsubscribe=()=>this.unsubscribe(),i={next:t.next&&Zt(t.next,s),error:t.error&&Zt(t.error,s),complete:t.complete&&Zt(t.complete,s)}):i=t}this.destination=new Yt(i)}};function we(e){k.useDeprecatedSynchronousErrorHandling?Xr(e):$r(e)}function Li(e){throw e}function Xt(e,t){let{onStoppedNotification:r}=k;r&&Y.setTimeout(()=>r(e,t))}var Ei={closed:!0,next:Gt,error:Li,complete:Gt};var Yr=typeof Symbol=="function"&&Symbol.observable||"@@observable";function Jr(e){return e}function Qr(e){return e.length===0?Jr:e.length===1?e[0]:function(r){return e.reduce((n,i)=>i(n),r)}}var H=class e{constructor(t){t&&(this._subscribe=t)}lift(t){let r=new e;return r.source=this,r.operator=t,r}subscribe(t,r,n){let i=Ni(t)?t:new Q(t,r,n);return J(()=>{let{operator:s,source:o}=this;i.add(s?s.call(i,o):o?this._subscribe(i):this._trySubscribe(i))}),i}_trySubscribe(t){try{return this._subscribe(t)}catch(r){t.error(r)}}forEach(t,r){return r=en(r),new r((n,i)=>{let s=new Q({next:o=>{try{t(o)}catch(a){i(a),s.unsubscribe()}},error:i,complete:n});this.subscribe(s)})}_subscribe(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)}[Yr](){return this}pipe(...t){return Qr(t)(this)}toPromise(t){return t=en(t),new t((r,n)=>{let i;this.subscribe(s=>i=s,s=>n(s),()=>r(i))})}};H.create=e=>new H(e);function en(e){var t;return(t=e??k.Promise)!==null&&t!==void 0?t:Promise}function Ii(e){return e&&D(e.next)&&D(e.error)&&D(e.complete)}function Ni(e){return e&&e instanceof ae||Ii(e)&&Re(e)}var tn=Te(e=>function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});var E=class extends H{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(t){let r=new Ce(this,this);return r.operator=t,r}_throwIfClosed(){if(this.closed)throw new tn}next(t){J(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(let r of this.currentObservers)r.next(t)}})}error(t){J(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=t;let{observers:r}=this;for(;r.length;)r.shift().error(t)}})}complete(){J(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;let{observers:t}=this;for(;t.length;)t.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0}_trySubscribe(t){return this._throwIfClosed(),super._trySubscribe(t)}_subscribe(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)}_innerSubscribe(t){let{hasError:r,isStopped:n,observers:i}=this;return r||n?$t:(this.currentObservers=null,i.push(t),new L(()=>{this.currentObservers=null,oe(i,t)}))}_checkFinalizedStatuses(t){let{hasError:r,thrownError:n,isStopped:i}=this;r?t.error(n):i&&t.complete()}asObservable(){let t=new H;return t.source=this,t}};E.create=(e,t)=>new Ce(e,t);var Ce=class extends E{constructor(t,r){super(),this.destination=t,this.source=r}next(t){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.next)===null||n===void 0||n.call(r,t)}error(t){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.error)===null||n===void 0||n.call(r,t)}complete(){var t,r;(r=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||r===void 0||r.call(t)}_subscribe(t){var r,n;return(n=(r=this.source)===null||r===void 0?void 0:r.subscribe(t))!==null&&n!==void 0?n:$t}};var P=[];for(let e=0;e<256;++e)P.push((e+256).toString(16).slice(1));function rn(e,t=0){return(P[e[t+0]]+P[e[t+1]]+P[e[t+2]]+P[e[t+3]]+"-"+P[e[t+4]]+P[e[t+5]]+"-"+P[e[t+6]]+P[e[t+7]]+"-"+P[e[t+8]]+P[e[t+9]]+"-"+P[e[t+10]]+P[e[t+11]]+P[e[t+12]]+P[e[t+13]]+P[e[t+14]]+P[e[t+15]]).toLowerCase()}var ji=new Uint8Array(16);function Jt(){return crypto.getRandomValues(ji)}function Ki(e,t,r){return!t&&!e&&crypto.randomUUID?crypto.randomUUID():Ui(e,t,r)}function Ui(e,t,r){e=e||{};let n=e.random??e.rng?.()??Jt();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let i=0;i<16;++i)t[r+i]=n[i];return t}return rn(n)}var Qt=Ki;var ke=class{_connect;_close;_error;_message;ws;_filter="";_wsTimeout=2e4;_token="";_playbackMode=!1;onConnect;onClose;onError;onMessage;version=1;endpoint="";selfId="";_source=null;set source(t){this._source?this._source.label=t:this._source={label:t}}set authToken(t){this._token=t}get connectionTimeout(){return this._wsTimeout}set connectionTimeout(t){this._wsTimeout=t<3e3?3e3:t>6e4?6e4:t}get isOpen(){return!!(this.ws&&this.ws.readyState!==1&&this.ws.readyState!==3)}get filter(){return this._filter}set filter(t){t&&t.indexOf("self")!==-1?this._filter=this.selfId?this.selfId:"":this._filter=t}get playbackMode(){return this._playbackMode}constructor(){this._connect=new E,this.onConnect=this._connect.asObservable(),this._close=new E,this.onClose=this._close.asObservable(),this._error=new E,this.onError=this._error.asObservable(),this._message=new E,this.onMessage=this._message.asObservable()}close(){this.ws&&(this.ws.close(),this.ws=null)}open(t,r,n){if(t=t||this.endpoint,!t)return;let i=t.indexOf("?")===-1?"?":"&";r&&(t+=`${i}subscribe=${r}`),(this._token||n)&&(t+=`${r?"&":"?"}token=${this._token||n}`),this.close(),this.ws=new WebSocket(t),setTimeout(()=>{this.ws&&this.ws.readyState!==1&&this.ws.readyState!==3&&(console.warn(`Connection watchdog expired (${this._wsTimeout/1e3} sec): ${this.ws.readyState}... aborting connection...`),this.close())},this._wsTimeout),this.ws.onopen=s=>{this._connect.next(s)},this.ws.onclose=s=>{this._close.next(s)},this.ws.onerror=s=>{this._error.next(s)},this.ws.onmessage=s=>{this.parseOnMessage(s)}}parseOnMessage(t){let r;if(typeof t.data=="string")try{r=JSON.parse(t.data)}catch{return}this.isHello(r)?(this.selfId=r.self,this._playbackMode=typeof r.startTime<"u",this._message.next(r)):this.isResponse(r)?(typeof r.login<"u"&&typeof r.login.token<"u"&&(this._token=r.login.token),this._message.next(r)):this._filter&&this.isDelta(r)?r.context===this._filter&&this._message.next(r):this._message.next(r)}sendRequest(t){if(typeof t!="object")return"";let r=ee.request();return typeof t.login>"u"&&this._token&&(r.token=this._token),Object.keys(t).forEach(i=>{r[i]=t[i]}),this.send(r),r.requestId}put(t,r,n){let i={context:t==="self"?"vessels.self":t,put:{path:r,value:n}};return this.sendRequest(i)}login(t,r){let n={login:{username:t,password:r}};return this.sendRequest(n)}send(t){this.ws&&this.ws.send(typeof t=="object"?JSON.stringify(t):t)}sendUpdate(t="self",r,n){let i=ee.updates();this._token&&(i.token=this._token),i.context=t==="self"?"vessels.self":t,this._token&&(i.token=this._token);let s=[];typeof r=="string"&&s.push({path:r,value:n}),typeof r=="object"&&Array.isArray(r)&&(s=r);let o={timestamp:new Date().toISOString(),values:s};this._source&&(o.source=this._source),i.updates.push(o),this.send(i)}subscribe(t="*",r="*",n){let i=ee.subscribe();if(this._token&&(i.token=this._token),i.context=t==="self"?"vessels.self":t,this._token&&(i.token=this._token),typeof r=="object"&&Array.isArray(r)&&(i.subscribe=r),typeof r=="string"){let s={path:r};n&&typeof n=="object"&&(n.period&&(s.period=n.period),n.minPeriod&&(s.minPeriod=n.minPeriod),n.format&&(n.format==="delta"||n.format==="full")&&(s.format=n.format),n.policy&&(n.policy==="instant"||n.policy==="ideal"||n.policy==="fixed")&&(s.policy=n.policy)),i.subscribe.push(s)}this.send(i)}unsubscribe(t="*",r="*"){let n=ee.unsubscribe();this._token&&(n.token=this._token),n.context=t==="self"?"vessels.self":t,this._token&&(n.token=this._token),typeof r=="object"&&Array.isArray(r)&&(n.unsubscribe=r),typeof r=="string"&&n.unsubscribe.push({path:r}),this.send(n)}raiseAlarm(t="*",r,n){let i;typeof r=="string"?i=r.indexOf("notifications.")===-1?`notifications.${r}`:r:i=r,this.put(t,i,n.value)}clearAlarm(t="*",r){let n=r.indexOf("notifications.")===-1?`notifications.${r}`:r;this.put(t,n,null)}isSelf(t){return t.context===this.selfId}isDelta(t){return typeof t.context<"u"}isHello(t){return typeof t.version<"u"&&typeof t.self<"u"}isResponse(t){return typeof t.requestId<"u"}},ee=class{static updates(){return{context:null,updates:[]}}static subscribe(){return{context:null,subscribe:[]}}static unsubscribe(){return{context:null,unsubscribe:[]}}static request(){return{requestId:Qt()}}},qe=class{_state;_method=[];_message="";constructor(t,r,n,i){this._message=typeof t<"u"?t:"",this._state=typeof r<"u"?r:"alarm",n&&this._method.push("visual"),i&&this._method.push("sound")}get value(){return{message:this._message,state:this._state,method:this._method}}};var te=class{id;name;mmsi;position=[0,0];positionReceived=!1;positionTimestamp="";positionUpdatedAt=0;state;type={id:-1,name:""};properties={};lastUpdated=new Date;callsignVhf;callsignHf;orientation=0;virtual},ue=class extends te{anchor={maxRadius:null,radius:null,position:null};autopilot={state:null,mode:null,target:null,enabled:!1,default:null,availableActions:[]};buddy=!1;closestApproach={distance:null,timeTo:null};cog;cogTrue=null;cogMagnetic=null;courseApi={arrivalCircle:0,activeRoute:{},nextPoint:{},previousPoint:{}};courseCalcs={};distanceToSelf;environment={mode:null,sun:null};heading;headingTrue=null;headingMagnetic=null;headingTrueUpdatedAt=0;headingMagneticUpdatedAt=0;performance={beatAngle:null,gybeAngle:null};radars={};registrations={};resourceUpdates=[];sog;track=[];vectors={cog:[]};wind={direction:null,mwd:null,twd:null,tws:null,speedTrue:null,sog:null,awa:null,aws:null};design={airHeight:null,beam:null,draft:{current:null,maximum:null},length:null};destination={name:null,eta:null};flag;port},Le=class extends te{constructor(){super()}},Ee=class extends te{sog=0;track=[];constructor(){super()}},le=class extends te{constructor(){super()}},Ie=class extends le{twd;tws;temperature;constructor(){super()}};var er={K:{C:e=>e-273.15,F:e=>(e-273.15)*9/5+32},rad:{degree:e=>e*180/Math.PI},deg:{radian:e=>e*.0174532925199433},ratio:{percent:e=>e*100},"m/s":{kn:e=>e*1.94384,"km/h":e=>e*3.6,mph:e=>e*2.2369362920544025,Bf:e=>e/.836^.6666666666666666,fps:e=>e*3.280839895013124},"rad/s":{"deg/s":e=>e*57.2958,rpm:e=>e*9.549296585513723},Hz:{rpm:e=>e*60},m:{fathom:e=>e*.5467468562055768,league:e=>e*.0002071251035625518,kilometer:e=>e*.001,mile:e=>e*.000621371192237334,"naut-mile":e=>e*.0005399568034557236,foot:e=>e*3.280839895013124,yard:e=>e*1.0936132983377078},s:{hour:e=>e*.0002777777777777778,minute:e=>e*.016666666666666666,day:e=>e*11574074074074073e-21,year:e=>e*3168876461541279e-23},foot:{m:e=>e/3.280839895013124}},ce={degree:{symbol:"\xBA",name:"Degrees"},radian:{symbol:"rad",name:"Radians"},percent:{symbol:"%",name:"Percent"},kilometer:{symbol:"km",name:"Kilometer"},"naut-mile":{symbol:"nmi",name:"Nautical Mile"},foot:{symbol:"ft",name:"Feet"},yard:{symbol:"yd",name:"Yard"},fathom:{symbol:"fm",name:"Fathom"},hour:{symbol:"hr",name:"Hour"},minute:{symbol:"min",name:"Minute"},F:{symbol:"\xBAF",name:"Fahrenheit"},C:{symbol:"\xBAC",name:"Celcius"}},$=class{static transform(t,r,n){if(!Number.isFinite(t))return null;if(r===n)return t;try{return er[r][n](t)}catch{throw new Error("Transformation not found!")}}static setSymbol(t,r){t in ce&&(ce[t].symbol=r??ce[t].symbol)}static getSymbol(t){return t in ce?ce[t].symbol:t}static degreesToRadians(t){return er.deg.radian(t)}static radiansToDegrees(t=0){return er.rad.degree(t)}static nauticalMilesToKm(t=0){return t*1.852}static angleToDirection(t,r){let n=Math.PI*2;if(r||(r=0),t||(t=0),!Number.isFinite(r)||!Number.isFinite(t))return null;let i=r+t;return i>n?i-n:i<0?n+i:i}static directionToAngle(t,r){let n=Math.PI*2;if(r||(r=0),t||(t=0),!Number.isFinite(r)||!Number.isFinite(t))return null;let i=r-t,s;if(i>0)s=i>Math.PI?n-i:0-i;else if(i<0){let o=Math.abs(i);s=o>Math.PI?o-n:o}else s=i;return s}};var A=Br(ei()),j=class e{static R=6371e3;static rhumbDestination(t,r,n){let i=e.R,s=n/i,o=t[1]*Math.PI/180,a=t[0]*Math.PI/180,l=r,y=s*Math.cos(l),g=o+y,h=s,m=89*Math.PI/180;g>m&&o<m?(h=s*(m-o)/y,g=m):g<-m&&o>-m&&(h=s*(-m-o)/y,g=-m);let S=Math.log(Math.tan(Math.PI/4+g/2)/Math.tan(Math.PI/4+o/2)),v=Math.abs(S)>1e-12?(g-o)/S:Math.cos(o),T=h*Math.sin(l)/v;return[(a+T)*180/Math.PI,g*180/Math.PI]}static destCoordinate(t,r,n){let i=(0,A.computeDestinationPoint)(t,n,$.radiansToDegrees(r));return[i.longitude,i.latitude]}static distanceTo(t,r){return(0,A.getDistance)(t,r)}static routeLength(t){return(0,A.getPathLength)(t)}static routeLegs(t,r){if(t.length<2)return[];let n=[];r?n.push({bearing:(0,A.getGreatCircleBearing)(r,t[0]),distance:e.distanceTo(r,t[0])}):n.push({bearing:0,distance:0});for(let i=1;i<t.length;++i){let s={bearing:(0,A.getGreatCircleBearing)(t[i-1],t[i]),distance:e.distanceTo(t[i-1],t[i])};n.push(s)}return n}static closestForwardPoint(t,r,n){if(t.length<2||!r)return-1;let i={index:-1,distance:-1};for(let s=0;s<t.length;++s){let o=(0,A.getGreatCircleBearing)(r,t[s]),a=Pr.difference(n,o);if(a>-90&&a<90){let l=e.distanceTo(r,t[s]);(i.distance===-1||l<i.distance)&&(i.distance=l,i.index=s)}}return i.index}static centreOfPolygon(t){let r=(0,A.getCenter)(t);return[r.longitude,r.latitude]}static inDLCrossingZone(t,r=170){return Math.abs(t[0])>=r}static inBounds(t,r){return(0,A.isPointInPolygon)(t,[[r[0],r[1]],[r[0],r[3]],[r[2],r[3]],[r[2],r[1]],[r[0],r[1]]])}static calcMapifiedExtent(t,r){let i=111111*Math.cos($.degreesToRadians(t[1])),s=[0,0,0,0];return s[1]=t[1]+(0-Math.abs(r))/111111,s[3]=t[1]+Math.abs(r)/111111,s[0]=t[0]+(0-Math.abs(r))/i,s[2]=t[0]+Math.abs(r)/i,s}static normaliseCoords(t){if(!Array.isArray(t))return[0,0];if(typeof t[0]=="number"){if(t[0]>180)for(;t[0]>180;)t[0]=t[0]-360;else if(t[0]<-180)for(;t[0]<-180;)t[0]=360+t[0];return t}else if(Array.isArray(t[0]))return t.forEach(r=>this.normaliseCoords(r)),t}},Pr=class e{static difference(t,r){let n=360-r,i=t+n,s=e.normalise(i);return s<180?0-s:360-s}static add(t,r){return e.normalise(t+r)}static normalise(t){return t<0?t+360:t>=360?t-360:t}};var Et=class{action="notification";playback=!1;result=null;self=null;timestamp=new Date().toISOString();sourceRef},z=class{action;playback=!1;result=null;timestamp;self=null;watchDogAlarm;constructor(){this.action="update"}},It=class extends z{constructor(){super(),this.action="resource"}},Nt=class extends z{constructor(){super(),this.action="radar"}},jt=class extends z{constructor(){super(),this.action="trail"}};var mi=Br(ii());var oi="auto",si=1e4,Ra=.2572,ai=new Set(["navigation.headingTrue","navigation.headingMagnetic","navigation.courseOverGroundTrue","navigation.courseOverGroundMagnetic","navigation.speedOverGround"]);function ui(e){let t=Date.now();if(e.headingTrue!==null&&t-e.headingTrueUpdatedAt<=si){e.orientation=e.headingTrue;return}if(e.headingMagnetic!==null&&t-e.headingMagneticUpdatedAt<=si){e.orientation=e.headingMagnetic;return}let r=e.cogTrue??e.cogMagnetic;typeof r=="number"&&(e.sog??0)>=Ra&&(e.orientation=r)}var wa=["environment.wind.speedTrue","environment.wind.speedOverGround","environment.wind.angleTrueGround","environment.wind.angleTrueWater","environment.wind.directionTrue","environment.wind.directionMagnetic","navigation.courseOverGroundTrue","navigation.courseOverGroundMagnetic","navigation.headingTrue","navigation.headingMagnetic"],b={active:!1,maxMsgIntervals:18,intervalCount:0,msgCount:0,alarm:!1},f,M,pi,Me=[],Ut=[],Lr=!1,Nr,Er=!1,x={signalk:{},aisState:[]},gi=[0,0,0,0],hi=60,xe=0,O,ie={},Z=500,q=!1,bi,U={maxAge:54e4,staleAge:36e4,lastTick:new Date().valueOf(),maxTrack:20},Ir={selfLines:{cog:{length:10}},aisCogLine:10},ye={trailDuration:24,trailResolution:{lastHour:"5s",next23:"10s",beyond24:"1m"}},V,vi,ne="freeboard-sk";function Ca(){f={self:new ue,aisTargets:new Map,aisStatus:{updated:[],stale:[],expired:[]},paths:{},atons:new Map,aircraft:new Map,sar:new Map,meteo:new Map},f.self.positionReceived=!1,xi()}function xi(){O={updated:{},stale:{},expired:{}}}function Kt({action:e,msg:t}){switch(e){case"onConnect":postMessage({action:"open",playback:q,result:t.target.readyState}),b.msgCount=0,b.intervalCount=0,b.alarm=!1,b.active=!0;break;case"onClose":yi(!1),li();break;case"onError":postMessage({action:"error",playback:q,result:"Connection error!"}),li();break;case"onMessage":b.msgCount++,Ia(t);break}}function li(){b.msgCount=0,b.intervalCount=0,b.active=!0,b.alarm=!0,Vt(!0)}addEventListener("message",({data:e})=>{ka(e)});function ka(e){if(e.cmd)switch(e.cmd){case"open":ci(e.options),La(e.options);break;case"close":yi(!0);break;case"subscribe":M.subscribe(e.options.context,e.options.path);break;case"settings":ci(e.options);break;case"alarm":Ea(e.options);break;case"vessel":if(e.options){let t;e.options.context==="self"?t=f.self:t=f.aisTargets.get(e.options.context),t&&e.options.name&&(t.name=e.options.name)}break;case"auth":e.options&&typeof e.options.token<"u"&&(pi=e.options.token);break;case"trail":e.options&&(ye.trailDuration=e.options.trailDuration??24,e.options.trailResolution&&(ye.trailResolution.lastHour=e.options.trailResolution.lastHour??"5s",ye.trailResolution.next23=e.options.trailResolution.next23??"1m",ye.trailResolution.beyond24=e.options.trailResolution.beyond24??"5m")),qa(ye);break}}function ci(e={}){e.interval&&typeof e.interval=="number"&&(Z=e.interval,Si(),Mi(),hi=1/(Z/1e3)*60),q=!!e.playback,e.config&&(typeof e.config.units.preferredPaths<"u"&&(ie=e.config.units.preferredPaths),e.config.vessels.aisMaxAge&&typeof e.config.vessels.aisMaxAge=="number"&&(U.maxAge=e.config.vessels.aisMaxAge),e.config.vessels.aisStaleAge&&typeof e.config.vessels.aisStaleAge=="number"&&(U.staleAge=e.config.vessels.aisStaleAge),typeof e.config.signalk.maxRadius=="number"&&(x.signalk=e.config.signalk),typeof e.config.selections.aisState<"u"&&Array.isArray(e.config.selections.aisState)&&(x.aisState=e.config.selections.aisState),Ir=e.config.vessels)}function yi(e=!1){Si(),Me.forEach(t=>t.unsubscribe()),M&&e&&M.close(),M=null,postMessage({action:"close",result:e,playback:q})}function Se(e){return fetch(e).then(t=>t.json())}function _i(){let e=x&&x.signalk&&x.signalk.maxRadius?`?radius=${x.signalk.maxRadius}`:"?radius=10000";Se(Nr+"/tracks"+e).then(t=>{Er=!0,Object.entries(t).forEach(r=>{if(f.aisTargets.has(r[0])){let n=f.aisTargets.get(r[0]);n.track=r[1].coordinates,jr(n)}})}).catch(()=>{Er=!1})}function qa(e){let t=Nr+"/self/track?",r=[],n=5e-4,i=!0;e.trailDuration>24&&(r.push(Se(`${t}timespan=${e.trailDuration-24}h&resolution=${e.trailResolution.beyond24}×panOffset=24`)),r.push(Se(`${t}timespan=23h&resolution=${e.trailResolution.next23}×panOffset=1`))),e.trailDuration>1&&e.trailDuration<25&&r.push(Se(`${t}timespan=${e.trailDuration-1}h&resolution=${e.trailResolution.next23}×panOffset=1`)),r.push(Se(`${t}timespan=1h&resolution=${e.trailResolution.lastHour}`));let s=[],o=new jt;o.playback=q,Promise.all(r).then(a=>{let l=0,y=r.length-1,g=60;a.forEach(h=>{if(h.type&&h.type==="MultiLineString"&&h.coordinates&&Array.isArray(h.coordinates))if(l!==y){let m=[];for(h.coordinates.forEach(S=>{m=m.concat(S)}),m=(0,mi.SimplifyAP)(m,n,i);m.length>g;){let S=m.slice(0,g);s.push(S),m=m.slice(g-1),m[0]=[m[0][0]+5e-9,m[0][1]+5e-9]}m.length!==0&&s.push(m)}else s=s.concat(h.coordinates);l++}),o.result=s,postMessage(o)}).catch(()=>{o.result=null,postMessage(o)})}function La(e){if(M)return;if(!e.url){postMessage({action:"error",result:"Valid options not provided!"});return}let t=e.url.split("/");if(t.pop(),t.push("api"),t[0]=t[0]==="wss:"?"https:":"http:",Nr=t.join("/"),Ca(),M=new ke,Me.push(M.onConnect.subscribe(r=>Kt({action:"onConnect",msg:r}))),Me.push(M.onClose.subscribe(r=>Kt({action:"onClose",msg:r}))),Me.push(M.onError.subscribe(r=>Kt({action:"onError",msg:r}))),Me.push(M.onMessage.subscribe(r=>Kt({action:"onMessage",msg:r}))),M.authToken=pi,e.playback){let r=e.playbackOptions.startTime?`?startTime=${e.playbackOptions.startTime}`:null,n=e.playbackOptions.playbackRate?`playbackRate=${e.playbackOptions.playbackRate}`:null;n=n?r?"&"+n:"?"+n:null;let i=`${e.url}${r||""}${n||""}`;M.open(i,e.playbackOptions.subscribe,e.token)}else M.open(e.url,e.subscribe,e.token),_i()}function Ea(e){let t=e.type.indexOf("notifications.")===-1?`notifications.${e.type}`:e.type;e.raise?M.raiseAlarm("self",t,new qe(e.message,e.state,!0,!0)):M.clearAlarm("self",t)}function Ia(e){M.isHello(e)?(postMessage({action:"hello",result:e,self:e.self,playback:q}),Z&&Mi()):M.isDelta(e)?(Lr=!0,e.updates.forEach(t=>{!("values"in t)||!t.values||(V=t.$source,vi=t.timestamp,t.values.forEach(r=>{if(bi=t.timestamp,!!e.context)switch(e.context.split(".")[0]){case"shore":case"atons":x?.signalk.atons&&Va(e.context,r),_e(e.context,f.atons,x?.signalk.atons);break;case"sar":x?.signalk.sar&&Fa(e.context,r),_e(e.context,f.sar,x?.signalk.sar);break;case"aircraft":x?.signalk.aircraft&&Ba(e.context,r),_e(e.context,f.aircraft,x?.signalk.aircraft);break;case"meteo":x?.signalk.meteo&&(Wa(e.context,r),di(r)),_e(e.context,f.meteo,x?.signalk.meteo);break;case"vessels":if(M.isSelf(e))f.self.id||(f.self.id=e.context),fi(f.self,r,!0),di(r);else{if(x?.signalk.vessels){let n=Na(e.context);fi(n,r)}_e(e.context,f.aisTargets,x?.signalk.vessels,x?.aisState)}break}}))}),Vt()):M.isResponse(e)&&postMessage({action:"response",result:e})}function _e(e,t,r=!0,n=[]){if(r){let i=t.get(e);i&&n.includes(i?.state)&&(O.expired[e]=!0,i=null),i&&x.signalk.maxRadius?i.positionReceived&&j.inBounds(i.position,gi)?O.updated[e]=!0:(t.delete(e),O.expired[e]=!0):O.updated[e]=!0}else t.size!==0&&(t.forEach((i,s)=>{O.expired[s]=!0}),t.clear())}function Vt(e=!1){if(!Z||e){let t=new z;t.watchDogAlarm=b.alarm,t.playback=q,f.aisStatus.updated=Object.keys(O.updated),f.aisStatus.stale=Object.keys(O.stale),f.aisStatus.expired=Object.keys(O.expired),t.result=f,t.timestamp=q?bi:f.self.lastUpdated.toISOString(),postMessage(t),xi(),f.self.resourceUpdates=[],Ua(),xe===0&&f.self.positionReceived&&x?.signalk.maxRadius&&(gi=j.calcMapifiedExtent(f.self.position,x.signalk.maxRadius),xe++),xe=xe>=hi?0:xe+1}}function Mi(){Z&&typeof Z=="number"&&Ut.push(setInterval(()=>{b.active&&!b.msgCount?(b.intervalCount=b.intervalCount+1,b.intervalCount>=b.maxMsgIntervals&&(b.intervalCount=0,b.alarm=!0,Vt(!0))):(b.intervalCount=0,b.msgCount=0,b.alarm=!1),Lr&&(Vt(!0),Lr=!1)},Z)),Ut.push(setInterval(()=>{Er&&_i()},6e4))}function Si(){Ut.forEach(e=>clearInterval(e)),Ut=[]}function Na(e){if(!f.aisTargets.has(e)){let t=new ue;t.id=e,t.position=null,f.aisTargets.set(e,t)}return f.aisTargets.get(e)}function fi(e,t,r=!1){let n=t.value;if(r){if(e.lastUpdated=new Date,t.path.startsWith("resources."))e.resourceUpdates.push(t),Ka(t);else if(t.path.startsWith("radars"))ja(t);else if(t.path.startsWith("navigation.racing"))e.properties[t.path]=n;else if(t.path==="performance.beatAngle")e.performance.beatAngle=n;else if(t.path==="performance.gybeAngle")e.performance.gybeAngle=n;else if(t.path.startsWith("navigation.course."))if(t.path.startsWith("navigation.course.calcValues.")){let a=t.path.split(".").slice(3).join(".");e.courseCalcs[a]=n}else t.path.includes("activeRoute")?e.courseApi.activeRoute=n:t.path.includes("nextPoint")?e.courseApi.nextPoint=n:t.path.includes("previousPoint")?e.courseApi.previousPoint=n:t.path.includes("arrivalCircle")&&(e.courseApi.arrivalCircle=n);else if(t.path.startsWith("radars.")){let a=t.path.split("."),l=a.slice(2).join(".");e.radars[a[1]]||(e.radars[a[1]]={}),e.radars[a[1]][l]=n}let o=t.path.indexOf("course")!==-1?t.path.split(".").slice(0,2).join("."):t.path;wa.indexOf(o)!==-1&&(f.paths[o]=null)}else t.path==="navigation.distanceToSelf"&&(e.distanceToSelf=n),t.path==="navigation.closestApproach"&&(e.closestApproach=n);if(t.path==="")typeof n.name<"u"&&(e.name=n.name),typeof n.mmsi<"u"&&(e.mmsi=n.mmsi,e.lastUpdated=new Date),typeof n.registrations<"u"&&(e.registrations=n.registrations),typeof n.buddy<"u"&&(e.buddy=n.buddy),typeof n.communication<"u"&&(e.callsignVhf=n.communication.callsignVhf??"",e.callsignHf=n.communication.callsignHf??"");else if(t.path==="communication.callsignVhf")e.callsignVhf=n;else if(t.path==="communication.callsignHf")e.callsignHf=n;else if(t.path==="design.aisShipType")e.type=n;else if(t.path==="navigation.position"&&n){if(typeof n.latitude>"u"||typeof n.longitude>"u")return;e.position=j.normaliseCoords([n.longitude,n.latitude]),e.positionReceived=!0,e.positionTimestamp=vi??"",e.positionUpdatedAt=Date.now(),e.lastUpdated=new Date,r||jr(e)}else t.path==="navigation.state"?e.state=n:t.path==="navigation.speedOverGround"?e.sog=n:t.path==="environment.mode"?e.environment.mode=n:t.path==="environment.sun"?e.environment.sun=n:t.path==="environment.wind.angleApparent"?e.wind.awa=n:t.path==="environment.wind.speedApparent"?e.wind.aws=n:t.path==="environment.wind.speedTrue"?e.wind.speedTrue=n:t.path==="environment.wind.speedOverGround"?e.wind.sog=n:t.path==="environment.wind.directionTrue"?e.wind.twd=n:t.path==="environment.wind.directionMagnetic"?e.wind.mwd=n:t.path==="navigation.anchor.position"?e.anchor.position=n:t.path==="navigation.anchor.maxRadius"?e.anchor.maxRadius=n:t.path==="navigation.anchor.currentRadius"?e.anchor.radius=n:t.path==="steering.autopilot.state"&&V===ne?e.autopilot.state=n:t.path==="steering.autopilot.mode"&&V===ne?e.autopilot.mode=n:t.path==="steering.autopilot.target"&&V===ne?e.autopilot.target=n:t.path==="steering.autopilot.engaged"&&V===ne?e.autopilot.enabled=n:t.path==="steering.autopilot.defaultPilot"?(e.autopilot.default=n,ne=n):t.path==="steering.autopilot.availableActions"&&V===ne?e.autopilot.availableActions=n??[]:t.path==="navigation.courseOverGroundTrue"?e.cogTrue=n:t.path==="navigation.courseOverGroundMagnetic"?e.cogMagnetic=n:t.path==="navigation.headingTrue"?(e.headingTrue=n,e.headingTrueUpdatedAt=Date.now()):t.path==="navigation.headingMagnetic"&&(e.headingMagnetic=n,e.headingMagneticUpdatedAt=Date.now());let i=ie.heading;typeof i>"u"||i===oi?ai.has(t.path)&&ui(e):t.path===i&&(e.orientation=n),typeof ie.tws<"u"&&t.path===ie.tws&&(e.wind.tws=n),typeof ie.twd<"u"&&t.path===ie.twd&&(e.wind.direction=t.path==="environment.wind.angleTrueGround"||t.path==="environment.wind.angleTrueWater"?$.angleToDirection(n,e.orientation??0):n);let s=e.cogTrue??e.cogMagnetic??void 0;if(typeof s<"u"&&e.position){let o=r?Ir.selfLines.cog.length:Ir.aisCogLine,a=(e.sog??0)*(o*60);e.vectors.cog=[e.position,j.rhumbDestination(e.position,s,a)]}}function ja(e){let t=new Nt;t.playback=q,t.result={path:e.path,value:e.value,sourceRef:V},postMessage(t)}function Ka(e){let t=new It;t.playback=q,t.result={path:e.path,value:e.value,sourceRef:V},postMessage(t)}function di(e){if(e.path.includes("notifications.")){let t=new Et;t.playback=q,t.result={path:e.path,value:e.value,sourceRef:V},postMessage(t)}}function Ua(){let e=new Date().valueOf();f.aisTargets.forEach((t,r)=>{t.lastUpdated.valueOf()<e-U.maxAge?(O.expired[r]=!0,f.aisTargets.delete(r)):t.lastUpdated.valueOf()<e-U.staleAge&&(O.stale[r]=!0)}),f.aircraft.forEach((t,r)=>{t.lastUpdated.valueOf()<e-U.maxAge?(O.expired[r]=!0,f.aircraft.delete(r)):t.lastUpdated.valueOf()<e-U.staleAge&&(O.stale[r]=!0)}),f.sar.forEach((t,r)=>{t.lastUpdated.valueOf()<e-U.maxAge?(O.expired[r]=!0,f.sar.delete(r)):t.lastUpdated.valueOf()<e-U.staleAge&&(O.stale[r]=!0)})}function Va(e,t){let r=!1;if(e.indexOf("shore.basestations")!==-1&&(r=!0),!f.atons.has(e)){let i=new le;i.id=e,i.position=null,i.type.id=null,r&&(i.type.id=-2,i.type.name="Basestation"),f.atons.set(e,i)}let n=f.atons.get(e);return t.path===""?(typeof t.value.name<"u"&&(n.name=t.value.name),typeof t.value.mmsi<"u"&&(n.mmsi=t.value.mmsi),typeof t.value.atonType<"u"&&(n.type=t.value.atonType)):t.path==="atonType"?n.type=t.value:t.path==="virtual"?n.virtual=t.value:t.path==="navigation.position"?(n.position=[t.value.longitude,t.value.latitude],n.positionReceived=!0):n.properties[t.path]=t.value,e}function Fa(e,t){if(!f.sar.has(e)){let n=new Le;n.id=e,n.position=null,n.type.id=-1,n.type.name="SaR Beacon",f.sar.set(e,n)}let r=f.sar.get(e);t.path===""?(typeof t.value.name<"u"&&(r.name=t.value.name),typeof t.value.mmsi<"u"&&(r.mmsi=t.value.mmsi),typeof t.value.communication<"u"&&(r.callsignVhf=t.value.communication.callsignVhf??"",r.callsignHf=t.value.communication.callsignHf??"")):t.path==="communication.callsignVhf"?r.callsignVhf=t.value:t.path==="communication.callsignHf"?r.callsignHf=t.value:t.path==="navigation.position"&&t.value&&(r.position=j.normaliseCoords([t.value.longitude,t.value.latitude]),r.positionReceived=!0)}function Wa(e,t){if(!f.meteo.has(e)){let n=new Ie;n.id=e,n.position=null,n.type.id=-1,n.type.name="Weather Station",f.meteo.set(e,n)}let r=f.meteo.get(e);if(t.path===""){if(typeof t.value.name<"u"&&(r.name=t.value.name),typeof t.value.mmsi<"u"){let n=e.split(":").slice(-2);r.mmsi=n.length===2?`${n[0]}:${n[1]}`:t.value.mmsi}typeof t.value.communication<"u"&&(r.callsignVhf=t.value.communication.callsignVhf??"",r.callsignHf=t.value.communication.callsignHf??"")}else t.path==="communication.callsignVhf"?r.callsignVhf=t.value:t.path==="communication.callsignHf"?r.callsignHf=t.value:t.path==="environment.outside.temperature"?r.temperature=t.value:t.path==="environment.wind.directionTrue"?r.twd=t.value:t.path==="environment.wind.averageSpeed"?r.tws=t.value:t.path==="navigation.position"&&t.value&&(r.position=j.normaliseCoords([t.value.longitude,t.value.latitude]),r.positionReceived=!0)}function Ba(e,t){if(!f.aircraft.has(e)){let n=new Ee;n.id=e,n.position=null,f.aircraft.set(e,n)}let r=f.aircraft.get(e);t.path===""?(typeof t.value.name<"u"&&(r.name=t.value.name),typeof t.value.mmsi<"u"&&(r.mmsi=t.value.mmsi),typeof t.value.communication<"u"&&(r.callsignVhf=t.value.communication.callsignVhf??"",r.callsignHf=t.value.communication.callsignHf??"")):t.path==="communication.callsignVhf"?r.callsignVhf=t.value:t.path==="communication.callsignHf"?r.callsignHf=t.value:t.path==="navigation.position"&&t.value?(r.position=j.normaliseCoords([t.value.longitude,t.value.latitude]),r.positionReceived=!0,jr(r)):t.path==="navigation.courseOverGroundTrue"?r.orientation=t.value:t.path==="navigation.speedOverGround"&&(r.sog=t.value)}function jr(e){if(e.track&&e.track.length===0)e.track.push([e.position]);else{let t=e.track[e.track.length-1].length,r=e.track[e.track.length-1][t-1];r[0]!==e.position[0]&&r[1]!==e.position[1]&&e.track[e.track.length-1].push(e.position)}e.track[e.track.length-1]=e.track[e.track.length-1].slice(0-U.maxTrack)}export{Se as apiGet,Kt as handleStreamEvent,Ca as initVessels,fi as processVessel};
|