@signalk/freeboard-sk 3.2.0 → 3.3.0-beta.0
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/README.md +276 -276
- package/package.json +18 -14
- package/plugin/vitest.config.mjs +1 -0
- package/public/assets/features/anchor-watch-1.jpg +0 -0
- package/public/assets/features/anchor-watch-2.jpg +0 -0
- package/public/assets/features/anchor-watch-3.jpg +0 -0
- package/public/assets/features/collision-alarm-display-1.jpg +0 -0
- package/public/assets/features/collision-alarm-display-2.jpg +0 -0
- package/public/assets/features/extension-panels-3.jpg +0 -0
- package/public/assets/features/radar-guard-zones-1.jpg +0 -0
- package/public/assets/features/radar-guard-zones-2.jpg +0 -0
- package/public/assets/features/radar-overlay-2.jpg +0 -0
- package/public/assets/features/radar-overlay-3.jpg +0 -0
- package/public/assets/features/route-planning-3.jpg +0 -0
- package/public/assets/features/route-planning-4.jpg +0 -0
- package/public/assets/features-corpus.json +1 -1
- package/public/assets/help/index.html +53 -124
- package/public/{chunk-D4A5NW5G.js → chunk-45ZTFAA5.js} +1 -1
- package/public/{chunk-4UBQTQSK.js → chunk-62WHV6CJ.js} +11 -11
- package/public/{chunk-6ZXMFU55.js → chunk-67S2RK5V.js} +1 -1
- package/public/{chunk-BJKB23AZ.js → chunk-6E2BDKCH.js} +1 -1
- package/public/{chunk-VQDXDSU7.js → chunk-AQKT2J2C.js} +1 -1
- package/public/chunk-BXGNCKBA.js +1 -0
- package/public/chunk-F4EUFUYM.js +4097 -0
- package/public/chunk-I33LU6L4.js +1 -0
- package/public/{chunk-YB4RBYE2.js → chunk-IGMXHN4X.js} +1 -1
- package/public/{chunk-RRYFRHFP.js → chunk-ISXARX6U.js} +1 -1
- package/public/chunk-J6MIIPAV.js +1 -0
- package/public/{chunk-7OBOGNNY.js → chunk-MX5HWKAH.js} +1 -1
- package/public/{chunk-5SYZI253.js → chunk-MYBGWSLC.js} +1 -1
- package/public/chunk-OBOT3EYE.js +1 -0
- package/public/chunk-OKVIYJ6A.js +1 -0
- package/public/{chunk-OVB2ZLN5.js → chunk-PAHYECKY.js} +1 -1
- package/public/{chunk-BNCDJR4Z.js → chunk-PD55PKQG.js} +2 -2
- package/public/chunk-QIIV7CZB.js +1 -0
- package/public/{chunk-BCS6VHKX.js → chunk-RG7WQ7O2.js} +15 -15
- package/public/chunk-S2NZQZZH.js +1 -0
- package/public/{chunk-R7YVRRY3.js → chunk-T7ZWMXKZ.js} +1 -1
- package/public/{chunk-GBMW6IJP.js → chunk-X6D4D6EN.js} +1 -1
- package/public/{chunk-USYMWMPO.js → chunk-YSHHABBQ.js} +1 -1
- package/public/{chunk-XZM7Q5WP.js → chunk-YZN4NRWW.js} +1 -1
- package/public/{chunk-P57WKW3G.js → chunk-Z2D7B2ZG.js} +1 -1
- package/public/index.html +2 -2
- package/public/main-S6QEWGOY.js +468 -0
- package/public/{styles-YRQUZIIZ.css → styles-BRU77GKR.css} +1 -1
- package/public/worker-E75PSRY4.js +12 -0
- package/public/worker-PCWM7FLK.js +3 -0
- package/public/{worker-BFPH3XRP.js → worker-UJD2XPGR.js} +6 -6
- package/public/worker-W3UMLYIU.js +12 -0
- package/public/chunk-A2UDMCI5.js +0 -1
- package/public/chunk-EDKY4MXN.js +0 -1
- package/public/chunk-GFDZNVNU.js +0 -4372
- package/public/chunk-H54CRRPU.js +0 -1
- package/public/chunk-HT6GODHM.js +0 -1
- package/public/chunk-RQKGK2KO.js +0 -1
- package/public/chunk-UBTZRPVO.js +0 -1
- package/public/chunk-XXGLBGHG.js +0 -1
- package/public/main-LYWXFV5I.js +0 -468
- package/public/worker-5LIQ6F6U.js +0 -12
- package/public/worker-DYC3TMVW.js +0 -3
- package/public/worker-SUE26ZZI.js +0 -12
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
var Gr=Object.create;var Jt=Object.defineProperty;var Yr=Object.getOwnPropertyDescriptor;var Kr=Object.getOwnPropertyNames;var zr=Object.getPrototypeOf,Hr=Object.prototype.hasOwnProperty;var F=(o,r)=>()=>{try{return r||o((r={exports:{}}).exports,r),r.exports}catch(c){throw r=0,c}};var Qr=(o,r,c,g)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of Kr(r))!Hr.call(o,a)&&a!==c&&Jt(o,a,{get:()=>r[a],enumerable:!(g=Yr(r,a))||g.enumerable});return o};var Zr=(o,r,c)=>(c=o!=null?Gr(zr(o)):{},Qr(r||!o||!o.__esModule?Jt(c,"default",{value:o,enumerable:!0}):c,o));var dt=F(qt=>{(function(){qt.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(qt)});var $=F((te,nt)=>{(function(){var o,r,c,g,a,d,u,l=[].slice,m={}.hasOwnProperty;o=function(){var T,N,I,E,p,w;if(w=arguments[0],p=2<=arguments.length?l.call(arguments,1):[],a(Object.assign))Object.assign.apply(null,arguments);else for(T=0,I=p.length;T<I;T++)if(E=p[T],E!=null)for(N in E)m.call(E,N)&&(w[N]=E[N]);return w},a=function(T){return!!T&&Object.prototype.toString.call(T)==="[object Function]"},d=function(T){var N;return!!T&&((N=typeof T)=="function"||N==="object")},c=function(T){return a(Array.isArray)?Array.isArray(T):Object.prototype.toString.call(T)==="[object Array]"},g=function(T){var N;if(c(T))return!T.length;for(N in T)if(m.call(T,N))return!1;return!0},u=function(T){var N,I;return d(T)&&(I=Object.getPrototypeOf(T))&&(N=I.constructor)&&typeof N=="function"&&N instanceof N&&Function.prototype.toString.call(N)===Function.prototype.toString.call(Object)},r=function(T){return a(T.valueOf)?T.valueOf():T},nt.exports.assign=o,nt.exports.isFunction=a,nt.exports.isObject=d,nt.exports.isArray=c,nt.exports.isEmpty=g,nt.exports.isPlainObject=u,nt.exports.getValue=r}).call(te)});var Rt=F((ee,re)=>{(function(){var o;re.exports=o=(function(){function r(){}return r.prototype.hasFeature=function(c,g){return!0},r.prototype.createDocumentType=function(c,g,a){throw new Error("This DOM method is not implemented.")},r.prototype.createDocument=function(c,g,a){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,g){throw new Error("This DOM method is not implemented.")},r})()}).call(ee)});var oe=F((ie,ne)=>{(function(){var o;ne.exports=o=(function(){function r(){}return r.prototype.handleError=function(c){throw new Error(c)},r})()}).call(ie)});var ae=F((se,ue)=>{(function(){var o;ue.exports=o=(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(se)});var fe=F((ce,le)=>{(function(){var o,r,c;r=oe(),c=ae(),le.exports=o=(function(){function g(){var a;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=a=Object.create(this.defaultParams)}return Object.defineProperty(g.prototype,"parameterNames",{get:function(){return new c(Object.keys(this.defaultParams))}}),g.prototype.getParameter=function(a){return this.params.hasOwnProperty(a)?this.params[a]:null},g.prototype.canSetParameter=function(a,d){return!0},g.prototype.setParameter=function(a,d){return d!=null?this.params[a]=d:delete this.params[a]},g})()}).call(ce)});var W=F((he,pe)=>{(function(){pe.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(he)});var jt=F((de,ye)=>{(function(){var o,r,c;o=W(),c=Q(),ye.exports=r=(function(){function g(a,d,u){if(this.parent=a,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),d==null)throw new Error("Missing attribute name. "+this.debugInfo(d));this.name=this.stringify.name(d),this.value=this.stringify.attValue(u),this.type=o.Attribute,this.isId=!1,this.schemaTypeInfo=null}return Object.defineProperty(g.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(g.prototype,"ownerElement",{get:function(){return this.parent}}),Object.defineProperty(g.prototype,"textContent",{get:function(){return this.value},set:function(a){return this.value=a||""}}),Object.defineProperty(g.prototype,"namespaceURI",{get:function(){return""}}),Object.defineProperty(g.prototype,"prefix",{get:function(){return""}}),Object.defineProperty(g.prototype,"localName",{get:function(){return this.name}}),Object.defineProperty(g.prototype,"specified",{get:function(){return!0}}),g.prototype.clone=function(){return Object.create(this)},g.prototype.toString=function(a){return this.options.writer.attribute(this,this.options.writer.filterOptions(a))},g.prototype.debugInfo=function(a){return a=a||this.name,a==null?"parent: <"+this.parent.name+">":"attribute: {"+a+"}, parent: <"+this.parent.name+">"},g.prototype.isEqualNode=function(a){return!(a.namespaceURI!==this.namespaceURI||a.prefix!==this.prefix||a.localName!==this.localName||a.value!==this.value)},g})()}).call(de)});var yt=F((me,ge)=>{(function(){var o;ge.exports=o=(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 g;return g=this.nodes[c.nodeName],this.nodes[c.nodeName]=c,g||null},r.prototype.removeNamedItem=function(c){var g;return g=this.nodes[c],delete this.nodes[c],g||null},r.prototype.item=function(c){return this.nodes[Object.keys(this.nodes)[c]]||null},r.prototype.getNamedItemNS=function(c,g){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,g){throw new Error("This DOM method is not implemented.")},r})()}).call(me)});var mt=F((we,Te)=>{(function(){var o,r,c,g,a,d,u,l,m,T=function(I,E){for(var p in E)N.call(E,p)&&(I[p]=E[p]);function w(){this.constructor=I}return w.prototype=E.prototype,I.prototype=new w,I.__super__=E.prototype,I},N={}.hasOwnProperty;m=$(),l=m.isObject,u=m.isFunction,d=m.getValue,a=Q(),o=W(),r=jt(),g=yt(),Te.exports=c=(function(I){T(E,I);function E(p,w,b){var P,A,_,h;if(E.__super__.constructor.call(this,p),w==null)throw new Error("Missing element name. "+this.debugInfo());if(this.name=this.stringify.name(w),this.type=o.Element,this.attribs={},this.schemaTypeInfo=null,b!=null&&this.attribute(b),p.type===o.Document&&(this.isRoot=!0,this.documentObject=p,p.rootObject=this,p.children)){for(h=p.children,A=0,_=h.length;A<_;A++)if(P=h[A],P.type===o.DocType){P.name=this.name;break}}}return Object.defineProperty(E.prototype,"tagName",{get:function(){return this.name}}),Object.defineProperty(E.prototype,"namespaceURI",{get:function(){return""}}),Object.defineProperty(E.prototype,"prefix",{get:function(){return""}}),Object.defineProperty(E.prototype,"localName",{get:function(){return this.name}}),Object.defineProperty(E.prototype,"id",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(E.prototype,"className",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(E.prototype,"classList",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(E.prototype,"attributes",{get:function(){return(!this.attributeMap||!this.attributeMap.nodes)&&(this.attributeMap=new g(this.attribs)),this.attributeMap}}),E.prototype.clone=function(){var p,w,b,P;b=Object.create(this),b.isRoot&&(b.documentObject=null),b.attribs={},P=this.attribs;for(w in P)N.call(P,w)&&(p=P[w],b.attribs[w]=p.clone());return b.children=[],this.children.forEach(function(A){var _;return _=A.clone(),_.parent=b,b.children.push(_)}),b},E.prototype.attribute=function(p,w){var b,P;if(p!=null&&(p=d(p)),l(p))for(b in p)N.call(p,b)&&(P=p[b],this.attribute(b,P));else u(w)&&(w=w.apply()),this.options.keepNullAttributes&&w==null?this.attribs[p]=new r(this,p,""):w!=null&&(this.attribs[p]=new r(this,p,w));return this},E.prototype.removeAttribute=function(p){var w,b,P;if(p==null)throw new Error("Missing attribute name. "+this.debugInfo());if(p=d(p),Array.isArray(p))for(b=0,P=p.length;b<P;b++)w=p[b],delete this.attribs[w];else delete this.attribs[p];return this},E.prototype.toString=function(p){return this.options.writer.element(this,this.options.writer.filterOptions(p))},E.prototype.att=function(p,w){return this.attribute(p,w)},E.prototype.a=function(p,w){return this.attribute(p,w)},E.prototype.getAttribute=function(p){return this.attribs.hasOwnProperty(p)?this.attribs[p].value:null},E.prototype.setAttribute=function(p,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.getAttributeNode=function(p){return this.attribs.hasOwnProperty(p)?this.attribs[p]:null},E.prototype.setAttributeNode=function(p){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.removeAttributeNode=function(p){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.getElementsByTagName=function(p){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.getAttributeNS=function(p,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.setAttributeNS=function(p,w,b){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.removeAttributeNS=function(p,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.getAttributeNodeNS=function(p,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.setAttributeNodeNS=function(p){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.getElementsByTagNameNS=function(p,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.hasAttribute=function(p){return this.attribs.hasOwnProperty(p)},E.prototype.hasAttributeNS=function(p,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.setIdAttribute=function(p,w){return this.attribs.hasOwnProperty(p)?this.attribs[p].isId:w},E.prototype.setIdAttributeNS=function(p,w,b){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.setIdAttributeNode=function(p,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.getElementsByTagName=function(p){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.getElementsByTagNameNS=function(p,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.getElementsByClassName=function(p){throw new Error("This DOM method is not implemented."+this.debugInfo())},E.prototype.isEqualNode=function(p){var w,b,P;if(!E.__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(w=b=0,P=this.attribs.length-1;0<=P?b<=P:b>=P;w=0<=P?++b:--b)if(!this.attribs[w].isEqualNode(p.attribs[w]))return!1;return!0},E})(a)}).call(we)});var ft=F((Ee,De)=>{(function(){var o,r,c=function(a,d){for(var u in d)g.call(d,u)&&(a[u]=d[u]);function l(){this.constructor=a}return l.prototype=d.prototype,a.prototype=new l,a.__super__=d.prototype,a},g={}.hasOwnProperty;r=Q(),De.exports=o=(function(a){c(d,a);function d(u){d.__super__.constructor.call(this,u),this.value=""}return Object.defineProperty(d.prototype,"data",{get:function(){return this.value},set:function(u){return this.value=u||""}}),Object.defineProperty(d.prototype,"length",{get:function(){return this.value.length}}),Object.defineProperty(d.prototype,"textContent",{get:function(){return this.value},set:function(u){return this.value=u||""}}),d.prototype.clone=function(){return Object.create(this)},d.prototype.substringData=function(u,l){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.appendData=function(u){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.insertData=function(u,l){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.deleteData=function(u,l){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.replaceData=function(u,l,m){throw new Error("This DOM method is not implemented."+this.debugInfo())},d.prototype.isEqualNode=function(u){return!(!d.__super__.isEqualNode.apply(this,arguments).isEqualNode(u)||u.data!==this.data)},d})(r)}).call(Ee)});var gt=F((be,Ne)=>{(function(){var o,r,c,g=function(d,u){for(var l in u)a.call(u,l)&&(d[l]=u[l]);function m(){this.constructor=d}return m.prototype=u.prototype,d.prototype=new m,d.__super__=u.prototype,d},a={}.hasOwnProperty;o=W(),c=ft(),Ne.exports=r=(function(d){g(u,d);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=o.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(be)});var wt=F((Oe,Ie)=>{(function(){var o,r,c,g=function(d,u){for(var l in u)a.call(u,l)&&(d[l]=u[l]);function m(){this.constructor=d}return m.prototype=u.prototype,d.prototype=new m,d.__super__=u.prototype,d},a={}.hasOwnProperty;o=W(),r=ft(),Ie.exports=c=(function(d){g(u,d);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=o.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(Oe)});var Tt=F((ve,_e)=>{(function(){var o,r,c,g,a=function(u,l){for(var m in l)d.call(l,m)&&(u[m]=l[m]);function T(){this.constructor=u}return T.prototype=l.prototype,u.prototype=new T,u.__super__=l.prototype,u},d={}.hasOwnProperty;g=$().isObject,c=Q(),o=W(),_e.exports=r=(function(u){a(l,u);function l(m,T,N,I){var E;l.__super__.constructor.call(this,m),g(T)&&(E=T,T=E.version,N=E.encoding,I=E.standalone),T||(T="1.0"),this.type=o.Declaration,this.version=this.stringify.xmlVersion(T),N!=null&&(this.encoding=this.stringify.xmlEncoding(N)),I!=null&&(this.standalone=this.stringify.xmlStandalone(I))}return l.prototype.toString=function(m){return this.options.writer.declaration(this,this.options.writer.filterOptions(m))},l})(c)}).call(ve)});var Et=F((Le,Ce)=>{(function(){var o,r,c,g=function(d,u){for(var l in u)a.call(u,l)&&(d[l]=u[l]);function m(){this.constructor=d}return m.prototype=u.prototype,d.prototype=new m,d.__super__=u.prototype,d},a={}.hasOwnProperty;c=Q(),o=W(),Ce.exports=r=(function(d){g(u,d);function u(l,m,T,N,I,E){if(u.__super__.constructor.call(this,l),m==null)throw new Error("Missing DTD element name. "+this.debugInfo());if(T==null)throw new Error("Missing DTD attribute name. "+this.debugInfo(m));if(!N)throw new Error("Missing DTD attribute type. "+this.debugInfo(m));if(!I)throw new Error("Missing DTD attribute default. "+this.debugInfo(m));if(I.indexOf("#")!==0&&(I="#"+I),!I.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(m));if(E&&!I.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=o.AttributeDeclaration,this.attributeName=this.stringify.name(T),this.attributeType=this.stringify.dtdAttType(N),E&&(this.defaultValue=this.stringify.dtdAttDefault(E)),this.defaultValueType=I}return u.prototype.toString=function(l){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(l))},u})(c)}).call(Le)});var Dt=F((Ae,Pe)=>{(function(){var o,r,c,g,a=function(u,l){for(var m in l)d.call(l,m)&&(u[m]=l[m]);function T(){this.constructor=u}return T.prototype=l.prototype,u.prototype=new T,u.__super__=l.prototype,u},d={}.hasOwnProperty;g=$().isObject,c=Q(),o=W(),Pe.exports=r=(function(u){a(l,u);function l(m,T,N,I){if(l.__super__.constructor.call(this,m),N==null)throw new Error("Missing DTD entity name. "+this.debugInfo(N));if(I==null)throw new Error("Missing DTD entity value. "+this.debugInfo(N));if(this.pe=!!T,this.name=this.stringify.name(N),this.type=o.EntityDeclaration,!g(I))this.value=this.stringify.dtdEntityValue(I),this.internal=!0;else{if(!I.pubID&&!I.sysID)throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(N));if(I.pubID&&!I.sysID)throw new Error("System identifier is required for a public external entity. "+this.debugInfo(N));if(this.internal=!1,I.pubID!=null&&(this.pubID=this.stringify.dtdPubID(I.pubID)),I.sysID!=null&&(this.sysID=this.stringify.dtdSysID(I.sysID)),I.nData!=null&&(this.nData=this.stringify.dtdNData(I.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(Ae)});var bt=F((Me,xe)=>{(function(){var o,r,c,g=function(d,u){for(var l in u)a.call(u,l)&&(d[l]=u[l]);function m(){this.constructor=d}return m.prototype=u.prototype,d.prototype=new m,d.__super__=u.prototype,d},a={}.hasOwnProperty;c=Q(),o=W(),xe.exports=r=(function(d){g(u,d);function u(l,m,T){if(u.__super__.constructor.call(this,l),m==null)throw new Error("Missing DTD element name. "+this.debugInfo());T||(T="(#PCDATA)"),Array.isArray(T)&&(T="("+T.join(",")+")"),this.name=this.stringify.name(m),this.type=o.ElementDeclaration,this.value=this.stringify.dtdElementValue(T)}return u.prototype.toString=function(l){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(l))},u})(c)}).call(Me)});var Nt=F((Se,Fe)=>{(function(){var o,r,c,g=function(d,u){for(var l in u)a.call(u,l)&&(d[l]=u[l]);function m(){this.constructor=d}return m.prototype=u.prototype,d.prototype=new m,d.__super__=u.prototype,d},a={}.hasOwnProperty;c=Q(),o=W(),Fe.exports=r=(function(d){g(u,d);function u(l,m,T){if(u.__super__.constructor.call(this,l),m==null)throw new Error("Missing DTD notation name. "+this.debugInfo(m));if(!T.pubID&&!T.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=o.NotationDeclaration,T.pubID!=null&&(this.pubID=this.stringify.dtdPubID(T.pubID)),T.sysID!=null&&(this.sysID=this.stringify.dtdSysID(T.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(Se)});var Ot=F((Xe,qe)=>{(function(){var o,r,c,g,a,d,u,l,m,T=function(I,E){for(var p in E)N.call(E,p)&&(I[p]=E[p]);function w(){this.constructor=I}return w.prototype=E.prototype,I.prototype=new w,I.__super__=E.prototype,I},N={}.hasOwnProperty;m=$().isObject,l=Q(),o=W(),r=Et(),g=Dt(),c=bt(),a=Nt(),u=yt(),qe.exports=d=(function(I){T(E,I);function E(p,w,b){var P,A,_,h,i,e;if(E.__super__.constructor.call(this,p),this.type=o.DocType,p.children){for(h=p.children,A=0,_=h.length;A<_;A++)if(P=h[A],P.type===o.Element){this.name=P.name;break}}this.documentObject=p,m(w)&&(i=w,w=i.pubID,b=i.sysID),b==null&&(e=[w,b],b=e[0],w=e[1]),w!=null&&(this.pubID=this.stringify.dtdPubID(w)),b!=null&&(this.sysID=this.stringify.dtdSysID(b))}return Object.defineProperty(E.prototype,"entities",{get:function(){var p,w,b,P,A;for(P={},A=this.children,w=0,b=A.length;w<b;w++)p=A[w],p.type===o.EntityDeclaration&&!p.pe&&(P[p.name]=p);return new u(P)}}),Object.defineProperty(E.prototype,"notations",{get:function(){var p,w,b,P,A;for(P={},A=this.children,w=0,b=A.length;w<b;w++)p=A[w],p.type===o.NotationDeclaration&&(P[p.name]=p);return new u(P)}}),Object.defineProperty(E.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(E.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(E.prototype,"internalSubset",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),E.prototype.element=function(p,w){var b;return b=new c(this,p,w),this.children.push(b),this},E.prototype.attList=function(p,w,b,P,A){var _;return _=new r(this,p,w,b,P,A),this.children.push(_),this},E.prototype.entity=function(p,w){var b;return b=new g(this,!1,p,w),this.children.push(b),this},E.prototype.pEntity=function(p,w){var b;return b=new g(this,!0,p,w),this.children.push(b),this},E.prototype.notation=function(p,w){var b;return b=new a(this,p,w),this.children.push(b),this},E.prototype.toString=function(p){return this.options.writer.docType(this,this.options.writer.filterOptions(p))},E.prototype.ele=function(p,w){return this.element(p,w)},E.prototype.att=function(p,w,b,P,A){return this.attList(p,w,b,P,A)},E.prototype.ent=function(p,w){return this.entity(p,w)},E.prototype.pent=function(p,w){return this.pEntity(p,w)},E.prototype.not=function(p,w){return this.notation(p,w)},E.prototype.up=function(){return this.root()||this.documentObject},E.prototype.isEqualNode=function(p){return!(!E.__super__.isEqualNode.apply(this,arguments).isEqualNode(p)||p.name!==this.name||p.publicId!==this.publicId||p.systemId!==this.systemId)},E})(l)}).call(Xe)});var It=F((Re,je)=>{(function(){var o,r,c,g=function(d,u){for(var l in u)a.call(u,l)&&(d[l]=u[l]);function m(){this.constructor=d}return m.prototype=u.prototype,d.prototype=new m,d.__super__=u.prototype,d},a={}.hasOwnProperty;o=W(),r=Q(),je.exports=c=(function(d){g(u,d);function u(l,m){if(u.__super__.constructor.call(this,l),m==null)throw new Error("Missing raw text. "+this.debugInfo());this.type=o.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(Re)});var vt=F((Be,Ue)=>{(function(){var o,r,c,g=function(d,u){for(var l in u)a.call(u,l)&&(d[l]=u[l]);function m(){this.constructor=d}return m.prototype=u.prototype,d.prototype=new m,d.__super__=u.prototype,d},a={}.hasOwnProperty;o=W(),r=ft(),Ue.exports=c=(function(d){g(u,d);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=o.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,T;for(T="",m=this.previousSibling;m;)T=m.data+T,m=m.previousSibling;for(T+=this.data,l=this.nextSibling;l;)T=T+l.data,l=l.nextSibling;return T}}),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(Be)});var _t=F((Ve,ke)=>{(function(){var o,r,c,g=function(d,u){for(var l in u)a.call(u,l)&&(d[l]=u[l]);function m(){this.constructor=d}return m.prototype=u.prototype,d.prototype=new m,d.__super__=u.prototype,d},a={}.hasOwnProperty;o=W(),r=ft(),ke.exports=c=(function(d){g(u,d);function u(l,m,T){if(u.__super__.constructor.call(this,l),m==null)throw new Error("Missing instruction target. "+this.debugInfo());this.type=o.ProcessingInstruction,this.target=this.stringify.insTarget(m),this.name=this.target,T&&(this.value=this.stringify.insValue(T))}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(Ve)});var Bt=F((We,Ge)=>{(function(){var o,r,c,g=function(d,u){for(var l in u)a.call(u,l)&&(d[l]=u[l]);function m(){this.constructor=d}return m.prototype=u.prototype,d.prototype=new m,d.__super__=u.prototype,d},a={}.hasOwnProperty;c=Q(),o=W(),Ge.exports=r=(function(d){g(u,d);function u(l){u.__super__.constructor.call(this,l),this.type=o.Dummy}return u.prototype.clone=function(){return Object.create(this)},u.prototype.toString=function(l){return""},u})(c)}).call(We)});var ze=F((Ye,Ke)=>{(function(){var o;Ke.exports=o=(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(Ye)});var Ze=F((He,Qe)=>{(function(){Qe.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(He)});var Q=F(($e,Je)=>{(function(){var o,r,c,g,a,d,u,l,m,T,N,I,E,p,w,b,P,A,_,h={}.hasOwnProperty;_=$(),A=_.isObject,P=_.isFunction,b=_.isEmpty,w=_.getValue,l=null,c=null,g=null,a=null,d=null,E=null,p=null,I=null,u=null,r=null,N=null,m=null,o=null,Je.exports=T=(function(){function i(e){this.parent=e,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.value=null,this.children=[],this.baseURI=null,l||(l=mt(),c=gt(),g=wt(),a=Tt(),d=Ot(),E=It(),p=vt(),I=_t(),u=Bt(),r=W(),N=ze(),m=yt(),o=Ze())}return Object.defineProperty(i.prototype,"nodeName",{get:function(){return this.name}}),Object.defineProperty(i.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(i.prototype,"nodeValue",{get:function(){return this.value}}),Object.defineProperty(i.prototype,"parentNode",{get:function(){return this.parent}}),Object.defineProperty(i.prototype,"childNodes",{get:function(){return(!this.childNodeList||!this.childNodeList.nodes)&&(this.childNodeList=new N(this.children)),this.childNodeList}}),Object.defineProperty(i.prototype,"firstChild",{get:function(){return this.children[0]||null}}),Object.defineProperty(i.prototype,"lastChild",{get:function(){return this.children[this.children.length-1]||null}}),Object.defineProperty(i.prototype,"previousSibling",{get:function(){var e;return e=this.parent.children.indexOf(this),this.parent.children[e-1]||null}}),Object.defineProperty(i.prototype,"nextSibling",{get:function(){var e;return e=this.parent.children.indexOf(this),this.parent.children[e+1]||null}}),Object.defineProperty(i.prototype,"ownerDocument",{get:function(){return this.document()||null}}),Object.defineProperty(i.prototype,"textContent",{get:function(){var e,f,v,O,s;if(this.nodeType===r.Element||this.nodeType===r.DocumentFragment){for(s="",O=this.children,f=0,v=O.length;f<v;f++)e=O[f],e.textContent&&(s+=e.textContent);return s}else return null},set:function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),i.prototype.setParent=function(e){var f,v,O,s,y;for(this.parent=e,e&&(this.options=e.options,this.stringify=e.stringify),s=this.children,y=[],v=0,O=s.length;v<O;v++)f=s[v],y.push(f.setParent(this));return y},i.prototype.element=function(e,f,v){var O,s,y,C,M,x,X,q,S,V,R;if(x=null,f===null&&v==null&&(S=[{},null],f=S[0],v=S[1]),f==null&&(f={}),f=w(f),A(f)||(V=[f,v],v=V[0],f=V[1]),e!=null&&(e=w(e)),Array.isArray(e))for(y=0,X=e.length;y<X;y++)s=e[y],x=this.element(s);else if(P(e))x=this.element(e.apply());else if(A(e)){for(M in e)if(h.call(e,M))if(R=e[M],P(R)&&(R=R.apply()),!this.options.ignoreDecorators&&this.stringify.convertAttKey&&M.indexOf(this.stringify.convertAttKey)===0)x=this.attribute(M.substr(this.stringify.convertAttKey.length),R);else if(!this.options.separateArrayItems&&Array.isArray(R)&&b(R))x=this.dummy();else if(A(R)&&b(R))x=this.element(M);else if(!this.options.keepNullNodes&&R==null)x=this.dummy();else if(!this.options.separateArrayItems&&Array.isArray(R))for(C=0,q=R.length;C<q;C++)s=R[C],O={},O[M]=s,x=this.element(O);else A(R)?!this.options.ignoreDecorators&&this.stringify.convertTextKey&&M.indexOf(this.stringify.convertTextKey)===0?x=this.element(R):(x=this.element(M),x.element(R)):x=this.element(M,R)}else!this.options.keepNullNodes&&v===null?x=this.dummy():!this.options.ignoreDecorators&&this.stringify.convertTextKey&&e.indexOf(this.stringify.convertTextKey)===0?x=this.text(v):!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&e.indexOf(this.stringify.convertCDataKey)===0?x=this.cdata(v):!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&e.indexOf(this.stringify.convertCommentKey)===0?x=this.comment(v):!this.options.ignoreDecorators&&this.stringify.convertRawKey&&e.indexOf(this.stringify.convertRawKey)===0?x=this.raw(v):!this.options.ignoreDecorators&&this.stringify.convertPIKey&&e.indexOf(this.stringify.convertPIKey)===0?x=this.instruction(e.substr(this.stringify.convertPIKey.length),v):x=this.node(e,f,v);if(x==null)throw new Error("Could not create any elements with: "+e+". "+this.debugInfo());return x},i.prototype.insertBefore=function(e,f,v){var O,s,y,C,M;if(e?.type)return y=e,C=f,y.setParent(this),C?(s=children.indexOf(C),M=children.splice(s),children.push(y),Array.prototype.push.apply(children,M)):children.push(y),y;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(e));return s=this.parent.children.indexOf(this),M=this.parent.children.splice(s),O=this.parent.element(e,f,v),Array.prototype.push.apply(this.parent.children,M),O},i.prototype.insertAfter=function(e,f,v){var O,s,y;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(e));return s=this.parent.children.indexOf(this),y=this.parent.children.splice(s+1),O=this.parent.element(e,f,v),Array.prototype.push.apply(this.parent.children,y),O},i.prototype.remove=function(){var e,f;if(this.isRoot)throw new Error("Cannot remove the root element. "+this.debugInfo());return e=this.parent.children.indexOf(this),[].splice.apply(this.parent.children,[e,e-e+1].concat(f=[])),this.parent},i.prototype.node=function(e,f,v){var O,s;return e!=null&&(e=w(e)),f||(f={}),f=w(f),A(f)||(s=[f,v],v=s[0],f=s[1]),O=new l(this,e,f),v!=null&&O.text(v),this.children.push(O),O},i.prototype.text=function(e){var f;return A(e)&&this.element(e),f=new p(this,e),this.children.push(f),this},i.prototype.cdata=function(e){var f;return f=new c(this,e),this.children.push(f),this},i.prototype.comment=function(e){var f;return f=new g(this,e),this.children.push(f),this},i.prototype.commentBefore=function(e){var f,v,O;return v=this.parent.children.indexOf(this),O=this.parent.children.splice(v),f=this.parent.comment(e),Array.prototype.push.apply(this.parent.children,O),this},i.prototype.commentAfter=function(e){var f,v,O;return v=this.parent.children.indexOf(this),O=this.parent.children.splice(v+1),f=this.parent.comment(e),Array.prototype.push.apply(this.parent.children,O),this},i.prototype.raw=function(e){var f;return f=new E(this,e),this.children.push(f),this},i.prototype.dummy=function(){var e;return e=new u(this),e},i.prototype.instruction=function(e,f){var v,O,s,y,C;if(e!=null&&(e=w(e)),f!=null&&(f=w(f)),Array.isArray(e))for(y=0,C=e.length;y<C;y++)v=e[y],this.instruction(v);else if(A(e))for(v in e)h.call(e,v)&&(O=e[v],this.instruction(v,O));else P(f)&&(f=f.apply()),s=new I(this,e,f),this.children.push(s);return this},i.prototype.instructionBefore=function(e,f){var v,O,s;return O=this.parent.children.indexOf(this),s=this.parent.children.splice(O),v=this.parent.instruction(e,f),Array.prototype.push.apply(this.parent.children,s),this},i.prototype.instructionAfter=function(e,f){var v,O,s;return O=this.parent.children.indexOf(this),s=this.parent.children.splice(O+1),v=this.parent.instruction(e,f),Array.prototype.push.apply(this.parent.children,s),this},i.prototype.declaration=function(e,f,v){var O,s;return O=this.document(),s=new a(O,e,f,v),O.children.length===0?O.children.unshift(s):O.children[0].type===r.Declaration?O.children[0]=s:O.children.unshift(s),O.root()||O},i.prototype.dtd=function(e,f){var v,O,s,y,C,M,x,X,q,S;for(O=this.document(),s=new d(O,e,f),q=O.children,y=C=0,x=q.length;C<x;y=++C)if(v=q[y],v.type===r.DocType)return O.children[y]=s,s;for(S=O.children,y=M=0,X=S.length;M<X;y=++M)if(v=S[y],v.isRoot)return O.children.splice(y,0,s),s;return O.children.push(s),s},i.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},i.prototype.root=function(){var e;for(e=this;e;){if(e.type===r.Document)return e.rootObject;if(e.isRoot)return e;e=e.parent}},i.prototype.document=function(){var e;for(e=this;e;){if(e.type===r.Document)return e;e=e.parent}},i.prototype.end=function(e){return this.document().end(e)},i.prototype.prev=function(){var e;if(e=this.parent.children.indexOf(this),e<1)throw new Error("Already at the first node. "+this.debugInfo());return this.parent.children[e-1]},i.prototype.next=function(){var e;if(e=this.parent.children.indexOf(this),e===-1||e===this.parent.children.length-1)throw new Error("Already at the last node. "+this.debugInfo());return this.parent.children[e+1]},i.prototype.importDocument=function(e){var f;return f=e.root().clone(),f.parent=this,f.isRoot=!1,this.children.push(f),this},i.prototype.debugInfo=function(e){var f,v;return e=e||this.name,e==null&&!((f=this.parent)!=null&&f.name)?"":e==null?"parent: <"+this.parent.name+">":(v=this.parent)!=null&&v.name?"node: <"+e+">, parent: <"+this.parent.name+">":"node: <"+e+">"},i.prototype.ele=function(e,f,v){return this.element(e,f,v)},i.prototype.nod=function(e,f,v){return this.node(e,f,v)},i.prototype.txt=function(e){return this.text(e)},i.prototype.dat=function(e){return this.cdata(e)},i.prototype.com=function(e){return this.comment(e)},i.prototype.ins=function(e,f){return this.instruction(e,f)},i.prototype.doc=function(){return this.document()},i.prototype.dec=function(e,f,v){return this.declaration(e,f,v)},i.prototype.e=function(e,f,v){return this.element(e,f,v)},i.prototype.n=function(e,f,v){return this.node(e,f,v)},i.prototype.t=function(e){return this.text(e)},i.prototype.d=function(e){return this.cdata(e)},i.prototype.c=function(e){return this.comment(e)},i.prototype.r=function(e){return this.raw(e)},i.prototype.i=function(e,f){return this.instruction(e,f)},i.prototype.u=function(){return this.up()},i.prototype.importXMLBuilder=function(e){return this.importDocument(e)},i.prototype.replaceChild=function(e,f){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.removeChild=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.appendChild=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.hasChildNodes=function(){return this.children.length!==0},i.prototype.cloneNode=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.normalize=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.isSupported=function(e,f){return!0},i.prototype.hasAttributes=function(){return this.attribs.length!==0},i.prototype.compareDocumentPosition=function(e){var f,v;return f=this,f===e?0:this.document()!==e.document()?(v=o.Disconnected|o.ImplementationSpecific,Math.random()<.5?v|=o.Preceding:v|=o.Following,v):f.isAncestor(e)?o.Contains|o.Preceding:f.isDescendant(e)?o.Contains|o.Following:f.isPreceding(e)?o.Preceding:o.Following},i.prototype.isSameNode=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.lookupPrefix=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.isDefaultNamespace=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.lookupNamespaceURI=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.isEqualNode=function(e){var f,v,O;if(e.nodeType!==this.nodeType||e.children.length!==this.children.length)return!1;for(f=v=0,O=this.children.length-1;0<=O?v<=O:v>=O;f=0<=O?++v:--v)if(!this.children[f].isEqualNode(e.children[f]))return!1;return!0},i.prototype.getFeature=function(e,f){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.setUserData=function(e,f,v){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.getUserData=function(e){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.contains=function(e){return e?e===this||this.isDescendant(e):!1},i.prototype.isDescendant=function(e){var f,v,O,s,y;for(y=this.children,O=0,s=y.length;O<s;O++)if(f=y[O],e===f||(v=f.isDescendant(e),v))return!0;return!1},i.prototype.isAncestor=function(e){return e.isDescendant(this)},i.prototype.isPreceding=function(e){var f,v;return f=this.treePosition(e),v=this.treePosition(this),f===-1||v===-1?!1:f<v},i.prototype.isFollowing=function(e){var f,v;return f=this.treePosition(e),v=this.treePosition(this),f===-1||v===-1?!1:f>v},i.prototype.treePosition=function(e){var f,v;return v=0,f=!1,this.foreachTreeNode(this.document(),function(O){if(v++,!f&&O===e)return f=!0}),f?v:-1},i.prototype.foreachTreeNode=function(e,f){var v,O,s,y,C;for(e||(e=this.document()),y=e.children,O=0,s=y.length;O<s;O++){if(v=y[O],C=f(v))return C;if(C=this.foreachTreeNode(v,f),C)return C}},i})()}).call($e)});var Ut=F((tr,er)=>{(function(){var o,r=function(g,a){return function(){return g.apply(a,arguments)}},c={}.hasOwnProperty;er.exports=o=(function(){function g(a){this.assertLegalName=r(this.assertLegalName,this),this.assertLegalChar=r(this.assertLegalChar,this);var d,u,l;a||(a={}),this.options=a,this.options.version||(this.options.version="1.0"),u=a.stringify||{};for(d in u)c.call(u,d)&&(l=u[d],this[d]=l)}return g.prototype.name=function(a){return this.options.noValidation?a:this.assertLegalName(""+a||"")},g.prototype.text=function(a){return this.options.noValidation?a:this.assertLegalChar(this.textEscape(""+a||""))},g.prototype.cdata=function(a){return this.options.noValidation?a:(a=""+a||"",a=a.replace("]]>","]]]]><![CDATA[>"),this.assertLegalChar(a))},g.prototype.comment=function(a){if(this.options.noValidation)return a;if(a=""+a||"",a.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+a);return this.assertLegalChar(a)},g.prototype.raw=function(a){return this.options.noValidation?a:""+a||""},g.prototype.attValue=function(a){return this.options.noValidation?a:this.assertLegalChar(this.attEscape(a=""+a||""))},g.prototype.insTarget=function(a){return this.options.noValidation?a:this.assertLegalChar(""+a||"")},g.prototype.insValue=function(a){if(this.options.noValidation)return a;if(a=""+a||"",a.match(/\?>/))throw new Error("Invalid processing instruction value: "+a);return this.assertLegalChar(a)},g.prototype.xmlVersion=function(a){if(this.options.noValidation)return a;if(a=""+a||"",!a.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+a);return a},g.prototype.xmlEncoding=function(a){if(this.options.noValidation)return a;if(a=""+a||"",!a.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+a);return this.assertLegalChar(a)},g.prototype.xmlStandalone=function(a){return this.options.noValidation?a:a?"yes":"no"},g.prototype.dtdPubID=function(a){return this.options.noValidation?a:this.assertLegalChar(""+a||"")},g.prototype.dtdSysID=function(a){return this.options.noValidation?a:this.assertLegalChar(""+a||"")},g.prototype.dtdElementValue=function(a){return this.options.noValidation?a:this.assertLegalChar(""+a||"")},g.prototype.dtdAttType=function(a){return this.options.noValidation?a:this.assertLegalChar(""+a||"")},g.prototype.dtdAttDefault=function(a){return this.options.noValidation?a:this.assertLegalChar(""+a||"")},g.prototype.dtdEntityValue=function(a){return this.options.noValidation?a:this.assertLegalChar(""+a||"")},g.prototype.dtdNData=function(a){return this.options.noValidation?a:this.assertLegalChar(""+a||"")},g.prototype.convertAttKey="@",g.prototype.convertPIKey="?",g.prototype.convertTextKey="#text",g.prototype.convertCDataKey="#cdata",g.prototype.convertCommentKey="#comment",g.prototype.convertRawKey="#raw",g.prototype.assertLegalChar=function(a){var d,u;if(this.options.noValidation)return a;if(d="",this.options.version==="1.0"){if(d=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,u=a.match(d))throw new Error("Invalid character in string: "+a+" at index "+u.index)}else if(this.options.version==="1.1"&&(d=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,u=a.match(d)))throw new Error("Invalid character in string: "+a+" at index "+u.index);return a},g.prototype.assertLegalName=function(a){var d;if(this.options.noValidation)return a;if(this.assertLegalChar(a),d=/^([: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])*$/,!a.match(d))throw new Error("Invalid character in name");return a},g.prototype.textEscape=function(a){var d;return this.options.noValidation?a:(d=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,a.replace(d,"&").replace(/</g,"<").replace(/>/g,">").replace(/\r/g,"
"))},g.prototype.attEscape=function(a){var d;return this.options.noValidation?a:(d=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,a.replace(d,"&").replace(/</g,"<").replace(/"/g,""").replace(/\t/g,"	").replace(/\n/g,"
").replace(/\r/g,"
"))},g})()}).call(tr)});var ht=F((rr,ir)=>{(function(){ir.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}).call(rr)});var Vt=F((nr,or)=>{(function(){var o,r,c,g,a,d,u,l,m,T,N,I,E,p,w,b,P,A={}.hasOwnProperty;P=$().assign,o=W(),m=Tt(),T=Ot(),c=gt(),g=wt(),I=mt(),p=It(),w=vt(),E=_t(),N=Bt(),a=Et(),d=bt(),u=Dt(),l=Nt(),r=ht(),or.exports=b=(function(){function _(h){var i,e,f;h||(h={}),this.options=h,e=h.writer||{};for(i in e)A.call(e,i)&&(f=e[i],this["_"+i]=this[i],this[i]=f)}return _.prototype.filterOptions=function(h){var i,e,f,v,O,s,y,C;return h||(h={}),h=P({},this.options,h),i={writer:this},i.pretty=h.pretty||!1,i.allowEmpty=h.allowEmpty||!1,i.indent=(e=h.indent)!=null?e:" ",i.newline=(f=h.newline)!=null?f:`
|
|
3
|
-
`,i.offset=(v=h.offset)!=null?v:0,i.dontPrettyTextNodes=(O=(s=h.dontPrettyTextNodes)!=null?s:h.dontprettytextnodes)!=null?O:0,i.spaceBeforeSlash=(y=(C=h.spaceBeforeSlash)!=null?C:h.spacebeforeslash)!=null?y:"",i.spaceBeforeSlash===!0&&(i.spaceBeforeSlash=" "),i.suppressPrettyCount=0,i.user={},i.state=r.None,i},_.prototype.indent=function(h,i,e){var f;return!i.pretty||i.suppressPrettyCount?"":i.pretty&&(f=(e||0)+i.offset+1,f>0)?new Array(f).join(i.indent):""},_.prototype.endline=function(h,i,e){return!i.pretty||i.suppressPrettyCount?"":i.newline},_.prototype.attribute=function(h,i,e){var f;return this.openAttribute(h,i,e),f=" "+h.name+'="'+h.value+'"',this.closeAttribute(h,i,e),f},_.prototype.cdata=function(h,i,e){var f;return this.openNode(h,i,e),i.state=r.OpenTag,f=this.indent(h,i,e)+"<![CDATA[",i.state=r.InsideTag,f+=h.value,i.state=r.CloseTag,f+="]]>"+this.endline(h,i,e),i.state=r.None,this.closeNode(h,i,e),f},_.prototype.comment=function(h,i,e){var f;return this.openNode(h,i,e),i.state=r.OpenTag,f=this.indent(h,i,e)+"<!-- ",i.state=r.InsideTag,f+=h.value,i.state=r.CloseTag,f+=" -->"+this.endline(h,i,e),i.state=r.None,this.closeNode(h,i,e),f},_.prototype.declaration=function(h,i,e){var f;return this.openNode(h,i,e),i.state=r.OpenTag,f=this.indent(h,i,e)+"<?xml",i.state=r.InsideTag,f+=' version="'+h.version+'"',h.encoding!=null&&(f+=' encoding="'+h.encoding+'"'),h.standalone!=null&&(f+=' standalone="'+h.standalone+'"'),i.state=r.CloseTag,f+=i.spaceBeforeSlash+"?>",f+=this.endline(h,i,e),i.state=r.None,this.closeNode(h,i,e),f},_.prototype.docType=function(h,i,e){var f,v,O,s,y;if(e||(e=0),this.openNode(h,i,e),i.state=r.OpenTag,s=this.indent(h,i,e),s+="<!DOCTYPE "+h.root().name,h.pubID&&h.sysID?s+=' PUBLIC "'+h.pubID+'" "'+h.sysID+'"':h.sysID&&(s+=' SYSTEM "'+h.sysID+'"'),h.children.length>0){for(s+=" [",s+=this.endline(h,i,e),i.state=r.InsideTag,y=h.children,v=0,O=y.length;v<O;v++)f=y[v],s+=this.writeChildNode(f,i,e+1);i.state=r.CloseTag,s+="]"}return i.state=r.CloseTag,s+=i.spaceBeforeSlash+">",s+=this.endline(h,i,e),i.state=r.None,this.closeNode(h,i,e),s},_.prototype.element=function(h,i,e){var f,v,O,s,y,C,M,x,X,q,S,V,R,Z;e||(e=0),q=!1,S="",this.openNode(h,i,e),i.state=r.OpenTag,S+=this.indent(h,i,e)+"<"+h.name,V=h.attribs;for(X in V)A.call(V,X)&&(f=V[X],S+=this.attribute(f,i,e));if(O=h.children.length,s=O===0?null:h.children[0],O===0||h.children.every(function(ct){return(ct.type===o.Text||ct.type===o.Raw)&&ct.value===""}))i.allowEmpty?(S+=">",i.state=r.CloseTag,S+="</"+h.name+">"+this.endline(h,i,e)):(i.state=r.CloseTag,S+=i.spaceBeforeSlash+"/>"+this.endline(h,i,e));else if(i.pretty&&O===1&&(s.type===o.Text||s.type===o.Raw)&&s.value!=null)S+=">",i.state=r.InsideTag,i.suppressPrettyCount++,q=!0,S+=this.writeChildNode(s,i,e+1),i.suppressPrettyCount--,q=!1,i.state=r.CloseTag,S+="</"+h.name+">"+this.endline(h,i,e);else{if(i.dontPrettyTextNodes){for(R=h.children,y=0,M=R.length;y<M;y++)if(v=R[y],(v.type===o.Text||v.type===o.Raw)&&v.value!=null){i.suppressPrettyCount++,q=!0;break}}for(S+=">"+this.endline(h,i,e),i.state=r.InsideTag,Z=h.children,C=0,x=Z.length;C<x;C++)v=Z[C],S+=this.writeChildNode(v,i,e+1);i.state=r.CloseTag,S+=this.indent(h,i,e)+"</"+h.name+">",q&&i.suppressPrettyCount--,S+=this.endline(h,i,e),i.state=r.None}return this.closeNode(h,i,e),S},_.prototype.writeChildNode=function(h,i,e){switch(h.type){case o.CData:return this.cdata(h,i,e);case o.Comment:return this.comment(h,i,e);case o.Element:return this.element(h,i,e);case o.Raw:return this.raw(h,i,e);case o.Text:return this.text(h,i,e);case o.ProcessingInstruction:return this.processingInstruction(h,i,e);case o.Dummy:return"";case o.Declaration:return this.declaration(h,i,e);case o.DocType:return this.docType(h,i,e);case o.AttributeDeclaration:return this.dtdAttList(h,i,e);case o.ElementDeclaration:return this.dtdElement(h,i,e);case o.EntityDeclaration:return this.dtdEntity(h,i,e);case o.NotationDeclaration:return this.dtdNotation(h,i,e);default:throw new Error("Unknown XML node type: "+h.constructor.name)}},_.prototype.processingInstruction=function(h,i,e){var f;return this.openNode(h,i,e),i.state=r.OpenTag,f=this.indent(h,i,e)+"<?",i.state=r.InsideTag,f+=h.target,h.value&&(f+=" "+h.value),i.state=r.CloseTag,f+=i.spaceBeforeSlash+"?>",f+=this.endline(h,i,e),i.state=r.None,this.closeNode(h,i,e),f},_.prototype.raw=function(h,i,e){var f;return this.openNode(h,i,e),i.state=r.OpenTag,f=this.indent(h,i,e),i.state=r.InsideTag,f+=h.value,i.state=r.CloseTag,f+=this.endline(h,i,e),i.state=r.None,this.closeNode(h,i,e),f},_.prototype.text=function(h,i,e){var f;return this.openNode(h,i,e),i.state=r.OpenTag,f=this.indent(h,i,e),i.state=r.InsideTag,f+=h.value,i.state=r.CloseTag,f+=this.endline(h,i,e),i.state=r.None,this.closeNode(h,i,e),f},_.prototype.dtdAttList=function(h,i,e){var f;return this.openNode(h,i,e),i.state=r.OpenTag,f=this.indent(h,i,e)+"<!ATTLIST",i.state=r.InsideTag,f+=" "+h.elementName+" "+h.attributeName+" "+h.attributeType,h.defaultValueType!=="#DEFAULT"&&(f+=" "+h.defaultValueType),h.defaultValue&&(f+=' "'+h.defaultValue+'"'),i.state=r.CloseTag,f+=i.spaceBeforeSlash+">"+this.endline(h,i,e),i.state=r.None,this.closeNode(h,i,e),f},_.prototype.dtdElement=function(h,i,e){var f;return this.openNode(h,i,e),i.state=r.OpenTag,f=this.indent(h,i,e)+"<!ELEMENT",i.state=r.InsideTag,f+=" "+h.name+" "+h.value,i.state=r.CloseTag,f+=i.spaceBeforeSlash+">"+this.endline(h,i,e),i.state=r.None,this.closeNode(h,i,e),f},_.prototype.dtdEntity=function(h,i,e){var f;return this.openNode(h,i,e),i.state=r.OpenTag,f=this.indent(h,i,e)+"<!ENTITY",i.state=r.InsideTag,h.pe&&(f+=" %"),f+=" "+h.name,h.value?f+=' "'+h.value+'"':(h.pubID&&h.sysID?f+=' PUBLIC "'+h.pubID+'" "'+h.sysID+'"':h.sysID&&(f+=' SYSTEM "'+h.sysID+'"'),h.nData&&(f+=" NDATA "+h.nData)),i.state=r.CloseTag,f+=i.spaceBeforeSlash+">"+this.endline(h,i,e),i.state=r.None,this.closeNode(h,i,e),f},_.prototype.dtdNotation=function(h,i,e){var f;return this.openNode(h,i,e),i.state=r.OpenTag,f=this.indent(h,i,e)+"<!NOTATION",i.state=r.InsideTag,f+=" "+h.name,h.pubID&&h.sysID?f+=' PUBLIC "'+h.pubID+'" "'+h.sysID+'"':h.pubID?f+=' PUBLIC "'+h.pubID+'"':h.sysID&&(f+=' SYSTEM "'+h.sysID+'"'),i.state=r.CloseTag,f+=i.spaceBeforeSlash+">"+this.endline(h,i,e),i.state=r.None,this.closeNode(h,i,e),f},_.prototype.openNode=function(h,i,e){},_.prototype.closeNode=function(h,i,e){},_.prototype.openAttribute=function(h,i,e){},_.prototype.closeAttribute=function(h,i,e){},_})()}).call(nr)});var Lt=F((sr,ur)=>{(function(){var o,r,c=function(a,d){for(var u in d)g.call(d,u)&&(a[u]=d[u]);function l(){this.constructor=a}return l.prototype=d.prototype,a.prototype=new l,a.__super__=d.prototype,a},g={}.hasOwnProperty;r=Vt(),ur.exports=o=(function(a){c(d,a);function d(u){d.__super__.constructor.call(this,u)}return d.prototype.document=function(u,l){var m,T,N,I,E;for(l=this.filterOptions(l),I="",E=u.children,T=0,N=E.length;T<N;T++)m=E[T],I+=this.writeChildNode(m,l,0);return l.pretty&&I.slice(-l.newline.length)===l.newline&&(I=I.slice(0,-l.newline.length)),I},d})(r)}).call(sr)});var kt=F((ar,cr)=>{(function(){var o,r,c,g,a,d,u,l,m=function(N,I){for(var E in I)T.call(I,E)&&(N[E]=I[E]);function p(){this.constructor=N}return p.prototype=I.prototype,N.prototype=new p,N.__super__=I.prototype,N},T={}.hasOwnProperty;l=$().isPlainObject,c=Rt(),r=fe(),a=Q(),o=W(),u=Ut(),d=Lt(),cr.exports=g=(function(N){m(I,N);function I(E){I.__super__.constructor.call(this,null),this.name="#document",this.type=o.Document,this.documentURI=null,this.domConfig=new r,E||(E={}),E.writer||(E.writer=new d),this.options=E,this.stringify=new u(E)}return Object.defineProperty(I.prototype,"implementation",{value:new c}),Object.defineProperty(I.prototype,"doctype",{get:function(){var E,p,w,b;for(b=this.children,p=0,w=b.length;p<w;p++)if(E=b[p],E.type===o.DocType)return E;return null}}),Object.defineProperty(I.prototype,"documentElement",{get:function(){return this.rootObject||null}}),Object.defineProperty(I.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(I.prototype,"strictErrorChecking",{get:function(){return!1}}),Object.defineProperty(I.prototype,"xmlEncoding",{get:function(){return this.children.length!==0&&this.children[0].type===o.Declaration?this.children[0].encoding:null}}),Object.defineProperty(I.prototype,"xmlStandalone",{get:function(){return this.children.length!==0&&this.children[0].type===o.Declaration?this.children[0].standalone==="yes":!1}}),Object.defineProperty(I.prototype,"xmlVersion",{get:function(){return this.children.length!==0&&this.children[0].type===o.Declaration?this.children[0].version:"1.0"}}),Object.defineProperty(I.prototype,"URL",{get:function(){return this.documentURI}}),Object.defineProperty(I.prototype,"origin",{get:function(){return null}}),Object.defineProperty(I.prototype,"compatMode",{get:function(){return null}}),Object.defineProperty(I.prototype,"characterSet",{get:function(){return null}}),Object.defineProperty(I.prototype,"contentType",{get:function(){return null}}),I.prototype.end=function(E){var p;return p={},E?l(E)&&(p=E,E=this.options.writer):E=this.options.writer,E.document(this,E.filterOptions(p))},I.prototype.toString=function(E){return this.options.writer.document(this,this.options.writer.filterOptions(E))},I.prototype.createElement=function(E){throw new Error("This DOM method is not implemented."+this.debugInfo())},I.prototype.createDocumentFragment=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},I.prototype.createTextNode=function(E){throw new Error("This DOM method is not implemented."+this.debugInfo())},I.prototype.createComment=function(E){throw new Error("This DOM method is not implemented."+this.debugInfo())},I.prototype.createCDATASection=function(E){throw new Error("This DOM method is not implemented."+this.debugInfo())},I.prototype.createProcessingInstruction=function(E,p){throw new Error("This DOM method is not implemented."+this.debugInfo())},I.prototype.createAttribute=function(E){throw new Error("This DOM method is not implemented."+this.debugInfo())},I.prototype.createEntityReference=function(E){throw new Error("This DOM method is not implemented."+this.debugInfo())},I.prototype.getElementsByTagName=function(E){throw new Error("This DOM method is not implemented."+this.debugInfo())},I.prototype.importNode=function(E,p){throw new Error("This DOM method is not implemented."+this.debugInfo())},I.prototype.createElementNS=function(E,p){throw new Error("This DOM method is not implemented."+this.debugInfo())},I.prototype.createAttributeNS=function(E,p){throw new Error("This DOM method is not implemented."+this.debugInfo())},I.prototype.getElementsByTagNameNS=function(E,p){throw new Error("This DOM method is not implemented."+this.debugInfo())},I.prototype.getElementById=function(E){throw new Error("This DOM method is not implemented."+this.debugInfo())},I.prototype.adoptNode=function(E){throw new Error("This DOM method is not implemented."+this.debugInfo())},I.prototype.normalizeDocument=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},I.prototype.renameNode=function(E,p,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},I.prototype.getElementsByClassName=function(E){throw new Error("This DOM method is not implemented."+this.debugInfo())},I.prototype.createEvent=function(E){throw new Error("This DOM method is not implemented."+this.debugInfo())},I.prototype.createRange=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},I.prototype.createNodeIterator=function(E,p,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},I.prototype.createTreeWalker=function(E,p,w){throw new Error("This DOM method is not implemented."+this.debugInfo())},I})(a)}).call(ar)});var hr=F((lr,fr)=>{(function(){var o,r,c,g,a,d,u,l,m,T,N,I,E,p,w,b,P,A,_,h,i,e,f,v,O={}.hasOwnProperty;v=$(),e=v.isObject,i=v.isFunction,f=v.isPlainObject,h=v.getValue,o=W(),I=kt(),p=mt(),g=gt(),a=wt(),b=It(),_=vt(),w=_t(),T=Tt(),N=Ot(),d=Et(),l=Dt(),u=bt(),m=Nt(),c=jt(),A=Ut(),P=Lt(),r=ht(),fr.exports=E=(function(){function s(y,C,M){var x;this.name="?xml",this.type=o.Document,y||(y={}),x={},y.writer?f(y.writer)&&(x=y.writer,y.writer=new P):y.writer=new P,this.options=y,this.writer=y.writer,this.writerOptions=this.writer.filterOptions(x),this.stringify=new A(y),this.onDataCallback=C||function(){},this.onEndCallback=M||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}return s.prototype.createChildNode=function(y){var C,M,x,X,q,S,V,R;switch(y.type){case o.CData:this.cdata(y.value);break;case o.Comment:this.comment(y.value);break;case o.Element:x={},V=y.attribs;for(M in V)O.call(V,M)&&(C=V[M],x[M]=C.value);this.node(y.name,x);break;case o.Dummy:this.dummy();break;case o.Raw:this.raw(y.value);break;case o.Text:this.text(y.value);break;case o.ProcessingInstruction:this.instruction(y.target,y.value);break;default:throw new Error("This XML node type is not supported in a JS object: "+y.constructor.name)}for(R=y.children,q=0,S=R.length;q<S;q++)X=R[q],this.createChildNode(X),X.type===o.Element&&this.up();return this},s.prototype.dummy=function(){return this},s.prototype.node=function(y,C,M){var x;if(y==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(y));return this.openCurrent(),y=h(y),C==null&&(C={}),C=h(C),e(C)||(x=[C,M],M=x[0],C=x[1]),this.currentNode=new p(this,y,C),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,M!=null&&this.text(M),this},s.prototype.element=function(y,C,M){var x,X,q,S,V,R;if(this.currentNode&&this.currentNode.type===o.DocType)this.dtdElement.apply(this,arguments);else if(Array.isArray(y)||e(y)||i(y))for(S=this.options.noValidation,this.options.noValidation=!0,R=new I(this.options).element("TEMP_ROOT"),R.element(y),this.options.noValidation=S,V=R.children,X=0,q=V.length;X<q;X++)x=V[X],this.createChildNode(x),x.type===o.Element&&this.up();else this.node(y,C,M);return this},s.prototype.attribute=function(y,C){var M,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(y));if(y!=null&&(y=h(y)),e(y))for(M in y)O.call(y,M)&&(x=y[M],this.attribute(M,x));else i(C)&&(C=C.apply()),this.options.keepNullAttributes&&C==null?this.currentNode.attribs[y]=new c(this,y,""):C!=null&&(this.currentNode.attribs[y]=new c(this,y,C));return this},s.prototype.text=function(y){var C;return this.openCurrent(),C=new _(this,y),this.onData(this.writer.text(C,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},s.prototype.cdata=function(y){var C;return this.openCurrent(),C=new g(this,y),this.onData(this.writer.cdata(C,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},s.prototype.comment=function(y){var C;return this.openCurrent(),C=new a(this,y),this.onData(this.writer.comment(C,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},s.prototype.raw=function(y){var C;return this.openCurrent(),C=new b(this,y),this.onData(this.writer.raw(C,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},s.prototype.instruction=function(y,C){var M,x,X,q,S;if(this.openCurrent(),y!=null&&(y=h(y)),C!=null&&(C=h(C)),Array.isArray(y))for(M=0,q=y.length;M<q;M++)x=y[M],this.instruction(x);else if(e(y))for(x in y)O.call(y,x)&&(X=y[x],this.instruction(x,X));else i(C)&&(C=C.apply()),S=new w(this,y,C),this.onData(this.writer.processingInstruction(S,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this},s.prototype.declaration=function(y,C,M){var x;if(this.openCurrent(),this.documentStarted)throw new Error("declaration() must be the first node.");return x=new T(this,y,C,M),this.onData(this.writer.declaration(x,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},s.prototype.doctype=function(y,C,M){if(this.openCurrent(),y==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,C,M),this.currentNode.rootNodeName=y,this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,this},s.prototype.dtdElement=function(y,C){var M;return this.openCurrent(),M=new u(this,y,C),this.onData(this.writer.dtdElement(M,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},s.prototype.attList=function(y,C,M,x,X){var q;return this.openCurrent(),q=new d(this,y,C,M,x,X),this.onData(this.writer.dtdAttList(q,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},s.prototype.entity=function(y,C){var M;return this.openCurrent(),M=new l(this,!1,y,C),this.onData(this.writer.dtdEntity(M,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},s.prototype.pEntity=function(y,C){var M;return this.openCurrent(),M=new l(this,!0,y,C),this.onData(this.writer.dtdEntity(M,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},s.prototype.notation=function(y,C){var M;return this.openCurrent(),M=new m(this,y,C),this.onData(this.writer.dtdNotation(M,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},s.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},s.prototype.end=function(){for(;this.currentLevel>=0;)this.up();return this.onEnd()},s.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},s.prototype.openNode=function(y){var C,M,x,X;if(!y.isOpen){if(!this.root&&this.currentLevel===0&&y.type===o.Element&&(this.root=y),M="",y.type===o.Element){this.writerOptions.state=r.OpenTag,M=this.writer.indent(y,this.writerOptions,this.currentLevel)+"<"+y.name,X=y.attribs;for(x in X)O.call(X,x)&&(C=X[x],M+=this.writer.attribute(C,this.writerOptions,this.currentLevel));M+=(y.children?">":"/>")+this.writer.endline(y,this.writerOptions,this.currentLevel),this.writerOptions.state=r.InsideTag}else this.writerOptions.state=r.OpenTag,M=this.writer.indent(y,this.writerOptions,this.currentLevel)+"<!DOCTYPE "+y.rootNodeName,y.pubID&&y.sysID?M+=' PUBLIC "'+y.pubID+'" "'+y.sysID+'"':y.sysID&&(M+=' SYSTEM "'+y.sysID+'"'),y.children?(M+=" [",this.writerOptions.state=r.InsideTag):(this.writerOptions.state=r.CloseTag,M+=">"),M+=this.writer.endline(y,this.writerOptions,this.currentLevel);return this.onData(M,this.currentLevel),y.isOpen=!0}},s.prototype.closeNode=function(y){var C;if(!y.isClosed)return C="",this.writerOptions.state=r.CloseTag,y.type===o.Element?C=this.writer.indent(y,this.writerOptions,this.currentLevel)+"</"+y.name+">"+this.writer.endline(y,this.writerOptions,this.currentLevel):C=this.writer.indent(y,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(y,this.writerOptions,this.currentLevel),this.writerOptions.state=r.None,this.onData(C,this.currentLevel),y.isClosed=!0},s.prototype.onData=function(y,C){return this.documentStarted=!0,this.onDataCallback(y,C+1)},s.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},s.prototype.debugInfo=function(y){return y==null?"":"node: <"+y+">"},s.prototype.ele=function(){return this.element.apply(this,arguments)},s.prototype.nod=function(y,C,M){return this.node(y,C,M)},s.prototype.txt=function(y){return this.text(y)},s.prototype.dat=function(y){return this.cdata(y)},s.prototype.com=function(y){return this.comment(y)},s.prototype.ins=function(y,C){return this.instruction(y,C)},s.prototype.dec=function(y,C,M){return this.declaration(y,C,M)},s.prototype.dtd=function(y,C,M){return this.doctype(y,C,M)},s.prototype.e=function(y,C,M){return this.element(y,C,M)},s.prototype.n=function(y,C,M){return this.node(y,C,M)},s.prototype.t=function(y){return this.text(y)},s.prototype.d=function(y){return this.cdata(y)},s.prototype.c=function(y){return this.comment(y)},s.prototype.r=function(y){return this.raw(y)},s.prototype.i=function(y,C){return this.instruction(y,C)},s.prototype.att=function(){return this.currentNode&&this.currentNode.type===o.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},s.prototype.a=function(){return this.currentNode&&this.currentNode.type===o.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},s.prototype.ent=function(y,C){return this.entity(y,C)},s.prototype.pent=function(y,C){return this.pEntity(y,C)},s.prototype.not=function(y,C){return this.notation(y,C)},s})()}).call(lr)});var yr=F((pr,dr)=>{(function(){var o,r,c,g,a=function(u,l){for(var m in l)d.call(l,m)&&(u[m]=l[m]);function T(){this.constructor=u}return T.prototype=l.prototype,u.prototype=new T,u.__super__=l.prototype,u},d={}.hasOwnProperty;o=W(),g=Vt(),r=ht(),dr.exports=c=(function(u){a(l,u);function l(m,T){this.stream=m,l.__super__.constructor.call(this,T)}return l.prototype.endline=function(m,T,N){return m.isLastRootNode&&T.state===r.CloseTag?"":l.__super__.endline.call(this,m,T,N)},l.prototype.document=function(m,T){var N,I,E,p,w,b,P,A,_;for(P=m.children,I=E=0,w=P.length;E<w;I=++E)N=P[I],N.isLastRootNode=I===m.children.length-1;for(T=this.filterOptions(T),A=m.children,_=[],p=0,b=A.length;p<b;p++)N=A[p],_.push(this.writeChildNode(N,T,0));return _},l.prototype.attribute=function(m,T,N){return this.stream.write(l.__super__.attribute.call(this,m,T,N))},l.prototype.cdata=function(m,T,N){return this.stream.write(l.__super__.cdata.call(this,m,T,N))},l.prototype.comment=function(m,T,N){return this.stream.write(l.__super__.comment.call(this,m,T,N))},l.prototype.declaration=function(m,T,N){return this.stream.write(l.__super__.declaration.call(this,m,T,N))},l.prototype.docType=function(m,T,N){var I,E,p,w;if(N||(N=0),this.openNode(m,T,N),T.state=r.OpenTag,this.stream.write(this.indent(m,T,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,T,N)),T.state=r.InsideTag,w=m.children,E=0,p=w.length;E<p;E++)I=w[E],this.writeChildNode(I,T,N+1);T.state=r.CloseTag,this.stream.write("]")}return T.state=r.CloseTag,this.stream.write(T.spaceBeforeSlash+">"),this.stream.write(this.endline(m,T,N)),T.state=r.None,this.closeNode(m,T,N)},l.prototype.element=function(m,T,N){var I,E,p,w,b,P,A,_,h,i;N||(N=0),this.openNode(m,T,N),T.state=r.OpenTag,this.stream.write(this.indent(m,T,N)+"<"+m.name),h=m.attribs;for(A in h)d.call(h,A)&&(I=h[A],this.attribute(I,T,N));if(p=m.children.length,w=p===0?null:m.children[0],p===0||m.children.every(function(e){return(e.type===o.Text||e.type===o.Raw)&&e.value===""}))T.allowEmpty?(this.stream.write(">"),T.state=r.CloseTag,this.stream.write("</"+m.name+">")):(T.state=r.CloseTag,this.stream.write(T.spaceBeforeSlash+"/>"));else if(T.pretty&&p===1&&(w.type===o.Text||w.type===o.Raw)&&w.value!=null)this.stream.write(">"),T.state=r.InsideTag,T.suppressPrettyCount++,_=!0,this.writeChildNode(w,T,N+1),T.suppressPrettyCount--,_=!1,T.state=r.CloseTag,this.stream.write("</"+m.name+">");else{for(this.stream.write(">"+this.endline(m,T,N)),T.state=r.InsideTag,i=m.children,b=0,P=i.length;b<P;b++)E=i[b],this.writeChildNode(E,T,N+1);T.state=r.CloseTag,this.stream.write(this.indent(m,T,N)+"</"+m.name+">")}return this.stream.write(this.endline(m,T,N)),T.state=r.None,this.closeNode(m,T,N)},l.prototype.processingInstruction=function(m,T,N){return this.stream.write(l.__super__.processingInstruction.call(this,m,T,N))},l.prototype.raw=function(m,T,N){return this.stream.write(l.__super__.raw.call(this,m,T,N))},l.prototype.text=function(m,T,N){return this.stream.write(l.__super__.text.call(this,m,T,N))},l.prototype.dtdAttList=function(m,T,N){return this.stream.write(l.__super__.dtdAttList.call(this,m,T,N))},l.prototype.dtdElement=function(m,T,N){return this.stream.write(l.__super__.dtdElement.call(this,m,T,N))},l.prototype.dtdEntity=function(m,T,N){return this.stream.write(l.__super__.dtdEntity.call(this,m,T,N))},l.prototype.dtdNotation=function(m,T,N){return this.stream.write(l.__super__.dtdNotation.call(this,m,T,N))},l})(g)}).call(pr)});var gr=F((mr,ot)=>{(function(){var o,r,c,g,a,d,u,l,m,T;T=$(),l=T.assign,m=T.isFunction,c=Rt(),g=kt(),a=hr(),u=Lt(),d=yr(),o=W(),r=ht(),ot.exports.create=function(N,I,E,p){var w,b;if(N==null)throw new Error("Root element needs a name.");return p=l({},I,E,p),w=new g(p),b=w.element(N),p.headless||(w.declaration(p),(p.pubID!=null||p.sysID!=null)&&w.dtd(p)),b},ot.exports.begin=function(N,I,E){var p;return m(N)&&(p=[N,I],I=p[0],E=p[1],N={}),I?new a(N,I,E):new g(N)},ot.exports.stringWriter=function(N){return new u(N)},ot.exports.streamWriter=function(N,I){return new d(N,I)},ot.exports.implementation=new c,ot.exports.nodeType=o,ot.exports.writerState=r}).call(mr)});var wr=F(Wt=>{(function(){"use strict";var o,r,c,g,a,d={}.hasOwnProperty;o=gr(),r=dt().defaults,g=function(u){return typeof u=="string"&&(u.indexOf("&")>=0||u.indexOf(">")>=0||u.indexOf("<")>=0)},a=function(u){return"<![CDATA["+c(u)+"]]>"},c=function(u){return u.replace("]]>","]]]]><![CDATA[>")},Wt.Builder=(function(){function u(l){var m,T,N;this.options={},T=r["0.2"];for(m in T)d.call(T,m)&&(N=T[m],this.options[m]=N);for(m in l)d.call(l,m)&&(N=l[m],this.options[m]=N)}return u.prototype.buildObject=function(l){var m,T,N,I,E;return m=this.options.attrkey,T=this.options.charkey,Object.keys(l).length===1&&this.options.rootName===r["0.2"].rootName?(E=Object.keys(l)[0],l=l[E]):E=this.options.rootName,N=(function(p){return function(w,b){var P,A,_,h,i,e;if(typeof b!="object")p.options.cdata&&g(b)?w.raw(a(b)):w.txt(b);else if(Array.isArray(b)){for(h in b)if(d.call(b,h)){A=b[h];for(i in A)_=A[i],w=N(w.ele(i),_).up()}}else for(i in b)if(d.call(b,i))if(A=b[i],i===m){if(typeof A=="object")for(P in A)e=A[P],w=w.att(P,e)}else if(i===T)p.options.cdata&&g(A)?w=w.raw(a(A)):w=w.txt(A);else if(Array.isArray(A))for(h in A)d.call(A,h)&&(_=A[h],typeof _=="string"?p.options.cdata&&g(_)?w=w.ele(i).raw(a(_)).up():w=w.ele(i,_).up():w=N(w.ele(i),_).up());else typeof A=="object"?w=N(w.ele(i),A).up():typeof A=="string"&&p.options.cdata&&g(A)?w=w.ele(i).raw(a(A)).up():(A==null&&(A=""),w=w.ele(i,A.toString()).up());return w}})(this),I=o.create(E,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),N(I,l).end(this.options.renderOpts)},u})()}).call(Wt)});var Tr=F((li,Gt)=>{function K(o){if(o)return $r(o);this._callbacks=new Map}function $r(o){return Object.assign(o,K.prototype),o._callbacks=new Map,o}K.prototype.on=function(o,r){let c=this._callbacks.get(o)??[];return c.push(r),this._callbacks.set(o,c),this};K.prototype.once=function(o,r){let c=(...g)=>{this.off(o,c),r.apply(this,g)};return c.fn=r,this.on(o,c),this};K.prototype.off=function(o,r){if(o===void 0&&r===void 0)return this._callbacks.clear(),this;if(r===void 0)return this._callbacks.delete(o),this;let c=this._callbacks.get(o);if(c){for(let[g,a]of c.entries())if(a===r||a.fn===r){c.splice(g,1);break}c.length===0?this._callbacks.delete(o):this._callbacks.set(o,c)}return this};K.prototype.emit=function(o,...r){let c=this._callbacks.get(o);if(c){let g=[...c];for(let a of g)a.apply(this,r)}return this};K.prototype.listeners=function(o){return this._callbacks.get(o)??[]};K.prototype.listenerCount=function(o){if(o)return this.listeners(o).length;let r=0;for(let c of this._callbacks.values())r+=c.length;return r};K.prototype.hasListeners=function(o){return this.listenerCount(o)>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 Gt<"u"&&(Gt.exports=K)});var br=F((fi,Dr)=>{var Er=Tr();function pt(){Er.call(this)}pt.prototype=new Er;Dr.exports=pt;pt.Stream=pt;pt.prototype.pipe=function(o,r){var c=this;function g(N){o.writable&&o.write(N)===!1&&c.pause&&c.pause()}c.on("data",g);function a(){c.readable&&c.resume&&c.resume()}o.on("drain",a),!o._isStdio&&(!r||r.end!==!1)&&(c.on("end",u),c.on("close",l));var d=!1;function u(){d||(d=!0,o.end())}function l(){d||(d=!0,typeof o.destroy=="function"&&o.destroy())}function m(N){if(T(),!this.hasListeners("error"))throw N}c.on("error",m),o.on("error",m);function T(){c.off("data",g),o.off("drain",a),c.off("end",u),c.off("close",l),c.off("error",m),o.off("error",m),c.off("end",T),c.off("close",T),o.off("end",T),o.off("close",T)}return c.on("end",T),c.on("close",T),o.on("end",T),o.on("close",T),o.emit("pipe",c),o}});var Nr=F(Ct=>{(function(o){o.parser=function(n,t){return new c(n,t)},o.SAXParser=c,o.SAXStream=N,o.createStream=m,o.MAX_BUFFER_LENGTH=64*1024;var r=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];o.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function c(n,t){if(!(this instanceof c))return new c(n,t);var L=this;a(L),L.q=L.c="",L.bufferCheckPosition=o.MAX_BUFFER_LENGTH,L.encoding=null,L.opt=t||{},L.opt.lowercase=L.opt.lowercase||L.opt.lowercasetags,L.looseCase=L.opt.lowercase?"toLowerCase":"toUpperCase",L.opt.maxEntityCount=L.opt.maxEntityCount||512,L.opt.maxEntityDepth=L.opt.maxEntityDepth||4,L.entityCount=L.entityDepth=0,L.tags=[],L.closed=L.closedRoot=L.sawRoot=!1,L.tag=L.error=null,L.strict=!!n,L.noscript=!!(n||L.opt.noscript),L.state=s.BEGIN,L.strictEntities=L.opt.strictEntities,L.ENTITIES=L.strictEntities?Object.create(o.XML_ENTITIES):Object.create(o.ENTITIES),L.attribList=[],L.opt.xmlns&&(L.ns=Object.create(b)),L.opt.unquotedAttributeValues===void 0&&(L.opt.unquotedAttributeValues=!n),L.trackPosition=L.opt.position!==!1,L.trackPosition&&(L.position=L.line=L.column=0),C(L,"onready")}Object.create||(Object.create=function(n){function t(){}t.prototype=n;var L=new t;return L}),Object.keys||(Object.keys=function(n){var t=[];for(var L in n)n.hasOwnProperty(L)&&t.push(L);return t});function g(n){for(var t=Math.max(o.MAX_BUFFER_LENGTH,10),L=0,D=0,j=r.length;D<j;D++){var k=n[r[D]].length;if(k>t)switch(r[D]){case"textNode":V(n);break;case"cdata":S(n,"oncdata",n.cdata),n.cdata="";break;case"script":S(n,"onscript",n.script),n.script="";break;default:Z(n,"Max buffer length exceeded: "+r[D])}L=Math.max(L,k)}var G=o.MAX_BUFFER_LENGTH-L;n.bufferCheckPosition=G+n.position}function a(n){for(var t=0,L=r.length;t<L;t++)n[r[t]]=""}function d(n){V(n),n.cdata!==""&&(S(n,"oncdata",n.cdata),n.cdata=""),n.script!==""&&(S(n,"onscript",n.script),n.script="")}c.prototype={end:function(){ct(this)},write:kr,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){d(this)}};var u;try{u=br().Stream}catch{u=function(){}}u||(u=function(){});var l=o.EVENTS.filter(function(n){return n!=="error"&&n!=="end"});function m(n,t){return new N(n,t)}function T(n,t){if(n.length>=2){if(n[0]===255&&n[1]===254)return"utf-16le";if(n[0]===254&&n[1]===255)return"utf-16be"}return n.length>=3&&n[0]===239&&n[1]===187&&n[2]===191?"utf8":n.length>=4?n[0]===60&&n[1]===0&&n[2]===63&&n[3]===0?"utf-16le":n[0]===0&&n[1]===60&&n[2]===0&&n[3]===63?"utf-16be":"utf8":t?"utf8":null}function N(n,t){if(!(this instanceof N))return new N(n,t);u.apply(this),this._parser=new c(n,t),this.writable=!0,this.readable=!0;var L=this;this._parser.onend=function(){L.emit("end")},this._parser.onerror=function(D){L.emit("error",D),L._parser.error=null},this._decoder=null,this._decoderBuffer=null,l.forEach(function(D){Object.defineProperty(L,"on"+D,{get:function(){return L._parser["on"+D]},set:function(j){if(!j)return L.removeAllListeners(D),L._parser["on"+D]=j,j;L.on(D,j)},enumerable:!0,configurable:!1})})}N.prototype=Object.create(u.prototype,{constructor:{value:N}}),N.prototype._decodeBuffer=function(n,t){if(this._decoderBuffer&&(n=Buffer.concat([this._decoderBuffer,n]),this._decoderBuffer=null),!this._decoder){var L=T(n,t);if(!L)return this._decoderBuffer=n,"";this._parser.encoding=L,this._decoder=new TextDecoder(L)}return this._decoder.decode(n,{stream:!t})},N.prototype.write=function(n){if(typeof Buffer=="function"&&typeof Buffer.isBuffer=="function"&&Buffer.isBuffer(n))n=this._decodeBuffer(n,!1);else if(this._decoderBuffer){var t=this._decodeBuffer(Buffer.alloc(0),!0);t&&(this._parser.write(t),this.emit("data",t))}return this._parser.write(n.toString()),this.emit("data",n),!0},N.prototype.end=function(n){if(n&&n.length&&this.write(n),this._decoderBuffer){var t=this._decodeBuffer(Buffer.alloc(0),!0);t&&(this._parser.write(t),this.emit("data",t))}else if(this._decoder){var L=this._decoder.decode();L&&(this._parser.write(L),this.emit("data",L))}return this._parser.end(),!0},N.prototype.on=function(n,t){var L=this;return!L._parser["on"+n]&&l.indexOf(n)!==-1&&(L._parser["on"+n]=function(){var D=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);D.splice(0,0,n),L.emit.apply(L,D)}),u.prototype.on.call(L,n,t)};var I="[CDATA[",E="DOCTYPE",p="http://www.w3.org/XML/1998/namespace",w="http://www.w3.org/2000/xmlns/",b={xml:p,xmlns:w},P=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,A=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,_=/[#:_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]/,h=/[#:_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 i(n){return n===" "||n===`
|
|
4
|
-
`||n==="\r"||n===" "}function e(n){return n==='"'||n==="'"}function f(n){return n===">"||i(n)}function v(n,t){return n.test(t)}function O(n,t){return!v(n,t)}var s=0;o.STATE={BEGIN:s++,BEGIN_WHITESPACE:s++,TEXT:s++,TEXT_ENTITY:s++,OPEN_WAKA:s++,SGML_DECL:s++,SGML_DECL_QUOTED:s++,DOCTYPE:s++,DOCTYPE_QUOTED:s++,DOCTYPE_DTD:s++,DOCTYPE_DTD_QUOTED:s++,COMMENT_STARTING:s++,COMMENT:s++,COMMENT_ENDING:s++,COMMENT_ENDED:s++,CDATA:s++,CDATA_ENDING:s++,CDATA_ENDING_2:s++,PROC_INST:s++,PROC_INST_BODY:s++,PROC_INST_ENDING:s++,OPEN_TAG:s++,OPEN_TAG_SLASH:s++,ATTRIB:s++,ATTRIB_NAME:s++,ATTRIB_NAME_SAW_WHITE:s++,ATTRIB_VALUE:s++,ATTRIB_VALUE_QUOTED:s++,ATTRIB_VALUE_CLOSED:s++,ATTRIB_VALUE_UNQUOTED:s++,ATTRIB_VALUE_ENTITY_Q:s++,ATTRIB_VALUE_ENTITY_U:s++,CLOSE_TAG:s++,CLOSE_TAG_SAW_WHITE:s++,SCRIPT:s++,SCRIPT_ENDING:s++},o.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},o.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(o.ENTITIES).forEach(function(n){var t=o.ENTITIES[n],L=typeof t=="number"?String.fromCharCode(t):t;o.ENTITIES[n]=L});for(var y in o.STATE)o.STATE[o.STATE[y]]=y;s=o.STATE;function C(n,t,L){n[t]&&n[t](L)}function M(n){var t=n&&n.match(/(?:^|\s)encoding\s*=\s*(['"])([^'"]+)\1/i);return t?t[2]:null}function x(n){return n?n.toLowerCase().replace(/[^a-z0-9]/g,""):null}function X(n,t){let L=x(n),D=x(t);return!L||!D?!0:D==="utf16"?L==="utf16le"||L==="utf16be":L===D}function q(n,t){if(!(!n.strict||!n.encoding||!t||t.name!=="xml")){var L=M(t.body);L&&!X(n.encoding,L)&&B(n,"XML declaration encoding "+L+" does not match detected stream encoding "+n.encoding.toUpperCase())}}function S(n,t,L){n.textNode&&V(n),C(n,t,L)}function V(n){n.textNode=R(n.opt,n.textNode),n.textNode&&C(n,"ontext",n.textNode),n.textNode=""}function R(n,t){return n.trim&&(t=t.trim()),n.normalize&&(t=t.replace(/\s+/g," ")),t}function Z(n,t){return V(n),n.trackPosition&&(t+=`
|
|
5
|
-
Line: `+n.line+`
|
|
6
|
-
Column: `+n.column+`
|
|
7
|
-
Char: `+n.c),t=new Error(t),n.error=t,C(n,"onerror",t),n}function ct(n){return n.sawRoot&&!n.closedRoot&&B(n,"Unclosed root tag"),n.state!==s.BEGIN&&n.state!==s.BEGIN_WHITESPACE&&n.state!==s.TEXT&&Z(n,"Unexpected end"),V(n),n.c="",n.closed=!0,C(n,"onend"),c.call(n,n.strict,n.opt),n}function B(n,t){if(typeof n!="object"||!(n instanceof c))throw new Error("bad call to strictFail");n.strict&&Z(n,t)}function Ur(n){n.strict||(n.tagName=n.tagName[n.looseCase]());var t=n.tags[n.tags.length-1]||n,L=n.tag={name:n.tagName,attributes:{}};n.opt.xmlns&&(L.ns=t.ns),n.attribList.length=0,S(n,"onopentagstart",L)}function Mt(n,t){var L=n.indexOf(":"),D=L<0?["",n]:n.split(":"),j=D[0],k=D[1];return t&&n==="xmlns"&&(j="xmlns",k=""),{prefix:j,local:k}}function xt(n){if(n.strict||(n.attribName=n.attribName[n.looseCase]()),n.attribList.indexOf(n.attribName)!==-1||n.tag.attributes.hasOwnProperty(n.attribName)){n.attribName=n.attribValue="";return}if(n.opt.xmlns){var t=Mt(n.attribName,!0),L=t.prefix,D=t.local;if(L==="xmlns")if(D==="xml"&&n.attribValue!==p)B(n,"xml: prefix must be bound to "+p+`
|
|
8
|
-
Actual: `+n.attribValue);else if(D==="xmlns"&&n.attribValue!==w)B(n,"xmlns: prefix must be bound to "+w+`
|
|
9
|
-
Actual: `+n.attribValue);else{var j=n.tag,k=n.tags[n.tags.length-1]||n;j.ns===k.ns&&(j.ns=Object.create(k.ns)),j.ns[D]=n.attribValue}n.attribList.push([n.attribName,n.attribValue])}else n.tag.attributes[n.attribName]=n.attribValue,S(n,"onattribute",{name:n.attribName,value:n.attribValue});n.attribName=n.attribValue=""}function st(n,t){if(n.opt.xmlns){var L=n.tag,D=Mt(n.tagName);L.prefix=D.prefix,L.local=D.local,L.uri=L.ns[D.prefix]||"",L.prefix&&!L.uri&&(B(n,"Unbound namespace prefix: "+JSON.stringify(n.tagName)),L.uri=D.prefix);var j=n.tags[n.tags.length-1]||n;L.ns&&j.ns!==L.ns&&Object.keys(L.ns).forEach(function($t){S(n,"onopennamespace",{prefix:$t,uri:L.ns[$t]})});for(var k=0,G=n.attribList.length;k<G;k++){var z=n.attribList[k],H=z[0],J=z[1],Y=Mt(H,!0),tt=Y.prefix,Wr=Y.local,Zt=tt===""?"":L.ns[tt]||"",Xt={name:H,value:J,prefix:tt,local:Wr,uri:Zt};tt&&tt!=="xmlns"&&!Zt&&(B(n,"Unbound namespace prefix: "+JSON.stringify(tt)),Xt.uri=tt),n.tag.attributes[H]=Xt,S(n,"onattribute",Xt)}n.attribList.length=0}n.tag.isSelfClosing=!!t,n.sawRoot=!0,n.tags.push(n.tag),S(n,"onopentag",n.tag),t||(!n.noscript&&n.tagName.toLowerCase()==="script"?n.state=s.SCRIPT:n.state=s.TEXT,n.tag=null,n.tagName=""),n.attribName=n.attribValue="",n.attribList.length=0}function St(n){if(!n.tagName){B(n,"Weird empty close tag."),n.textNode+="</>",n.state=s.TEXT;return}if(n.script){if(n.tagName!=="script"){n.script+="</"+n.tagName+">",n.tagName="",n.state=s.SCRIPT;return}S(n,"onscript",n.script),n.script=""}var t=n.tags.length,L=n.tagName;n.strict||(L=L[n.looseCase]());for(var D=L;t--;){var j=n.tags[t];if(j.name!==D)B(n,"Unexpected close tag");else break}if(t<0){B(n,"Unmatched closing tag: "+n.tagName),n.textNode+="</"+n.tagName+">",n.state=s.TEXT;return}n.tagName=L;for(var k=n.tags.length;k-- >t;){var G=n.tag=n.tags.pop();n.tagName=n.tag.name,S(n,"onclosetag",n.tagName);var z={};for(var H in G.ns)z[H]=G.ns[H];var J=n.tags[n.tags.length-1]||n;n.opt.xmlns&&G.ns!==J.ns&&Object.keys(G.ns).forEach(function(Y){var tt=G.ns[Y];S(n,"onclosenamespace",{prefix:Y,uri:tt})})}t===0&&(n.closedRoot=!0),n.tagName=n.attribValue=n.attribName="",n.attribList.length=0,n.state=s.TEXT}function Vr(n){var t=n.entity,L=t.toLowerCase(),D,j="";return n.ENTITIES[t]?n.ENTITIES[t]:n.ENTITIES[L]?n.ENTITIES[L]:(t=L,t.charAt(0)==="#"&&(t.charAt(1)==="x"?(t=t.slice(2),D=parseInt(t,16),j=D.toString(16)):(t=t.slice(1),D=parseInt(t,10),j=D.toString(10))),t=t.replace(/^0+/,""),isNaN(D)||j.toLowerCase()!==t||D<0||D>1114111?(B(n,"Invalid character entity"),"&"+n.entity+";"):String.fromCodePoint(D))}function Qt(n,t){t==="<"?(n.state=s.OPEN_WAKA,n.startTagPosition=n.position):i(t)||(B(n,"Non-whitespace before first tag."),n.textNode=t,n.state=s.TEXT)}function Ft(n,t){var L="";return t<n.length&&(L=n.charAt(t)),L}function kr(n){var t=this;if(this.error)throw this.error;if(t.closed)return Z(t,"Cannot write after close. Assign an onready handler.");if(n===null)return ct(t);typeof n=="object"&&(n=n.toString());for(var L=0,D="";D=Ft(n,L++),t.c=D,!!D;)switch(t.trackPosition&&(t.position++,D===`
|
|
10
|
-
`?(t.line++,t.column=0):t.column++),t.state){case s.BEGIN:if(t.state=s.BEGIN_WHITESPACE,D==="\uFEFF")continue;Qt(t,D);continue;case s.BEGIN_WHITESPACE:Qt(t,D);continue;case s.TEXT:if(t.sawRoot&&!t.closedRoot){for(var k=L-1;D&&D!=="<"&&D!=="&";)D=Ft(n,L++),D&&t.trackPosition&&(t.position++,D===`
|
|
11
|
-
`?(t.line++,t.column=0):t.column++);t.textNode+=n.substring(k,L-1)}D==="<"&&!(t.sawRoot&&t.closedRoot&&!t.strict)?(t.state=s.OPEN_WAKA,t.startTagPosition=t.position):(!i(D)&&(!t.sawRoot||t.closedRoot)&&B(t,"Text data outside of root node."),D==="&"?t.state=s.TEXT_ENTITY:t.textNode+=D);continue;case s.SCRIPT:D==="<"?t.state=s.SCRIPT_ENDING:t.script+=D;continue;case s.SCRIPT_ENDING:D==="/"?t.state=s.CLOSE_TAG:(t.script+="<"+D,t.state=s.SCRIPT);continue;case s.OPEN_WAKA:if(D==="!")t.state=s.SGML_DECL,t.sgmlDecl="";else if(!i(D))if(v(P,D))t.state=s.OPEN_TAG,t.tagName=D;else if(D==="/")t.state=s.CLOSE_TAG,t.tagName="";else if(D==="?")t.state=s.PROC_INST,t.procInstName=t.procInstBody="";else{if(B(t,"Unencoded <"),t.startTagPosition+1<t.position){var j=t.position-t.startTagPosition;D=new Array(j).join(" ")+D}t.textNode+="<"+D,t.state=s.TEXT}continue;case s.SGML_DECL:if(t.sgmlDecl+D==="--"){t.state=s.COMMENT,t.comment="",t.sgmlDecl="";continue}t.doctype&&t.doctype!==!0&&t.sgmlDecl?(t.state=s.DOCTYPE_DTD,t.doctype+="<!"+t.sgmlDecl+D,t.sgmlDecl=""):(t.sgmlDecl+D).toUpperCase()===I?(S(t,"onopencdata"),t.state=s.CDATA,t.sgmlDecl="",t.cdata=""):(t.sgmlDecl+D).toUpperCase()===E?(t.state=s.DOCTYPE,(t.doctype||t.sawRoot)&&B(t,"Inappropriately located doctype declaration"),t.doctype="",t.sgmlDecl=""):D===">"?(S(t,"onsgmldeclaration",t.sgmlDecl),t.sgmlDecl="",t.state=s.TEXT):(e(D)&&(t.state=s.SGML_DECL_QUOTED),t.sgmlDecl+=D);continue;case s.SGML_DECL_QUOTED:D===t.q&&(t.state=s.SGML_DECL,t.q=""),t.sgmlDecl+=D;continue;case s.DOCTYPE:D===">"?(t.state=s.TEXT,S(t,"ondoctype",t.doctype),t.doctype=!0):(t.doctype+=D,D==="["?t.state=s.DOCTYPE_DTD:e(D)&&(t.state=s.DOCTYPE_QUOTED,t.q=D));continue;case s.DOCTYPE_QUOTED:t.doctype+=D,D===t.q&&(t.q="",t.state=s.DOCTYPE);continue;case s.DOCTYPE_DTD:D==="]"?(t.doctype+=D,t.state=s.DOCTYPE):D==="<"?(t.state=s.OPEN_WAKA,t.startTagPosition=t.position):e(D)?(t.doctype+=D,t.state=s.DOCTYPE_DTD_QUOTED,t.q=D):t.doctype+=D;continue;case s.DOCTYPE_DTD_QUOTED:t.doctype+=D,D===t.q&&(t.state=s.DOCTYPE_DTD,t.q="");continue;case s.COMMENT:D==="-"?t.state=s.COMMENT_ENDING:t.comment+=D;continue;case s.COMMENT_ENDING:D==="-"?(t.state=s.COMMENT_ENDED,t.comment=R(t.opt,t.comment),t.comment&&S(t,"oncomment",t.comment),t.comment=""):(t.comment+="-"+D,t.state=s.COMMENT);continue;case s.COMMENT_ENDED:D!==">"?(B(t,"Malformed comment"),t.comment+="--"+D,t.state=s.COMMENT):t.doctype&&t.doctype!==!0?t.state=s.DOCTYPE_DTD:t.state=s.TEXT;continue;case s.CDATA:for(var k=L-1;D&&D!=="]";)D=Ft(n,L++),D&&t.trackPosition&&(t.position++,D===`
|
|
12
|
-
`?(t.line++,t.column=0):t.column++);t.cdata+=n.substring(k,L-1),D==="]"&&(t.state=s.CDATA_ENDING);continue;case s.CDATA_ENDING:D==="]"?t.state=s.CDATA_ENDING_2:(t.cdata+="]"+D,t.state=s.CDATA);continue;case s.CDATA_ENDING_2:D===">"?(t.cdata&&S(t,"oncdata",t.cdata),S(t,"onclosecdata"),t.cdata="",t.state=s.TEXT):D==="]"?t.cdata+="]":(t.cdata+="]]"+D,t.state=s.CDATA);continue;case s.PROC_INST:D==="?"?t.state=s.PROC_INST_ENDING:i(D)?t.state=s.PROC_INST_BODY:t.procInstName+=D;continue;case s.PROC_INST_BODY:if(!t.procInstBody&&i(D))continue;D==="?"?t.state=s.PROC_INST_ENDING:t.procInstBody+=D;continue;case s.PROC_INST_ENDING:if(D===">"){let J={name:t.procInstName,body:t.procInstBody};q(t,J),S(t,"onprocessinginstruction",J),t.procInstName=t.procInstBody="",t.state=s.TEXT}else t.procInstBody+="?"+D,t.state=s.PROC_INST_BODY;continue;case s.OPEN_TAG:v(A,D)?t.tagName+=D:(Ur(t),D===">"?st(t):D==="/"?t.state=s.OPEN_TAG_SLASH:(i(D)||B(t,"Invalid character in tag name"),t.state=s.ATTRIB));continue;case s.OPEN_TAG_SLASH:D===">"?(st(t,!0),St(t)):(B(t,"Forward-slash in opening tag not followed by >"),t.state=s.ATTRIB);continue;case s.ATTRIB:if(i(D))continue;D===">"?st(t):D==="/"?t.state=s.OPEN_TAG_SLASH:v(P,D)?(t.attribName=D,t.attribValue="",t.state=s.ATTRIB_NAME):B(t,"Invalid attribute name");continue;case s.ATTRIB_NAME:D==="="?t.state=s.ATTRIB_VALUE:D===">"?(B(t,"Attribute without value"),t.attribValue=t.attribName,xt(t),st(t)):i(D)?t.state=s.ATTRIB_NAME_SAW_WHITE:v(A,D)?t.attribName+=D:B(t,"Invalid attribute name");continue;case s.ATTRIB_NAME_SAW_WHITE:if(D==="=")t.state=s.ATTRIB_VALUE;else{if(i(D))continue;B(t,"Attribute without value"),t.tag.attributes[t.attribName]="",t.attribValue="",S(t,"onattribute",{name:t.attribName,value:""}),t.attribName="",D===">"?st(t):v(P,D)?(t.attribName=D,t.state=s.ATTRIB_NAME):(B(t,"Invalid attribute name"),t.state=s.ATTRIB)}continue;case s.ATTRIB_VALUE:if(i(D))continue;e(D)?(t.q=D,t.state=s.ATTRIB_VALUE_QUOTED):(t.opt.unquotedAttributeValues||Z(t,"Unquoted attribute value"),t.state=s.ATTRIB_VALUE_UNQUOTED,t.attribValue=D);continue;case s.ATTRIB_VALUE_QUOTED:if(D!==t.q){D==="&"?t.state=s.ATTRIB_VALUE_ENTITY_Q:t.attribValue+=D;continue}xt(t),t.q="",t.state=s.ATTRIB_VALUE_CLOSED;continue;case s.ATTRIB_VALUE_CLOSED:i(D)?t.state=s.ATTRIB:D===">"?st(t):D==="/"?t.state=s.OPEN_TAG_SLASH:v(P,D)?(B(t,"No whitespace between attributes"),t.attribName=D,t.attribValue="",t.state=s.ATTRIB_NAME):B(t,"Invalid attribute name");continue;case s.ATTRIB_VALUE_UNQUOTED:if(!f(D)){D==="&"?t.state=s.ATTRIB_VALUE_ENTITY_U:t.attribValue+=D;continue}xt(t),D===">"?st(t):t.state=s.ATTRIB;continue;case s.CLOSE_TAG:if(t.tagName)D===">"?St(t):v(A,D)?t.tagName+=D:t.script?(t.script+="</"+t.tagName+D,t.tagName="",t.state=s.SCRIPT):(i(D)||B(t,"Invalid tagname in closing tag"),t.state=s.CLOSE_TAG_SAW_WHITE);else{if(i(D))continue;O(P,D)?t.script?(t.script+="</"+D,t.state=s.SCRIPT):B(t,"Invalid tagname in closing tag."):t.tagName=D}continue;case s.CLOSE_TAG_SAW_WHITE:if(i(D))continue;D===">"?St(t):B(t,"Invalid characters in closing tag");continue;case s.TEXT_ENTITY:case s.ATTRIB_VALUE_ENTITY_Q:case s.ATTRIB_VALUE_ENTITY_U:var G,z;switch(t.state){case s.TEXT_ENTITY:G=s.TEXT,z="textNode";break;case s.ATTRIB_VALUE_ENTITY_Q:G=s.ATTRIB_VALUE_QUOTED,z="attribValue";break;case s.ATTRIB_VALUE_ENTITY_U:G=s.ATTRIB_VALUE_UNQUOTED,z="attribValue";break}if(D===";"){var H=Vr(t);t.opt.unparsedEntities&&!Object.values(o.XML_ENTITIES).includes(H)?((t.entityCount+=1)>t.opt.maxEntityCount&&Z(t,"Parsed entity count exceeds max entity count"),(t.entityDepth+=1)>t.opt.maxEntityDepth&&Z(t,"Parsed entity depth exceeds max entity depth"),t.entity="",t.state=G,t.write(H),t.entityDepth-=1):(t[z]+=H,t.entity="",t.state=G)}else v(t.entity.length?h:_,D)?t.entity+=D:(B(t,"Invalid character in entity name"),t[z]+="&"+t.entity+D,t.entity="",t.state=G);continue;default:throw new Error(t,"Unknown state: "+t.state)}return t.position>=t.bufferCheckPosition&&g(t),t}String.fromCodePoint||(function(){var n=String.fromCharCode,t=Math.floor,L=function(){var D=16384,j=[],k,G,z=-1,H=arguments.length;if(!H)return"";for(var J="";++z<H;){var Y=Number(arguments[z]);if(!isFinite(Y)||Y<0||Y>1114111||t(Y)!==Y)throw RangeError("Invalid code point: "+Y);Y<=65535?j.push(Y):(Y-=65536,k=(Y>>10)+55296,G=Y%1024+56320,j.push(k,G)),(z+1===H||j.length>D)&&(J+=n.apply(null,j),j.length=0)}return J};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:L,configurable:!0,writable:!0}):String.fromCodePoint=L})()})(typeof Ct>"u"?Ct.sax={}:Ct)});var Sr=F((pi,Yt)=>{"use strict";var lt=typeof Reflect=="object"?Reflect:null,Or=lt&&typeof lt.apply=="function"?lt.apply:function(r,c,g){return Function.prototype.apply.call(r,c,g)},At;lt&&typeof lt.ownKeys=="function"?At=lt.ownKeys:Object.getOwnPropertySymbols?At=function(r){return Object.getOwnPropertyNames(r).concat(Object.getOwnPropertySymbols(r))}:At=function(r){return Object.getOwnPropertyNames(r)};function Jr(o){console&&console.warn&&console.warn(o)}var vr=Number.isNaN||function(r){return r!==r};function U(){U.init.call(this)}Yt.exports=U;Yt.exports.once=ii;U.EventEmitter=U;U.prototype._events=void 0;U.prototype._eventsCount=0;U.prototype._maxListeners=void 0;var Ir=10;function Pt(o){if(typeof o!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof o)}Object.defineProperty(U,"defaultMaxListeners",{enumerable:!0,get:function(){return Ir},set:function(o){if(typeof o!="number"||o<0||vr(o))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+o+".");Ir=o}});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||vr(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 _r(o){return o._maxListeners===void 0?U.defaultMaxListeners:o._maxListeners}U.prototype.getMaxListeners=function(){return _r(this)};U.prototype.emit=function(r){for(var c=[],g=1;g<arguments.length;g++)c.push(arguments[g]);var a=r==="error",d=this._events;if(d!==void 0)a=a&&d.error===void 0;else if(!a)return!1;if(a){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=d[r];if(m===void 0)return!1;if(typeof m=="function")Or(m,this,c);else for(var T=m.length,N=Mr(m,T),g=0;g<T;++g)Or(N[g],this,c);return!0};function Lr(o,r,c,g){var a,d,u;if(Pt(c),d=o._events,d===void 0?(d=o._events=Object.create(null),o._eventsCount=0):(d.newListener!==void 0&&(o.emit("newListener",r,c.listener?c.listener:c),d=o._events),u=d[r]),u===void 0)u=d[r]=c,++o._eventsCount;else if(typeof u=="function"?u=d[r]=g?[c,u]:[u,c]:g?u.unshift(c):u.push(c),a=_r(o),a>0&&u.length>a&&!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=o,l.type=r,l.count=u.length,Jr(l)}return o}U.prototype.addListener=function(r,c){return Lr(this,r,c,!1)};U.prototype.on=U.prototype.addListener;U.prototype.prependListener=function(r,c){return Lr(this,r,c,!0)};function ti(){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 Cr(o,r,c){var g={fired:!1,wrapFn:void 0,target:o,type:r,listener:c},a=ti.bind(g);return a.listener=c,g.wrapFn=a,a}U.prototype.once=function(r,c){return Pt(c),this.on(r,Cr(this,r,c)),this};U.prototype.prependOnceListener=function(r,c){return Pt(c),this.prependListener(r,Cr(this,r,c)),this};U.prototype.removeListener=function(r,c){var g,a,d,u,l;if(Pt(c),a=this._events,a===void 0)return this;if(g=a[r],g===void 0)return this;if(g===c||g.listener===c)--this._eventsCount===0?this._events=Object.create(null):(delete a[r],a.removeListener&&this.emit("removeListener",r,g.listener||c));else if(typeof g!="function"){for(d=-1,u=g.length-1;u>=0;u--)if(g[u]===c||g[u].listener===c){l=g[u].listener,d=u;break}if(d<0)return this;d===0?g.shift():ei(g,d),g.length===1&&(a[r]=g[0]),a.removeListener!==void 0&&this.emit("removeListener",r,l||c)}return this};U.prototype.off=U.prototype.removeListener;U.prototype.removeAllListeners=function(r){var c,g,a;if(g=this._events,g===void 0)return this;if(g.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):g[r]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete g[r]),this;if(arguments.length===0){var d=Object.keys(g),u;for(a=0;a<d.length;++a)u=d[a],u!=="removeListener"&&this.removeAllListeners(u);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(c=g[r],typeof c=="function")this.removeListener(r,c);else if(c!==void 0)for(a=c.length-1;a>=0;a--)this.removeListener(r,c[a]);return this};function Ar(o,r,c){var g=o._events;if(g===void 0)return[];var a=g[r];return a===void 0?[]:typeof a=="function"?c?[a.listener||a]:[a]:c?ri(a):Mr(a,a.length)}U.prototype.listeners=function(r){return Ar(this,r,!0)};U.prototype.rawListeners=function(r){return Ar(this,r,!1)};U.listenerCount=function(o,r){return typeof o.listenerCount=="function"?o.listenerCount(r):Pr.call(o,r)};U.prototype.listenerCount=Pr;function Pr(o){var r=this._events;if(r!==void 0){var c=r[o];if(typeof c=="function")return 1;if(c!==void 0)return c.length}return 0}U.prototype.eventNames=function(){return this._eventsCount>0?At(this._events):[]};function Mr(o,r){for(var c=new Array(r),g=0;g<r;++g)c[g]=o[g];return c}function ei(o,r){for(;r+1<o.length;r++)o[r]=o[r+1];o.pop()}function ri(o){for(var r=new Array(o.length),c=0;c<r.length;++c)r[c]=o[c].listener||o[c];return r}function ii(o,r){return new Promise(function(c,g){function a(u){o.removeListener(r,d),g(u)}function d(){typeof o.removeListener=="function"&&o.removeListener("error",a),c([].slice.call(arguments))}xr(o,r,d,{once:!0}),r!=="error"&&ni(o,a,{once:!0})})}function ni(o,r,c){typeof o.on=="function"&&xr(o,"error",r,c)}function xr(o,r,c,g){if(typeof o.on=="function")g.once?o.once(r,c):o.on(r,c);else if(typeof o.addEventListener=="function")o.addEventListener(r,function a(d){g.once&&o.removeEventListener(r,a),c(d)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof o)}});var Fr=F(Kt=>{(function(){"use strict";Kt.stripBOM=function(o){return o[0]==="\uFEFF"?o.substring(1):o}}).call(Kt)});var zt=F(ut=>{(function(){"use strict";var o;o=new RegExp(/(?!xmlns)^.*:/),ut.normalize=function(r){return r.toLowerCase()},ut.firstCharLowerCase=function(r){return r.charAt(0).toLowerCase()+r.slice(1)},ut.stripPrefix=function(r){return r.replace(o,"")},ut.parseNumbers=function(r){return isNaN(r)||(r=r%1===0?parseInt(r,10):parseFloat(r)),r},ut.parseBooleans=function(r){return/^(?:true|false)$/i.test(r)&&(r=r.toLowerCase()==="true"),r}}).call(ut)});var qr=F(Xr=>{Xr.every=function(o){return new Ht(o)};var et={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5};for(at in et)at==="millisecond"?et.ms=et[at]:et[at.charAt(0)]=et[at],et[at+"s"]=et[at];var at;function Ht(o){this.count=0;var r=si(o);r&&(this.time=Number(r[0])*et[r[1]],this.type=r[1])}Ht.prototype.do=function(o){this.time&&(this.interval=setInterval(c,this.time));var r=this;function c(){r.count++,o.call(r)}return this};Ht.prototype.stop=function(){return this.interval&&(clearInterval(this.interval),delete this.interval),this};var oi=/^\s*(\d+(?:\.\d+)?)\s*([a-z]+)\s*$/;function si(o){var r=o.match(oi);return r&&et[r[2]]?r.slice(1):null}});var Rr=F(rt=>{(function(){"use strict";var o,r,c,g,a,d,u,l,m,T=function(E,p){return function(){return E.apply(p,arguments)}},N=function(E,p){for(var w in p)I.call(p,w)&&(E[w]=p[w]);function b(){this.constructor=E}return b.prototype=p.prototype,E.prototype=new b,E.__super__=p.prototype,E},I={}.hasOwnProperty;l=Nr(),g=Sr(),o=Fr(),u=zt(),m=qr().setImmediate,r=dt().defaults,a=function(E){return typeof E=="object"&&E!=null&&Object.keys(E).length===0},d=function(E,p,w){var b,P,A;for(b=0,P=E.length;b<P;b++)A=E[b],p=A(p,w);return p},c=function(E,p,w){var b;return b=Object.create(null),b.value=w,b.writable=!0,b.enumerable=!0,b.configurable=!0,Object.defineProperty(E,p,b)},rt.Parser=(function(E){N(p,E);function p(w){this.parseStringPromise=T(this.parseStringPromise,this),this.parseString=T(this.parseString,this),this.reset=T(this.reset,this),this.assignOrPush=T(this.assignOrPush,this),this.processAsync=T(this.processAsync,this);var b,P,A;if(!(this instanceof rt.Parser))return new rt.Parser(w);this.options={},P=r["0.2"];for(b in P)I.call(P,b)&&(A=P[b],this.options[b]=A);for(b in w)I.call(w,b)&&(A=w[b],this.options[b]=A);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 w,b;try{return this.remaining.length<=this.options.chunkSize?(w=this.remaining,this.remaining="",this.saxParser=this.saxParser.write(w),this.saxParser.close()):(w=this.remaining.substr(0,this.options.chunkSize),this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length),this.saxParser=this.saxParser.write(w),m(this.processAsync))}catch(P){if(b=P,!this.saxParser.errThrown)return this.saxParser.errThrown=!0,this.emit(b)}},p.prototype.assignOrPush=function(w,b,P){return b in w?(w[b]instanceof Array||c(w,b,[w[b]]),w[b].push(P)):this.options.explicitArray?c(w,b,[P]):c(w,b,P)},p.prototype.reset=function(){var w,b,P,A;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(_){return function(h){if(_.saxParser.resume(),!_.saxParser.errThrown)return _.saxParser.errThrown=!0,_.emit("error",h)}})(this),this.saxParser.onend=(function(_){return function(){if(!_.saxParser.ended)return _.saxParser.ended=!0,_.emit("end",_.resultObject)}})(this),this.saxParser.ended=!1,this.EXPLICIT_CHARKEY=this.options.explicitCharkey,this.resultObject=null,A=[],w=this.options.attrkey,b=this.options.charkey,this.saxParser.onopentag=(function(_){return function(h){var i,e,f,v,O;if(f={},f[b]="",!_.options.ignoreAttrs){O=h.attributes;for(i in O)I.call(O,i)&&(!(w in f)&&!_.options.mergeAttrs&&(f[w]={}),e=_.options.attrValueProcessors?d(_.options.attrValueProcessors,h.attributes[i],i):h.attributes[i],v=_.options.attrNameProcessors?d(_.options.attrNameProcessors,i):i,_.options.mergeAttrs?_.assignOrPush(f,v,e):c(f[w],v,e))}return f["#name"]=_.options.tagNameProcessors?d(_.options.tagNameProcessors,h.name):h.name,_.options.xmlns&&(f[_.options.xmlnskey]={uri:h.uri,local:h.local}),A.push(f)}})(this),this.saxParser.onclosetag=(function(_){return function(){var h,i,e,f,v,O,s,y,C,M;if(O=A.pop(),v=O["#name"],(!_.options.explicitChildren||!_.options.preserveChildrenOrder)&&delete O["#name"],O.cdata===!0&&(h=O.cdata,delete O.cdata),C=A[A.length-1],O[b].match(/^\s*$/)&&!h?(i=O[b],delete O[b]):(_.options.trim&&(O[b]=O[b].trim()),_.options.normalize&&(O[b]=O[b].replace(/\s{2,}/g," ").trim()),O[b]=_.options.valueProcessors?d(_.options.valueProcessors,O[b],v):O[b],Object.keys(O).length===1&&b in O&&!_.EXPLICIT_CHARKEY&&(O=O[b])),a(O)&&(typeof _.options.emptyTag=="function"?O=_.options.emptyTag():O=_.options.emptyTag!==""?_.options.emptyTag:i),_.options.validator!=null&&(M="/"+(function(){var x,X,q;for(q=[],x=0,X=A.length;x<X;x++)f=A[x],q.push(f["#name"]);return q})().concat(v).join("/"),(function(){var x;try{return O=_.options.validator(M,C&&C[v],O)}catch(X){return x=X,_.emit("error",x)}})()),_.options.explicitChildren&&!_.options.mergeAttrs&&typeof O=="object"){if(!_.options.preserveChildrenOrder)f={},_.options.attrkey in O&&(f[_.options.attrkey]=O[_.options.attrkey],delete O[_.options.attrkey]),!_.options.charsAsChildren&&_.options.charkey in O&&(f[_.options.charkey]=O[_.options.charkey],delete O[_.options.charkey]),Object.getOwnPropertyNames(O).length>0&&(f[_.options.childkey]=O),O=f;else if(C){C[_.options.childkey]=C[_.options.childkey]||[],s={};for(e in O)I.call(O,e)&&c(s,e,O[e]);C[_.options.childkey].push(s),delete O["#name"],Object.keys(O).length===1&&b in O&&!_.EXPLICIT_CHARKEY&&(O=O[b])}}return A.length>0?_.assignOrPush(C,v,O):(_.options.explicitRoot&&(y=O,O={},c(O,v,y)),_.resultObject=O,_.saxParser.ended=!0,_.emit("end",_.resultObject))}})(this),P=(function(_){return function(h){var i,e;if(e=A[A.length-1],e)return e[b]+=h,_.options.explicitChildren&&_.options.preserveChildrenOrder&&_.options.charsAsChildren&&(_.options.includeWhiteChars||h.replace(/\\n/g,"").trim()!=="")&&(e[_.options.childkey]=e[_.options.childkey]||[],i={"#name":"__text__"},i[b]=h,_.options.normalize&&(i[b]=i[b].replace(/\s{2,}/g," ").trim()),e[_.options.childkey].push(i)),e}})(this),this.saxParser.ontext=P,this.saxParser.oncdata=(function(_){return function(h){var i;if(i=P(h),i)return i.cdata=!0}})(this)},p.prototype.parseString=function(w,b){var P;b!=null&&typeof b=="function"&&(this.on("end",function(A){return this.reset(),b(null,A)}),this.on("error",function(A){return this.reset(),b(A)}));try{return w=w.toString(),w.trim()===""?(this.emit("end",null),!0):(w=o.stripBOM(w),this.options.async?(this.remaining=w,m(this.processAsync),this.saxParser):this.saxParser.write(w).close())}catch(A){if(P=A,this.saxParser.errThrown||this.saxParser.ended){if(this.saxParser.ended)throw P}else return this.emit("error",P),this.saxParser.errThrown=!0}},p.prototype.parseStringPromise=function(w){return new Promise((function(b){return function(P,A){return b.parseString(w,function(_,h){return _?A(_):P(h)})}})(this))},p})(g),rt.parseString=function(E,p,w){var b,P,A;return w!=null?(typeof w=="function"&&(b=w),typeof p=="object"&&(P=p)):(typeof p=="function"&&(b=p),P={}),A=new rt.Parser(P),A.parseString(E,b)},rt.parseStringPromise=function(E,p){var w,b;return typeof p=="object"&&(w=p),b=new rt.Parser(w),b.parseStringPromise(E)}}).call(rt)});var jr=F(it=>{(function(){"use strict";var o,r,c,g,a=function(u,l){for(var m in l)d.call(l,m)&&(u[m]=l[m]);function T(){this.constructor=u}return T.prototype=l.prototype,u.prototype=new T,u.__super__=l.prototype,u},d={}.hasOwnProperty;r=dt(),o=wr(),c=Rr(),g=zt(),it.defaults=r.defaults,it.processors=g,it.ValidationError=(function(u){a(l,u);function l(m){this.message=m}return l})(Error),it.Builder=o.Builder,it.Parser=c.Parser,it.parseString=c.parseString,it.parseStringPromise=c.parseStringPromise}).call(it)});var Br=Zr(jr());self.onmessage=async o=>{let{sourceType:r,value:c}=o.data,g;try{r==="xml"?g=await(0,Br.parseStringPromise)(c):g=null,self.postMessage(g)}catch{self.postMessage(null)}};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
var _o=Object.create;var fn=Object.defineProperty;var Mo=Object.getOwnPropertyDescriptor;var So=Object.getOwnPropertyNames;var Po=Object.getPrototypeOf,To=Object.prototype.hasOwnProperty;var c=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}};var ko=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of So(t))!To.call(e,i)&&i!==r&&fn(e,i,{get:()=>t[i],enumerable:!(n=Mo(t,i))||n.enumerable});return e};var dn=(e,t,r)=>(r=e!=null?_o(Po(e)):{},ko(t||!e||!e.__esModule?fn(r,"default",{value:e,enumerable:!0}):r,e));var _=c(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 dc=p.sexagesimalPattern=/^([0-9]{1,3})°\s*([0-9]{1,3}(?:\.(?:[0-9]{1,}))?)['′]\s*(([0-9]{1,3}(\.([0-9]{1,}))?)["″]\s*)?([NEOSW]?)$/,mc=p.earthRadius=6378137,pc=p.MINLAT=-90,gc=p.MAXLAT=90,hc=p.MINLON=-180,bc=p.MAXLON=180,xc=p.DEG_TO_RAD=Math.PI/180,yc=p.RAD_TO_DEG=180/Math.PI,vc=p.longitudeKeys=["lng","lon","longitude",0],_c=p.latitudeKeys=["lat","latitude",1],Mc=p.altitudeKeys=["alt","altitude","elevation","elev",2],Sc=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},Pc=p.timeConversion={m:60,h:3600,d:86400},N=p.areaConversion={m2:1,km2:1e-6,ha:1e-4,a:.01,ft2:10.763911,yd2:1.19599,in2:1550.0031};N.sqm=N.m2;N.sqkm=N.km2;N.sqft=N.ft2;N.sqyd=N.yd2;N.sqin=N.in2});var xe=c($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.default=void 0;var qo=(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)},kc=$e.default=qo});var ye=c(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});We.default=void 0;var No=e=>{let t=e.toString().trim();return isNaN(parseFloat(t))?!1:parseFloat(t)===Number(t)},Oc=We.default=No});var ve=c(Ge=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.default=void 0;var jo=_(),Ko=e=>jo.sexagesimalPattern.test(e.toString().trim()),Rc=Ge.default=Ko});var _e=c(ze=>{"use strict";Object.defineProperty(ze,"__esModule",{value:!0});ze.default=void 0;var Fo=_(),Vo=e=>{let t=new RegExp(Fo.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},Dc=ze.default=Vo});var Ze=c(Xe=>{"use strict";Object.defineProperty(Xe,"__esModule",{value:!0});Xe.default=void 0;var hr=_(),br=Uo(xe());function Uo(e){return e&&e.__esModule?e:{default:e}}var Ho=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{longitude:hr.longitudeKeys,latitude:hr.latitudeKeys,altitude:hr.altitudeKeys},r=(0,br.default)(e,t.longitude),n=(0,br.default)(e,t.latitude),i=(0,br.default)(e,t.altitude);return{latitude:n,longitude:r,...i?{altitude:i}:{}}},Ec=Xe.default=Ho});var yr=c(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.default=void 0;var Bo=xr(ye()),$o=xr(ve()),Wo=xr(_e()),Tn=_();function xr(e){return e&&e.__esModule?e:{default:e}}var kn=e=>{if((0,Bo.default)(e)){let t=parseFloat(e);return!(t>Tn.MAXLAT||t<Tn.MINLAT)}return(0,$o.default)(e)?kn((0,Wo.default)(e)):!1},qc=Ye.default=kn});var _r=c(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.default=void 0;var Go=vr(ye()),zo=vr(ve()),Xo=vr(_e()),An=_();function vr(e){return e&&e.__esModule?e:{default:e}}var On=e=>{if((0,Go.default)(e)){let t=parseFloat(e);return!(t>An.MAXLON||t<An.MINLON)}return(0,zo.default)(e)?On((0,Xo.default)(e)):!1},jc=Je.default=On});var Sr=c(Qe=>{"use strict";Object.defineProperty(Qe,"__esModule",{value:!0});Qe.default=void 0;var Zo=Mr(Ze()),wn=Mr(yr()),Rn=Mr(_r());function Mr(e){return e&&e.__esModule?e:{default:e}}var Yo=e=>{let{latitude:t,longitude:r}=(0,Zo.default)(e);if(Array.isArray(e)&&e.length>=2)return(0,Rn.default)(e[0])&&(0,wn.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,wn.default)(i)&&(0,Rn.default)(n)},Fc=Qe.default=Yo});var tt=c(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.default=void 0;var Jo=Se(ye()),Qo=Se(ve()),es=Se(_e()),Ln=Se(Sr()),ts=Se(Ze());function Se(e){return e&&e.__esModule?e:{default:e}}var Me=e=>{if((0,Jo.default)(e))return Number(e);if((0,Qo.default)(e))return(0,es.default)(e);if((0,Ln.default)(e)){let t=(0,ts.default)(e);return Array.isArray(e)?e.map((r,n)=>[0,1].includes(n)?Me(r):r):{...e,...t.latitude&&{[t.latitude]:Me(e[t.latitude])},...t.longitude&&{[t.longitude]:Me(e[t.longitude])}}}return Array.isArray(e)?e.map(t=>(0,Ln.default)(t)?Me(t):t):e},Uc=et.default=Me});var R=c(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.default=void 0;var rs=_(),ns=Dn(xe()),is=Dn(tt());function Dn(e){return e&&e.__esModule?e:{default:e}}var os=(e,t)=>{let r=(0,ns.default)(e,rs.latitudeKeys);if(r==null)return;let n=e[r];return t===!0?n:(0,is.default)(n)},Bc=rt.default=os});var L=c(nt=>{"use strict";Object.defineProperty(nt,"__esModule",{value:!0});nt.default=void 0;var ss=_(),as=In(xe()),us=In(tt());function In(e){return e&&e.__esModule?e:{default:e}}var ls=(e,t)=>{let r=(0,as.default)(e,ss.longitudeKeys);if(r==null)return;let n=e[r];return t===!0?n:(0,us.default)(n)},Wc=nt.default=ls});var j=c(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.default=void 0;var cs=_(),fs=e=>e*cs.DEG_TO_RAD,zc=it.default=fs});var G=c(ot=>{"use strict";Object.defineProperty(ot,"__esModule",{value:!0});ot.default=void 0;var ds=_(),ms=e=>e*ds.RAD_TO_DEG,Zc=ot.default=ms});var Cn=c(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.default=void 0;var ps=st(R()),gs=st(L()),Pr=st(j()),Tr=st(G()),En=_();function st(e){return e&&e.__esModule?e:{default:e}}var hs=function(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:6371e3,i=(0,ps.default)(e),o=(0,gs.default)(e),s=t/n,a=(0,Pr.default)(r),u=(0,Pr.default)(i),m=(0,Pr.default)(o),g=Math.asin(Math.sin(u)*Math.cos(s)+Math.cos(u)*Math.sin(s)*Math.cos(a)),h=m+Math.atan2(Math.sin(a)*Math.sin(s)*Math.cos(u),Math.cos(s)-Math.sin(u)*Math.sin(g)),x=(0,Tr.default)(h);return(x<En.MINLON||x>En.MAXLON)&&(h=(h+3*Math.PI)%(2*Math.PI)-Math.PI,x=(0,Tr.default)(h)),{latitude:(0,Tr.default)(g),longitude:x}},Jc=at.default=hs});var qn=c(ut=>{"use strict";Object.defineProperty(ut,"__esModule",{value:!0});ut.default=void 0;var bs=_(),xs=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"m",r=bs.areaConversion[t];if(r)return e*r;throw new Error("Invalid unit used for area conversion.")},ef=ut.default=xs});var Nn=c(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.default=void 0;var ys=_(),vs=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"m",r=ys.distanceConversion[t];if(r)return e*r;throw new Error("Invalid unit used for distance conversion.")},rf=lt.default=vs});var jn=c(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.default=void 0;var ct=_(),_s=function(e){switch(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"kmh"){case"kmh":return e*ct.timeConversion.h*ct.distanceConversion.km;case"mph":return e*ct.timeConversion.h*ct.distanceConversion.mi;default:return e}},of=ft.default=_s});var Kn=c(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.default=void 0;var Ms=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},Ss=e=>{let[t,r]=e.toString().split("."),n=Math.abs(Number(t)),i=+("0."+(r||0))*60,o=i.toString().split("."),s=Math.floor(i),a=Ms(+("0."+(o[1]||0))*60).toString(),[u,m="0"]=a.split(".");return n+"\xB0 "+s.toString().padStart(2,"0")+"' "+u.padStart(2,"0")+"."+m.padEnd(1,"0")+'"'},af=dt.default=Ss});var kr=c(mt=>{"use strict";Object.defineProperty(mt,"__esModule",{value:!0});mt.default=void 0;var Ps=e=>e>1?1:e<-1?-1:e,lf=mt.default=Ps});var H=c(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.default=void 0;var Fn=pt(R()),Vn=pt(L()),Ar=pt(j()),Ts=pt(kr()),ks=_();function pt(e){return e&&e.__esModule?e:{default:e}}var As=function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;r=isNaN(r)?1:r;let n=(0,Ar.default)((0,Fn.default)(e)),i=(0,Ar.default)((0,Fn.default)(t)),o=(0,Ar.default)((0,Vn.default)(e)-(0,Vn.default)(t)),s=Math.acos((0,Ts.default)(Math.sin(i)*Math.sin(n)+Math.cos(i)*Math.cos(n)*Math.cos(o)))*ks.earthRadius;return Math.round(s/r)*r},ff=gt.default=As});var Or=c(ht=>{"use strict";Object.defineProperty(ht,"__esModule",{value:!0});ht.default=void 0;var Un=Os(H());function Os(e){return e&&e.__esModule?e:{default:e}}var ws=function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Un.default;return r=typeof r=="function"?r:Un.default,t.slice().sort((n,i)=>r(e,n)-r(e,i))},mf=ht.default=ws});var Hn=c(bt=>{"use strict";Object.defineProperty(bt,"__esModule",{value:!0});bt.default=void 0;var Rs=Ls(Or());function Ls(e){return e&&e.__esModule?e:{default:e}}var Ds=(e,t)=>(0,Rs.default)(e,t)[0],gf=bt.default=Ds});var Wn=c(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.default=void 0;var wr=Rr(j()),Is=Rr(R()),Bn=Rr(L()),$n=_();function Rr(e){return e&&e.__esModule?e:{default:e}}var Es=e=>{let t=0;if(e.length>2){let r,n,i;for(let o=0;o<e.length;o++){o===e.length-2?(r=e.length-2,n=e.length-1,i=0):o===e.length-1?(r=e.length-1,n=0,i=1):(r=o,n=o+1,i=o+2);let s=(0,Bn.default)(e[r]),a=(0,Is.default)(e[n]),u=(0,Bn.default)(e[i]);t+=((0,wr.default)(u)-(0,wr.default)(s))*Math.sin((0,wr.default)(a))}t=t*$n.earthRadius*$n.earthRadius/2}return Math.abs(t)},bf=xt.default=Es});var Lr=c(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.default=void 0;var Cs=Gn(R()),qs=Gn(L());function Gn(e){return e&&e.__esModule?e:{default:e}}var Ns=e=>{if(Array.isArray(e)===!1||e.length===0)throw new Error("No points were given.");return e.reduce((t,r)=>{let n=(0,Cs.default)(r),i=(0,qs.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})},yf=yt.default=Ns});var zn=c(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.default=void 0;var js=_t(R()),Ks=_t(L()),ie=_t(j()),vt=_t(G()),Pe=_();function _t(e){return e&&e.__esModule?e:{default:e}}var Fs=(e,t)=>{let r=(0,js.default)(e),n=(0,Ks.default)(e),i=(0,ie.default)(r),o=(0,ie.default)(n),s=t/Pe.earthRadius,a=i-s,u=i+s,m=(0,ie.default)(Pe.MAXLAT),g=(0,ie.default)(Pe.MINLAT),h=(0,ie.default)(Pe.MAXLON),x=(0,ie.default)(Pe.MINLON),k,v;if(a>g&&u<m){let O=Math.asin(Math.sin(s)/Math.cos(i));k=o-O,k<x&&(k+=Math.PI*2),v=o+O,v>h&&(v-=Math.PI*2)}else a=Math.max(a,g),u=Math.min(u,m),k=x,v=h;return[{latitude:(0,vt.default)(a),longitude:(0,vt.default)(k)},{latitude:(0,vt.default)(u),longitude:(0,vt.default)(v)}]},_f=Mt.default=Fs});var Yn=c(Pt=>{"use strict";Object.defineProperty(Pt,"__esModule",{value:!0});Pt.default=void 0;var Vs=St(R()),Us=St(L()),Xn=St(j()),Zn=St(G());function St(e){return e&&e.__esModule?e:{default:e}}var Hs=e=>{if(Array.isArray(e)===!1||e.length===0)return!1;let t=e.length,r=e.reduce((s,a)=>{let u=(0,Xn.default)((0,Vs.default)(a)),m=(0,Xn.default)((0,Us.default)(a));return{X:s.X+Math.cos(u)*Math.cos(m),Y:s.Y+Math.cos(u)*Math.sin(m),Z:s.Z+Math.sin(u)}},{X:0,Y:0,Z:0}),n=r.X/t,i=r.Y/t,o=r.Z/t;return{longitude:(0,Zn.default)(Math.atan2(i,n)),latitude:(0,Zn.default)(Math.atan2(o,Math.sqrt(n*n+i*i)))}},Sf=Pt.default=Hs});var Jn=c(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});Tt.default=void 0;var Bs=$s(Lr());function $s(e){return e&&e.__esModule?e:{default:e}}var Ws=e=>{let t=(0,Bs.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))}},Tf=Tt.default=Ws});var Dr=c(Ot=>{"use strict";Object.defineProperty(Ot,"__esModule",{value:!0});Ot.default=void 0;var Qn=At(R()),ei=At(L()),kt=At(j()),Gs=At(G());function At(e){return e&&e.__esModule?e:{default:e}}var zs=(e,t)=>{let r=(0,kt.default)((0,ei.default)(t))-(0,kt.default)((0,ei.default)(e)),n=Math.log(Math.tan((0,kt.default)((0,Qn.default)(t))/2+Math.PI/4)/Math.tan((0,kt.default)((0,Qn.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,Gs.default)(Math.atan2(r,n))+360)%360},Af=Ot.default=zs});var ri=c(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.default=void 0;var ti=Xs(Dr());function Xs(e){return e&&e.__esModule?e:{default:e}}var Zs=function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ti.default,n=typeof r=="function"?r(e,t):(0,ti.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"}},wf=wt.default=Zs});var Er=c(Rt=>{"use strict";Object.defineProperty(Rt,"__esModule",{value:!0});Rt.default=void 0;var Ir=ii(H()),ni=ii(kr());function ii(e){return e&&e.__esModule?e:{default:e}}var Ys=function(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1,i=(0,Ir.default)(t,e,n),o=(0,Ir.default)(e,r,n),s=(0,Ir.default)(t,r,n),a=Math.acos((0,ni.default)((i*i+s*s-o*o)/(2*i*s))),u=Math.acos((0,ni.default)((o*o+s*s-i*i)/(2*o*s)));return i===0||o===0?0:s===0||a>Math.PI/2?i:u>Math.PI/2?o:Math.sin(a)*i},Lf=Rt.default=Ys});var ai=c(Dt=>{"use strict";Object.defineProperty(Dt,"__esModule",{value:!0});Dt.default=void 0;var oi=Lt(R()),si=Lt(L()),F=Lt(j()),Js=Lt(G());function Lt(e){return e&&e.__esModule?e:{default:e}}var Qs=(e,t)=>{let r=(0,oi.default)(t),n=(0,si.default)(t),i=(0,oi.default)(e),o=(0,si.default)(e);return((0,Js.default)(Math.atan2(Math.sin((0,F.default)(n)-(0,F.default)(o))*Math.cos((0,F.default)(r)),Math.cos((0,F.default)(i))*Math.sin((0,F.default)(r))-Math.sin((0,F.default)(i))*Math.cos((0,F.default)(r))*Math.cos((0,F.default)(n)-(0,F.default)(o))))+360)%360},If=Dt.default=Qs});var ui=c(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.default=void 0;var ea=ta(H());function ta(e){return e&&e.__esModule?e:{default:e}}var ra=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ea.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},Cf=It.default=ra});var di=c(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.default=void 0;var li=qr(R()),ci=qr(L()),Cr=qr(j()),fi=_();function qr(e){return e&&e.__esModule?e:{default:e}}var na=function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;r=isNaN(r)?1:r;let n=(0,li.default)(e),i=(0,ci.default)(e),o=(0,li.default)(t),s=(0,ci.default)(t),a=6356752314245e-6,u=1/298.257223563,m=(0,Cr.default)(s-i),g,h,x,k,v,O,an=Math.atan((1-u)*Math.tan((0,Cr.default)(parseFloat(n)))),un=Math.atan((1-u)*Math.tan((0,Cr.default)(parseFloat(o)))),De=Math.sin(an),Ie=Math.cos(an),Ee=Math.sin(un),J=Math.cos(un),de=m,ln,cn=100;do{let ir=Math.sin(de),or=Math.cos(de);if(O=Math.sqrt(J*ir*(J*ir)+(Ie*Ee-De*J*or)*(Ie*Ee-De*J*or)),O===0)return 0;g=De*Ee+Ie*J*or,h=Math.atan2(O,g),x=Ie*J*ir/O,k=1-x*x,v=g-2*De*Ee/k,isNaN(v)&&(v=0);let sr=u/16*k*(4+u*(4-3*k));ln=de,de=m+(1-sr)*u*x*(h+sr*O*(v+sr*g*(-1+2*v*v)))}while(Math.abs(de-ln)>1e-12&&--cn>0);if(cn===0)return NaN;let U=k*(fi.earthRadius*fi.earthRadius-a*a)/(a*a),xo=1+U/16384*(4096+U*(-768+U*(320-175*U))),nr=U/1024*(256+U*(-128+U*(74-47*U))),yo=nr*O*(v+nr/4*(g*(-1+2*v*v)-nr/6*v*(-3+4*O*O)*(-3+4*v*v))),vo=a*xo*(h-yo);return Math.round(vo/r)*r},Nf=Et.default=na});var mi=c(Ct=>{"use strict";Object.defineProperty(Ct,"__esModule",{value:!0});Ct.default=void 0;var ia=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"},Kf=Ct.default=ia});var pi=c(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.default=void 0;var oa=sa(H());function sa(e){return e&&e.__esModule?e:{default:e}}var aa=function(e,t){let n=(arguments.length>2&&arguments[2]!==void 0?arguments[2]:oa.default)(e,t),i=Number(t.time)-Number(e.time);return n/i*1e3},Vf=qt.default=aa});var gi=c(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.default=void 0;var Nr=ua(H());function ua(e){return e&&e.__esModule?e:{default:e}}var la=(e,t,r)=>(0,Nr.default)(t,e)+(0,Nr.default)(e,r)===(0,Nr.default)(t,r),Hf=Nt.default=la});var bi=c(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.default=void 0;var jt=hi(R()),D=hi(L());function hi(e){return e&&e.__esModule?e:{default:e}}var ca=(e,t)=>{let r=!1,n=t.length;for(let i=-1,o=n-1;++i<n;o=i)((0,D.default)(t[i])<=(0,D.default)(e)&&(0,D.default)(e)<(0,D.default)(t[o])||(0,D.default)(t[o])<=(0,D.default)(e)&&(0,D.default)(e)<(0,D.default)(t[i]))&&(0,jt.default)(e)<((0,jt.default)(t[o])-(0,jt.default)(t[i]))*((0,D.default)(e)-(0,D.default)(t[i]))/((0,D.default)(t[o])-(0,D.default)(t[i]))+(0,jt.default)(t[i])&&(r=!r);return r},$f=Kt.default=ca});var xi=c(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.default=void 0;var fa=da(Er());function da(e){return e&&e.__esModule?e:{default:e}}var ma=(e,t,r,n)=>(0,fa.default)(e,t,r)<n,Gf=Ft.default=ma});var yi=c(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.default=void 0;var pa=ga(H());function ga(e){return e&&e.__esModule?e:{default:e}}var ha=(e,t,r)=>(0,pa.default)(e,t,.01)<r,Xf=Vt.default=ha});var vi=c(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});Ut.default=void 0;var ba=e=>{if(!e.startsWith("POLYGON"))throw new Error("Invalid wkt.");return e.slice(e.indexOf("(")+2,e.indexOf(")")).split(", ").map(n=>{let[i,o]=n.split(" ");return{longitude:parseFloat(i),latitude:parseFloat(o)}})},Yf=Ut.default=ba});var _i=c(f=>{"use strict";Object.defineProperty(f,"__esModule",{value:!0});var xa={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(f,"computeDestinationPoint",{enumerable:!0,get:function(){return ya.default}});Object.defineProperty(f,"convertArea",{enumerable:!0,get:function(){return va.default}});Object.defineProperty(f,"convertDistance",{enumerable:!0,get:function(){return _a.default}});Object.defineProperty(f,"convertSpeed",{enumerable:!0,get:function(){return Ma.default}});Object.defineProperty(f,"decimalToSexagesimal",{enumerable:!0,get:function(){return Sa.default}});Object.defineProperty(f,"findNearest",{enumerable:!0,get:function(){return Pa.default}});Object.defineProperty(f,"getAreaOfPolygon",{enumerable:!0,get:function(){return Ta.default}});Object.defineProperty(f,"getBounds",{enumerable:!0,get:function(){return ka.default}});Object.defineProperty(f,"getBoundsOfDistance",{enumerable:!0,get:function(){return Aa.default}});Object.defineProperty(f,"getCenter",{enumerable:!0,get:function(){return Oa.default}});Object.defineProperty(f,"getCenterOfBounds",{enumerable:!0,get:function(){return wa.default}});Object.defineProperty(f,"getCompassDirection",{enumerable:!0,get:function(){return Ra.default}});Object.defineProperty(f,"getCoordinateKey",{enumerable:!0,get:function(){return La.default}});Object.defineProperty(f,"getCoordinateKeys",{enumerable:!0,get:function(){return Da.default}});Object.defineProperty(f,"getDistance",{enumerable:!0,get:function(){return Ia.default}});Object.defineProperty(f,"getDistanceFromLine",{enumerable:!0,get:function(){return Ea.default}});Object.defineProperty(f,"getGreatCircleBearing",{enumerable:!0,get:function(){return Ca.default}});Object.defineProperty(f,"getLatitude",{enumerable:!0,get:function(){return qa.default}});Object.defineProperty(f,"getLongitude",{enumerable:!0,get:function(){return Na.default}});Object.defineProperty(f,"getPathLength",{enumerable:!0,get:function(){return ja.default}});Object.defineProperty(f,"getPreciseDistance",{enumerable:!0,get:function(){return Ka.default}});Object.defineProperty(f,"getRhumbLineBearing",{enumerable:!0,get:function(){return Fa.default}});Object.defineProperty(f,"getRoughCompassDirection",{enumerable:!0,get:function(){return Va.default}});Object.defineProperty(f,"getSpeed",{enumerable:!0,get:function(){return Ua.default}});Object.defineProperty(f,"isDecimal",{enumerable:!0,get:function(){return Ha.default}});Object.defineProperty(f,"isPointInLine",{enumerable:!0,get:function(){return Ba.default}});Object.defineProperty(f,"isPointInPolygon",{enumerable:!0,get:function(){return $a.default}});Object.defineProperty(f,"isPointNearLine",{enumerable:!0,get:function(){return Wa.default}});Object.defineProperty(f,"isPointWithinRadius",{enumerable:!0,get:function(){return Ga.default}});Object.defineProperty(f,"isSexagesimal",{enumerable:!0,get:function(){return za.default}});Object.defineProperty(f,"isValidCoordinate",{enumerable:!0,get:function(){return Xa.default}});Object.defineProperty(f,"isValidLatitude",{enumerable:!0,get:function(){return Za.default}});Object.defineProperty(f,"isValidLongitude",{enumerable:!0,get:function(){return Ya.default}});Object.defineProperty(f,"orderByDistance",{enumerable:!0,get:function(){return Ja.default}});Object.defineProperty(f,"sexagesimalToDecimal",{enumerable:!0,get:function(){return Qa.default}});Object.defineProperty(f,"toDecimal",{enumerable:!0,get:function(){return eu.default}});Object.defineProperty(f,"toDeg",{enumerable:!0,get:function(){return ru.default}});Object.defineProperty(f,"toRad",{enumerable:!0,get:function(){return tu.default}});Object.defineProperty(f,"wktToPolygon",{enumerable:!0,get:function(){return nu.default}});var ya=d(Cn()),va=d(qn()),_a=d(Nn()),Ma=d(jn()),Sa=d(Kn()),Pa=d(Hn()),Ta=d(Wn()),ka=d(Lr()),Aa=d(zn()),Oa=d(Yn()),wa=d(Jn()),Ra=d(ri()),La=d(xe()),Da=d(Ze()),Ia=d(H()),Ea=d(Er()),Ca=d(ai()),qa=d(R()),Na=d(L()),ja=d(ui()),Ka=d(di()),Fa=d(Dr()),Va=d(mi()),Ua=d(pi()),Ha=d(ye()),Ba=d(gi()),$a=d(bi()),Wa=d(xi()),Ga=d(yi()),za=d(ve()),Xa=d(Sr()),Za=d(yr()),Ya=d(_r()),Ja=d(Or()),Qa=d(_e()),eu=d(tt()),tu=d(j()),ru=d(G()),nu=d(vi()),jr=_();Object.keys(jr).forEach(function(e){e==="default"||e==="__esModule"||Object.prototype.hasOwnProperty.call(xa,e)||e in f&&f[e]===jr[e]||Object.defineProperty(f,e,{enumerable:!0,get:function(){return jr[e]}})});function d(e){return e&&e.__esModule?e:{default:e}}});var Mi=c(Ur=>{"use strict";Ur.__esModule=!0;function Fr(e,t){return e*e+t*t}function iu(e,t){return Fr(e[0]-t[0],e[1]-t[1])}function ou(e,t,r){var n=t[0],i=t[1],o=r[0]-n,s=r[1]-i;if(o!==0||s!==0){var a=((e[0]-n)*o+(e[1]-i)*s)/Fr(o,s);a>1?(n=r[0],i=r[1]):a>0&&(n+=o*a,i+=s*a)}return Fr(e[0]-n,e[1]-i)}function su(e,t){for(var r=e[0],n,i=[r],o=1,s=e.length;o<s;o++)n=e[o],iu(n,r)>t&&(i.push(n),r=n);return r!==n&&i.push(n),i}function Vr(e,t,r,n,i){for(var o=n,s,a=t+1;a<r;a++){var u=ou(e[a],e[t],e[r]);u>o&&(s=a,o=u)}o>n&&(s-t>1&&Vr(e,t,s,n,i),i.push(e[s]),r-s>1&&Vr(e,s,r,n,i))}function au(e,t){var r=e.length-1,n=[e[0]];return Vr(e,0,r,t,n),n.push(e[r]),n}function uu(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:su(e,n),e=au(e,n),e}Ur.SimplifyAP=uu});var Si=c($r=>{"use strict";$r.__esModule=!0;function Hr(e,t){return e*e+t*t}function lu(e,t){return Hr(e.longitude-t.longitude,e.latitude-t.latitude)}function cu(e,t,r){var n=t.longitude,i=t.latitude,o=r.longitude-n,s=r.latitude-i;if(o!==0||s!==0){var a=((e.longitude-n)*o+(e.latitude-i)*s)/Hr(o,s);a>1?(n=r.longitude,i=r.latitude):a>0&&(n+=o*a,i+=s*a)}return Hr(e.longitude-n,e.latitude-i)}function fu(e,t){for(var r=e[0],n,i=[r],o=1,s=e.length;o<s;o++)n=e[o],lu(n,r)>t&&(i.push(n),r=n);return r!==n&&i.push(n),i}function Br(e,t,r,n,i){for(var o=n,s,a=t+1;a<r;a++){var u=cu(e[a],e[t],e[r]);u>o&&(s=a,o=u)}o>n&&(s-t>1&&Br(e,t,s,n,i),i.push(e[s]),r-s>1&&Br(e,s,r,n,i))}function du(e,t){var r=e.length-1,n=[e[0]];return Br(e,0,r,t,n),n.push(e[r]),n}function mu(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:fu(e,n),e=du(e,n),e}$r.SimplifyLL=mu});var Pi=c(zr=>{"use strict";zr.__esModule=!0;function Wr(e,t){return e*e+t*t}function pu(e,t){return Wr(e.x-t.x,e.y-t.y)}function gu(e,t,r){var n=t.x,i=t.y,o=r.x-n,s=r.y-i;if(o!==0||s!==0){var a=((e.x-n)*o+(e.y-i)*s)/Wr(o,s);a>1?(n=r.x,i=r.y):a>0&&(n+=o*a,i+=s*a)}return Wr(e.x-n,e.y-i)}function hu(e,t){for(var r=e[0],n,i=[r],o=1,s=e.length;o<s;o++)n=e[o],pu(n,r)>t&&(i.push(n),r=n);return r!==n&&i.push(n),i}function Gr(e,t,r,n,i){for(var o=n,s,a=t+1;a<r;a++){var u=gu(e[a],e[t],e[r]);u>o&&(s=a,o=u)}o>n&&(s-t>1&&Gr(e,t,s,n,i),i.push(e[s]),r-s>1&&Gr(e,s,r,n,i))}function bu(e,t){var r=e.length-1,n=[e[0]];return Gr(e,0,r,t,n),n.push(e[r]),n}function xu(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:hu(e,n),e=bu(e,n),e}zr.Simplify=xu});var Ti=c(Te=>{"use strict";Te.__esModule=!0;var yu=Mi();Te.SimplifyAP=yu.SimplifyAP;var vu=Si();Te.SimplifyLL=vu.SimplifyLL;var _u=Pi();Te.Simplify=_u.Simplify});function w(e){return typeof e=="function"}function Ce(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 qe=Ce(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 me(e,t){if(e){let r=e.indexOf(t);0<=r&&e.splice(r,1)}}var C=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 o of r)o.remove(this);else r.remove(this);let{initialTeardown:n}=this;if(w(n))try{n()}catch(o){t=o instanceof qe?o.errors:[o]}let{_finalizers:i}=this;if(i){this._finalizers=null;for(let o of i)try{mn(o)}catch(s){t=t??[],s instanceof qe?t=[...t,...s.errors]:t.push(s)}}if(t)throw new qe(t)}}add(t){var r;if(t&&t!==this)if(this.closed)mn(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)&&me(r,t)}remove(t){let{_finalizers:r}=this;r&&me(r,t),t instanceof e&&t._removeParent(this)}};C.EMPTY=(()=>{let e=new C;return e.closed=!0,e})();var ar=C.EMPTY;function Ne(e){return e instanceof C||e&&"closed"in e&&w(e.remove)&&w(e.add)&&w(e.unsubscribe)}function mn(e){w(e)?e():e.unsubscribe()}var I={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var Q={setTimeout(e,t,...r){let{delegate:n}=Q;return n?.setTimeout?n.setTimeout(e,t,...r):setTimeout(e,t,...r)},clearTimeout(e){let{delegate:t}=Q;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function pn(e){Q.setTimeout(()=>{let{onUnhandledError:t}=I;if(t)t(e);else throw e})}function ur(){}var gn=lr("C",void 0,void 0);function hn(e){return lr("E",void 0,e)}function bn(e){return lr("N",e,void 0)}function lr(e,t,r){return{kind:e,value:t,error:r}}var B=null;function ee(e){if(I.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 xn(e){I.useDeprecatedSynchronousErrorHandling&&B&&(B.errorThrown=!0,B.error=e)}var pe=class extends C{constructor(t){super(),this.isStopped=!1,t?(this.destination=t,Ne(t)&&t.add(this)):this.destination=wo}static create(t,r,n){return new te(t,r,n)}next(t){this.isStopped?fr(bn(t),this):this._next(t)}error(t){this.isStopped?fr(hn(t),this):(this.isStopped=!0,this._error(t))}complete(){this.isStopped?fr(gn,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()}}},Ao=Function.prototype.bind;function cr(e,t){return Ao.call(e,t)}var dr=class{constructor(t){this.partialObserver=t}next(t){let{partialObserver:r}=this;if(r.next)try{r.next(t)}catch(n){je(n)}}error(t){let{partialObserver:r}=this;if(r.error)try{r.error(t)}catch(n){je(n)}else je(t)}complete(){let{partialObserver:t}=this;if(t.complete)try{t.complete()}catch(r){je(r)}}},te=class extends pe{constructor(t,r,n){super();let i;if(w(t)||!t)i={next:t??void 0,error:r??void 0,complete:n??void 0};else{let o;this&&I.useDeprecatedNextContext?(o=Object.create(t),o.unsubscribe=()=>this.unsubscribe(),i={next:t.next&&cr(t.next,o),error:t.error&&cr(t.error,o),complete:t.complete&&cr(t.complete,o)}):i=t}this.destination=new dr(i)}};function je(e){I.useDeprecatedSynchronousErrorHandling?xn(e):pn(e)}function Oo(e){throw e}function fr(e,t){let{onStoppedNotification:r}=I;r&&Q.setTimeout(()=>r(e,t))}var wo={closed:!0,next:ur,error:Oo,complete:ur};var yn=typeof Symbol=="function"&&Symbol.observable||"@@observable";function vn(e){return e}function _n(e){return e.length===0?vn:e.length===1?e[0]:function(r){return e.reduce((n,i)=>i(n),r)}}var $=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=Lo(t)?t:new te(t,r,n);return ee(()=>{let{operator:o,source:s}=this;i.add(o?o.call(i,s):s?this._subscribe(i):this._trySubscribe(i))}),i}_trySubscribe(t){try{return this._subscribe(t)}catch(r){t.error(r)}}forEach(t,r){return r=Mn(r),new r((n,i)=>{let o=new te({next:s=>{try{t(s)}catch(a){i(a),o.unsubscribe()}},error:i,complete:n});this.subscribe(o)})}_subscribe(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)}[yn](){return this}pipe(...t){return _n(t)(this)}toPromise(t){return t=Mn(t),new t((r,n)=>{let i;this.subscribe(o=>i=o,o=>n(o),()=>r(i))})}};$.create=e=>new $(e);function Mn(e){var t;return(t=e??I.Promise)!==null&&t!==void 0?t:Promise}function Ro(e){return e&&w(e.next)&&w(e.error)&&w(e.complete)}function Lo(e){return e&&e instanceof pe||Ro(e)&&Ne(e)}var Sn=Ce(e=>function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});var q=class extends ${constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(t){let r=new Ke(this,this);return r.operator=t,r}_throwIfClosed(){if(this.closed)throw new Sn}next(t){ee(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(let r of this.currentObservers)r.next(t)}})}error(t){ee(()=>{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(){ee(()=>{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?ar:(this.currentObservers=null,i.push(t),new C(()=>{this.currentObservers=null,me(i,t)}))}_checkFinalizedStatuses(t){let{hasError:r,thrownError:n,isStopped:i}=this;r?t.error(n):i&&t.complete()}asObservable(){let t=new $;return t.source=this,t}};q.create=(e,t)=>new Ke(e,t);var Ke=class extends q{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:ar}};var S=[];for(let e=0;e<256;++e)S.push((e+256).toString(16).slice(1));function Pn(e,t=0){return(S[e[t+0]]+S[e[t+1]]+S[e[t+2]]+S[e[t+3]]+"-"+S[e[t+4]]+S[e[t+5]]+"-"+S[e[t+6]]+S[e[t+7]]+"-"+S[e[t+8]]+S[e[t+9]]+"-"+S[e[t+10]]+S[e[t+11]]+S[e[t+12]]+S[e[t+13]]+S[e[t+14]]+S[e[t+15]]).toLowerCase()}var Do=new Uint8Array(16);function mr(){return crypto.getRandomValues(Do)}function Io(e,t,r){return!t&&!e&&crypto.randomUUID?crypto.randomUUID():Eo(e,t,r)}function Eo(e,t,r){e=e||{};let n=e.random??e.rng?.()??mr();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 Pn(n)}var pr=Io;var Fe=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 q,this.onConnect=this._connect.asObservable(),this._close=new q,this.onClose=this._close.asObservable(),this._error=new q,this.onError=this._error.asObservable(),this._message=new q,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=o=>{this._connect.next(o)},this.ws.onclose=o=>{this._close.next(o)},this.ws.onerror=o=>{this._error.next(o)},this.ws.onmessage=o=>{this.parseOnMessage(o)}}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=re.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=re.updates();this._token&&(i.token=this._token),i.context=t==="self"?"vessels.self":t,this._token&&(i.token=this._token);let o=[];typeof r=="string"&&o.push({path:r,value:n}),typeof r=="object"&&Array.isArray(r)&&(o=r);let s={timestamp:new Date().toISOString(),values:o};this._source&&(s.source=this._source),i.updates.push(s),this.send(i)}subscribe(t="*",r="*",n){let i=re.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 o={path:r};n&&typeof n=="object"&&(n.period&&(o.period=n.period),n.minPeriod&&(o.minPeriod=n.minPeriod),n.format&&(n.format==="delta"||n.format==="full")&&(o.format=n.format),n.policy&&(n.policy==="instant"||n.policy==="ideal"||n.policy==="fixed")&&(o.policy=n.policy)),i.subscribe.push(o)}this.send(i)}unsubscribe(t="*",r="*"){let n=re.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"}},re=class{static updates(){return{context:null,updates:[]}}static subscribe(){return{context:null,subscribe:[]}}static unsubscribe(){return{context:null,unsubscribe:[]}}static request(){return{requestId:pr()}}},Ve=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 ne=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},ge=class extends ne{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;magneticVariation=null;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},Ue=class extends ne{constructor(){super()}},He=class extends ne{sog=0;track=[];constructor(){super()}},he=class extends ne{constructor(){super()}},Be=class extends he{twd;tws;temperature;constructor(){super()}};var gr={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}},be={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"}},W=class{static transform(t,r,n){if(!Number.isFinite(t))return null;if(r===n)return t;try{return gr[r][n](t)}catch{throw new Error("Transformation not found!")}}static setSymbol(t,r){t in be&&(be[t].symbol=r??be[t].symbol)}static getSymbol(t){return t in be?be[t].symbol:t}static degreesToRadians(t){return gr.deg.radian(t)}static radiansToDegrees(t=0){return gr.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,o;if(i>0)o=i>Math.PI?n-i:0-i;else if(i<0){let s=Math.abs(i);o=s>Math.PI?s-n:s}else o=i;return o}};var A=dn(_i()),E=class e{static R=6371e3;static rhumbDestination(t,r,n){let i=e.R,o=n/i,s=t[1]*Math.PI/180,a=t[0]*Math.PI/180,u=r,m=o*Math.cos(u),g=s+m,h=o,x=89*Math.PI/180;g>x&&s<x?(h=o*(x-s)/m,g=x):g<-x&&s>-x&&(h=o*(-x-s)/m,g=-x);let k=Math.log(Math.tan(Math.PI/4+g/2)/Math.tan(Math.PI/4+s/2)),v=Math.abs(k)>1e-12?(g-s)/k:Math.cos(s),O=h*Math.sin(u)/v;return[(a+O)*180/Math.PI,g*180/Math.PI]}static destCoordinate(t,r,n){let i=(0,A.computeDestinationPoint)(t,n,W.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 o={bearing:(0,A.getGreatCircleBearing)(t[i-1],t[i]),distance:e.distanceTo(t[i-1],t[i])};n.push(o)}return n}static closestForwardPoint(t,r,n){if(t.length<2||!r)return-1;let i={index:-1,distance:-1};for(let o=0;o<t.length;++o){let s=(0,A.getGreatCircleBearing)(r,t[o]),a=Kr.difference(n,s);if(a>-90&&a<90){let u=e.distanceTo(r,t[o]);(i.distance===-1||u<i.distance)&&(i.distance=u,i.index=o)}}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(W.degreesToRadians(t[1])),o=[0,0,0,0];return o[1]=t[1]+(0-Math.abs(r))/111111,o[3]=t[1]+Math.abs(r)/111111,o[0]=t[0]+(0-Math.abs(r))/i,o[2]=t[0]+Math.abs(r)/i,o}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}},Kr=class e{static difference(t,r){let n=360-r,i=t+n,o=e.normalise(i);return o<180?0-o:360-o}static add(t,r){return e.normalise(t+r)}static normalise(t){return t<0?t+360:t>=360?t-360:t}};var Ht=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"}},Bt=class extends z{constructor(){super(),this.action="resource"}},$t=class extends z{constructor(){super(),this.action="radar"}},oe=class extends z{timed;constructor(){super(),this.action="trail"}};var ro=dn(Ti());var Xr=2*Math.PI;function se(e,t){return!Number.isFinite(e)||!Number.isFinite(t)?null:((e+t)%Xr+Xr)%Xr}var Ai="auto",ki=1e4,Mu=.2572,Oi=new Set(["navigation.headingTrue","navigation.headingMagnetic","navigation.courseOverGroundTrue","navigation.courseOverGroundMagnetic","navigation.speedOverGround","navigation.magneticVariation"]);function wi(e){let t=Date.now();if(e.headingTrue!==null&&t-e.headingTrueUpdatedAt<=ki){e.orientation=e.headingTrue;return}if(e.headingMagnetic!==null&&t-e.headingMagneticUpdatedAt<=ki){e.orientation=se(e.headingMagnetic,e.magneticVariation)??e.headingMagnetic;return}let r=e.cogTrue??se(e.cogMagnetic,e.magneticVariation)??e.cogMagnetic;typeof r=="number"&&(e.sog??0)>=Mu&&(e.orientation=r)}var Su=new Set(["navigation.headingMagnetic","navigation.courseOverGroundMagnetic"]);function Zr(e,t,r){return Su.has(e)?se(t,r)??t:t}function Ri(e,t){let r=t==="navigation.headingMagnetic"?e.headingMagnetic:t==="navigation.courseOverGroundMagnetic"?e.cogMagnetic:null;return Number.isFinite(r)?Zr(t,r,e.magneticVariation):null}var zt={api:"none",serverHasTracksApi:!1,v1SelfTrack:!1,v1AisTracks:!1},Pu="PT2H",Tu=120,ku=10,Au=1e3,Xt=12;function Ei(e){let t=e.replace(/\/v1\/api\/?$/,"");return{features:`${t}/v2/features`,providers:`${t}/v2/api/tracks/_providers`,v1SelfTrack:`${e}/self/track?timespan=1h`,v1Tracks:`${e}/tracks`}}function Jr(e){return`${e.replace(/\/v1\/api\/?$/,"")}/v2/api/tracks`}var Li=async(e,t)=>{try{return(await e(t)).ok}catch{return!1}},Di=async(e,t)=>{try{let r=await e(t);return r.ok?await r.json():void 0}catch{return}};function Ou(e){if(!e||typeof e!="object")return;let t=Object.entries(e);if(t.length!==0)return(t.find(([,r])=>r?.isDefault)??t[0])[0]}async function Ci(e,t){let r=await Di(e,t.features),n=Array.isArray(r?.apis)&&r.apis.includes("tracks");if(n){let s=Ou(await Di(e,t.providers));if(s)return{api:"v2",serverHasTracksApi:n,provider:s,v1SelfTrack:!1,v1AisTracks:!1}}let[i,o]=await Promise.all([Li(e,t.v1SelfTrack),Li(e,t.v1Tracks)]);return{api:i||o?"v1":"none",serverHasTracksApi:n,v1SelfTrack:i,v1AisTracks:o}}function Wt(e){if(typeof e!="string")return;let t=e.trim();if(/^P/i.test(t))return t.toUpperCase();let r=/^(\d+)\s*([smh])$/i.exec(t);return r?`PT${Number(r[1])}${r[2].toUpperCase()}`:void 0}var X=36e5;function qi(e,t,r){let n=o=>new Date(o).toISOString(),i=[];return e>24?(i.push({from:n(r-e*X),to:n(r-24*X),resolution:Wt(t.beyond24)}),i.push({from:n(r-24*X),to:n(r-X),resolution:Wt(t.next23)})):e>1&&i.push({from:n(r-e*X),to:n(r-X),resolution:Wt(t.next23)}),i.push({from:n(r-X),resolution:Wt(t.lastHour)}),i}function Gt(e){return Object.entries(e).filter(([,t])=>t!==void 0&&t!=="").map(([t,r])=>`${t}=${encodeURIComponent(String(r))}`).join("&")}function Ni(e,t,r){return`${e}?${Gt({context:"self",from:t.from,to:t.to,resolution:t.resolution,times:"true",provider:r})}`}var ji=e=>{let t=e?.features;return Array.isArray(t)?t:[]},Yr=e=>e.geometry?.type==="MultiLineString"&&Array.isArray(e.geometry.coordinates)?e.geometry.coordinates:void 0;function Ki(e){let t=ji(e).filter(n=>n.properties?.isSelf&&Yr(n));if(t.length===0)return;let r=t[0].properties?.providerId;return t.filter(n=>n.properties?.providerId===r).flatMap(n=>Yr(n))}function Fi(e,t){let r=new Map,n=new Map;return ji(e).forEach(i=>{let o=i.properties?.context,s=Yr(i);if(!o||i.properties?.isSelf||!s)return;let a=i.properties?.providerId;(!r.has(o)||a===t&&n.get(o)!==t)&&(r.set(o,s),n.set(o,a))}),r}function Ii(e){let t=((e+180)%360+360)%360-180;return t===-180&&e>0?180:t}function wu(e,t){if(!Array.isArray(e)||e.length!==4)return null;let[r,n,i,o]=e;if(![r,n,i,o].every(Number.isFinite)||i<r)return null;if(Array.isArray(t)&&t.length===4){let[a,u,m,g]=t,h=Math.round(((r+i)/2-(a+m)/2)/360)*360;if(r=Math.max(r,a+h),i=Math.min(i,m+h),n=Math.max(n,u),o=Math.min(o,g),r>=i||n>=o)return null}let s=a=>Math.round(a*1e6)/1e6;return n=s(Math.max(-90,n)),o=s(Math.min(90,o)),i-r>=360?[-180,n,180,o]:[s(Ii(r)),n,s(Ii(i)),o]}function Vi(e){if(e.showAll){if(!e.view||!(e.view.zoom>=ku))return null;let n=wu(e.view.extent,e.radiusBox);return n?Gt({bbox:n.join(","),duration:Pu,maxPoints:Tu,times:"true",provider:e.provider}):null}let t=e.picks.filter(n=>e.targets.has(n));if(t.length===0)return null;let r=Number.isFinite(e.pickHours)&&e.pickHours>0?e.pickHours:Xt;return Gt({contexts:t.join(","),duration:`PT${r}H`,maxPoints:Au,times:"true",provider:e.provider})}var Ui=.5;function Hi(e,t){let[r,n,i,o]=e,s=(i-r)*t,a=(o-n)*t;return[r-s,n-a,i+s,o+a]}function Bi(e,t){if(!e||Math.floor(e.zoom)!==Math.floor(t.zoom))return!0;let[r,n,i,o]=t.extent,[s,a,u,m]=e.extent;return r<s||n<a||i>u||o>m}function $i(){let e=0;return{begin:()=>++e,invalidate:()=>{e++},isCurrent:t=>t===e}}var Ru=6378137,Lu=2*Math.PI*Ru/256;var Qr=6e4,en=60*Qr,Wi=24*en;var zi=e=>{let t=e?.features;return Array.isArray(t)?t:[]},Du=(e,t)=>{if(e.length===0)return[];let r=e.some(n=>n.properties?.providerId===t)?t:e[0].properties?.providerId;return e.filter(n=>n.properties?.providerId===r)};function tn(e,t,r){let n=[],i=[],o=!0;if(Du(zi(t),r).forEach(s=>{let a=s.geometry?.type==="MultiLineString"&&Array.isArray(s.geometry.coordinates)?s.geometry.coordinates:[],u=s.properties?.coordTimes;a.forEach((m,g)=>{if(!Array.isArray(m)||m.length===0)return;n.push(m);let h=Array.isArray(u)?u[g]:void 0;Array.isArray(h)&&h.length===m.length?i.push(h):o=!1})}),n.length!==0)return o?{context:e,lines:n,times:i}:{context:e,lines:n}}function Xi(e,t){let r=new Map;zi(e).forEach(i=>{let o=i.properties?.context;o&&r.set(o,[...r.get(o)??[],i])});let n=new Map;return r.forEach((i,o)=>{let s=tn(o,{features:i},t);s?.times&&n.set(o,{lines:s.lines,times:s.times})}),n}var hd=[5*Qr,15*Qr,en,6*en,Wi,7*Wi];var Gi=e=>e?Date.parse(e):NaN;var Iu=10*6e4;function Zi(e,t){let r=[...e.lines],n=[...e.times];return t.lines.forEach((i,o)=>{let s=n[n.length-1],a=s?Gi(t.times[o][0])-Gi(s[s.length-1]):NaN;o===0&&a>=0&&a<=Iu?(r[r.length-1]=r[r.length-1].concat(i),n[n.length-1]=s.concat(t.times[o])):(r.push(i),n.push(t.times[o]))}),{lines:r,times:n}}var Eu=["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"],y={active:!1,maxMsgIntervals:18,intervalCount:0,msgCount:0,alarm:!1},l,M,Yt,Oe=[],Jt=[],rn=!1,Y,le=zt,no=Promise.resolve(zt),Re=null,io=null,oo=[],Qt=!1,nn=Xt,Yi,Cu=1e3,ce=new Set,Le=$i(),qu=5e3,b={signalk:{},aisState:[]},so=[0,0,0,0],ao=60,ke=0,T,ue={},Z=500,P=!1,uo,K={maxAge:54e4,staleAge:36e4,lastTick:new Date().valueOf(),maxTrack:20},on={selfLines:{cog:{length:10}},aisCogLine:10},fe={trailDuration:24,trailResolution:{lastHour:"5s",next23:"10s",beyond24:"1m"}},V,lo,ae="freeboard-sk";function Nu(){l={self:new ge,aisTargets:new Map,aisStatus:{updated:[],stale:[],expired:[]},paths:{},atons:new Map,aircraft:new Map,sar:new Map,meteo:new Map},l.self.positionReceived=!1,ce.clear(),Le.invalidate(),co()}function co(){T={updated:{},stale:{},expired:{}}}function Zt({action:e,msg:t}){switch(e){case"onConnect":postMessage({action:"open",playback:P,result:t.target.readyState}),Ku(),y.msgCount=0,y.intervalCount=0,y.alarm=!1,y.active=!0;break;case"onClose":fo(!1),Ji();break;case"onError":postMessage({action:"error",playback:P,result:"Connection error!"}),Ji();break;case"onMessage":y.msgCount++,Xu(t);break}}function Ji(){y.msgCount=0,y.intervalCount=0,y.active=!0,y.alarm=!0,tr(!0)}addEventListener("message",({data:e})=>{ju(e)});function ju(e){if(e.cmd)switch(e.cmd){case"open":Qi(e.options),Gu(e.options);break;case"close":fo(!0);break;case"subscribe":M.subscribe(e.options.context,e.options.path);break;case"settings":Qi(e.options);break;case"alarm":zu(e.options);break;case"vessel":if(e.options){let t;e.options.context==="self"?t=l.self:t=l.aisTargets.get(e.options.context),t&&e.options.name&&(t.name=e.options.name)}break;case"auth":e.options&&typeof e.options.token<"u"&&(Yt=e.options.token);break;case"trail":e.options&&(fe.trailDuration=e.options.trailDuration??24,e.options.trailResolution&&(fe.trailResolution.lastHour=e.options.trailResolution.lastHour??"5s",fe.trailResolution.next23=e.options.trailResolution.next23??"1m",fe.trailResolution.beyond24=e.options.trailResolution.beyond24??"5m")),Fu();break;case"view":e.options?.extent&&(Re={extent:e.options.extent,zoom:e.options.zoom},Qt&&Bi(io,Re)&&er());break;case"trackSelection":oo=Array.isArray(e.options?.ids)?e.options.ids:[],er();break}}function Qi(e={}){if(e.interval&&typeof e.interval=="number"&&(Z=e.interval,bo(),ho(),ao=1/(Z/1e3)*60),P=!!e.playback,e.config){typeof e.config.units.preferredPaths<"u"&&(ue=e.config.units.preferredPaths),e.config.vessels.aisMaxAge&&typeof e.config.vessels.aisMaxAge=="number"&&(K.maxAge=e.config.vessels.aisMaxAge),e.config.vessels.aisStaleAge&&typeof e.config.vessels.aisStaleAge=="number"&&(K.staleAge=e.config.vessels.aisStaleAge),typeof e.config.signalk.maxRadius=="number"&&(b.signalk=e.config.signalk),typeof e.config.selections.aisState<"u"&&Array.isArray(e.config.selections.aisState)&&(b.aisState=e.config.selections.aisState),on=e.config.vessels,e.config.vessels.aisShowTrack!==Qt&&(Qt=e.config.vessels.aisShowTrack,er());let t=e.config.vessels.aisTrackLength??Xt;t!==nn&&(nn=t,er())}}function fo(e=!1){bo(),Oe.forEach(t=>t.unsubscribe()),M&&e&&M.close(),M=null,postMessage({action:"close",result:e,playback:P})}function we(e){return fetch(e).then(t=>t.json())}function mo(e){return fetch(e,Yt?{headers:{Authorization:`Bearer ${Yt}`}}:void 0)}function po(e){return mo(e).then(t=>{if(!t.ok)throw new Error(`${t.status}`);return t.json()})}function Ku(){Y&&(no=Ci(mo,Ei(Y)).catch(()=>zt).then(e=>(le=e,postMessage({action:"trackSource",playback:P,result:e}),sn(),e)))}function Fu(){no.then(e=>{if(e.api==="v2")Vu(fe,e.provider);else if(e.api==="v1"&&e.v1SelfTrack)Wu(fe);else{let t=new oe;t.playback=P,t.result=null,postMessage(t)}})}function Vu(e,t){let r=Jr(Y),n=qi(e.trailDuration,e.trailResolution,Date.now()),i=new oe;i.playback=P,Promise.all(n.map(o=>po(Ni(r,o,t)))).then(o=>{i.result=go(o.map(s=>Ki(s)??null)),i.timed=Uu(o,t),postMessage(i)}).catch(()=>{i.result=null,postMessage(i)})}function Uu(e,t){let r={lines:[],times:[]};for(let n of e){let i=tn("self",n,t);if(i&&!i.times)return;i&&(r=Zi(r,{lines:i.lines,times:i.times}))}return r.lines.length?r:void 0}function er(){Le.invalidate(),clearTimeout(Yi),Yi=setTimeout(()=>{le.api==="v2"&&sn()},Cu)}function sn(){P||!l||(le.api==="v2"?Hu(le.provider):le.api==="v1"&&le.v1AisTracks&&$u())}function Hu(e){let t=Re&&{extent:Hi(Re.extent,Ui),zoom:Re.zoom};io=t;let r=Vi({view:t,showAll:Qt,picks:oo,targets:l.aisTargets,radiusBox:b.signalk.maxRadius&&l.self.positionReceived?E.calcMapifiedExtent(l.self.position,b.signalk.maxRadius):void 0,pickHours:nn,provider:e});if(!r){Le.invalidate();return}let n=Le.begin();po(`${Jr(Y)}?${r}`).then(i=>{Le.isCurrent(n)&&!P&&(Bu(l.aisTargets,Fi(i,e)),postMessage({action:"aisTracksTimed",playback:P,result:Xi(i,e)}))}).catch(()=>{})}function Bu(e,t){let r=[...ce];ce.clear(),t.forEach((n,i)=>{let o=e.get(i),s=n.filter(a=>Array.isArray(a)&&a.length>0);o?.positionReceived&&o.position&&s.length>0&&(o.track=s,ce.add(i),rr(o))}),r.filter(n=>!ce.has(n)).forEach(n=>{let i=e.get(n),o=i?.track?.[i.track.length-1];o&&(i.track=[o.slice(0-K.maxTrack)])})}function $u(){let e=b&&b.signalk&&b.signalk.maxRadius?`?radius=${b.signalk.maxRadius}`:"?radius=10000";we(Y+"/tracks"+e).then(t=>{Object.entries(t).forEach(r=>{if(l.aisTargets.has(r[0])){let n=l.aisTargets.get(r[0]);n.track=r[1].coordinates,rr(n)}})}).catch(()=>{})}function Wu(e){let t=Y+"/self/track?",r=[];e.trailDuration>24&&(r.push(we(`${t}timespan=${e.trailDuration-24}h&resolution=${e.trailResolution.beyond24}×panOffset=24`)),r.push(we(`${t}timespan=23h&resolution=${e.trailResolution.next23}×panOffset=1`))),e.trailDuration>1&&e.trailDuration<25&&r.push(we(`${t}timespan=${e.trailDuration-1}h&resolution=${e.trailResolution.next23}×panOffset=1`)),r.push(we(`${t}timespan=1h&resolution=${e.trailResolution.lastHour}`));let n=new oe;n.playback=P,Promise.all(r).then(i=>{n.result=go(i.map(o=>o?.type==="MultiLineString"&&Array.isArray(o.coordinates)?o.coordinates:null)),postMessage(n)}).catch(()=>{n.result=null,postMessage(n)})}function go(e){let i=e.length-1,o=[];return e.forEach((s,a)=>{if(s)if(a!==i){let u=[];for(s.forEach(m=>{u=u.concat(m)}),u=(0,ro.SimplifyAP)(u,5e-4,!0);u.length>60;){let m=u.slice(0,60);o.push(m),u=u.slice(59),u[0]=[u[0][0]+5e-9,u[0][1]+5e-9]}u.length!==0&&o.push(u)}else o=o.concat(s)}),o}function Gu(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:",Y=t.join("/"),Nu(),M=new Fe,Oe.push(M.onConnect.subscribe(r=>Zt({action:"onConnect",msg:r}))),Oe.push(M.onClose.subscribe(r=>Zt({action:"onClose",msg:r}))),Oe.push(M.onError.subscribe(r=>Zt({action:"onError",msg:r}))),Oe.push(M.onMessage.subscribe(r=>Zt({action:"onMessage",msg:r}))),M.authToken=Yt,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)}function zu(e){let t=e.type.indexOf("notifications.")===-1?`notifications.${e.type}`:e.type;e.raise?M.raiseAlarm("self",t,new Ve(e.message,e.state,!0,!0)):M.clearAlarm("self",t)}function Xu(e){M.isHello(e)?(postMessage({action:"hello",result:e,self:e.self,playback:P}),Z&&ho()):M.isDelta(e)?(rn=!0,e.updates.forEach(t=>{!("values"in t)||!t.values||(V=t.$source,lo=t.timestamp,t.values.forEach(r=>{if(uo=t.timestamp,!!e.context)switch(e.context.split(".")[0]){case"shore":case"atons":b?.signalk.atons&&el(e.context,r),Ae(e.context,l.atons,b?.signalk.atons);break;case"sar":b?.signalk.sar&&tl(e.context,r),Ae(e.context,l.sar,b?.signalk.sar);break;case"aircraft":b?.signalk.aircraft&&nl(e.context,r),Ae(e.context,l.aircraft,b?.signalk.aircraft);break;case"meteo":b?.signalk.meteo&&(rl(e.context,r),to(r)),Ae(e.context,l.meteo,b?.signalk.meteo);break;case"vessels":if(M.isSelf(e))l.self.id||(l.self.id=e.context),eo(l.self,r,!0),to(r);else{if(b?.signalk.vessels){let n=Zu(e.context);eo(n,r)}Ae(e.context,l.aisTargets,b?.signalk.vessels,b?.aisState)}break}}))}),tr()):M.isResponse(e)&&postMessage({action:"response",result:e})}function Ae(e,t,r=!0,n=[]){if(r){let i=t.get(e);i&&n.includes(i?.state)&&(T.expired[e]=!0,i=null),i&&b.signalk.maxRadius?i.positionReceived&&E.inBounds(i.position,so)?T.updated[e]=!0:(t.delete(e),T.expired[e]=!0):T.updated[e]=!0}else t.size!==0&&(t.forEach((i,o)=>{T.expired[o]=!0}),t.clear())}function tr(e=!1){if(!Z||e){let t=new z;t.watchDogAlarm=y.alarm,t.playback=P,l.aisStatus.updated=Object.keys(T.updated),l.aisStatus.stale=Object.keys(T.stale),l.aisStatus.expired=Object.keys(T.expired),t.result=l,t.timestamp=P?uo:l.self.lastUpdated.toISOString(),postMessage(t),co(),l.self.resourceUpdates=[],Qu(),ke===0&&l.self.positionReceived&&b?.signalk.maxRadius&&(so=E.calcMapifiedExtent(l.self.position,b.signalk.maxRadius),ke++),ke=ke>=ao?0:ke+1}}function ho(){Z&&typeof Z=="number"&&Jt.push(setInterval(()=>{y.active&&!y.msgCount?(y.intervalCount=y.intervalCount+1,y.intervalCount>=y.maxMsgIntervals&&(y.intervalCount=0,y.alarm=!0,tr(!0))):(y.intervalCount=0,y.msgCount=0,y.alarm=!1),rn&&(tr(!0),rn=!1)},Z)),Jt.push(setInterval(()=>sn(),6e4))}function bo(){Jt.forEach(e=>clearInterval(e)),Jt=[]}function Zu(e){if(!l.aisTargets.has(e)){let t=new ge;t.id=e,t.position=null,l.aisTargets.set(e,t)}return l.aisTargets.get(e)}function eo(e,t,r=!1){let n=t.value;if(r){if(e.lastUpdated=new Date,t.path.startsWith("resources."))e.resourceUpdates.push(t),Ju(t);else if(t.path.startsWith("radars"))Yu(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("."),u=a.slice(2).join(".");e.radars[a[1]]||(e.radars[a[1]]={}),e.radars[a[1]][u]=n}let s=t.path.indexOf("course")!==-1?t.path.split(".").slice(0,2).join("."):t.path;Eu.indexOf(s)!==-1&&(l.paths[s]=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=E.normaliseCoords([n.longitude,n.latitude]),e.positionReceived=!0,e.positionTimestamp=lo??"",e.positionUpdatedAt=Date.now(),e.lastUpdated=new Date,r||rr(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===ae?e.autopilot.state=n:t.path==="steering.autopilot.mode"&&V===ae?e.autopilot.mode=n:t.path==="steering.autopilot.target"&&V===ae?e.autopilot.target=n:t.path==="steering.autopilot.engaged"&&V===ae?e.autopilot.enabled=n:t.path==="steering.autopilot.defaultPilot"?(e.autopilot.default=n,ae=n):t.path==="steering.autopilot.availableActions"&&V===ae?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()):t.path==="navigation.magneticVariation"&&(e.magneticVariation=n);let i=ue.heading;typeof i>"u"||i===Ai?Oi.has(t.path)&&wi(e):t.path===i?e.orientation=Zr(t.path,n,e.magneticVariation):t.path==="navigation.magneticVariation"&&(e.orientation=Ri(e,i)??e.orientation),typeof ue.tws<"u"&&t.path===ue.tws&&(e.wind.tws=n),typeof ue.twd<"u"&&t.path===ue.twd&&(e.wind.direction=t.path==="environment.wind.angleTrueGround"||t.path==="environment.wind.angleTrueWater"?W.angleToDirection(n,e.orientation??0):n);let o=e.cogTrue??se(e.cogMagnetic,e.magneticVariation)??e.cogMagnetic??void 0;if(typeof o<"u"&&e.position){let s=r?on.selfLines.cog.length:on.aisCogLine,a=(e.sog??0)*(s*60);e.vectors.cog=[e.position,E.rhumbDestination(e.position,o,a)]}}function Yu(e){let t=new $t;t.playback=P,t.result={path:e.path,value:e.value,sourceRef:V},postMessage(t)}function Ju(e){let t=new Bt;t.playback=P,t.result={path:e.path,value:e.value,sourceRef:V},postMessage(t)}function to(e){if(e.path.includes("notifications.")){let t=new Ht;t.playback=P,t.result={path:e.path,value:e.value,sourceRef:V},postMessage(t)}}function Qu(){let e=new Date().valueOf();l.aisTargets.forEach((t,r)=>{t.lastUpdated.valueOf()<e-K.maxAge?(T.expired[r]=!0,l.aisTargets.delete(r)):t.lastUpdated.valueOf()<e-K.staleAge&&(T.stale[r]=!0)}),l.aircraft.forEach((t,r)=>{t.lastUpdated.valueOf()<e-K.maxAge?(T.expired[r]=!0,l.aircraft.delete(r)):t.lastUpdated.valueOf()<e-K.staleAge&&(T.stale[r]=!0)}),l.sar.forEach((t,r)=>{t.lastUpdated.valueOf()<e-K.maxAge?(T.expired[r]=!0,l.sar.delete(r)):t.lastUpdated.valueOf()<e-K.staleAge&&(T.stale[r]=!0)})}function el(e,t){let r=!1;if(e.indexOf("shore.basestations")!==-1&&(r=!0),!l.atons.has(e)){let i=new he;i.id=e,i.position=null,i.type.id=null,r&&(i.type.id=-2,i.type.name="Basestation"),l.atons.set(e,i)}let n=l.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 tl(e,t){if(!l.sar.has(e)){let n=new Ue;n.id=e,n.position=null,n.type.id=-1,n.type.name="SaR Beacon",l.sar.set(e,n)}let r=l.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=E.normaliseCoords([t.value.longitude,t.value.latitude]),r.positionReceived=!0)}function rl(e,t){if(!l.meteo.has(e)){let n=new Be;n.id=e,n.position=null,n.type.id=-1,n.type.name="Weather Station",l.meteo.set(e,n)}let r=l.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=E.normaliseCoords([t.value.longitude,t.value.latitude]),r.positionReceived=!0)}function nl(e,t){if(!l.aircraft.has(e)){let n=new He;n.id=e,n.position=null,l.aircraft.set(e,n)}let r=l.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=E.normaliseCoords([t.value.longitude,t.value.latitude]),r.positionReceived=!0,rr(r)):t.path==="navigation.courseOverGroundTrue"?r.orientation=t.value:t.path==="navigation.speedOverGround"&&(r.sog=t.value)}function rr(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-(ce.has(e.id)?qu:K.maxTrack))}export{we as apiGet,Bu as applyServerAisTracks,Zt as handleStreamEvent,Nu as initVessels,eo as processVessel,Uu as timedTrail,mo as trackFetch};
|