@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.
Files changed (61) hide show
  1. package/README.md +276 -276
  2. package/package.json +18 -14
  3. package/plugin/vitest.config.mjs +1 -0
  4. package/public/assets/features/anchor-watch-1.jpg +0 -0
  5. package/public/assets/features/anchor-watch-2.jpg +0 -0
  6. package/public/assets/features/anchor-watch-3.jpg +0 -0
  7. package/public/assets/features/collision-alarm-display-1.jpg +0 -0
  8. package/public/assets/features/collision-alarm-display-2.jpg +0 -0
  9. package/public/assets/features/extension-panels-3.jpg +0 -0
  10. package/public/assets/features/radar-guard-zones-1.jpg +0 -0
  11. package/public/assets/features/radar-guard-zones-2.jpg +0 -0
  12. package/public/assets/features/radar-overlay-2.jpg +0 -0
  13. package/public/assets/features/radar-overlay-3.jpg +0 -0
  14. package/public/assets/features/route-planning-3.jpg +0 -0
  15. package/public/assets/features/route-planning-4.jpg +0 -0
  16. package/public/assets/features-corpus.json +1 -1
  17. package/public/assets/help/index.html +53 -124
  18. package/public/{chunk-D4A5NW5G.js → chunk-45ZTFAA5.js} +1 -1
  19. package/public/{chunk-4UBQTQSK.js → chunk-62WHV6CJ.js} +11 -11
  20. package/public/{chunk-6ZXMFU55.js → chunk-67S2RK5V.js} +1 -1
  21. package/public/{chunk-BJKB23AZ.js → chunk-6E2BDKCH.js} +1 -1
  22. package/public/{chunk-VQDXDSU7.js → chunk-AQKT2J2C.js} +1 -1
  23. package/public/chunk-BXGNCKBA.js +1 -0
  24. package/public/chunk-F4EUFUYM.js +4097 -0
  25. package/public/chunk-I33LU6L4.js +1 -0
  26. package/public/{chunk-YB4RBYE2.js → chunk-IGMXHN4X.js} +1 -1
  27. package/public/{chunk-RRYFRHFP.js → chunk-ISXARX6U.js} +1 -1
  28. package/public/chunk-J6MIIPAV.js +1 -0
  29. package/public/{chunk-7OBOGNNY.js → chunk-MX5HWKAH.js} +1 -1
  30. package/public/{chunk-5SYZI253.js → chunk-MYBGWSLC.js} +1 -1
  31. package/public/chunk-OBOT3EYE.js +1 -0
  32. package/public/chunk-OKVIYJ6A.js +1 -0
  33. package/public/{chunk-OVB2ZLN5.js → chunk-PAHYECKY.js} +1 -1
  34. package/public/{chunk-BNCDJR4Z.js → chunk-PD55PKQG.js} +2 -2
  35. package/public/chunk-QIIV7CZB.js +1 -0
  36. package/public/{chunk-BCS6VHKX.js → chunk-RG7WQ7O2.js} +15 -15
  37. package/public/chunk-S2NZQZZH.js +1 -0
  38. package/public/{chunk-R7YVRRY3.js → chunk-T7ZWMXKZ.js} +1 -1
  39. package/public/{chunk-GBMW6IJP.js → chunk-X6D4D6EN.js} +1 -1
  40. package/public/{chunk-USYMWMPO.js → chunk-YSHHABBQ.js} +1 -1
  41. package/public/{chunk-XZM7Q5WP.js → chunk-YZN4NRWW.js} +1 -1
  42. package/public/{chunk-P57WKW3G.js → chunk-Z2D7B2ZG.js} +1 -1
  43. package/public/index.html +2 -2
  44. package/public/main-S6QEWGOY.js +468 -0
  45. package/public/{styles-YRQUZIIZ.css → styles-BRU77GKR.css} +1 -1
  46. package/public/worker-E75PSRY4.js +12 -0
  47. package/public/worker-PCWM7FLK.js +3 -0
  48. package/public/{worker-BFPH3XRP.js → worker-UJD2XPGR.js} +6 -6
  49. package/public/worker-W3UMLYIU.js +12 -0
  50. package/public/chunk-A2UDMCI5.js +0 -1
  51. package/public/chunk-EDKY4MXN.js +0 -1
  52. package/public/chunk-GFDZNVNU.js +0 -4372
  53. package/public/chunk-H54CRRPU.js +0 -1
  54. package/public/chunk-HT6GODHM.js +0 -1
  55. package/public/chunk-RQKGK2KO.js +0 -1
  56. package/public/chunk-UBTZRPVO.js +0 -1
  57. package/public/chunk-XXGLBGHG.js +0 -1
  58. package/public/main-LYWXFV5I.js +0 -468
  59. package/public/worker-5LIQ6F6U.js +0 -12
  60. package/public/worker-DYC3TMVW.js +0 -3
  61. package/public/worker-SUE26ZZI.js +0 -12
@@ -0,0 +1,12 @@
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=>{"use strict";(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)=>{"use strict";(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)=>{"use strict";(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)=>{"use strict";(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)=>{"use strict";(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)=>{"use strict";(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)=>{"use strict";(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)=>{"use strict";(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)=>{"use strict";(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)=>{"use strict";(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)=>{"use strict";(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)=>{"use strict";(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)=>{"use strict";(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)=>{"use strict";(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)=>{"use strict";(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)=>{"use strict";(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)=>{"use strict";(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)=>{"use strict";(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)=>{"use strict";(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)=>{"use strict";(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)=>{"use strict";(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)=>{"use strict";(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)=>{"use strict";(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)=>{"use strict";(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)=>{"use strict";(function(){Qe.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(He)});var Q=F(($e,Je)=>{"use strict";(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)=>{"use strict";(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,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r/g,"&#xD;"))},g.prototype.attEscape=function(a){var d;return this.options.noValidation?a:(d=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,a.replace(d,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;"))},g})()}).call(tr)});var ht=F((rr,ir)=>{"use strict";(function(){ir.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}).call(rr)});var Vt=F((nr,or)=>{"use strict";(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)=>{"use strict";(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)=>{"use strict";(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)=>{"use strict";(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)=>{"use strict";(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)=>{"use strict";(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=>{"use strict";(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)=>{"use strict";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)=>{"use strict";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=>{"use strict";(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=>{"use strict";(function(){"use strict";Kt.stripBOM=function(o){return o[0]==="\uFEFF"?o.substring(1):o}}).call(Kt)});var zt=F(ut=>{"use strict";(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=>{"use strict";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=>{"use strict";(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=>{"use strict";(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)}};
@@ -0,0 +1,3 @@
1
+ var Do=Object.create;var bn=Object.defineProperty;var Io=Object.getOwnPropertyDescriptor;var Co=Object.getOwnPropertyNames;var Eo=Object.getPrototypeOf,qo=Object.prototype.hasOwnProperty;var c=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}};var No=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Co(t))!qo.call(e,i)&&i!==r&&bn(e,i,{get:()=>t[i],enumerable:!(n=Io(t,i))||n.enumerable});return e};var xn=(e,t,r)=>(r=e!=null?Do(Eo(e)):{},No(t||!e||!e.__esModule?bn(r,"default",{value:e,enumerable:!0}):r,e));var _=c(g=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0});g.timeConversion=g.sexagesimalPattern=g.longitudeKeys=g.latitudeKeys=g.earthRadius=g.distanceConversion=g.areaConversion=g.altitudeKeys=g.RAD_TO_DEG=g.MINLON=g.MINLAT=g.MAXLON=g.MAXLAT=g.DEG_TO_RAD=void 0;var vc=g.sexagesimalPattern=/^([0-9]{1,3})°\s*([0-9]{1,3}(?:\.(?:[0-9]{1,}))?)['′]\s*(([0-9]{1,3}(\.([0-9]{1,}))?)["″]\s*)?([NEOSW]?)$/,_c=g.earthRadius=6378137,Mc=g.MINLAT=-90,Sc=g.MAXLAT=90,Pc=g.MINLON=-180,Tc=g.MAXLON=180,Ac=g.DEG_TO_RAD=Math.PI/180,kc=g.RAD_TO_DEG=180/Math.PI,Oc=g.longitudeKeys=["lng","lon","longitude",0],Rc=g.latitudeKeys=["lat","latitude",1],wc=g.altitudeKeys=["alt","altitude","elevation","elev",2],Lc=g.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},Dc=g.timeConversion={m:60,h:3600,d:86400},N=g.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 ve=c(Ge=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.default=void 0;var Go=(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)},Cc=Ge.default=Go});var _e=c(ze=>{"use strict";Object.defineProperty(ze,"__esModule",{value:!0});ze.default=void 0;var zo=e=>{let t=e.toString().trim();return isNaN(parseFloat(t))?!1:parseFloat(t)===Number(t)},qc=ze.default=zo});var Me=c(Xe=>{"use strict";Object.defineProperty(Xe,"__esModule",{value:!0});Xe.default=void 0;var Xo=_(),Zo=e=>Xo.sexagesimalPattern.test(e.toString().trim()),jc=Xe.default=Zo});var Se=c(Ze=>{"use strict";Object.defineProperty(Ze,"__esModule",{value:!0});Ze.default=void 0;var Yo=_(),Jo=e=>{let t=new RegExp(Yo.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},Uc=Ze.default=Jo});var Je=c(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.default=void 0;var xr=_(),yr=Qo(ve());function Qo(e){return e&&e.__esModule?e:{default:e}}var es=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{longitude:xr.longitudeKeys,latitude:xr.latitudeKeys,altitude:xr.altitudeKeys},r=(0,yr.default)(e,t.longitude),n=(0,yr.default)(e,t.latitude),i=(0,yr.default)(e,t.altitude);return{latitude:n,longitude:r,...i?{altitude:i}:{}}},Vc=Ye.default=es});var _r=c(Qe=>{"use strict";Object.defineProperty(Qe,"__esModule",{value:!0});Qe.default=void 0;var ts=vr(_e()),rs=vr(Me()),ns=vr(Se()),Ln=_();function vr(e){return e&&e.__esModule?e:{default:e}}var Dn=e=>{if((0,ts.default)(e)){let t=parseFloat(e);return!(t>Ln.MAXLAT||t<Ln.MINLAT)}return(0,rs.default)(e)?Dn((0,ns.default)(e)):!1},Bc=Qe.default=Dn});var Sr=c(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.default=void 0;var is=Mr(_e()),os=Mr(Me()),ss=Mr(Se()),In=_();function Mr(e){return e&&e.__esModule?e:{default:e}}var Cn=e=>{if((0,is.default)(e)){let t=parseFloat(e);return!(t>In.MAXLON||t<In.MINLON)}return(0,os.default)(e)?Cn((0,ss.default)(e)):!1},Wc=et.default=Cn});var Tr=c(tt=>{"use strict";Object.defineProperty(tt,"__esModule",{value:!0});tt.default=void 0;var as=Pr(Je()),En=Pr(_r()),qn=Pr(Sr());function Pr(e){return e&&e.__esModule?e:{default:e}}var us=e=>{let{latitude:t,longitude:r}=(0,as.default)(e);if(Array.isArray(e)&&e.length>=2)return(0,qn.default)(e[0])&&(0,En.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,En.default)(i)&&(0,qn.default)(n)},zc=tt.default=us});var nt=c(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.default=void 0;var ls=Te(_e()),cs=Te(Me()),fs=Te(Se()),Nn=Te(Tr()),ds=Te(Je());function Te(e){return e&&e.__esModule?e:{default:e}}var Pe=e=>{if((0,ls.default)(e))return Number(e);if((0,cs.default)(e))return(0,fs.default)(e);if((0,Nn.default)(e)){let t=(0,ds.default)(e);return Array.isArray(e)?e.map((r,n)=>[0,1].includes(n)?Pe(r):r):{...e,...t.latitude&&{[t.latitude]:Pe(e[t.latitude])},...t.longitude&&{[t.longitude]:Pe(e[t.longitude])}}}return Array.isArray(e)?e.map(t=>(0,Nn.default)(t)?Pe(t):t):e},Zc=rt.default=Pe});var w=c(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.default=void 0;var ms=_(),ps=jn(ve()),gs=jn(nt());function jn(e){return e&&e.__esModule?e:{default:e}}var hs=(e,t)=>{let r=(0,ps.default)(e,ms.latitudeKeys);if(r==null)return;let n=e[r];return t===!0?n:(0,gs.default)(n)},Jc=it.default=hs});var L=c(ot=>{"use strict";Object.defineProperty(ot,"__esModule",{value:!0});ot.default=void 0;var bs=_(),xs=Kn(ve()),ys=Kn(nt());function Kn(e){return e&&e.__esModule?e:{default:e}}var vs=(e,t)=>{let r=(0,xs.default)(e,bs.longitudeKeys);if(r==null)return;let n=e[r];return t===!0?n:(0,ys.default)(n)},ef=ot.default=vs});var j=c(st=>{"use strict";Object.defineProperty(st,"__esModule",{value:!0});st.default=void 0;var _s=_(),Ms=e=>e*_s.DEG_TO_RAD,rf=st.default=Ms});var X=c(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.default=void 0;var Ss=_(),Ps=e=>e*Ss.RAD_TO_DEG,of=at.default=Ps});var Fn=c(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.default=void 0;var Ts=ut(w()),As=ut(L()),Ar=ut(j()),kr=ut(X()),Un=_();function ut(e){return e&&e.__esModule?e:{default:e}}var ks=function(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:6371e3,i=(0,Ts.default)(e),o=(0,As.default)(e),s=t/n,a=(0,Ar.default)(r),u=(0,Ar.default)(i),p=(0,Ar.default)(o),m=Math.asin(Math.sin(u)*Math.cos(s)+Math.cos(u)*Math.sin(s)*Math.cos(a)),h=p+Math.atan2(Math.sin(a)*Math.sin(s)*Math.cos(u),Math.cos(s)-Math.sin(u)*Math.sin(m)),b=(0,kr.default)(h);return(b<Un.MINLON||b>Un.MAXLON)&&(h=(h+3*Math.PI)%(2*Math.PI)-Math.PI,b=(0,kr.default)(h)),{latitude:(0,kr.default)(m),longitude:b}},af=lt.default=ks});var Vn=c(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.default=void 0;var Os=_(),Rs=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"m",r=Os.areaConversion[t];if(r)return e*r;throw new Error("Invalid unit used for area conversion.")},lf=ct.default=Rs});var Hn=c(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.default=void 0;var ws=_(),Ls=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"m",r=ws.distanceConversion[t];if(r)return e*r;throw new Error("Invalid unit used for distance conversion.")},ff=ft.default=Ls});var Bn=c(mt=>{"use strict";Object.defineProperty(mt,"__esModule",{value:!0});mt.default=void 0;var dt=_(),Ds=function(e){switch(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"kmh"){case"kmh":return e*dt.timeConversion.h*dt.distanceConversion.km;case"mph":return e*dt.timeConversion.h*dt.distanceConversion.mi;default:return e}},mf=mt.default=Ds});var $n=c(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.default=void 0;var Is=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},Cs=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=Is(+("0."+(o[1]||0))*60).toString(),[u,p="0"]=a.split(".");return n+"\xB0 "+s.toString().padStart(2,"0")+"' "+u.padStart(2,"0")+"."+p.padEnd(1,"0")+'"'},gf=pt.default=Cs});var Or=c(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.default=void 0;var Es=e=>e>1?1:e<-1?-1:e,bf=gt.default=Es});var B=c(bt=>{"use strict";Object.defineProperty(bt,"__esModule",{value:!0});bt.default=void 0;var Wn=ht(w()),Gn=ht(L()),Rr=ht(j()),qs=ht(Or()),Ns=_();function ht(e){return e&&e.__esModule?e:{default:e}}var js=function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;r=isNaN(r)?1:r;let n=(0,Rr.default)((0,Wn.default)(e)),i=(0,Rr.default)((0,Wn.default)(t)),o=(0,Rr.default)((0,Gn.default)(e)-(0,Gn.default)(t)),s=Math.acos((0,qs.default)(Math.sin(i)*Math.sin(n)+Math.cos(i)*Math.cos(n)*Math.cos(o)))*Ns.earthRadius;return Math.round(s/r)*r},yf=bt.default=js});var wr=c(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.default=void 0;var zn=Ks(B());function Ks(e){return e&&e.__esModule?e:{default:e}}var Us=function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:zn.default;return r=typeof r=="function"?r:zn.default,t.slice().sort((n,i)=>r(e,n)-r(e,i))},_f=xt.default=Us});var Xn=c(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.default=void 0;var Fs=Vs(wr());function Vs(e){return e&&e.__esModule?e:{default:e}}var Hs=(e,t)=>(0,Fs.default)(e,t)[0],Sf=yt.default=Hs});var Jn=c(vt=>{"use strict";Object.defineProperty(vt,"__esModule",{value:!0});vt.default=void 0;var Lr=Dr(j()),Bs=Dr(w()),Zn=Dr(L()),Yn=_();function Dr(e){return e&&e.__esModule?e:{default:e}}var $s=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,Zn.default)(e[r]),a=(0,Bs.default)(e[n]),u=(0,Zn.default)(e[i]);t+=((0,Lr.default)(u)-(0,Lr.default)(s))*Math.sin((0,Lr.default)(a))}t=t*Yn.earthRadius*Yn.earthRadius/2}return Math.abs(t)},Tf=vt.default=$s});var Ir=c(_t=>{"use strict";Object.defineProperty(_t,"__esModule",{value:!0});_t.default=void 0;var Ws=Qn(w()),Gs=Qn(L());function Qn(e){return e&&e.__esModule?e:{default:e}}var zs=e=>{if(Array.isArray(e)===!1||e.length===0)throw new Error("No points were given.");return e.reduce((t,r)=>{let n=(0,Ws.default)(r),i=(0,Gs.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})},kf=_t.default=zs});var ei=c(Pt=>{"use strict";Object.defineProperty(Pt,"__esModule",{value:!0});Pt.default=void 0;var Xs=St(w()),Zs=St(L()),se=St(j()),Mt=St(X()),Ae=_();function St(e){return e&&e.__esModule?e:{default:e}}var Ys=(e,t)=>{let r=(0,Xs.default)(e),n=(0,Zs.default)(e),i=(0,se.default)(r),o=(0,se.default)(n),s=t/Ae.earthRadius,a=i-s,u=i+s,p=(0,se.default)(Ae.MAXLAT),m=(0,se.default)(Ae.MINLAT),h=(0,se.default)(Ae.MAXLON),b=(0,se.default)(Ae.MINLON),S,v;if(a>m&&u<p){let O=Math.asin(Math.sin(s)/Math.cos(i));S=o-O,S<b&&(S+=Math.PI*2),v=o+O,v>h&&(v-=Math.PI*2)}else a=Math.max(a,m),u=Math.min(u,p),S=b,v=h;return[{latitude:(0,Mt.default)(a),longitude:(0,Mt.default)(S)},{latitude:(0,Mt.default)(u),longitude:(0,Mt.default)(v)}]},Rf=Pt.default=Ys});var ni=c(At=>{"use strict";Object.defineProperty(At,"__esModule",{value:!0});At.default=void 0;var Js=Tt(w()),Qs=Tt(L()),ti=Tt(j()),ri=Tt(X());function Tt(e){return e&&e.__esModule?e:{default:e}}var ea=e=>{if(Array.isArray(e)===!1||e.length===0)return!1;let t=e.length,r=e.reduce((s,a)=>{let u=(0,ti.default)((0,Js.default)(a)),p=(0,ti.default)((0,Qs.default)(a));return{X:s.X+Math.cos(u)*Math.cos(p),Y:s.Y+Math.cos(u)*Math.sin(p),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,ri.default)(Math.atan2(i,n)),latitude:(0,ri.default)(Math.atan2(o,Math.sqrt(n*n+i*i)))}},Lf=At.default=ea});var ii=c(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.default=void 0;var ta=ra(Ir());function ra(e){return e&&e.__esModule?e:{default:e}}var na=e=>{let t=(0,ta.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))}},If=kt.default=na});var Cr=c(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.default=void 0;var oi=Rt(w()),si=Rt(L()),Ot=Rt(j()),ia=Rt(X());function Rt(e){return e&&e.__esModule?e:{default:e}}var oa=(e,t)=>{let r=(0,Ot.default)((0,si.default)(t))-(0,Ot.default)((0,si.default)(e)),n=Math.log(Math.tan((0,Ot.default)((0,oi.default)(t))/2+Math.PI/4)/Math.tan((0,Ot.default)((0,oi.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,ia.default)(Math.atan2(r,n))+360)%360},Ef=wt.default=oa});var ui=c(Lt=>{"use strict";Object.defineProperty(Lt,"__esModule",{value:!0});Lt.default=void 0;var ai=sa(Cr());function sa(e){return e&&e.__esModule?e:{default:e}}var aa=function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ai.default,n=typeof r=="function"?r(e,t):(0,ai.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"}},Nf=Lt.default=aa});var qr=c(Dt=>{"use strict";Object.defineProperty(Dt,"__esModule",{value:!0});Dt.default=void 0;var Er=ci(B()),li=ci(Or());function ci(e){return e&&e.__esModule?e:{default:e}}var ua=function(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1,i=(0,Er.default)(t,e,n),o=(0,Er.default)(e,r,n),s=(0,Er.default)(t,r,n),a=Math.acos((0,li.default)((i*i+s*s-o*o)/(2*i*s))),u=Math.acos((0,li.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},Kf=Dt.default=ua});var mi=c(Ct=>{"use strict";Object.defineProperty(Ct,"__esModule",{value:!0});Ct.default=void 0;var fi=It(w()),di=It(L()),F=It(j()),la=It(X());function It(e){return e&&e.__esModule?e:{default:e}}var ca=(e,t)=>{let r=(0,fi.default)(t),n=(0,di.default)(t),i=(0,fi.default)(e),o=(0,di.default)(e);return((0,la.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},Ff=Ct.default=ca});var pi=c(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.default=void 0;var fa=da(B());function da(e){return e&&e.__esModule?e:{default:e}}var ma=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:fa.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},Hf=Et.default=ma});var xi=c(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.default=void 0;var gi=jr(w()),hi=jr(L()),Nr=jr(j()),bi=_();function jr(e){return e&&e.__esModule?e:{default:e}}var pa=function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1;r=isNaN(r)?1:r;let n=(0,gi.default)(e),i=(0,hi.default)(e),o=(0,gi.default)(t),s=(0,hi.default)(t),a=6356752314245e-6,u=1/298.257223563,p=(0,Nr.default)(s-i),m,h,b,S,v,O,mn=Math.atan((1-u)*Math.tan((0,Nr.default)(parseFloat(n)))),pn=Math.atan((1-u)*Math.tan((0,Nr.default)(parseFloat(o)))),Ce=Math.sin(mn),Ee=Math.cos(mn),qe=Math.sin(pn),ee=Math.cos(pn),pe=p,gn,hn=100;do{let sr=Math.sin(pe),ar=Math.cos(pe);if(O=Math.sqrt(ee*sr*(ee*sr)+(Ee*qe-Ce*ee*ar)*(Ee*qe-Ce*ee*ar)),O===0)return 0;m=Ce*qe+Ee*ee*ar,h=Math.atan2(O,m),b=Ee*ee*sr/O,S=1-b*b,v=m-2*Ce*qe/S,isNaN(v)&&(v=0);let ur=u/16*S*(4+u*(4-3*S));gn=pe,pe=p+(1-ur)*u*b*(h+ur*O*(v+ur*m*(-1+2*v*v)))}while(Math.abs(pe-gn)>1e-12&&--hn>0);if(hn===0)return NaN;let H=S*(bi.earthRadius*bi.earthRadius-a*a)/(a*a),Ro=1+H/16384*(4096+H*(-768+H*(320-175*H))),or=H/1024*(256+H*(-128+H*(74-47*H))),wo=or*O*(v+or/4*(m*(-1+2*v*v)-or/6*v*(-3+4*O*O)*(-3+4*v*v))),Lo=a*Ro*(h-wo);return Math.round(Lo/r)*r},$f=qt.default=pa});var yi=c(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.default=void 0;var ga=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"},Gf=Nt.default=ga});var vi=c(jt=>{"use strict";Object.defineProperty(jt,"__esModule",{value:!0});jt.default=void 0;var ha=ba(B());function ba(e){return e&&e.__esModule?e:{default:e}}var xa=function(e,t){let n=(arguments.length>2&&arguments[2]!==void 0?arguments[2]:ha.default)(e,t),i=Number(t.time)-Number(e.time);return n/i*1e3},Xf=jt.default=xa});var _i=c(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.default=void 0;var Kr=ya(B());function ya(e){return e&&e.__esModule?e:{default:e}}var va=(e,t,r)=>(0,Kr.default)(t,e)+(0,Kr.default)(e,r)===(0,Kr.default)(t,r),Yf=Kt.default=va});var Si=c(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.default=void 0;var Ut=Mi(w()),D=Mi(L());function Mi(e){return e&&e.__esModule?e:{default:e}}var _a=(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,Ut.default)(e)<((0,Ut.default)(t[o])-(0,Ut.default)(t[i]))*((0,D.default)(e)-(0,D.default)(t[i]))/((0,D.default)(t[o])-(0,D.default)(t[i]))+(0,Ut.default)(t[i])&&(r=!r);return r},Qf=Ft.default=_a});var Pi=c(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.default=void 0;var Ma=Sa(qr());function Sa(e){return e&&e.__esModule?e:{default:e}}var Pa=(e,t,r,n)=>(0,Ma.default)(e,t,r)<n,td=Vt.default=Pa});var Ti=c(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.default=void 0;var Ta=Aa(B());function Aa(e){return e&&e.__esModule?e:{default:e}}var ka=(e,t,r)=>(0,Ta.default)(e,t,.01)<r,nd=Ht.default=ka});var Ai=c(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.default=void 0;var Oa=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)}})},od=Bt.default=Oa});var ki=c(f=>{"use strict";Object.defineProperty(f,"__esModule",{value:!0});var Ra={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 wa.default}});Object.defineProperty(f,"convertArea",{enumerable:!0,get:function(){return La.default}});Object.defineProperty(f,"convertDistance",{enumerable:!0,get:function(){return Da.default}});Object.defineProperty(f,"convertSpeed",{enumerable:!0,get:function(){return Ia.default}});Object.defineProperty(f,"decimalToSexagesimal",{enumerable:!0,get:function(){return Ca.default}});Object.defineProperty(f,"findNearest",{enumerable:!0,get:function(){return Ea.default}});Object.defineProperty(f,"getAreaOfPolygon",{enumerable:!0,get:function(){return qa.default}});Object.defineProperty(f,"getBounds",{enumerable:!0,get:function(){return Na.default}});Object.defineProperty(f,"getBoundsOfDistance",{enumerable:!0,get:function(){return ja.default}});Object.defineProperty(f,"getCenter",{enumerable:!0,get:function(){return Ka.default}});Object.defineProperty(f,"getCenterOfBounds",{enumerable:!0,get:function(){return Ua.default}});Object.defineProperty(f,"getCompassDirection",{enumerable:!0,get:function(){return Fa.default}});Object.defineProperty(f,"getCoordinateKey",{enumerable:!0,get:function(){return Va.default}});Object.defineProperty(f,"getCoordinateKeys",{enumerable:!0,get:function(){return Ha.default}});Object.defineProperty(f,"getDistance",{enumerable:!0,get:function(){return Ba.default}});Object.defineProperty(f,"getDistanceFromLine",{enumerable:!0,get:function(){return $a.default}});Object.defineProperty(f,"getGreatCircleBearing",{enumerable:!0,get:function(){return Wa.default}});Object.defineProperty(f,"getLatitude",{enumerable:!0,get:function(){return Ga.default}});Object.defineProperty(f,"getLongitude",{enumerable:!0,get:function(){return za.default}});Object.defineProperty(f,"getPathLength",{enumerable:!0,get:function(){return Xa.default}});Object.defineProperty(f,"getPreciseDistance",{enumerable:!0,get:function(){return Za.default}});Object.defineProperty(f,"getRhumbLineBearing",{enumerable:!0,get:function(){return Ya.default}});Object.defineProperty(f,"getRoughCompassDirection",{enumerable:!0,get:function(){return Ja.default}});Object.defineProperty(f,"getSpeed",{enumerable:!0,get:function(){return Qa.default}});Object.defineProperty(f,"isDecimal",{enumerable:!0,get:function(){return eu.default}});Object.defineProperty(f,"isPointInLine",{enumerable:!0,get:function(){return tu.default}});Object.defineProperty(f,"isPointInPolygon",{enumerable:!0,get:function(){return ru.default}});Object.defineProperty(f,"isPointNearLine",{enumerable:!0,get:function(){return nu.default}});Object.defineProperty(f,"isPointWithinRadius",{enumerable:!0,get:function(){return iu.default}});Object.defineProperty(f,"isSexagesimal",{enumerable:!0,get:function(){return ou.default}});Object.defineProperty(f,"isValidCoordinate",{enumerable:!0,get:function(){return su.default}});Object.defineProperty(f,"isValidLatitude",{enumerable:!0,get:function(){return au.default}});Object.defineProperty(f,"isValidLongitude",{enumerable:!0,get:function(){return uu.default}});Object.defineProperty(f,"orderByDistance",{enumerable:!0,get:function(){return lu.default}});Object.defineProperty(f,"sexagesimalToDecimal",{enumerable:!0,get:function(){return cu.default}});Object.defineProperty(f,"toDecimal",{enumerable:!0,get:function(){return fu.default}});Object.defineProperty(f,"toDeg",{enumerable:!0,get:function(){return mu.default}});Object.defineProperty(f,"toRad",{enumerable:!0,get:function(){return du.default}});Object.defineProperty(f,"wktToPolygon",{enumerable:!0,get:function(){return pu.default}});var wa=d(Fn()),La=d(Vn()),Da=d(Hn()),Ia=d(Bn()),Ca=d($n()),Ea=d(Xn()),qa=d(Jn()),Na=d(Ir()),ja=d(ei()),Ka=d(ni()),Ua=d(ii()),Fa=d(ui()),Va=d(ve()),Ha=d(Je()),Ba=d(B()),$a=d(qr()),Wa=d(mi()),Ga=d(w()),za=d(L()),Xa=d(pi()),Za=d(xi()),Ya=d(Cr()),Ja=d(yi()),Qa=d(vi()),eu=d(_e()),tu=d(_i()),ru=d(Si()),nu=d(Pi()),iu=d(Ti()),ou=d(Me()),su=d(Tr()),au=d(_r()),uu=d(Sr()),lu=d(wr()),cu=d(Se()),fu=d(nt()),du=d(j()),mu=d(X()),pu=d(Ai()),Ur=_();Object.keys(Ur).forEach(function(e){e==="default"||e==="__esModule"||Object.prototype.hasOwnProperty.call(Ra,e)||e in f&&f[e]===Ur[e]||Object.defineProperty(f,e,{enumerable:!0,get:function(){return Ur[e]}})});function d(e){return e&&e.__esModule?e:{default:e}}});var Oi=c(Br=>{"use strict";Br.__esModule=!0;function Vr(e,t){return e*e+t*t}function gu(e,t){return Vr(e[0]-t[0],e[1]-t[1])}function hu(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)/Vr(o,s);a>1?(n=r[0],i=r[1]):a>0&&(n+=o*a,i+=s*a)}return Vr(e[0]-n,e[1]-i)}function bu(e,t){for(var r=e[0],n,i=[r],o=1,s=e.length;o<s;o++)n=e[o],gu(n,r)>t&&(i.push(n),r=n);return r!==n&&i.push(n),i}function Hr(e,t,r,n,i){for(var o=n,s,a=t+1;a<r;a++){var u=hu(e[a],e[t],e[r]);u>o&&(s=a,o=u)}o>n&&(s-t>1&&Hr(e,t,s,n,i),i.push(e[s]),r-s>1&&Hr(e,s,r,n,i))}function xu(e,t){var r=e.length-1,n=[e[0]];return Hr(e,0,r,t,n),n.push(e[r]),n}function yu(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:bu(e,n),e=xu(e,n),e}Br.SimplifyAP=yu});var Ri=c(Gr=>{"use strict";Gr.__esModule=!0;function $r(e,t){return e*e+t*t}function vu(e,t){return $r(e.longitude-t.longitude,e.latitude-t.latitude)}function _u(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)/$r(o,s);a>1?(n=r.longitude,i=r.latitude):a>0&&(n+=o*a,i+=s*a)}return $r(e.longitude-n,e.latitude-i)}function Mu(e,t){for(var r=e[0],n,i=[r],o=1,s=e.length;o<s;o++)n=e[o],vu(n,r)>t&&(i.push(n),r=n);return r!==n&&i.push(n),i}function Wr(e,t,r,n,i){for(var o=n,s,a=t+1;a<r;a++){var u=_u(e[a],e[t],e[r]);u>o&&(s=a,o=u)}o>n&&(s-t>1&&Wr(e,t,s,n,i),i.push(e[s]),r-s>1&&Wr(e,s,r,n,i))}function Su(e,t){var r=e.length-1,n=[e[0]];return Wr(e,0,r,t,n),n.push(e[r]),n}function Pu(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:Mu(e,n),e=Su(e,n),e}Gr.SimplifyLL=Pu});var wi=c(Zr=>{"use strict";Zr.__esModule=!0;function zr(e,t){return e*e+t*t}function Tu(e,t){return zr(e.x-t.x,e.y-t.y)}function Au(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)/zr(o,s);a>1?(n=r.x,i=r.y):a>0&&(n+=o*a,i+=s*a)}return zr(e.x-n,e.y-i)}function ku(e,t){for(var r=e[0],n,i=[r],o=1,s=e.length;o<s;o++)n=e[o],Tu(n,r)>t&&(i.push(n),r=n);return r!==n&&i.push(n),i}function Xr(e,t,r,n,i){for(var o=n,s,a=t+1;a<r;a++){var u=Au(e[a],e[t],e[r]);u>o&&(s=a,o=u)}o>n&&(s-t>1&&Xr(e,t,s,n,i),i.push(e[s]),r-s>1&&Xr(e,s,r,n,i))}function Ou(e,t){var r=e.length-1,n=[e[0]];return Xr(e,0,r,t,n),n.push(e[r]),n}function Ru(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:ku(e,n),e=Ou(e,n),e}Zr.Simplify=Ru});var Li=c(ke=>{"use strict";ke.__esModule=!0;var wu=Oi();ke.SimplifyAP=wu.SimplifyAP;var Lu=Ri();ke.SimplifyLL=Lu.SimplifyLL;var Du=wi();ke.Simplify=Du.Simplify});function R(e){return typeof e=="function"}function Ne(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 je=Ne(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 ge(e,t){if(e){let r=e.indexOf(t);0<=r&&e.splice(r,1)}}var E=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(R(n))try{n()}catch(o){t=o instanceof je?o.errors:[o]}let{_finalizers:i}=this;if(i){this._finalizers=null;for(let o of i)try{yn(o)}catch(s){t=t??[],s instanceof je?t=[...t,...s.errors]:t.push(s)}}if(t)throw new je(t)}}add(t){var r;if(t&&t!==this)if(this.closed)yn(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)&&ge(r,t)}remove(t){let{_finalizers:r}=this;r&&ge(r,t),t instanceof e&&t._removeParent(this)}};E.EMPTY=(()=>{let e=new E;return e.closed=!0,e})();var lr=E.EMPTY;function Ke(e){return e instanceof E||e&&"closed"in e&&R(e.remove)&&R(e.add)&&R(e.unsubscribe)}function yn(e){R(e)?e():e.unsubscribe()}var I={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var te={setTimeout(e,t,...r){let{delegate:n}=te;return n?.setTimeout?n.setTimeout(e,t,...r):setTimeout(e,t,...r)},clearTimeout(e){let{delegate:t}=te;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function vn(e){te.setTimeout(()=>{let{onUnhandledError:t}=I;if(t)t(e);else throw e})}function cr(){}var _n=fr("C",void 0,void 0);function Mn(e){return fr("E",void 0,e)}function Sn(e){return fr("N",e,void 0)}function fr(e,t,r){return{kind:e,value:t,error:r}}var W=null;function re(e){if(I.useDeprecatedSynchronousErrorHandling){let t=!W;if(t&&(W={errorThrown:!1,error:null}),e(),t){let{errorThrown:r,error:n}=W;if(W=null,r)throw n}}else e()}function Pn(e){I.useDeprecatedSynchronousErrorHandling&&W&&(W.errorThrown=!0,W.error=e)}var he=class extends E{constructor(t){super(),this.isStopped=!1,t?(this.destination=t,Ke(t)&&t.add(this)):this.destination=Uo}static create(t,r,n){return new ne(t,r,n)}next(t){this.isStopped?mr(Sn(t),this):this._next(t)}error(t){this.isStopped?mr(Mn(t),this):(this.isStopped=!0,this._error(t))}complete(){this.isStopped?mr(_n,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()}}},jo=Function.prototype.bind;function dr(e,t){return jo.call(e,t)}var pr=class{constructor(t){this.partialObserver=t}next(t){let{partialObserver:r}=this;if(r.next)try{r.next(t)}catch(n){Ue(n)}}error(t){let{partialObserver:r}=this;if(r.error)try{r.error(t)}catch(n){Ue(n)}else Ue(t)}complete(){let{partialObserver:t}=this;if(t.complete)try{t.complete()}catch(r){Ue(r)}}},ne=class extends he{constructor(t,r,n){super();let i;if(R(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&&dr(t.next,o),error:t.error&&dr(t.error,o),complete:t.complete&&dr(t.complete,o)}):i=t}this.destination=new pr(i)}};function Ue(e){I.useDeprecatedSynchronousErrorHandling?Pn(e):vn(e)}function Ko(e){throw e}function mr(e,t){let{onStoppedNotification:r}=I;r&&te.setTimeout(()=>r(e,t))}var Uo={closed:!0,next:cr,error:Ko,complete:cr};var Tn=typeof Symbol=="function"&&Symbol.observable||"@@observable";function An(e){return e}function kn(e){return e.length===0?An:e.length===1?e[0]:function(r){return e.reduce((n,i)=>i(n),r)}}var G=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=Vo(t)?t:new ne(t,r,n);return re(()=>{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=On(r),new r((n,i)=>{let o=new ne({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)}[Tn](){return this}pipe(...t){return kn(t)(this)}toPromise(t){return t=On(t),new t((r,n)=>{let i;this.subscribe(o=>i=o,o=>n(o),()=>r(i))})}};G.create=e=>new G(e);function On(e){var t;return(t=e??I.Promise)!==null&&t!==void 0?t:Promise}function Fo(e){return e&&R(e.next)&&R(e.error)&&R(e.complete)}function Vo(e){return e&&e instanceof he||Fo(e)&&Ke(e)}var Rn=Ne(e=>function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});var q=class extends G{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(t){let r=new Fe(this,this);return r.operator=t,r}_throwIfClosed(){if(this.closed)throw new Rn}next(t){re(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(let r of this.currentObservers)r.next(t)}})}error(t){re(()=>{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(){re(()=>{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?lr:(this.currentObservers=null,i.push(t),new E(()=>{this.currentObservers=null,ge(i,t)}))}_checkFinalizedStatuses(t){let{hasError:r,thrownError:n,isStopped:i}=this;r?t.error(n):i&&t.complete()}asObservable(){let t=new G;return t.source=this,t}};q.create=(e,t)=>new Fe(e,t);var Fe=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:lr}};var P=[];for(let e=0;e<256;++e)P.push((e+256).toString(16).slice(1));function wn(e,t=0){return(P[e[t+0]]+P[e[t+1]]+P[e[t+2]]+P[e[t+3]]+"-"+P[e[t+4]]+P[e[t+5]]+"-"+P[e[t+6]]+P[e[t+7]]+"-"+P[e[t+8]]+P[e[t+9]]+"-"+P[e[t+10]]+P[e[t+11]]+P[e[t+12]]+P[e[t+13]]+P[e[t+14]]+P[e[t+15]]).toLowerCase()}var Ho=new Uint8Array(16);function gr(){return crypto.getRandomValues(Ho)}function Bo(e,t,r){return!t&&!e&&crypto.randomUUID?crypto.randomUUID():$o(e,t,r)}function $o(e,t,r){e=e||{};let n=e.random??e.rng?.()??gr();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 wn(n)}var hr=Bo;var Ve=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=ie.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=ie.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=ie.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=ie.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"}},ie=class{static updates(){return{context:null,updates:[]}}static subscribe(){return{context:null,subscribe:[]}}static unsubscribe(){return{context:null,unsubscribe:[]}}static request(){return{requestId:hr()}}},He=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 oe=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},be=class extends oe{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},Be=class extends oe{constructor(){super()}},$e=class extends oe{sog=0;track=[];constructor(){super()}},xe=class extends oe{constructor(){super()}},We=class extends xe{twd;tws;temperature;constructor(){super()}};var br={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}},ye={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"}},z=class{static transform(t,r,n){if(!Number.isFinite(t))return null;if(r===n)return t;try{return br[r][n](t)}catch{throw new Error("Transformation not found!")}}static setSymbol(t,r){t in ye&&(ye[t].symbol=r??ye[t].symbol)}static getSymbol(t){return t in ye?ye[t].symbol:t}static degreesToRadians(t){return br.deg.radian(t)}static radiansToDegrees(t=0){return br.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 k=xn(ki()),C=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,p=o*Math.cos(u),m=s+p,h=o,b=89*Math.PI/180;m>b&&s<b?(h=o*(b-s)/p,m=b):m<-b&&s>-b&&(h=o*(-b-s)/p,m=-b);let S=Math.log(Math.tan(Math.PI/4+m/2)/Math.tan(Math.PI/4+s/2)),v=Math.abs(S)>1e-12?(m-s)/S:Math.cos(s),O=h*Math.sin(u)/v;return[(a+O)*180/Math.PI,m*180/Math.PI]}static destCoordinate(t,r,n){let i=(0,k.computeDestinationPoint)(t,n,z.radiansToDegrees(r));return[i.longitude,i.latitude]}static distanceTo(t,r){return(0,k.getDistance)(t,r)}static routeLength(t){return(0,k.getPathLength)(t)}static routeLegs(t,r){if(t.length<2)return[];let n=[];r?n.push({bearing:(0,k.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,k.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,k.getGreatCircleBearing)(r,t[o]),a=Fr.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,k.getCenter)(t);return[r.longitude,r.latitude]}static inDLCrossingZone(t,r=170){return Math.abs(t[0])>=r}static inBounds(t,r){return(0,k.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(z.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}},Fr=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 $t=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"}},Wt=class extends Z{constructor(){super(),this.action="resource"}},Gt=class extends Z{constructor(){super(),this.action="radar"}},ae=class extends Z{timed;constructor(){super(),this.action="trail"}};var po=xn(Li());var Yr=2*Math.PI;function ue(e,t){return!Number.isFinite(e)||!Number.isFinite(t)?null:((e+t)%Yr+Yr)%Yr}var Ii="auto",Di=1e4,Iu=.2572,Ci=new Set(["navigation.headingTrue","navigation.headingMagnetic","navigation.courseOverGroundTrue","navigation.courseOverGroundMagnetic","navigation.speedOverGround","navigation.magneticVariation"]);function Ei(e){let t=Date.now();if(e.headingTrue!==null&&t-e.headingTrueUpdatedAt<=Di){e.orientation=e.headingTrue;return}if(e.headingMagnetic!==null&&t-e.headingMagneticUpdatedAt<=Di){e.orientation=ue(e.headingMagnetic,e.magneticVariation)??e.headingMagnetic;return}let r=e.cogTrue??ue(e.cogMagnetic,e.magneticVariation)??e.cogMagnetic;typeof r=="number"&&(e.sog??0)>=Iu&&(e.orientation=r)}var Cu=new Set(["navigation.headingMagnetic","navigation.courseOverGroundMagnetic"]);function Jr(e,t,r){return Cu.has(e)?ue(t,r)??t:t}function qi(e,t){let r=t==="navigation.headingMagnetic"?e.headingMagnetic:t==="navigation.courseOverGroundMagnetic"?e.cogMagnetic:null;return Number.isFinite(r)?Jr(t,r,e.magneticVariation):null}var Zt={api:"none",serverHasTracksApi:!1,v1SelfTrack:!1,v1AisTracks:!1},Eu="PT2H",qu=120,Nu=10,ju=1e3,Yt=12;function Ui(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 en(e){return`${e.replace(/\/v1\/api\/?$/,"")}/v2/api/tracks`}var Ni=async(e,t)=>{try{return(await e(t)).ok}catch{return!1}},ji=async(e,t)=>{try{let r=await e(t);return r.ok?await r.json():void 0}catch{return}};function Ku(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 Fi(e,t){let r=await ji(e,t.features),n=Array.isArray(r?.apis)&&r.apis.includes("tracks");if(n){let s=Ku(await ji(e,t.providers));if(s)return{api:"v2",serverHasTracksApi:n,provider:s,v1SelfTrack:!1,v1AisTracks:!1}}let[i,o]=await Promise.all([Ni(e,t.v1SelfTrack),Ni(e,t.v1Tracks)]);return{api:i||o?"v1":"none",serverHasTracksApi:n,v1SelfTrack:i,v1AisTracks:o}}function zt(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}function Vi(e){return{lastHour:e.lastHour,next23:e.next23==="5s"?"1m":e.next23,beyond24:e.beyond24==="10s"?"5m":e.beyond24}}var Y=36e5,Oe=0,Hi=96;function Bi(e,t,r,n,i){let o=u=>new Date(u).toISOString(),s=n===void 0?{simplify:!0}:{epsilon:n},a=[];return e===Oe||e>24?(a.push({...e===Oe?{}:{from:o(r-e*Y)},to:o(r-24*Y),resolution:zt(t.beyond24),...s,...e===Oe&&i?{bbox:i}:{}}),a.push({from:o(r-24*Y),to:o(r-Y),resolution:zt(t.next23),...s})):e>1&&a.push({from:o(r-e*Y),to:o(r-Y),resolution:zt(t.next23),...s}),a.push({from:o(r-Y),resolution:zt(t.lastHour)}),a}function Xt(e){return Object.entries(e).filter(([,t])=>t!==void 0&&t!=="").map(([t,r])=>`${t}=${encodeURIComponent(String(r))}`).join("&")}function $i(e,t,r){return`${e}?${Xt({context:"self",from:t.from,to:t.to,resolution:t.resolution,epsilon:t.epsilon,simplify:t.simplify?"true":void 0,bbox:t.bbox?.join(","),times:"true",provider:r})}`}var Wi=e=>{let t=e?.features;return Array.isArray(t)?t:[]},Qr=e=>e.geometry?.type==="MultiLineString"&&Array.isArray(e.geometry.coordinates)?e.geometry.coordinates:void 0;function Gi(e){let t=Wi(e).filter(n=>n.properties?.isSelf&&Qr(n));if(t.length===0)return;let r=t[0].properties?.providerId;return t.filter(n=>n.properties?.providerId===r).flatMap(n=>Qr(n))}function zi(e,t){let r=new Map,n=new Map;return Wi(e).forEach(i=>{let o=i.properties?.context,s=Qr(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 Ki(e){let t=((e+180)%360+360)%360-180;return t===-180&&e>0?180:t}function tn(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,p,m]=t,h=Math.round(((r+i)/2-(a+p)/2)/360)*360;if(r=Math.max(r,a+h),i=Math.min(i,p+h),n=Math.max(n,u),o=Math.min(o,m),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(Ki(r)),n,s(Ki(i)),o]}function Xi(e){if(e.showAll){if(!e.view||!(e.view.zoom>=Nu))return null;let n=tn(e.view.extent,e.radiusBox);return n?Xt({bbox:n.join(","),duration:Eu,maxPoints:qu,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:Yt;return Xt({contexts:t.join(","),duration:`PT${r}H`,maxPoints:ju,times:"true",provider:e.provider})}var Zi=.5,Yi=.5;function rn(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 Ji(e,t){if(!e||Math.floor(e.zoom)!==Math.floor(t.zoom))return!0;let[r,n,i,o]=t.extent,[s,a,u,p]=e.extent;return r<s||n<a||i>u||o>p}function nn(){let e=0;return{begin:()=>++e,invalidate:()=>{e++},isCurrent:t=>t===e}}var on=6378137,eo=2*Math.PI*on/256;function Qi(e){let t=Math.max(-85,Math.min(85,e));return on*Math.log(Math.tan(Math.PI/4+t*Math.PI/360))}function to(e,t){let r=(Qi(e)+Qi(t))/2/on;return(2*Math.atan(Math.exp(r))-Math.PI/2)*180/Math.PI}var sn=6e4,an=60*sn,ro=24*an;function io(e,t){if(!Number.isFinite(e)||!Array.isArray(t)||t.length!==4)return null;let r=to(t[1],t[3]);if(!Number.isFinite(r))return null;let n=Math.floor(e)+1,i=eo/Math.pow(2,n)*Math.cos(r*Math.PI/180),o=Number(i.toPrecision(3));return o>0?o:null}var oo=e=>{let t=e?.features;return Array.isArray(t)?t:[]},Uu=(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 un(e,t,r){let n=[],i=[],o=!0,s,a;if(Uu(oo(t),r).forEach(u=>{typeof u.properties?.resolution=="string"&&(s=u.properties.resolution),typeof u.properties?.epsilon=="number"&&(a=Math.max(a??0,u.properties.epsilon));let p=u.geometry?.type==="MultiLineString"&&Array.isArray(u.geometry.coordinates)?u.geometry.coordinates:[],m=u.properties?.coordTimes;p.forEach((h,b)=>{if(!Array.isArray(h)||h.length===0)return;n.push(h);let S=Array.isArray(m)?m[b]:void 0;Array.isArray(S)&&S.length===h.length?i.push(S):o=!1})}),n.length!==0)return{context:e,lines:n,...o&&{times:i},...s!==void 0&&{resolution:s},...a!==void 0&&{epsilon:a}}}function so(e,t){let r=new Map;oo(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=un(o,{features:i},t);s?.times&&n.set(o,{lines:s.lines,times:s.times})}),n}var Sd=[5*sn,15*sn,an,6*an,ro,7*ro];var no=e=>e?Date.parse(e):NaN;var Fu=10*6e4;function ao(e,t){let r=[...e.lines],n=[...e.times];return t.lines.forEach((i,o)=>{let s=n[n.length-1],a=s?no(t.times[o][0])-no(s[s.length-1]):NaN;o===0&&a>=0&&a<=Fu?(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 Vu=["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,Qt,Le=[],er=[],ln=!1,Q,fe=Zt,go=Promise.resolve(Zt),U=null,ho=null,bo=[],tr=!1,cn=Yt,uo,Hu=1e3,de=new Set,Ie=nn(),$=nn(),Bu=5e3,x={signalk:{},aisState:[]},xo=[0,0,0,0],yo=60,Re=0,A,ce={},J=500,T=!1,vo,K={maxAge:54e4,staleAge:36e4,lastTick:new Date().valueOf(),maxTrack:20},fn={selfLines:{cog:{length:10}},aisCogLine:10},me={trailDuration:24,trailResolution:{lastHour:"5s",next23:"10s",beyond24:"1m"}},V,_o,le="freeboard-sk";function $u(){l={self:new be,aisTargets:new Map,aisStatus:{updated:[],stale:[],expired:[]},paths:{},atons:new Map,aircraft:new Map,sar:new Map,meteo:new Map},l.self.positionReceived=!1,de.clear(),Ie.invalidate(),Mo()}function Mo(){A={updated:{},stale:{},expired:{}}}function Jt({action:e,msg:t}){switch(e){case"onConnect":postMessage({action:"open",playback:T,result:t.target.readyState}),Gu(),y.msgCount=0,y.intervalCount=0,y.alarm=!1,y.active=!0;break;case"onClose":So(!1),lo();break;case"onError":postMessage({action:"error",playback:T,result:"Connection error!"}),lo();break;case"onMessage":y.msgCount++,nl(t);break}}function lo(){y.msgCount=0,y.intervalCount=0,y.active=!0,y.alarm=!0,nr(!0)}addEventListener("message",({data:e})=>{Wu(e)});function Wu(e){if(e.cmd)switch(e.cmd){case"open":co(e.options),tl(e.options);break;case"close":So(!0);break;case"subscribe":M.subscribe(e.options.context,e.options.path);break;case"settings":co(e.options);break;case"alarm":rl(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"&&(Qt=e.options.token);break;case"trail":e.options&&(me.trailDuration=e.options.trailDuration??24,e.options.trailResolution&&(me.trailResolution.lastHour=e.options.trailResolution.lastHour??"5s",me.trailResolution.next23=e.options.trailResolution.next23??"5s",me.trailResolution.beyond24=e.options.trailResolution.beyond24??"10s")),zu();break;case"view":e.options?.extent&&(U={extent:e.options.extent,zoom:e.options.zoom},tr&&Ji(ho,U)&&rr());break;case"trackSelection":bo=Array.isArray(e.options?.ids)?e.options.ids:[],rr();break}}function co(e={}){if(e.interval&&typeof e.interval=="number"&&(J=e.interval,Oo(),ko(),yo=1/(J/1e3)*60),T=!!e.playback,e.config){typeof e.config.units.preferredPaths<"u"&&(ce=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"&&(x.signalk=e.config.signalk),typeof e.config.selections.aisState<"u"&&Array.isArray(e.config.selections.aisState)&&(x.aisState=e.config.selections.aisState),fn=e.config.vessels,e.config.vessels.aisShowTrack!==tr&&(tr=e.config.vessels.aisShowTrack,rr());let t=e.config.vessels.aisTrackLength??Yt;t!==cn&&(cn=t,rr())}}function So(e=!1){Oo(),Le.forEach(t=>t.unsubscribe()),M&&e&&M.close(),M=null,postMessage({action:"close",result:e,playback:T})}function De(e){return fetch(e).then(t=>t.json())}function Po(e){return fetch(e,Qt?{headers:{Authorization:`Bearer ${Qt}`}}:void 0)}function To(e){return Po(e).then(t=>{if(!t.ok)throw new Error(`${t.status}`);return t.json()})}function Gu(){Q&&(go=Fi(Po,Ui(Q)).catch(()=>Zt).then(e=>(fe=e,postMessage({action:"trackSource",playback:T,result:e}),dn(),e)))}function zu(){let e=$.begin();go.then(t=>{if(t.api==="v2")Xu(en(Q),me,t.provider,e);else if(t.api==="v1"&&t.v1SelfTrack)el(me,e);else if($.isCurrent(e)){let r=new ae;r.playback=T,r.result=null,postMessage(r)}})}function Xu(e,t,r,n=$.begin()){let i=(U&&io(U.zoom,U.extent))??void 0,o=(U&&tn(rn(U.extent,Yi)))??void 0,s=Bi(t.trailDuration,t.trailResolution,Date.now(),i,o),a=new ae;a.playback=T,Promise.all(s.map(u=>To($i(e,u,r)))).then(u=>{$.isCurrent(n)&&(a.result=Ao(u.map(p=>Gi(p)??null),s.map(p=>p.epsilon!==void 0||p.simplify===!0)),a.timed=Zu(u,r),postMessage(a))}).catch(()=>{$.isCurrent(n)&&(a.result=null,postMessage(a))})}function Zu(e,t){let r={lines:[],times:[]};for(let n of e){let i=un("self",n,t);if(i&&!i.times)return;i&&(r=ao(r,{lines:i.lines,times:i.times}))}return r.lines.length?r:void 0}function rr(){Ie.invalidate(),clearTimeout(uo),uo=setTimeout(()=>{fe.api==="v2"&&dn()},Hu)}function dn(){T||!l||(fe.api==="v2"?Yu(fe.provider):fe.api==="v1"&&fe.v1AisTracks&&Qu())}function Yu(e){let t=U&&{extent:rn(U.extent,Zi),zoom:U.zoom};ho=t;let r=Xi({view:t,showAll:tr,picks:bo,targets:l.aisTargets,radiusBox:x.signalk.maxRadius&&l.self.positionReceived?C.calcMapifiedExtent(l.self.position,x.signalk.maxRadius):void 0,pickHours:cn,provider:e});if(!r){Ie.invalidate();return}let n=Ie.begin();To(`${en(Q)}?${r}`).then(i=>{Ie.isCurrent(n)&&!T&&(Ju(l.aisTargets,zi(i,e)),postMessage({action:"aisTracksTimed",playback:T,result:so(i,e)}))}).catch(()=>{})}function Ju(e,t){let r=[...de];de.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,de.add(i),ir(o))}),r.filter(n=>!de.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 Qu(){let e=x&&x.signalk&&x.signalk.maxRadius?`?radius=${x.signalk.maxRadius}`:"?radius=10000";De(Q+"/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,ir(n)}})}).catch(()=>{})}function el(e,t=$.begin()){let r=Q+"/self/track?",n=Vi(e.trailResolution),i=e.trailDuration===Oe?Hi:e.trailDuration,o=[];i>24&&(o.push(De(`${r}timespan=${i-24}h&resolution=${n.beyond24}&timespanOffset=24`)),o.push(De(`${r}timespan=23h&resolution=${n.next23}&timespanOffset=1`))),i>1&&i<25&&o.push(De(`${r}timespan=${i-1}h&resolution=${n.next23}&timespanOffset=1`)),o.push(De(`${r}timespan=1h&resolution=${n.lastHour}`));let s=new ae;s.playback=T,Promise.all(o).then(a=>{$.isCurrent(t)&&(s.result=Ao(a.map(u=>u?.type==="MultiLineString"&&Array.isArray(u.coordinates)?u.coordinates:null)),postMessage(s))}).catch(()=>{$.isCurrent(t)&&(s.result=null,postMessage(s))})}function Ao(e,t=[]){let o=e.length-1,s=[];return e.forEach((a,u)=>{a&&(u!==o?a.forEach(p=>{let m=t[u]?p:(0,po.SimplifyAP)(p,5e-4,!0);for(;m.length>60;){let h=m.slice(0,60);s.push(h),m=m.slice(59),m[0]=[m[0][0]+5e-9,m[0][1]+5e-9]}m.length!==0&&s.push(m)}):s=s.concat(a))}),s}function tl(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:",Q=t.join("/"),$u(),M=new Ve,Le.push(M.onConnect.subscribe(r=>Jt({action:"onConnect",msg:r}))),Le.push(M.onClose.subscribe(r=>Jt({action:"onClose",msg:r}))),Le.push(M.onError.subscribe(r=>Jt({action:"onError",msg:r}))),Le.push(M.onMessage.subscribe(r=>Jt({action:"onMessage",msg:r}))),M.authToken=Qt,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 rl(e){let t=e.type.indexOf("notifications.")===-1?`notifications.${e.type}`:e.type;e.raise?M.raiseAlarm("self",t,new He(e.message,e.state,!0,!0)):M.clearAlarm("self",t)}function nl(e){M.isHello(e)?(postMessage({action:"hello",result:e,self:e.self,playback:T}),J&&ko()):M.isDelta(e)?(ln=!0,e.updates.forEach(t=>{!("values"in t)||!t.values||(V=t.$source,_o=t.timestamp,t.values.forEach(r=>{if(vo=t.timestamp,!!e.context)switch(e.context.split(".")[0]){case"shore":case"atons":x?.signalk.atons&&ul(e.context,r),we(e.context,l.atons,x?.signalk.atons);break;case"sar":x?.signalk.sar&&ll(e.context,r),we(e.context,l.sar,x?.signalk.sar);break;case"aircraft":x?.signalk.aircraft&&fl(e.context,r),we(e.context,l.aircraft,x?.signalk.aircraft);break;case"meteo":x?.signalk.meteo&&(cl(e.context,r),mo(r)),we(e.context,l.meteo,x?.signalk.meteo);break;case"vessels":if(M.isSelf(e))l.self.id||(l.self.id=e.context),fo(l.self,r,!0),mo(r);else{if(x?.signalk.vessels){let n=il(e.context);fo(n,r)}we(e.context,l.aisTargets,x?.signalk.vessels,x?.aisState)}break}}))}),nr()):M.isResponse(e)&&postMessage({action:"response",result:e})}function we(e,t,r=!0,n=[]){if(r){let i=t.get(e);i&&n.includes(i?.state)&&(A.expired[e]=!0,i=null),i&&x.signalk.maxRadius?i.positionReceived&&C.inBounds(i.position,xo)?A.updated[e]=!0:(t.delete(e),A.expired[e]=!0):A.updated[e]=!0}else t.size!==0&&(t.forEach((i,o)=>{A.expired[o]=!0}),t.clear())}function nr(e=!1){if(!J||e){let t=new Z;t.watchDogAlarm=y.alarm,t.playback=T,l.aisStatus.updated=Object.keys(A.updated),l.aisStatus.stale=Object.keys(A.stale),l.aisStatus.expired=Object.keys(A.expired),t.result=l,t.timestamp=T?vo:l.self.lastUpdated.toISOString(),postMessage(t),Mo(),l.self.resourceUpdates=[],al(),Re===0&&l.self.positionReceived&&x?.signalk.maxRadius&&(xo=C.calcMapifiedExtent(l.self.position,x.signalk.maxRadius),Re++),Re=Re>=yo?0:Re+1}}function ko(){J&&typeof J=="number"&&er.push(setInterval(()=>{y.active&&!y.msgCount?(y.intervalCount=y.intervalCount+1,y.intervalCount>=y.maxMsgIntervals&&(y.intervalCount=0,y.alarm=!0,nr(!0))):(y.intervalCount=0,y.msgCount=0,y.alarm=!1),ln&&(nr(!0),ln=!1)},J)),er.push(setInterval(()=>dn(),6e4))}function Oo(){er.forEach(e=>clearInterval(e)),er=[]}function il(e){if(!l.aisTargets.has(e)){let t=new be;t.id=e,t.position=null,l.aisTargets.set(e,t)}return l.aisTargets.get(e)}function fo(e,t,r=!1){let n=t.value;if(r){if(e.lastUpdated=new Date,t.path.startsWith("resources."))e.resourceUpdates.push(t),sl(t);else if(t.path.startsWith("radars"))ol(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;Vu.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=C.normaliseCoords([n.longitude,n.latitude]),e.positionReceived=!0,e.positionTimestamp=_o??"",e.positionUpdatedAt=Date.now(),e.lastUpdated=new Date,r||ir(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===le?e.autopilot.state=n:t.path==="steering.autopilot.mode"&&V===le?e.autopilot.mode=n:t.path==="steering.autopilot.target"&&V===le?e.autopilot.target=n:t.path==="steering.autopilot.engaged"&&V===le?e.autopilot.enabled=n:t.path==="steering.autopilot.defaultPilot"?(e.autopilot.default=n,le=n):t.path==="steering.autopilot.availableActions"&&V===le?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=ce.heading;typeof i>"u"||i===Ii?Ci.has(t.path)&&Ei(e):t.path===i?e.orientation=Jr(t.path,n,e.magneticVariation):t.path==="navigation.magneticVariation"&&(e.orientation=qi(e,i)??e.orientation),typeof ce.tws<"u"&&t.path===ce.tws&&(e.wind.tws=n),typeof ce.twd<"u"&&t.path===ce.twd&&(e.wind.direction=t.path==="environment.wind.angleTrueGround"||t.path==="environment.wind.angleTrueWater"?z.angleToDirection(n,e.orientation??0):n);let o=e.cogTrue??ue(e.cogMagnetic,e.magneticVariation)??e.cogMagnetic??void 0;if(typeof o<"u"&&e.position){let s=r?fn.selfLines.cog.length:fn.aisCogLine,a=(e.sog??0)*(s*60);e.vectors.cog=[e.position,C.rhumbDestination(e.position,o,a)]}}function ol(e){let t=new Gt;t.playback=T,t.result={path:e.path,value:e.value,sourceRef:V},postMessage(t)}function sl(e){let t=new Wt;t.playback=T,t.result={path:e.path,value:e.value,sourceRef:V},postMessage(t)}function mo(e){if(e.path.includes("notifications.")){let t=new $t;t.playback=T,t.result={path:e.path,value:e.value,sourceRef:V},postMessage(t)}}function al(){let e=new Date().valueOf();l.aisTargets.forEach((t,r)=>{t.lastUpdated.valueOf()<e-K.maxAge?(A.expired[r]=!0,l.aisTargets.delete(r)):t.lastUpdated.valueOf()<e-K.staleAge&&(A.stale[r]=!0)}),l.aircraft.forEach((t,r)=>{t.lastUpdated.valueOf()<e-K.maxAge?(A.expired[r]=!0,l.aircraft.delete(r)):t.lastUpdated.valueOf()<e-K.staleAge&&(A.stale[r]=!0)}),l.sar.forEach((t,r)=>{t.lastUpdated.valueOf()<e-K.maxAge?(A.expired[r]=!0,l.sar.delete(r)):t.lastUpdated.valueOf()<e-K.staleAge&&(A.stale[r]=!0)})}function ul(e,t){let r=!1;if(e.indexOf("shore.basestations")!==-1&&(r=!0),!l.atons.has(e)){let i=new xe;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 ll(e,t){if(!l.sar.has(e)){let n=new Be;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=C.normaliseCoords([t.value.longitude,t.value.latitude]),r.positionReceived=!0)}function cl(e,t){if(!l.meteo.has(e)){let n=new We;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=C.normaliseCoords([t.value.longitude,t.value.latitude]),r.positionReceived=!0)}function fl(e,t){if(!l.aircraft.has(e)){let n=new $e;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=C.normaliseCoords([t.value.longitude,t.value.latitude]),r.positionReceived=!0,ir(r)):t.path==="navigation.courseOverGroundTrue"?r.orientation=t.value:t.path==="navigation.speedOverGround"&&(r.sog=t.value)}function ir(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-(de.has(e.id)?Bu:K.maxTrack))}export{De as apiGet,Ju as applyServerAisTracks,Ao as assembleTrail,el as getVesselTrail,Xu as getVesselTrailV2,Jt as handleStreamEvent,$u as initVessels,fo as processVessel,Zu as timedTrail,Po as trackFetch};